text:
/* DO NOT EDIT */
/* This file was generated from users.stone */

package com.dropbox.core.v2.users;

import com.dropbox.core.stone.StoneDeserializerLogger;
import com.dropbox.core.stone.StoneSerializers;
import com.dropbox.core.stone.StructSerializer;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.core.JsonParser;
import com.fasterxml.jackson.core.JsonToken;

import java.io.IOException;
import java.util.Arrays;

/**
 * The amount of detail revealed about an account depends on the user being
 * queried and the user making the query.
 */
public class Account {
    // struct users.Account (users.stone)

    protected final String accountId;
    protected final Name name;
    protected final String email;
    protected final boolean emailVerified;
    protected final String profilePhotoUrl;
    protected final boolean disabled;

    /**
     * The amount of detail revealed about an account depends on the user being
     * queried and the user making the query.
     *
     * @param accountId  The user's unique Dropbox ID. Must have length of at
     *     least 40, have length of at most 40, and not be {@code null}.
     * @param name  Details of a user's name. Must not be {@code null}.
     * @param email  The user's email address. Do not rely on this without
     *     checking the {@link Account#getEmailVerified} field. Even then, it's
     *     possible that the user has since lost access to their email. Must not
     *     be {@code null}.
     * @param emailVerified  Whether the user has verified their email address.
     * @param disabled  Whether the user has been disabled.
     * @param profilePhotoUrl  URL for the photo representing the user, if one
     *     is set.
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public Account(String accountId, Name name, String email, boolean emailVerified, boolean disabled, String profilePhotoUrl) {
        if (accountId == null) {
            throw new IllegalArgumentException("Required value for 'accountId' is null");
        }
        if (accountId.length() < 40) {
            throw new IllegalArgumentException("String 'accountId' is shorter than 40");
        }
        if (accountId.length() > 40) {
            throw new IllegalArgumentException("String 'accountId' is longer than 40");
        }
        this.accountId = accountId;
        if (name == null) {
            throw new IllegalArgumentException("Required value for 'name' is null");
        }
        this.name = name;
        if (email == null) {
            throw new IllegalArgumentException("Required value for 'email' is null");
        }
        this.email = email;
        this.emailVerified = emailVerified;
        this.profilePhotoUrl = profilePhotoUrl;
        this.disabled = disabled;
    }

    /**
     * The amount of detail revealed about an account depends on the user being
     * queried and the user making the query.
     *
     * <p> The default values for unset fields will be used. </p>
     *
     * @param accountId  The user's unique Dropbox ID. Must have length of at
     *     least 40, have length of at most 40, and not be {@code null}.
     * @param name  Details of a user's name. Must not be {@code null}.
     * @param email  The user's email address. Do not rely on this without
     *     checking the {@link Account#getEmailVerified} field. Even then, it's
     *     possible that the user has since lost access to their email. Must not
     *     be {@code null}.
     * @param emailVerified  Whether the user has verified their email address.
     * @param disabled  Whether the user has been disabled.
     *
     * @throws IllegalArgumentException  If any argument does not meet its
     *     preconditions.
     */
    public Account(String accountId, Name name, String email, boolean emailVerified, boolean disabled) {
        this(accountId, name, email, emailVerified, disabled, null);
    }

    /**
     * The user's unique Dropbox ID.
     *
     * @return value for this field, never {@code null}.
     */
    public String getAccountId() {
        return accountId;
    }

    /**
     * Details of a user's name.
     *
     * @return value for this field, never {@code null}.
     */
    public Name getName() {
        return name;
    }

    /**
     * The user's email address. Do not rely on this without checking the {@link
     * Account#getEmailVerified} field. Even then, it's possible that the user
     * has since lost access to their email.
     *
     * @return value for this field, never {@code null}.
     */
    public String getEmail() {
        return email;
    }

    /**
     * Whether the user has verified their email address.
     *
     * @return value for this field.
     */
    public boolean getEmailVerified() {
        return emailVerified;
    }

    /**
     * Whether the user has been disabled.
     *
     * @return value for this field.
     */
    public boolean getDisabled() {
        return disabled;
    }

    /**
     * URL for the photo representing the user, if one is set.
     *
     * @return value for this field, or {@code null} if not present.
     */
    public String getProfilePhotoUrl() {
        return profilePhotoUrl;
    }

    @Override
    public int hashCode() {
        int hash = Arrays.hashCode(new Object [] {
            accountId,
            name,
            email,
            emailVerified,
            profilePhotoUrl,
            disabled
        });
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == this) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        // be careful with inheritance
        else if (obj.getClass().equals(this.getClass())) {
            Account other = (Account) obj;
            return ((this.accountId == other.accountId) || (this.accountId.equals(other.accountId)))
                && ((this.name == other.name) || (this.name.equals(other.name)))
                && ((this.email == other.email) || (this.email.equals(other.email)))
                && (this.emailVerified == other.emailVerified)
                && (this.disabled == other.disabled)
                && ((this.profilePhotoUrl == other.profilePhotoUrl) || (this.profilePhotoUrl != null && this.profilePhotoUrl.equals(other.profilePhotoUrl)))
                ;
        }
        else {
            return false;
        }
    }

    @Override
    public String toString() {
        return Serializer.INSTANCE.serialize(this, false);
    }

    /**
     * Returns a String representation of this object formatted for easier
     * readability.
     *
     * <p> The returned String may contain newlines. </p>
     *
     * @return Formatted, multiline String representation of this object
     */
    public String toStringMultiline() {
        return Serializer.INSTANCE.serialize(this, true);
    }

    /**
     * For internal use only.
     */
    private static class Serializer extends StructSerializer<Account> {
        public static final Serializer INSTANCE = new Serializer();

        @Override
        public void serialize(Account value, JsonGenerator g, boolean collapse) throws IOException, JsonGenerationException {
            if (!collapse) {
                g.writeStartObject();
            }
            g.writeFieldName("account_id");
            StoneSerializers.string().serialize(value.accountId, g);
            g.writeFieldName("name");
            Name.Serializer.INSTANCE.serialize(value.name, g);
            g.writeFieldName("email");
            StoneSerializers.string().serialize(value.email, g);
            g.writeFieldName("email_verified");
            StoneSerializers.boolean_().serialize(value.emailVerified, g);
            g.writeFieldName("disabled");
            StoneSerializers.boolean_().serialize(value.disabled, g);
            if (value.profilePhotoUrl != null) {
                g.writeFieldName("profile_photo_url");
                StoneSerializers.nullable(StoneSerializers.string()).serialize(value.profilePhotoUrl, g);
            }
            if (!collapse) {
                g.writeEndObject();
            }
        }

        @Override
        public Account deserialize(JsonParser p, boolean collapsed) throws IOException, JsonParseException {
            Account value;
            String tag = null;
            if (!collapsed) {
                expectStartObject(p);
                tag = readTag(p);
            }
            if (tag == null) {
                String f_accountId = null;
                Name f_name = null;
                String f_email = null;
                Boolean f_emailVerified = null;
                Boolean f_disabled = null;
                String f_profilePhotoUrl = null;
                while (p.getCurrentToken() == JsonToken.FIELD_NAME) {
                    String field = p.getCurrentName();
                    p.nextToken();
                    if ("account_id".equals(field)) {
                        f_accountId = StoneSerializers.string().deserialize(p);
                    }
                    else if ("name".equals(field)) {
                        f_name = Name.Serializer.INSTANCE.deserialize(p);
                    }
                    else if ("email".equals(field)) {
                        f_email = StoneSerializers.string().deserialize(p);
                    }
                    else if ("email_verified".equals(field)) {
                        f_emailVerified = StoneSerializers.boolean_().deserialize(p);
                    }
                    else if ("disabled".equals(field)) {
                        f_disabled = StoneSerializers.boolean_().deserialize(p);
                    }
                    else if ("profile_photo_url".equals(field)) {
                        f_profilePhotoUrl = StoneSerializers.nullable(StoneSerializers.string()).deserialize(p);
                    }
                    else {
                        skipValue(p);
                    }
                }
                if (f_accountId == null) {
                    throw new JsonParseException(p, "Required field \"account_id\" missing.");
                }
                if (f_name == null) {
                    throw new JsonParseException(p, "Required field \"name\" missing.");
                }
                if (f_email == null) {
                    throw new JsonParseException(p, "Required field \"email\" missing.");
                }
                if (f_emailVerified == null) {
                    throw new JsonParseException(p, "Required field \"email_verified\" missing.");
                }
                if (f_disabled == null) {
                    throw new JsonParseException(p, "Required field \"disabled\" missing.");
                }
                value = new Account(f_accountId, f_name, f_email, f_emailVerified, f_disabled, f_profilePhotoUrl);
            }
            else {
                throw new JsonParseException(p, "No subtype found that matches tag: \"" + tag + "\"");
            }
            if (!collapsed) {
                expectEndObject(p);
            }
            StoneDeserializerLogger.log(value, value.toStringMultiline());
            return value;
        }
    }
}


text:
<?php namespace App\Tests\User\Auth;

use App\Tests\TestCase;

class PasswordTest extends TestCase
{
	remindPassword

  public function test_Password_Remind()
    {
        $this->visit('/auth/password/reset');
        $this->see('ghvghcghcgh');
        $this->type('dfbdfbfdb', 'email');
        $this->press('Вход');
        $this->see('ghvghcghcgh');
    }

	resetPassword

  public function test_ChangePassword()
    {
        $this->it_provides_password_reset_to_registered_email();

        $passwordReset = DB::table('password_resets')->select('token')->where('email', $this->user->email)->first();

        $this->visit('/auth/password/reset/'.$passwordReset->token);
            ->type($this->user->email, 'email');
            ->type('nevermind', 'password');
            ->type('nevermind', 'password_confirmation');
            ->press('Reset password');
            ->assertEquals($this->user->email, auth()->user()->email);
    }

    public function it_rejects_unregistered_email()
    {
        $this->visit(route('user.agenda'));
             ->seePageIs('/auth/login');
             ->click('Forgot password');
             ->type('unregistered@example.org', 'email');
             ->press('Send me the reset link');
             ->see('We can\'t find a user with that e-mail address.');
    }

    public function it_provides_password_reset_to_registered_email()
    {
        $this->user = $this->createUser();
        $this->visit(route('user.agenda'));
            ->seePageIs('/auth/login');
            ->click('Forgot password');
            ->type($this->user->email, 'email');
            ->press('Send me the reset link');
            ->see('We have e-mailed your password reset link');
    }

