text:
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
/* The Computer Language Benchmarks Game
   http://benchmarksgame.alioth.debian.org/

   contributed by Robert F. Tobler to process large blocks of byte arrays

   modified for use with xunit-performance
*/

using Microsoft.Xunit.Performance;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;

[assembly: OptimizeForBenchmarks]
[assembly: MeasureInstructionsRetired]

namespace BenchmarksGame
{

public static class Revcomp
{

#if DEBUG
    const int Iterations = 1;
    const string InputFile = "revcomp-input25.txt";
#else
    const int Iterations = 800;
    const string InputFile = "revcomp-input25000.txt";
#endif

   struct Block {
      public byte[] Data; public int Count;
      public int Read(BinaryReader r) {
         Data = r.ReadBytes(16384); Count++; return Data.Length;
      }
      public Index IndexOf(byte b, int o) {
         return new Index { Block = Count, Pos = Array.IndexOf(Data, b, o) };
      }
   }

   struct Index {
      public int Block; public int Pos;
      public static readonly Index None = new Index { Block = -1, Pos = -1 };
      public bool InBlock(Block b) { return Block == b.Count; }
   }

   const byte Gt = (byte)'>';
   const byte Lf = (byte)'\n';

   static string FindInput(string s)
   {
       string CoreRoot = System.Environment.GetEnvironmentVariable("CORE_ROOT");

       if (CoreRoot == null)
       {
           Console.WriteLine("This benchmark requries CORE_ROOT to be set");
           return null;
       }

       string inputFile = s ?? InputFile;

       // Normal testing -- input file will end up next to the assembly
       // and CoreRoot points at the test overlay dir
       string[] pathPartsNormal = new string[] {
           CoreRoot, "..", "..", "JIT", "Performance",
           "CodeQuality", "BenchmarksGame", "revcomp", "revcomp", inputFile
       };

       string inputPathNormal = Path.Combine(pathPartsNormal);

       // Perf testing -- input file will end up next to the assembly
       // and CoreRoot points at this directory
       string[] pathPartsPerf = new string[] { CoreRoot, inputFile };

       string inputPathPerf = Path.Combine(pathPartsPerf);

       string inputPath = null;

       if (File.Exists(inputPathNormal))
       {
           inputPath = inputPathNormal;
       }
       else if (File.Exists(inputPathPerf))
       {
           inputPath = inputPathPerf;
       }

       if (inputPath != null)
       {
           Console.WriteLine("Using input file {0}", inputPath);
       }
       else
       {
           Console.WriteLine("Unable to find input file {0}", inputFile);
       }

       return inputPath;
   }

   static int Main(string[] args)
   {
       bool verbose = false;
       string inputFile = InputFile;
       int iterations = Iterations;

       for (int i = 0; i < args.Length; i++)
       {
           if (args[i] == "-v")
           {
               verbose = true;
           }
           if (args[i] == "-i")
           {
               i++;

               if (i < args.Length)
               {
                   Int32.TryParse(args[i], out iterations);
               }
           }
           else
           {
               inputFile = args[i];
           }
       }

       string fullInputFile = FindInput(inputFile);

       if (fullInputFile == null)
       {
           return -1;
       }

       if (iterations != Iterations)
       {
           Console.WriteLine("Running {0} iterations", iterations);
       }

       // Warmup
       BenchInner(false, fullInputFile);

       Stopwatch sw = Stopwatch.StartNew();
       for (int j = 0; j < iterations; j++)
       {
           BenchInner(verbose, fullInputFile);
       }
       sw.Stop();
       Console.WriteLine("revcomp [{0} iters]: {1}ms", iterations, sw.ElapsedMilliseconds);

       return 100;
   }

   static void BenchInner(bool doOutput, string inputFile)
   {
      InitComplements();
      var seq = new List<byte[]>();
      var b = new Block { Count = -1 };
      Index line = Index.None, start = Index.None, end = Index.None;
      using (var r = new BinaryReader(File.OpenRead(inputFile))) {
          using (var w = doOutput ? Console.OpenStandardOutput() : Stream.Null) {
              while (b.Read(r) > 0) {
                  seq.Add(b.Data);
                  if (line.Pos < 0) line = b.IndexOf(Gt, 0);
                  while (line.Pos >= 0) {
                      if (start.Pos < 0) {
                          var off = line.InBlock(b) ? line.Pos : 0;
                          start = b.IndexOf(Lf, off);
                          if (start.Pos < 0) {
                              w.Write(b.Data, off, b.Data.Length - off);
                              seq.Clear(); break;
                          }
                          w.Write(b.Data, off, start.Pos + 1 - off);
                      }
                      if (end.Pos < 0) {
                          end = b.IndexOf(Gt, start.InBlock(b) ? start.Pos : 0);
                          if (end.Pos < 0) break;
                      }
                      w.Reverse(start.Pos, end.Pos, seq);
                      if (seq.Count > 1) seq.RemoveRange(0, seq.Count - 1);
                      line = end; end = Index.None; start = Index.None;
                  }
              }
              if (start.Pos >= 0 && end.Pos < 0)
              w.Reverse(start.Pos, seq[seq.Count -1].Length, seq);
          }
      }
   }

   const string Seq = "ABCDGHKMRTVYabcdghkmrtvy";
   const string Rev = "TVGHCDMKYABRTVGHCDMKYABR";
   static byte[] comp = new byte[256];

   static void InitComplements() {
      for (byte i = 0; i < 255; i++) comp[i] = i;
      for (int i = 0; i < Seq.Length; i++)
         comp[(byte)Seq[i]] = (byte)Rev[i];
      comp[Lf] = 0;  comp[(byte)' '] = 0;
   }

   const int LineLen = 61;
   const int BufSize = LineLen * 269;
   static byte[] buf = new byte[BufSize];

   static void Reverse(this Stream w, int si, int ei, List<byte[]> bl) {
      int bi = 0, line = LineLen - 1;
      for (int ri = bl.Count-1; ri >= 0; ri--) {
         var b = bl[ri]; int off = ri == 0 ? si : 0;
         for (int i = (ri == bl.Count-1 ? ei : b.Length)-1; i >= off; i--) {
            var c = comp[b[i]]; if (c > 0) buf[bi++] = c;
            if (bi == line) {
               buf[bi++] = Lf; line += LineLen;
               if (bi == BufSize) {
                  w.Write(buf, 0, BufSize); bi = 0; line = LineLen - 1;
               }
            }
         }
      }
      if (bi > 0) {
          if (buf[bi-1] != Lf) buf[bi++] = Lf; w.Write(buf, 0, bi);
      }
   }

   [Benchmark]
   public static void Bench()
   {
       string inputFile = FindInput(InputFile);

       if (inputFile == null)
       {
           throw new Exception("unable to find input");
       }

        foreach (var iteration in Benchmark.Iterations)
        {
            using (iteration.StartMeasurement())
            {
                for (int i = 0; i < Iterations; i++)
                {
                    BenchInner(false, inputFile);
                }
            }
        }
   }
}

}


text:
<?php

namespace Alhames\ApiHelperBundle\Core;

use ApiHelper\Core\ClientInterface;
use ApiHelper\Core\OAuth2ClientInterface;
use ApiHelper\Core\ParserInterface;
use Alhames\ApiHelperBundle\Account\AbstractAccount;

/**
 * Class ServiceManager.
 */
class ServiceManager
{
    /** @var array  */
    protected $config;

    /** @var ClientInterface[] */
    protected $clients = [];

    /**
     * ServiceManager constructor.
     *
     * @param array $config
     */
    public function __construct(array $config = [])
    {
        $this->config = $config;
    }

    /**
     * @param string $alias
     *
     * @return bool
     */
    public function has($alias)
    {
        return array_key_exists($alias, $this->config);
    }

    /**
     * @param string $alias
     *
     * @return ClientInterface|OAuth2ClientInterface|ParserInterface
     */
    public function get($alias)
    {
        if (!array_key_exists($alias, $this->clients)) {
            $this->clients[$alias] = $this->create($alias);
        }

        return $this->clients[$alias];
    }

    /**
     * @param string $alias
     * @param array  $options
     *
     * @return ClientInterface|OAuth2ClientInterface|ParserInterface
     */
    public function create($alias, array $options = [])
    {
        if (!$this->has($alias)) {
            throw new \LogicException(sprintf('Invalid service "%s".', $alias));
        }

        $class = $this->config[$alias]['client_class'];

        return new $class(array_merge($this->config[$alias], $options));
    }

    /**
     * @param string                $alias
     * @param OAuth2ClientInterface $client
     *
     * @return AbstractAccount
     */
    public function createAccount($alias, OAuth2ClientInterface $client = null)
    {
        if (!isset($this->config[$alias]['account_class'])) {
            throw new \LogicException(sprintf('Service %s not found or does not have an account.', $alias));
        }

        $client = $client ?: $this->get($alias);
        $class = $this->config[$alias]['account_class'];

        return new $class($alias, $client);
    }

    /**
     * @param string $alias
     * @param string $providerKey
     *
     * @return bool
     */
    public function isLoginSupported($alias, $providerKey)
    {
        if (!$this->has($alias)) {
            return false;
        }

        if (is_bool($this->config[$alias]['security_login'])) {
            return $this->config[$alias]['security_login'];
        }

        return in_array($providerKey, $this->config[$alias]['security_login'], true);
    }

    /**
     * @param string $alias
     *
     * @return bool
     */
    public function isConnectSupported($alias)
    {
        return $this->has($alias) && $this->config[$alias]['security_connect'];
    }

    /**
     * @return string[]
     */
    public function getConnectSupportedServices()
    {
        $services = [];

        foreach ($this->config as $alias => $config) {
            if ($config['security_connect']) {
                $services[] = $alias;
            }
        }

        return $services;
    }

    /**
     * @return string[]
     */
    public function getLoginSupportedServices($providerKey)
    {
        $services = [];

        foreach ($this->config as $alias => $config) {
            if (true === $config['security_login']) {
                $services[] = $alias;
            } elseif (is_array($config['security_login']) && in_array($providerKey, $config['security_login'], true)) {
                $services[] = $alias;
            }
        }

        return $services;
    }
}

redpajama_set_name: RedPajamaGithub


text:
package org.rockey.wechat.mp.sdk.vo.push;

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

/**
 *
 * @author RockeyHoo
 */
@XmlRootElement(name = "xml")
@XmlAccessorType(XmlAccessType.FIELD)
public class TextPush extends Push {
    @XmlElement(name = "Content")
    private String content;

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

}


text:
/**
 * @author	Andrew Sytsma <asytsma@purdue.edu>
 */
public class Human implements Player
{
	/**
	 * Holds the player's username.
	 */
	private final String username;

