text:
<?php

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly
}

/**
 * Class Hugeit_Lightbox_Model
 */
class Hugeit_Lightbox_Model {

	public function save() {
		if ( isset( $_POST['params'] ) ) {
			foreach ( $_POST['params'] as $name => $value ) {
				update_option( $name, wp_unslash( sanitize_text_field( $value ) ) );
			}
			?>

<?php _e( 'Item Saved' ); ?>

			<?php
		}
	}

	/**
	 * Lightbox default options
	 *
	 * @return array
	 */
	public function default_options() {
		$optons = array(
			'hugeit_lightbox_size'                   => '17',
			'hugeit_lightbox_width'                  => '500',
			'hugeit_lightbox_href'                   => 'False',
			'hugeit_lightbox_scalephotos'            => 'true',
			'hugeit_lightbox_rel'                    => 'false',
			'hugeit_lightbox_scrolling'              => 'false',
			'hugeit_lightbox_opacity'                => '20',
			'hugeit_lightbox_open'                   => 'false',
			'hugeit_lightbox_overlayclose'           => 'true',
			'hugeit_lightbox_esckey'                 => 'false',
			'hugeit_lightbox_arrowkey'               => 'false',
			'hugeit_lightbox_loop'                   => 'true',
			'hugeit_lightbox_data'                   => 'false',
			'hugeit_lightbox_classname'              => 'false',
			'hugeit_lightbox_closebutton'            => 'true',
			'hugeit_lightbox_current'                => 'image',
			'hugeit_lightbox_previous'               => 'previous',
			'hugeit_lightbox_next'                   => 'next',
			'hugeit_lightbox_close'                  => 'close',
			'hugeit_lightbox_iframe'                 => 'false',
			'hugeit_lightbox_inline'                 => 'false',
			'hugeit_lightbox_html'                   => 'false',
			'hugeit_lightbox_photo'                  => 'false',
			'hugeit_lightbox_height'                 => '500',
			'hugeit_lightbox_innerwidth'             => 'false',
			'hugeit_lightbox_innerheight'            => 'false',
			'hugeit_lightbox_initialwidth'           => '300',
			'hugeit_lightbox_initialheight'          => '100',
			'hugeit_lightbox_maxwidth'               => '768',
			'hugeit_lightbox_maxheight'              => '500',
			'hugeit_lightbox_slideshow'              => 'false',
			'hugeit_lightbox_slideshowspeed'         => '2500',
			'hugeit_lightbox_slideshowauto'          => 'true',
			'hugeit_lightbox_slideshowstart'         => 'start slideshow',
			'hugeit_lightbox_slideshowstop'          => 'stop slideshow',
			'hugeit_lightbox_fixed'                  => 'true',
			'hugeit_lightbox_top'                    => 'false',
			'hugeit_lightbox_bottom'                 => 'false',
			'hugeit_lightbox_left'                   => 'false',
			'hugeit_lightbox_right'                  => 'false',
			'hugeit_lightbox_reposition'             => 'false',
			'hugeit_lightbox_retinaimage'            => 'true',
			'hugeit_lightbox_retinaurl'              => 'false',
			'hugeit_lightbox_retinasuffix'           => '@2x.$1',
			'hugeit_lightbox_returnfocus'            => 'true',
			'hugeit_lightbox_trapfocus'              => 'true',
			'hugeit_lightbox_fastiframe'             => 'true',
			'hugeit_lightbox_preloading'             => 'true',
			'hugeit_lightbox_title_position'         => '5',
			'hugeit_lightbox_size_fix'               => 'false',
			'hugeit_lightbox_watermark_width'        => '30',
			'hugeit_lightbox_watermark_position'     => '3',
			'hugeit_lightbox_watermark_img_src'      => hugeit_lightbox_plugins_url() . '/images/No-image-found.jpg',
			'hugeit_lightbox_watermark_transparency' => '100',
			'hugeit_lightbox_watermark_image'        => 'false'
		);

		return $optons;
	}

	/**
	 * Lightbox general options
	 *
	 * @return array
	 */
	public function general_options() {
		$optons = array(
			'hugeit_lightbox_style'      => '1',
			'hugeit_lightbox_transition' => 'elastic',
			'hugeit_lightbox_speed'      => '800',
			'hugeit_lightbox_fadeout'    => '300',
			'hugeit_lightbox_title'      => 'false',
			'hugeit_lightbox_type'       => 'old_type'
		);

		return $optons;
	}

	/**
	 * Responsive Lightbox default options
	 *
	 * @return array
	 */
	public function default_resp_options() {
		$options = array(
			'hugeit_lightbox_slideAnimationType'            => 'effect_1',
			'hugeit_lightbox_overlayDuration'               => '150',
			'hugeit_lightbox_escKey_new'                    => 'false',
			'hugeit_lightbox_keyPress_new'                  => 'false',
			'hugeit_lightbox_arrows'                        => 'true',
			'hugeit_lightbox_mouseWheel'                    => 'false',
			'hugeit_lightbox_download'                      => 'false',
			'hugeit_lightbox_showCounter'                   => 'false',
			'hugeit_lightbox_nextHtml'                      => '',     //not used
			'hugeit_lightbox_prevHtml'                      => '',     //not used
			'hugeit_lightbox_sequence_info'                 => 'image',
			'hugeit_lightbox_sequenceInfo'                  => 'of',
			'hugeit_lightbox_width_new'                     => '100',
			'hugeit_lightbox_height_new'                    => '100',
			'hugeit_lightbox_videoMaxWidth'                 => '790',
			'hugeit_lightbox_slideshow_new'                 => 'false',
			'hugeit_lightbox_slideshow_auto_new'            => 'false',
			'hugeit_lightbox_slideshow_speed_new'           => '2500',
			'hugeit_lightbox_slideshow_start_new'           => '',     //not used
			'hugeit_lightbox_slideshow_stop_new'            => '',     //not used
			'hugeit_lightbox_watermark'                     => 'false',
			'hugeit_lightbox_socialSharing'                 => 'false',
			'hugeit_lightbox_facebookButton'                => 'false',
			'hugeit_lightbox_twitterButton'                 => 'false',
			'hugeit_lightbox_googleplusButton'              => 'false',
			'hugeit_lightbox_pinterestButton'               => 'false',
			'hugeit_lightbox_linkedinButton'                => 'false',
			'hugeit_lightbox_tumblrButton'                  => 'false',
			'hugeit_lightbox_redditButton'                  => 'false',
			'hugeit_lightbox_bufferButton'                  => 'false',
			'hugeit_lightbox_diggButton'                    => 'false',
			'hugeit_lightbox_vkButton'                      => 'false',
			'hugeit_lightbox_yummlyButton'                  => 'false',
			'hugeit_lightbox_watermark_text'                => 'WaterMark',
			'hugeit_lightbox_watermark_textColor'           => 'ffffff',
			'hugeit_lightbox_watermark_textFontSize'        => '30',
			'hugeit_lightbox_watermark_containerBackground' => '000000',
			'hugeit_lightbox_watermark_containerOpacity'    => '90',
			'hugeit_lightbox_watermark_containerWidth'      => '300',
			'hugeit_lightbox_watermark_position_new'        => '9',
			'hugeit_lightbox_watermark_opacity'             => '70',
			'hugeit_lightbox_watermark_margin'              => '10',
			'hugeit_lightbox_watermark_img_src_new'         => hugeit_lightbox_plugins_url() . '/images/No-image-found.jpg'
		);

		return $options;
	}

	/**
	 * Responsive Lightbox default options
	 *
	 * @return array
	 */
	public function general_resp_options() {
		$options = array(
			'hugeit_lightbox_lightboxView'                  => 'view1',
			'hugeit_lightbox_speed_new'                     => '600',
			'hugeit_lightbox_overlayClose_new'              => 'true',
			'hugeit_lightbox_loop_new'                      => 'true',
			'hugeit_lightbox_fullwidth_effect'              => 'false',
			'hugeit_lightbox_thumbs'     					=> 'false',
			'hugeit_lightbox_showTitle'                		=> 'true',
			'hugeit_lightbox_showDesc'               		=> 'false',
			'hugeit_lightbox_showBorder'               		=> 'false',
			'hugeit_lightbox_imageframe'                    => 'frame_0'
		);
		return $options;
	}

	function lightbox_get_option() {
		$lightbox_options    = $this->general_options();
		$lightbox_get_option = array();
		foreach ( $lightbox_options as $name => $value ) {
			$lightbox_get_option[ $name ] = get_option( $name );
		}

		return $lightbox_get_option;
	}

	function lightbox_get_resp_option() {
		$lightbox_options         = $this->general_resp_options();
		$lightbox_get_resp_option = array();
		foreach ( $lightbox_options as $name => $value ) {
			$lightbox_get_resp_option[ $name ] = get_option( $name );
		}

		return $lightbox_get_resp_option;
	}

}


text:
import requests
from os import path

SERVER_URL = "http://localhost:3000"

def post(route, data):
    r = requests.post(path.join(SERVER_URL, route), data=data)
    try:
        return r.json()
    except ValueError, e:
        return {"error": r.text}

redpajama_set_name: RedPajamaGithub


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spark.Compiler.ChunkVisitors;
using Spark.Parser.Code;

namespace Spark.Compiler.Javascript.ChunkVisitors
{
    public class JavascriptGeneratedCodeVisitor : GeneratedCodeVisitorBase
    {
        private readonly StringBuilder _source;

        public JavascriptGeneratedCodeVisitor(StringBuilder source)
        {
            _source = source;
        }

        protected override void Visit(SendLiteralChunk chunk)
        {
            if (string.IsNullOrEmpty(chunk.Text))
                return;

            var text =
                chunk.Text.Replace("\\", "\\\\").Replace("\t", "\\t").Replace("\r", "\\r").Replace("\n", "\\n").Replace(
                    "\"", "\\\"");
            _source.Append("Output.Write(\"").Append(text).AppendLine("\");");
        }

        protected override void Visit(SendExpressionChunk chunk)
        {
            if (chunk.SilentNulls)
                _source.Append("if(typeof(")
                       .Append(chunk.Code)
                       .Append(") != 'undefined') ");

            _source.Append("Output.Write(").Append(chunk.Code).AppendLine(");");
        }

        protected override void Visit(CodeStatementChunk chunk)
        {
            _source.Append(chunk.Code);
        }

        protected override void Visit(MacroChunk chunk)
        {
            // Must not do anything here. Macro is written out in PreRender.
        }

        protected override void Visit(LocalVariableChunk chunk)
        {
            if (Snippets.IsNullOrEmpty(chunk.Value))
            {
                _source.Append("var ").Append(chunk.Name).AppendLine(" = null;");
            }
            else
            {
                _source.Append("var ").Append(chunk.Name).Append(" = ").Append(chunk.Value).AppendLine(";");
            }
        }

        protected override void Visit(AssignVariableChunk chunk)
        {
            _source.Append(chunk.Name).Append(" = ").Append(chunk.Value).AppendLine(";");
        }