    public function it_rejects_invalid_token()
    {
        $this->it_provides_password_reset_to_registered_email();
            ->visit('/auth/password/reset/'.'an-invalid-token');
            ->type($this->user->email, 'email');
            ->type('nevermind', 'password');
            ->type('nevermind', 'password_confirmation');
            ->press('Reset password');
            ->see('This password reset token is invalid');
    }

    public function test_ChangePassword()
    {
        $this->visit('/');
        $this->see('The booking app for successful professionals')
             ->see('Let\'s begin')
             ->see('Login');
    }
}

redpajama_set_name: RedPajamaGithub


text:
class CreateWidgets < ActiveRecord::Migration
  def change
    create_table :widgets do |col|
      col.string :title
      col.text :content
      col.timestamps
    end
  end
end


text:
steal('steal','./post','steal/rhino/prompt.js',function(s, post){
/**
 * Gets the sha of the most recent commit
 *
 * @param {Object} info the github repos information
 * @return {String} the sha of the most recent commit (ex: 'ba7013dfaee2e503069f594ec271ec9795edb16c')
 */
var lastCommitSha = function(inf, token){
	var commitsText = readUrl("https://api.github.com/repos/" +
								inf.user + "/" +
								inf.repo + "/" +
								"commits?sha=" + inf.branch + (token ? "&access_token="+token : "") );

	eval("var commits = " + commitsText);
	return commits[0].commit.tree.sha;
},
/**
 * Gets the API url for the tree at the sha specified
 *
 * @param {Object} info the github repos information
 * @param {String} sha the sha of the tree
 * @param {Boolean} recursive whether we want to get the tree recursively (i.e. all tress within this tree)
 * @param {String} token
 * @return {String} the API url of the tree (ex: 'https://api.github.com/repos/jupiterjs/funcunit/git/trees/ba7013dfaee2e503069f594ec271ec9795edb16c')
 */
getTreeUrl = function(inf, sha, recursive, token){
	sha = !sha ? lastCommitSha(inf) : sha;
	var url = "https://api.github.com/repos/" +
				inf.user + "/" +
				inf.repo + "/" +
				"git/trees/" + sha;
	var after = [];

	if(recursive) {
		after.push("recursive=1");
	}
	if(token){
		after.push("access_token="+token)
	}
	if(after.length){
		url +="?"+after.join("&")
	}
	return url;
},
/**
 * Gets the API url for the folder(tree) at the sha specified
 * Traverse the whole repo tree until we find the matching
 * folder path
 *
 * @param {Object} info the github repos information
 * @return {String} the API url of the folder (ex: 'https://api.github.com/repos/jupiterjs/funcunit/git/trees/ba7013dfaee2e503069f594ec271ec9795edb16c')
 */
getFolderUrl = function(inf, token) {
	var repoTreeText = readUrl(getTreeUrl(inf, inf.branch, true, token)),
		repoTree,
		folderPath = inf.resource.replace(/\/$/, ""),
		sha;

	eval("var t = " + repoTreeText);
	repoTree = t.tree;
	for(file in repoTree) {
		//print('-f ' + repoTree[file].path);
		if(folderPath === repoTree[file].path) {
			sha = repoTree[file].sha;
			break;
		}
	}
	return getTreeUrl(inf, sha, undefined, token);
},
github = s.get.git = {
		/**
		 * Generate a map of names to urls
		 *
		 * @param {String} content tree data from the repo/folder
		 * @param {String} rawUrl the API url for the repo/folder
		 * @param {String} originalUrl the original url for the repo/folder
		 * @return {Object} mapping of names to urls
		 */
		ls : function(content, rawUrl, originalUrl, options){
			var info = github.info(originalUrl),
				tree,
				item,
				data = {}

			//print("item -- "+info.base)

			eval("var t = " + content);
			tree = t.tree;
			// use gitHub's commit API
			for(var i = 0; i < tree.length; i++) {
				item = tree[i]
				//print('item: ' + item.path)
				if(item.path.indexOf(".git") === 0){

				} else if ( item.type == "blob" ) {
					data[item.path] = info.base + item.path;
				}
				else if ( item.type == "tree" ) {
					data[item.path+"/"] = info.base + item.path+"/";
				}
			}

			return data;

		},
		/**
		 * Return the raw place to get the repo/folder contents
		 * or doanload a file
		 *
		 * - root folder will return the API url for the root tree
		 * - folder will return the API url for folder's tree
		 * - file will return the raw download url
		 *
		 * @param {String} url url to convert
		 * @return {String} raw place to doanload contents or file
		 */
		raw : function(url, options){
			var options = options || {}
			github.init(options);
			var info = github.info(url);
			if(info.resource == "/"){ // root level folder
				return getTreeUrl(info, null, null, options.token)
			} else if( /\/$/.test(url) ) { // a folder
				return getFolderUrl(info,options.token)
			} else { // download url
				return "https://raw."+info.domain+"/"+info.user+"/"+info.repo+"/"+info.branch+"/"+info.resource
			}
		},
		/**
		 * Helper to get info for a github repo
		 *
		 * Resulting info object has the following properties:
		 *
		 * - `protocol`: protocol of the url
		 * - `domain`: domain of the repo
		 * - `user`: github user
		 * - `repo`: repo's name
		 * - `branch`: branch from url or master
		 * - `resource`: path within the current repo
		 * - `base`: base url for the repo
		 *
		 * @param {String} url url of the repo
		 * @return {Object} containing the repo info
		 */
		info : function(url){
			var split = url.split("/"),
				data = {},
				branch;
			data.protcol = split.shift();
			split.shift();
			data.domain = split.shift();
			data.user = split.shift();
			data.repo = split.shift();

			branch = split.shift();
			if(branch === 'tree' || branch === 'raw' || branch === 'blob'){
				branch = split.shift();
			}
			data.branch = branch || 'master';

			data.resource = split.join('/').replace(/\?.*/,"") || "/";
			data.base = "https://"+data.domain+"/"+data.user+"/"+data.repo+"/tree/"+data.branch+"/"+( data.resource == "/" ? "" : data.resource)
			return data;
		},
		getTreeUrl : getTreeUrl,
		getFolderUrl : getFolderUrl,
		init: function(options){
			if(options.token){
				return;
			}
			var token = readFile(".steal_git_token");
			if(!token){
				print("You don't have an OAuth token. I will create one for you.\n"+
				"I need your github username and password just once to create one.\n"+
				"I will not save your password, just the token.")
				var user = s.prompt("Github Username: ")
				var pass = s.promptPassword("Github Password: ")

				var response = post({
					url: "https://api.github.com/authorizations",
					data: '{"scopes":["public_repo"],"note":"steal get"}',
					username: user,
					password: pass
				});

				eval("var data = " + response);
				token = data.token;

				print("Saving token at .steal_git_token. Delete it if you want to create a new one.");
				s.File(".steal_git_token").save(token)

			}
			options.token = token;
		}
	};
})()


text:
/**
 * Copyright 2011, Big Switch Networks, Inc.
 * Originally created by David Erickson, Stanford University
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may
 * not use this file except in compliance with the License. You may obtain
 * a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations
 * under the License.
 **/

package net.onrc.openvirtex.packet;

import java.util.Arrays;

/**
 *
 * @author David Erickson (daviderickson@cs.stanford.edu)
 */
public class DHCPOption {
	protected byte code;
	protected byte length;
	protected byte[] data;

	/**
	 * @return the code
	 */
	public byte getCode() {
		return this.code;
	}

	/**
	 * @param code
	 *            the code to set
	 */
	public DHCPOption setCode(final byte code) {
		this.code = code;
		return this;
	}

	/**
	 * @return the length
	 */
	public byte getLength() {
		return this.length;
	}

	/**
	 * @param length
	 *            the length to set
	 */
	public DHCPOption setLength(final byte length) {
		this.length = length;
		return this;
	}

	/**
	 * @return the data
	 */
	public byte[] getData() {
		return this.data;
	}

	/**
	 * @param data
	 *            the data to set
	 */
	public DHCPOption setData(final byte[] data) {
		this.data = data;
		return this;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#hashCode()
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + this.code;
		result = prime * result + Arrays.hashCode(this.data);
		result = prime * result + this.length;
		return result;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#equals(java.lang.Object)
	 */
	@Override
	public boolean equals(final Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (!(obj instanceof DHCPOption)) {
			return false;
		}
		final DHCPOption other = (DHCPOption) obj;
		if (this.code != other.code) {
			return false;
		}
		if (!Arrays.equals(this.data, other.data)) {
			return false;
		}
		if (this.length != other.length) {
			return false;
		}
		return true;
	}

	/*
	 * (non-Javadoc)
	 *
	 * @see java.lang.Object#toString()
	 */
	@Override
	public String toString() {
		return "DHCPOption [code=" + this.code + ", length=" + this.length
				+ ", data=" + Arrays.toString(this.data) + "]";
	}
}


text:
<!--
  ~ Copyright 2022 Blue Circle Software, LLC
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~     http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
  ~
  -->

<configuration>

    <appender name="FILE" class="ch.qos.logback.core.FileAppender">
        <file>target/it-spring-server.log</file>
        <append>true</append>
        <!-- set immediateFlush to false for much higher logging throughput -->
        <immediateFlush>true</immediateFlush>
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%-4relative [%thread] %-5level %logger{35} - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="DEBUG">
        <appender-ref ref="FILE" />
    </root>
</configuration>


text:
<?php
/**
 * Created by JetBrains PhpStorm.
 * User: erlangb
 * Date: 26/06/13
 * Time: 2.03
 * To change this template use File | Settings | File Templates.
 */

namespace Meytip\InnlabBundle\Listener;

use FOS\UserBundle\Event\FormEvent;
use FOS\UserBundle\Event\GetResponseUserEvent;
use FOS\UserBundle\FOSUserEvents;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;

class RegistrationConfirmListener implements EventSubscriberInterface
{
    private $router;

    public function __construct(UrlGeneratorInterface $router)
    {
        $this->router = $router;
    }

    /**
     * {@inheritDoc}
     */
    public static function getSubscribedEvents()
    {
        return array(
            FOSUserEvents::REGISTRATION_SUCCESS => 'onRegistrationConfirm'
        );
    }