	/**
	 * Human constructor initializes fields.
	 *
	 * @param username	The player's username.
	 */
	public Human(String username)
	{
		this.username = username;
	}	//end of Human constructor

	/**
	 * Returns the username of the player.
	 *
	 * @return	Returns the username of the player.
	 */
	public String getUsername()
	{
		return this.username;
	}	//end of getUsername method
}	//end of Human class


text:
//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:4.0.30319.42000
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

namespace Secs4Net {
    using System;

    /// <summary>
    ///   A strongly-typed resource class, for looking up localized strings, etc.
    /// </summary>
    // This class was auto-generated by the StronglyTypedResourceBuilder
    // class via a tool like ResGen or Visual Studio.
    // To add or remove a member, edit your .ResX file then rerun ResGen
    // with the /str option, or rebuild your VS project.
    [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")]
    [global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
    [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    internal class Resources {

        private static global::System.Resources.ResourceManager resourceMan;

        private static global::System.Globalization.CultureInfo resourceCulture;

        [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
        internal Resources() {
        }

        /// <summary>
        ///   Returns the cached ResourceManager instance used by this class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Resources.ResourceManager ResourceManager {
            get {
                if (object.ReferenceEquals(resourceMan, null)) {
                    global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Secs4Net.Resources", typeof(Resources).Assembly);
                    resourceMan = temp;
                }
                return resourceMan;
            }
        }

        /// <summary>
        ///   Overrides the current thread's CurrentUICulture property for all
        ///   resource lookups using this strongly typed resource class.
        /// </summary>
        [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
        internal static global::System.Globalization.CultureInfo Culture {
            get {
                return resourceCulture;
            }
            set {
                resourceCulture = value;
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Unrecognized Device Id.
        /// </summary>
        internal static string S9F1 {
            get {
                return ResourceManager.GetString("S9F1", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Data Too Long.
        /// </summary>
        internal static string S9F11 {
            get {
                return ResourceManager.GetString("S9F11", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Conversation Timeout.
        /// </summary>
        internal static string S9F13 {
            get {
                return ResourceManager.GetString("S9F13", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Unrecognized Stream Type.
        /// </summary>
        internal static string S9F3 {
            get {
                return ResourceManager.GetString("S9F3", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Unrecognized Function Type.
        /// </summary>
        internal static string S9F5 {
            get {
                return ResourceManager.GetString("S9F5", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Illegal Data.
        /// </summary>
        internal static string S9F7 {
            get {
                return ResourceManager.GetString("S9F7", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Transaction Timer Timeout.
        /// </summary>
        internal static string S9F9 {
            get {
                return ResourceManager.GetString("S9F9", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to S9Fy message reply..
        /// </summary>
        internal static string S9Fy {
            get {
                return ResourceManager.GetString("S9Fy", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Stream number must be less than 127.
        /// </summary>
        internal static string SecsMessageStreamNumberMustLessThan127 {
            get {
                return ResourceManager.GetString("SecsMessageStreamNumberMustLessThan127", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to Equipment is not online mode.
        /// </summary>
        internal static string SxF0 {
            get {
                return ResourceManager.GetString("SxF0", resourceCulture);
            }
        }

        /// <summary>
        ///   Looks up a localized string similar to T3 Timeout!.
        /// </summary>
        internal static string T3Timeout {
            get {
                return ResourceManager.GetString("T3Timeout", resourceCulture);
            }
        }
    }
}


text:
package com.citrix.netscaler.nitro.resource.config.lb;

import com.citrix.netscaler.nitro.resource.base.*;
import com.citrix.netscaler.nitro.service.nitro_service;
import com.citrix.netscaler.nitro.service.options;
import com.citrix.netscaler.nitro.util.*;
import com.citrix.netscaler.nitro.exception.nitro_exception;

class lbwlm_lbvserver_binding_response extends base_response
{
	public lbwlm_lbvserver_binding[] lbwlm_lbvserver_binding;
}
/**
	* Binding class showing the lbvserver that can be bound to lbwlm.
	*/

public class lbwlm_lbvserver_binding extends base_resource
{
	private String vservername;
	private String wlmname;
	private Long __count;

	/**
	*

	* The name of the Work Load Manager.
 Minimum length =  1
	*

	*/
	public void set_wlmname(String wlmname) throws Exception{
		this.wlmname = wlmname;
	}

	/**
	*

	* The name of the Work Load Manager.
 Minimum length =  1
	*

	*/
	public String get_wlmname() throws Exception {
		return this.wlmname;
	}

	/**
	*

	* Name of the virtual server which is to be bound to the WLM.
	*

	*/
	public void set_vservername(String vservername) throws Exception{
		this.vservername = vservername;
	}

	/**
	*

	* Name of the virtual server which is to be bound to the WLM.
	*

	*/
	public String get_vservername() throws Exception {
		return this.vservername;
	}

	/**
	*

	* converts nitro response into object and returns the object array in case of get request.
	*

	*/
	protected base_resource[] get_nitro_response(nitro_service service, String response) throws Exception{
		lbwlm_lbvserver_binding_response result = (lbwlm_lbvserver_binding_response) service.get_payload_formatter().string_to_resource(lbwlm_lbvserver_binding_response.class, response);
		if(result.errorcode != 0) {
			if (result.errorcode == 444) {
				service.clear_session();
			}
			if(result.severity != null)
			{
				if (result.severity.equals("ERROR"))
					throw new nitro_exception(result.message,result.errorcode);
			}
			else
			{
				throw new nitro_exception(result.message,result.errorcode);
			}
		}
		return result.lbwlm_lbvserver_binding;
	}

	/**
	*

	* Returns the value of object identifier argument
	*

	*/

	protected String get_object_name() {
		return this.wlmname;
	}

	public static base_response add(nitro_service client, lbwlm_lbvserver_binding resource) throws Exception {
		lbwlm_lbvserver_binding updateresource = new lbwlm_lbvserver_binding();
		updateresource.wlmname = resource.wlmname;
		updateresource.vservername = resource.vservername;
		return updateresource.update_resource(client);
	}

	public static base_responses add(nitro_service client, lbwlm_lbvserver_binding resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			lbwlm_lbvserver_binding updateresources[] = new lbwlm_lbvserver_binding[resources.length];
			for (int i=0;i<resources.length;i++){
				updateresources[i] = new lbwlm_lbvserver_binding();
				updateresources[i].wlmname = resources[i].wlmname;
				updateresources[i].vservername = resources[i].vservername;
			}
			result = update_bulk_request(client, updateresources);
		}
		return result;
	}

	public static base_response delete(nitro_service client, lbwlm_lbvserver_binding resource) throws Exception {
		lbwlm_lbvserver_binding deleteresource = new lbwlm_lbvserver_binding();
		deleteresource.wlmname = resource.wlmname;
		deleteresource.vservername = resource.vservername;
		return deleteresource.delete_resource(client);
	}

	public static base_responses delete(nitro_service client, lbwlm_lbvserver_binding resources[]) throws Exception {
		base_responses result = null;
		if (resources != null && resources.length > 0) {
			lbwlm_lbvserver_binding deleteresources[] = new lbwlm_lbvserver_binding[resources.length];
			for (int i=0;i<resources.length;i++){
				deleteresources[i] = new lbwlm_lbvserver_binding();
				deleteresources[i].wlmname = resources[i].wlmname;
				deleteresources[i].vservername = resources[i].vservername;
			}
			result = delete_bulk_request(client, deleteresources);
		}
		return result;
	}

	/**
	* Use this API to fetch lbwlm_lbvserver_binding resources of given name .
	*/
	public static lbwlm_lbvserver_binding[] get(nitro_service service, String wlmname) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		lbwlm_lbvserver_binding response[] = (lbwlm_lbvserver_binding[]) obj.get_resources(service);
		return response;
	}

	/**
	* Use this API to fetch filtered set of lbwlm_lbvserver_binding resources.
	* filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
	*/
	public static lbwlm_lbvserver_binding[] get_filtered(nitro_service service, String wlmname, String filter) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		options option = new options();
		option.set_filter(filter);
		lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option);
		return response;
	}

	/**
	* Use this API to fetch filtered set of lbwlm_lbvserver_binding resources.
	* set the filter parameter values in filtervalue object.
	*/
	public static lbwlm_lbvserver_binding[] get_filtered(nitro_service service, String wlmname, filtervalue[] filter) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		options option = new options();
		option.set_filter(filter);
		lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option);
		return response;
	}

	/**
	* Use this API to count lbwlm_lbvserver_binding resources configued on NetScaler.
	*/
	public static long count(nitro_service service, String wlmname) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		options option = new options();
		option.set_count(true);
		lbwlm_lbvserver_binding response[] = (lbwlm_lbvserver_binding[]) obj.get_resources(service,option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

	/**
	* Use this API to count the filtered set of lbwlm_lbvserver_binding resources.
	* filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
	*/
	public static long count_filtered(nitro_service service, String wlmname, String filter) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		options option = new options();
		option.set_count(true);
		option.set_filter(filter);
		lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

	/**
	* Use this API to count the filtered set of lbwlm_lbvserver_binding resources.
	* set the filter parameter values in filtervalue object.
	*/
	public static long count_filtered(nitro_service service, String wlmname, filtervalue[] filter) throws Exception{
		lbwlm_lbvserver_binding obj = new lbwlm_lbvserver_binding();
		obj.set_wlmname(wlmname);
		options option = new options();
		option.set_count(true);
		option.set_filter(filter);
		lbwlm_lbvserver_binding[] response = (lbwlm_lbvserver_binding[]) obj.getfiltered(service, option);
		if (response != null) {
			return response[0].__count;
		}
		return 0;
	}

}


text:
ZEPHIR_INIT_CLASS(ArangoDBClient_Collection) {

	ZEPHIR_REGISTER_CLASS(ArangoDBClient, Collection, arangodbclient, collection, arangodbclient_collection_method_entry, 0);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_id"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_name"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_type"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_waitForSync"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_journalSize"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_isSystem"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_isVolatile"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_numberOfShards"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_shardKeys"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_status"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zend_declare_property_null(arangodbclient_collection_ce, SL("_keyOptions"), ZEND_ACC_PROTECTED TSRMLS_CC);

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_ID"), "id");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_NAME"), "name");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_TYPE"), "type");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_WAIT_SYNC"), "waitForSync");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_JOURNAL_SIZE"), "journalSize");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_STATUS"), "status");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_KEY_OPTIONS"), "keyOptions");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_IS_SYSTEM"), "isSystem");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_IS_VOLATILE"), "isVolatile");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_NUMBER_OF_SHARDS"), "numberOfShards");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("ENTRY_SHARD_KEYS"), "shardKeys");

	zephir_declare_class_constant_string(arangodbclient_collection_ce, SL("OPTION_PROPERTIES"), "properties");

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("TYPE_DOCUMENT"), 2);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("TYPE_EDGE"), 3);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("STATUS_NEW_BORN"), 1);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("STATUS_UNLOADED"), 2);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("STATUS_LOADED"), 3);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("STATUS_BEING_UNLOADED"), 4);

	zephir_declare_class_constant_long(arangodbclient_collection_ce, SL("STATUS_DELETED"), 5);

	return SUCCESS;

}

PHP_METHOD(ArangoDBClient_Collection, __construct) {

	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *name_param = NULL;
	zval name;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&name);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 0, 1, &name_param);

	if (!name_param) {
		ZEPHIR_INIT_VAR(&name);
		ZVAL_STRING(&name, "");
	} else {
		zephir_get_strval(&name, name_param);
	}

	if (!ZEPHIR_IS_STRING_IDENTICAL(&name, "")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setname", NULL, 0, &name);
		zephir_check_call_status();
	}
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, createFromArray) {

	zend_string *_2;
	zend_ulong _1;
	zephir_fcall_cache_entry *_3 = NULL;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *values_param = NULL, collection, key, value, *_0;
	zval values;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&values);
	ZVAL_UNDEF(&collection);
	ZVAL_UNDEF(&key);
	ZVAL_UNDEF(&value);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &values_param);

	zephir_get_arrval(&values, values_param);

	ZEPHIR_INIT_VAR(&collection);
	object_init_ex(&collection, arangodbclient_collection_ce);
	ZEPHIR_CALL_METHOD(NULL, &collection, "__construct", NULL, 20);
	zephir_check_call_status();
	zephir_is_iterable(&values, 0, "arangodbclient/collection.zep", 50);
	ZEND_HASH_FOREACH_KEY_VAL(Z_ARRVAL_P(&values), _1, _2, _0)
	{
		ZEPHIR_INIT_NVAR(&key);
		if (_2 != NULL) {
			ZVAL_STR_COPY(&key, _2);
		} else {
			ZVAL_LONG(&key, _1);
		}
		ZEPHIR_INIT_NVAR(&value);
		ZVAL_COPY(&value, _0);
		ZEPHIR_CALL_METHOD(NULL, &collection, "set", &_3, 21, &key, &value);
		zephir_check_call_status();
	} ZEND_HASH_FOREACH_END();
	ZEPHIR_INIT_NVAR(&value);
	ZEPHIR_INIT_NVAR(&key);
	RETURN_CCTOR(&collection);

}

PHP_METHOD(ArangoDBClient_Collection, getDefaultType) {

	zval *this_ptr = getThis();

	RETURN_LONG(2);

}

PHP_METHOD(ArangoDBClient_Collection, __clone) {

	zval __$null;
	zval *this_ptr = getThis();

	ZVAL_NULL(&__$null);

	zephir_update_property_zval(this_ptr, SL("_id"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_name"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_waitForSync"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_journalSize"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_isSystem"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_isVolatile"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_numberOfShards"), &__$null);
	zephir_update_property_zval(this_ptr, SL("_shardKeys"), &__$null);

}

PHP_METHOD(ArangoDBClient_Collection, __toString) {

	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZEPHIR_MM_GROW();

	ZEPHIR_RETURN_CALL_METHOD(this_ptr, "tojson", NULL, 0);
	zephir_check_call_status();
	RETURN_MM();

}

PHP_METHOD(ArangoDBClient_Collection, toJson) {

	zval _0;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&_0, this_ptr, "getall", NULL, 0);
	zephir_check_call_status();
	zephir_json_encode(return_value, &_0, 0 );
	RETURN_MM();

}

PHP_METHOD(ArangoDBClient_Collection, toSerialized) {

	zval _0;
	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);

	ZEPHIR_MM_GROW();

	ZEPHIR_CALL_METHOD(&_0, this_ptr, "getall", NULL, 0);
	zephir_check_call_status();
	ZEPHIR_RETURN_CALL_FUNCTION("serialize", NULL, 4, &_0);
	zephir_check_call_status();
	RETURN_MM();

}

PHP_METHOD(ArangoDBClient_Collection, getAll) {

	zval result, _0, _1, _3, _2$$3, _4$$4;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&result);
	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_1);
	ZVAL_UNDEF(&_3);
	ZVAL_UNDEF(&_2$$3);
	ZVAL_UNDEF(&_4$$4);

	ZEPHIR_MM_GROW();

	ZEPHIR_INIT_VAR(&result);
	zephir_create_array(&result, 9, 0 TSRMLS_CC);
	ZEPHIR_OBS_VAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("id"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_name"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("name"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_waitForSync"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("waitForSync"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_journalSize"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("journalSize"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_isSystem"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("isSystem"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_isVolatile"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("isVolatile"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_type"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("type"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_status"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("status"), &_0, PH_COPY | PH_SEPARATE);
	ZEPHIR_OBS_NVAR(&_0);
	zephir_read_property(&_0, this_ptr, SL("_keyOptions"), PH_NOISY_CC);
	zephir_array_update_string(&result, SL("keyOptions"), &_0, PH_COPY | PH_SEPARATE);
	zephir_read_property(&_1, this_ptr, SL("_numberOfShards"), PH_NOISY_CC | PH_READONLY);
	if (Z_TYPE_P(&_1) != IS_NULL) {
		zephir_read_property(&_2$$3, this_ptr, SL("_numberOfShards"), PH_NOISY_CC | PH_READONLY);
		zephir_array_update_string(&result, SL("numberOfShards"), &_2$$3, PH_COPY | PH_SEPARATE);
	}
	zephir_read_property(&_3, this_ptr, SL("_shardKeys"), PH_NOISY_CC | PH_READONLY);
	if (Z_TYPE_P(&_3) == IS_ARRAY) {
		zephir_read_property(&_4$$4, this_ptr, SL("_shardKeys"), PH_NOISY_CC | PH_READONLY);
		zephir_array_update_string(&result, SL("shardKeys"), &_4$$4, PH_COPY | PH_SEPARATE);
	}
	RETURN_CCTOR(&result);

}

PHP_METHOD(ArangoDBClient_Collection, set) {

	zend_long ZEPHIR_LAST_CALL_STATUS;
	zval *key_param = NULL, *value, value_sub;
	zval key;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&key);
	ZVAL_UNDEF(&value_sub);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 2, 0, &key_param, &value);

	zephir_get_strval(&key, key_param);

	if (!(Z_TYPE_P(&key) == IS_STRING)) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(arangodbclient_clientexception_ce, "Invalid collection attribute type", "arangodbclient/collection.zep", 102);
		return;
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "id")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setid", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "name")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setname", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "waitForSync")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setwaitforsync", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "journalSize")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setjournalsize", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "isSystem")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setissystem", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "isVolatile")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setisvolatile", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "type")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "settype", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "status")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setstatus", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "keyOptions")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setkeyoptions", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "numberOfShards")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setnumberofshards", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	if (ZEPHIR_IS_STRING_IDENTICAL(&key, "shardKeys")) {
		ZEPHIR_CALL_METHOD(NULL, this_ptr, "setshardkeys", NULL, 0, value);
		zephir_check_call_status();
		RETURN_MM_NULL();
	}
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, setId) {

	zval _3;
	zend_bool _1;
	zval *id, id_sub, _0, _2;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&id_sub);
	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_2);
	ZVAL_UNDEF(&_3);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &id);

	zephir_read_property(&_0, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY);
	_1 = Z_TYPE_P(&_0) != IS_NULL;
	if (_1) {
		zephir_read_property(&_2, this_ptr, SL("_id"), PH_NOISY_CC | PH_READONLY);
		_1 = !ZEPHIR_IS_IDENTICAL(&_2, id);
	}
	if (_1) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(arangodbclient_clientexception_ce, "Should not update the id of an existing collection", "arangodbclient/collection.zep", 153);
		return;
	}
	zephir_get_strval(&_3, id);
	zephir_update_property_zval(this_ptr, SL("_id"), &_3);
	RETURN_MM_MEMBER(getThis(), "_id");

}