        protected override void Visit(ConditionalChunk chunk)
        {
            switch (chunk.Type)
            {
                case ConditionalType.If:
                    {
                        _source.Append("if (").Append(chunk.Condition).AppendLine(") {");
                        Accept(chunk.Body);
                        _source.AppendLine("}");
                    }
                    break;
                case ConditionalType.ElseIf:
                    {
                        _source.Append("else if (").Append(chunk.Condition).AppendLine(") {");
                        Accept(chunk.Body);
                        _source.AppendLine("}");
                    }
                    break;
                case ConditionalType.Else:
                    {
                        _source.AppendLine("else {");
                        Accept(chunk.Body);
                        _source.AppendLine("}");
                    }
                    break;
                case ConditionalType.Unless:
                    {
                        _source.Append("if (!(").Append(chunk.Condition).AppendLine(")) {");
                        Accept(chunk.Body);
                        _source.AppendLine("}");
                    }
                    break;
            }
        }

        protected override void Visit(ForEachChunk chunk)
        {
            var inspector = new ForEachInspector(chunk.Code);
            if (inspector.Recognized)
            {
                var detect = new DetectCodeExpressionVisitor(OuterPartial);
                var autoIndex = detect.Add(inspector.VariableName + "Index");
                var autoCount = detect.Add(inspector.VariableName + "Count");
                var autoIsFirst = detect.Add(inspector.VariableName + "IsFirst");
                var autoIsLast = detect.Add(inspector.VariableName + "IsLast");
                detect.Accept(chunk.Body);
                if (autoIsLast.Detected)
                {
                    autoIndex.Detected = true;
                    autoCount.Detected = true;
                }

            	string iteratorName = "__iter__" + inspector.VariableName;

                if (autoCount.Detected)
                {
                    // var itemCount=0;for(var __iter__item in coll){if(typeof(__iter__item)!='function'){++itemCount;}}
                    _source
                        .Append("var ")
                        .Append(inspector.VariableName)
                        .Append("Count=0;for(var ")
                        .Append(iteratorName)
                        .Append(" in ")
                        .Append(inspector.CollectionCode)
                        .Append("){ if(typeof(")
						.Append(inspector.CollectionCode)
						.Append("[")
						.Append(iteratorName)
						.Append("])!='function') {")
						.Append("++")
                        .Append(inspector.VariableName)
                        .Append("Count;}}");
                }

                if (autoIndex.Detected)
                {
                    // var itemIndex=0;
                    _source.Append("var ").Append(inspector.VariableName).Append("Index=0;");
                }

                if (autoIsFirst.Detected)
                {
                    // var itemIsFirst=true;
                    _source.Append("var ").Append(inspector.VariableName).Append("IsFirst=true;");
                }

                // for(var __iter__item in coll) {
                _source
                    .Append("for (var ")
                    .Append(iteratorName)
                    .Append(" in ")
                    .Append(inspector.CollectionCode)
                    .Append(") {");

                // var item=coll[__iter__item];
                _source
                    .Append("var ")
                    .Append(inspector.VariableName)
                    .Append("=")
                    .Append(inspector.CollectionCode)
                    .Append("[__iter__")
                    .Append(inspector.VariableName)
                    .Append("];");

            	// if(typeof(item)!='function') {
				_source.Append("if(typeof(")
					.Append(inspector.VariableName)
					.Append(")!='function') {");

                if (autoIsLast.Detected)
                {
                    // var itemIsLast=(itemIndex==itemCount-1);
                    _source
                        .Append("var ")
                        .Append(inspector.VariableName)
                        .Append("IsLast=(")
                        .Append(inspector.VariableName)
                        .Append("Index==")
                        .Append(inspector.VariableName)
                        .Append("Count-1);");
                }

                _source.AppendLine();

                Accept(chunk.Body);

                if (autoIsFirst.Detected)
                {
                    // itemIsFirst=false;
                    _source.Append(inspector.VariableName).Append("IsFirst=false;");
                }

                if (autoIndex.Detected)
                {
                    // ++itemIndex;
                    _source.Append("++").Append(inspector.VariableName).Append("Index;");
                }

                _source.AppendLine("}}");
            }
            else
            {
                _source.Append("for (").Append(chunk.Code).AppendLine(") {");
                Accept(chunk.Body);
                _source.Append("}");
            }
        }

        protected override void Visit(ScopeChunk chunk)
        {
            _source.AppendLine("{");
            base.Visit(chunk);
            _source.AppendLine("}");
        }

        protected override void Visit(ContentChunk chunk)
        {
            _source.Append("OutputScope('").Append(chunk.Name).AppendLine("'); {");
            Accept(chunk.Body);
            _source.AppendLine("} DisposeOutputScope();");
        }

        protected override void Visit(UseContentChunk chunk)
        {
            _source.Append("if (Content['").Append(chunk.Name).AppendLine("']) {");
            _source.Append("Output.Write(Content['").Append(chunk.Name).AppendLine("']);}");
            if (chunk.Default.Count != 0)
            {
                _source.AppendLine("else {");
                Accept(chunk.Default);
                _source.AppendLine("}");
            }
        }

        protected override void Visit(ContentSetChunk chunk)
        {
            _source.AppendLine("OutputScope(new StringWriter()); {");
            Accept(chunk.Body);
            switch (chunk.AddType)
            {
                case ContentAddType.AppendAfter:
                    //format = "{0} = {0} + Output.ToString();";
                    _source
                        .Append(chunk.Variable)
                        .Append(" = ")
                        .Append(chunk.Variable)
                        .AppendLine(" + Output.toString();");
                    break;
                case ContentAddType.InsertBefore:
                    //format = "{0} = Output.ToString() + {0};";
                    _source
                        .Append(chunk.Variable)
                        .Append(" = Output.toString() + ")
                        .Append(chunk.Variable)
                        .AppendLine(";");
                    break;
                default:
                    //format = "{0} = Output.ToString();";
                     _source
                        .Append(chunk.Variable)
                        .Append(" = Output.toString();");
                    break;
            }

            _source.AppendLine("DisposeOutputScope();}");
        }

    }
}


text:
<?php

namespace Drupal\Core\Database\Driver\pgsql;

use Drupal\pgsql\Driver\Database\pgsql\Truncate as PgsqlTruncate;

@trigger_error('\Drupal\Core\Database\Driver\pgsql\Truncate is deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL database driver has been moved to the pgsql module. See https://www.drupal.org/node/3129492', E_USER_DEPRECATED);

/**
 * PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate.
 *
 * @deprecated in drupal:9.4.0 and is removed from drupal:11.0.0. The PostgreSQL
 *   database driver has been moved to the pgsql module.
 *
 * @see https://www.drupal.org/node/3129492
 */
class Truncate extends PgsqlTruncate {}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>Uses of Interface org.apache.poi.hwpf.model.CharIndexTranslator (POI API Documentation)</title>
<link rel="stylesheet" type="text/css" href="../../../../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

Uses of Interface
org.apache.poi.hwpf.model.CharIndexTranslator

Packages that use CharIndexTranslator

Package
Description

org.apache.poi.hwpf.model

Uses of CharIndexTranslator in org.apache.poi.hwpf.model

Classes in org.apache.poi.hwpf.model that implement CharIndexTranslator

Modifier and Type
Class and Description

class
TextPieceTable

The piece table for matching up character positions to bits of text.

Methods in org.apache.poi.hwpf.model with parameters of type CharIndexTranslator

Modifier and Type
Method and Description

protected byte[]
CHPFormattedDiskPage.toByteArray(CharIndexTranslator translator)

protected byte[]
CHPFormattedDiskPage.toByteArray(CharIndexTranslator translator,
           int fcMin)

Deprecated.

Use CHPFormattedDiskPage.toByteArray(CharIndexTranslator) instead

protected byte[]
PAPFormattedDiskPage.toByteArray(HWPFOutputStream dataStream,
           CharIndexTranslator translator)

Creates a byte array representation of this data structure.

void
PAPBinTable.writeTo(HWPFFileSystem sys,
       CharIndexTranslator translator)

Deprecated.

void
CHPBinTable.writeTo(HWPFFileSystem sys,
       int fcMin,
       CharIndexTranslator translator)

Deprecated.

void
PAPBinTable.writeTo(HWPFOutputStream wordDocumentStream,
       HWPFOutputStream tableStream,
       CharIndexTranslator translator)

void
CHPBinTable.writeTo(HWPFOutputStream wordDocumentStream,
       HWPFOutputStream tableStream,
       int fcMin,
       CharIndexTranslator translator)

Constructors in org.apache.poi.hwpf.model with parameters of type CharIndexTranslator

Constructor and Description

BytePropertyNode(int fcStart,
                int fcEnd,
                CharIndexTranslator translator,
                java.lang.Object buf)

Deprecated.

CHPBinTable(byte[] documentStream,
           byte[] tableStream,
           int offset,
           int size,
           CharIndexTranslator translator)

Constructor used to read a binTable in from a Word document.

CHPFormattedDiskPage(byte[] documentStream,
                    int offset,
                    CharIndexTranslator translator)

This constructs a CHPFormattedDiskPage from a raw fkp (512 byte array
 read from a Word file).

CHPX(int fcStart,
    int fcEnd,
    CharIndexTranslator translator,
    byte[] grpprl)

Deprecated.

CHPX(int fcStart,
    int fcEnd,
    CharIndexTranslator translator,
    SprmBuffer buf)

Deprecated.

PAPBinTable(byte[] documentStream,
           byte[] tableStream,
           byte[] dataStream,
           int offset,
           int size,
           CharIndexTranslator charIndexTranslator)

PAPFormattedDiskPage(byte[] documentStream,
                    byte[] dataStream,
                    int offset,
                    CharIndexTranslator translator)

Creates a PAPFormattedDiskPage from a 512 byte array

PAPX(int fcStart,
    int fcEnd,
    CharIndexTranslator translator,
    byte[] papx,
    ParagraphHeight phe,
    byte[] dataStream)

PAPX(int fcStart,
    int fcEnd,
    CharIndexTranslator translator,
    SprmBuffer buf,
    byte[] dataStream)

Deprecated.

Overview

Package

Class

Use

Tree

Deprecated

Index

Help

Prev

Next

Frames

No Frames

All Classes

                Copyright 2015 The Apache Software Foundation or
        its licensors, as applicable.


text:
layout: page
title: "Denver Test"
fips: 108125
permalink: "/concept.html"
---

Name:

Population:


text:
// @flow
/**
 * These objects store the data about the DOM nodes we create, as well as some
 * extra data. They can then be transformed into real DOM nodes with the
 * `toNode` function or HTML markup using `toMarkup`. They are useful for both
 * storing extra properties on the nodes, as well as providing a way to easily
 * work with the DOM.
 *
 * Similar functions for working with MathML nodes exist in mathMLTree.js.
 */
import { scriptFromCodepoint } from "./unicodeScripts";
import utils from "./utils";
import svgGeometry from "./svgGeometry";
import type Options from "./Options";