    public function onRegistrationConfirm(FormEvent $event)
    {
        $url = $this->router->generate('scommessa');

        $event->setResponse(new RedirectResponse($url));
    }
}


text:
package com.jetbrains.python.codeInsight.parameterInfo;

import com.intellij.codeInsight.parameterInfo.ParameterFlag;
import com.intellij.lang.parameterInfo.ParameterInfoUtilsBase;
import com.intellij.openapi.util.Pair;
import com.intellij.openapi.util.TextRange;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.psi.util.PsiTreeUtil;
import com.intellij.util.text.CharArrayUtil;
import com.jetbrains.python.psi.*;
import com.jetbrains.python.psi.impl.ParamHelper;
import com.jetbrains.python.psi.impl.PyCallExpressionHelper;
import com.jetbrains.python.psi.impl.PyPsiUtils;
import com.jetbrains.python.psi.resolve.PyResolveContext;
import com.jetbrains.python.psi.types.PyCallableParameter;
import com.jetbrains.python.psi.types.PyCallableParameterImpl;
import com.jetbrains.python.psi.types.PyStructuralType;
import com.jetbrains.python.psi.types.TypeEvalContext;
import org.jetbrains.annotations.ApiStatus;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.*;
import java.util.stream.Collectors;

@ApiStatus.Internal
public final class PyParameterInfoUtils {

  @Nullable
  public static PyArgumentList findArgumentList(PsiFile file, int contextOffset, int parameterListStart) {
    final PyArgumentList argumentList =
      ParameterInfoUtilsBase.findParentOfType(file, contextOffset - 1, PyArgumentList.class);

    if (argumentList != null && parameterListStart >= 0 && argumentList.getTextRange().getStartOffset() != parameterListStart) {
      return PsiTreeUtil.getParentOfType(argumentList, PyArgumentList.class);
    }

    return argumentList;
  }

  public static List<Pair<PyCallExpression, PyCallExpression.PyMarkedCallee>> findCallCandidates(PyArgumentList argumentList) {
    if (argumentList != null) {
      final PyCallExpression call = argumentList.getCallExpression();
      if (call != null) {
        final TypeEvalContext typeEvalContext = TypeEvalContext.userInitiated(argumentList.getProject(), argumentList.getContainingFile());
        final PyResolveContext resolveContext = PyResolveContext.defaultContext().withRemote().withTypeEvalContext(typeEvalContext);

        return PyUtil
          .filterTopPriorityResults(call.multiResolveCallee(resolveContext))
          .stream()
          .filter(markedCallee -> markedCallee.getCallableType().getParameters(typeEvalContext) != null)
          .map(markedCallee -> Pair.createNonNull(call, markedCallee))
          .collect(Collectors.toList());
      }
    }
    return null;
  }

  /**
   * builds the textual picture and the list of named parameters
   *
   * @param parameters            parameters of a callable
   * @param indexToNamedParameter used to collect all named parameters of callable
   * @param parameterToHintIndex  used to collect info about parameter hints
   * @param hintFlags             mark parameter as deprecated/highlighted/strikeout
   * @param context               context to be used to get parameter representation
   */
  public static List<String> buildParameterListHint(@NotNull List<PyCallableParameter> parameters,
                                                    @NotNull final Map<Integer, PyCallableParameter> indexToNamedParameter,
                                                    @NotNull final Map<PyCallableParameter, Integer> parameterToHintIndex,
                                                    @NotNull final Map<Integer, EnumSet<ParameterFlag>> hintFlags,
                                                    @NotNull TypeEvalContext context) {
    final List<String> hintsList = new ArrayList<>();
    final int[] currentParameterIndex = new int[]{0};
    ParamHelper.walkDownParameters(
      parameters,
      new ParamHelper.ParamWalker() {
        @Override
        public void enterTupleParameter(PyTupleParameter param, boolean first, boolean last) {
          hintFlags.put(hintsList.size(), EnumSet.noneOf(ParameterFlag.class));
          hintsList.add("(");
        }

        @Override
        public void leaveTupleParameter(PyTupleParameter param, boolean first, boolean last) {
          hintFlags.put(hintsList.size(), EnumSet.noneOf(ParameterFlag.class));
          hintsList.add(last ? ")" : "), ");
        }

        @Override
        public void visitNamedParameter(PyNamedParameter param, boolean first, boolean last) {
          visitNonPsiParameter(PyCallableParameterImpl.psi(param), first, last);
        }

        @Override
        public void visitSlashParameter(@NotNull PySlashParameter param, boolean first, boolean last) {
          hintFlags.put(hintsList.size(), EnumSet.noneOf(ParameterFlag.class));
          hintsList.add(last ? "/" : "/, ");
          currentParameterIndex[0]++;
        }

        @Override
        public void visitSingleStarParameter(PySingleStarParameter param, boolean first, boolean last) {
          hintFlags.put(hintsList.size(), EnumSet.noneOf(ParameterFlag.class));
          hintsList.add(last ? "*" : "*, ");
          currentParameterIndex[0]++;
        }

        @Override
        public void visitNonPsiParameter(@NotNull PyCallableParameter parameter, boolean first, boolean last) {
          indexToNamedParameter.put(currentParameterIndex[0], parameter);
          final StringBuilder stringBuilder = new StringBuilder();
          stringBuilder.append(parameter.getPresentableText(true, context, type -> type == null || type instanceof PyStructuralType));
          if (!last) stringBuilder.append(", ");
          final int hintIndex = hintsList.size();
          parameterToHintIndex.put(parameter, hintIndex);
          hintFlags.put(hintIndex, EnumSet.noneOf(ParameterFlag.class));
          hintsList.add(stringBuilder.toString());
          currentParameterIndex[0]++;
        }
      }
    );
    return hintsList;
  }

  public static void highlightParameter(@NotNull final PyCallableParameter parameter,
                                        @NotNull final Map<PyCallableParameter, Integer> parameterToHintIndex,
                                        @NotNull final Map<Integer, EnumSet<ParameterFlag>> hintFlags,
                                        boolean mustHighlight) {
    final Integer hintIndex = parameterToHintIndex.get(parameter);
    if (mustHighlight && hintIndex != null && hintFlags.containsKey(hintIndex)) {
      hintFlags.get(hintIndex).add(ParameterFlag.HIGHLIGHT);
    }
  }

  @NotNull
  public static List<PyCallableParameter> getFlattenedTupleParameterComponents(@NotNull PyTupleParameter parameter) {
    final List<PyCallableParameter> results = new ArrayList<>();
    for (PyParameter component : parameter.getContents()) {
      if (component instanceof PyNamedParameter) {
        results.add(PyCallableParameterImpl.psi(component));
      }
      else if (component instanceof PyTupleParameter) {
        results.addAll(getFlattenedTupleParameterComponents((PyTupleParameter)component));
      }
    }
    return results;
  }

  /**
   * match params to available args, highlight current param(s)
   *
   * @return index of last parameter
   */
  public static int collectHighlights(@NotNull final PyCallExpression.PyArgumentsMapping mapping,
                                      @NotNull final List<PyCallableParameter> parameterList,
                                      @NotNull final Map<PyCallableParameter, Integer> parameterHintToIndex,
                                      @NotNull final Map<Integer, EnumSet<ParameterFlag>> hintFlags,
                                      @NotNull final List<PyExpression> flatArgs,
                                      int currentParamOffset) {
    final PyCallExpression.PyMarkedCallee callee = mapping.getMarkedCallee();
    assert callee != null;
    int lastParamIndex = callee.getImplicitOffset();
    final Map<PyExpression, PyCallableParameter> mappedParameters = mapping.getMappedParameters();
    final Map<PyExpression, PyCallableParameter> mappedTupleParameters = mapping.getMappedTupleParameters();
    for (PyExpression arg : flatArgs) {
      final boolean mustHighlight = arg.getTextRange().contains(currentParamOffset);
      PsiElement seeker = arg;
      // An argument tuple may have been flattened; find it
      while (!(seeker instanceof PyArgumentList) && seeker instanceof PyExpression && !mappedParameters.containsKey(seeker)) {
        seeker = seeker.getParent();
      }
      if (seeker instanceof PyExpression) {
        final PyCallableParameter parameter = mappedParameters.get((PyExpression)seeker);
        lastParamIndex = Math.max(lastParamIndex, parameterList.indexOf(parameter));
        if (parameter != null) {
          highlightParameter(parameter, parameterHintToIndex, hintFlags, mustHighlight);
        }
      }
      else if (PyCallExpressionHelper.isVariadicPositionalArgument(arg)) {
        for (PyCallableParameter parameter : mapping.getParametersMappedToVariadicPositionalArguments()) {
          lastParamIndex = Math.max(lastParamIndex, parameterList.indexOf(parameter));
          highlightParameter(parameter, parameterHintToIndex, hintFlags, mustHighlight);
        }
      }
      else if (PyCallExpressionHelper.isVariadicKeywordArgument(arg)) {
        for (PyCallableParameter parameter : mapping.getParametersMappedToVariadicKeywordArguments()) {
          lastParamIndex = Math.max(lastParamIndex, parameterList.indexOf(parameter));
          highlightParameter(parameter, parameterHintToIndex, hintFlags, mustHighlight);
        }
      }
      else {
        final PyTupleParameter tupleParameter = Optional
          .ofNullable(mappedTupleParameters.get(arg))
          .map(PyCallableParameter::getParameter)
          .map(psi -> PyUtil.as(psi, PyTupleParameter.class))
          .orElse(null);

        if (tupleParameter != null) {
          for (PyCallableParameter parameter : getFlattenedTupleParameterComponents(tupleParameter)) {
            lastParamIndex = Math.max(lastParamIndex, parameterList.indexOf(parameter));
            highlightParameter(parameter, parameterHintToIndex, hintFlags, mustHighlight);
          }
        }
      }
    }
    return lastParamIndex;
  }

