text:
from database.lol import (
    Champion,
    Item,
    OPGGKRARAM,
    Rune,
    Spell,
    Version
)
from model.lol import (
    Game,
    League,
    Mastery,
    Participants,
    Summoner
)
from rapidfuzz import process
from utilities.format import alphabet, format_list
from utilities.request import fetch

BASE = 'https://na1.api.riotgames.com/lol'
ASSET = 'https://ddragon.leagueoflegends.com'

async def get_champion_masteries(session, params, summoner_id: int):
    url = f"{BASE}/champion-mastery/v4/champion-masteries/by-summoner/{summoner_id}"
    return await fetch(session, url, params=params)

async def get_summoner_account(session, params, summoner_name: str):
    url = f"{BASE}/summoner/v4/summoners/by-name/{summoner_name}"
    return await fetch(session, url, params=params)

async def get_summoner_leagues(session, params, summoner_id: int):
    url = f"{BASE}/league/v4/entries/by-summoner/{summoner_id}"
    return await fetch(session, url, params=params)

async def get_active_game(session, params, summoner_name: str):
    summoner = await get_summoner_account(session, params, summoner_name)
    summoner_id = summoner.get('id')

    url = f"{BASE}/spectator/v4/active-games/by-summoner/{summoner_id}"
    return await fetch(session, url, params=params)

async def get_champion_version():
    return (
        await Version
        .select('champion')
        .where(Version.id == 1)
        .gino
        .scalar()
    )

async def get_item_version():
    return (
        await Version
        .select('item')
        .where(Version.id == 1)
        .gino
        .scalar()
    )

async def get_spell_version():
    return (
        await Version
        .select('summoner')
        .where(Version.id == 1)
        .gino
        .scalar()
    )

async def get_champion(champion_name: str):
    champion_name = alphabet(champion_name)
    champion_name = await search_for_champion(champion_name)

    return (
        await Champion
        .select('name')
        .where(
            Champion.name == champion_name
        )
        .gino
        .scalar()
    )

async def get_champion_name(champion_id: str):
    return (
        await Champion
        .select('name')
        .where(
            Champion.id == str(champion_id)
        )
        .gino
        .scalar()
    )

async def get_champion_id(champion_name: str):
    champion_name = await search_for_champion(champion_name)

    return (
        await Champion
        .select('id')
        .where(Champion.name == champion_name)
        .gino
        .scalar()
    )

async def get_champion_image(champion_name: str):
    champion_name = await search_for_champion(champion_name)

    return (
        await Champion
        .select('full_image')
        .where(Champion.name == champion_name)
        .gino
        .scalar()
    )

async def get_champion_runes(champion_name: str):
    champion_id = await get_champion_id(champion_name)

    return (
        await OPGGKRARAM
        .select('runes')
        .where(OPGGKRARAM.champion_id == champion_id)
        .gino
        .scalar()
    )

async def get_champion_items(champion_name: str):
    champion_id = await get_champion_id(champion_name)

    return (
        await OPGGKRARAM
        .select('items')
        .where(OPGGKRARAM.champion_id == champion_id)
        .gino
        .scalar()
    )

async def get_champion_skill_order(champion_name: str):
    champion_id = await get_champion_id(champion_name)

    return (
        await OPGGKRARAM
        .select('skills')
        .where(OPGGKRARAM.champion_id == champion_id)
        .gino
        .scalar()
    )

async def get_rune_name(rune_id: str):
    return (
        await Rune
        .select('name')
        .where(Rune.id == rune_id)
        .gino
        .scalar()
    )

async def get_item_name(item_id: str):
    return (
        await Item
        .select('name')
        .where(Item.id == item_id)
        .gino
        .scalar()
    )

async def get_core_item_name(item_id: str):
    return (
        await Item
        .select('name')
        .where(
            (Item.id == item_id) &
            (Item.ingredients.isnot(None))
        )
        .gino
        .scalar()
    )

async def get_champion_names():
    champions = await Champion.select('name').gino.all()
    return [champion.name for champion in champions]

async def get_spell_names():
    spells = await Spell.select('name').gino.all()
    return [spell.name for spell in spells]

async def get_champion_statistics(champion_name: str):
    return (
        await Champion
        .query
        .where(Champion.name == champion_name)
        .gino
        .first()
    )

async def get_spell_statistics(spell_name: str):
    return (
        await Spell
        .query
        .where(Spell.name == spell_name)
        .gino
        .first()
    )

async def search_for_champion(champion_name: str):
    champion_names = await get_champion_names()

    match, score, _ = process.extractOne(
        champion_name,
        champion_names
    )

    return match

async def search_for_spell(spell_name: str):
    spell_names = await get_spell_names()

    match, score, _ = process.extractOne(
        spell_name,
        spell_names
    )

    return match

async def get_placement(leagues):
    placement = ''

    display = {
        'RANKED_SOLO_5x5': 1,
        'RANKED_FLEX_SR': 2,
        'RANKED_FLEX_TT': 3,
        'RANKED_TFT': 4,
        'RANKED_TFT_DOUBLE_UP': 5,
    }

    leagues.sort(
        key=lambda orderly: display[
            orderly['queueType']
        ]
    )

    for league in leagues:
        queue = League(league)
        placement = placement + f"{queue.queues}: {queue} \n"

    if not placement:
        placement = placement + 'Unranked'

    return placement

async def get_mastery(session, params, summoner_id):
    get_masteries = await get_champion_masteries(
        session,
        params,
        summoner_id
    )

    champions = []

    for masteries in get_masteries[:10]:
        mastery = Mastery(masteries)
        name = await get_champion_name(mastery.id)
        champions.append(
            f"{name}: {mastery}"
        )

    return format_list(champions, sort=False)


text:
ACCEPTED

#### According to
Index Fungorum

#### Published in
Revue roum. Biol. , Sér. Biol. Végét. 34(2): 94 (1989)

#### Original name
Aureobasidium vaccinii Richit. & Teodoru

### Remarks
null

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace InstagramAPI;

class AutoResponseFunctionSetter
{
    public function __call($function, $args)
    {
        $underScoreNames = $this->camelCaseToUnderScore($function);
        if (strpos($underScoreNames, '_') === false) {
            return false;
        }
        list($functionType, $propName) = explode('_', $underScoreNames, 2);

        switch ($functionType) {
            case 'get':
                if (!property_exists($this, $propName)) {
                    throw new \Exception("Wrong function $function");
                }

                return $this->$propName;
                break;
            case 'set':
                if (!property_exists($this, $propName)) {
                    throw new \Exception("Wrong function $function");
                }
                $this->$propName = $args[0];
                break;
            case 'is':
                if (!property_exists($this, $underScoreNames)) {
                    throw new \Exception("Wrong function $function");
                }

                return $this->$underScoreNames;
                break;
        }
    }

    public function camelCaseToUnderScore($input)
    {
        preg_match_all('!([A-Z][A-Z0-9]*(?=$|[A-Z][a-z0-9])|[A-Za-z][a-z0-9]+)!', $input, $matches);
        $ret = $matches[0];
        foreach ($ret as &$match) {
            $match = $match == strtoupper($match) ? strtolower($match) : lcfirst($match);
        }

        return implode('_', $ret);
    }
}


text:
using namespace tainicom::Aether::Native::Animation::Data;

namespace tainicom
{
	namespace Aether
	{
		namespace Native
		{
			namespace Animation
			{
				public value struct VertexPositionNormalTextureData
				{
				public:
					Vector3Data Position;
					Vector3Data Normal;
					Vector2Data TextureCoordinate;
				};
			}
		}
	}
}


text:
using ColossalFramework.Math;
using Harmony;
using PropUnlimiter.Manager;
using PropUnlimiter.Utils;
using System;
using System.Collections.Generic;
using UnityEngine;