PHP_METHOD(ArangoDBClient_Collection, getId) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_id");

}

PHP_METHOD(ArangoDBClient_Collection, setName) {

	zend_bool _1;
	zval *name_param = NULL, _0, _2;
	zval name, _3;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&name);
	ZVAL_UNDEF(&_3);
	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_2);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &name_param);

	zephir_get_strval(&name, name_param);

	zephir_read_property(&_0, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY);
	_1 = Z_TYPE_P(&_0) != IS_NULL;
	if (_1) {
		zephir_read_property(&_2, this_ptr, SL("_name"), PH_NOISY_CC | PH_READONLY);
		_1 = !ZEPHIR_IS_IDENTICAL(&_2, &name);
	}
	if (_1) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(arangodbclient_clientexception_ce, "Should not update the name of an existing collection", "arangodbclient/collection.zep", 168);
		return;
	}
	zephir_get_strval(&_3, &name);
	zephir_update_property_zval(this_ptr, SL("_name"), &_3);
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, getName) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_name");

}

PHP_METHOD(ArangoDBClient_Collection, setType) {

	zend_bool _1, _3;
	zval *type_param = NULL, _0, _2, _4;
	zend_long type;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_2);
	ZVAL_UNDEF(&_4);

	zephir_fetch_params(0, 1, 0, &type_param);

	type = zephir_get_intval(type_param);

	zephir_read_property(&_0, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY);
	_1 = Z_TYPE_P(&_0) != IS_NULL;
	if (_1) {
		zephir_read_property(&_2, this_ptr, SL("_type"), PH_NOISY_CC | PH_READONLY);
		_1 = !ZEPHIR_IS_LONG_IDENTICAL(&_2, type);
	}
	if (_1) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(arangodbclient_clientexception_ce, "Should not update the type of an existing collection", "arangodbclient/collection.zep", 182);
		return;
	}
	_3 = type != 2;
	if (_3) {
		_3 = type != 3;
	}
	if (_3) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STRW(arangodbclient_clientexception_ce, "Invalid type used for collection", "arangodbclient/collection.zep", 185);
		return;
	}
	ZEPHIR_INIT_ZVAL_NREF(_4);
	ZVAL_LONG(&_4, type);
	zephir_update_property_zval(this_ptr, SL("_type"), &_4);

}

PHP_METHOD(ArangoDBClient_Collection, getType) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_type");

}