  public static void highlightNext(@NotNull final PyCallExpression.PyMarkedCallee marked,
                                   @NotNull final List<PyCallableParameter> parameterList,
                                   @NotNull final Map<Integer, PyCallableParameter> indexToNamedParameter,
                                   @NotNull final Map<PyCallableParameter, Integer> parameterToHintIndex,
                                   @NotNull final Map<Integer, EnumSet<ParameterFlag>> hintFlags,
                                   boolean isArgsEmpty, int lastParamIndex) {
    boolean canOfferNext = true; // can we highlight next unfilled parameter
    for (EnumSet<ParameterFlag> set : hintFlags.values()) {
      if (set.contains(ParameterFlag.HIGHLIGHT)) {
        canOfferNext = false;
        break;
      }
    }
    // highlight the next parameter to be filled
    if (canOfferNext) {
      int highlightIndex = Integer.MAX_VALUE; // initially beyond reason = no highlight
      if (isArgsEmpty) {
        highlightIndex = marked.getImplicitOffset(); // no args, highlight first (PY-3690)
      }
      else if (lastParamIndex < parameterList.size() - 1) { // lastParamIndex not at end, or no args
        if (!indexToNamedParameter.containsKey(lastParamIndex) || indexToNamedParameter.get(lastParamIndex).isPositionalContainer()) {
          highlightIndex = lastParamIndex; // stick to *arg
        }
        else {
          highlightIndex = lastParamIndex + 1; // highlight next
        }
      }
      else if (lastParamIndex == parameterList.size() - 1) { // we're right after the end of param list
        final PyCallableParameter parameter = indexToNamedParameter.get(lastParamIndex);
        if (parameter.isPositionalContainer() || parameter.isKeywordContainer()) {
          highlightIndex = lastParamIndex; // stick to *arg
        }
      }
      if (indexToNamedParameter.containsKey(highlightIndex)) {
        hintFlags.get(parameterToHintIndex.get(indexToNamedParameter.get(highlightIndex))).add(ParameterFlag.HIGHLIGHT);
      }
    }
  }

  public static void highlightParameters(PyCallExpression callExpression,
                                         PyCallExpression.PyMarkedCallee markedCallee,
                                         List<PyCallableParameter> parameters,
                                         PyCallExpression.PyArgumentsMapping mapping,
                                         Map<Integer, PyCallableParameter> indexToNamedParameter,
                                         Map<PyCallableParameter, Integer> parameterToHintIndex,
                                         Map<Integer, EnumSet<ParameterFlag>> hintFlags,
                                         int currentParamOffset) {
    // gray out enough first parameters as implicit (self, cls, ...)
    for (int i = 0; i < markedCallee.getImplicitOffset(); i++) {
      if (indexToNamedParameter.containsKey(i)) {
        final PyCallableParameter parameter = indexToNamedParameter.get(i);
        hintFlags.get(parameterToHintIndex.get(parameter)).add(ParameterFlag.DISABLE); // show but mark as absent
      }
    }

    final List<PyExpression> flattenedArguments = PyUtil.flattenedParensAndLists(callExpression.getArguments());
    final int lastParamIndex =
      collectHighlights(mapping, parameters, parameterToHintIndex, hintFlags, flattenedArguments, currentParamOffset);

    highlightNext(markedCallee, parameters, indexToNamedParameter, parameterToHintIndex, hintFlags, flattenedArguments.isEmpty(),
                  lastParamIndex);
  }

  public static int findCurrentParameter(@NotNull PyArgumentList argumentList, int allegedCursorOffset, PsiFile file) {
    CharSequence chars = file.getViewProvider().getContents();
    // align offset to nearest expression; context may point to a space, etc.
    final List<PyExpression> flattenedArguments = PyUtil.flattenedParensAndLists(argumentList.getArguments());
    int offset = -1;
    for (PyExpression argument : flattenedArguments) {
      final TextRange range = argument.getTextRange();

      // widen the range to include all whitespace around the argument
      final int left = CharArrayUtil.shiftBackward(chars, range.getStartOffset() - 1, " \t\r\n");
      int right = CharArrayUtil.shiftForwardCarefully(chars, range.getEndOffset(), " \t\r\n");
      if (argument.getParent() instanceof PyListLiteralExpression || argument.getParent() instanceof PyTupleExpression) {
        right = CharArrayUtil.shiftForward(chars, range.getEndOffset(), " \t\r\n])");
      }

      if (left <= allegedCursorOffset && right >= allegedCursorOffset) {
        offset = range.getStartOffset();
        break;
      }
    }
    return offset;
  }

  @Nullable
  public static ParameterHints buildParameterHints(@NotNull Pair<PyCallExpression, PyCallExpression.PyMarkedCallee> callAndCallee,
                                                   int currentParamOffset) {
    final PyCallExpression callExpression = callAndCallee.getFirst();
    PyPsiUtils.assertValid(callExpression);

    final TypeEvalContext typeEvalContext = TypeEvalContext.userInitiated(callExpression.getProject(), callExpression.getContainingFile());
    final PyCallExpression.PyMarkedCallee markedCallee = callAndCallee.getSecond();

    final List<PyCallableParameter> parameters = markedCallee.getCallableType().getParameters(typeEvalContext);
    if (parameters == null) return null;

    final PyCallExpression.PyArgumentsMapping mapping = PyCallExpressionHelper.mapArguments(callExpression, markedCallee, typeEvalContext);
    if (mapping.getMarkedCallee() == null) return null;

    final Map<Integer, PyCallableParameter> indexToNamedParameter = new HashMap<>(parameters.size());

    // param -> hint index. indexes are not contiguous, because some hints are parentheses.
    final Map<PyCallableParameter, Integer> parameterToHintIndex = new HashMap<>();
    // formatting of hints: hint index -> flags. this includes flags for parens.
    final Map<Integer, EnumSet<ParameterFlag>> hintFlags = new HashMap<>();

    final List<String> hintsList =
      buildParameterListHint(parameters, indexToNamedParameter, parameterToHintIndex, hintFlags, typeEvalContext);

    highlightParameters(callExpression, markedCallee, parameters, mapping, indexToNamedParameter, parameterToHintIndex, hintFlags,
                        currentParamOffset);

    return new ParameterHints(hintsList, hintFlags);
  }
}


text:
<?php
/**
 * Author: Andrey Morozov
 * Email: andrey@3davinci.ru
 * Date: 03.05.2017
 */

namespace Sberbank\Tests\Exception;

use PHPUnit\Framework\TestCase;
use Sberbank\Exception\InvalidRequestException;

class InvalidRequestExceptionTest extends TestCase
{
    public function testConstruct()
    {
        $exception = new InvalidRequestException('Error');
        $this->assertSame('Error', $exception->getMessage());
    }
}


text:
import TodoController from './todo.controller';
export default{
    name: 'todoComponent',
    config: {
        templateUrl: './app/components/todo/todo.component.html',
        controller: [TodoController]
    }
}


text:
using System;
using System.IO;
using System.Threading;
using System.Threading.Tasks;
using Marten.Internal.Sessions;
using Marten.Linq.QueryHandlers;
using Marten.Services;
#nullable enable
namespace Marten
{
    internal class JsonLoader: IJsonLoader
    {
        private readonly QuerySession _session;

        public JsonLoader(QuerySession session)
        {
            _session = session;
        }

        public string? FindById<T>(string id) where T : class
        {
            return findJsonById<T, string>(id);
        }

        public Task<string?> FindByIdAsync<T>(string id, CancellationToken token) where T : class
        {
            return findJsonByIdAsync<T, string>(id, token);
        }

        public Task<string?> FindJsonByIdAsync<T>(int id, CancellationToken token) where T : class
        {
            return findJsonByIdAsync<T, int>(id, token);
        }

        private string? findJsonById<T, TId>(TId id) where T : notnull where TId : notnull
        {
            var storage = _session.QueryStorageFor<T, TId>();
            var command = storage.BuildLoadCommand(id, _session.Tenant);

            return _session.Database.LoadOne(command, LinqConstants.StringValueSelector);
        }

        private Task<string?> findJsonByIdAsync<T, TId>(TId id, CancellationToken token) where T : notnull where TId : notnull
        {
            var storage = _session.QueryStorageFor<T, TId>();
            var command = storage.BuildLoadCommand(id, _session.Tenant);

            return _session.Database.LoadOneAsync(command, LinqConstants.StringValueSelector, token);
        }

        public string? FindById<T>(int id) where T : class
        {
            return findJsonById<T, int>(id);
        }

        public string? FindById<T>(long id) where T : class
        {
            return findJsonById<T, long>(id);
        }

        public string? FindById<T>(Guid id) where T : class
        {
            return findJsonById<T, Guid>(id);
        }

        public Task<string?> FindByIdAsync<T>(int id, CancellationToken token = new CancellationToken()) where T : class
        {
            return findJsonByIdAsync<T, int>(id, token);
        }

        public Task<string?> FindByIdAsync<T>(long id, CancellationToken token = new CancellationToken()) where T : class
        {
            return findJsonByIdAsync<T, long>(id, token);
        }

        public Task<string?> FindByIdAsync<T>(Guid id, CancellationToken token = new CancellationToken()) where T : class
        {
            return findJsonByIdAsync<T, Guid>(id, token);
        }

        public Task<bool> StreamById<T>(int id, Stream destination, CancellationToken token = default) where T : class
        {
            return streamJsonById<T, int>(id, destination, token);
        }

        private Task<bool> streamJsonById<T, TId>(TId id, Stream destination, CancellationToken token) where T : class where TId : notnull
        {
            var storage = _session.QueryStorageFor<T, TId>();
            var command = storage.BuildLoadCommand(id, _session.Tenant);

            return _session.Database.StreamOne(command, destination, token);
        }

        public Task<bool> StreamById<T>(long id, Stream destination, CancellationToken token = default) where T : class
        {
            return streamJsonById<T, long>(id, destination, token);
        }

        public Task<bool> StreamById<T>(string id, Stream destination, CancellationToken token = default) where T : class
        {
            return streamJsonById<T, string>(id, destination, token);
        }