namespace PropUnlimiter.Patches
{
    [HarmonyPatch(typeof(PropManager))]
    [HarmonyPatch("CreateProp")]
    class PropCreatePatch
    {
        public static bool Prefix(ref PropInfo info, ref Vector3 position, ref float angle, ref bool single)
        {
            if (!(Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift)))
            {
                return true;
            }
            else
            {
#if DEBUG
                string str = String.Format("Invoking prop at:{0}, angle:{1}, info:{2}", position, angle, info.GetLocalizedTitle());
                LoggerUtils.Log(str);
#endif
                PropUnlimiterManager.instance.SetUnlimitedProp(info.m_prefabDataIndex, position, angle, single);
                PropTool.DispatchPlacementEffect(position, true);
                PropManager.instance.UpdateProp(0);
                PropManager.instance.UpdatePropRenderer(0, true);
                return false;
            }
        }
    }

    [HarmonyPatch(typeof(PropManager))]
    [HarmonyPatch("EndRenderingImpl")]
    class PropRenderingPatch
    {
        /// <summary>
        /// Intended for internal accurate rendering only.
        /// </summary>
        /// <param name="cameraInfo"></param>
        /// <param name="container"></param>
        private static void RenderProp(RenderManager.CameraInfo cameraInfo, PropContainer container)
        {
            if ( (container.propInstance.m_flags & 68) != 0)
            {
                return;
            }
            PropInfo info = container.propInstance.Info;
            Vector3 inaccuratePosition = container.propInstance.Position;
            Vector3 position = new Vector3(container.extras["accx"], inaccuratePosition.y, container.extras["accz"]);
            if (!cameraInfo.CheckRenderDistance(position, info.m_maxRenderDistance) || !cameraInfo.Intersect(position, info.m_generatedInfo.m_size.y * info.m_maxScale))
            {
                return;
            }
            float angle = container.propInstance.Angle;
            Randomizer r = new Randomizer(0);
            float scale = info.m_minScale + (float)((double)r.Int32(10000U) * ((double)info.m_maxScale - (double)info.m_minScale) * 9.99999974737875E-05);
            Color color = info.GetColor(ref r);
            Vector4 objectIndex = new Vector4(1f / 512f, 1f / 384f, 0.0f, 0.0f);
            InstanceID id = new InstanceID();
            if (info.m_requireHeightMap)
            {
                Texture _HeightMap;
                Vector4 _HeightMapping;
                Vector4 _SurfaceMapping;
                TerrainManager.instance.GetHeightMapping(position, out _HeightMap, out _HeightMapping, out _SurfaceMapping);
                PropInstance.RenderInstance(cameraInfo, info, id, position, scale, angle, color, objectIndex, true, _HeightMap, _HeightMapping, _SurfaceMapping);
            }
            else
            {
                PropInstance.RenderInstance(cameraInfo, info, id, position, scale, angle, color, objectIndex, true);
            }
        }

        public static void Postfix(ref RenderManager.CameraInfo cameraInfo)
        {
            ItemClass.Availability availability = ToolManager.instance.m_properties.m_mode;
            FastList<RenderGroup> fastList = RenderManager.instance.m_renderedGroups;
            int num1 = 1 << LayerMask.NameToLayer("Props") | 1 << RenderManager.instance.lightSystem.m_lightLayer;
            for (int index1 = 0; index1 < fastList.m_size; ++index1)
            {
                RenderGroup renderGroup = fastList.m_buffer[index1];
                if ((renderGroup.m_instanceMask & num1) != 0)
                {
                    int minX = renderGroup.m_x * 270 / 45;
                    int minZ = renderGroup.m_z * 270 / 45;
                    int maxX = (renderGroup.m_x + 1) * 270 / 45 - 1;
                    int maxZ = (renderGroup.m_z + 1) * 270 / 45 - 1;
                    for (int index2 = minZ; index2 <= maxZ; ++index2)
                    {
                        for (int index3 = minX; index3 <= maxX; ++index3)
                        {
                            int gridKey = index2 * 270 + index3;
                            List<PropContainer> list = PropUnlimiterManager.instance.GetPropsInGrid(gridKey);

                            if (list != null)
                            {
                                foreach (PropContainer instance in list)
                                {
                                    if ( instance.extras.ContainsKey("accx") && instance.extras.ContainsKey("accy") && instance.extras.ContainsKey("accz"))
                                    {
                                        RenderProp(cameraInfo, instance);
                                    }
                                    else
                                    {
                                        instance.propInstance.RenderInstance(cameraInfo, 0, renderGroup.m_instanceMask);
                                    }
                                }
                            }

                        }
                    }
                }
            }

            for (int index = 0; index < PrefabCollection<PropInfo>.PrefabCount(); ++index)
            {
                PropInfo prefab = PrefabCollection<PropInfo>.GetPrefab((uint)index);
                if (prefab != null && prefab.m_lodCount != 0)
                {
                    PropInstance.RenderLod(cameraInfo, prefab);
                }
            }
        }
    }

    [HarmonyPatch(typeof(PropManager))]
    [HarmonyPatch("AfterTerrainUpdate")]
    class PropTerrainUpdatedPatch
    {
        public static void Postfix(TerrainArea heightArea, TerrainArea surfaceArea, TerrainArea zoneArea)
        {

            float minX = heightArea.m_min.x;
            float minZ = heightArea.m_min.z;
            float maxX = heightArea.m_max.x;
            float maxZ = heightArea.m_max.z;

            int minGridX = Mathf.Max((int)(((double)minX - 8.0) / 64.0 + 135.0), 0);
            int minGridZ = Mathf.Max((int)(((double)minZ - 8.0) / 64.0 + 135.0), 0);
            int maxGridX = Mathf.Min((int)(((double)maxX + 8.0) / 64.0 + 135.0), 269);
            int maxGridZ = Mathf.Min((int)(((double)maxZ + 8.0) / 64.0 + 135.0), 269);

            for (int index1 = minGridZ; index1 <= maxGridZ; ++index1)
            {
                for (int index2 = minGridX; index2 <= maxGridX; ++index2)
                {
                    int gridKey = index1 * 270 + index2;
                    List<PropContainer> list = PropUnlimiterManager.instance.GetPropsInGrid(gridKey);

                    if (list != null)
                    {
                        for(int i =0; i<list.Count; i++)
                        {
                            PropInstance instance = list[i].propInstance;
                            instance.TerrainUpdated(0, minX, minZ, maxX, maxZ);
                            Vector3 position = instance.Position;
                            position.y = TerrainManager.instance.SampleDetailHeight(position);
                            ushort num = (ushort)Mathf.Clamp(Mathf.RoundToInt(position.y * 64f), 0, (int)ushort.MaxValue);
                            instance.m_posY = num;
                            list[i].propInstance = instance;
                            PropManager.instance.UpdateProp(0);
                            PropManager.instance.UpdatePropRenderer(0, true);
                        }

                    }

                }
            }

        }
    }
}


text:
package mujina.api;

public enum AuthenticationMethod {
  ALL, USER
}


text:
package deepboof.forward;

import deepboof.Tensor;
import deepboof.VTensor;

/**
 *
Interface for all virtual 2D spatial padding implementation.  Virtual padding contains a reference
 * to the original input tensor which is going to be padded and on the fly will generate the values for
 * elements which are not explicitly contained in the input tensor.  This can reduce memory consumption and is
 * more simplistic to implement for more complex padding methods.

 *
 * Clipped padding is a special case.  In this situation only pixels contained inside the original image should
 * be processed.
 *
 * @author Peter Abeles
 */
public interface SpatialPadding2D<T extends Tensor<T>> extends VTensor {
	/**
	 * Spatial tensor that padding is being added around
	 * @param input The input tensor
	 */
	void setInput(T input);

	/**
	 * Returns how far away the row is from the clipping border.  0 if it is inside the image. Positive is below
	 * the lower extent and negative if above upper extent.
	 *
	 * @param paddedRow Row in padded coordinates
	 * @return offset
	 */
	int getClippingOffsetRow( int paddedRow );

	/**
	 * Returns how far away the column is from the clipping border.  0 if it is inside the image. Positive is below
	 * the lower extent and negative if above upper extent.
	 *
	 * @param paddedCol Column in padded coordinates
	 * @return offset
	 */
	int getClippingOffsetCol( int paddedCol );

	/**
	 * Returns the lower-extent padding along the tensor's rows.
	 * @return padding
	 */
	int getPaddingRow0();

	/**
	 * Returns the lower-extent padding along the tensor's columns.
	 * @return padding
	 */
	int getPaddingCol0();

		/**
	 * Returns the upper-extent padding along the tensor's rows.
	 * @return padding
	 */
	int getPaddingRow1();

	/**
	 * Returns the upper-extent padding along the tensor's columns.
	 * @return padding
	 */
	int getPaddingCol1();

	/**
	 * Returns what the tensor's shape will be when given can input tensor with
	 * the spcified shape.
	 * @param inputShape Input spatial tensor.  3-DOF with no mini-batch or 4-DOF with mini-batch
	 * @return Tensor's shape
	 */
	int[] shapeGivenInput( int ...inputShape );

	/**
	 * Returns true if this is a clipped border or false of it is not.
	 * @return if clipped or not
	 */
	boolean isClipped();

	/**
	 * Returns the type of input tensor it can process
	 *
	 * @return Type of tensor
	 */
	Class<T> getTensorType();
}


text:
#import <Foundation/Foundation.h>

@interface StoryboardPerform : NSObject

+ (UIStoryboard *)noticeStoryboard;

@end


text:
package org.schoellerfamily.gedbrowser.api.transformers;

import org.schoellerfamily.gedbrowser.persistence.domain.AttributeDocument;
import org.schoellerfamily.gedbrowser.persistence.domain.GedDocument;
import org.schoellerfamily.gedbrowser.persistence.domain.SourceDocument;

/**
 * @author Dick Schoeller
 */
public interface SourceTitleBuilder {
    /**
     * @param document the document whose title we want
     * @return the title
     */
    default String title(final SourceDocument document) {
        for (final GedDocument<?> g : document.getAttributes()) {
            if ("Title".equals(g.getString())) {
                final AttributeDocument a = (AttributeDocument) g;
                return a.getTail();
            }
        }
        return "Unknown";
    }

}


text:
export class AuthenticateUserRequest {
    constructor(public user?: string) {

    }
}


text:
package org.jasig.cas.support.openid.authentication.principal;

import org.jasig.cas.authentication.principal.AbstractServiceFactory;
import org.jasig.cas.support.openid.OpenIdProtocolConstants;
import org.openid4java.message.ParameterList;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;

import javax.servlet.http.HttpServletRequest;
import javax.validation.constraints.NotNull;

/**
 * The {@link OpenIdServiceFactory} creates {@link OpenIdService} objects.
 *
 * @author Misagh Moayyed
 * @since 4.2
 */
@Component("openIdServiceFactory")
public class OpenIdServiceFactory extends AbstractServiceFactory<OpenIdService> {

    /**
     * The prefix url for OpenID (without the trailing slash).
     */
    @NotNull
    @Value("${server.prefix}/openid")
    private String openIdPrefixUrl;

    public String getOpenIdPrefixUrl() {
        return openIdPrefixUrl;
    }

    public void setOpenIdPrefixUrl(final String openIdPrefixUrl) {
        this.openIdPrefixUrl = openIdPrefixUrl;
    }

    @Override
    public OpenIdService createService(final HttpServletRequest request) {
        final String service = request.getParameter(OpenIdProtocolConstants.OPENID_RETURNTO);
        final String openIdIdentity = request.getParameter(OpenIdProtocolConstants.OPENID_IDENTITY);
        final String signature = request.getParameter(OpenIdProtocolConstants.OPENID_SIG);

        if (openIdIdentity == null || !StringUtils.hasText(service)) {
            return null;
        }

        final String id = cleanupUrl(service);
        final String artifactId = request.getParameter(OpenIdProtocolConstants.OPENID_ASSOCHANDLE);
        final ParameterList paramList = new ParameterList(request.getParameterMap());

        return new OpenIdService(id, service, artifactId, openIdIdentity,
                signature, paramList, this.openIdPrefixUrl);
    }

    @Override
    public OpenIdService createService(final String id) {
        return new OpenIdService(id, id, null, null, null, null, this.openIdPrefixUrl);
    }
}


text:
import castPath from './_castPath';
import isIndex from './_isIndex';
import isKey from './_isKey';
import last from './last';
import parent from './_parent';
import toKey from './_toKey';

/** Used for built-in method references. */
var arrayProto = Array.prototype;

/** Built-in value references. */
var splice = arrayProto.splice;

/**
 * The base implementation of `_.pullAt` without support for individual
 * indexes or capturing the removed elements.
 *
 * @private
 * @param {Array} array The array to modify.
 * @param {number[]} indexes The indexes of elements to remove.
 * @returns {Array} Returns `array`.
 */
function basePullAt(array, indexes) {
  var length = array ? indexes.length : 0,
      lastIndex = length - 1;

  while (length--) {
    var index = indexes[length];
    if (length == lastIndex || index !== previous) {
      var previous = index;
      if (isIndex(index)) {
        splice.call(array, index, 1);
      }
      else if (!isKey(index, array)) {
        var path = castPath(index),
            object = parent(array, path);

        if (object != null) {
          delete object[toKey(last(path))];
        }
      }
      else {
        delete array[toKey(index)];
      }
    }
  }
  return array;
}