PHP_METHOD(ArangoDBClient_Collection, setStatus) {

	zend_bool _1;
	zval *status_param = NULL, __$true, tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, _0, _2, _3, _4, _5;
	zend_long status, ZEPHIR_LAST_CALL_STATUS;
	zval *this_ptr = getThis();

	ZVAL_BOOL(&__$true, 1);
	ZVAL_UNDEF(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c);
	ZVAL_UNDEF(&_0);
	ZVAL_UNDEF(&_2);
	ZVAL_UNDEF(&_3);
	ZVAL_UNDEF(&_4);
	ZVAL_UNDEF(&_5);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &status_param);

	status = zephir_get_intval(status_param);

	zephir_read_property(&_0, this_ptr, SL("_status"), PH_NOISY_CC | PH_READONLY);
	_1 = Z_TYPE_P(&_0) != IS_NULL;
	if (_1) {
		zephir_read_property(&_2, this_ptr, SL("_status"), PH_NOISY_CC | PH_READONLY);
		_1 = !ZEPHIR_IS_LONG_IDENTICAL(&_2, status);
	}
	if (_1) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(arangodbclient_clientexception_ce, "Should not update the status of an existing collection", "arangodbclient/collection.zep", 201);
		return;
	}
	ZEPHIR_INIT_VAR(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c);
	zephir_create_array(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, 5, 0 TSRMLS_CC);
	ZEPHIR_INIT_VAR(&_3);
	ZVAL_LONG(&_3, 1);
	zephir_array_fast_append(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &_3);
	ZEPHIR_INIT_NVAR(&_3);
	ZVAL_LONG(&_3, 2);
	zephir_array_fast_append(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &_3);
	ZEPHIR_INIT_NVAR(&_3);
	ZVAL_LONG(&_3, 3);
	zephir_array_fast_append(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &_3);
	ZEPHIR_INIT_NVAR(&_3);
	ZVAL_LONG(&_3, 4);
	zephir_array_fast_append(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &_3);
	ZEPHIR_INIT_NVAR(&_3);
	ZVAL_LONG(&_3, 5);
	zephir_array_fast_append(&tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &_3);
	ZVAL_LONG(&_4, status);
	ZEPHIR_CALL_FUNCTION(&_5, "in_array", NULL, 5, &_4, &tmpArray8c13b2fa5ccb3b2f347c5ca02097d28c, &__$true);
	zephir_check_call_status();
	if (!(zephir_is_true(&_5))) {
		ZEPHIR_THROW_EXCEPTION_DEBUG_STR(arangodbclient_clientexception_ce, "Invalid status used for collection", "arangodbclient/collection.zep", 205);
		return;
	}
	ZEPHIR_INIT_ZVAL_NREF(_4);
	ZVAL_LONG(&_4, status);
	zephir_update_property_zval(this_ptr, SL("_status"), &_4);
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, getStatus) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_status");

}

PHP_METHOD(ArangoDBClient_Collection, setKeyOptions) {

	zval *keyOptions_param = NULL;
	zval keyOptions;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&keyOptions);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &keyOptions_param);

	zephir_get_arrval(&keyOptions, keyOptions_param);

	zephir_update_property_zval(this_ptr, SL("_keyOptions"), &keyOptions);
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, getKeyOptions) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_keyOptions");

}

PHP_METHOD(ArangoDBClient_Collection, setWaitForSync) {

	zval *value_param = NULL, __$true, __$false;
	zend_bool value;
	zval *this_ptr = getThis();

	ZVAL_BOOL(&__$true, 1);
	ZVAL_BOOL(&__$false, 0);

	zephir_fetch_params(0, 1, 0, &value_param);

	value = zephir_get_boolval(value_param);

	if (value) {
		zephir_update_property_zval(this_ptr, SL("_waitForSync"), &__$true);
	} else {
		zephir_update_property_zval(this_ptr, SL("_waitForSync"), &__$false);
	}

}

PHP_METHOD(ArangoDBClient_Collection, getWaitForSync) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_waitForSync");

}

PHP_METHOD(ArangoDBClient_Collection, setJournalSize) {

	zval *value_param = NULL, _0;
	zend_long value;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);

	zephir_fetch_params(0, 1, 0, &value_param);

	value = zephir_get_intval(value_param);

	ZEPHIR_INIT_ZVAL_NREF(_0);
	ZVAL_LONG(&_0, value);
	zephir_update_property_zval(this_ptr, SL("_journalSize"), &_0);

}

PHP_METHOD(ArangoDBClient_Collection, getJournalSize) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_journalSize");

}

PHP_METHOD(ArangoDBClient_Collection, setIsSystem) {

	zval *value_param = NULL, __$true, __$false;
	zend_bool value;
	zval *this_ptr = getThis();

	ZVAL_BOOL(&__$true, 1);
	ZVAL_BOOL(&__$false, 0);

	zephir_fetch_params(0, 1, 0, &value_param);

	value = zephir_get_boolval(value_param);

	if (value) {
		zephir_update_property_zval(this_ptr, SL("_isSystem"), &__$true);
	} else {
		zephir_update_property_zval(this_ptr, SL("_isSystem"), &__$false);
	}

}

PHP_METHOD(ArangoDBClient_Collection, getIsSystem) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_isSystem");

}

PHP_METHOD(ArangoDBClient_Collection, setIsVolatile) {

	zval *value_param = NULL, __$true, __$false;
	zend_bool value;
	zval *this_ptr = getThis();

	ZVAL_BOOL(&__$true, 1);
	ZVAL_BOOL(&__$false, 0);

	zephir_fetch_params(0, 1, 0, &value_param);

	value = zephir_get_boolval(value_param);

	if (value) {
		zephir_update_property_zval(this_ptr, SL("_isVolatile"), &__$true);
	} else {
		zephir_update_property_zval(this_ptr, SL("_isVolatile"), &__$false);
	}

}

PHP_METHOD(ArangoDBClient_Collection, getIsVolatile) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_isVolatile");

}

PHP_METHOD(ArangoDBClient_Collection, setNumberOfShards) {

	zval *value_param = NULL, _0;
	zend_long value;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&_0);

	zephir_fetch_params(0, 1, 0, &value_param);

	value = zephir_get_intval(value_param);

	ZEPHIR_INIT_ZVAL_NREF(_0);
	ZVAL_LONG(&_0, value);
	zephir_update_property_zval(this_ptr, SL("_numberOfShards"), &_0);

}

PHP_METHOD(ArangoDBClient_Collection, getNumberOfShards) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_numberOfShards");

}

PHP_METHOD(ArangoDBClient_Collection, setShardKeys) {

	zval *value_param = NULL;
	zval value;
	zval *this_ptr = getThis();

	ZVAL_UNDEF(&value);

	ZEPHIR_MM_GROW();
	zephir_fetch_params(1, 1, 0, &value_param);

	zephir_get_arrval(&value, value_param);

	zephir_update_property_zval(this_ptr, SL("_shardKeys"), &value);
	ZEPHIR_MM_RESTORE();

}

PHP_METHOD(ArangoDBClient_Collection, getShardKeys) {

	zval *this_ptr = getThis();

	RETURN_MEMBER(getThis(), "_shardKeys");

}


text:
class TemplateURL;

// Importer for Mozilla Firefox 2.
class Firefox2Importer : public Importer {
 public:
  Firefox2Importer();
  virtual ~Firefox2Importer();

  // Importer methods.
  virtual void StartImport(ProfileInfo profile_info,
                           uint16 items,
                           ProfileWriter* writer,
                           MessageLoop* delagate_loop,
                           ImporterHost* host);

  // Loads the default bookmarks in the Firefox installed at |firefox_app_path|,
  // and stores their locations in |urls|.
  static void LoadDefaultBookmarks(const std::wstring& firefox_app_path,
                                   std::set<GURL> *urls);

  // Creates a TemplateURL with the |keyword| and |url|. |title| may be empty.
  // This function transfers ownership of the created TemplateURL to the caller.
  static TemplateURL* CreateTemplateURL(const std::wstring& title,
                                        const std::wstring& keyword,
                                        const GURL& url);

  // Imports the bookmarks from the specified file. |template_urls| and
  // |favicons| may be null, in which case TemplateURLs and favicons are
  // not parsed. Any bookmarks in |default_urls| are ignored.
  static void ImportBookmarksFile(
      const std::wstring& file_path,
      const std::set<GURL>& default_urls,
      bool import_to_bookmark_bar,
      const std::wstring& first_folder_name,
      Importer* importer,
      std::vector<ProfileWriter::BookmarkEntry>* bookmarks,
      std::vector<TemplateURL*>* template_urls,
      std::vector<history::ImportedFavIconUsage>* favicons);

 private:
  FRIEND_TEST(FirefoxImporterTest, Firefox2BookmarkParse);
  FRIEND_TEST(FirefoxImporterTest, Firefox2CookesParse);

  void ImportBookmarks();
  void ImportPasswords();
  void ImportHistory();
  void ImportSearchEngines();
  // Import the user's home page, unless it is set to default home page as
  // defined in browserconfig.properties.
  void ImportHomepage();

  // Fills |files| with the paths to the files containing the search engine
  // descriptions.
  void GetSearchEnginesXMLFiles(std::vector<std::wstring>* files);

  // Helper methods for parsing bookmark file.
  // Firefox 2 saves its bookmarks in a html file. We are interested in the
  // bookmarks and folders, and their hierarchy. A folder starts with a
  // heading tag, which contains it title. All bookmarks and sub-folders is
  // following, and bracketed by a
 tag:
  //

title

  //

  //      ... container ...
  //

  // And a bookmark is presented by a  tag:
  //
name
  // Reference: http://kb.mozillazine.org/Bookmarks.html
  static bool ParseCharsetFromLine(const std::string& line,
                                   std::string* charset);
  static bool ParseFolderNameFromLine(const std::string& line,
                                      const std::string& charset,
                                      std::wstring* folder_name,
                                      bool* is_toolbar_folder);
  // See above, this will also put the data: URL of the favicon into *favicon
  // if there is a favicon given.  |post_data| is set for POST base keywords to
  // the contents of the actual POST (with %s for the search term).
  static bool ParseBookmarkFromLine(const std::string& line,
                                    const std::string& charset,
                                    std::wstring* title,
                                    GURL* url,
                                    GURL* favicon,
                                    std::wstring* shortcut,
                                    base::Time* add_date,
                                    std::wstring* post_data);

  // Fetches the given attribute value from the |tag|. Returns true if
  // successful, and |value| will contain the value.
  static bool GetAttribute(const std::string& tag,
                           const std::string& attribute,
                           std::string* value);

  // There are some characters in html file will be escaped:
  //   '<', '>', '"', '\', '&'
  // Un-escapes them if the bookmark name has those characters.
  static void HTMLUnescape(std::wstring* text);

  // Fills |xml_files| with the file with an xml extension found under |dir|.
  static void FindXMLFilesInDir(const std::wstring& dir,
                                std::vector<std::wstring>* xml_files);