/**
 * Create an HTML className based on a list of classes. In addition to joining
 * with spaces, we also remove null or empty classes.
 */
const createClass = function(classes: string[]): string {
    classes = classes.slice();
    for (let i = classes.length - 1; i >= 0; i--) {
        if (!classes[i]) {
            classes.splice(i, 1);
        }
    }

    return classes.join(" ");
};

// To ensure that all nodes have compatible signatures for these methods.
interface VirtualDomNode {
    toNode(): Node;
    toMarkup(): string;
}

export interface CombinableDomNode extends VirtualDomNode {
    tryCombine(sibling: CombinableDomNode): boolean;
}

/**
 * All `DomChildNode`s MUST have `height`, `depth`, and `maxFontSize` numeric
 * fields.
 *
 * `DomChildNode` is not defined as an interface since `documentFragment` also
 * has these fields but should not be considered a `DomChildNode`.
 */
export type DomChildNode = span | anchor | svgNode | symbolNode;

export type SvgChildNode = pathNode | lineNode;

export type CssStyle = {[name: string]: string};

/**
 * This node represents a span node, with a className, a list of children, and
 * an inline style. It also contains information about its height, depth, and
 * maxFontSize.
 */
class span implements CombinableDomNode {
    classes: string[];
    children: DomChildNode[];
    height: number;
    depth: number;
    width: ?number;
    maxFontSize: number;
    style: CssStyle;
    attributes: {[string]: string};

    constructor(
        classes?: string[],
        children?: DomChildNode[],
        options?: Options,
        style?: CssStyle,
    ) {
        this.classes = classes || [];
        this.children = children || [];
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
        this.style = Object.assign({}, style);
        this.attributes = {};
        if (options) {
            if (options.style.isTight()) {
                this.classes.push("mtight");
            }
            const color = options.getColor();
            if (color) {
                this.style.color = color;
            }
        }
    }

    /**
     * Sets an arbitrary attribute on the span. Warning: use this wisely. Not all
     * browsers support attributes the same, and having too many custom attributes
     * is probably bad.
     */
    setAttribute(attribute: string, value: string) {
        this.attributes[attribute] = value;
    }

    tryCombine(sibling: CombinableDomNode): boolean {
        return false;
    }

    /**
     * Convert the span into an HTML node
     */
    toNode(): HTMLSpanElement {
        const span = document.createElement("span");

        // Apply the class
        span.className = createClass(this.classes);

        // Apply inline styles
        for (const style in this.style) {
            if (Object.prototype.hasOwnProperty.call(this.style, style)) {
                // $FlowFixMe Flow doesn't seem to understand span.style's type.
                span.style[style] = this.style[style];
            }
        }

        // Apply attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                span.setAttribute(attr, this.attributes[attr]);
            }
        }

        // Append the children, also as HTML nodes
        for (let i = 0; i < this.children.length; i++) {
            span.appendChild(this.children[i].toNode());
        }

        return span;
    }

    /**
     * Convert the span into an HTML markup string
     */
    toMarkup(): string {
        let markup = "<span";

        // Add the class
        if (this.classes.length) {
            markup += " class=\"";
            markup += utils.escape(createClass(this.classes));
            markup += "\"";
        }

        let styles = "";

        // Add the styles, after hyphenation
        for (const style in this.style) {
            if (this.style.hasOwnProperty(style)) {
                styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
            }
        }

        if (styles) {
            markup += " style=\"" + utils.escape(styles) + "\"";
        }

        // Add the attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                markup += " " + attr + "=\"";
                markup += utils.escape(this.attributes[attr]);
                markup += "\"";
            }
        }

        markup += ">";

        // Add the markup of the children, also as markup
        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        markup += "";

        return markup;
    }
}

/**
 * This node represents an anchor () element with a hyperlink, a list of classes,
 * a list of children, and an inline style. It also contains information about its
 * height, depth, and maxFontSize.
 */
class anchor implements CombinableDomNode {
    href: string;
    classes: string[];
    children: DomChildNode[];
    height: number;
    depth: number;
    maxFontSize: number;
    style: CssStyle;
    attributes: {[string]: string};

    constructor(
        href: string,
        classes: string[],
        children: DomChildNode[],
        options: Options,
    ) {
        this.href = href;
        this.classes = classes;
        this.children = children;
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
        this.style = {};
        this.attributes = {};
        if (options.style.isTight()) {
            this.classes.push("mtight");
        }
        const color = options.getColor();
        if (color) {
            this.style.color = color;
        }
    }

    /**
     * Sets an arbitrary attribute on the anchor. Warning: use this wisely. Not all
     * browsers support attributes the same, and having too many custom attributes
     * is probably bad.
     */
    setAttribute(attribute: string, value: string) {
        this.attributes[attribute] = value;
    }

    tryCombine(sibling: CombinableDomNode): boolean {
        return false;
    }

    /**
     * Convert the anchor into an HTML node
     */
    toNode(): HTMLAnchorElement {
        const a = document.createElement("a");

        // Apply the href
        a.setAttribute('href', this.href);

        // Apply the class
        if (this.classes.length) {
            a.className = createClass(this.classes);
        }

        // Apply inline styles
        for (const style in this.style) {
            if (Object.prototype.hasOwnProperty.call(this.style, style)) {
                // $FlowFixMe Flow doesn't seem to understand a.style's type.
                a.style[style] = this.style[style];
            }
        }

        // Apply attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                a.setAttribute(attr, this.attributes[attr]);
            }
        }

        // Append the children, also as HTML nodes
        for (let i = 0; i < this.children.length; i++) {
            a.appendChild(this.children[i].toNode());
        }

        return a;
    }

    /**
     * Convert the a into an HTML markup string
     */
    toMarkup(): string {
        let markup = "<a";

        // Add the href
        markup += `href="${markup += utils.escape(this.href)}"`;
        // Add the class
        if (this.classes.length) {
            markup += ` class="${utils.escape(createClass(this.classes))}"`;
        }

        let styles = "";

        // Add the styles, after hyphenation
        for (const style in this.style) {
            if (this.style.hasOwnProperty(style)) {
                styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
            }
        }

        if (styles) {
            markup += " style=\"" + utils.escape(styles) + "\"";
        }

        // Add the attributes
        for (const attr in this.attributes) {
            if (attr !== "href" &&
                Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                markup += ` ${attr}="${utils.escape(this.attributes[attr])}"`;
            }
        }

        markup += ">";

        // Add the markup of the children, also as markup
        for (const child of this.children) {
            markup += child.toMarkup();
        }

        markup += "";

        return markup;
    }
}

/**
 * This node represents a document fragment, which contains elements, but when
 * placed into the DOM doesn't have any representation itself. Thus, it only
 * contains children and doesn't have any HTML properties. It also keeps track
 * of a height, depth, and maxFontSize.
 */
class documentFragment implements VirtualDomNode {
    children: DomChildNode[];
    height: number;
    depth: number;
    maxFontSize: number;

    constructor(children?: DomChildNode[]) {
        this.children = children || [];
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
    }

    /**
     * Convert the fragment into a node
     */
    toNode(): Node {
        // Create a fragment
        const frag = document.createDocumentFragment();

        // Append the children
        for (let i = 0; i < this.children.length; i++) {
            frag.appendChild(this.children[i].toNode());
        }

        return frag;
    }

    /**
     * Convert the fragment into HTML markup
     */
    toMarkup(): string {
        let markup = "";

        // Simply concatenate the markup for the children together
        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        return markup;
    }
}

const iCombinations = {
    'î': '\u0131\u0302',
    'ï': '\u0131\u0308',
    'í': '\u0131\u0301',
    // 'ī': '\u0131\u0304', // enable when we add Extended Latin
    'ì': '\u0131\u0300',
};

/**
 * A symbol node contains information about a single symbol. It either renders
 * to a single text node, or a span with a single text node in it, depending on
 * whether it has CSS classes, styles, or needs italic correction.
 */
class symbolNode implements CombinableDomNode {
    value: string;
    height: number;
    depth: number;
    italic: number;
    skew: number;
    width: number;
    maxFontSize: number;
    classes: string[];
    style: CssStyle;

    constructor(
        value: string,
        height?: number,
        depth?: number,
        italic?: number,
        skew?: number,
        width?: number,
        classes?: string[],
        style?: CssStyle,
    ) {
        this.value = value;
        this.height = height || 0;
        this.depth = depth || 0;
        this.italic = italic || 0;
        this.skew = skew || 0;
        this.width = width || 0;
        this.classes = classes || [];
        this.style = Object.assign({}, style);
        this.maxFontSize = 0;

        // Mark text from non-Latin scripts with specific classes so that we
        // can specify which fonts to use.  This allows us to render these
        // characters with a serif font in situations where the browser would
        // either default to a sans serif or render a placeholder character.
        // We use CSS class names like cjk_fallback, hangul_fallback and
        // brahmic_fallback. See ./unicodeScripts.js for the set of possible
        // script names
        const script = scriptFromCodepoint(this.value.charCodeAt(0));
        if (script) {
            this.classes.push(script + "_fallback");
        }

        if (/[îïíì]/.test(this.value)) {    // add ī when we add Extended Latin
            this.value = iCombinations[this.value];
        }
    }

    tryCombine(sibling: CombinableDomNode): boolean {
        if (!sibling
            || !(sibling instanceof symbolNode)
            || this.italic > 0
            || createClass(this.classes) !== createClass(sibling.classes)
            || this.skew !== sibling.skew
            || this.maxFontSize !== sibling.maxFontSize) {
            return false;
        }
        for (const style in this.style) {
            if (this.style.hasOwnProperty(style)
                && this.style[style] !== sibling.style[style]) {
                return false;
            }
        }
        for (const style in sibling.style) {
            if (sibling.style.hasOwnProperty(style)
                && this.style[style] !== sibling.style[style]) {
                return false;
            }
        }
        this.value += sibling.value;
        this.height = Math.max(this.height, sibling.height);
        this.depth = Math.max(this.depth, sibling.depth);
        this.italic = sibling.italic;
        return true;
    }

    /**
     * Creates a text node or span from a symbol node. Note that a span is only
     * created if it is needed.
     */
    toNode(): Node {
        const node = document.createTextNode(this.value);
        let span = null;

        if (this.italic > 0) {
            span = document.createElement("span");
            span.style.marginRight = this.italic + "em";
        }

        if (this.classes.length > 0) {
            span = span || document.createElement("span");
            span.className = createClass(this.classes);
        }

        for (const style in this.style) {
            if (this.style.hasOwnProperty(style)) {
                span = span || document.createElement("span");
                // $FlowFixMe Flow doesn't seem to understand span.style's type.
                span.style[style] = this.style[style];
            }
        }

        if (span) {
            span.appendChild(node);
            return span;
        } else {
            return node;
        }
    }