export default basePullAt;


text:
<subjectRole>

The <subjectRole> element, when used within a
            <subjectRel> element, contains a set of subjects that are related to
         other subjects in the same row of the current <subjectRelTable>. By
         default, no relationship is defined between multiple subjects in the same
            <subjectRole> element. When used within the
            <subjectRelHeader>, the <subjectRole> element
         defines the category of subject or relationship provided by that column.

Category: Subject scheme elements


text:
<?php

namespace App\Http\Controllers\User;

use App\Http\Controllers\MainController;
use App\Models\User;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;

class UserSaveController extends MainController
{
    /**
     * @param  Request  $request
     */
    public function save(Request $request)
    {
        $validator = Validator::make($request->all(), [
            'first_name' => 'required|max:50',
            'email' => 'required|email|max:254',
            'lang' => 'required',
            //'password_confirmation' => 'confirmed:password'
        ]);

        if ($validator->fails()) {
            return redirect('/user')
                ->withErrors($validator)
                ->withInput();
        }

        if (empty($request->id)) {
            $user = new User();
            $user->created_at = now();
            //Company should be assigned on create
            $user->company_id = Auth::user()->company_id;
        } else {
            $user = User::find($request->id);
        }
        $user->first_name = $request->first_name;
        $user->last_name = $request->last_name;
        $user->email = $request->email;
        $user->phone = $request->phone;
        $user->lang = $request->lang;

        if (! empty($request->password) && ! empty($request->password_confirmation) && ($request->password == $request->password_confirmation)) {
            $user->password = Hash::make($request->password);
        }

        if (! empty($request->roles)) {
            $user->syncRoles($request->roles);
        }

        $user->updated_at = now();
        $user->save();

        return redirect('/user');
    }
}


text:
Workspace created for work and develop Udacity Robotic Nanodegree course

### Rover Search and Sample Return project

`./src/rover/project/`


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Interface.Responses
{
    public class Response
    {
        public ResponseType Type { get; set; }
        public string Message { get; set; }
    }
}


text:
// Copyright (c) DotSpatial Team. All rights reserved.
// Licensed under the MIT license. See License.txt file in the project root for full license information.

using System.Collections.Generic;
using System.IO;
using System.Linq;
using DotSpatial.Controls;
using DotSpatial.Projections;

namespace DotSpatial.Data.Rasters.GdalExtension
{
    /// <summary>
    /// A dataset that contains data for more more than one layer.
    /// </summary>
    public class MultiLayerDataSet : DataSet, ISelfLoadSet
    {
        #region Fields

        private string _fileName;

        /// <summary>
        /// The name that should be shown as the LegendText of the MapSelfLoadGroup returned by GetLayer.
        /// </summary>
        private string _groupName;

        /// <summary>
        /// This contains the featuresets and their corresponding style lists that are contained in this MultiLayerDataSet.
        /// </summary>
        private IDictionary<IFeatureSet, IList<string>> _dataSets;

        #endregion

        #region Constructors

        /// <summary>
        /// Initializes a new instance of the <see cref="MultiLayerDataSet"/> class.
        /// </summary>
        public MultiLayerDataSet()
        {
            _dataSets = new Dictionary<IFeatureSet, IList<string>>();
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="MultiLayerDataSet"/> class that is loaded from the supplied fileName.
        /// </summary>
        /// <param name="fileName">The string fileName of the MultiLayerDataSet to load.</param>
        public MultiLayerDataSet(string fileName)
            : this()
        {
            Open(fileName);
        }

        #endregion

        #region Methods

        /// <inheritdoc />
        public new void Dispose()
        {
            foreach (var dataset in _dataSets)
            {
                dataset.Key.Dispose();
            }

            _dataSets.Clear();
            base.Dispose();
        }

        /// <summary>
        /// Gets the IMapSelfLoadLayer that contains all the DataSets as Layers and can be added to the map.
        /// </summary>
        /// <returns>Null, if there are no DataSets, a MapSelfLoadLayer if there is only 1 DataSet otherwise a MapSelfLoadGroup with layers for the existing DataSets.</returns>
        public IMapSelfLoadLayer GetLayer()
        {
            return GetLayer(null);
        }

        /// <summary>
        /// Gets the IMapSelfLoadLayer that contains all the DataSets as Layers and can be added to the map.
        /// </summary>
        /// <param name="layerNames">The names of the layers that should be loaded. If this is null all layers get loaded.</param>
        /// <returns>Null, if there are no DataSets, a MapSelfLoadLayer if there is only 1 DataSet otherwise a MapSelfLoadGroup with layers for the existing DataSets.</returns>
        public IMapSelfLoadLayer GetLayer(string[] layerNames)
        {
            if (_dataSets.Count < 1) return null;

            if (_dataSets.Count > 1)
            {
                // return a group with all the layers
                var gr = new MapSelfLoadGroup
                {
                    LegendText = _groupName,
                    DataSet = this,
                    FilePath = _fileName
                };

                foreach (var ds in _dataSets)
                {
                    if (layerNames == null || layerNames.Contains(ds.Key.Name))
                    {
                        IMapFeatureLayer l = gr.Layers.Add(ds.Key);
                        OgrDataReader.TranslateStyles(l, ds.Value);
                        l.IsExpanded = false;
                    }
                }

                return gr;
            }

            // return the single existing layer
            var fs = _dataSets.Keys.FirstOrDefault();
            if (fs == null || (layerNames != null && !layerNames.Contains(fs.Name))) return null;

            IMapSelfLoadLayer layer;

            switch (fs.FeatureType)
            {
                case FeatureType.MultiPoint:
                case FeatureType.Point:
                    layer = new MapSelfLoadPointLayer(fs);
                    break;
                case FeatureType.Line:
                    layer = new MapSelfLoadLineLayer(fs);
                    break;
                case FeatureType.Polygon:
                    layer = new MapSelfLoadPolygonLayer(fs);
                    break;
                default:
                    return null;
            }

            layer.LegendText = _groupName;
            OgrDataReader.TranslateStyles((IMapFeatureLayer)layer, _dataSets[fs]);
            layer.IsExpanded = false;
            return layer;
        }

        /// <summary>
        /// Opens the given file.
        /// </summary>
        /// <param name="fileName">Name of the file that should be opened.</param>
        public void Open(string fileName)
        {
            Dispose();

            _fileName = fileName;
            _groupName = Path.GetFileNameWithoutExtension(fileName);

            using var reader = new OgrDataReader(fileName);
            _dataSets = reader.GetLayers();
        }

        /// <inheritdoc />
        public new void Reproject(ProjectionInfo targetProjection)
        {
            foreach (var ds in _dataSets)
            {
                ds.Key.Reproject(targetProjection);
            }
        }

        #endregion
    }
}


text:
package org.apache.nifi.web.api.dto;

import io.swagger.annotations.ApiModelProperty;

import javax.xml.bind.annotation.XmlType;
import java.util.List;
import java.util.Set;

/**
 * A connection between two connectable components.
 */
@XmlType(name = "connection")
public class ConnectionDTO extends ComponentDTO {

    private ConnectableDTO source;
    private ConnectableDTO destination;
    private String name;
    private Integer labelIndex;
    private Long zIndex;
    private Set<String> selectedRelationships;
    private Set<String> availableRelationships;

    private Long backPressureObjectThreshold;
    private String backPressureDataSizeThreshold;
    private String flowFileExpiration;
    private List<String> prioritizers;
    private List<PositionDTO> bends;

    /**
     * The source of this connection.
     *
     * @return The source of this connection
     */
    @ApiModelProperty(
            value = "The source of the connection."
    )
    public ConnectableDTO getSource() {
        return source;
    }

    public void setSource(ConnectableDTO source) {
        this.source = source;
    }

    /**
     * The destination of this connection.
     *
     * @return The destination of this connection
     */
    @ApiModelProperty(
            value = "The destination of the connection."
    )
    public ConnectableDTO getDestination() {
        return destination;
    }

    public void setDestination(ConnectableDTO destination) {
        this.destination = destination;
    }

    /**
     * @return name of the connection
     */
    @ApiModelProperty(
            value = "The name of the connection."
    )
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    /**
     * @return position of the bend points on this connection
     */
    @ApiModelProperty(
            value = "The bend points on the connection."
    )
    public List<PositionDTO> getBends() {
        return bends;
    }

    public void setBends(List<PositionDTO> bends) {
        this.bends = bends;
    }

    /**
     * @return The index of control point that the connection label should be placed over
     */
    @ApiModelProperty(
            value = "The index of the bend point where to place the connection label."
    )
    public Integer getLabelIndex() {
        return labelIndex;
    }

    public void setLabelIndex(Integer labelIndex) {
        this.labelIndex = labelIndex;
    }

    /**
     * @return z index for this connection
     */
    @ApiModelProperty(
            value = "The z index of the connection."
    )
    public Long getzIndex() {
        return zIndex;
    }

    public void setzIndex(Long zIndex) {
        this.zIndex = zIndex;
    }

    /**
     * The relationships that make up this connection.
     *
     * @return The relationships
     */
    @ApiModelProperty(
            value = "The selected relationship that comprise the connection."
    )
    public Set<String> getSelectedRelationships() {
        return selectedRelationships;
    }

    public void setSelectedRelationships(Set<String> relationships) {
        this.selectedRelationships = relationships;
    }

    /**
     * @return relationships that the source of the connection currently supports. This property is read only
     */
    @ApiModelProperty(
            value = "The relationships that the source of the connection currently supports.",
            readOnly = true
    )
    public Set<String> getAvailableRelationships() {
        return availableRelationships;
    }

    public void setAvailableRelationships(Set<String> availableRelationships) {
        this.availableRelationships = availableRelationships;
    }

    /**
     * The object count threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are
     * affected but it does help feeder processors to stop pushing too much into this work queue.
     *
     * @return The back pressure object threshold
     */
    @ApiModelProperty(
            value = "The object count threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files "
                    + "over the limit are affected but it does help feeder processors to stop pushing too much into this work queue."
    )
    public Long getBackPressureObjectThreshold() {
        return backPressureObjectThreshold;
    }

    public void setBackPressureObjectThreshold(Long backPressureObjectThreshold) {
        this.backPressureObjectThreshold = backPressureObjectThreshold;
    }

    /**
     * The object data size threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing files over the limit are
     * affected but it does help feeder processors to stop pushing too much into this work queue.
     *
     * @return The back pressure data size threshold
     */
    @ApiModelProperty(
            value = "The object data size threshold for determining when back pressure is applied. Updating this value is a passive change in the sense that it won't impact whether existing "
                    + "files over the limit are affected but it does help feeder processors to stop pushing too much into this work queue."
    )
    public String getBackPressureDataSizeThreshold() {
        return backPressureDataSizeThreshold;
    }