        public Task<bool> StreamById<T>(Guid id, Stream destination, CancellationToken token = default) where T : class
        {
            return streamJsonById<T, Guid>(id, destination, token);
        }
    }
}


text:
import React from 'react';
import PropTypes from 'prop-types';
import Helmet from 'react-helmet';
import { StaticQuery, graphql } from 'gatsby';

function SEO({ description, lang, meta, keywords, title }) {
  return (
    <StaticQuery
      query={detailsQuery}
      render={data => {
        const metaDescription =
          description || data.site.siteMetadata.description;
        return (
          <Helmet
            htmlAttributes={{
              lang,
            }}
            title={title}
            titleTemplate={`%s | ${data.site.siteMetadata.title}`}
            meta={[
              {
                name: `description`,
                content: metaDescription,
              },
              {
                property: `og:title`,
                content: title,
              },
              {
                property: `og:description`,
                content: metaDescription,
              },
              {
                property: `og:type`,
                content: `website`,
              },
              {
                name: `twitter:card`,
                content: `summary`,
              },
              {
                name: `twitter:creator`,
                content: data.site.siteMetadata.author,
              },
              {
                name: `twitter:title`,
                content: title,
              },
              {
                name: `twitter:description`,
                content: metaDescription,
              },
            ]
              .concat(
                keywords.length > 0
                  ? {
                      name: `keywords`,
                      content: keywords.join(`, `),
                    }
                  : [],
              )
              .concat(meta)}
          />
        );
      }}
    />
  );
}

SEO.defaultProps = {
  lang: `en`,
  meta: [],
  keywords: [],
};

SEO.propTypes = {
  description: PropTypes.string,
  lang: PropTypes.string,
  meta: PropTypes.array,
  keywords: PropTypes.arrayOf(PropTypes.string),
  title: PropTypes.string.isRequired,
};

export default SEO;

const detailsQuery = graphql`
  query DefaultSEOQuery {
    site {
      siteMetadata {
        title
        description
        author
      }
    }
  }
`;


text:
<!doctype html>
<title>/resources/media/webm/sunflower.webm</title>

FAIL (script didn't run)


text:
package org.opensingular.requirement.connector.sei30.ws;

import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

/**
 *
Classe Java de RetornoConsultaDocumento complex type.
 *
 *
O seguinte fragmento do esquema especifica o conteúdo esperado contido dentro desta classe.
 *
 *

 * <complexType name="RetornoConsultaDocumento">
 *   <complexContent>
 *     <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
 *       <all>
 *         <element name="IdProcedimento" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="ProcedimentoFormatado" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="IdDocumento" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="DocumentoFormatado" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="LinkAcesso" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Serie" type="{Sei}Serie"/>
 *         <element name="Numero" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="Data" type="{http://www.w3.org/2001/XMLSchema}string"/>
 *         <element name="UnidadeElaboradora" type="{Sei}Unidade"/>
 *         <element name="AndamentoGeracao" type="{Sei}Andamento"/>
 *         <element name="Assinaturas" type="{Sei}ArrayOfAssinatura"/>
 *         <element name="Publicacao" type="{Sei}Publicacao"/>
 *         <element name="Campos" type="{Sei}ArrayOfCampo"/>
 *       </all>
 *     </restriction>
 *   </complexContent>
 * </complexType>
 *

 *
 *
 */
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "RetornoConsultaDocumento", propOrder = {

})
public class RetornoConsultaDocumento extends RetornoFlexivel {

    @XmlElement(name = "IdProcedimento", required = true)
    protected String idProcedimento;
    @XmlElement(name = "ProcedimentoFormatado", required = true)
    protected String procedimentoFormatado;
    @XmlElement(name = "IdDocumento", required = true)
    protected String idDocumento;
    @XmlElement(name = "DocumentoFormatado", required = true)
    protected String documentoFormatado;
    @XmlElement(name = "LinkAcesso", required = true)
    protected String linkAcesso;
    @XmlElement(name = "Serie", required = true)
    protected Serie serie;
    @XmlElement(name = "Numero", required = true)
    protected String numero;
    @XmlElement(name = "Data", required = true)
    protected String data;
    @XmlElement(name = "UnidadeElaboradora", required = true)
    protected Unidade unidadeElaboradora;
    @XmlElement(name = "AndamentoGeracao", required = true)
    protected Andamento andamentoGeracao;
    @XmlElement(name = "Assinaturas", required = true)
    protected ArrayOfAssinatura assinaturas;
    @XmlElement(name = "Publicacao", required = true)
    protected Publicacao publicacao;
    @XmlElement(name = "Campos", required = true)
    protected ArrayOfCampo campos;

    /**
     * Obtém o valor da propriedade idProcedimento.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIdProcedimento() {
        return idProcedimento;
    }

    /**
     * Define o valor da propriedade idProcedimento.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIdProcedimento(String value) {
        this.idProcedimento = value;
    }

    /**
     * Obtém o valor da propriedade procedimentoFormatado.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getProcedimentoFormatado() {
        return procedimentoFormatado;
    }

    /**
     * Define o valor da propriedade procedimentoFormatado.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setProcedimentoFormatado(String value) {
        this.procedimentoFormatado = value;
    }

    /**
     * Obtém o valor da propriedade idDocumento.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getIdDocumento() {
        return idDocumento;
    }

    /**
     * Define o valor da propriedade idDocumento.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setIdDocumento(String value) {
        this.idDocumento = value;
    }

    /**
     * Obtém o valor da propriedade documentoFormatado.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getDocumentoFormatado() {
        return documentoFormatado;
    }

    /**
     * Define o valor da propriedade documentoFormatado.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setDocumentoFormatado(String value) {
        this.documentoFormatado = value;
    }

    /**
     * Obtém o valor da propriedade linkAcesso.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getLinkAcesso() {
        return linkAcesso;
    }

    /**
     * Define o valor da propriedade linkAcesso.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setLinkAcesso(String value) {
        this.linkAcesso = value;
    }

    /**
     * Obtém o valor da propriedade serie.
     *
     * @return
     *     possible object is
     *     {@link Serie }
     *
     */
    public Serie getSerie() {
        return serie;
    }

    /**
     * Define o valor da propriedade serie.
     *
     * @param value
     *     allowed object is
     *     {@link Serie }
     *
     */
    public void setSerie(Serie value) {
        this.serie = value;
    }

    /**
     * Obtém o valor da propriedade numero.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getNumero() {
        return numero;
    }

    /**
     * Define o valor da propriedade numero.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setNumero(String value) {
        this.numero = value;
    }

    /**
     * Obtém o valor da propriedade data.
     *
     * @return
     *     possible object is
     *     {@link String }
     *
     */
    public String getData() {
        return data;
    }

    /**
     * Define o valor da propriedade data.
     *
     * @param value
     *     allowed object is
     *     {@link String }
     *
     */
    public void setData(String value) {
        this.data = value;
    }

    /**
     * Obtém o valor da propriedade unidadeElaboradora.
     *
     * @return
     *     possible object is
     *     {@link Unidade }
     *
     */
    public Unidade getUnidadeElaboradora() {
        return unidadeElaboradora;
    }

    /**
     * Define o valor da propriedade unidadeElaboradora.
     *
     * @param value
     *     allowed object is
     *     {@link Unidade }
     *
     */
    public void setUnidadeElaboradora(Unidade value) {
        this.unidadeElaboradora = value;
    }

    /**
     * Obtém o valor da propriedade andamentoGeracao.
     *
     * @return
     *     possible object is
     *     {@link Andamento }
     *
     */
    public Andamento getAndamentoGeracao() {
        return andamentoGeracao;
    }

    /**
     * Define o valor da propriedade andamentoGeracao.
     *
     * @param value
     *     allowed object is
     *     {@link Andamento }
     *
     */
    public void setAndamentoGeracao(Andamento value) {
        this.andamentoGeracao = value;
    }

    /**
     * Obtém o valor da propriedade assinaturas.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfAssinatura }
     *
     */
    public ArrayOfAssinatura getAssinaturas() {
        return assinaturas;
    }

    /**
     * Define o valor da propriedade assinaturas.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfAssinatura }
     *
     */
    public void setAssinaturas(ArrayOfAssinatura value) {
        this.assinaturas = value;
    }

    /**
     * Obtém o valor da propriedade publicacao.
     *
     * @return
     *     possible object is
     *     {@link Publicacao }
     *
     */
    public Publicacao getPublicacao() {
        return publicacao;
    }

    /**
     * Define o valor da propriedade publicacao.
     *
     * @param value
     *     allowed object is
     *     {@link Publicacao }
     *
     */
    public void setPublicacao(Publicacao value) {
        this.publicacao = value;
    }

    /**
     * Obtém o valor da propriedade campos.
     *
     * @return
     *     possible object is
     *     {@link ArrayOfCampo }
     *
     */
    public ArrayOfCampo getCampos() {
        return campos;
    }

    /**
     * Define o valor da propriedade campos.
     *
     * @param value
     *     allowed object is
     *     {@link ArrayOfCampo }
     *
     */
    public void setCampos(ArrayOfCampo value) {
        this.campos = value;
    }

}


text:
package org.apache.spark.sql.execution.datasources.orc;

import org.apache.orc.ColumnStatistics;
import org.apache.orc.Reader;
import org.apache.orc.TypeDescription;
import org.apache.spark.sql.types.*;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.Queue;

/**
 * {@link OrcFooterReader} is a util class which encapsulates the helper
 * methods of reading ORC file footer.
 */
public class OrcFooterReader {

  /**
   * Read the columns statistics from ORC file footer.
   *
   * @param orcReader the reader to read ORC file footer.
   * @return Statistics for all columns in the file.
   */
  public static OrcColumnStatistics readStatistics(Reader orcReader) {
    TypeDescription orcSchema = orcReader.getSchema();
    ColumnStatistics[] orcStatistics = orcReader.getStatistics();
    StructType sparkSchema = OrcUtils.toCatalystSchema(orcSchema);
    return convertStatistics(sparkSchema, new LinkedList<>(Arrays.asList(orcStatistics)));
  }