    /**
     * Creates markup for a symbol node.
     */
    toMarkup(): string {
        // TODO(alpert): More duplication than I'd like from
        // span.prototype.toMarkup and symbolNode.prototype.toNode...
        let needsSpan = false;

        let markup = " 0) {
            styles += "margin-right:" + this.italic + "em;";
        }
        for (const style in this.style) {
            if (this.style.hasOwnProperty(style)) {
                styles += utils.hyphenate(style) + ":" + this.style[style] + ";";
            }
        }

        if (styles) {
            needsSpan = true;
            markup += " style=\"" + utils.escape(styles) + "\"";
        }

        const escaped = utils.escape(this.value);
        if (needsSpan) {
            markup += ">";
            markup += escaped;
            markup += "";
            return markup;
        } else {
            return escaped;
        }
    }
}

/**
 * SVG nodes are used to render stretchy wide elements.
 */
class svgNode implements VirtualDomNode {
    children: SvgChildNode[];
    attributes: {[string]: string};
    // Required for all `DomChildNode`s. Are always 0 for svgNode.
    height: number;
    depth: number;
    maxFontSize: number;

    constructor(children?: SvgChildNode[], attributes?: {[string]: string}) {
        this.children = children || [];
        this.attributes = attributes || {};
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "svg");

        // Apply attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                node.setAttribute(attr, this.attributes[attr]);
            }
        }

        for (let i = 0; i < this.children.length; i++) {
            node.appendChild(this.children[i].toNode());
        }
        return node;
    }

    toMarkup(): string {
        let markup = "<svg";

        // Apply attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                markup += ` ${attr}='${this.attributes[attr]}'`;
            }
        }

        markup += ">";

        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        markup += "</svg>";

        return markup;

    }
}

class pathNode implements VirtualDomNode {
    pathName: string;
    alternate: ?string;

    constructor(pathName: string, alternate?: string) {
        this.pathName = pathName;
        this.alternate = alternate;  // Used only for tall \sqrt
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "path");

        if (this.alternate) {
            node.setAttribute("d", this.alternate);
        } else {
            node.setAttribute("d", svgGeometry.path[this.pathName]);
        }

        return node;
    }

    toMarkup(): string {
        if (this.alternate) {
            return `<path d='${this.alternate}'/>`;
        } else {
            return `<path d='${svgGeometry.path[this.pathName]}'/>`;
        }
    }
}

class lineNode implements VirtualDomNode {
    attributes: {[string]: string};

    constructor(attributes?: {[string]: string}) {
        this.attributes = attributes || {};
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "line");

        // Apply attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                node.setAttribute(attr, this.attributes[attr]);
            }
        }

        return node;
    }

    toMarkup(): string {
        let markup = "<line";

        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                markup += ` ${attr}='${this.attributes[attr]}'`;
            }
        }

        markup += "/>";

        return markup;
    }
}

export default {
    span,
    anchor,
    documentFragment,
    symbolNode,
    svgNode,
    pathNode,
    lineNode,
};


text:
package pl.mmorpg.prototype.server.packetshandling.characteractions;

import com.badlogic.gdx.Gdx;

import pl.mmorpg.prototype.server.collision.pixelmap.PixelCollisionMap;
import pl.mmorpg.prototype.server.objects.GameObject;
import pl.mmorpg.prototype.server.objects.MovableGameObject;
import pl.mmorpg.prototype.server.states.PlayState;

public class MoveRightPacketHandler extends MovePacketHandler
{

	public MoveRightPacketHandler(PlayState playState)
	{
		super(playState);
	}

	@Override
	public void perform(MovableGameObject operationTarget, PixelCollisionMap<GameObject> collisionMap)
	{
		operationTarget.moveRight(collisionMap, Gdx.graphics.getDeltaTime());
	}

}


text:
import java.util.ArrayList;
import java.util.List;

public class Degree {
	// you are free to add private variables/methods at will
	// as well as standard Java methods (equals, toString, etc)

	// Methods to change/complete are below
	// do not change their signature/names

	public Degree(StudentRecord r) {
		this.record = r;
		if (r.getYear(2).size() != 4 || r.getYear(3).size() != 4)
			throw new IllegalArgumentException();
	}

	public Classification classify() {
		Profile level6 = new Profile(record.getYear(3));
		List<PointGrade> tempList = new ArrayList<PointGrade>();
		for (int i = 0; i < 4; i++)
			tempList.add(record.getYear(2).get(i));
		for (int i = 0; i < 4; i++)
			tempList.add(record.getYear(3).get(i));
		Profile level5 = new Profile(tempList);
		int lvl5 = classToNumber(level5.classify());
		int lvl6 = classToNumber(level6.classify());

		if (lvl5 == lvl6)
			return level5.classify();
		else if (lvl5 > lvl6 && lvl5 - lvl6 <= 1) {
			if (level5.isClear())
				return level5.classify();
		} else if (lvl6 > lvl5 && lvl6 - lvl5 <= 1) {
			if (level6.isClear())
				return level6.classify();
		}
		return Classification.Discretion;
	}

	private int classToNumber(Classification c) {
		if (c == Classification.First)
			return 4;
		else if (c == Classification.UpperSecond)
			return 3;
		else if (c == Classification.LowerSecond)
			return 2;
		else
			return 1;
	}

	private StudentRecord record;
}


text:
package num

import (
	"fmt"
	"math/big"

	"github.com/michaelmacinnis/oh/internal/common/interface/boolean"
	"github.com/michaelmacinnis/oh/internal/common/interface/cell"
	"github.com/michaelmacinnis/oh/internal/common/interface/literal"
	"github.com/michaelmacinnis/oh/internal/common/interface/rational"
)

const name = "number"

// T (num) wraps Go's big.Rat type.
type T big.Rat

type num = T

// Int creates a num from the integer i.
func Int(i int) cell.I {
	return Rat(big.NewRat(int64(i), 1))
}

// New creates a new num from a string.
func New(s string) cell.I {
	v := &big.Rat{}

	if _, ok := v.SetString(s); !ok {
		panic("'" + s + "' is not a valid number")
	}

	return Rat(v)
}

// Rat creates wraps the *big.Rat r as a num.
func Rat(r *big.Rat) cell.I {
	return (*num)(r)
}

// Bool returns the boolean value of the num n.
func (n *num) Bool() bool {
	return n.Rat().Cmp(&big.Rat{}) != 0
}

// Equal returns true if c is the same number as the num n.
func (n *num) Equal(c cell.I) bool {
	return Is(c) && n.Rat().Cmp(To(c).Rat()) == 0
}

// Literal returns the literal representation of the num n.
func (n *num) Literal() string {
	return "(|" + name + " " + n.String() + "|)"
}

// Name returns the type name for the num n.
func (n *num) Name() string {
	return name
}

// Rat returns the value of the num n as a *big.Rat.
func (n *num) Rat() *big.Rat {
	return (*big.Rat)(n)
}

// String returns the text of the num n.
func (n *num) String() string {
	return n.Rat().RatString()
}

// A compiler-checked list of interfaces this type satisfies. Never called.
func implements() { //nolint:deadcode,unused
	var t num

	// The num type has a boolean value.
	_ = boolean.I(&t)

	// The num type is a cell.
	_ = cell.I(&t)

	// The num type has a literal representation.
	_ = literal.I(&t)

	// The num type is a rational.
	_ = rational.I(&t)

	// The num type is a stringer.
	_ = fmt.Stringer(&t)
}


text:
from __future__ import print_function
from builtins import chr
import os, sys, importlib, shutil
from cntk_helpers import *

####################################
# Parameters
####################################
imgDir = "C:/Users/Minh-ICRL/Documents/LEGO-Object-Classification/DataSets/Lego/testImages"

# no need to change these params
drawingImgSize = 1000.0

####################################
# Functions
####################################
def event_cv2_drawRectangles(event, x, y, flags, param):
    global global_image
    global global_bboxes
    global global_leftButtonDownPoint

    # draw all previous bounding boxes, and the most recent box in a different color
    imgCopy = global_image.copy()
    drawRectangles(imgCopy, global_bboxes)
    if len(global_bboxes)>0:
        drawRectangles(imgCopy, [global_bboxes[-1]], color = (255, 0, 0))

    # handle mouse events
    if event == cv2.EVENT_LBUTTONDOWN:
        global_leftButtonDownPoint = (x, y)

    elif event == cv2.EVENT_LBUTTONUP:
        pt1 = global_leftButtonDownPoint
        pt2 = (x, y)
        minPt = (min(pt1[0], pt2[0]), min(pt1[1], pt2[1]))
        maxPt = (max(pt1[0], pt2[0]), max(pt1[1], pt2[1]))
        imgWidth, imgHeight = imArrayWidthHeight(global_image)
        minPt = ptClip(minPt, imgWidth, imgHeight)
        maxPt = ptClip(maxPt, imgWidth, imgHeight)
        global_bboxes.append(minPt + maxPt)

    elif flags == cv2.EVENT_FLAG_LBUTTON: #if left mouse button is held down
        cv2.rectangle(imgCopy, global_leftButtonDownPoint, (x, y), (255, 255, 0), 1)

    else:
        drawCrossbar(imgCopy, (x, y))
    cv2.imshow("AnnotationWindow", imgCopy)

def scaleCropBboxes(rectsIn, scaleFactor, imgWidth, imgHeight):
    if len(rectsIn) <= 0:
        return rectsIn
    else:
        rects = [ [int(round(rect[i]/scaleFactor)) for i in range(4)]
                  for rect in rectsIn]
        rects = [Bbox(*rect).crop(imgWidth, imgHeight).rect() for rect in rects]
        for rect in rects:
            assert (Bbox(*rect).isValid())
        return rects

####################################
# Main
####################################
imgFilenames = [f for f in os.listdir(imgDir) if f.lower().endswith(".jpg")]
with open('mytrain2.txt', 'w') as listFile:
    for fileindex, tmpImage in enumerate(imgFilenames):
            listFile.write('{0}\t testImages/{1}\n'.format(fileindex, tmpImage))

# loop over each image and get annotation
for imgFilenameIndex,imgFilename in enumerate(imgFilenames):
    print (imgFilenameIndex, imgFilename)
    imgPath = os.path.join(imgDir, imgFilename)
    bBoxPath = imgPath[:-4] + ".bboxes.tsv"

    # skip image if ground truth already exists
    if os.path.exists(bBoxPath):
        print ("Skipping image {0} since ground truth already exists".format(imgFilename))
        continue
    else:
        print ("Processing image {0} of {1}: {2}".format(imgFilenameIndex, len(imgFilenames), imgPath))

    # prepare image window and callback
    global_bboxes = []
    global_image, scaleFactor = imresizeMaxDim(imread(imgPath), drawingImgSize)
    cv2.namedWindow("AnnotationWindow")
    cv2.setMouseCallback("AnnotationWindow", event_cv2_drawRectangles)
    cv2.imshow("AnnotationWindow", global_image)

    # process user input
    while True:
        key = chr(cv2.waitKey())

        # undo/remove last rectangle
        if key == "u":
            if len(global_bboxes) >= 1:
                global_bboxes = global_bboxes[:-1]
                imgCopy = global_image.copy()
                drawRectangles(imgCopy, global_bboxes)
                cv2.imshow("AnnotationWindow", imgCopy)

        # skip image
        elif key == "s":
            if os.path.exists(bBoxPath):
                print ("Skipping image hence deleting existing bbox file: " + bBoxPath)
                os.remove(bBoxPath)
            break

        # next image
        elif key == "n":
            bboxes = scaleCropBboxes(global_bboxes, scaleFactor, imWidth(imgPath), imHeight(imgPath))
            writeTable(bBoxPath, bboxes)
            break

        # quit
        elif key == "q":
            sys.exit()