    public void setBackPressureDataSizeThreshold(String backPressureDataSizeThreshold) {
        this.backPressureDataSizeThreshold = backPressureDataSizeThreshold;
    }

    /**
     * The amount of time a flow file may be in the flow before it will be automatically aged out of the flow. Once a flow file reaches this age it will be terminated from the flow the next time a
     * processor attempts to start work on it.
     *
     * @return The flow file expiration in minutes
     */
    @ApiModelProperty(
            value = "The amount of time a flow file may be in the flow before it will be automatically aged out of the flow. Once a flow file reaches this age it will be terminated from "
                    + "the flow the next time a processor attempts to start work on it."
    )
    public String getFlowFileExpiration() {
        return flowFileExpiration;
    }

    public void setFlowFileExpiration(String flowFileExpiration) {
        this.flowFileExpiration = flowFileExpiration;
    }

    /**
     * The prioritizers this connection is using.
     *
     * @return The prioritizer list
     */
    @ApiModelProperty(
            value = "The comparators used to prioritize the queue."
    )
    public List<String> getPrioritizers() {
        return prioritizers;
    }

    public void setPrioritizers(List<String> prioritizers) {
        this.prioritizers = prioritizers;
    }

    @Override
    public String toString() {
        return "ConnectionDTO [id: " + getId() + "]";
    }
}


text:
namespace Efrpg.Generators
{
    public class ResultSetResultReaderCommand
    {
        public int Index { get; }
        public string ReaderCommand { get; }
        public bool NotLastRecord { get; }
        public string WriteStoredProcReturnModelName { get; }

        public ResultSetResultReaderCommand(int index, string readerCommand, bool notLastRecord, string writeStoredProcReturnModelName)
        {
            Index                          = index;
            ReaderCommand                  = readerCommand;
            NotLastRecord                  = notLastRecord;
            WriteStoredProcReturnModelName = writeStoredProcReturnModelName;
        }
    }
}


text:
namespace boost {
    namespace detail {
        template<bool IsPointer,bool IsArray,bool IsConst,bool IsVolatile>
        struct remove_const_impl_typeof {
            template<typename T,typename ID>
            struct inner {
                typedef T type;
            };
            template<typename T>
            struct transform_type {
                typedef T type;
            };
        };
        template<> //Const
        struct remove_const_impl_typeof<false,false,true,false> {
            template<typename T,typename ID>
            struct inner {
                template<typename U>
                static msvc_register_type<U,ID> test(U const&(*)());
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T& type;
            };
        };
        template<> //CV
        struct remove_const_impl_typeof<false,false,true,true> {
            template<typename T,typename ID>
            struct inner {
                template<typename U>
                static msvc_register_type<U volatile,ID> test(U const volatile&(*)());
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (T(*)())(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T& type;
            };
        };
        template<> //Const Pointer
        struct remove_const_impl_typeof<true,false,true,false> {
            template<typename T,typename ID>
            struct inner {
                template<typename U>
                static msvc_register_type<U,ID> test(void(*)(U const[]));
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T type[];
            };
        };
        template<> //CV Pointer
        struct remove_const_impl_typeof<true,false,true,true> {
            template<typename T,typename ID>
            struct inner {
                template<typename U>
                static msvc_register_type<U volatile,ID> test(void(*)(U const volatile[]));
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T type[];
            };
        };
        template<> //Const Array
        struct remove_const_impl_typeof<false,true,true,false> {
            template<typename T,typename ID>
            struct inner {
                BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));

                template<typename U>
                static msvc_register_type<U[value],ID> test(void(*)(U const[]));
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T type;
            };
        };

        template<> //CV Array
        struct remove_const_impl_typeof<false,true,true,true> {
            template<typename T,typename ID>
            struct inner {
                BOOST_STATIC_CONSTANT(unsigned,value=(sizeof(T)/sizeof((*((T*)NULL))[0])));

                template<typename U>
                static msvc_register_type<U volatile[value],ID> test(void(*)(U const volatile[]));
                static msvc_register_type<T,ID> test(...);
                BOOST_STATIC_CONSTANT(unsigned,register_test=sizeof(test( (void(*)(T))(NULL) ) ));
                typedef typename msvc_extract_type<ID>::id2type::type type;
            };
            template<typename T>
            struct transform_type {
                typedef T type;
            };
        };

    } //namespace detail

    template<typename T>
    struct remove_const {
        typedef detail::remove_const_impl_typeof<
            boost::is_pointer<T>::value,
            boost::is_array<T>::value,
            boost::is_const<T>::value,
            boost::is_volatile<T>::value
        > remove_const_type;
        typedef typename
            remove_const_type::template inner<
                typename remove_const_type::template transform_type<T>::type,
                remove_const<T>
            >::type
        type;
        BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_const,T)
    };
}//namespace boost

#endif //BOOST_TYPE_TRAITS_MSVC_REMOVE_CONST_HOLT_2004_0828


text:
ACCEPTED

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

#### Published in
null

#### Original name
Epidendrum baculus Rchb.f.

### Remarks
null


text:
//%2005////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
// Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation, The Open Group.
// Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
// IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
// Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
// EMC Corporation; VERITAS Software Corporation; The Open Group.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
// ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
// "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
// LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
//
//==============================================================================
//
// Author: Chip Vincent (cvincent@us.ibm.com)
//
// Modified By: Yi Zhou, Hewlett-Packard Company(yi_zhou@hp.com)
//              Mike Day, IBM (mdday@us.ibm.com)
//              Adrian Schuur, schuur@de.ibm.com
//
//%/////////////////////////////////////////////////////////////////////////////

#include "JMPIProvider.h"

#include <Pegasus/Common/Tracer.h>
#include <Pegasus/ProviderManager2/JMPI/JMPIProvider.h>
#include <Pegasus/ProviderManager2/JMPI/JMPIProviderModule.h>

PEGASUS_NAMESPACE_BEGIN
PEGASUS_USING_STD;

#ifdef PEGASUS_DEBUG
#define DDD(x) if (JMPIjvm::trace) x;
#else
#define DDD(x)
#endif

#include "Convert.h"

// set current operations to 1 to prevent an unload
// until the provider has had a chance to initialize
JMPIProvider::JMPIProvider(const String & name,
		   JMPIProviderModule *module,
		   ProviderVector *mv)
   : _module(module), _cimom_handle(0), _name(name),
     _no_unload(0), _rm(0)
{
   _current_operations = 1;
   _currentSubscriptions = 0;
   miVector=*mv;
   jProvider=mv->jProvider;
   jProviderClass=mv->jProviderClass;
   noUnload=false;
   cachedClass=NULL;
}

JMPIProvider::JMPIProvider(JMPIProvider *pr)
  : _module(pr->_module), _cimom_handle(0), _name(pr->_name),
    _no_unload(0), _rm(0)
{
   _current_operations = 1;
   _currentSubscriptions = 0;
   miVector=pr->miVector;
   _cimom_handle=new CIMOMHandle();
   noUnload=pr->noUnload;
   cachedClass=NULL;
}

JMPIProvider::~JMPIProvider(void)
{
   delete cachedClass;
}

JMPIProvider::Status JMPIProvider::getStatus(void) const
{
    AutoMutex lock(_statusMutex);
    return(_status);
}

JMPIProviderModule *JMPIProvider::getModule(void) const
{
    return(_module);
}

String JMPIProvider::getName(void) const
{
    return(_name);
}

void JMPIProvider::initialize(CIMOMHandle& cimom)
{
    _status       = INITIALIZING;
    _cimom_handle = &cimom;

    DDD(PEGASUS_STD(cout)<<"--- JMPIProvider::Initialize()"<<PEGASUS_STD(endl));

    JvmVector *jv  = 0;
    JNIEnv    *env = JMPIjvm::attachThread(&jv);

    // public abstract void initialize (org.pegasus.jmpi.CIMOMHandle ch)
    //        throws org.pegasus.jmpi.CIMException
    jmethodID id = env->GetMethodID((jclass)jProviderClass,
                                    "initialize",
                                    "(Lorg/pegasus/jmpi/CIMOMHandle;)V");

    DDD(PEGASUS_STD(cout)
        <<"--- JMPIProvider::Initialize:id = "
        <<PEGASUS_STD(hex)
        <<(int)id
        <<PEGASUS_STD(dec)
        <<PEGASUS_STD(endl));

    JMPIjvm::checkException(env);

    if (id != NULL)
    {
       jstring jName = env->NewStringUTF(_name.getCString());

       JMPIjvm::checkException(env);

       jint    jCimomRef = DEBUG_ConvertCToJava (CIMOMHandle*, jint, &cimom);
       jobject jch       = env->NewObject(jv->CIMOMHandleClassRef,
                                          JMPIjvm::jv.CIMOMHandleNewISt,
                                          jCimomRef,
                                          jName);

       JMPIjvm::checkException(env);

       env->CallVoidMethod((jobject)jProvider,id,jch);

       JMPIjvm::checkException(env);
    }
    env->ExceptionClear();

    JMPIjvm::detachThread();

    _status             = INITIALIZED;
    _current_operations = 0;
}

Boolean JMPIProvider::tryTerminate(void)
{
    return false;
}

void JMPIProvider::_terminate(void)
{
}

void JMPIProvider::terminate(void)
{
}

Boolean JMPIProvider::operator == (const void *key) const
{
   if( (void *)this == key)
      return true;
   return false;
}

Boolean JMPIProvider::operator == (const JMPIProvider &prov) const
{
   if(String::equalNoCase(_name, prov._name))
      return true;
   return false;
}
/*
void JMPIProvider::get_idle_timer(struct timeval *t)
{
   if(t && _cimom_handle)
      _cimom_handle->get_idle_timer(t);
}

void JMPIProvider::update_idle_timer(void)
{
   if(_cimom_handle)
      _cimom_handle->update_idle_timer();
}

Boolean JMPIProvider::pending_operation(void)
{
   if(_cimom_handle)
      return _cimom_handle->pending_operation();
   return false;
}

Boolean JMPIProvider::unload_ok(void)
{
   return false;
}
*/
//   force provider manager to keep in memory
void JMPIProvider::protect(void)
{
  // _no_unload++;
}

// allow provider manager to unload when idle
void JMPIProvider::unprotect(void)
{
  // _no_unload--;
}