  /**
   * Convert a queue of ORC {@link ColumnStatistics}s into Spark {@link OrcColumnStatistics}.
   * The queue of ORC {@link ColumnStatistics}s are assumed to be ordered as tree pre-order.
   */
  private static OrcColumnStatistics convertStatistics(
      DataType sparkSchema, Queue<ColumnStatistics> orcStatistics) {
    OrcColumnStatistics statistics = new OrcColumnStatistics(orcStatistics.remove());
    if (sparkSchema instanceof StructType) {
      for (StructField field : ((StructType) sparkSchema).fields()) {
        statistics.add(convertStatistics(field.dataType(), orcStatistics));
      }
    } else if (sparkSchema instanceof MapType) {
      statistics.add(convertStatistics(((MapType) sparkSchema).keyType(), orcStatistics));
      statistics.add(convertStatistics(((MapType) sparkSchema).valueType(), orcStatistics));
    } else if (sparkSchema instanceof ArrayType) {
      statistics.add(convertStatistics(((ArrayType) sparkSchema).elementType(), orcStatistics));
    }
    return statistics;
  }
}


text:
'use strict';

const array = require('types/array');

describe('array', () => {
  const rstream = {};

  describe('fixed length', () => {
    describe('length is the number of items', () => {
      test('encode', () => {
        const itemBytes = 7;
        const items = [10, 20];
        const wstream = {};

        const itemType = {
          decode() {},
          encode: jest.fn(),
        };

        itemType.encode.bytes = itemBytes;

        const type = array(itemType, items.length);
        type.encode(items, wstream);

        expect(itemType.encode).toHaveBeenCalledTimes(items.length);
        expect(type.encode.bytes).toBe(itemBytes * items.length);
      });

      test('throws when length != items.length', () => {
        const items = [10, 20];
        const wstream = {};

        const itemType = {
          decode() {},
          encode: jest.fn(),
        };

        const requiredSize = items.length + 1;
        const type = array(itemType, requiredSize);

        expect(() => type.encode(items, wstream)).toThrow(
          `Argument #1 required length ${requiredSize} instead of ${
            items.length
          }`
        );
      });

      test('decode', () => {
        const length = 2;
        const bytes = 10;

        const first = 1;
        const second = 2;
        const items = [first, second];

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = bytes;

        const type = array(itemType, length);

        expect(type.decode(rstream)).toEqual([first, second]);
        expect(type.decode.bytes).toBe(bytes * length);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const bytes = 3;

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return bytes;
          },
        };

        const type = array(itemType, items.length);

        expect(type.encodingLength(items)).toBe(items.length * bytes);
      });
    });

    describe('length is the number of bytes', () => {
      test('encode', () => {
        const bytes = 7;
        const items = [10, 20];
        const length = bytes * items.length;
        const wstream = {};

        const itemType = {
          encode: jest.fn(),
          decode() {},
          encodingLength() {
            return bytes;
          },
        };

        itemType.encode.bytes = bytes;

        const type = array(itemType, length, 'bytes');
        type.encode(items, wstream);

        expect(itemType.encode).toHaveBeenCalledTimes(items.length);
        expect(type.encode.bytes).toBe(length);
      });

      test('decode', () => {
        const first = 1;
        const second = 2;
        const items = [first, second];

        const bytes = 3;
        const length = bytes * items.length;

        const meta = {
          bytes: 0,
          context: {},
        };

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = bytes;
        const type = array(itemType, length, 'bytes');

        expect(type.decode(rstream, meta)).toEqual([first, second]);
        expect(type.decode.bytes).toBe(length);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const bytes = 3;
        const length = items.length * bytes;

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return bytes;
          },
        };

        const type = array(itemType, length, 'bytes');

        expect(type.encodingLength(items)).toBe(length);
      });
    });
  });

  describe('length is type', () => {
    describe('length is the number of items', () => {
      test('encode', () => {
        const items = [100, 200, 300];
        const wstream = {};

        const lengthType = {
          decode() {},
          encode: jest.fn(),
        };

        lengthType.encode.bytes = 2;

        const itemType = {
          decode() {},
          encode: jest.fn(),
        };

        itemType.encode.bytes = 3;

        const type = array(itemType, lengthType);
        type.encode(items, wstream);

        expect(lengthType.encode).toHaveBeenCalledTimes(1);
        expect(lengthType.encode).toBeCalledWith(items.length, wstream);
        expect(itemType.encode).toHaveBeenCalledTimes(items.length);
        expect(type.encode.bytes).toBe(
          itemType.encode.bytes * items.length + lengthType.encode.bytes
        );
      });

      test('decode', () => {
        const first = 1;
        const second = 2;
        const items = [first, second];

        const { length } = items;
        const itemBytes = 3;
        const lengthBytes = 3;

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = itemBytes;

        const lengthType = {
          decode() {
            return length;
          },
          encode() {},
        };

        lengthType.decode.bytes = lengthBytes;

        const type = array(itemType, lengthType);

        expect(type.decode(rstream)).toEqual([first, second]);
        expect(type.decode.bytes).toBe(itemBytes * length + lengthBytes);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const itemBytes = 3;
        const lengthBytes = 5;

        const lengthType = {
          encode() {},
          decode() {},
          encodingLength() {
            return lengthBytes;
          },
        };

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return itemBytes;
          },
        };

        const type = array(itemType, lengthType);

        expect(type.encodingLength(items)).toBe(
          items.length * itemBytes + lengthBytes
        );
      });
    });

    describe('length is the number of bytes', () => {
      test('encode', () => {
        const items = [100, 200, 300];
        const itemBytes = 4;
        const wstream = {};

        const lengthType = {
          decode() {},
          encode: jest.fn(),
        };

        lengthType.encode.bytes = 2;

        const itemType = {
          decode() {},
          encode: jest.fn(),
          encodingLength() {
            return itemBytes;
          },
        };

        itemType.encode.bytes = itemBytes;

        const type = array(itemType, lengthType, 'bytes');
        type.encode(items, wstream);

        expect(lengthType.encode).toHaveBeenCalledTimes(1);
        expect(lengthType.encode).toBeCalledWith(
          items.length * itemBytes,
          wstream
        );
        expect(itemType.encode).toHaveBeenCalledTimes(items.length);
        expect(type.encode.bytes).toBe(
          itemBytes * items.length + lengthType.encode.bytes
        );
      });

      test('decode', () => {
        const first = 1;
        const second = 2;
        const items = [first, second];

        const { length } = items;
        const itemBytes = 3;
        const lengthBytes = 3;

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = itemBytes;

        const lengthType = {
          decode() {
            return length * itemBytes;
          },
          encode() {},
        };

        lengthType.decode.bytes = lengthBytes;

        const type = array(itemType, lengthType, 'bytes');

        expect(type.decode(rstream)).toEqual([first, second]);
        expect(type.decode.bytes).toBe(itemBytes * length + lengthBytes);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const itemBytes = 3;
        const lengthBytes = 5;

        const lengthType = {
          encode() {},
          decode() {},
          encodingLength() {
            return lengthBytes;
          },
        };

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return itemBytes;
          },
        };

        const type = array(itemType, lengthType, 'bytes');

        expect(type.encodingLength(items)).toBe(
          items.length * itemBytes + lengthBytes
        );
      });
    });
  });

  describe('item is an user defined type', () => {
    test('encode', () => {
      const wstream = {};
      const items = [{ a: 100 }, { a: 200 }, { a: 300 }];
      const itemBytes = 4;

      const schema = {
        a: {
          encode: jest.fn(),
          decode() {},
        },
      };

      schema.a.encode.bytes = itemBytes;

      const type = array(schema, items.length);
      type.encode(items, wstream);

      expect(schema.a.encode).toHaveBeenCalledTimes(items.length);
      expect(type.encode.bytes).toBe(itemBytes * items.length);
    });

    test('decode', () => {
      const firstItem = 1;
      const secondItem = 2;
      const items = [firstItem, secondItem];

      const { length } = items;
      const itemBytes = 2;

      const itemType = {
        decode() {
          return items.shift();
        },
        encode() {},
      };

      itemType.decode.bytes = itemBytes;

      const schema = {
        a: itemType,
      };

      const type = array(schema, length);

      expect(type.decode(rstream)).toEqual([
        { a: firstItem },
        { a: secondItem },
      ]);
      expect(type.decode.bytes).toBe(itemBytes * length);
    });

    test('encodingLength', () => {
      const itemBytes = 3;
      const items = [{ a: 100 }, { a: 200 }, { a: 300 }];

      const schema = {
        a: {
          encode() {},
          decode() {},
          encodingLength() {
            return itemBytes;
          },
        },
      };

      const type = array(schema, items.length);

      expect(type.encodingLength(items)).toBe(itemBytes * items.length);
    });
  });

  describe('length is function', () => {
    describe('length is the number of items', () => {
      test('decode', () => {
        const first = 1;
        const second = 2;
        const items = [first, second];

        const { length } = items;
        const bytes = 3;

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = bytes;
        const callback = jest.fn().mockImplementation(() => length);

        const type = array(itemType, callback);

        expect(type.decode(rstream)).toEqual([first, second]);
        expect(callback).toHaveBeenCalledTimes(1);
        expect(type.decode.bytes).toBe(bytes * length);
      });

      test('encode', () => {
        const wstream = {};
        const items = [100, 200, 300];
        const { length } = items;
        const bytes = 4;

        const itemType = {
          decode() {},
          encode: jest.fn(),
        };

        itemType.encode.bytes = bytes;

        const callback = jest.fn().mockImplementation(() => length);

        const type = array(itemType, callback);
        type.encode(items, wstream);

        expect(callback).toHaveBeenCalledTimes(1);
        expect(itemType.encode).toHaveBeenCalledTimes(items.length);
        expect(type.encode.bytes).toBe(bytes * items.length);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const bytes = 3;

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return bytes;
          },
        };

        const type = array(itemType, () => {});

        expect(type.encodingLength(items)).toBe(items.length * bytes);
      });
    });

    describe('length is the number of bytes', () => {
      test('decode', () => {
        const first = 1;
        const second = 2;
        const items = [first, second];

        const bytes = 3;
        const { length } = items;

        const itemType = {
          decode() {
            return items.shift();
          },
          encode() {},
        };

        itemType.decode.bytes = bytes;
        const callback = jest.fn().mockImplementation(() => length * bytes);

        const type = array(itemType, callback, 'bytes');

        expect(type.decode(rstream)).toEqual([first, second]);
        expect(callback).toHaveBeenCalledTimes(1);
        expect(type.decode.bytes).toBe(length * bytes);
      });

      test('encode', () => {
        const wstream = {};
        const items = [100, 200, 300];

        const bytes = 4;
        const { length } = items;

        const callback = jest.fn().mockImplementation(() => length * bytes);

        const itemType = {
          decode() {},
          encode: jest.fn(),
          encodingLength() {
            return bytes;
          },
        };

        itemType.encode.bytes = bytes;

        const type = array(itemType, callback, 'bytes');
        type.encode(items, wstream);

        expect(callback).toHaveBeenCalledTimes(1);
        expect(itemType.encode).toHaveBeenCalledTimes(length);
        expect(type.encode.bytes).toBe(bytes * length);
      });

      test('encodingLength', () => {
        const items = [10, 20];
        const bytes = 3;
        const length = items.length * bytes;

        const itemType = {
          encode() {},
          decode() {},
          encodingLength() {
            return bytes;
          },
        };

        const schema = array(itemType, () => {}, 'bytes');

        expect(schema.encodingLength(items)).toBe(length);
      });
    });
  });
});