cv2.destroyAllWindows()


text:
  #define CL_TARGET_OPENCL_VERSION 110
  #include "clblast.h"
#elif CUDA_API
  #include "clblast_cuda.h"
#endif

namespace clblast {
// A special namespace to hold all the global constant variables (including the database entries)
namespace database {

// =================================================================================================

// Type alias for the database storage (arrays for fast compilation/efficiency)
using Name = std::array<char, 51>; // name as stored in database (50 chars + string terminator)
using Params = std::array<size_t, 16>; // parameters as stored in database

// Type alias after extracting from the database (sorted map for improved code readability)
using Parameters = std::map<std::string, size_t>; // parameters after reading from DB

// The OpenCL device types
const std::string kDeviceTypeCPU = "CPU";
const std::string kDeviceTypeGPU = "GPU";
const std::string kDeviceTypeAccelerator = "accelerator";
const std::string kDeviceTypeAll = "default";
const Name kDeviceNameDefault = {"default                                           "};

struct DatabaseDevice {
  Name name;
  Params parameters; // parameter values

};
struct DatabaseArchitecture {
  std::string name;
  std::vector<DatabaseDevice> devices;
};
struct DatabaseVendor {
  std::string type;
  std::string name;
  std::vector<DatabaseArchitecture> architectures;
};
struct DatabaseEntry {
  std::string kernel;
  Precision precision;
  std::vector<std::string> parameter_names;
  std::vector<DatabaseVendor> vendors;
};

// =================================================================================================
} // namespace database
} // namespace clblast

// CLBLAST_DATABASE_DATABASE_STRUCTURE_H_
#endif


text:
package com.md_5.cascade.entity;

import java.util.Set;
import org.bukkit.entity.ComplexEntityPart;
import org.bukkit.entity.ComplexLivingEntity;

public class CascadeComplexLivingEntity extends CascadeLivingEntity implements ComplexLivingEntity {

    @Override
    public Set<ComplexEntityPart> getParts() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}


text:
@interface ComGoogleCommonGraphAbstractNetwork ()

+ (id<JavaUtilMap>)edgeIncidentNodesMapWithComGoogleCommonGraphNetwork:(id<ComGoogleCommonGraphNetwork>)network;

@end

__attribute__((unused)) static id<JavaUtilMap> ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> network);

__attribute__((unused)) static IOSObjectArray *ComGoogleCommonGraphAbstractNetwork__Annotations$0();

@interface ComGoogleCommonGraphAbstractNetwork_1 : ComGoogleCommonGraphAbstractGraph {
 @public
  ComGoogleCommonGraphAbstractNetwork *this$0_;
}

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork:(ComGoogleCommonGraphAbstractNetwork *)outer$;

- (id<JavaUtilSet>)nodes;

- (id<JavaUtilSet>)edges;

- (ComGoogleCommonGraphElementOrder *)nodeOrder;

- (jboolean)isDirected;

- (jboolean)allowsSelfLoops;

- (id<JavaUtilSet>)adjacentNodesWithId:(id)node;

- (id<JavaUtilSet>)predecessorsWithId:(id)node;

- (id<JavaUtilSet>)successorsWithId:(id)node;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonGraphAbstractNetwork_1)

__attribute__((unused)) static void ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork_1 *self, ComGoogleCommonGraphAbstractNetwork *outer$);

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1 *new_ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork *outer$) NS_RETURNS_RETAINED;

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1 *create_ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork *outer$);

@interface ComGoogleCommonGraphAbstractNetwork_1_1 : JavaUtilAbstractSet {
 @public
  ComGoogleCommonGraphAbstractNetwork_1 *this$0_;
}

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork_1:(ComGoogleCommonGraphAbstractNetwork_1 *)outer$;

- (id<JavaUtilIterator>)iterator;

- (jint)size;

- (jboolean)containsWithId:(id)obj;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonGraphAbstractNetwork_1_1)

__attribute__((unused)) static void ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *self, ComGoogleCommonGraphAbstractNetwork_1 *outer$);

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1_1 *new_ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1 *outer$) NS_RETURNS_RETAINED;

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1_1 *create_ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1 *outer$);

__attribute__((unused)) static IOSObjectArray *ComGoogleCommonGraphAbstractNetwork_1_1__Annotations$0();

@interface ComGoogleCommonGraphAbstractNetwork_1_1_1 : NSObject < ComGoogleCommonBaseFunction > {
 @public
  ComGoogleCommonGraphAbstractNetwork_1_1 *this$0_;
}

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork_1_1:(ComGoogleCommonGraphAbstractNetwork_1_1 *)outer$;

- (ComGoogleCommonGraphEndpointPair *)applyWithId:(id)edge;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonGraphAbstractNetwork_1_1_1)

__attribute__((unused)) static void ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1_1 *self, ComGoogleCommonGraphAbstractNetwork_1_1 *outer$);

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1_1_1 *new_ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *outer$) NS_RETURNS_RETAINED;

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_1_1_1 *create_ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *outer$);

@interface ComGoogleCommonGraphAbstractNetwork_2 : NSObject < ComGoogleCommonBaseFunction > {
 @public
  id<ComGoogleCommonGraphNetwork> val$network_;
}

- (instancetype)initWithComGoogleCommonGraphNetwork:(id<ComGoogleCommonGraphNetwork>)capture$0;

- (ComGoogleCommonGraphEndpointPair *)applyWithId:(id)edge;

@end

J2OBJC_EMPTY_STATIC_INIT(ComGoogleCommonGraphAbstractNetwork_2)

__attribute__((unused)) static void ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(ComGoogleCommonGraphAbstractNetwork_2 *self, id<ComGoogleCommonGraphNetwork> capture$0);

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_2 *new_ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> capture$0) NS_RETURNS_RETAINED;

__attribute__((unused)) static ComGoogleCommonGraphAbstractNetwork_2 *create_ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> capture$0);

@implementation ComGoogleCommonGraphAbstractNetwork

J2OBJC_IGNORE_DESIGNATED_BEGIN
- (instancetype)init {
  ComGoogleCommonGraphAbstractNetwork_init(self);
  return self;
}
J2OBJC_IGNORE_DESIGNATED_END

- (id<ComGoogleCommonGraphGraph>)asGraph {
  return new_ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(self);
}

- (jint)degreeWithId:(id)node {
  if ([self isDirected]) {
    return ComGoogleCommonMathIntMath_saturatedAddWithInt_withInt_([((id<JavaUtilSet>) nil_chk([self inEdgesWithId:node])) size], [((id<JavaUtilSet>) nil_chk([self outEdgesWithId:node])) size]);
  }
  else {
    return ComGoogleCommonMathIntMath_saturatedAddWithInt_withInt_([((id<JavaUtilSet>) nil_chk([self incidentEdgesWithId:node])) size], [((id<JavaUtilSet>) nil_chk([self edgesConnectingWithId:node withId:node])) size]);
  }
}

- (jint)inDegreeWithId:(id)node {
  return [self isDirected] ? [((id<JavaUtilSet>) nil_chk([self inEdgesWithId:node])) size] : [self degreeWithId:node];
}

- (jint)outDegreeWithId:(id)node {
  return [self isDirected] ? [((id<JavaUtilSet>) nil_chk([self outEdgesWithId:node])) size] : [self degreeWithId:node];
}

- (id<JavaUtilSet>)adjacentEdgesWithId:(id)edge {
  ComGoogleCommonGraphEndpointPair *endpointPair = [self incidentNodesWithId:edge];
  id<JavaUtilSet> endpointPairIncidentEdges = ComGoogleCommonCollectSets_union__WithJavaUtilSet_withJavaUtilSet_([self incidentEdgesWithId:[((ComGoogleCommonGraphEndpointPair *) nil_chk(endpointPair)) nodeU]], [self incidentEdgesWithId:[endpointPair nodeV]]);
  return ComGoogleCommonCollectSets_differenceWithJavaUtilSet_withJavaUtilSet_(endpointPairIncidentEdges, ComGoogleCommonCollectImmutableSet_ofWithId_(edge));
}

- (jboolean)isEqual:(id)obj {
  if (obj == self) {
    return true;
  }
  if (!([ComGoogleCommonGraphNetwork_class_() isInstance:obj])) {
    return false;
  }
  id<ComGoogleCommonGraphNetwork> other = (id<ComGoogleCommonGraphNetwork>) cast_check(obj, ComGoogleCommonGraphNetwork_class_());
  return [self isDirected] == [((id<ComGoogleCommonGraphNetwork>) nil_chk(other)) isDirected] && [((id<JavaUtilSet>) nil_chk([self nodes])) isEqual:[other nodes]] && [((id<JavaUtilMap>) nil_chk(ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(self))) isEqual:ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(other)];
}

- (NSUInteger)hash {
  return ((jint) [((id<JavaUtilMap>) nil_chk(ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(self))) hash]);
}

- (NSString *)description {
  NSString *propertiesString = NSString_java_formatWithNSString_withNSObjectArray_(@"isDirected: %s, allowsParallelEdges: %s, allowsSelfLoops: %s", [IOSObjectArray newArrayWithObjects:(id[]){ JavaLangBoolean_valueOfWithBoolean_([self isDirected]), JavaLangBoolean_valueOfWithBoolean_([self allowsParallelEdges]), JavaLangBoolean_valueOfWithBoolean_([self allowsSelfLoops]) } count:3 type:NSObject_class_()]);
  return NSString_java_formatWithNSString_withNSObjectArray_(ComGoogleCommonGraphGraphConstants_GRAPH_STRING_FORMAT, [IOSObjectArray newArrayWithObjects:(id[]){ propertiesString, [self nodes], ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(self) } count:3 type:NSObject_class_()]);
}