  // Given the URL of a page and a favicon data URL, adds an appropriate record
  // to the given favicon usage vector. Will do nothing if the favicon is not
  // valid.
  static void DataURLToFaviconUsage(
      const GURL& link_url,
      const GURL& favicon_data,
      std::vector<history::ImportedFavIconUsage>* favicons);

  ProfileWriter* writer_;
  std::wstring source_path_;
  std::wstring app_path_;
  // If true, we only parse the bookmarks.html file specified as source_path_.
  bool parsing_bookmarks_html_file_;

  DISALLOW_EVIL_CONSTRUCTORS(Firefox2Importer);
};

#endif  // CHROME_BROWSER_IMPORTER_FIREFOX2_IMPORTER_H_


text:
<?php

/**
 *
 * Please see single-event.php in this directory for detailed instructions on how to use and modify these templates.
 *
 */

?>


text:
package org.kuali.kra.irb.auth;

import org.kuali.kra.infrastructure.PermissionConstants;
import org.kuali.kra.irb.Protocol;
import org.kuali.kra.irb.actions.ProtocolActionType;

public class ProtocolReviewNotRequiredUnavailableAuthorizer extends ProtocolAuthorizer {

    @Override
    public boolean isAuthorized(String userId, ProtocolTask task) {
        Protocol protocol = task.getProtocol();
        boolean hasPermission = hasPermission(userId, protocol, PermissionConstants.REVIEW_NOT_REQUIRED);
        boolean canExecuteAction = canExecuteAction(task.getProtocol(), ProtocolActionType.IRB_REVIEW_NOT_REQUIRED);
        return hasPermission && !canExecuteAction;
    }

}


text:
import java.applet.*;
import java.net.*;
import java.io.*;

public interface SocketFactory {

  public Socket createSocket(String host, int port, Applet applet)
    throws IOException;

  public Socket createSocket(String host, int port, String[] args)
    throws IOException;
}


text:
package org.nem.ncc.controller.viewmodels;

import org.nem.core.crypto.PublicKey;
import org.nem.core.model.*;
import org.nem.core.model.ncc.*;
import org.nem.core.model.primitive.*;
import org.nem.core.serialization.*;
import org.nem.ncc.model.AccountLabel;

/**
 * Represents an account.
 */
public class AccountViewModel implements SerializableEntity {
	private final Address address;
	private final String label;
	private final PublicKey publicKey;
	private final Amount balance;
	private final BlockAmount foragedBlocks;
	private final Double importance;
	private final AccountStatus status;

	/**
	 * Creates a new account view model around an account metadata pair.
	 *
	 * @param accountMetaDataPair The account metadata pair.
	 * @param label The account label.
	 */
	public AccountViewModel(
			final AccountMetaDataPair accountMetaDataPair,
			final AccountLabel label) {
		this(accountMetaDataPair.getAccount(), accountMetaDataPair.getMetaData().getStatus(), label);
	}

	/**
	 * Creates a new account view model.
	 *
	 * @param info The account info.
	 * @param status The account status.
	 * @param label The account label.
	 */
	public AccountViewModel(
			final AccountInfo info,
			final AccountStatus status,
			final AccountLabel label) {
		this.address = info.getAddress();
		this.label = null == label ? null : label.getLabel();

		this.publicKey = null == info.getKeyPair()
				? null
				: info.getKeyPair().getPublicKey();

		this.balance = info.getBalance();
		this.foragedBlocks = info.getNumForagedBlocks();
		this.importance = info.getImportance();
		this.status = status;
	}

	/**
	 * Gets the account address.
	 *
	 * @return The address.
	 */
	public Address getAddress() {
		return this.address;
	}

	/**
	 * Gets the account label.
	 *
	 * @return The label.
	 */
	public String getLabel() {
		return this.label;
	}

	/**
	 * Gets the account public key.
	 *
	 * @return The public key.
	 */
	public PublicKey getPublicKey() {
		return this.publicKey;
	}

	/**
	 * Gets the account balance.
	 *
	 * @return The balance.
	 */
	public Amount getBalance() {
		return this.balance;
	}

	/**
	 * Gets the number of blocks foraged by the account.
	 *
	 * @return The number of foraged blocks.
	 */
	public BlockAmount getForagedBlocks() {
		return this.foragedBlocks;
	}

	/**
	 * Gets the importance of the account.
	 *
	 * @return The importance.
	 */
	public Double getImportance() {
		return this.importance;
	}

	/**
	 * Gets the status of the account.
	 *
	 * @return The status.
	 */
	public AccountStatus getStatus() {
		return this.status;
	}

	@Override
	public void serialize(final Serializer serializer) {
		Address.writeTo(serializer, "address", this.address);
		serializer.writeString("label", this.label);
		serializer.writeBytes("publicKey", null == this.publicKey ? null : this.publicKey.getRaw());
		Amount.writeTo(serializer, "balance", this.balance);
		serializer.writeDouble("importance", this.importance);
		BlockAmount.writeTo(serializer, "foragedBlocks", this.foragedBlocks);
		AccountStatus.writeTo(serializer, "status", this.status);
	}
}


text:
<?xml version="1.0" encoding="UTF-8"?>
<launchHistory>
<launchGroup id="org.eclipse.ui.externaltools.launchGroup">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.debug">
<mruHistory>
<launch memento="<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration local="true" path="HelloPurplebox"/>
"/>
</mruHistory>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.run">
<mruHistory>
<launch memento="<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration local="true" path="HelloPurplebox"/>
"/>
</mruHistory>
<favorites/>
</launchGroup>
<launchGroup id="com.qnx.tools.ide.target.ui.launchGroup.log">
<mruHistory/>
<favorites/>
</launchGroup>
<launchGroup id="org.eclipse.debug.ui.launchGroup.profile">
<mruHistory>
<launch memento="<?xml version="1.0" encoding="UTF-8"?>
<launchConfiguration local="true" path="HelloPurplebox"/>
"/>
</mruHistory>
<favorites/>
</launchGroup>
</launchHistory>


text:
package ghostawt;

import java.awt.Component;
import java.awt.peer.ScrollbarPeer;

public class GScrollbarPeer extends GComponentPeer implements ScrollbarPeer {
    public GScrollbarPeer(Component target) {
        super(target);
    }

    @Override
    public void setValues(int value, int visible, int minimum, int maximum) {
    }

    @Override
    public void setLineIncrement(int l) {
    }

    @Override
    public void setPageIncrement(int l) {
    }
}


text:
import gulp from 'gulp';
import gulpIf from 'gulp-if';
import plumber from 'gulp-plumber';
import rename from 'gulp-rename';
import imagemin from 'gulp-imagemin';
import {isDevelopment} from '../utils/env';
import {
    path,
    plumberConfig,
    imageminConfig
} from '../config';

export const assets = () => {
    return gulp.src(
        [
            '**/*.*',
            '!**/*.md'
        ],
        {
            cwd: 'source/static/assets'
        })
        .pipe(plumber(plumberConfig))
        // Copy favicon.ico
        .pipe(gulpIf(function (file) {
            if (file.dirname.indexOf('favicons') > -1) {
                return true;
            }
        }, rename({dirname: '/'})
        ))
        // Minify images
        .pipe(gulpIf(!isDevelopment,
            imagemin(imageminConfig.images)
        ))
        .pipe(gulp.dest(path.root));
};


text:
The undistort example demonstrates how to undistort a depth map. It sets up a virtual pinhole camera with a 120 degree
field of view. The choice of the virtual camera's parameters is arbitrary and can be changed. For every pixel of this
virtual camera, we precompute the corresponding pixel coordinate in the real, distorted depth camera. At runtime, we
use this precomputed lookup table to copy depth values from the distorted depth map to the undistorted depth map using
nearest neighbor interpolation. This remapping function can, for example, also be accomplished using OpenCV's faster
remap() function.

## Usage Info

```
undistort.exe <output file>
```

Example:

```
undistort.exe undistorted.csv
```


text:
<?php
$lang['required'] 			= 'El campo %s es obligatorio.';
$lang['isset'] 				= 'El campo %s debe contener un valor.';
$lang['valid_email'] 		= 'El campo %s debe contener una direccion de email valida';
$lang['valid_emails'] 		= 'El campo %s debe contener todas las direcciones de email valida.';
$lang['valid_url'] 			= 'El campo %s debe contener una URL valida.';
$lang['valid_ip'] 			= 'El campo %s debe contener una IP valida.';
$lang['min_length'] 		= 'El campo %s debe tener al menos %s caracteres.';
$lang['max_length'] 		= 'El campo %s no puede exceder los %s caracteres.';
$lang['exact_length'] 		= 'El campo %s debe tener exactamente %s caracteres.';
$lang['alpha'] 				= 'El campo %s debe contener solo caracteres alfabeticos.';
$lang['alpha_numeric'] 		= 'El campo %s debe contener solo caracteres alfanumerico.';
$lang['alpha_dash'] 		= 'El campo %s debe contener solo caracteres alfanumericos, subrayado y guiones';
$lang['numeric']			= 'El campo %s debe contener solo numeros.';
$lang['is_numeric'] 		= 'El campo %s debe contener solo caracteres numericos.';
$lang['integer'] 			= 'El campo %s debe contener un entero.';
$lang['regex_match']		= "El campo %s no tiene el formato correcto.";
$lang['matches'] 			= 'El campo %s no coincide con el campo %s.';
$lang['is_natural'] 		= 'El campo %s debe contener solo numeros positivos.';
$lang['is_natural_no_zero'] = 'El campo %s debe contener un numero mayor que cero.';
$lang['decimal']			= "El Campo %s debe contener un numero decimal.";
$lang['less_than']			= "EL campo %s debe contener un numero menor a %s.";
$lang['greater_than']		= "El campo %s debe cotener un numero mayos a %s.";
$lang['is_unique']			= "Ya existe un campo con este valor. Elija otro."; //no esta en los demas idiomas
$lang['blank']				= "No puede dejar el campo en blanco";
/* End of file form_validation_lang.php */
/* Location: ./system/language/english/form_validation_lang.php */


text:
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
Proc. K. Ned. Akad. Wet. , Ser. C, Biol. Med. Sci. 86(2): 236 (1983)

#### Original name
Macbrideola robusta T.N. Lakh. & K.G. Mukerji, 1977

### Remarks
null


text:
Example and demo registry to allow for npm to install package directly from github. Works for public and private repositories.

# why

Private npm registries are cool, they are often cumbersome to setup and are a bit of an overkill right now. Since your sourcecode already lives on github, why not just install directly from github using npm.

The problem with the current support for github in npm is that it doesn't work well for private repos. To download private repos you have to use the less elegant git+ssh uri syntax and make your package.json files look terrible.