text:
class RenameRegionsUsersToRegionOrganizers < ActiveRecord::Migration
  def change
    rename_table :regions_users, :region_organizers
  end
end


text:
import os
import sys

if __name__ == "__main__":
    from django.core.management import execute_from_command_line
    from msz.settings import read_env
    read_env()
    os.environ.setdefault("DJANGO_SETTINGS_MODULE", "msz.settings")
    execute_from_command_line(sys.argv)


text:
#import "BT_locationManager.h"
#import <CoreLocation/CoreLocation.h>
#import "tabatoodemo_appDelegate.h"
#import "BT_debugger.h"

//used in formats below for readability
#define LocStr(key) [[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]

@implementation BT_locationManager

@synthesize locationManager, updateCount, warningCount;

-(id)init{
    self = [super init];
    if (self != nil){
		[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"INIT %@", @" (only initializing, not using)"]];

		//counter tracks updates so we can turn the updater off when we have a few location
		//updates - this save battery!
		self.updateCount = 0;
		self.warningCount = 0;

    }
    return self;
}

//start location updates
-(void)startLocationUpdates{
	[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"startLocationUpdates %@", @""]];

	@try {

		//if we have not already done this..
		if(self.locationManager == nil){

			//init location manager
        	self.locationManager = [[[CLLocationManager alloc] init] autorelease];
			[self.locationManager setDelegate:self];
			[self.locationManager setDesiredAccuracy:kCLLocationAccuracyBest];
			[self.locationManager startUpdatingLocation];

		}else{

			[self.locationManager startUpdatingLocation];

		}

	}@catch (NSException * e) {
	}@finally {
 	}

}

//stop location udpates
-(void)stopLocationUpdates{
	[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"stopLocationUpdates %@", @""]];
	[self.locationManager stopUpdatingLocation];
}

- (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{
	[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didUpdateToLocation %@", @""]];

	NSMutableString *update = [[[NSMutableString alloc] init] autorelease];
	NSDateFormatter *dateFormatter = [[[NSDateFormatter alloc] init]  autorelease];
	[dateFormatter setDateStyle:NSDateFormatterMediumStyle];
	[dateFormatter setTimeStyle:NSDateFormatterMediumStyle];
	[update appendFormat:@"%@\n\n", [dateFormatter stringFromDate:newLocation.timestamp]];

	//horizontal coordinates
	if (signbit(newLocation.horizontalAccuracy)) {

		//negative accuracy means an invalid or unavailable measurement
		[update appendString:LocStr(@"LatLongUnavailable")];

	}else{

		//coreLocation returns positive for North & East, negative for South & West
		[update appendFormat:LocStr(@"LatLongFormat"),
		fabs(newLocation.coordinate.latitude), signbit(newLocation.coordinate.latitude) ? LocStr(@"South") : LocStr(@"North"),
		fabs(newLocation.coordinate.longitude),	signbit(newLocation.coordinate.longitude) ? LocStr(@"West") : LocStr(@"East")];
		[update appendString:@"\n"];
		[update appendFormat:LocStr(@"MeterAccuracyFormat"), newLocation.horizontalAccuracy];

	}
	[update appendString:@"\n\n"];

	//altitude
	if (signbit(newLocation.verticalAccuracy)) {
		//negative accuracy means an invalid or unavailable measurement
		[update appendString:LocStr(@"AltUnavailable")];
	} else {
		//positive and negative in altitude denote above & below sea level, respectively
		[update appendFormat:LocStr(@"AltitudeFormat"), fabs(newLocation.altitude),	(signbit(newLocation.altitude)) ? LocStr(@"BelowSeaLevel") : LocStr(@"AboveSeaLevel")];
		[update appendString:@"\n"];
		[update appendFormat:LocStr(@"MeterAccuracyFormat"), newLocation.verticalAccuracy];
	}
	[update appendString:@"\n\n"];

	//calculate disatance moved and time elapsed, but only if we have an "old" location
	if(oldLocation != nil) {

		CLLocationDistance distanceMoved = [newLocation distanceFromLocation:oldLocation];
		NSTimeInterval timeElapsed = [newLocation.timestamp timeIntervalSinceDate:oldLocation.timestamp];
		[update appendFormat:LocStr(@"LocationChangedFormat"), distanceMoved];
		if (signbit(timeElapsed)) {
			[update appendString:LocStr(@"FromPreviousMeasurement")];
		} else {
			[update appendFormat:LocStr(@"TimeElapsedFormat"), timeElapsed];

		}
		[update appendString:@"\n\n"];
	}

	//appDelegate
	tabatoodemo_appDelegate *appDelegate = (tabatoodemo_appDelegate *)[[UIApplication sharedApplication] delegate];
	[appDelegate.rootApp.rootDevice setDeviceLatitude:[NSString stringWithFormat:@"%f", newLocation.coordinate.latitude]];
	[appDelegate.rootApp.rootDevice setDeviceLongitude:[NSString stringWithFormat:@"%f", newLocation.coordinate.longitude]];
	[appDelegate.rootApp.rootDevice setCanReportLocation:TRUE];

	//turn off updates after 10 reports. This ensures accuracy but reduces battery load.
	self.updateCount = (self.updateCount + 1);
	if(self.updateCount > 10){
		[self.locationManager stopUpdatingLocation];
	}

}

//location update errors
- (void)locationManager:(CLLocationManager *)manager  didFailWithError:(NSError *)error{
	NSMutableString *errorString = [[[NSMutableString alloc] init] autorelease];

	//stop updating..
	[self.locationManager stopUpdatingLocation];

	if ([error domain] == kCLErrorDomain || [error code] == kCLErrorDenied) {

		//user denied...
		[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"Location services didFailWithError. Several things can cause this. Has the user allowed location updates?%@", @""]];

		//alert the user on first error
		if(self.warningCount == 0){

			//flag so we only get one warning
			[self setWarningCount:1];

			UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Location Services Disabled"
			message:@"This application cannot access your location information. The application will continue to function but may have limited capability."
			delegate:self
			cancelButtonTitle:@"OK" otherButtonTitles:nil];
			//[alertView show];
			[alertView release];
		}

	}else{

		if ([error domain] == kCLErrorDomain) {
			//handle CoreLocation-related errors here
			switch ([error code]) {
					// This error code is usually returned whenever user taps "Don't Allow" in response to
					// being told your app wants to access the current location. Once this happens, you cannot
					// attempt to get the location again until the app has quit and relaunched.
				case kCLErrorDenied:
					[errorString appendFormat:@"%@\n", NSLocalizedString(@"LocationDenied", nil)];
					break;
					// This error code is usually returned whenever the device has no data or WiFi connectivity,
				case kCLErrorLocationUnknown:
					[errorString appendFormat:@"%@\n", NSLocalizedString(@"LocationUnknown", nil)];
					break;
					// We shouldn't ever get an unknown error code, but just in case...
				default:
					[errorString appendFormat:@"GENERIC %@ %d\n", NSLocalizedString(@"GenericLocationError", nil), [error code]];
					break;
			}
		}else{
			//handle all non-CoreLocation errors here
			[errorString appendFormat:@"Error domain: \"%@\"  Error code: %d\n", [error domain], [error code]];
			[errorString appendFormat:@"Description: \"%@\"\n", [error localizedDescription]];
		}

		//debug
		[BT_debugger showIt:self theMessage:[NSString stringWithFormat:@"didFailWithError %@", errorString]];

	}

	//appDelegate
	tabatoodemo_appDelegate *appDelegate = (tabatoodemo_appDelegate *)[[UIApplication sharedApplication] delegate];
	[appDelegate.rootApp.rootDevice setCanReportLocation:FALSE];

	//reset counter to it starts again next time
	self.updateCount = 0;

}

- (void)dealloc {
    [self.locationManager release];
    [super dealloc];
}

@end


text:
export const getSchedule = (...args) => ({
  type: 'app/getSchedule',
  args
})

// update store, mean we need to replace audio from api result
// do we need to check data.code ?
export const replaceSchedule = (data) => ({
  type: 'app/replaceSchedule',
  // always use sub-key to have better vizualize state
  payload: {
    schedules: data.schedules,
  }
})


text:
\section{Costing}
\label{sec:costing}

This is how the file name is specified
\begin{lstlisting}

    val env: ScriptEnv = Map(
    ScriptNameProp -> s"filename_verify",
  ...
\end{lstlisting}

The file should be in \lst{test-out} directory. The graph should have
explicit nodes like \lst{CostOf(...)}, which represent access to CostTable
entries. The actual cost is counted in the nodes like this \lst{s1340: Int =
OpCost(2, List(s1361, s1360), s983)}. Each such node is handled like
\lst{costAccumulator.add(s1340, OpCost(2, List(s1361, s1360), s983), dataEnv)}
See \lst{CostAccumulator}

How much cost is represented by OpCost node?
\begin{enumerate}
    \item Symbols s1361, s1360 are dependencies. They represent cost that
    should be accumulated before s983.
    \item If upon handling of OpCost, the dependencies are not yet
    accumulated, then they are accumulated first, and then s983 is
    accumulated.
    \item the values of s1340 is the value of s983.
    \item Thus execution of OpCost, consists of 2 parts: a) data flow b) side
    effect on CostAccumulator
    \item OpCost is special node, interpreted in a special way. See method
    evaluate in Evaluation.
\end{enumerate}

% For why this is necessary, consider a script where two different context
% variables are used. Without this, the same OpCost node is emitted twice, but
% only single is added in the graph because of unification of nodes. Thus
% adding costedValue.id make those nodes different and they both added to the
% graph.