Boolean JMPIProvider::testIfZeroAndIncrementSubscriptions ()
{
    AutoMutex lock (_currentSubscriptionsMutex);
    Boolean isZero = (_currentSubscriptions == 0);
    _currentSubscriptions++;

    return isZero;
}

Boolean JMPIProvider::decrementSubscriptionsAndTestIfZero ()
{
    AutoMutex lock (_currentSubscriptionsMutex);
    _currentSubscriptions--;
    Boolean isZero = (_currentSubscriptions == 0);

    return isZero;
}

Boolean JMPIProvider::testSubscriptions ()
{
    AutoMutex lock (_currentSubscriptionsMutex);
    Boolean currentSubscriptions = (_currentSubscriptions > 0);

    return currentSubscriptions;
}

void JMPIProvider::resetSubscriptions ()
{
    AutoMutex lock (_currentSubscriptionsMutex);
    _currentSubscriptions = 0;
}

void JMPIProvider::setProviderInstance (const CIMInstance & instance)
{
    _providerInstance = instance;
}

CIMInstance JMPIProvider::getProviderInstance ()
{
    return _providerInstance;
}

PEGASUS_NAMESPACE_END


text:
from __future__ import unicode_literals

from django.db import migrations

class Migration(migrations.Migration):

    dependencies = [
        ('users', '0013_auto_20170408_1745'),
    ]

    operations = [
        migrations.RenameField(
            model_name='skill',
            old_name='skill',
            new_name='name',
        ),
    ]


text:
'use strict';

/**
 * Module dependencies.
 */
var mongoose = require('mongoose'),
	Schema = mongoose.Schema;

/**
 * Recipe Schema
 */
var RecipeSchema = new Schema({
	name: {
		type: String,
		default: '',
		required: 'Please fill Recipe name',
		trim: true
	},
	created: {
		type: Date,
		default: Date.now
	},
	user: {
		type: Schema.ObjectId,
		ref: 'User'
	},
	coffeeName: {
		type: String,
		default: '',
		required: 'Please include your coffee name',
		trim: true
	},
	milk: {
		type: Boolean,
		default: false
	},
	sugar: {
		type: Number,
		default: 0,
		min: 0,
		max: 10
	},
	honey: {
		type: Boolean,
		default: false
	},
	description: {
		type: String,
		default: '',
		trim: true
	},
	views: {
		type: Number
	},
	upvotes: {
		type: Number
	}
});

mongoose.model('Recipe', RecipeSchema);


text:
<?php

declare (strict_types=1);
namespace Rector\DowngradePhp70\Rector\FuncCall;

use PhpParser\Node;
use PhpParser\Node\Arg;
use PhpParser\Node\Expr\Array_;
use PhpParser\Node\Expr\ArrayItem;
use PhpParser\Node\Expr\FuncCall;
use PhpParser\Node\Name;
use PhpParser\Node\Scalar\String_;
use PhpParser\Node\Stmt\Expression;
use Rector\Core\Rector\AbstractRector;
use Rector\NodeTypeResolver\Node\AttributeKey;
use Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample;
use Symplify\RuleDocGenerator\ValueObject\RuleDefinition;
/**
 * @see \Rector\Tests\DowngradePhp70\Rector\FuncCall\DowngradeSessionStartArrayOptionsRector\DowngradeSessionStartArrayOptionsRectorTest
 */
final class DowngradeSessionStartArrayOptionsRector extends \Rector\Core\Rector\AbstractRector
{
    /**
     * @return array<class-string<Node>>
     */
    public function getNodeTypes() : array
    {
        return [\PhpParser\Node\Expr\FuncCall::class];
    }
    public function getRuleDefinition() : \Symplify\RuleDocGenerator\ValueObject\RuleDefinition
    {
        return new \Symplify\RuleDocGenerator\ValueObject\RuleDefinition('Move array option of session_start($options) to before statement\'s ini_set()', [new \Symplify\RuleDocGenerator\ValueObject\CodeSample\CodeSample(<<<'CODE_SAMPLE'
session_start([
    'cache_limiter' => 'private',
]);
CODE_SAMPLE
, <<<'CODE_SAMPLE'
ini_set('session.cache_limiter', 'private');
session_start();
CODE_SAMPLE
)]);
    }
    /**
     * @param FuncCall $node
     */
    public function refactor(\PhpParser\Node $node) : ?\PhpParser\Node
    {
        if ($this->shouldSkip($node)) {
            return null;
        }
        $currentStatement = $node->getAttribute(\Rector\NodeTypeResolver\Node\AttributeKey::CURRENT_STATEMENT);
        /** @var Array_ $options */
        $options = $node->args[0]->value;
        foreach ($options->items as $option) {
            if (!$option instanceof \PhpParser\Node\Expr\ArrayItem) {
                return null;
            }
            if (!$option->key instanceof \PhpParser\Node\Scalar\String_) {
                return null;
            }
            if (!$this->valueResolver->isTrueOrFalse($option->value) && !$option->value instanceof \PhpParser\Node\Scalar\String_) {
                return null;
            }
            $sessionKey = new \PhpParser\Node\Scalar\String_('session.' . $option->key->value);
            $funcName = new \PhpParser\Node\Name('ini_set');
            $iniSet = new \PhpParser\Node\Expr\FuncCall($funcName, [new \PhpParser\Node\Arg($sessionKey), new \PhpParser\Node\Arg($option->value)]);
            $this->addNodeBeforeNode(new \PhpParser\Node\Stmt\Expression($iniSet), $currentStatement);
        }
        unset($node->args[0]);
        return $node;
    }
    private function shouldSkip(\PhpParser\Node\Expr\FuncCall $funcCall) : bool
    {
        if (!$this->isName($funcCall, 'session_start')) {
            return \true;
        }
        if (!isset($funcCall->args[0])) {
            return \true;
        }
        return !$funcCall->args[0]->value instanceof \PhpParser\Node\Expr\Array_;
    }
}


text:
package ch.qos.logback.core.helpers;

import ch.qos.logback.core.Context;
import ch.qos.logback.core.ContextBase;
import ch.qos.logback.core.rolling.helper.FileFilterUtil;
import ch.qos.logback.core.rolling.helper.FileNamePattern;
import org.junit.Test;

import java.io.File;
import java.text.ParseException;
import java.text.SimpleDateFormat;

import static junit.framework.Assert.assertEquals;

public class FileFilterUtilTest {

    Context context = new ContextBase();

    // see also http://jira.qos.ch/browse/LBCORE-164
    @Test
    public void findHighestCounterTest() throws ParseException {
        String[] sa = new String[] { "c:/log/debug-old-2010-08-10.0.log", "c:/log/debug-old-2010-08-10.1.log", "c:/log/debug-old-2010-08-10.10.log",
                "c:/log/debug-old-2010-08-10.11.log", "c:/log/debug-old-2010-08-10.12.log", "c:/log/debug-old-2010-08-10.2.log",
                "c:/log/debug-old-2010-08-10.3.log", "c:/log/debug-old-2010-08-10.4.log", "c:/log/debug-old-2010-08-10.5.log",
                "c:/log/debug-old-2010-08-10.6.log", "c:/log/debug-old-2010-08-10.7.log", "c:/log/debug-old-2010-08-10.8.log",
                "c:/log/debug-old-2010-08-10.9.log" };

        File[] matchingFileArray = new File[sa.length];
        for (int i = 0; i < sa.length; i++) {
            matchingFileArray[i] = new File(sa[i]);
        }
        FileNamePattern fnp = new FileNamePattern("c:/log/debug-old-%d{yyyy-MM-dd}.%i.log", context);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
        String rexexp = null;
        rexexp = fnp.toRegexForFixedDate(sdf.parse("2010-08-10"));
        String stemRegex = FileFilterUtil.afterLastSlash(rexexp);
        int result = FileFilterUtil.findHighestCounter(matchingFileArray, stemRegex);
        assertEquals(12, result);
    }
}


text:
<!doctype html>
<html>
    <head>

        <base href="/">
        <title>Alurapic</title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width">

        <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap.min.css">
        <link rel="stylesheet" href="node_modules/bootstrap/dist/css/bootstrap-theme.min.css">

        <link rel="stylesheet" href="node_modules/jqueryui-browser/themes/base/jquery-ui.css">

        <script src="node_modules/jquery/dist/jquery.min.js"></script>

        <script src="node_modules/jquery-migrate/dist/jquery-migrate.min.js"></script>
        <script src="node_modules/jqueryui-browser/ui/jquery-ui.js"></script>

        <script src="node_modules/core-js/client/shim.min.js"></script>
        <script src="node_modules/zone.js/dist/zone.js"></script>
        <script src="node_modules/reflect-metadata/Reflect.js"></script>
        <script src="node_modules/systemjs/dist/system.src.js"></script>

        <script src="systemjs.config.js"></script>
        <script>
            System.import('app').catch(function(err){ console.error(err); });
        </script>
    </head>
    <body>
        <app>Aquele carregando escroto que todo mundo usa.</app>
    </body>
</html>


text:
<?xml version="1.0" encoding="utf-8"?>
<selector
  xmlns:android="http://schemas.android.com/apk/res/android">
    <item android:state_enabled="true" android:state_selected="true" android:drawable="@color/emotion_panel_tab_bg_color_check" />
    <item android:drawable="@color/emotion_tab_check_bg" />
</selector>


text:
<?xml version="1.0" encoding="utf-8"?>
<android.support.v7.widget.Toolbar xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/toolbar"
    android:layout_height="wrap_content"
    android:layout_width="match_parent"
    android:background="@color/colorPrimary">

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <TextView
            android:layout_width="wrap_content"
            android:text="RENDERED VIEW"
            android:paddingTop="5dp"
            android:textSize="25sp"
            android:textStyle="bold"
            android:layout_marginLeft="5dp"
            android:textColor="@color/f5f5f5"
            android:layout_height="wrap_content" />
    </RelativeLayout>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

    </RelativeLayout>

</android.support.v7.widget.Toolbar>


text:
package com.signalcollect.dcop.evaluation.dsa

import com.signalcollect.dcop.evaluation.candidates.BinaryConstraintGraphProvider
import com.signalcollect.Graph
import com.signalcollect.dcop.evaluation.candidates.DSAVertexBuilder
import com.signalcollect.GraphBuilder
import com.signalcollect.dcop.evaluation.candidates.DSAVariant
import com.signalcollect.ExecutionConfiguration
import com.signalcollect.configuration.ExecutionMode
import com.signalcollect.StateForwarderEdge
import com.signalcollect.dcop.evaluation.dsa.DSAConflictAggregationOperation

object DSAASyncStepsExecution extends App{