To solve these issues and provide a "cheap" (both in cost and complexity) solution to installing from github via npm, an npm registry proxy can be used. Previously, you would need to proxy all requests through this fake registry but with the addition of the [scopes](http://blog.nodejitsu.com/a-summary-of-scoped-modules-in-npm/) this can actually be done on a per organization or user level and also makes installing private repos as modules much simpler.

# setup

You need to use npm v1.5+ for the scopes features. The easiest way to do this without messing up your existing install is to use the `npm-next` module. Install it globally (as shown below) and run it whenever you would normally run the `npm` cli command.

```
$ npm i -g npm-next
$ npm-next -v
2.0.0-beta.2
```

## configure npm

npm needs to be told where to find our scoped modules. In our example, we are going to download a module from my personal github account. To educate npm about how to handle `@defunctzombie` scope, add the following to your `$HOME/.npmrc` file

```
@defunctzombie:registry=http://npm-github.herokuapp.com
```

This tells npm that whenever it sees a module that starts with `@defunctzombie/` to download it from the npm-github.herokuapp.com registry and not the default main npm registry.

The same process is used for organizations.

## install a scoped module

I have created a demo scoped module to test your setup. Run the command below. Notice that this module [scope-test-02](https://github.com/defunctzombie/scope-test-02) and its dependency do not live on the npm registry but are downloaded via the demo proxy and installed as regular modules.

```
$ npm-next install @defunctzombie/scope-test-02
```

If everything is configured correctly you should see the following output

```
@defunctzombie/scope-test-02@0.0.2 node_modules/@defunctzombie/scope-test-02
└── @defunctzombie/scope-test-01@0.0.2
```

If you wish to add the scoped module to your app's package.json, simply use the full scoped name as the module name.

```json
{
    "dependencies": {
        "@defunctzombie/scope-test-01": "0.0.2"
    }
}
```

# private repositories

If you have a private github repository and wish to install that as an npm module the registry proxy supports that too. One benefit to the approach used here is that you can continue using github to manage user access to your repositories without configuring another permission system.

First, you need to create an oauth token using whatever github account has access to the private repo you wish to install. Follow [these](https://help.github.com/articles/creating-an-access-token-for-command-line-use) instructions from github.

Then, once again edit your `.npmrc` file and add the following lines after the existing `@defunctzombie/` line. Note, you will need these lines under every `@user` or `@org` that has private repos you wish to install.

```
@defunctzombie:registry=http://npm-github.herokuapp.com
//npm-github.herokuapp.com/:always-auth=true
//npm-github.herokuapp.com/:_authToken=<token here>
```

These credentials WILL BE SENT to the heroku demo app which will use them to grant access to the private repository.

That's it! You can now install any private repo your user account has access to via npm. For CI systems, simply make a CI github user and token with only the repo access you need.

**Note**: while I am not storing any github auth tokens, PLEASE run your own copy of the registry code for any serious use. The heroku app is only a demo.

# gotchas and tips

* You must tag the version in github before you can install it.


text:
package org.apereo.cas.authentication.principal.cache;

import org.apereo.cas.authentication.principal.Principal;
import org.apereo.cas.authentication.principal.PrincipalAttributesRepository;
import org.apereo.cas.util.CollectionUtils;
import org.apereo.cas.util.spring.ApplicationContextProvider;

import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import lombok.val;
import org.apache.commons.lang3.StringUtils;
import org.apereo.services.persondir.IPersonAttributeDao;
import org.apereo.services.persondir.support.merger.IAttributeMerger;
import org.apereo.services.persondir.support.merger.MultivaluedAttributeMerger;
import org.apereo.services.persondir.support.merger.NoncollidingAttributeAdder;
import org.apereo.services.persondir.support.merger.ReplacingAttributeAdder;

import java.io.Closeable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors;

/**
 * Parent class for retrieval principals attributes, provides operations
 * around caching, merging of attributes.
 *
 * @author Misagh Moayyed
 * @since 4.2
 */
@Slf4j
@ToString
@Getter
@Setter
@EqualsAndHashCode(of = {"timeUnit", "expiration"})
public abstract class AbstractPrincipalAttributesRepository implements PrincipalAttributesRepository, Closeable {

    /**
     * Default cache expiration time unit.
     */
    private static final String DEFAULT_CACHE_EXPIRATION_UNIT = TimeUnit.HOURS.name();

    /**
     * Default expiration lifetime based on the default time unit.
     */
    private static final long DEFAULT_CACHE_EXPIRATION_DURATION = 2;

    private static final long serialVersionUID = 6350245643948535906L;

    /**
     * The expiration time.
     */
    protected long expiration;

    /**
     * Expiration time unit.
     */
    protected String timeUnit;

    /**
     * The merging strategy that deals with existing principal attributes
     * and those that are retrieved from the source. By default, existing attributes
     * are ignored and the source is always consulted.
     */
    protected MergingStrategy mergingStrategy;
    private transient IPersonAttributeDao attributeRepository;

    /**
     * Instantiates a new principal attributes repository.
     * Simply used buy
     */
    protected AbstractPrincipalAttributesRepository() {
        this(DEFAULT_CACHE_EXPIRATION_DURATION, DEFAULT_CACHE_EXPIRATION_UNIT);
    }

    /**
     * Instantiates a new principal attributes repository.
     *
     * @param expiration the expiration
     * @param timeUnit   the time unit
     */
    public AbstractPrincipalAttributesRepository(final long expiration, final String timeUnit) {
        this.expiration = expiration;
        this.timeUnit = timeUnit;
    }

    /***
     * Convert principal attributes to person attributes.
     * @param p  the principal carrying attributes
     * @return person attributes
     */
    private static Map<String, List<Object>> convertPrincipalAttributesToPersonAttributes(final Principal p) {
        val convertedAttributes = new TreeMap<String, List<Object>>(String.CASE_INSENSITIVE_ORDER);
        val principalAttributes = p.getAttributes();
        principalAttributes.entrySet().forEach(entry -> {
            val values = entry.getValue();
            val key = entry.getKey();
            if (values instanceof List) {
                convertedAttributes.put(key, (List) values);
            } else {
                convertedAttributes.put(key, CollectionUtils.wrap(values));
            }
        });
        return convertedAttributes;
    }

    /**
     * Convert person attributes to principal attributes.
     *
     * @param attributes person attributes
     * @return principal attributes
     */
    protected Map<String, Object> convertPersonAttributesToPrincipalAttributes(final Map<String, List<Object>> attributes) {
        return attributes.entrySet().stream().collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().size() == 1
            ? entry.getValue().get(0) : entry.getValue(), (e, f) -> f == null ? e : f));
    }

    /**
     * Obtains attributes first from the repository by calling
     * {@link org.apereo.services.persondir.IPersonAttributeDao#getPerson(String)}.
     *
     * @param id the person id to locate in the attribute repository
     * @return the map of attributes
     */
    protected Map<String, List<Object>> retrievePersonAttributesToPrincipalAttributes(final String id) {
        val attrs = getAttributeRepository().getPerson(id);
        if (attrs == null) {
            LOGGER.debug("Could not find principal [{}] in the repository so no attributes are returned.", id);
            return new HashMap<>(0);
        }
        val attributes = attrs.getAttributes();
        if (attributes == null) {
            LOGGER.debug("Principal [{}] has no attributes and so none are returned.", id);
            return new HashMap<>(0);
        }
        return attributes;
    }

    @Override
    public Map<String, Object> getAttributes(final Principal p) {
        val cachedAttributes = getPrincipalAttributes(p);
        if (cachedAttributes != null && !cachedAttributes.isEmpty()) {
            LOGGER.debug("Found [{}] cached attributes for principal [{}] that are [{}]", cachedAttributes.size(), p.getId(), cachedAttributes);
            return cachedAttributes;
        }
        if (getAttributeRepository() == null) {
            LOGGER.debug("No attribute repository is defined for [{}]. Returning default principal attributes for [{}]", getClass().getName(), p.getId());
            return cachedAttributes;
        }
        val sourceAttributes = retrievePersonAttributesToPrincipalAttributes(p.getId());
        LOGGER.debug("Found [{}] attributes for principal [{}] from the attribute repository.", sourceAttributes.size(), p.getId());
        if (this.mergingStrategy == null || this.mergingStrategy.getAttributeMerger() == null) {
            LOGGER.debug("No merging strategy found, so attributes retrieved from the repository will be used instead.");
            return convertAttributesToPrincipalAttributesAndCache(p, sourceAttributes);
        }
        val principalAttributes = convertPrincipalAttributesToPersonAttributes(p);
        LOGGER.debug("Merging current principal attributes with that of the repository via strategy [{}]", this.mergingStrategy);
        try {
            val mergedAttributes = this.mergingStrategy.getAttributeMerger().mergeAttributes(principalAttributes, sourceAttributes);
            return convertAttributesToPrincipalAttributesAndCache(p, mergedAttributes);
        } catch (final Exception e) {
            val builder = new StringBuilder();
            builder.append(e.getClass().getName().concat("-"));
            if (StringUtils.isNotBlank(e.getMessage())) {
                builder.append(e.getMessage());
            }
            LOGGER.error("The merging strategy [{}] for [{}] has failed to produce principal attributes because: [{}]. "
                    + "This usually is indicative of a bug and/or configuration mismatch. CAS will skip the merging process "
                    + "and will return the original collection of principal attributes [{}]", this.mergingStrategy, p.getId(),
                builder.toString(), principalAttributes);
            return convertAttributesToPrincipalAttributesAndCache(p, principalAttributes);
        }
    }

    /**
     * Convert attributes to principal attributes and cache.
     *
     * @param p                the p
     * @param sourceAttributes the source attributes
     * @return the map
     */
    private Map<String, Object> convertAttributesToPrincipalAttributesAndCache(final Principal p, final Map<String, List<Object>> sourceAttributes) {
        val finalAttributes = convertPersonAttributesToPrincipalAttributes(sourceAttributes);
        addPrincipalAttributes(p.getId(), finalAttributes);
        return finalAttributes;
    }

    /**
     * Add principal attributes into the underlying cache instance.
     *
     * @param id         identifier used by the cache as key.
     * @param attributes attributes to cache
     * @since 4.2
     */
    protected abstract void addPrincipalAttributes(String id, Map<String, Object> attributes);

    /**
     * Gets principal attributes from cache.
     *
     * @param p the principal
     * @return the principal attributes from cache
     */
    protected abstract Map<String, Object> getPrincipalAttributes(Principal p);

    private IPersonAttributeDao getAttributeRepository() {
        try {
            if (this.attributeRepository == null) {
                val context = ApplicationContextProvider.getApplicationContext();
                if (context != null) {
                    return context.getBean("attributeRepository", IPersonAttributeDao.class);
                }
                LOGGER.warn("No application context could be retrieved, so no attribute repository instance can be determined.");
            }
        } catch (final Exception e) {
            LOGGER.warn(e.getMessage(), e);
        }
        return this.attributeRepository;
    }

    /**
     * Defines the merging strategy options.
     */
    public enum MergingStrategy {

        /**
         * Replace attributes.
         */
        REPLACE,
        /**
         * Add attributes.
         */
        ADD,
        /**
         * No merging.
         */
        NONE,
        /**
         * Multivalued attributes.
         */
        MULTIVALUED;

        /**
         * Get attribute merger.
         *
         * @return the attribute merger
         */
        public IAttributeMerger getAttributeMerger() {
            val name = this.name().toUpperCase();
            switch (name.toUpperCase()) {
                case "REPLACE":
                    return new ReplacingAttributeAdder();
                case "ADD":
                    return new NoncollidingAttributeAdder();
                case "MULTIVALUED":
                    return new MultivaluedAttributeMerger();
                default:
                    return null;
            }
        }
    }

}


text:
package synergynet3.activitypack1.table.fishes;

import java.awt.Color;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;

import multiplicity3.csys.MultiplicityEnvironment;
import multiplicity3.csys.factory.ContentTypeNotBoundException;
import multiplicity3.csys.items.container.IContainer;
import multiplicity3.csys.items.image.IImage;
import multiplicity3.csys.items.item.IItem;
import multiplicity3.csys.stage.IStage;
import synergynet3.activitypack1.table.fishes.birdmodel.Bird;
import synergynet3.activitypack1.table.fishes.birdmodel.Food;
import synergynet3.activitypack1.table.fishes.birdmodel.Obstacle;
import synergynet3.activitypack1.table.fishes.birdmodel.Predator;

import com.jme3.math.Vector2f;

/**
 * The Class BirdCollection.
 */
public class BirdCollection
{

	/** The birds. */
	private List<Bird> birds = new ArrayList<Bird>();

	/** The eatable bird count. */
	private int eatableBirdCount;

	/** The root. */
	private IContainer root;

	/**
	 * Instantiates a new bird collection.
	 *
	 * @param root
	 *            the root
	 */
	public BirdCollection(IContainer root)
	{
		this.root = root;
	}

	/**
	 * Adds the bird.
	 *
	 * @param b
	 *            the b
	 */
	public void addBird(Bird b)
	{
		birds.add(b);
		IItem rep = createRepresentationForBird(b);
		root.addItem(rep);
		b.setRepresentation(rep);
		if (birdIsEatable(b))
		{
			eatableBirdCount++;
		}
	}

	/**
	 * Bird at index.
	 *
	 * @param i
	 *            the i
	 * @return the bird
	 */
	public Bird birdAtIndex(int i)
	{
		return birds.get(i);
	}

	/**
	 * Eatable bird count.
	 *
	 * @return the int
	 */
	public int eatableBirdCount()
	{
		return eatableBirdCount;
	}

	/**
	 * Removes the bird.
	 *
	 * @param b
	 *            the b
	 */
	public void removeBird(Bird b)
	{
		birds.remove(b);
		root.removeItem(b.getRepresentation());
		if (birdIsEatable(b))
		{
			eatableBirdCount--;
		}
	}

	/**
	 * Size.
	 *
	 * @return the int
	 */
	public int size()
	{
		return birds.size();
	}

	/**
	 * Update.
	 */
	public void update()
	{
		for (Bird b : birds)
		{
			b.updateRepresentationPosition();
			b.updateRepresentationRotation();
		}
	}

	/**
	 * Bird is eatable.
	 *
	 * @param b
	 *            the b
	 * @return true, if successful
	 */
	private boolean birdIsEatable(Bird b)
	{
		return b.getColor().equals(Color.blue) || b.getColor().equals(Color.green) || b.getColor().equals(Color.yellow);
	}

	/**
	 * Creates the representation for bird.
	 *
	 * @param b
	 *            the b
	 * @return the i item
	 */
	private IItem createRepresentationForBird(Bird b)
	{
		IStage stage = MultiplicityEnvironment.get().getLocalStages().get(0);
		try
		{

			IImage img = stage.getContentFactory().create(IImage.class, "bird", UUID.randomUUID());
			img.setSize(new Vector2f(24, 24));
			if (b instanceof Predator)
			{
				img.setImage("synergynet3/activitypack1/table/fishes/red.png");
			}
			else if (b instanceof Food)
			{
				img.setImage("synergynet3/activitypack1/table/fishes/food.png");
			}
			else if (b instanceof Obstacle)
			{
				img.setImage("synergynet3/activitypack1/table/fishes/obstacle.png");
			}
			else if (b.getColor().equals(Color.blue))
			{
				img.setImage("synergynet3/activitypack1/table/fishes/blue.png");
			}
			else if (b.getColor().equals(Color.green))
			{
				img.setImage("synergynet3/activitypack1/table/fishes/green.png");
			}
			else if (b.getColor().equals(Color.yellow))
			{
				img.setImage("synergynet3/activitypack1/table/fishes/yellow.png");
			}

			return img;

		}
		catch (ContentTypeNotBoundException e)
		{
			// TODO Auto-generated catch block
			e.printStackTrace();
		}

		return null;
	}

}


text:
import { Context, ContextManager, ROOT_CONTEXT } from '@opentelemetry/api';

/**
 * Stack Context Manager for managing the state in web
 * it doesn't fully support the async calls though
 */
export class StackContextManager implements ContextManager {
  /**
   * whether the context manager is enabled or not
   */
  private _enabled = false;

  /**
   * Keeps the reference to current context
   */
  public _currentContext = ROOT_CONTEXT;

  /**
   *
   * @param context
   * @param target Function to be executed within the context
   */
  // eslint-disable-next-line @typescript-eslint/ban-types
  private _bindFunction<T extends Function>(
    context = ROOT_CONTEXT,
    target: T
  ): T {
    const manager = this;
    const contextWrapper = function (this: unknown, ...args: unknown[]) {
      return manager.with(context, () => target.apply(this, args));
    };
    Object.defineProperty(contextWrapper, 'length', {
      enumerable: false,
      configurable: true,
      writable: false,
      value: target.length,
    });
    return (contextWrapper as unknown) as T;
  }

  /**
   * Returns the active context
   */
  active(): Context {
    return this._currentContext;
  }

  /**
   * Binds a the certain context or the active one to the target function and then returns the target
   * @param context A context (span) to be bind to target
   * @param target a function or event emitter. When target or one of its callbacks is called,
   *  the provided context will be used as the active context for the duration of the call.
   */
  bind<T>(context: Context, target: T): T {
    // if no specific context to propagate is given, we use the current one
    if (context === undefined) {
      context = this.active();
    }
    if (typeof target === 'function') {
      return this._bindFunction(context, target);
    }
    return target;
  }

  /**
   * Disable the context manager (clears the current context)
   */
  disable(): this {
    this._currentContext = ROOT_CONTEXT;
    this._enabled = false;
    return this;
  }

  /**
   * Enables the context manager and creates a default(root) context
   */
  enable(): this {
    if (this._enabled) {
      return this;
    }
    this._enabled = true;
    this._currentContext = ROOT_CONTEXT;
    return this;
  }

  /**
   * Calls the callback function [fn] with the provided [context]. If [context] is undefined then it will use the window.
   * The context will be set as active
   * @param context
   * @param fn Callback function
   * @param thisArg optional receiver to be used for calling fn
   * @param args optional arguments forwarded to fn
   */
  with<A extends unknown[], F extends (...args: A) => ReturnType<F>>(
    context: Context | null,
    fn: F,
    thisArg?: ThisParameterType<F>,
    ...args: A
  ): ReturnType<F> {
    const previousContext = this._currentContext;
    this._currentContext = context || ROOT_CONTEXT;

    try {
      return fn.call(thisArg, ...args);
    } finally {
      this._currentContext = previousContext;
    }
  }
}


text:
module WinFFI
  if WINDOWS_VERSION >= :xp
    require 'win-ffi/core/struct/point'

    require_relative '../../enum/shell/help_info_context'

    module User32
      # Structure pointed to by lParam of WM_HELP
      # https://docs.microsoft.com/en-us/windows/win32/api/winuser/ns-winuser-helpinfo
      class HELPINFO < FFIAdditions::Struct
        attr_accessor :cbSize,
                      :iContextType,
                      :iCtrlId,
                      :hItemHandle,
                      :dwContextId,
                      :MousePos

        layout cbSize:       :uint,
               iContextType: HelpInfoContext,
               iCtrlId:      :int,
               hItemHandle:  :handle,
               dwContextId:  :dword,
               MousePos:     POINT

        def initialize
          super
          self.cbSize = self.size
        end

        private :cbSize, :cbSize=
      end
    end
  end
end


text:
package googlecharts.proxies.microflows;

import java.util.HashMap;
import java.util.Map;
import com.mendix.core.Core;
import com.mendix.core.CoreException;
import com.mendix.systemwideinterfaces.MendixRuntimeException;
import com.mendix.systemwideinterfaces.core.IContext;
import com.mendix.systemwideinterfaces.core.IMendixObject;

public class Microflows
{
	// These are the microflows for the GoogleCharts module
	public static googlecharts.proxies.Result dS_DonutsEaten_AreaChart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_DonutsEaten_AreaChart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_DonutsEaten_BarChart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_DonutsEaten_BarChart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_DonutsEaten_ColumnChart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_DonutsEaten_ColumnChart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_DonutsEaten_LineChart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_DonutsEaten_LineChart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_DonutsEaten_PieChart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_DonutsEaten_PieChart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_Sankey_Example(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_Sankey_Example", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static googlecharts.proxies.Result dS_SensorData_Linechart(IContext context)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			IMendixObject result = (IMendixObject)Core.execute(context, "GoogleCharts.DS_SensorData_Linechart", params);
			return result == null ? null : googlecharts.proxies.Result.initialize(context, result);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdateAreaResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdateAreaResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdateBarResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdateBarResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdateColumnResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdateColumnResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdateLineResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdateLineResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdatePieResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdatePieResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
	public static void iVK_UpdateSankeyResult(IContext context, googlecharts.proxies.Result _result)
	{
		try
		{
			Map<java.lang.String, Object> params = new HashMap<java.lang.String, Object>();
			params.put("Result", _result == null ? null : _result.getMendixObject());
			Core.execute(context, "GoogleCharts.IVK_UpdateSankeyResult", params);
		}
		catch (CoreException e)
		{
			throw new MendixRuntimeException(e);
		}
	}
}


text:
require "blurred_image_tag/version"
require "blurred_image_tag/engine"


text:
class User < ActiveRecord::Base
  has_badges
end


text:
//
//  NSNumber+MWKTitleNamespace.h
//  Wikipedia
//
//  Created by Brian Gerstle on 2/16/16.
//  Copyright © 2016 Wikimedia Foundation. All rights reserved.
//

#import <Foundation/Foundation.h>

/**
 *  List of all built-in MediaWiki namespaces.
 *
 *  see https://www.mediawiki.org/wiki/Manual:Namespace#Built-in_namespaces
 */
typedef NS_ENUM (NSInteger, MWKTitleNamespace) {
    MWKTitleNamespaceUnknown       = NSNotFound,
    MWKTitleNamespaceMedia         = -2,
    MWKTitleNamespaceSpecial       = -1,
    MWKTitleNamespaceMain          = 0,
    MWKTitleNamespaceTalk          = 1,
    MWKTitleNamespaceUser          = 2,
    MWKTitleNamespaceUserTalk      = 3,
    MWKTitleNamespaceProject       = 4,
    MWKTitleNamespaceProjectTalk   = 5,
    MWKTitleNamespaceFile          = 6,
    MWKTitleNamespaceFileTalk      = 7,
    MWKTitleNamespaceMediaWiki     = 8,
    MWKTitleNamespaceMediaWikiTalk = 9,
    MWKTitleNamespaceTemplate      = 10,
    MWKTitleNamespaceTemplateTalk  = 11,
    MWKTitleNamespaceHelp          = 12,
    MWKTitleNamespaceHelpTalk      = 13,
    MWKTitleNamespaceCategory      = 14,
    MWKTitleNamespaceCategoryTalk  = 15
};

@interface NSNumber (MWKTitleNamespace)

/**
 *  Casts the receiver's value to a @c MWKTitleNamespace enum, performing additional range validation.
 *
 *  @return The receiver's integer value as a namespace enum, or if out of bounds, @c MWKTitleNamespaceUnknown.
 */
- (MWKTitleNamespace)wmf_titleNamespaceValue;

/**
 *  Convenience getter to check if the receiver belongs in the Main namespace.
 *
 *  @return @c YES if the receiver's integer value is @c MWKTitleNamespaceMain, otherwise @c NO.
 */
- (BOOL)wmf_isMainNamespace;

@end


text:
from django.conf.urls.defaults import *
from cloudman.settings import MEDIA_ROOT
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
     (r'^changeloglist/$','cloudman.cloudman.logQueries.listChangeLog'),
     (r'^issuelist/$','cloudman.cloudman.logQueries.issuepanel'),
     (r'^logpanel/$','cloudman.cloudman.logQueries.logpanel'),
     (r'^issuepanel/$','cloudman.cloudman.logQueries.issuepanel'),
)


text:
'use strict';

var React = require('react');

module.exports = React.createClass({

  displayName: 'LoadingChoice',

  mixins: [require('../../mixins/helper')],

  render: function () {
    return this.renderWithConfig();
  },

  renderDefault: function () {
    return (
      Loading choices...
    );
  }

});


text:
module Serializer(serialize) where
import Datatypes
import qualified Opcodes as Op

serialize :: [IR] -> [String]
serialize instructions = (map serializeInstruction instructions)

serializeInstruction :: IR -> String
serializeInstruction (TwoIR (R reg) (I immediate)  masked) =
  prefix ++ "ldi $" ++ (show reg) ++ ", " ++ (show immediate)
  where prefix = if masked then "? " else ""

serializeInstruction (TwoIR (R reg) (C address) masked) =
  "ldc $" ++ (show reg) ++ ", " ++ (show address)

serializeInstruction (ThreeIR operator (R rd) (R rs) (R rt) masked) =
  prefix ++ (Op.mnemonic opcode) ++ " $" ++ (show rd) ++ ", $" ++ (show rs) ++ ", $" ++ (show rt)
  where opcode = case operator of
               BitwiseAnd -> Op.And
               BitwiseOr -> Op.Or
               BitwiseXor -> Op.Xor
               Plus -> Op.Add
               Minus -> Op.Sub
               Multiply -> Op.Mul
               LessThan -> Op.Slt
               EqualTo -> Op.Seq
        prefix = if masked then "? " else ""

serializeInstruction (ThreeIR op rd (I rs) (R rt) masked)
 | op == Plus = serializeInstruction (ThreeIR op rd (R rt) (I rs) masked)

serializeInstruction (ThreeIR operator (R rd) (R rs) (I sh) masked) =
  prefix ++ (Op.mnemonic opcode) ++ " $" ++ (show rd) ++ ", $" ++ (show rs) ++ ", " ++ (show sh)
  where opcode = case operator of
               Plus -> Op.Addi
               ShiftLeft -> Op.Sll
               ShiftRight -> Op.Srl
               ShiftRightArithmetic -> Op.Sra
        prefix = if masked then "? " else ""

serializeInstruction LoadIR = "lw"

serializeInstruction StoreIR = "sw"


text:
package kata.java;

import java.util.Arrays;
import java.util.OptionalInt;
import java.util.function.IntPredicate;
import java.util.stream.IntStream;

public class ProbeMap {

    private static final int MIN_CAPACITY = 16;
    private static final int MAX_CAPACITY = Integer.MIN_VALUE >>> 1;

    private static int alignCapacity(int initCapacity) {
        int n = initCapacity - 1;
        n |= n >>> 1;
        n |= n >>> 2;
        n |= n >>> 4;
        n |= n >>> 8;
        n |= n >>> 16;
        return n < MIN_CAPACITY ? MIN_CAPACITY : n >= MAX_CAPACITY ? MAX_CAPACITY : n + 1;
    }

    private final int missedValue;
    private int[] values;
    private int[] keys;
    private int capacity;
    private int size;

    public ProbeMap() {
        this(MIN_CAPACITY);
    }

    public ProbeMap(int initCapacity) {
        this(initCapacity, Integer.MIN_VALUE);
    }

    public ProbeMap(int initCapacity, int missedValue) {
        this.missedValue = missedValue;
        this.capacity = alignCapacity(initCapacity);
        this.values = new int[capacity];
        Arrays.fill(values, missedValue);
        this.keys = new int[capacity];
        Arrays.fill(keys, missedValue);
    }

    public int capacity() {
        return capacity;
    }

    public boolean put(int key, int value) {
        if (isFull() && capacity == MAX_CAPACITY) return false;
        int index = key & capacity - 1;
        if (keys[index] == key) {
            values[index] = value;
        } else {
            index = nextFreeSlot(index);
            keys[index] = key;
            values[index] = value;
            size += 1;
        }
        if (isFull()) resize();
        return true;
    }

    private int nextFreeSlot(int index) {
        while (values[index] != missedValue) {
            index = index + 1 & capacity - 1;
        }
        return index;
    }

    private boolean isFull() {
        return size == capacity - 1;
    }

    private void resize() {
        int newCapacity = capacity << 1;
        int[] newKeys = new int[newCapacity];
        Arrays.fill(newKeys, missedValue);
        int[] newValues = new int[newCapacity];
        Arrays.fill(newValues, missedValue);

        for (int i = 0; i < capacity; i++) {
            if (values[i] != missedValue) {
                int newIndex = keys[i] & newCapacity - 1;
                while (newValues[newIndex] != missedValue) {
                    newIndex = newIndex + 1 & capacity - 1;
                }
                newKeys[newIndex] = keys[i];
                newValues[newIndex] = values[i];
            }
        }

        keys = newKeys;
        values = newValues;
        capacity = newCapacity;
    }

    public OptionalInt get(int key) {
        int index = key & capacity - 1;
        if (values[index] == missedValue) {
            return OptionalInt.empty();
        } else {
            while (keys[index] != key) {
                index = index + 1 & capacity - 1;
            }
            return OptionalInt.of(values[index]);
        }
    }

    public int missedValue() {
        return missedValue;
    }

    public Iterable<Integer> keys() {
        return () -> IntStream.of(keys).filter(key -> key != missedValue).iterator();
    }

    public Iterable<Integer> values() {
        return () -> IntStream.of(values).filter(value -> value != missedValue).iterator();
    }
}


text:
package com.xenopsconsulting.gamedayapi

import fetchstrategies.{FetchStrategyProvider, FetchStrategy}
import java.util.Date

trait TestNoBottomInningFetchStrategyProvider extends TestFetchStrategyProvider {

   override def newFetchStrategy(date: Date, team: String, nightcap: Boolean = false): FetchStrategy = {
     new TestNoBottomInningFetchStrategy(date, team, nightcap)
   }

 }


text:
package com.baidubce.services.bos.model;

import com.baidubce.auth.BceCredentials;

/**
 * Provides options for creating an Baidu Bos bucket.
 */
public class CreateBucketRequest extends GenericBucketRequest {

    /**
     * Constructs a new {@link CreateBucketRequest},ready to be executed to create the specified bucket.
     *
     * @param bucketName The name of the Baidu Bos bucket to create.
     */
    public CreateBucketRequest(String bucketName) {
        super(bucketName);
    }

    public CreateBucketRequest withRequestCredentials(BceCredentials credentials) {
        this.setRequestCredentials(credentials);
        return this;
    }

    public CreateBucketRequest withBucketName(String bucketName) {
        this.setBucketName(bucketName);
        return this;
    }
}


text:
package com.cloudera.hoop;

import com.cloudera.lib.wsrs.StringParam;

/**
 * Class for filter parameter.
 */
public class FilterParam extends StringParam {

  /**
   * Parameter name.
   */
  public static final String NAME = "filter";

  /**
   * Default parameter value.
   */
  public static final String DEFAULT = "";

  /**
   * Constructor.
   *
   * @param expr parameter value.
   */
  public FilterParam(String expr) {
    super(NAME, expr);
  }

}


text:
package com.ericgrandt.domain;

import com.google.common.base.Objects;
import java.math.BigDecimal;
import java.util.UUID;

public class Balance {
    private final UUID userId;
    private final int currencyId;
    private BigDecimal balance;

    public Balance(UUID userId, int currencyId, BigDecimal balance) {
        this.userId = userId;
        this.currencyId = currencyId;
        this.balance = balance;
    }

    public UUID getUserId() {
        return userId;
    }

    public int getCurrencyId() {
        return currencyId;
    }

    public BigDecimal getBalance() {
        return balance;
    }

    public void setBalance(BigDecimal balance) {
        this.balance = balance;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }

        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        Balance other = (Balance) o;
        return currencyId == other.currencyId
            && Objects.equal(userId, other.userId)
            && Objects.equal(balance, other.balance);
    }

    @Override
    public int hashCode() {
        return Objects.hashCode(userId, currencyId, balance);
    }
}