+ (id<JavaUtilMap>)edgeIncidentNodesMapWithComGoogleCommonGraphNetwork:(id<ComGoogleCommonGraphNetwork>)network {
  return ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(network);
}

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "LComGoogleCommonGraphGraph;", 0x1, -1, -1, -1, 0, -1, -1 },
    { NULL, "I", 0x1, 1, 2, -1, 3, -1, -1 },
    { NULL, "I", 0x1, 4, 2, -1, 3, -1, -1 },
    { NULL, "I", 0x1, 5, 2, -1, 3, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, 6, 2, -1, 7, -1, -1 },
    { NULL, "Z", 0x11, 8, 2, -1, -1, -1, 9 },
    { NULL, "I", 0x11, 10, -1, -1, -1, -1, -1 },
    { NULL, "LNSString;", 0x1, 11, -1, -1, -1, -1, -1 },
    { NULL, "LJavaUtilMap;", 0xa, 12, 13, -1, 14, -1, -1 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(init);
  methods[1].selector = @selector(asGraph);
  methods[2].selector = @selector(degreeWithId:);
  methods[3].selector = @selector(inDegreeWithId:);
  methods[4].selector = @selector(outDegreeWithId:);
  methods[5].selector = @selector(adjacentEdgesWithId:);
  methods[6].selector = @selector(isEqual:);
  methods[7].selector = @selector(hash);
  methods[8].selector = @selector(description);
  methods[9].selector = @selector(edgeIncidentNodesMapWithComGoogleCommonGraphNetwork:);
  #pragma clang diagnostic pop
  static const void *ptrTable[] = { "()Lcom/google/common/graph/Graph<TN;>;", "degree", "LNSObject;", "(TN;)I", "inDegree", "outDegree", "adjacentEdges", "(TE;)Ljava/util/Set<TE;>;", "equals", (void *)&ComGoogleCommonGraphAbstractNetwork__Annotations$0, "hashCode", "toString", "edgeIncidentNodesMap", "LComGoogleCommonGraphNetwork;", "<N:Ljava/lang/Object;E:Ljava/lang/Object;>(Lcom/google/common/graph/Network<TN;TE;>;)Ljava/util/Map<TE;Lcom/google/common/graph/EndpointPair<TN;>;>;", "<N:Ljava/lang/Object;E:Ljava/lang/Object;>Ljava/lang/Object;Lcom/google/common/graph/Network<TN;TE;>;" };
  static const J2ObjcClassInfo _ComGoogleCommonGraphAbstractNetwork = { "AbstractNetwork", "com.google.common.graph", ptrTable, methods, NULL, 7, 0x401, 10, 0, -1, -1, -1, 15, -1 };
  return &_ComGoogleCommonGraphAbstractNetwork;
}

@end

void ComGoogleCommonGraphAbstractNetwork_init(ComGoogleCommonGraphAbstractNetwork *self) {
  NSObject_init(self);
}

id<JavaUtilMap> ComGoogleCommonGraphAbstractNetwork_edgeIncidentNodesMapWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> network) {
  ComGoogleCommonGraphAbstractNetwork_initialize();
  id<ComGoogleCommonBaseFunction> edgeToIncidentNodesFn = new_ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(network);
  return ComGoogleCommonCollectMaps_asMapWithJavaUtilSet_withComGoogleCommonBaseFunction_([((id<ComGoogleCommonGraphNetwork>) nil_chk(network)) edges], edgeToIncidentNodesFn);
}

IOSObjectArray *ComGoogleCommonGraphAbstractNetwork__Annotations$0() {
  return [IOSObjectArray newArrayWithObjects:(id[]){ [IOSObjectArray newArrayWithObjects:(id[]){ create_JavaxAnnotationNullable() } count:1 type:JavaLangAnnotationAnnotation_class_()] } count:1 type:IOSClass_arrayType(JavaLangAnnotationAnnotation_class_(), 1)];
}

J2OBJC_CLASS_TYPE_LITERAL_SOURCE(ComGoogleCommonGraphAbstractNetwork)

@implementation ComGoogleCommonGraphAbstractNetwork_1

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork:(ComGoogleCommonGraphAbstractNetwork *)outer$ {
  ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(self, outer$);
  return self;
}

- (id<JavaUtilSet>)nodes {
  return [this$0_ nodes];
}

- (id<JavaUtilSet>)edges {
  if ([this$0_ allowsParallelEdges]) {
    return [super edges];
  }
  return new_ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(self);
}

- (ComGoogleCommonGraphElementOrder *)nodeOrder {
  return [this$0_ nodeOrder];
}

- (jboolean)isDirected {
  return [this$0_ isDirected];
}

- (jboolean)allowsSelfLoops {
  return [this$0_ allowsSelfLoops];
}

- (id<JavaUtilSet>)adjacentNodesWithId:(id)node {
  return [this$0_ adjacentNodesWithId:node];
}

- (id<JavaUtilSet>)predecessorsWithId:(id)node {
  return [this$0_ predecessorsWithId:node];
}

- (id<JavaUtilSet>)successorsWithId:(id)node {
  return [this$0_ successorsWithId:node];
}

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x0, -1, -1, -1, -1, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, -1, -1, -1, 0, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, -1, -1, -1, 1, -1, -1 },
    { NULL, "LComGoogleCommonGraphElementOrder;", 0x1, -1, -1, -1, 2, -1, -1 },
    { NULL, "Z", 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "Z", 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, 3, 4, -1, 5, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, 6, 4, -1, 5, -1, -1 },
    { NULL, "LJavaUtilSet;", 0x1, 7, 4, -1, 5, -1, -1 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(initWithComGoogleCommonGraphAbstractNetwork:);
  methods[1].selector = @selector(nodes);
  methods[2].selector = @selector(edges);
  methods[3].selector = @selector(nodeOrder);
  methods[4].selector = @selector(isDirected);
  methods[5].selector = @selector(allowsSelfLoops);
  methods[6].selector = @selector(adjacentNodesWithId:);
  methods[7].selector = @selector(predecessorsWithId:);
  methods[8].selector = @selector(successorsWithId:);
  #pragma clang diagnostic pop
  static const J2ObjcFieldInfo fields[] = {
    { "this$0_", "LComGoogleCommonGraphAbstractNetwork;", .constantValue.asLong = 0, 0x1012, -1, -1, 8, -1 },
  };
  static const void *ptrTable[] = { "()Ljava/util/Set<TN;>;", "()Ljava/util/Set<Lcom/google/common/graph/EndpointPair<TN;>;>;", "()Lcom/google/common/graph/ElementOrder<TN;>;", "adjacentNodes", "LNSObject;", "(TN;)Ljava/util/Set<TN;>;", "predecessors", "successors", "Lcom/google/common/graph/AbstractNetwork<TN;TE;>;", "LComGoogleCommonGraphAbstractNetwork;", "asGraph", "Lcom/google/common/graph/AbstractGraph<TN;>;" };
  static const J2ObjcClassInfo _ComGoogleCommonGraphAbstractNetwork_1 = { "", "com.google.common.graph", ptrTable, methods, fields, 7, 0x8018, 9, 1, 9, -1, 10, 11, -1 };
  return &_ComGoogleCommonGraphAbstractNetwork_1;
}

@end

void ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork_1 *self, ComGoogleCommonGraphAbstractNetwork *outer$) {
  self->this$0_ = outer$;
  ComGoogleCommonGraphAbstractGraph_init(self);
}

ComGoogleCommonGraphAbstractNetwork_1 *new_ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork *outer$) {
  J2OBJC_NEW_IMPL(ComGoogleCommonGraphAbstractNetwork_1, initWithComGoogleCommonGraphAbstractNetwork_, outer$)
}

ComGoogleCommonGraphAbstractNetwork_1 *create_ComGoogleCommonGraphAbstractNetwork_1_initWithComGoogleCommonGraphAbstractNetwork_(ComGoogleCommonGraphAbstractNetwork *outer$) {
  J2OBJC_CREATE_IMPL(ComGoogleCommonGraphAbstractNetwork_1, initWithComGoogleCommonGraphAbstractNetwork_, outer$)
}

@implementation ComGoogleCommonGraphAbstractNetwork_1_1

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork_1:(ComGoogleCommonGraphAbstractNetwork_1 *)outer$ {
  ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(self, outer$);
  return self;
}

- (id<JavaUtilIterator>)iterator {
  return ComGoogleCommonCollectIterators_transformWithJavaUtilIterator_withComGoogleCommonBaseFunction_([((id<JavaUtilSet>) nil_chk([this$0_->this$0_ edges])) iterator], new_ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(self));
}

- (jint)size {
  return [((id<JavaUtilSet>) nil_chk([this$0_->this$0_ edges])) size];
}

- (jboolean)containsWithId:(id)obj {
  if (!([obj isKindOfClass:[ComGoogleCommonGraphEndpointPair class]])) {
    return false;
  }
  ComGoogleCommonGraphEndpointPair *endpointPair = (ComGoogleCommonGraphEndpointPair *) cast_chk(obj, [ComGoogleCommonGraphEndpointPair class]);
  return [this$0_ isDirected] == [((ComGoogleCommonGraphEndpointPair *) nil_chk(endpointPair)) isOrdered] && [((id<JavaUtilSet>) nil_chk([this$0_ nodes])) containsWithId:[endpointPair nodeU]] && [((id<JavaUtilSet>) nil_chk([this$0_ successorsWithId:[endpointPair nodeU]])) containsWithId:[endpointPair nodeV]];
}

- (NSUInteger)countByEnumeratingWithState:(NSFastEnumerationState *)state objects:(__unsafe_unretained id *)stackbuf count:(NSUInteger)len {
  return JreDefaultFastEnumeration(self, state, stackbuf, len);
}

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x0, -1, -1, -1, -1, -1, -1 },
    { NULL, "LJavaUtilIterator;", 0x1, -1, -1, -1, 0, -1, -1 },
    { NULL, "I", 0x1, -1, -1, -1, -1, -1, -1 },
    { NULL, "Z", 0x1, 1, 2, -1, -1, -1, 3 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(initWithComGoogleCommonGraphAbstractNetwork_1:);
  methods[1].selector = @selector(iterator);
  methods[2].selector = @selector(size);
  methods[3].selector = @selector(containsWithId:);
  #pragma clang diagnostic pop
  static const J2ObjcFieldInfo fields[] = {
    { "this$0_", "LComGoogleCommonGraphAbstractNetwork_1;", .constantValue.asLong = 0, 0x1012, -1, -1, -1, -1 },
  };
  static const void *ptrTable[] = { "()Ljava/util/Iterator<Lcom/google/common/graph/EndpointPair<TN;>;>;", "contains", "LNSObject;", (void *)&ComGoogleCommonGraphAbstractNetwork_1_1__Annotations$0, "LComGoogleCommonGraphAbstractNetwork_1;", "edges", "Ljava/util/AbstractSet<Lcom/google/common/graph/EndpointPair<TN;>;>;" };
  static const J2ObjcClassInfo _ComGoogleCommonGraphAbstractNetwork_1_1 = { "", "com.google.common.graph", ptrTable, methods, fields, 7, 0x8018, 4, 1, 4, -1, 5, 6, -1 };
  return &_ComGoogleCommonGraphAbstractNetwork_1_1;
}

@end

void ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *self, ComGoogleCommonGraphAbstractNetwork_1 *outer$) {
  self->this$0_ = outer$;
  JavaUtilAbstractSet_init(self);
}

ComGoogleCommonGraphAbstractNetwork_1_1 *new_ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1 *outer$) {
  J2OBJC_NEW_IMPL(ComGoogleCommonGraphAbstractNetwork_1_1, initWithComGoogleCommonGraphAbstractNetwork_1_, outer$)
}