    var graph: Graph[Any, Any] = _

  val DSAAalgorithm = new DSAVertexBuilder(false, DSAVariant.A, pSchedule = 0.45)

  val graphProvider: BinaryConstraintGraphProvider = new BinaryConstraintGraphProvider(4, 2, 2, loadFrom = "graphs/test.txt", isAdopt = true)

  val graphBuilder = new GraphBuilder[Any, Any]()

//  // Get the adjustment schedule associated with this algorithm
//  val execMode = (DSAAalgorithm.apply(0, Array(1, 2, 3)).asInstanceOf[ConstrainedVertex[_, _]]).underlyingSignalCollectSchedule
//
//  // Set time limit
//  val executionConfig = {
//    if (execMode == ExecutionMode.PureAsynchronous)
//      ExecutionConfiguration(execMode).withSignalThreshold(0.01).withTimeLimit(5000)
//    else
//      ExecutionConfiguration(execMode).withSignalThreshold(0.01).withStepsLimit(250)
//  }

  val executionConfig = ExecutionConfiguration.withExecutionMode(ExecutionMode.Synchronous).withCollectThreshold(0).withSignalThreshold(0).withStepsLimit(1)

  // What edgeBuilder to use with this algorithm
  val edgeBuilder = DSAAalgorithm match {
    case otherwise => (x: Int, y: Int) => new StateForwarderEdge(y)
  }

  val vertexBuilder = DSAAalgorithm

  graph = graphBuilder.build
  graphProvider.populate(graph, vertexBuilder, edgeBuilder)
  graph.awaitIdle

  var conflictsOverTime : Map[Int,Int] = Map()

  for(i <- 0 to 20){
	  graph.execute(executionConfig)
	  val conflicts = graph.aggregate(new DSAConflictAggregationOperation)
	  println(i + " -> " + conflicts)
	  conflictsOverTime += (i -> conflicts)
  }

}


text:
package io.vertx.blueprint.kue.service;

import io.vertx.blueprint.kue.queue.Job;
import io.vertx.blueprint.kue.queue.JobState;
import io.vertx.blueprint.kue.service.impl.JobServiceImpl;
import io.vertx.codegen.annotations.Fluent;
import io.vertx.codegen.annotations.ProxyGen;
import io.vertx.codegen.annotations.VertxGen;
import io.vertx.core.AsyncResult;
import io.vertx.core.Handler;
import io.vertx.core.Vertx;
import io.vertx.core.json.JsonArray;
import io.vertx.core.json.JsonObject;
import io.vertx.serviceproxy.ProxyHelper;

import java.util.List;

/**
 * Service interface for task operations.
 *
 * @author Eric Zhao
 */
@ProxyGen
@VertxGen
public interface JobService {

  /**
   * Factory method for creating a {@link JobService} instance.
   *
   * @param vertx  Vertx instance
   * @param config configuration
   * @return the new {@link JobService} instance
   */
  static JobService create(Vertx vertx, JsonObject config) {
    return new JobServiceImpl(vertx, config);
  }

  /**
   * Factory method for creating a {@link JobService} service proxy.
   * This is useful for doing RPCs.
   *
   * @param vertx Vertx instance
   * @param address event bus address of RPC
   * @return the new {@link JobService} service proxy
   */
  static JobService createProxy(Vertx vertx, String address) {
    return ProxyHelper.createProxy(JobService.class, vertx, address);
  }

  /**
   * Get the certain from backend by id.
   *
   * @param id      job id
   * @param handler async result handler
   */
  @Fluent
  JobService getJob(long id, Handler<AsyncResult<Job>> handler);

  /**
   * Remove a job by id.
   *
   * @param id      job id
   * @param handler async result handler
   */
  @Fluent
  JobService removeJob(long id, Handler<AsyncResult<Void>> handler);

  /**
   * Judge whether a job with certain id exists.
   *
   * @param id      job id
   * @param handler async result handler
   */
  @Fluent
  JobService existsJob(long id, Handler<AsyncResult<Boolean>> handler);

  /**
   * Get job log by id.
   *
   * @param id      job id
   * @param handler async result handler
   */
  @Fluent
  JobService getJobLog(long id, Handler<AsyncResult<JsonArray>> handler);

  /**
   * Get a list of job in certain state in range (from, to) with order.
   *
   * @param state   expected job state
   * @param from    from
   * @param to      to
   * @param order   range order
   * @param handler async result handler
   */
  @Fluent
  JobService jobRangeByState(String state, long from, long to, String order, Handler<AsyncResult<List<Job>>> handler);

  /**
   * Get a list of job in certain state and type in range (from, to) with order.
   *
   * @param type    expected job type
   * @param state   expected job state
   * @param from    from
   * @param to      to
   * @param order   range order
   * @param handler async result handler
   */
  @Fluent
  JobService jobRangeByType(String type, String state, long from, long to, String order, Handler<AsyncResult<List<Job>>> handler);

  /**
   * Get a list of job in range (from, to) with order.
   *
   * @param from    from
   * @param to      to
   * @param order   range order
   * @param handler async result handler
   */
  @Fluent
  JobService jobRange(long from, long to, String order, Handler<AsyncResult<List<Job>>> handler);

  // Runtime cardinality metrics