text:
dbm.registerClass("dbm.core.extendedevent.eventperformer.EventPerformer", "dbm.core.BaseObject", function(objectFunctions, staticFunctions, ClassReference) {
	//console.log("dbm.core.extendedevent.eventperformer.EventPerformer");

	//Self reference
	var EventPerformer = dbm.importClass("dbm.core.extendedevent.eventperformer.EventPerformer");

	//Error report

	//Dependencies
	var CommandsArrayIterator = dbm.importClass("dbm.core.extendedevent.commands.CommandsArrayIterator");

	//Utils

	//Constants
	var CommandStatusTypes = dbm.importClass("dbm.constants.status.CommandStatusTypes");

	/**
	 * Constructor
	 */
	objectFunctions._init = function() {
		//console.log("dbm.core.extendedevent.eventperformer.EventPerformer::_init");

		this.superCall();

		this._commandsArray = (new CommandsArrayIterator()).init();
		this._commandsArray.canRemoveItemsWhileActive = true;
		this._commandsArray.canAddItemsWhileActive = false;
		this.addDestroyableObject(this._commandsArray);

		this.breakOnError = false;
		this._isPerforming = false;

		return this;
	};

	objectFunctions.perform = function(aEventDataObject) {
		//console.log("dbm.core.extendedevent.eventperformer.EventPerformer::perform");
		var currentCommand;
		var theResult;

		var iterationData = this._commandsArray.createIterationData();
		for(;iterationData.position < iterationData.length; iterationData.position++) {
			currentCommand = iterationData.array[iterationData.position];
			theResult = currentCommand.perform(aEventDataObject);
			if(this._isDestroyed) {
				break;
			}
			if(currentCommand.removeAfterPerform) {
				this._commandsArray.removeItem(currentCommand);
			}

			if((theResult === CommandStatusTypes.BREAK) || (this.breakOnError && (theResult === CommandStatusTypes.ERROR))) {
				break;
			}
		}
		if(!this._isDestroyed) {
			this._commandsArray.stopUsingIterationData(iterationData);
		}
	};

	objectFunctions.addCommand = function(aCommand) {
		this._commandsArray.push(aCommand);
	};

	objectFunctions.removeCommand = function(aCommand) {
		//console.log("dbm.core.extendedevent.eventperformer.EventPerformer::removeCommand");

		this._commandsArray.removeItem(aCommand);
	};

	objectFunctions.removeCommandById = function(aId) {
		this._commandsArray.removeItemById(aId);
	};

	objectFunctions.hasCommandWithId = function(aId) {
		return this._commandsArray.hasItemWithId(aId);
	};

	objectFunctions.resetCommands = function() {
		this._commandsArray.stop();
		this._commandsArray.destroy();

		this._commandsArray = (new CommandsArrayIterator()).init();
		this._commandsArray.canRemoveItemsWhileActive = true;
		this._commandsArray.canAddItemsWhileActive = false;
	};

	objectFunctions.setAllReferencesToNull = function() {

		this._commandsArray = null;

		this.superCall();
	};
});


text:
package com.chenjie.coolweather.utils;

import android.text.TextUtils;

import com.chenjie.coolweather.dao.City;
import com.chenjie.coolweather.dao.Country;
import com.chenjie.coolweather.dao.Province;
import com.chenjie.coolweather.model.Weather;
import com.google.gson.Gson;

import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

/**
 * Created by chenjie on 2017/7/15.
 */

public class JSONUtil {

    public static boolean handleProvinceResponse(String response) {

        if (!TextUtils.isEmpty(response)) {
            try {
                JSONArray allProvinces = new JSONArray(response);
                for (int i = 0; i < allProvinces.length(); i++) {
                    JSONObject provinceObject = allProvinces.getJSONObject(i);

                    Province province = new Province();
                    province.setName(provinceObject.getString("name"));
                    province.setCode(provinceObject.getInt("id"));

                    province.save();
                }
                return true;
            } catch (JSONException e) {
                e.printStackTrace();
                return false;
            }
        } else {
            return false;
        }
    }

    public static boolean handleCityResponse(String response, int provinceID) {

        if (!TextUtils.isEmpty(response)) {
            try {
                JSONArray allProvinces = new JSONArray(response);
                for (int i = 0; i < allProvinces.length(); i++) {
                    JSONObject cityObject = allProvinces.getJSONObject(i);

                    City city = new City();
                    city.setName(cityObject.getString("name"));
                    city.setCode(cityObject.getInt("id"));
                    city.setProvinceID(provinceID);

                    city.save();
                }
                return true;
            } catch (JSONException e) {
                e.printStackTrace();
                return false;
            }
        } else {
            return false;
        }
    }

    public static boolean handleCountryResponse(String response, int cityID) {

        if (!TextUtils.isEmpty(response)) {
            try {
                JSONArray allProvinces = new JSONArray(response);
                for (int i = 0; i < allProvinces.length(); i++) {
                    JSONObject countryObject = allProvinces.getJSONObject(i);

                    Country country = new Country();
                    country.setName(countryObject.getString("name"));
                    country.setWeatherID(countryObject.getString("weather_id"));
                    country.setCityID(cityID);

                    country.save();
                }
                return true;
            } catch (JSONException e) {
                e.printStackTrace();
                return false;
            }
        } else {
            return false;
        }
    }

    public static Weather handleWeatherResponse(String response) {
        try {
            JSONObject jsonObject = new JSONObject(response);
            JSONArray jsonArray = jsonObject.getJSONArray("HeWeather");
            String weatherContent = jsonArray.getJSONObject(0).toString();
            return new Gson().fromJson(weatherContent, Weather.class);
        } catch (JSONException e) {
            e.printStackTrace();
        }
        return null;
    }

}


text:
import { Document, model, Mongoose, Schema, Types } from 'mongoose';
const enumValues = require('mongoose-enumvalues');

export interface ICard extends Document {
    name: String,
    monsterType: String,
    attribute: String,
    cardType: String,
    cardEffectType: String,
    level: Number,
    attack: Number
    defence: Number
};

export const CardSchema = new Schema({
    name: { type: String, required: true },
    somethingElse: Number,
});

const Card = model<ICard>('Card', CardSchema);

export default Card;


text:
require 'vk/schema'
require 'json'
require 'pathname'

module Vk
  class Schema
    class Generator
      autoload :Client, 'vk/schema/generator/client'
      autoload :Common, 'vk/schema/generator/common'
      autoload :Errors, 'vk/schema/generator/errors'
      autoload :Method, 'vk/schema/generator/method'
      autoload :Methods, 'vk/schema/generator/methods'
      autoload :Object, 'vk/schema/generator/object'
      autoload :Objects, 'vk/schema/generator/objects'
      autoload :Response, 'vk/schema/generator/response'
      autoload :Responses, 'vk/schema/generator/responses'
      autoload :Type, 'vk/schema/generator/type'
      autoload :Types, 'vk/schema/generator/types'

      # @return [Vk::Schema]
      def schema
        @schema ||= Schema.new
      end

      def call
        options = {}
        Generator::Types.start([schema], options)
        Generator::Errors.start([schema], options)
        Generator::Objects.start([schema], options)
        Generator::Responses.start([schema], options)
        Generator::Methods.start([schema], options)
        Generator::Client.start([schema], options)
        system('bin/rubocop -a lib/vk/api')
      end
    end
  end
end


text:
/*
 * Pouch DB Service.
 * Author: LSajev
 * Date: 2-Nov-2015
 *
 * */

//Ex creating a DB
/*
 $scope.dbObject = PouchDBService.createDB("dbName");
 */

//Ex accessing a method in controller.
/*
 PouchDBService.getById($scope.dbObject, id).then(function (response) {
 // handle response
 }).catch(function (err) {
 console.log(err);
 });

 */

//API returns a promise you should access each service using ".then() " method
/* Ex
 insert().then(function (response) {
 // handle response
 }).catch(function (err) {
 console.log(err);
 });

 getById(dbObj, id).then(function (response) {
 // handle response
 }).catch(function (err) {
 console.log(err);
 });

 */
angular.module('starter.services').factory('PouchDBService', function ($http, $log) {
//function to destroy a DB
    function deleteDB_(dbObj) {
        return dbObj.destroy();
    }

//function to create a new DB.
    function createDB_(dbName) {
        return new PouchDB(dbName);
    }

//function to fetch all records from DB.
    function getAll_(dbObj) {

        return dbObj.allDocs({
            include_docs: true,
            attachments: true
        });
    }

//function to insert a new record. it's compulsury to have a _id value in json object it should be unique.
    function insert_(dbObj, dbObj) {
        return dbObj.put(dbObj);
    }

//function to fetch a row by id
    function getById_(dbObj, id) {
        return dbObj.get(id);
    }

//function to remove a record
    function removeRecord_(dbObj, id) {
        return dbObj.get(id).then(function (doc) {
            return dbObj.remove(doc._id, doc._rev);
        });
    }

//function to insert the bulk json objects
    function insertBatchJson_(dbObj, jsonObj) {
        return dbObj.bulkDocs(dbObj, jsonObj);
    }

//function to get the db info
    /*
    It will return output
     {
     "db_name": "test",
     "doc_count": 4,
     "update_seq": 5
     }
     */
    function getDBInfo_(dbObj) {
        return dbObj.db.info();
    }

    return {
        getAll: function (dbObj) {
            return getAll_(dbObj);
        },
        createDB: function (dbName) {
            return createDB_(dbName);
        },
        insert: function (dbObj, jsonObj) {
            return insert_(dbName);
        },
        insertBatchJson: function () {
            return insertBatchJson_(dbObj, jsonObj);
        },
        deleteDB: function (dbObj) {
            return deleteDB_(dbName);
        },
        getById: function (dbObj, id) {
            return getById_(dbObj, id);
        },
        removeRecord: function (dbObj, id) {
            return removeRecord_(dbObj, id);
        },
        getDBInfo: function (dbObj) {
            return getDBInfo_(dbObj);
        }
    }

});


text:
include_recipe 'dynatrace-appmon::node_info'

unless platform_family?('debian', 'fedora', 'rhel')
  raise 'Unsupported platform family.'
end

installation_path = "#{node['dynatrace']['server']['linux']['installer']['prefix_dir']}/dynatrace"
installer_cache_dir = "#{Chef::Config['file_cache_path']}/dynatrace"

# NOTE: this may also delete files from other Dynatrace packages that share the same directory (e.g. /opt/dynatrace)!
dynatrace_uninstall_package 'Uninstall Dynatrace Server' do
  installation_path installation_path
  installer_cache_path installer_cache_dir
  service_name 'dynaTraceServer'
end


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:id="@+id/bt_restart"
        android:title="Restart"
        android:icon="@drawable/recycle" />
    <item android:id="@+id/bt_about"
        android:title="About"
        android:icon="@drawable/about" />
    <item android:id="@+id/bt_exit"
        android:title="Exit"
        android:icon="@drawable/close" />
</menu>