ComGoogleCommonGraphAbstractNetwork_1_1 *create_ComGoogleCommonGraphAbstractNetwork_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_(ComGoogleCommonGraphAbstractNetwork_1 *outer$) {
  J2OBJC_CREATE_IMPL(ComGoogleCommonGraphAbstractNetwork_1_1, initWithComGoogleCommonGraphAbstractNetwork_1_, outer$)
}

IOSObjectArray *ComGoogleCommonGraphAbstractNetwork_1_1__Annotations$0() {
  return [IOSObjectArray newArrayWithObjects:(id[]){ [IOSObjectArray newArrayWithObjects:(id[]){ create_JavaxAnnotationNullable() } count:1 type:JavaLangAnnotationAnnotation_class_()] } count:1 type:IOSClass_arrayType(JavaLangAnnotationAnnotation_class_(), 1)];
}

@implementation ComGoogleCommonGraphAbstractNetwork_1_1_1

- (instancetype)initWithComGoogleCommonGraphAbstractNetwork_1_1:(ComGoogleCommonGraphAbstractNetwork_1_1 *)outer$ {
  ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(self, outer$);
  return self;
}

- (ComGoogleCommonGraphEndpointPair *)applyWithId:(id)edge {
  return [this$0_->this$0_->this$0_ incidentNodesWithId:edge];
}

- (id<JavaUtilFunctionFunction>)composeWithJavaUtilFunctionFunction:(id<JavaUtilFunctionFunction>)arg0 {
  return JavaUtilFunctionFunction_composeWithJavaUtilFunctionFunction_(self, arg0);
}

- (id<JavaUtilFunctionFunction>)andThenWithJavaUtilFunctionFunction:(id<JavaUtilFunctionFunction>)arg0 {
  return JavaUtilFunctionFunction_andThenWithJavaUtilFunctionFunction_(self, arg0);
}

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x0, -1, -1, -1, -1, -1, -1 },
    { NULL, "LComGoogleCommonGraphEndpointPair;", 0x1, 0, 1, -1, 2, -1, -1 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(initWithComGoogleCommonGraphAbstractNetwork_1_1:);
  methods[1].selector = @selector(applyWithId:);
  #pragma clang diagnostic pop
  static const J2ObjcFieldInfo fields[] = {
    { "this$0_", "LComGoogleCommonGraphAbstractNetwork_1_1;", .constantValue.asLong = 0, 0x1012, -1, -1, -1, -1 },
  };
  static const void *ptrTable[] = { "apply", "LNSObject;", "(TE;)Lcom/google/common/graph/EndpointPair<TN;>;", "LComGoogleCommonGraphAbstractNetwork_1_1;", "iterator", "Ljava/lang/Object;Lcom/google/common/base/Function<TE;Lcom/google/common/graph/EndpointPair<TN;>;>;" };
  static const J2ObjcClassInfo _ComGoogleCommonGraphAbstractNetwork_1_1_1 = { "", "com.google.common.graph", ptrTable, methods, fields, 7, 0x8018, 2, 1, 3, -1, 4, 5, -1 };
  return &_ComGoogleCommonGraphAbstractNetwork_1_1_1;
}

@end

void ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1_1 *self, ComGoogleCommonGraphAbstractNetwork_1_1 *outer$) {
  self->this$0_ = outer$;
  NSObject_init(self);
}

ComGoogleCommonGraphAbstractNetwork_1_1_1 *new_ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *outer$) {
  J2OBJC_NEW_IMPL(ComGoogleCommonGraphAbstractNetwork_1_1_1, initWithComGoogleCommonGraphAbstractNetwork_1_1_, outer$)
}

ComGoogleCommonGraphAbstractNetwork_1_1_1 *create_ComGoogleCommonGraphAbstractNetwork_1_1_1_initWithComGoogleCommonGraphAbstractNetwork_1_1_(ComGoogleCommonGraphAbstractNetwork_1_1 *outer$) {
  J2OBJC_CREATE_IMPL(ComGoogleCommonGraphAbstractNetwork_1_1_1, initWithComGoogleCommonGraphAbstractNetwork_1_1_, outer$)
}

@implementation ComGoogleCommonGraphAbstractNetwork_2

- (instancetype)initWithComGoogleCommonGraphNetwork:(id<ComGoogleCommonGraphNetwork>)capture$0 {
  ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(self, capture$0);
  return self;
}

- (ComGoogleCommonGraphEndpointPair *)applyWithId:(id)edge {
  return [((id<ComGoogleCommonGraphNetwork>) nil_chk(val$network_)) incidentNodesWithId:edge];
}

- (id<JavaUtilFunctionFunction>)composeWithJavaUtilFunctionFunction:(id<JavaUtilFunctionFunction>)arg0 {
  return JavaUtilFunctionFunction_composeWithJavaUtilFunctionFunction_(self, arg0);
}

- (id<JavaUtilFunctionFunction>)andThenWithJavaUtilFunctionFunction:(id<JavaUtilFunctionFunction>)arg0 {
  return JavaUtilFunctionFunction_andThenWithJavaUtilFunctionFunction_(self, arg0);
}

+ (const J2ObjcClassInfo *)__metadata {
  static J2ObjcMethodInfo methods[] = {
    { NULL, NULL, 0x0, -1, -1, -1, -1, -1, -1 },
    { NULL, "LComGoogleCommonGraphEndpointPair;", 0x1, 0, 1, -1, 2, -1, -1 },
  };
  #pragma clang diagnostic push
  #pragma clang diagnostic ignored "-Wobjc-multiple-method-names"
  methods[0].selector = @selector(initWithComGoogleCommonGraphNetwork:);
  methods[1].selector = @selector(applyWithId:);
  #pragma clang diagnostic pop
  static const J2ObjcFieldInfo fields[] = {
    { "val$network_", "LComGoogleCommonGraphNetwork;", .constantValue.asLong = 0, 0x1012, -1, -1, 3, -1 },
  };
  static const void *ptrTable[] = { "apply", "LNSObject;", "(TE;)Lcom/google/common/graph/EndpointPair<TN;>;", "Lcom/google/common/graph/Network<TN;TE;>;", "LComGoogleCommonGraphAbstractNetwork;", "edgeIncidentNodesMapWithComGoogleCommonGraphNetwork:", "Ljava/lang/Object;Lcom/google/common/base/Function<TE;Lcom/google/common/graph/EndpointPair<TN;>;>;" };
  static const J2ObjcClassInfo _ComGoogleCommonGraphAbstractNetwork_2 = { "", "com.google.common.graph", ptrTable, methods, fields, 7, 0x8018, 2, 1, 4, -1, 5, 6, -1 };
  return &_ComGoogleCommonGraphAbstractNetwork_2;
}

@end

void ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(ComGoogleCommonGraphAbstractNetwork_2 *self, id<ComGoogleCommonGraphNetwork> capture$0) {
  self->val$network_ = capture$0;
  NSObject_init(self);
}

ComGoogleCommonGraphAbstractNetwork_2 *new_ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> capture$0) {
  J2OBJC_NEW_IMPL(ComGoogleCommonGraphAbstractNetwork_2, initWithComGoogleCommonGraphNetwork_, capture$0)
}

ComGoogleCommonGraphAbstractNetwork_2 *create_ComGoogleCommonGraphAbstractNetwork_2_initWithComGoogleCommonGraphNetwork_(id<ComGoogleCommonGraphNetwork> capture$0) {
  J2OBJC_CREATE_IMPL(ComGoogleCommonGraphAbstractNetwork_2, initWithComGoogleCommonGraphNetwork_, capture$0)
}


text:
"""
These tests are aimed to ensure that the `RawIOChunk` instances behave consistently with
the other `RawIOBase` implementations.
"""

import os
from contextlib import nullcontext as does_not_raise
from dataclasses import dataclass
from io import SEEK_CUR, SEEK_END, BufferedIOBase, BytesIO, RawIOBase
from itertools import product
from tempfile import TemporaryFile
from typing import IO, Any, Callable, ContextManager

import pytest

from io_chunks.raw_io_chunk import RawIOChunk

IOFactory = Callable[[], IO]

def temp_file_factory(contents: bytes, buffering=-1) -> IO:
    temp_file = TemporaryFile("w+b", buffering=buffering)
    temp_file.write(contents)
    temp_file.seek(0)
    return temp_file

@dataclass(frozen=True)
class UseCase:
    """
    Represent a supported use case to check compatibility with the `RawIOBase` or to
    verify it.
    Contains all the results and expectations of all the tests.

    This allows to have all the use case definitions in a single place.
    """

    factory: IOFactory
    name: str
    size: int
    full_read_result: bytes
    negative_seek_expect: ContextManager[Any]
    before_start_seek_expect: ContextManager[Any]
    seek_hole_expect: ContextManager[Any]
    seek_data_expect: ContextManager[Any]
    truncate_negative_expect: ContextManager[Any]

@dataclass(frozen=True)
class ClosedAction:
    """
    The secondary part of the use cases for the `test_closed_raises_value_error`
    """

    action: Callable[[IO], Any]
    name: str

USE_CASES = [
    UseCase(
        factory=lambda: BytesIO(b"01234"),
        name="BytesIO",
        size=5,
        full_read_result=b"01234",
        negative_seek_expect=pytest.raises(ValueError),
        before_start_seek_expect=does_not_raise(),
        seek_hole_expect=pytest.raises(ValueError),
        seek_data_expect=pytest.raises(ValueError),
        truncate_negative_expect=pytest.raises(ValueError),
    ),
    UseCase(
        factory=lambda: RawIOChunk(BytesIO(b"01234"), size=4),
        name="RawIOChunk (size 4)",
        size=4,
        full_read_result=b"0123",
        negative_seek_expect=pytest.raises(ValueError),
        before_start_seek_expect=does_not_raise(),
        seek_hole_expect=pytest.raises(ValueError),
        seek_data_expect=pytest.raises(ValueError),
        truncate_negative_expect=pytest.raises(ValueError),
    ),
    UseCase(
        factory=lambda: RawIOChunk(BytesIO(b"01234"), size=5),
        name="RawIOChunk (size 5)",
        size=5,
        full_read_result=b"01234",
        negative_seek_expect=pytest.raises(ValueError),
        before_start_seek_expect=does_not_raise(),
        seek_hole_expect=pytest.raises(ValueError),
        seek_data_expect=pytest.raises(ValueError),
        truncate_negative_expect=pytest.raises(ValueError),
    ),
    UseCase(
        factory=lambda: RawIOChunk(BytesIO(b"01234"), size=6),
        name="RawIOChunk (size 6)",
        size=6,
        full_read_result=b"01234",
        negative_seek_expect=pytest.raises(ValueError),
        before_start_seek_expect=does_not_raise(),
        seek_hole_expect=pytest.raises(ValueError),
        seek_data_expect=pytest.raises(ValueError),
        truncate_negative_expect=pytest.raises(ValueError),
    ),
    UseCase(
        factory=lambda: temp_file_factory(b"01234"),
        name="TempFile",
        size=5,
        full_read_result=b"01234",
        negative_seek_expect=pytest.raises(OSError),
        before_start_seek_expect=pytest.raises(OSError),
        seek_hole_expect=does_not_raise(),
        seek_data_expect=does_not_raise(),
        truncate_negative_expect=pytest.raises(OSError),
    ),
    UseCase(
        factory=lambda: temp_file_factory(b"01234", buffering=0),
        name="TempFile (unbuffered)",
        size=5,
        full_read_result=b"01234",
        negative_seek_expect=pytest.raises(OSError),
        before_start_seek_expect=pytest.raises(OSError),
        seek_hole_expect=does_not_raise(),
        seek_data_expect=does_not_raise(),
        truncate_negative_expect=pytest.raises(OSError),
    ),
]