  /**
   * Get cardinality by job type and state.
   *
   * @param type    job type
   * @param state   job state
   * @param handler async result handler
   */
  @Fluent
  JobService cardByType(String type, JobState state, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality by job state.
   *
   * @param state   job state
   * @param handler async result handler
   */
  @Fluent
  JobService card(JobState state, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality of completed jobs.
   *
   * @param type    job type; if null, then return global metrics
   * @param handler async result handler
   */
  @Fluent
  JobService completeCount(String type, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality of failed jobs.
   *
   * @param type job type; if null, then return global metrics
   */
  @Fluent
  JobService failedCount(String type, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality of inactive jobs.
   *
   * @param type job type; if null, then return global metrics
   */
  @Fluent
  JobService inactiveCount(String type, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality of active jobs.
   *
   * @param type job type; if null, then return global metrics
   */
  @Fluent
  JobService activeCount(String type, Handler<AsyncResult<Long>> handler);

  /**
   * Get cardinality of delayed jobs.
   *
   * @param type job type; if null, then return global metrics
   */
  @Fluent
  JobService delayedCount(String type, Handler<AsyncResult<Long>> handler);

  /**
   * Get the job types present.
   *
   * @param handler async result handler
   */
  @Fluent
  JobService getAllTypes(Handler<AsyncResult<List<String>>> handler);

  /**
   * Return job ids with the given {@link JobState}.
   *
   * @param state   job state
   * @param handler async result handler
   */
  @Fluent
  JobService getIdsByState(JobState state, Handler<AsyncResult<List<Long>>> handler);

  /**
   * Get queue work time in milliseconds.
   *
   * @param handler async result handler
   */
  @Fluent
  JobService getWorkTime(Handler<AsyncResult<Long>> handler);
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.
// Code generated by Microsoft (R) AutoRest Code Generator.

package com.azure.resourcemanager.network.fluent.models;

import com.azure.core.annotation.Fluent;
import com.azure.core.management.Resource;
import com.azure.core.management.SubResource;
import com.azure.resourcemanager.network.models.ManagedServiceIdentity;
import com.azure.resourcemanager.network.models.ProvisioningState;
import com.azure.resourcemanager.network.models.VirtualApplianceNicProperties;
import com.azure.resourcemanager.network.models.VirtualApplianceSkuProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
import java.util.Map;

/** NetworkVirtualAppliance Resource. */
@Fluent
public final class NetworkVirtualApplianceInner extends Resource {
    /*
     * Properties of the Network Virtual Appliance.
     */
    @JsonProperty(value = "properties")
    private NetworkVirtualAppliancePropertiesFormat innerProperties;

    /*
     * The service principal that has read access to cloud-init and config blob.
     */
    @JsonProperty(value = "identity")
    private ManagedServiceIdentity identity;

    /*
     * A unique read-only string that changes whenever the resource is updated.
     */
    @JsonProperty(value = "etag", access = JsonProperty.Access.WRITE_ONLY)
    private String etag;

    /*
     * Resource ID.
     */
    @JsonProperty(value = "id")
    private String id;

    /** Creates an instance of NetworkVirtualApplianceInner class. */
    public NetworkVirtualApplianceInner() {
    }

    /**
     * Get the innerProperties property: Properties of the Network Virtual Appliance.
     *
     * @return the innerProperties value.
     */
    private NetworkVirtualAppliancePropertiesFormat innerProperties() {
        return this.innerProperties;
    }

    /**
     * Get the identity property: The service principal that has read access to cloud-init and config blob.
     *
     * @return the identity value.
     */
    public ManagedServiceIdentity identity() {
        return this.identity;
    }

    /**
     * Set the identity property: The service principal that has read access to cloud-init and config blob.
     *
     * @param identity the identity value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withIdentity(ManagedServiceIdentity identity) {
        this.identity = identity;
        return this;
    }

    /**
     * Get the etag property: A unique read-only string that changes whenever the resource is updated.
     *
     * @return the etag value.
     */
    public String etag() {
        return this.etag;
    }

    /**
     * Get the id property: Resource ID.
     *
     * @return the id value.
     */
    public String id() {
        return this.id;
    }

    /**
     * Set the id property: Resource ID.
     *
     * @param id the id value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withId(String id) {
        this.id = id;
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public NetworkVirtualApplianceInner withLocation(String location) {
        super.withLocation(location);
        return this;
    }

    /** {@inheritDoc} */
    @Override
    public NetworkVirtualApplianceInner withTags(Map<String, String> tags) {
        super.withTags(tags);
        return this;
    }

    /**
     * Get the nvaSku property: Network Virtual Appliance SKU.
     *
     * @return the nvaSku value.
     */
    public VirtualApplianceSkuProperties nvaSku() {
        return this.innerProperties() == null ? null : this.innerProperties().nvaSku();
    }

    /**
     * Set the nvaSku property: Network Virtual Appliance SKU.
     *
     * @param nvaSku the nvaSku value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withNvaSku(VirtualApplianceSkuProperties nvaSku) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withNvaSku(nvaSku);
        return this;
    }

    /**
     * Get the addressPrefix property: Address Prefix.
     *
     * @return the addressPrefix value.
     */
    public String addressPrefix() {
        return this.innerProperties() == null ? null : this.innerProperties().addressPrefix();
    }

    /**
     * Get the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs.
     *
     * @return the bootStrapConfigurationBlobs value.
     */
    public List<String> bootStrapConfigurationBlobs() {
        return this.innerProperties() == null ? null : this.innerProperties().bootStrapConfigurationBlobs();
    }

    /**
     * Set the bootStrapConfigurationBlobs property: BootStrapConfigurationBlobs storage URLs.
     *
     * @param bootStrapConfigurationBlobs the bootStrapConfigurationBlobs value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withBootStrapConfigurationBlobs(List<String> bootStrapConfigurationBlobs) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withBootStrapConfigurationBlobs(bootStrapConfigurationBlobs);
        return this;
    }

    /**
     * Get the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed.
     *
     * @return the virtualHub value.
     */
    public SubResource virtualHub() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualHub();
    }

    /**
     * Set the virtualHub property: The Virtual Hub where Network Virtual Appliance is being deployed.
     *
     * @param virtualHub the virtualHub value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withVirtualHub(SubResource virtualHub) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withVirtualHub(virtualHub);
        return this;
    }

    /**
     * Get the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs.
     *
     * @return the cloudInitConfigurationBlobs value.
     */
    public List<String> cloudInitConfigurationBlobs() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudInitConfigurationBlobs();
    }

    /**
     * Set the cloudInitConfigurationBlobs property: CloudInitConfigurationBlob storage URLs.
     *
     * @param cloudInitConfigurationBlobs the cloudInitConfigurationBlobs value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withCloudInitConfigurationBlobs(List<String> cloudInitConfigurationBlobs) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withCloudInitConfigurationBlobs(cloudInitConfigurationBlobs);
        return this;
    }

    /**
     * Get the cloudInitConfiguration property: CloudInitConfiguration string in plain text.
     *
     * @return the cloudInitConfiguration value.
     */
    public String cloudInitConfiguration() {
        return this.innerProperties() == null ? null : this.innerProperties().cloudInitConfiguration();
    }

    /**
     * Set the cloudInitConfiguration property: CloudInitConfiguration string in plain text.
     *
     * @param cloudInitConfiguration the cloudInitConfiguration value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withCloudInitConfiguration(String cloudInitConfiguration) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withCloudInitConfiguration(cloudInitConfiguration);
        return this;
    }

    /**
     * Get the virtualApplianceAsn property: VirtualAppliance ASN.
     *
     * @return the virtualApplianceAsn value.
     */
    public Long virtualApplianceAsn() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceAsn();
    }

    /**
     * Set the virtualApplianceAsn property: VirtualAppliance ASN.
     *
     * @param virtualApplianceAsn the virtualApplianceAsn value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withVirtualApplianceAsn(Long virtualApplianceAsn) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withVirtualApplianceAsn(virtualApplianceAsn);
        return this;
    }

    /**
     * Get the sshPublicKey property: Public key for SSH login.
     *
     * @return the sshPublicKey value.
     */
    public String sshPublicKey() {
        return this.innerProperties() == null ? null : this.innerProperties().sshPublicKey();
    }

    /**
     * Set the sshPublicKey property: Public key for SSH login.
     *
     * @param sshPublicKey the sshPublicKey value to set.
     * @return the NetworkVirtualApplianceInner object itself.
     */
    public NetworkVirtualApplianceInner withSshPublicKey(String sshPublicKey) {
        if (this.innerProperties() == null) {
            this.innerProperties = new NetworkVirtualAppliancePropertiesFormat();
        }
        this.innerProperties().withSshPublicKey(sshPublicKey);
        return this;
    }

    /**
     * Get the virtualApplianceNics property: List of Virtual Appliance Network Interfaces.
     *
     * @return the virtualApplianceNics value.
     */
    public List<VirtualApplianceNicProperties> virtualApplianceNics() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceNics();
    }

    /**
     * Get the virtualApplianceSites property: List of references to VirtualApplianceSite.
     *
     * @return the virtualApplianceSites value.
     */
    public List<SubResource> virtualApplianceSites() {
        return this.innerProperties() == null ? null : this.innerProperties().virtualApplianceSites();
    }

    /**
     * Get the inboundSecurityRules property: List of references to InboundSecurityRules.
     *
     * @return the inboundSecurityRules value.
     */
    public List<SubResource> inboundSecurityRules() {
        return this.innerProperties() == null ? null : this.innerProperties().inboundSecurityRules();
    }

    /**
     * Get the provisioningState property: The provisioning state of the resource.
     *
     * @return the provisioningState value.
     */
    public ProvisioningState provisioningState() {
        return this.innerProperties() == null ? null : this.innerProperties().provisioningState();
    }

    /**
     * Validates the instance.
     *
     * @throws IllegalArgumentException thrown if the instance is not valid.
     */
    public void validate() {
        if (innerProperties() != null) {
            innerProperties().validate();
        }
        if (identity() != null) {
            identity().validate();
        }
    }
}


text:
package com.heatonresearch.aifh.randomize;

import com.heatonresearch.aifh.AIFHError;

import java.io.Serializable;

/**
 * Generate random choices unevenly.  This class is used to select random
 * choices from a list, with a probability weight places on each item
 * in the list.
 *

 * This is often called a Roulette Wheel in Machine Learning texts.  How it differs from
 * a Roulette Wheel that you might find in Las Vegas or Monte Carlo is that the
 * areas that can be selected are not of uniform size.  However, you can be sure
 * that one will be picked.
 *

 * http://en.wikipedia.org/wiki/Fitness_proportionate_selection
 */
public class RandomChoice implements Serializable {
    /**
     * The probabilities of each item in the list.
     */
    final private double[] probabilities;

    /**
     * Construct a list of probabilities.
     *
     * @param theProbabilities The probability of each item in the list.
     */
    public RandomChoice(double[] theProbabilities) {

        this.probabilities = theProbabilities.clone();

        double total = 0;
        for (final double probability : probabilities) {
            total += probability;
        }

        if (total == 0.0) {
            double prob = 1.0 / probabilities.length;
            for (int i = 0; i < probabilities.length; i++) {
                probabilities[i] = prob;
            }
        } else {
            double total2 = 0;
            double factor = 1.0 / total;
            for (int i = 0; i < probabilities.length; i++) {
                probabilities[i] = probabilities[i] * factor;
                total2 += probabilities[i];
            }

            if (Math.abs(1.0 - total2) > 0.02) {
                double prob = 1.0 / probabilities.length;
                for (int i = 0; i < probabilities.length; i++) {
                    probabilities[i] = prob;
                }
            }
        }
    }

    /**
     * Generate a random choice, based on the probabilities provided to the constructor.
     *
     * @return The random choice.
     */
    public int generate(GenerateRandom theGenerator) {
        double r = theGenerator.nextDouble();
        double sum = 0.0;

        for (int i = 0; i < probabilities.length; i++) {
            sum += probabilities[i];
            if (r < sum) {
                return i;
            }
        }

        for (int i = 0; i < probabilities.length; i++) {
            if (probabilities[i] != 0.0) {
                return i;
            }
        }

        throw new AIFHError("Invalid probabilities.");
    }

    /**
     * Generate a random choice, but skip one of the choices.
     *
     * @param skip The choice to skip.
     * @return The random choice.
     */
    public int generate(GenerateRandom theGenerator, int skip) {
        double totalProb = 1.0 - probabilities[skip];

        double throwValue = theGenerator.nextDouble() * totalProb;
        double accumulator = 0.0;

        for (int i = 0; i < skip; i++) {
            accumulator += probabilities[i];
            if (accumulator > throwValue) {
                return i;
            }
        }

        for (int i = skip + 1; i < probabilities.length; i++) {
            accumulator += probabilities[i];
            if (accumulator > throwValue) {
                return i;
            }
        }

        for (int i = 0; i < skip; i++) {
            if (probabilities[i] != 0.0) {
                return i;
            }
        }
        for (int i = skip + 1; i < probabilities.length; i++) {
            if (probabilities[i] != 0.0) {
                return i;
            }
        }

        return -1;
    }
}


text:
import re
import logging
from rmgpy.quantity import Energy, Mass, Length, Frequency

class QMData(object):
    """
    General class for data extracted from a QM calculation
    """
    def __init__(self,
                 groundStateDegeneracy = -1,
                 numberOfAtoms = None,
                 stericEnergy = None,
                 molecularMass = None,
                 energy = 0,
                 atomicNumbers = None,
                 rotationalConstants = None,
                 atomCoords = None,
                 frequencies = None,
                 source = None,
                 ):
        #: Electronic ground state degeneracy in RMG taken as number of radicals +1
        self.groundStateDegeneracy = groundStateDegeneracy
        self.numberOfAtoms = numberOfAtoms #: Number of atoms.
        self.stericEnergy = Energy(stericEnergy)
        self.molecularMass = Mass(molecularMass)
        self.energy = Energy(energy)
        self.atomicNumbers = atomicNumbers
        self.rotationalConstants = Frequency(rotationalConstants)
        self.atomCoords = Length(atomCoords)
        self.frequencies = Frequency(frequencies)
        self.source = source

        self.testValid()

    def testValid(self):
        assert self.groundStateDegeneracy > 0

    def __repr__(self):
        things=[]
        for attribute in ['groundStateDegeneracy',
                          'numberOfAtoms',
                          'stericEnergy',
                          'molecularMass',
                          'energy',
                          'atomicNumbers',
                          'rotationalConstants',
                          'atomCoords',
                          'frequencies',
                          'source',
                          ]:
            things.append("{0!s}={1!r}".format(attribute, getattr(self,attribute)))
        string = ', '.join(things)
        string = re.sub('\s+',' ',string)
        return 'QMData({0!s})'.format(string)

def parseCCLibData(cclibData, groundStateDegeneracy):
    """
    Parses a CCLib data object and returns QMData object.
    """
    try:
        numberOfAtoms = cclibData.natom
        molecularMass = (cclibData.molmass, 'amu')
        energy = (cclibData.scfenergies[-1], 'eV/molecule')
        atomicNumbers = cclibData.atomnos
        rotationalConstants = ([i * 1e9 for i in cclibData.rotcons[-1]],'hertz')
        atomCoords = (cclibData.atomcoords[-1], 'angstrom')
        frequencies = (cclibData.vibfreqs, 'cm^-1')

    except AttributeError, e:
        logging.error("The passed in cclibData has these attributes: {0!r}".format(cclibData._attrlist))
        raise e

    if hasattr(cclibData, 'stericenergy'):
        stericEnergy = (cclibData.stericenergy, 'eV/molecule')
    else:
        stericEnergy = None

    return QMData(
        groundStateDegeneracy=groundStateDegeneracy,
        numberOfAtoms=numberOfAtoms,
        stericEnergy=stericEnergy,
        molecularMass=molecularMass,
        energy=energy,
        atomicNumbers=atomicNumbers,
        rotationalConstants=rotationalConstants,
        atomCoords=atomCoords,
        frequencies=frequencies
    )


text:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="TabletopPunkaAPIUnit" parallel="methods" thread-count="4">

</suite>


text:
// Copyright 2022 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
// ** This file is automatically generated by gapic-generator-typescript. **
// ** https://github.com/googleapis/gapic-generator-typescript **
// ** All changes to this file may be overwritten. **

'use strict';

function main(name) {
  // [START cloudiot_v1_generated_DeviceManager_GetDevice_async]
  /**
   * This snippet has been automatically generated and should be regarded as a code template only.
   * It will require modifications to work.
   * It may require correct/in-range values for request initialization.
   * TODO(developer): Uncomment these variables before running the sample.
   */
  /**
   *  Required. The name of the device. For example,
   *  `projects/p0/locations/us-central1/registries/registry0/devices/device0` or
   *  `projects/p0/locations/us-central1/registries/registry0/devices/{num_id}`.
   */
  // const name = 'abc123'
  /**
   *  The fields of the `Device` resource to be returned in the response. If the
   *  field mask is unset or empty, all fields are returned. Fields have to be
   *  provided in snake_case format, for example: `last_heartbeat_time`.
   */
  // const fieldMask = {}

  // Imports the Iot library
  const {DeviceManagerClient} = require('@google-cloud/iot').v1;

  // Instantiates a client
  const iotClient = new DeviceManagerClient();

  async function callGetDevice() {
    // Construct request
    const request = {
      name,
    };

    // Run request
    const response = await iotClient.getDevice(request);
    console.log(response);
  }

  callGetDevice();
  // [END cloudiot_v1_generated_DeviceManager_GetDevice_async]
}

process.on('unhandledRejection', err => {
  console.error(err.message);
  process.exitCode = 1;
});
main(...process.argv.slice(2));


text:
Date: 31/06/2016

## Status

Accepted

## Context

We've got a Single Page app, it needs to talk to the server. Our use of scala and scalajs means we can use [lihaoyi's autowire
macros](https://github.com/lihaoyi/autowire)
Although this is essentially a 0 on the [Richardson maturity model](https://martinfowler.com/articles/richardsonMaturityModel.html)
it has huge benefits in terms of speed of change. We also (at the moment) only have the one client of the SPA so we can afford the tight coupling.
It doesn't preclude moving toward something more restful, as we can just add routes when we recognise a need.

## Decision

Use autowire for now.

## Consequences

+ \+ Compile time safety between front and back.
- \- macro magic that has cause a few headaches here and there (beware immutable.Seq)


text:
ssrs-net
========

An SSRS client for showing reports using handlers and MVC action results


text:
The ssh daemon will be configured to disallow user environment settings that
may allow users to bypass access restrictions in some cases.


text:
.smoke-base {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  visibility: hidden;
  opacity: 0;
}

.smoke-base.smoke-visible {
  opacity: 1;
  visibility: visible;
}

.smokebg {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
}

.smoke-base .dialog {
  position: absolute;
}

.dialog-prompt {
  margin-top: 15px;
  text-align: center;
}

.dialog-buttons {
  margin: 20px 0 5px 0
}

.smoke {
  font-family: Menlo, 'Andale Mono', monospace;
  text-align: center;
  font-size: 22px;
  line-height: 150%;
}

.dialog-buttons button {
  display: inline-block;
  vertical-align: baseline;
  cursor: pointer;
  font-family: Menlo, 'Andale Mono', monospace;
  font-style: normal;
  text-decoration: none;
  border: 0;
  outline: 0;
  margin: 0 5px;
  -webkit-background-clip: padding-box;
  font-size: 13px;
  line-height: 13px;
  font-weight: normal;
  padding: 9px 12px;
}

.dialog-prompt input {
  margin: 0;
  border: 0;
  font-family: sans-serif;
  outline: none;
  font-family: Menlo, 'Andale Mono', monospace;
  border: 1px solid #aaa;
  width: 75%;
  display: inline-block;
  background-color: transparent;
  font-size: 16px;
  padding: 8px;
}

.smoke-base {
  background: rgba(0,0,0,.3);
 /* filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#90000000,endColorstr=#900000000);*/
}

.smoke-base .dialog {
  top: 25%;
  width: 40%;
  left: 50%;
  margin-left: -20%;
}

.smoke-base .dialog-inner {
  padding: 15px;

  color:#202020;
}

.smoke {
  background-color: rgba(255,255,255,0.95);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#ffffff,endColorstr=#ffffff);
	box-shadow: 0 2px 8px #666;
}

.dialog-buttons button {
  background-color: rgba(0,0,0,.85);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#222222,endColorstr=#222222);
  border-radius: 0;
  color: #fff;
}

button.cancel {
  background-color: rgba(0,0,0,.40);
  filter: progid:DXImageTransform.Microsoft.gradient(startColorstr=#444444,endColorstr=#444444);
}

.queue{
	display:none;
}


text:
namespace tfrt {
namespace gpu {

GpuOpRegistry::GpuOpRegistry() : impl_(std::make_unique<Impl>()) {}

GpuOpRegistry::~GpuOpRegistry() {}

GpuOpRegistry::GpuOpRegistry(GpuOpRegistry&& other) = default;

GpuOpRegistry& GpuOpRegistry::operator=(GpuOpRegistry&& other) = default;

// Add an op with the specified dispatch function.  This style of dispatch
// function does not require a shape function.
void GpuOpRegistry::AddOp(string_view op_name, GpuDispatchFn dispatch_fn) {
  impl_->AddOp(op_name, dispatch_fn, GpuOpFlags{}, {});
}

void GpuOpRegistry::AddOp(string_view op_name, GpuDispatchFn dispatch_fn,
                          ArrayRef<string_view> attr_names) {
  impl_->AddOp(op_name, dispatch_fn, GpuOpFlags{}, attr_names);
}

// Set a metadata function for the specified op_name.  All metadata functions
// are required to be semantically equal, so multiple registrations for the
// same op are allowed (making static initialization easier).
void GpuOpRegistry::AddMetadataFn(string_view op_name,
                                  OpMetadataFn metadata_fn) {
  impl_->AddMetadataFn(op_name, metadata_fn);
}

static std::vector<GpuOpRegistration>* GetStaticGpuOpRegistrations() {
  static std::vector<GpuOpRegistration>* ret =
      new std::vector<GpuOpRegistration>;
  return ret;
}

void AddStaticGpuOpRegistration(GpuOpRegistration func) {
  GetStaticGpuOpRegistrations()->push_back(func);
}

void RegisterStaticGpuOps(GpuOpRegistry* op_reg) {
  for (auto func : *GetStaticGpuOpRegistrations()) {
    func(op_reg);
  }
}

}  // namespace gpu
}  // namespace tfrt


text:
[Core](../modules/Core.md).Group

## Table of contents

### Constructors

- [constructor](Core.Group.md#constructor)

## Constructors

### constructor

• **new Group**()


text:
package coinparam

import (
	"math/big"
)

// CompactToBig converts a compact representation of a whole number N to an
// unsigned 32-bit number.  The representation is similar to IEEE754 floating
// point numbers.
//
// Like IEEE754 floating point, there are three basic components: the sign,
// the exponent, and the mantissa.  They are broken out as follows:
//
//	* the most significant 8 bits represent the unsigned base 256 exponent
// 	* bit 23 (the 24th bit) represents the sign bit
//	* the least significant 23 bits represent the mantissa
//
//	-------------------------------------------------
//	|   Exponent     |    Sign    |    Mantissa     |
//	-------------------------------------------------
//	| 8 bits [31-24] | 1 bit [23] | 23 bits [22-00] |
//	-------------------------------------------------
//
// The formula to calculate N is:
// 	N = (-1^sign) * mantissa * 256^(exponent-3)
//
// This compact form is only used in bitcoin to encode unsigned 256-bit numbers
// which represent difficulty targets, thus there really is not a need for a
// sign bit, but it is implemented here to stay consistent with bitcoind.
func CompactToBig(compact uint32) *big.Int {
	// Extract the mantissa, sign bit, and exponent.
	mantissa := compact & 0x007fffff
	isNegative := compact&0x00800000 != 0
	exponent := uint(compact >> 24)

	// Since the base for the exponent is 256, the exponent can be treated
	// as the number of bytes to represent the full 256-bit number.  So,
	// treat the exponent as the number of bytes and shift the mantissa
	// right or left accordingly.  This is equivalent to:
	// N = mantissa * 256^(exponent-3)
	var bn *big.Int
	if exponent <= 3 {
		mantissa >>= 8 * (3 - exponent)
		bn = big.NewInt(int64(mantissa))
	} else {
		bn = big.NewInt(int64(mantissa))
		bn.Lsh(bn, 8*(exponent-3))
	}

	// Make it negative if the sign bit is set.
	if isNegative {
		bn = bn.Neg(bn)
	}

	return bn
}

// BigToCompact converts a whole number N to a compact representation using
// an unsigned 32-bit number.  The compact representation only provides 23 bits
// of precision, so values larger than (2^23 - 1) only encode the most
// significant digits of the number.  See CompactToBig for details.
func BigToCompact(n *big.Int) uint32 {
	// No need to do any work if it's zero.
	if n.Sign() == 0 {
		return 0
	}

	// Since the base for the exponent is 256, the exponent can be treated
	// as the number of bytes.  So, shift the number right or left
	// accordingly.  This is equivalent to:
	// mantissa = mantissa / 256^(exponent-3)
	var mantissa uint32
	exponent := uint(len(n.Bytes()))
	if exponent <= 3 {
		mantissa = uint32(n.Bits()[0])
		mantissa <<= 8 * (3 - exponent)
	} else {
		// Use a copy to avoid modifying the caller's original number.
		tn := new(big.Int).Set(n)
		mantissa = uint32(tn.Rsh(tn, 8*(exponent-3)).Bits()[0])
	}

	// When the mantissa already has the sign bit set, the number is too
	// large to fit into the available 23-bits, so divide the number by 256
	// and increment the exponent accordingly.
	if mantissa&0x00800000 != 0 {
		mantissa >>= 8
		exponent++
	}

	// Pack the exponent, sign bit, and mantissa into an unsigned 32-bit
	// int and return it.
	compact := uint32(exponent<<24) | mantissa
	if n.Sign() < 0 {
		compact |= 0x00800000
	}
	return compact
}


text:
using namespace std;

bool valid_name(string test_name);
string get_text(bool name = false);
bool yes_or_no();
int int_option(int max_digit);