CLOSED_ACTIONS = [
    ClosedAction(lambda buffer: buffer.read(), name="read"),
    ClosedAction(lambda buffer: buffer.seek(0), name="seek"),
    ClosedAction(lambda buffer: buffer.tell(), name="tell"),
    ClosedAction(lambda buffer: buffer.seekable(), name="seekable"),
    ClosedAction(lambda buffer: buffer.readable(), name="readable"),
]

use_cases_param = pytest.mark.parametrize(
    "use_case", USE_CASES, ids=lambda param: param.name
)

@use_cases_param
def test_full_read(use_case: UseCase):
    with use_case.factory() as instance:
        result = instance.read()
        assert result == use_case.full_read_result
        assert instance.read() == b""
        assert instance.read(1) == b""

@pytest.mark.parametrize(
    ["use_case", "action"],
    product(USE_CASES, CLOSED_ACTIONS),
    ids=lambda param: param.name,
)
def test_closed_raises_value_error(use_case: UseCase, action: ClosedAction):
    with use_case.factory() as instance:
        assert instance.closed is False
        action.action(instance)
        instance.close()
        assert instance.closed is True
        with pytest.raises(ValueError):
            action.action(instance)

@use_cases_param
def test_closed_values(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.tell() == 0
        assert instance.seek(0) == 0
        assert instance.readable() is True
        assert instance.seekable() is True

@use_cases_param
def test_extra_seek(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.seek(100) == 100
        assert instance.tell() == 100

@use_cases_param
def test_negative_seek(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.negative_seek_expect:
            instance.seek(-1)

@use_cases_param
def test_seek_inside(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.seek(0) == 0
        assert instance.seek(1) == 1

@use_cases_param
def test_seek_outside(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.seek(10) == 10

@use_cases_param
def test_seek_end_inside(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.seek(-1, SEEK_END) == use_case.size - 1

@use_cases_param
def test_seek_end_outside(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.before_start_seek_expect:
            assert instance.seek(-10, SEEK_END) == 0

@use_cases_param
def test_seek_cur_inside(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.seek(1) == 1
        assert instance.seek(1, SEEK_CUR) == 2
        assert instance.seek(-1, SEEK_CUR) == 1
        assert instance.seek(-1, SEEK_CUR) == 0

@use_cases_param
def test_seek_cur_ouside(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.before_start_seek_expect:
            assert instance.seek(-1, SEEK_CUR) == 0

@use_cases_param
def test_seek_hole(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.seek_hole_expect:
            instance.seek(0, os.SEEK_HOLE) == 0

@use_cases_param
def test_seek_data(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.seek_hole_expect:
            instance.seek(0, os.SEEK_DATA) == 3

@use_cases_param
def test_pos_invalid_type(use_case: UseCase):
    with use_case.factory() as instance:
        with pytest.raises(TypeError):
            instance.seek("a")  # type: ignore[arg-type]
        with pytest.raises(TypeError):
            instance.seek(1, "a")  # type: ignore[arg-type]

@use_cases_param
def test_readinto_empty_array(use_case: UseCase):
    with use_case.factory() as instance:
        # readinto is not in IO or IOBase but in RawIOBase and BufferedIOBase.
        # While this test is not part of the IO contract, it *is* part of the RawIOBase
        # contract, the class RawIOChunk inherits.
        assert isinstance(instance, (RawIOBase, BufferedIOBase))
        buffer = bytearray(0)
        assert instance.readinto(buffer) == 0
        assert buffer == b""

@use_cases_param
def test_truncate(use_case: UseCase):
    with use_case.factory() as instance:
        assert instance.truncate(2) == 2
        assert instance.read() == b"01"

@use_cases_param
def test_truncate_negative(use_case: UseCase):
    with use_case.factory() as instance:
        with use_case.truncate_negative_expect:
            assert instance.truncate(-1) == 0


text:
<?php

namespace Expidian\GlobalBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Bridge\Doctrine\Validator\Constraints as DoctrineAssert;

/**
 * Expidian\GlobalBundle\Entity\Personas
 *
 * @DoctrineAssert\UniqueEntity(fields="cedulaDeIdentidad", message="Esta persona ya se encuentra registrada en la base de datos.")
 *
 * @ORM\Table(name="personas")
 * @ORM\Entity
 */
class Personas
{
    /**
     * @var integer $idPersona
     *
     * @ORM\Column(name="id_persona", type="integer", nullable=false)
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="SEQUENCE")
     * @ORM\SequenceGenerator(sequenceName="personas_id_persona_seq", allocationSize="1", initialValue="1")
     */
    private $idPersona;

    /**
     * @var string $nombre
     *
     * @Assert\NotBlank(message="El Nombre del usuario es un dato obligatorio.")
     *
     * @ORM\Column(name="nombre", type="string", length=60, nullable=false)
     */
    private $nombre;

    /**
     * @var string $apellido
     *
     * @Assert\NotBlank(message="El Apellido del usuario es un dato obligatorio.")
     *
     * @ORM\Column(name="apellido", type="string", length=60, nullable=false)
     */
    private $apellido;

    /**
     * @var string $nacionalidad
     *
     * @Assert\Choice(choices = {"V", "E"}, message = "Debe Seleccionar un Valor Válido de Nacionalidad V o E.")
     *
     * @ORM\Column(name="nacionalidad", type="string", length=1, nullable=true)
     */
    private $nacionalidad;

    /**
     * @var decimal $cedulaDeIdentidad
     *
     * @Assert\NotBlank(message="El Número de Cédula o Pasaporte es un dato obligatorio.")
     * @Assert\Regex(pattern="/^0*[1-9][0-9]*$/" , message="El valor {{ value }} no es un {{ type }} válido.")
     *
     * @ORM\Column(name="cedula_de_identidad", type="decimal", nullable=false, unique=true)
     */
    private $cedulaDeIdentidad;

    /**
     * @var decimal $telefono1
     *
     * @Assert\Regex(pattern="/^0*[1-9][0-9]*$/" , message="El valor {{ value }} no es un {{ type }} válido.")
     * @Assert\MaxLength(limit=11,message="Ingrese un Número de Teléfono válido.")
     * @Assert\MinLength(limit=10,message="Ingrese un Número de Teléfono válido.")
     *
     * @ORM\Column(name="telefono1", type="decimal", nullable=true)
     */
    private $telefono1;

    /**
     * @var decimal $telefono2
     *
     * @Assert\Regex(pattern="/^0*[1-9][0-9]*$/" , message="El valor {{ value }} no es un {{ type }} válido.")
     * @Assert\MaxLength(limit=11,message="Ingrese un Número de Teléfono válido.")
     * @Assert\MinLength(limit=10,message="Ingrese un Número de Teléfono válido.")
     *
     * @ORM\Column(name="telefono2", type="decimal", nullable=true)
     */
    private $telefono2;

    /**
     * @var string $email
     *
     * @Assert\Email(message="E-mail inválido")
     *
     * @ORM\Column(name="email", type="string", length=255, nullable=true)
     */
    private $email;

    /**
     * @var Paises
     *
     * @ORM\ManyToOne(targetEntity="Paises")
     * @ORM\JoinColumns({
     *   @ORM\JoinColumn(name="id_pais", referencedColumnName="id_pais")
     * })
     */
    private $pais;

    /**
     * Get idPersona
     *
     * @return integer
     */
    public function getIdPersona()
    {
        return $this->idPersona;
    }

    /**
     * Set nombre
     *
     * @param string $nombre
     */
    public function setNombre($nombre)
    {
        $this->nombre = ucwords($nombre);
    }

    /**
     * Get nombre
     *
     * @return string
     */
    public function getNombre()
    {
        return $this->nombre;
    }

    /**
     * Set apellido
     *
     * @param string $apellido
     */
    public function setApellido($apellido)
    {
        $this->apellido = ucwords($apellido);
    }

    /**
     * Get apellido
     *
     * @return string
     */
    public function getApellido()
    {
        return $this->apellido;
    }

    /**
     * Set nacionalidad
     *
     * @param string $nacionalidad
     */
    public function setNacionalidad($nacionalidad)
    {
        $this->nacionalidad = strtoupper($nacionalidad);
    }

    /**
     * Get nacionalidad
     *
     * @return string
     */
    public function getNacionalidad()
    {
        return $this->nacionalidad;
    }

    /**
     * Set cedulaDeIdentidad
     *
     * @param decimal $cedulaDeIdentidad
     */
    public function setCedulaDeIdentidad($cedulaDeIdentidad)
    {
        $this->cedulaDeIdentidad = $cedulaDeIdentidad;
    }

    /**
     * Get cedulaDeIdentidad
     *
     * @return decimal
     */
    public function getCedulaDeIdentidad()
    {
        return $this->cedulaDeIdentidad;
    }

    /**
     * Set telefono1
     *
     * @param decimal $telefono1
     */
    public function setTelefono1($telefono1)
    {
        $this->telefono1 = $telefono1;
    }

    /**
     * Get telefono1
     *
     * @return decimal
     */
    public function getTelefono1()
    {
        return $this->telefono1;
    }

    /**
     * Set telefono2
     *
     * @param decimal $telefono2
     */
    public function setTelefono2($telefono2)
    {
        $this->telefono2 = $telefono2;
    }

    /**
     * Get telefono2
     *
     * @return decimal
     */
    public function getTelefono2()
    {
        return $this->telefono2;
    }

    /**
     * Set email
     *
     * @param string $email
     */
    public function setEmail($email)
    {
        $this->email = strtolower($email);
    }

    /**
     * Get email
     *
     * @return string
     */
    public function getEmail()
    {
        return $this->email;
    }

    /**
     * Set pais
     *
     * @param Expidian\GlobalBundle\Entity\Paises $pais
     */
    public function setPais(\Expidian\GlobalBundle\Entity\Paises $pais)
    {
        $this->pais = $pais;
    }

    /**
     * Get pais
     *
     * @return Expidian\GlobalBundle\Entity\Paises
     */
    public function getPais()
    {
        return $this->pais;
    }

    public function __toString(){
        return ucwords($this->nombre." ".$this->apellido);
    }

}