text:
// Type definitions for non-npm package Google Admin Reports API reports_v1 1.0
// Project: https://developers.google.com/admin-sdk/reports/
// Definitions by: Bolisov Alexey <https://github.com/Bolisov>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3

// IMPORTANT
// This file was generated by https://github.com/Bolisov/google-api-typings-generator. Please do not edit it manually.
// In case of any problems please post issue to https://github.com/Bolisov/google-api-typings-generator
// Generated from: https://www.googleapis.com/discovery/v1/apis/admin/reports_v1/rest

/// <reference types="gapi.client" />

declare namespace gapi.client {
    /** Load Admin Reports API reports_v1 */
    function load(name: "admin", version: "reports_v1"): PromiseLike<void>;
    function load(name: "admin", version: "reports_v1", callback: () => any): void;

    const activities: admin.ActivitiesResource;

    const channels: admin.ChannelsResource;

    const customerUsageReports: admin.CustomerUsageReportsResource;

    const userUsageReport: admin.UserUsageReportResource;

    namespace admin {
        interface Activities {
            /** ETag of the resource. */
            etag?: string;
            /** Each record in read response. */
            items?: Activity[];
            /** Kind of list response this is. */
            kind?: string;
            /** Token for retrieving the next page */
            nextPageToken?: string;
        }
        interface Activity {
            /** User doing the action. */
            actor?: {
                /** User or OAuth 2LO request. */
                callerType?: string;
                /** Email address of the user. */
                email?: string;
                /** For OAuth 2LO API requests, consumer_key of the requestor. */
                key?: string;
                /** Obfuscated user id of the user. */
                profileId?: string;
            };
            /** ETag of the entry. */
            etag?: string;
            /** Activity events. */
            events?: Array<{
                /** Name of event. */
                name?: string;
                /** Parameter value pairs for various applications. */
                parameters?: Array<{
                    /** Boolean value of the parameter. */
                    boolValue?: boolean;
                    /** Integral value of the parameter. */
                    intValue?: string;
                    /** Multi-int value of the parameter. */
                    multiIntValue?: string[];
                    /** Multi-string value of the parameter. */
                    multiValue?: string[];
                    /** The name of the parameter. */
                    name?: string;
                    /** String value of the parameter. */
                    value?: string;
                }>;
                /** Type of event. */
                type?: string;
            }>;
            /** Unique identifier for each activity record. */
            id?: {
                /** Application name to which the event belongs. */
                applicationName?: string;
                /** Obfuscated customer ID of the source customer. */
                customerId?: string;
                /** Time of occurrence of the activity. */
                time?: string;
                /** Unique qualifier if multiple events have the same time. */
                uniqueQualifier?: string;
            };
            /** IP Address of the user doing the action. */
            ipAddress?: string;
            /** Kind of resource this is. */
            kind?: string;
            /** Domain of source customer. */
            ownerDomain?: string;
        }
        interface Channel {
            /** The address where notifications are delivered for this channel. */
            address?: string;
            /** Date and time of notification channel expiration, expressed as a Unix timestamp, in milliseconds. Optional. */
            expiration?: string;
            /** A UUID or similar unique string that identifies this channel. */
            id?: string;
            /** Identifies this as a notification channel used to watch for changes to a resource. Value: the fixed string "api#channel". */
            kind?: string;
            /** Additional parameters controlling delivery channel behavior. Optional. */
            params?: Record<string, string>;
            /** A Boolean value to indicate whether payload is wanted. Optional. */
            payload?: boolean;
            /** An opaque ID that identifies the resource being watched on this channel. Stable across different API versions. */
            resourceId?: string;
            /** A version-specific identifier for the watched resource. */
            resourceUri?: string;
            /** An arbitrary string delivered to the target address with each notification delivered over this channel. Optional. */
            token?: string;
            /** The type of delivery mechanism used for this channel. */
            type?: string;
        }
        interface UsageReport {
            /** The date to which the record belongs. */
            date?: string;
            /** Information about the type of the item. */
            entity?: {
                /** Obfuscated customer id for the record. */
                customerId?: string;
                /** Obfuscated user id for the record. */
                profileId?: string;
                /** The type of item, can be a customer or user. */
                type?: string;
                /** user's email. */
                userEmail?: string;
            };
            /** ETag of the resource. */
            etag?: string;
            /** The kind of object. */
            kind?: string;
            /** Parameter value pairs for various applications. */
            parameters?: Array<{
                /** Boolean value of the parameter. */
                boolValue?: boolean;
                /** RFC 3339 formatted value of the parameter. */
                datetimeValue?: string;
                /** Integral value of the parameter. */
                intValue?: string;
                /** Nested message value of the parameter. */
                msgValue?: Array<Record<string, any>>;
                /** The name of the parameter. */
                name?: string;
                /** String value of the parameter. */
                stringValue?: string;
            }>;
        }
        interface UsageReports {
            /** ETag of the resource. */
            etag?: string;
            /** The kind of object. */
            kind?: string;
            /** Token for retrieving the next page */
            nextPageToken?: string;
            /** Various application parameter records. */
            usageReports?: UsageReport[];
            /** Warnings if any. */
            warnings?: Array<{
                /** Machine readable code / warning type. */
                code?: string;
                /** Key-Value pairs to give detailed information on the warning. */
                data?: Array<{
                    /** Key associated with a key-value pair to give detailed information on the warning. */
                    key?: string;
                    /** Value associated with a key-value pair to give detailed information on the warning. */
                    value?: string;
                }>;
                /** Human readable message for the warning. */
                message?: string;
            }>;
        }
        interface ActivitiesResource {
            /** Retrieves a list of activities for a specific customer and application. */
            list(request: {
                /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */
                actorIpAddress?: string;
                /** Data format for the response. */
                alt?: string;
                /** Application name for which the events are to be retrieved. */
                applicationName: string;
                /** Represents the customer for which the data is to be fetched. */
                customerId?: string;
                /** Return events which occurred at or before this time. */
                endTime?: string;
                /** Name of the event being queried. */
                eventName?: string;
                /** Selector specifying which fields to include in a partial response. */
                fields?: string;
                /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */
                filters?: string;
                /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
                key?: string;
                /** Number of activity records to be shown in each page. */
                maxResults?: number;
                /** OAuth 2.0 token for the current user. */
                oauth_token?: string;
                /** Token to specify next page. */
                pageToken?: string;
                /** Returns response with indentations and line breaks. */
                prettyPrint?: boolean;
                /**
                 * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
                 * Overrides userIp if both are provided.
                 */
                quotaUser?: string;
                /** Return events which occurred at or after this time. */
                startTime?: string;
                /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
                userIp?: string;
                /**
                 * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for
                 * all users.
                 */
                userKey: string;
            }): Request<Activities>;
            /** Push changes to activities */
            watch(request: {
                /** IP Address of host where the event was performed. Supports both IPv4 and IPv6 addresses. */
                actorIpAddress?: string;
                /** Data format for the response. */
                alt?: string;
                /** Application name for which the events are to be retrieved. */
                applicationName: string;
                /** Represents the customer for which the data is to be fetched. */
                customerId?: string;
                /** Return events which occurred at or before this time. */
                endTime?: string;
                /** Name of the event being queried. */
                eventName?: string;
                /** Selector specifying which fields to include in a partial response. */
                fields?: string;
                /** Event parameters in the form [parameter1 name][operator][parameter1 value],[parameter2 name][operator][parameter2 value],... */
                filters?: string;
                /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
                key?: string;
                /** Number of activity records to be shown in each page. */
                maxResults?: number;
                /** OAuth 2.0 token for the current user. */
                oauth_token?: string;
                /** Token to specify next page. */
                pageToken?: string;
                /** Returns response with indentations and line breaks. */
                prettyPrint?: boolean;
                /**
                 * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
                 * Overrides userIp if both are provided.
                 */
                quotaUser?: string;
                /** Return events which occurred at or after this time. */
                startTime?: string;
                /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
                userIp?: string;
                /**
                 * Represents the profile id or the user email for which the data should be filtered. When 'all' is specified as the userKey, it returns usageReports for
                 * all users.
                 */
                userKey: string;
            }): Request<Channel>;
        }
        interface ChannelsResource {
            /** Stop watching resources through this channel */
            stop(request: {
                /** Data format for the response. */
                alt?: string;
                /** Selector specifying which fields to include in a partial response. */
                fields?: string;
                /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
                key?: string;
                /** OAuth 2.0 token for the current user. */
                oauth_token?: string;
                /** Returns response with indentations and line breaks. */
                prettyPrint?: boolean;
                /**
                 * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
                 * Overrides userIp if both are provided.
                 */
                quotaUser?: string;
                /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
                userIp?: string;
            }): Request<void>;
        }
        interface CustomerUsageReportsResource {
            /** Retrieves a report which is a collection of properties / statistics for a specific customer. */
            get(request: {
                /** Data format for the response. */
                alt?: string;
                /** Represents the customer for which the data is to be fetched. */
                customerId?: string;
                /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */
                date: string;
                /** Selector specifying which fields to include in a partial response. */
                fields?: string;
                /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
                key?: string;
                /** OAuth 2.0 token for the current user. */
                oauth_token?: string;
                /** Token to specify next page. */
                pageToken?: string;
                /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */
                parameters?: string;
                /** Returns response with indentations and line breaks. */
                prettyPrint?: boolean;
                /**
                 * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
                 * Overrides userIp if both are provided.
                 */
                quotaUser?: string;
                /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
                userIp?: string;
            }): Request<UsageReports>;
        }
        interface UserUsageReportResource {
            /** Retrieves a report which is a collection of properties / statistics for a set of users. */
            get(request: {
                /** Data format for the response. */
                alt?: string;
                /** Represents the customer for which the data is to be fetched. */
                customerId?: string;
                /** Represents the date in yyyy-mm-dd format for which the data is to be fetched. */
                date: string;
                /** Selector specifying which fields to include in a partial response. */
                fields?: string;
                /** Represents the set of filters including parameter operator value. */
                filters?: string;
                /** API key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token. */
                key?: string;
                /** Maximum number of results to return. Maximum allowed is 1000 */
                maxResults?: number;
                /** OAuth 2.0 token for the current user. */
                oauth_token?: string;
                /** Token to specify next page. */
                pageToken?: string;
                /** Represents the application name, parameter name pairs to fetch in csv as app_name1:param_name1, app_name2:param_name2. */
                parameters?: string;
                /** Returns response with indentations and line breaks. */
                prettyPrint?: boolean;
                /**
                 * Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
                 * Overrides userIp if both are provided.
                 */
                quotaUser?: string;
                /** IP address of the site where the request originates. Use this if you want to enforce per-user limits. */
                userIp?: string;
                /** Represents the profile id or the user email for which the data should be filtered. */
                userKey: string;
            }): Request<UsageReports>;
        }
    }
}


text:
askForPassword
=============================

Alfred Workflow to toggle "askForPassword" (password prompt to wake from sleep or unlock the screen)

The keyword is `pass`

* hit `Enter` to enable the password prompt
* hit `Alt-Enter` to disable the password prompt

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace PayPal\Api;

use PayPal\Common\PPModel;
use PayPal\Common\FormatConverter;
use PayPal\Validation\NumericValidator;

/**
 * Class Currency
 *
 * Base object for all financial value related fields (balance, payment due, etc.)
 *
 * @package PayPal\Api
 *
 * @property string currency
 * @property string value
 */
class Currency extends PPModel
{
    /**
     * 3 letter currency code as defined by ISO 4217.
     *
     * @param string $currency
     *
     * @return $this
     */
    public function setCurrency($currency)
    {
        $this->currency = $currency;
        return $this;
    }

    /**
     * 3 letter currency code as defined by ISO 4217.
     *
     * @return string
     */
    public function getCurrency()
    {
        return $this->currency;
    }

    /**
     * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
     *
     * @param string|double $value
     *
     * @return $this
     */
    public function setValue($value)
    {
        NumericValidator::validate($value, "Value");
        $value = FormatConverter::formatToTwoDecimalPlaces($value);
        $this->value = $value;
        return $this;
    }

    /**
     * amount up to N digit after the decimals separator as defined in ISO 4217 for the appropriate currency code.
     *
     * @return string
     */
    public function getValue()
    {
        return $this->value;
    }

}


text:
using System;
using OpenTK;
using DongLife.Code;
using DongLife.Controls;

namespace DongLife.Scenes.GameScenes
{
    public class KIJU_WorldDomination : VNScene
    {
        private Actor player, professor;

        public KIJU_WorldDomination() : base("KIJU_WorldDomination")
        {
            background = new Background(@"Textures/Backgrounds/pawns_of_war.png");

            player = ActorFactory.CreateActor("Player");
            professor = ActorFactory.CreateActor("Teacher");

            AddChild(background);
            RegisterActor(player);
            RegisterActor(professor);

            Sequences.RegisterSequence(0, NO_ACTOR, "As the gears of war churned, Professor Kaiju was able to successfully defeat the world's armies through determination.");
            Sequences.RegisterSequence(1, new SequenceSpecial("SpawnActors"));
            ((SequenceSpecial)Sequences.Sequences[1]).OnSequenceExecution += (sender, e) =>
            {
                player.Animator.AnimateFade(1f, 800f);
                professor.Animator.AnimateFade(1f, 800f);

                Sequences.SetStage(2);
            };
            Sequences.RegisterSequence(2, "Teacher", "We did it {PLAYERNAME}!  We have rid the world of racists!  We shall build a new utopia for our peoples!  I shall now be known as King Professor Kaiju!");
            Sequences.RegisterSequence(3, new SequenceDecision("Player",
                "Overthrow King Professor Kaiju.",
                "Rule alongside King Professor Kaiju."));
            ((SequenceDecision)Sequences.Sequences[3]).Choice += (sender, e) =>
            {
                if (e == 0) //Overthrow
                    Sequences.SetStage(10);
                else if (e == 1) //Alongside
                    Sequences.SetStage(20);

                Sequences.ExecuteSequence(this);
            };

            //Overthrow
            Sequences.RegisterSequence(10, "Player", "King Professor Kaiju!  I challenge you to a duel!");
            Sequences.RegisterSequence(11, "Teacher", "Oh no!  My one true weakness!  I am allergic to challenges!");
            Sequences.RegisterSequence(12, new SequenceSceneTransition("GEND_KingKaiju"));

            //Rule alongside
            Sequences.RegisterSequence(20, "Player", "I will be with you, King Professor Kaiju, until the very end!");
            Sequences.RegisterSequence(21, "Teacher", "That's good, {PLAYERNAME}... That's very good...");
            Sequences.RegisterSequence(22, "Teacher", "I may have some use for you yet...");
            Sequences.RegisterSequence(23, new SequenceSceneTransition("GEND_KaijuSlave"));
        }

        public override void OnEnter()
        {
            base.OnEnter();

            player.SetAlpha(0f);
            professor.SetAlpha(0f);
        }
    }
}


text:
// Copyright (C) Pash Contributors. License: GPL/BSD. See https://github.com/Pash-Project/Pash/
using System;

namespace System.Management.Automation.Language
{
    public class DoUntilStatementAst : LoopStatementAst
    {
        public DoUntilStatementAst(IScriptExtent extent, string label, PipelineBaseAst condition, StatementBlockAst body)
            : base(extent, label, condition, body)
        {
        }

        public override string ToString()
        {
            return string.Format("do {{ ... }} until {0}", this.Condition);
        }
    }
}


text:
package com.artemis.cli;

import java.io.File;
import java.util.List;

import com.artemis.ClassUtil;
import com.artemis.Weaver;
import com.artemis.WeaverLog;
import com.artemis.cli.converter.FolderConverter;
import com.artemis.meta.ClassMetadata;
import com.beust.jcommander.Parameter;
import com.beust.jcommander.Parameters;

@Parameters(
		commandDescription="Optimize systems extending EntityProcessingSystem")
public class OptimizationCommand {
	static final String COMMAND = "optimize";

	@Parameter(
		names = {"-c", "--class-folder"},
		description = "Root class folder",
		converter = FolderConverter.class,
		required = true)
	private File classRoot;

	@Parameter(
		names = {"-v", "--verbose"},
		description = "Print summary of all transformed components",
		required = false)
	private boolean verbose = false;

	void execute() {
		long start = System.currentTimeMillis();

		WeaverLog result = new WeaverLog();
		List<ClassMetadata> processed =
				Weaver.rewriteEntitySystems(ClassUtil.find(classRoot), result);

		if (verbose && processed.size() > 0) {
			System.out.println(result.getFormattedLog());
		} else {
			System.out.println(getSummary(processed, start));
		}
	}

	private static CharSequence getSummary(List<ClassMetadata> processed, long start) {
		return String.format("Optimized %d entity systems in %dms.",
			processed.size(), (System.currentTimeMillis() - start));
	}
}


text:
"""Support for Broadlink remotes."""
import asyncio
from base64 import b64encode
from collections import defaultdict
from datetime import timedelta
from itertools import product
import logging

from broadlink.exceptions import (
    AuthorizationError,
    BroadlinkException,
    DeviceOfflineError,
    ReadError,
    StorageError,
)
import voluptuous as vol

from homeassistant.components.remote import (
    ATTR_ALTERNATIVE,
    ATTR_COMMAND,
    ATTR_DELAY_SECS,
    ATTR_DEVICE,
    ATTR_NUM_REPEATS,
    DEFAULT_DELAY_SECS,
    PLATFORM_SCHEMA,
    SUPPORT_LEARN_COMMAND,
    RemoteEntity,
)
from homeassistant.const import CONF_HOST, STATE_ON
from homeassistant.core import callback
from homeassistant.exceptions import HomeAssistantError
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.restore_state import RestoreEntity
from homeassistant.helpers.storage import Store
from homeassistant.util.dt import utcnow

from .const import DOMAIN
from .helpers import data_packet, import_device

_LOGGER = logging.getLogger(__name__)

LEARNING_TIMEOUT = timedelta(seconds=30)

CODE_STORAGE_VERSION = 1
FLAG_STORAGE_VERSION = 1
FLAG_SAVE_DELAY = 15

COMMAND_SCHEMA = vol.Schema(
    {
        vol.Required(ATTR_COMMAND): vol.All(
            cv.ensure_list, [vol.All(cv.string, vol.Length(min=1))], vol.Length(min=1)
        ),
    },
    extra=vol.ALLOW_EXTRA,
)

SERVICE_SEND_SCHEMA = COMMAND_SCHEMA.extend(
    {
        vol.Optional(ATTR_DEVICE): vol.All(cv.string, vol.Length(min=1)),
        vol.Optional(ATTR_DELAY_SECS, default=DEFAULT_DELAY_SECS): vol.Coerce(float),
    }
)

SERVICE_LEARN_SCHEMA = COMMAND_SCHEMA.extend(
    {
        vol.Required(ATTR_DEVICE): vol.All(cv.string, vol.Length(min=1)),
        vol.Optional(ATTR_ALTERNATIVE, default=False): cv.boolean,
    }
)

PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend(
    {vol.Required(CONF_HOST): cv.string}, extra=vol.ALLOW_EXTRA
)

async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
    """Import the device and discontinue platform.

    This is for backward compatibility.
    Do not use this method.
    """
    import_device(hass, config[CONF_HOST])
    _LOGGER.warning(
        "The remote platform is deprecated, please remove it from your configuration"
    )

async def async_setup_entry(hass, config_entry, async_add_entities):
    """Set up a Broadlink remote."""
    device = hass.data[DOMAIN].devices[config_entry.entry_id]
    remote = BroadlinkRemote(
        device,
        Store(hass, CODE_STORAGE_VERSION, f"broadlink_remote_{device.unique_id}_codes"),
        Store(hass, FLAG_STORAGE_VERSION, f"broadlink_remote_{device.unique_id}_flags"),
    )

    loaded = await remote.async_load_storage_files()
    if not loaded:
        _LOGGER.error("Failed to create '%s Remote' entity: Storage error", device.name)
        return

    async_add_entities([remote], False)

class BroadlinkRemote(RemoteEntity, RestoreEntity):
    """Representation of a Broadlink remote."""

    def __init__(self, device, codes, flags):
        """Initialize the remote."""
        self._device = device
        self._coordinator = device.update_manager.coordinator
        self._code_storage = codes
        self._flag_storage = flags
        self._codes = {}
        self._flags = defaultdict(int)
        self._state = True

    @property
    def name(self):
        """Return the name of the remote."""
        return f"{self._device.name} Remote"

    @property
    def unique_id(self):
        """Return the unique id of the remote."""
        return self._device.unique_id

    @property
    def is_on(self):
        """Return True if the remote is on."""
        return self._state

    @property
    def available(self):
        """Return True if the remote is available."""
        return self._device.update_manager.available

    @property
    def should_poll(self):
        """Return True if the remote has to be polled for state."""
        return False

    @property
    def supported_features(self):
        """Flag supported features."""
        return SUPPORT_LEARN_COMMAND

    @property
    def device_info(self):
        """Return device info."""
        return {
            "identifiers": {(DOMAIN, self._device.unique_id)},
            "manufacturer": self._device.api.manufacturer,
            "model": self._device.api.model,
            "name": self._device.name,
            "sw_version": self._device.fw_version,
        }

    def get_code(self, command, device):
        """Return a code and a boolean indicating a toggle command.

        If the command starts with `b64:`, extract the code from it.
        Otherwise, extract the code from the dictionary, using the device
        and command as keys.

        You need to change the flag whenever a toggle command is sent
        successfully. Use `self._flags[device] ^= 1`.
        """
        if command.startswith("b64:"):
            code, is_toggle_cmd = command[4:], False

        else:
            if device is None:
                raise KeyError("You need to specify a device")

            try:
                code = self._codes[device][command]
            except KeyError as err:
                raise KeyError("Command not found") from err

            # For toggle commands, alternate between codes in a list.
            if isinstance(code, list):
                code = code[self._flags[device]]
                is_toggle_cmd = True
            else:
                is_toggle_cmd = False

        try:
            return data_packet(code), is_toggle_cmd
        except ValueError as err:
            raise ValueError("Invalid code") from err

    @callback
    def get_flags(self):
        """Return a dictionary of toggle flags.

        A toggle flag indicates whether the remote should send an
        alternative code.
        """
        return self._flags

    async def async_added_to_hass(self):
        """Call when the remote is added to hass."""
        state = await self.async_get_last_state()
        self._state = state is None or state.state == STATE_ON

        self.async_on_remove(
            self._coordinator.async_add_listener(self.async_write_ha_state)
        )

    async def async_update(self):
        """Update the remote."""
        await self._coordinator.async_request_refresh()

    async def async_turn_on(self, **kwargs):
        """Turn on the remote."""
        self._state = True
        self.async_write_ha_state()

    async def async_turn_off(self, **kwargs):
        """Turn off the remote."""
        self._state = False
        self.async_write_ha_state()

    async def async_load_storage_files(self):
        """Load codes and toggle flags from storage files."""
        try:
            self._codes.update(await self._code_storage.async_load() or {})
            self._flags.update(await self._flag_storage.async_load() or {})

        except HomeAssistantError:
            return False

        return True

    async def async_send_command(self, command, **kwargs):
        """Send a list of commands to a device."""
        kwargs[ATTR_COMMAND] = command
        kwargs = SERVICE_SEND_SCHEMA(kwargs)
        commands = kwargs[ATTR_COMMAND]
        device = kwargs.get(ATTR_DEVICE)
        repeat = kwargs[ATTR_NUM_REPEATS]
        delay = kwargs[ATTR_DELAY_SECS]

        if not self._state:
            return

        should_delay = False

        for _, cmd in product(range(repeat), commands):
            if should_delay:
                await asyncio.sleep(delay)

            try:
                code, is_toggle_cmd = self.get_code(cmd, device)

            except (KeyError, ValueError) as err:
                _LOGGER.error("Failed to send '%s': %s", cmd, err)
                should_delay = False
                continue

            try:
                await self._device.async_request(self._device.api.send_data, code)

            except (AuthorizationError, DeviceOfflineError, OSError) as err:
                _LOGGER.error("Failed to send '%s': %s", command, err)
                break

            except BroadlinkException as err:
                _LOGGER.error("Failed to send '%s': %s", command, err)
                should_delay = False
                continue

            should_delay = True
            if is_toggle_cmd:
                self._flags[device] ^= 1

        self._flag_storage.async_delay_save(self.get_flags, FLAG_SAVE_DELAY)

    async def async_learn_command(self, **kwargs):
        """Learn a list of commands from a remote."""
        kwargs = SERVICE_LEARN_SCHEMA(kwargs)
        commands = kwargs[ATTR_COMMAND]
        device = kwargs[ATTR_DEVICE]
        toggle = kwargs[ATTR_ALTERNATIVE]

        if not self._state:
            return

        should_store = False

        for command in commands:
            try:
                code = await self._async_learn_command(command)
                if toggle:
                    code = [code, await self._async_learn_command(command)]

            except (AuthorizationError, DeviceOfflineError, OSError) as err:
                _LOGGER.error("Failed to learn '%s': %s", command, err)
                break

            except BroadlinkException as err:
                _LOGGER.error("Failed to learn '%s': %s", command, err)
                continue

            self._codes.setdefault(device, {}).update({command: code})
            should_store = True

        if should_store:
            await self._code_storage.async_save(self._codes)

    async def _async_learn_command(self, command):
        """Learn a command from a remote."""
        try:
            await self._device.async_request(self._device.api.enter_learning)

        except (BroadlinkException, OSError) as err:
            _LOGGER.debug("Failed to enter learning mode: %s", err)
            raise

        self.hass.components.persistent_notification.async_create(
            f"Press the '{command}' button.",
            title="Learn command",
            notification_id="learn_command",
        )

        try:
            start_time = utcnow()
            while (utcnow() - start_time) < LEARNING_TIMEOUT:
                await asyncio.sleep(1)
                try:
                    code = await self._device.async_request(self._device.api.check_data)

                except (ReadError, StorageError):
                    continue

                return b64encode(code).decode("utf8")
            raise TimeoutError("No code received")

        finally:
            self.hass.components.persistent_notification.async_dismiss(
                notification_id="learn_command"
            )


text:
package sun.awt;

import java.awt.Component;
import java.awt.Container;
import java.awt.AWTEvent;
import java.awt.Font;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Point;

import java.awt.peer.ComponentPeer;

import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.lang.reflect.InvocationTargetException;

import java.util.logging.Logger;
import java.util.logging.Level;

import java.security.AccessController;
import java.security.PrivilegedAction;

/**
 * A collection of methods for modifying package private fields in AWT components.
 * This class is meant to be used by Peer code only. Previously peer code
 * got around this problem by modifying fields from native code. However
 * as we move away from native code to Pure-java peers we need this class.
 *
 * @author Bino George
 */

public class ComponentAccessor
{
    private static Class componentClass;
    private static Field fieldX;
    private static Field fieldY;
    private static Field fieldWidth;
    private static Field fieldHeight;
    private static Method methodGetParentNoClientCode;
    private static Method methodGetFontNoClientCode;
    private static Method methodProcessEvent;
    private static Method methodEnableEvents;
    private static Field fieldParent;
    private static Field fieldBackground;
    private static Field fieldForeground;
    private static Field fieldFont;
    private static Field fieldPacked;
    private static Field fieldIgnoreRepaint;
    private static Field fieldPeer;
    private static Method methodResetGC;
    private static Field fieldVisible;
    private static Method methodIsEnabledImpl;
    private static Method methodGetCursorNoClientCode;
    private static Method methodLocationNoClientCode;

    private static final Logger log = Logger.getLogger("sun.awt.ComponentAccessor");

    private ComponentAccessor() {
    }

    static {
        AccessController.doPrivileged( new PrivilegedAction() {
                public Object run() {
                    try {
                        componentClass = Class.forName("java.awt.Component");
                        fieldX  = componentClass.getDeclaredField("x");
                        fieldX.setAccessible(true);
                        fieldY  = componentClass.getDeclaredField("y");
                        fieldY.setAccessible(true);
                        fieldWidth  = componentClass.getDeclaredField("width");
                        fieldWidth.setAccessible(true);
                        fieldHeight  = componentClass.getDeclaredField("height");
                        fieldHeight.setAccessible(true);
                        fieldForeground  = componentClass.getDeclaredField("foreground");
                        fieldForeground.setAccessible(true);
                        fieldBackground  = componentClass.getDeclaredField("background");
                        fieldBackground.setAccessible(true);
                        fieldFont = componentClass.getDeclaredField("font");
                        fieldFont.setAccessible(true);
                        methodGetParentNoClientCode = componentClass.getDeclaredMethod("getParent_NoClientCode", (Class[]) null);
                        methodGetParentNoClientCode.setAccessible(true);
                        methodGetFontNoClientCode = componentClass.getDeclaredMethod("getFont_NoClientCode", (Class[]) null);
                        methodGetFontNoClientCode.setAccessible(true);
                        Class[] argTypes = { AWTEvent.class };
                        methodProcessEvent = componentClass.getDeclaredMethod("processEvent",argTypes);
                        methodProcessEvent.setAccessible(true);
                        Class[] argTypesForMethodEnableEvents = { Long.TYPE };
                        methodEnableEvents = componentClass.getDeclaredMethod("enableEvents",argTypesForMethodEnableEvents);
                        methodEnableEvents.setAccessible(true);

                        fieldParent  = componentClass.getDeclaredField("parent");
                        fieldParent.setAccessible(true);
                        fieldPacked = componentClass.getDeclaredField("isPacked");
                        fieldPacked.setAccessible(true);
                        fieldIgnoreRepaint = componentClass.getDeclaredField("ignoreRepaint");
                        fieldIgnoreRepaint.setAccessible(true);

                        fieldPeer = componentClass.getDeclaredField("peer");
                        fieldPeer.setAccessible(true);

                        methodResetGC = componentClass.getDeclaredMethod("resetGC", (Class[]) null);
                        methodResetGC.setAccessible(true);

                        fieldVisible = componentClass.getDeclaredField("visible");
                        fieldVisible.setAccessible(true);

                        methodIsEnabledImpl = componentClass.getDeclaredMethod("isEnabledImpl", (Class[]) null);
                        methodIsEnabledImpl.setAccessible(true);

                        methodGetCursorNoClientCode = componentClass.getDeclaredMethod("getCursor_NoClientCode", (Class[]) null);
                        methodGetCursorNoClientCode.setAccessible(true);

                        methodLocationNoClientCode = componentClass.getDeclaredMethod("location_NoClientCode", (Class[]) null);
                        methodLocationNoClientCode.setAccessible(true);
                    }
                    catch (NoSuchFieldException e) {
                        log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
                    }
                    catch (ClassNotFoundException e) {
                        log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
                    }
                    catch (NoSuchMethodException e) {
                        log.log(Level.FINE, "Unable to initialize ComponentAccessor", e);
                    }
                    // to please javac
                    return null;
                }
            });
    }

    public static void setX(Component c, int x)
    {
        try {
            fieldX.setInt(c,x);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static void setY(Component c, int y)
    {
        try {
            fieldY.setInt(c,y);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static void setWidth(Component c, int width)
    {
        try {
            fieldWidth.setInt(c,width);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static void setHeight(Component c, int height)
    {
        try {
            fieldHeight.setInt(c,height);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static void setBounds(Component c, int x, int y, int width, int height)
    {
        try {
            fieldX.setInt(c,x);
            fieldY.setInt(c,y);
            fieldWidth.setInt(c,width);
            fieldHeight.setInt(c,height);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static int getX(Component c) {
        try {
            return fieldX.getInt(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return 0;
    }

    public static int getY(Component c) {
        try {
            return fieldY.getInt(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return 0;
    }

    public static int getWidth(Component c) {
        try {
            return fieldWidth.getInt(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return 0;
    }

    public static int getHeight(Component c) {
        try {
            return fieldHeight.getInt(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return 0;
    }

    public static boolean getIsPacked(Component c) {
        try {
            return fieldPacked.getBoolean(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return false;
    }

    public static Container getParent_NoClientCode(Component c) {
        Container parent=null;

        try {
            parent = (Container) methodGetParentNoClientCode.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }

        return parent;
    }

    public static Font getFont_NoClientCode(Component c) {
        Font font=null;

        try {
            font = (Font) methodGetFontNoClientCode.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }

        return font;
    }

    public static void processEvent(Component c, AWTEvent event) {
        Font font=null;

        try {
            Object[] args = new Object[1];
            args[0] = event;
            methodProcessEvent.invoke(c,args);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }
    }

    public static void enableEvents(Component c, long event_mask) {
        try {
            Object[] args = new Object[1];
            args[0] = Long.valueOf(event_mask);
            methodEnableEvents.invoke(c,args);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }
    }

    public static void setParent(Component c, Container parent)
    {
        try {
            fieldParent.set(c,parent);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static Color getForeground(Component c)
    {
        Color color = null;
        try {
            color = (Color) fieldForeground.get(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return color;
    }

    public static Color getBackground(Component c)
    {
        Color color = null;
        try {
            color = (Color) fieldBackground.get(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return color;
    }

    public static void setBackground(Component c, Color color) {
        try {
            fieldBackground.set(c, color);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static Font getFont(Component c)
    {
        Font f = null;
        try {
            f = (Font) fieldFont.get(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return f;
    }

    public static ComponentPeer getPeer(Component c) {
        ComponentPeer peer = null;
        try {
            peer = (ComponentPeer)fieldPeer.get(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return peer;
    }

    public static void setPeer(Component c, ComponentPeer peer) {
        try {
            fieldPeer.set(c, peer);
        } catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
    }

    public static boolean getIgnoreRepaint(Component comp) {
        try {
            return fieldIgnoreRepaint.getBoolean(comp);
        }
        catch (IllegalAccessException e) {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }

        return false;
    }

    public static void resetGC(Component c) {
        try {
            methodResetGC.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e) {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }
    }

    public static boolean getVisible(Component c) {
        try {
            return fieldVisible.getBoolean(c);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        return false;
    }

    public static boolean isEnabledImpl(Component c) {
        boolean enabled = true;
        try {
            enabled = (Boolean) methodIsEnabledImpl.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }
        return enabled;
    }

    public static Cursor getCursor_NoClientCode(Component c) {
        Cursor cursor = null;

        try {
            cursor = (Cursor) methodGetCursorNoClientCode.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }

        return cursor;
    }

    public static Point getLocation_NoClientCode(Component c) {
        Point loc = null;

        try {
            loc = (Point) methodLocationNoClientCode.invoke(c, (Object[]) null);
        }
        catch (IllegalAccessException e)
        {
            log.log(Level.FINE, "Unable to access the Component object", e);
        }
        catch (InvocationTargetException e) {
            log.log(Level.FINE, "Unable to invoke on the Component object", e);
        }

        return loc;
    }
}


text:
import os
import django
from django import http
from django import shortcuts
from django.core.paginator import ObjectPaginator, InvalidPage
from google.appengine.api import users
from google.appengine.ext import db
import common
from smionline.models.models import *
from yahoo import ystockquote
import datetime
import listings

def edit(request, listing_id, listing_value_id):
  """Create or edit a listings.  GET shows a blank form, POST processes it."""
  user = users.GetCurrentUser()
  if user is None:
    return http.HttpResponseForbidden('You must be signed in to add or edit a listing value')

  listing_value = None
  if listing_id and listing_value_id:
    listing_value = db.get(db.Key.from_path(Listing.kind(), int(listing_id)))
    if listing is None:
      return http.HttpResponseNotFound('No listing exists with that key (%r)' %
                                       listing_id)

  form = ListingForm(data=request.POST or None, instance=listing)

  if not request.POST:
    return common.respond(request, user, 'listing', {'form': form, 'listing':listing})

  errors = form.errors
  if not errors:
    try:
      listing = form.save(commit=False)
    except ValueError, err:
      errors['__all__'] = unicode(err)
  if errors:
    return common.respond(request, user, 'listing', {'form': form, 'listing': listing})

  if not listing.creator:
    listing.creator = user
  listing.put()
  return http.HttpResponseRedirect('/')

def new(request):
  """Create a listing.  GET shows a blank form, POST processes it."""
  return edit(request, None)

def delete(request ,listing_id):
  """Delete a listing."""
  if request.DELETE:
    return http.HttpResponseRedirect('/')

def list(request, listing_id):
  user = users.GetCurrentUser()
  if user is None:
    return http.HttpResponseForbidden('You must be signed in to view listing values')
  listing_values = None
  listing = None
  lvs_paginator = None
  if request.GET.has_key('page'):
    page = int(request.GET['page'])
  else:
    page = 0

  if listing_id:
    listing = get_listing(listing_id)
    lvs = ListingValue.all().order('-date').filter('listing_key = ', str(listing.key()))
    lvs_paginator = ObjectPaginator(lvs, 10)
    listing_values = lvs_paginator.get_page(page)

  if listing is None or listing_values is None or listing_id is None:
      return http.HttpResponseNotFound(
          'No values exists for that listing (%r)' %
          listing_id)

  paginator = {}
  paginator['has_previous_page'] = lvs_paginator.has_previous_page(page)
  paginator['has_next_page'] = lvs_paginator.has_next_page(page)
  paginator['next_page_number'] = page+1
  paginator['previous_page_number'] = page-1
  return common.respond(request, user,
                        'values_list',
                        {'listing': listing,
                         'listing_values' : listing_values,
                         'paginator': paginator})

def fetch_historic_values(request, listing_id):
  user = users.GetCurrentUser()
  if user is None:
    return http.HttpResponseForbidden('You must be signed in to view listing values')
  listing_values = None
  listing = None
  historic_results = None
  if listing_id:
    listing = get_listing(listing_id)
    listing_values = get_all_listing_values(listing.key())
    start_date = datetime.date.today() - datetime.timedelta(days=60)
    for listing_value in listing_values:
      start_date = listing_value.date
      break
    historic_results = ystockquote.get_historical_prices(
      listing.symbol, start_date.strftime("%Y%m%d"),
      datetime.date.today().strftime("%Y%m%d"))
    for historic_result in historic_results:
      is_in_data_store = False
      split_date = historic_result[0].split('-')
      historic_date = datetime.date(int(split_date[0]),
                                    int(split_date[1]),
                                    int(split_date[2]))
      for data_store_value in listing_values:
        if historic_date == data_store_value.date:
          is_in_data_store = True
      if not is_in_data_store:
        lv = ListingValue(listing_key = str(listing.key()),
                          date = historic_date,
                          open = float(historic_result[1]),
                          high = float(historic_result[2]),
                          low = float(historic_result[3]),
                          volume = int(historic_result[5]),
                          adj_close = float(historic_result[6]),
                          value = float(historic_result[4]),
                          creator = user)
        lv.save()
  return common.respond(request, user,
                        'values_fetch',
                        {'listing': listing})

def delete(request):
  user = users.GetCurrentUser()
  if user is None:
    return http.HttpResponseForbidden('You must be signed in to delete listing values')
  symbol = None
  if request.GET.has_key('symbol'):
    symbol = request.GET['symbol']
  else:
    return http.HttpResponseNotFound('Please provide symbol parameter')
  listing_key = listings.get_key_from_symbol(symbol)
  if listing_key is None:
    return http.HttpResponseNotFound('None')
  q = db.GqlQuery("SELECT * FROM ListingValue WHERE listing_key = :key",
                  key = str(listing_key))
  results = q.fetch(1000)
  while results:
    db.delete(results)
    results = q.fetch(1000, len(results))
  return common.respond(request, user,
                        'values_delete')

def get_listing(listing_id):
  listing = db.get(db.Key.from_path(Listing.kind(), int(listing_id)))
  return listing

def get_all_listing_values(listing_key):
  return db.GqlQuery('SELECT * FROM ListingValue '
                     'WHERE listing_key = :key '
                     'ORDER BY date DESC', key = str(listing_key))


text:
var bling = require("./build/Release/bling");
var Long = require("long");

const City128Value = require('./lib/city128');

/**
 * bkdr
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.bkdr = function(str) {
    return bling.calcHash("BKDR", str);
};

/**
 * ap
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.ap = function(str) {
    return bling.calcHash("AP", str);
};

/**
 * djb
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.djb = function(str) {
    return bling.calcHash("DJB", str);
};

/**
 * js
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.js = function(str) {
    return bling.calcHash("JS", str);
};

/**
 * rs
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.rs = function(str) {
    return bling.calcHash("RS", str);
};

/**
 * sdb
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.sdbm = function(str) {
    return bling.calcHash("SDBM", str);
};

/**
 * pjw
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.pjw = function(str) {
    return bling.calcHash("PJW", str);
};

/**
 * elf
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.elf = function(str) {
    return bling.calcHash("ELF", str);
};

/**
 * city32
 * @param {String} str the string will be hashed
 * @return {Number} the hash value
 */
exports.city32 = function(str) {
    return bling.cityHash32(str);
};

/**
 * city64
 * @param {String} str the string will be hashed
 * @return {Long} the hash value
 */
exports.city64 = function(str) {
    var _int64 = bling.cityHash64(str);
    _int64 = new Long(_int64.readInt32LE(0), _int64.readInt32LE(4), true);
    return _int64;
};

/**
 * city128
 * @param {String} str the string will be hashed
 * @return {City128Value} the hash value
 */
exports.city128 = function(str) {
    var _int128 = bling.cityHash128(str);
    return new City128Value(_int128);
};


text:
package com.maxdemarzi.Helpers;

import javax.ws.rs.WebApplicationException;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;

public class Exceptions  extends WebApplicationException {

    public Exceptions(int code, String error)  {
        super(new Throwable(error), Response.status(code)
                .entity("{\"error\":\"" + error + "\"}")
                .type(MediaType.APPLICATION_JSON)
                .build());

    }

    public static Exceptions invalidInput = new Exceptions(400, "Invalid Input");

    public static Exceptions missingNameParameter = new Exceptions(400, "Missing name Parameter.");
    public static Exceptions invalidNameParameter = new Exceptions(400, "Invalid name Parameter.");

    public static Exceptions missingCodeParameter = new Exceptions(400, "Missing code Parameter.");
    public static Exceptions invalidCodeParameter = new Exceptions(400, "Invalid code Parameter.");

    public static Exceptions missingPriorityParameter = new Exceptions(400, "Missing priority Parameter.");
    public static Exceptions invalidPriorityParameter = new Exceptions(400, "Invalid priority Parameter.");

    public static Exceptions missingFromParameter = new Exceptions(400, "Missing from Parameter.");
    public static Exceptions invalidFromParameter = new Exceptions(400, "Invalid from Parameter.");

    public static Exceptions missingToParameter = new Exceptions(400, "Missing to Parameter.");
    public static Exceptions invalidToParameter = new Exceptions(400, "Invalid to Parameter.");

    public static Exceptions missingDayParameter = new Exceptions(400, "Missing day Parameter.");
    public static Exceptions invalidDayParameter = new Exceptions(400, "Invalid day Parameter.");

}


text:
package ns

type Nsmemorystats struct {
	Allocf         float64 `json:"allocf,omitempty"`
	Clearstats     string  `json:"clearstats,omitempty"`
	Memcurallocper float64 `json:"memcurallocper,omitempty"`
	Memcurinkb     int     `json:"memcurinkb,omitempty"`
	Pool           string  `json:"pool,omitempty"`
}


text:
namespace mlir {
namespace torch {
namespace TMTensor {

/// Returns a `memref.dim` or `tensor.dim` operation to get the shape of `v` at
/// `dim`.
Value getDimValue(OpBuilder &builder, Location loc, Value v, int64_t dim);

/// Returns a `memref.dim` or `tensor.dim` operation to get the shape of `v` at
/// `dim`. If the shape is constant, returns the shape as an `IntegerAttr`.
OpFoldResult getDim(OpBuilder &builder, Location loc, Value v, int64_t dim);

} // namespace TMTensor
} // namespace torch
} // namespace mlir

#define GET_OP_CLASSES
#include "torch-mlir-dialects/Dialect/TMTensor/IR/TMTensorOps.h.inc" // IWYU pragma: export

#endif // TORCH_MLIR_DIALECTS_DIALECT_TMTENSOR_IR_TMTENSOROPS_H_


text:
import EventEmitter from '../event-emitter/constructor';

export default class Channel extends EventEmitter {
}


text:
namespace miniMAT {
    namespace ast {
        struct ClearStmt : public Statement
        {
            ClearStmt(std::vector<std::shared_ptr<Reference>> refs);

            std::string ClassName() const;

            void VisitDisplay(const std::string& prefix) const;
            ast::Matrix VisitEvaluate(std::shared_ptr<std::map<std::string, ast::Matrix>> vars);
            void VisitCheck(std::shared_ptr<std::map<std::string, ast::Matrix>> vars,
                            std::shared_ptr<reporter::ErrorReporter> checker) const;

            void PrintResult(std::shared_ptr<std::map<std::string, ast::Matrix>> vars,
                             ast::Matrix ans,
                             bool suppressed) const;

            std::vector<std::shared_ptr<Reference>> refs;
        };
    }
}

#endif


text:
package servingTea.waitress.old;
/*package waitress;

import java.util.ArrayList;

import jade.core.Agent;
import jade.domain.FIPAAgentManagement.FailureException;
import jade.domain.FIPAAgentManagement.NotUnderstoodException;
import jade.domain.FIPAAgentManagement.RefuseException;
import jade.lang.acl.ACLMessage;
import jade.lang.acl.MessageTemplate;
import jade.proto.AchieveREResponder;

public class RespondToCustomer extends AchieveREResponder {
public String CustomerOrder="none";
	String Conversation = "none";
	String dummy = "tea";
	ArrayList<Object> menuForCustomer = new ArrayList<Object>();

	public RespondToCustomer(Waitress waitress, MessageTemplate mt) {
		super(waitress, mt);
	}

	public RespondToCustomer(Agent a, MessageTemplate mt, ArrayList<Object> menuForCustomer) {
		super(a, mt);
		this.menuForCustomer = menuForCustomer;
	}

	@Override
	protected ACLMessage prepareResponse(ACLMessage request) throws NotUnderstoodException, RefuseException {
		// send AGREE
		Conversation = request.getContent();
		ACLMessage agree = request.createReply();
		agree.setPerformative(ACLMessage.AGREE);
		return agree;
		// send REFUSE
		// throw new RefuseException("check-failed");
	}

	@Override
	protected ACLMessage prepareResultNotification(ACLMessage request, ACLMessage response) throws FailureException {
		// if agent AGREEd to request
		// send INFORM
		ACLMessage inform = request.createReply();
		switch (Conversation.toString()) {
		case "RequestMenu":
			inform.setContent(dummy);
			inform.setPerformative(ACLMessage.INFORM);
			System.out.println("Waitress: This is the menu:  "+ Conversation);
			break;
		case "tea":
			inform.setContent("none");
			inform.setPerformative(ACLMessage.INFORM);
			CustomerOrder= Conversation.toString();
			System.out.println("Waitress: Dear Customer, you will get "+ Conversation);

			break;
		default:
			System.out.println("------>Waitress was fired!");
		}

		return inform;
		// send FAILURE
		// throw new FailureException("unexpected-error");
	}

	private static final long serialVersionUID = -8009542545033008746L;
}
*/


text:
import Util from "../../helpers/Util";

const PluginActions = {
  "DIALOG_ALERT": "DIALOG_ALERT",
  "FORM_INSERT": "FORM_INSERT",
  "FORM_UPDATE": "FORM_UPDATE",
  "FORM_DELETE": "FORM_DELETE"
};

export default Util.fixObject(PluginActions, "PLUGIN_ACTION_");


text:
///////////////////////////////////////////////////////////////
// This is generated code.
//////////////////////////////////////////////////////////////
// Code is generated using LLBLGen Pro version: 4.2
// Code is generated using templates: SD.TemplateBindings.SharedTemplates
// Templates vendor: Solutions Design.
// Templates version:
//////////////////////////////////////////////////////////////
using System;
using SD.LLBLGen.Pro.ORMSupportClasses;

namespace NinjaSoftware.EnioNg.CoolJ.HelperClasses
{

	// __LLBLGENPRO_USER_CODE_REGION_START AdditionalNamespaces
	// __LLBLGENPRO_USER_CODE_REGION_END

	/// Singleton implementation of the FieldInfoProvider. This class is the singleton wrapper through which the actual instance is retrieved.
	/// <remarks>It uses a single instance of an internal class. The access isn't marked with locks as the FieldInfoProviderBase class is threadsafe.</remarks>
	internal static class FieldInfoProviderSingleton
	{
		#region Class Member Declarations
		private static readonly IFieldInfoProvider _providerInstance = new FieldInfoProviderCore();
		#endregion

		/// Dummy static constructor to make sure threadsafe initialization is performed.
		static FieldInfoProviderSingleton()
		{
		}

		/// Gets the singleton instance of the FieldInfoProviderCore
		/// <returns>Instance of the FieldInfoProvider.</returns>
		public static IFieldInfoProvider GetInstance()
		{
			return _providerInstance;
		}
	}

	/// Actual implementation of the FieldInfoProvider. Used by singleton wrapper.
	internal class FieldInfoProviderCore : FieldInfoProviderBase
	{
		/// Initializes a new instance of the <see cref="FieldInfoProviderCore"/> class.
		internal FieldInfoProviderCore()
		{
			Init();
		}

		/// Method which initializes the internal datastores.
		private void Init()
		{
			this.InitClass( (16 + 0));
			InitArtiklEntityInfos();
			InitAuditInfoEntityInfos();
			InitAuditInfoActionTypeRoEntityInfos();
			InitBrojacEntityInfos();
			InitConfigEntityInfos();
			InitEntityRoEntityInfos();
			InitErrorEntityInfos();
			InitFirmaEntityInfos();
			InitPartnerEntityInfos();
			InitPdvEntityInfos();
			InitRacunGlavaEntityInfos();
			InitRacunStavkaEntityInfos();
			InitRoleRoEntityInfos();
			InitStatusRoEntityInfos();
			InitTarifaEntityInfos();
			InitUserEntityInfos();

			this.ConstructElementFieldStructures(InheritanceInfoProviderSingleton.GetInstance());
		}

		/// Inits ArtiklEntity's FieldInfo objects
		private void InitArtiklEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(ArtiklFieldIndex), "ArtiklEntity");
			this.AddElementFieldInfo("ArtiklEntity", "ArtiklId", typeof(System.Int64), true, false, false, false,  (int)ArtiklFieldIndex.ArtiklId, 0, 0, 19);
			this.AddElementFieldInfo("ArtiklEntity", "Cijena", typeof(System.Decimal), false, false, false, false,  (int)ArtiklFieldIndex.Cijena, 0, 2, 10);
			this.AddElementFieldInfo("ArtiklEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)ArtiklFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("ArtiklEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)ArtiklFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("ArtiklEntity", "IsActive", typeof(System.Boolean), false, false, false, false,  (int)ArtiklFieldIndex.IsActive, 0, 0, 0);
			this.AddElementFieldInfo("ArtiklEntity", "Jm", typeof(System.String), false, false, false, false,  (int)ArtiklFieldIndex.Jm, 10, 0, 0);
			this.AddElementFieldInfo("ArtiklEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)ArtiklFieldIndex.Naziv, 150, 0, 0);
			this.AddElementFieldInfo("ArtiklEntity", "PdvId", typeof(System.Int64), false, true, false, false,  (int)ArtiklFieldIndex.PdvId, 0, 0, 19);
		}
		/// Inits AuditInfoEntity's FieldInfo objects
		private void InitAuditInfoEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(AuditInfoFieldIndex), "AuditInfoEntity");
			this.AddElementFieldInfo("AuditInfoEntity", "ActionDateTime", typeof(System.DateTime), false, false, false, false,  (int)AuditInfoFieldIndex.ActionDateTime, 0, 0, 0);
			this.AddElementFieldInfo("AuditInfoEntity", "AuditInfoActionTypeId", typeof(System.Int64), false, true, false, false,  (int)AuditInfoFieldIndex.AuditInfoActionTypeId, 0, 0, 19);
			this.AddElementFieldInfo("AuditInfoEntity", "AuditInfoId", typeof(System.Int64), true, false, false, false,  (int)AuditInfoFieldIndex.AuditInfoId, 0, 0, 19);
			this.AddElementFieldInfo("AuditInfoEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)AuditInfoFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("AuditInfoEntity", "EntityId", typeof(System.Int64), false, true, false, false,  (int)AuditInfoFieldIndex.EntityId, 0, 0, 19);
			this.AddElementFieldInfo("AuditInfoEntity", "JsonData", typeof(System.String), false, false, false, false,  (int)AuditInfoFieldIndex.JsonData, 2147483647, 0, 0);
			this.AddElementFieldInfo("AuditInfoEntity", "PrimaryKeyValue", typeof(System.Int64), false, false, false, false,  (int)AuditInfoFieldIndex.PrimaryKeyValue, 0, 0, 19);
			this.AddElementFieldInfo("AuditInfoEntity", "UserId", typeof(System.Int64), false, true, false, false,  (int)AuditInfoFieldIndex.UserId, 0, 0, 19);
		}
		/// Inits AuditInfoActionTypeRoEntity's FieldInfo objects
		private void InitAuditInfoActionTypeRoEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(AuditInfoActionTypeRoFieldIndex), "AuditInfoActionTypeRoEntity");
			this.AddElementFieldInfo("AuditInfoActionTypeRoEntity", "AuditInfoActionTypeId", typeof(System.Int64), true, false, false, false,  (int)AuditInfoActionTypeRoFieldIndex.AuditInfoActionTypeId, 0, 0, 19);
			this.AddElementFieldInfo("AuditInfoActionTypeRoEntity", "Code", typeof(System.String), false, false, false, false,  (int)AuditInfoActionTypeRoFieldIndex.Code, 128, 0, 0);
			this.AddElementFieldInfo("AuditInfoActionTypeRoEntity", "Name", typeof(System.String), false, false, false, false,  (int)AuditInfoActionTypeRoFieldIndex.Name, 256, 0, 0);
		}
		/// Inits BrojacEntity's FieldInfo objects
		private void InitBrojacEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(BrojacFieldIndex), "BrojacEntity");
			this.AddElementFieldInfo("BrojacEntity", "BrojacId", typeof(System.Int64), true, false, false, false,  (int)BrojacFieldIndex.BrojacId, 0, 0, 19);
			this.AddElementFieldInfo("BrojacEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)BrojacFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("BrojacEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)BrojacFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("BrojacEntity", "Godina", typeof(System.Int16), false, false, false, false,  (int)BrojacFieldIndex.Godina, 0, 0, 5);
			this.AddElementFieldInfo("BrojacEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)BrojacFieldIndex.Naziv, 100, 0, 0);
			this.AddElementFieldInfo("BrojacEntity", "SlijedeciBroj", typeof(System.Int32), false, false, false, false,  (int)BrojacFieldIndex.SlijedeciBroj, 0, 0, 10);
		}
		/// Inits ConfigEntity's FieldInfo objects
		private void InitConfigEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(ConfigFieldIndex), "ConfigEntity");
			this.AddElementFieldInfo("ConfigEntity", "Adresa", typeof(System.String), false, false, false, true,  (int)ConfigFieldIndex.Adresa, 100, 0, 0);
			this.AddElementFieldInfo("ConfigEntity", "AktivnaGodina", typeof(System.Int16), false, false, false, false,  (int)ConfigFieldIndex.AktivnaGodina, 0, 0, 5);
			this.AddElementFieldInfo("ConfigEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)ConfigFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("ConfigEntity", "ConfigId", typeof(System.Int64), true, false, false, false,  (int)ConfigFieldIndex.ConfigId, 0, 0, 19);
			this.AddElementFieldInfo("ConfigEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)ConfigFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("ConfigEntity", "Mjesto", typeof(System.String), false, false, false, true,  (int)ConfigFieldIndex.Mjesto, 100, 0, 0);
			this.AddElementFieldInfo("ConfigEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)ConfigFieldIndex.Naziv, 100, 0, 0);
			this.AddElementFieldInfo("ConfigEntity", "Oib", typeof(System.String), false, false, false, false,  (int)ConfigFieldIndex.Oib, 11, 0, 0);
			this.AddElementFieldInfo("ConfigEntity", "Zr", typeof(System.String), false, false, false, true,  (int)ConfigFieldIndex.Zr, 50, 0, 0);
		}
		/// Inits EntityRoEntity's FieldInfo objects
		private void InitEntityRoEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(EntityRoFieldIndex), "EntityRoEntity");
			this.AddElementFieldInfo("EntityRoEntity", "Code", typeof(System.String), false, false, false, false,  (int)EntityRoFieldIndex.Code, 128, 0, 0);
			this.AddElementFieldInfo("EntityRoEntity", "EntityId", typeof(System.Int64), true, false, false, false,  (int)EntityRoFieldIndex.EntityId, 0, 0, 19);
			this.AddElementFieldInfo("EntityRoEntity", "Name", typeof(System.String), false, false, false, false,  (int)EntityRoFieldIndex.Name, 256, 0, 0);
		}
		/// Inits ErrorEntity's FieldInfo objects
		private void InitErrorEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(ErrorFieldIndex), "ErrorEntity");
			this.AddElementFieldInfo("ErrorEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)ErrorFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("ErrorEntity", "ErrorDateTime", typeof(System.DateTime), false, false, false, false,  (int)ErrorFieldIndex.ErrorDateTime, 0, 0, 0);
			this.AddElementFieldInfo("ErrorEntity", "ErrorId", typeof(System.Int64), true, false, false, false,  (int)ErrorFieldIndex.ErrorId, 0, 0, 19);
			this.AddElementFieldInfo("ErrorEntity", "Message", typeof(System.String), false, false, false, false,  (int)ErrorFieldIndex.Message, 2147483647, 0, 0);
			this.AddElementFieldInfo("ErrorEntity", "ParentErrorId", typeof(Nullable<System.Int64>), false, true, false, true,  (int)ErrorFieldIndex.ParentErrorId, 0, 0, 19);
			this.AddElementFieldInfo("ErrorEntity", "StackTrace", typeof(System.String), false, false, false, true,  (int)ErrorFieldIndex.StackTrace, 2147483647, 0, 0);
		}
		/// Inits FirmaEntity's FieldInfo objects
		private void InitFirmaEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(FirmaFieldIndex), "FirmaEntity");
			this.AddElementFieldInfo("FirmaEntity", "FirmaId", typeof(System.Int64), true, false, false, false,  (int)FirmaFieldIndex.FirmaId, 0, 0, 19);
		}
		/// Inits PartnerEntity's FieldInfo objects
		private void InitPartnerEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(PartnerFieldIndex), "PartnerEntity");
			this.AddElementFieldInfo("PartnerEntity", "Adresa", typeof(System.String), false, false, false, true,  (int)PartnerFieldIndex.Adresa, 100, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)PartnerFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)PartnerFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("PartnerEntity", "IsActive", typeof(System.Boolean), false, false, false, false,  (int)PartnerFieldIndex.IsActive, 0, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "Mjesto", typeof(System.String), false, false, false, true,  (int)PartnerFieldIndex.Mjesto, 40, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)PartnerFieldIndex.Naziv, 100, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "Oib", typeof(System.String), false, false, false, true,  (int)PartnerFieldIndex.Oib, 11, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "PartnerId", typeof(System.Int64), true, false, false, false,  (int)PartnerFieldIndex.PartnerId, 0, 0, 19);
			this.AddElementFieldInfo("PartnerEntity", "Posta", typeof(System.String), false, false, false, true,  (int)PartnerFieldIndex.Posta, 10, 0, 0);
			this.AddElementFieldInfo("PartnerEntity", "Valuta", typeof(System.Int16), false, false, false, false,  (int)PartnerFieldIndex.Valuta, 0, 0, 5);
		}
		/// Inits PdvEntity's FieldInfo objects
		private void InitPdvEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(PdvFieldIndex), "PdvEntity");
			this.AddElementFieldInfo("PdvEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)PdvFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("PdvEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)PdvFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("PdvEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)PdvFieldIndex.Naziv, 128, 0, 0);
			this.AddElementFieldInfo("PdvEntity", "PdvId", typeof(System.Int64), true, false, false, false,  (int)PdvFieldIndex.PdvId, 0, 0, 19);
			this.AddElementFieldInfo("PdvEntity", "Stopa", typeof(System.Decimal), false, false, false, false,  (int)PdvFieldIndex.Stopa, 0, 2, 4);
		}
		/// Inits RacunGlavaEntity's FieldInfo objects
		private void InitRacunGlavaEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(RacunGlavaFieldIndex), "RacunGlavaEntity");
			this.AddElementFieldInfo("RacunGlavaEntity", "BrojRacuna", typeof(System.Int32), false, false, false, false,  (int)RacunGlavaFieldIndex.BrojRacuna, 0, 0, 10);
			this.AddElementFieldInfo("RacunGlavaEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)RacunGlavaFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "Datum", typeof(System.DateTime), false, false, false, false,  (int)RacunGlavaFieldIndex.Datum, 0, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)RacunGlavaFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("RacunGlavaEntity", "Godina", typeof(System.Int16), false, false, false, false,  (int)RacunGlavaFieldIndex.Godina, 0, 0, 5);
			this.AddElementFieldInfo("RacunGlavaEntity", "JePdvRacun", typeof(System.Boolean), false, false, false, false,  (int)RacunGlavaFieldIndex.JePdvRacun, 0, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "MjestoRadaAdresa", typeof(System.String), false, false, false, true,  (int)RacunGlavaFieldIndex.MjestoRadaAdresa, 100, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "MjestoRadaNaziv", typeof(System.String), false, false, false, true,  (int)RacunGlavaFieldIndex.MjestoRadaNaziv, 100, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "PartnerId", typeof(System.Int64), false, true, false, false,  (int)RacunGlavaFieldIndex.PartnerId, 0, 0, 19);
			this.AddElementFieldInfo("RacunGlavaEntity", "RacunGlavaId", typeof(System.Int64), true, false, false, false,  (int)RacunGlavaFieldIndex.RacunGlavaId, 0, 0, 19);
			this.AddElementFieldInfo("RacunGlavaEntity", "StatusId", typeof(System.Int64), false, true, false, false,  (int)RacunGlavaFieldIndex.StatusId, 0, 0, 19);
			this.AddElementFieldInfo("RacunGlavaEntity", "TarifaId", typeof(System.Int64), false, true, false, false,  (int)RacunGlavaFieldIndex.TarifaId, 0, 0, 19);
			this.AddElementFieldInfo("RacunGlavaEntity", "TarifaStopa", typeof(System.Decimal), false, false, false, false,  (int)RacunGlavaFieldIndex.TarifaStopa, 0, 2, 5);
			this.AddElementFieldInfo("RacunGlavaEntity", "Valuta", typeof(System.Int16), false, false, false, false,  (int)RacunGlavaFieldIndex.Valuta, 0, 0, 5);
			this.AddElementFieldInfo("RacunGlavaEntity", "Vrijeme", typeof(System.String), false, false, false, true,  (int)RacunGlavaFieldIndex.Vrijeme, 10, 0, 0);
			this.AddElementFieldInfo("RacunGlavaEntity", "Zaglavlje", typeof(System.String), false, false, false, true,  (int)RacunGlavaFieldIndex.Zaglavlje, 1024, 0, 0);
		}
		/// Inits RacunStavkaEntity's FieldInfo objects
		private void InitRacunStavkaEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(RacunStavkaFieldIndex), "RacunStavkaEntity");
			this.AddElementFieldInfo("RacunStavkaEntity", "ArtiklId", typeof(System.Int64), false, true, false, false,  (int)RacunStavkaFieldIndex.ArtiklId, 0, 0, 19);
			this.AddElementFieldInfo("RacunStavkaEntity", "Cijena", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.Cijena, 0, 2, 10);
			this.AddElementFieldInfo("RacunStavkaEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)RacunStavkaFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("RacunStavkaEntity", "Iznos", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.Iznos, 0, 2, 10);
			this.AddElementFieldInfo("RacunStavkaEntity", "Kolicina", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.Kolicina, 0, 2, 8);
			this.AddElementFieldInfo("RacunStavkaEntity", "PdvIznos", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.PdvIznos, 0, 2, 10);
			this.AddElementFieldInfo("RacunStavkaEntity", "PdvPosto", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.PdvPosto, 0, 2, 4);
			this.AddElementFieldInfo("RacunStavkaEntity", "Pozicija", typeof(System.Int16), false, false, false, false,  (int)RacunStavkaFieldIndex.Pozicija, 0, 0, 5);
			this.AddElementFieldInfo("RacunStavkaEntity", "RacunGlavaId", typeof(System.Int64), false, true, false, false,  (int)RacunStavkaFieldIndex.RacunGlavaId, 0, 0, 19);
			this.AddElementFieldInfo("RacunStavkaEntity", "RacunStavkaId", typeof(System.Int64), true, false, false, false,  (int)RacunStavkaFieldIndex.RacunStavkaId, 0, 0, 19);
			this.AddElementFieldInfo("RacunStavkaEntity", "TarifaIznos", typeof(System.Decimal), false, false, false, false,  (int)RacunStavkaFieldIndex.TarifaIznos, 0, 2, 10);
		}
		/// Inits RoleRoEntity's FieldInfo objects
		private void InitRoleRoEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(RoleRoFieldIndex), "RoleRoEntity");
			this.AddElementFieldInfo("RoleRoEntity", "Code", typeof(System.String), false, false, false, false,  (int)RoleRoFieldIndex.Code, 50, 0, 0);
			this.AddElementFieldInfo("RoleRoEntity", "Name", typeof(System.String), false, false, false, false,  (int)RoleRoFieldIndex.Name, 50, 0, 0);
			this.AddElementFieldInfo("RoleRoEntity", "RoleId", typeof(System.Int64), true, false, false, false,  (int)RoleRoFieldIndex.RoleId, 0, 0, 19);
		}
		/// Inits StatusRoEntity's FieldInfo objects
		private void InitStatusRoEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(StatusRoFieldIndex), "StatusRoEntity");
			this.AddElementFieldInfo("StatusRoEntity", "Code", typeof(System.String), false, false, false, false,  (int)StatusRoFieldIndex.Code, 50, 0, 0);
			this.AddElementFieldInfo("StatusRoEntity", "Name", typeof(System.String), false, false, false, false,  (int)StatusRoFieldIndex.Name, 50, 0, 0);
			this.AddElementFieldInfo("StatusRoEntity", "StatusId", typeof(System.Int64), true, false, false, false,  (int)StatusRoFieldIndex.StatusId, 0, 0, 19);
		}
		/// Inits TarifaEntity's FieldInfo objects
		private void InitTarifaEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(TarifaFieldIndex), "TarifaEntity");
			this.AddElementFieldInfo("TarifaEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)TarifaFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("TarifaEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)TarifaFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("TarifaEntity", "IsActive", typeof(System.Boolean), false, false, false, false,  (int)TarifaFieldIndex.IsActive, 0, 0, 0);
			this.AddElementFieldInfo("TarifaEntity", "Naziv", typeof(System.String), false, false, false, false,  (int)TarifaFieldIndex.Naziv, 100, 0, 0);
			this.AddElementFieldInfo("TarifaEntity", "Stopa", typeof(System.Decimal), false, false, false, false,  (int)TarifaFieldIndex.Stopa, 0, 2, 5);
			this.AddElementFieldInfo("TarifaEntity", "TarifaId", typeof(System.Int64), true, false, false, false,  (int)TarifaFieldIndex.TarifaId, 0, 0, 19);
		}
		/// Inits UserEntity's FieldInfo objects
		private void InitUserEntityInfos()
		{
			this.AddFieldIndexEnumForElementName(typeof(UserFieldIndex), "UserEntity");
			this.AddElementFieldInfo("UserEntity", "ConcurrencyGuid", typeof(System.String), false, false, false, false,  (int)UserFieldIndex.ConcurrencyGuid, 50, 0, 0);
			this.AddElementFieldInfo("UserEntity", "FirmaId", typeof(System.Int64), false, true, false, false,  (int)UserFieldIndex.FirmaId, 0, 0, 19);
			this.AddElementFieldInfo("UserEntity", "Password", typeof(System.String), false, false, false, false,  (int)UserFieldIndex.Password, 256, 0, 0);
			this.AddElementFieldInfo("UserEntity", "RoleId", typeof(System.Int64), false, true, false, false,  (int)UserFieldIndex.RoleId, 0, 0, 19);
			this.AddElementFieldInfo("UserEntity", "UserId", typeof(System.Int64), true, false, false, false,  (int)UserFieldIndex.UserId, 0, 0, 19);
			this.AddElementFieldInfo("UserEntity", "Username", typeof(System.String), false, false, false, false,  (int)UserFieldIndex.Username, 20, 0, 0);
		}

	}
}


text:
%% show_divided_img: Show divided image
function show_divided_img(blocks)
    [row, col] = size(blocks);
    blocks = blocks';

    for k = 1:numel(blocks)
        subplot(row, col, k);
        imshow(blocks{k});
    end


text:
package com.google.android.exoplayer2.extractor.ogg;

import static com.google.android.exoplayer2.testutil.TestUtil.getByteArray;
import static com.google.common.truth.Truth.assertThat;

import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.android.exoplayer2.testutil.FakeExtractorInput;
import com.google.android.exoplayer2.testutil.TestUtil;
import com.google.android.exoplayer2.util.ParsableByteArray;
import java.io.IOException;
import java.util.Arrays;
import java.util.Random;
import org.junit.Test;
import org.junit.runner.RunWith;

/** Unit test for {@link OggPacket}. */
@RunWith(AndroidJUnit4.class)
public final class OggPacketTest {

  private static final String TEST_FILE = "ogg/bear.opus";

  private final Random random = new Random(/* seed= */ 0);
  private final OggPacket oggPacket = new OggPacket();

  @Test
  public void readPacketsWithEmptyPage() throws Exception {
    byte[] firstPacket = TestUtil.buildTestData(8, random);
    byte[] secondPacket = TestUtil.buildTestData(272, random);
    byte[] thirdPacket = TestUtil.buildTestData(256, random);
    byte[] fourthPacket = TestUtil.buildTestData(271, random);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(), "ogg/four_packets_with_empty_page"));

    assertReadPacket(input, firstPacket);
    assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isTrue();
    assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isFalse();
    assertThat(oggPacket.getPageHeader().type).isEqualTo(0x02);
    assertThat(oggPacket.getPageHeader().headerSize).isEqualTo(27 + 1);
    assertThat(oggPacket.getPageHeader().bodySize).isEqualTo(8);
    assertThat(oggPacket.getPageHeader().revision).isEqualTo(0x00);
    assertThat(oggPacket.getPageHeader().pageSegmentCount).isEqualTo(1);
    assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1000);
    assertThat(oggPacket.getPageHeader().streamSerialNumber).isEqualTo(4096);
    assertThat(oggPacket.getPageHeader().granulePosition).isEqualTo(0);

    assertReadPacket(input, secondPacket);
    assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isFalse();
    assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isFalse();
    assertThat(oggPacket.getPageHeader().type).isEqualTo(0);
    assertThat(oggPacket.getPageHeader().headerSize).isEqualTo(27 + 2);
    assertThat(oggPacket.getPageHeader().bodySize).isEqualTo(255 + 17);
    assertThat(oggPacket.getPageHeader().pageSegmentCount).isEqualTo(2);
    assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1001);
    assertThat(oggPacket.getPageHeader().granulePosition).isEqualTo(16);

    assertReadPacket(input, thirdPacket);
    assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isFalse();
    assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
    assertThat(oggPacket.getPageHeader().type).isEqualTo(4);
    assertThat(oggPacket.getPageHeader().headerSize).isEqualTo(27 + 4);
    assertThat(oggPacket.getPageHeader().bodySize).isEqualTo(255 + 1 + 255 + 16);
    assertThat(oggPacket.getPageHeader().pageSegmentCount).isEqualTo(4);
    // Page 1002 is empty, so current page is 1003.
    assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1003);
    assertThat(oggPacket.getPageHeader().granulePosition).isEqualTo(128);

    assertReadPacket(input, fourthPacket);

    assertReadEof(input);
  }

  @Test
  public void readPacketWithZeroSizeTerminator() throws Exception {
    byte[] firstPacket = TestUtil.buildTestData(255, random);
    byte[] secondPacket = TestUtil.buildTestData(8, random);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(),
                "ogg/packet_with_zero_size_terminator"));

    assertReadPacket(input, firstPacket);
    assertReadPacket(input, secondPacket);
    assertReadEof(input);
  }

  @Test
  public void readContinuedPacketOverTwoPages() throws Exception {
    byte[] firstPacket = TestUtil.buildTestData(518);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(),
                "ogg/continued_packet_over_two_pages"));

    assertReadPacket(input, firstPacket);
    assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
    assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isFalse();
    assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1001);

    assertReadEof(input);
  }

  @Test
  public void readContinuedPacketOverFourPages() throws Exception {
    byte[] firstPacket = TestUtil.buildTestData(1028);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(),
                "ogg/continued_packet_over_four_pages"));

    assertReadPacket(input, firstPacket);
    assertThat((oggPacket.getPageHeader().type & 0x04) == 0x04).isTrue();
    assertThat((oggPacket.getPageHeader().type & 0x02) == 0x02).isFalse();
    assertThat(oggPacket.getPageHeader().pageSequenceNumber).isEqualTo(1003);

    assertReadEof(input);
  }

  @Test
  public void readDiscardContinuedPacketAtStart() throws Exception {
    byte[] pageBody = TestUtil.buildTestData(256 + 8);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(), "ogg/continued_packet_at_start"));

    // Expect the first partial packet to be discarded.
    assertReadPacket(input, Arrays.copyOfRange(pageBody, 256, 256 + 8));
    assertReadEof(input);
  }

  @Test
  public void readZeroSizedPacketsAtEndOfStream() throws Exception {
    byte[] firstPacket = TestUtil.buildTestData(8, random);
    byte[] secondPacket = TestUtil.buildTestData(8, random);
    byte[] thirdPacket = TestUtil.buildTestData(8, random);
    FakeExtractorInput input =
        createInput(
            getByteArray(
                ApplicationProvider.getApplicationContext(),
                "ogg/zero_sized_packets_at_end_of_stream"));

    assertReadPacket(input, firstPacket);
    assertReadPacket(input, secondPacket);
    assertReadPacket(input, thirdPacket);
    assertReadEof(input);
  }

  @Test
  public void parseRealFile() throws IOException {
    byte[] data = TestUtil.getByteArray(ApplicationProvider.getApplicationContext(), TEST_FILE);
    FakeExtractorInput input = new FakeExtractorInput.Builder().setData(data).build();
    int packetCounter = 0;
    while (readPacket(input)) {
      packetCounter++;
    }
    assertThat(packetCounter).isEqualTo(277);
  }

  private static FakeExtractorInput createInput(byte[] data) {
    return new FakeExtractorInput.Builder()
        .setData(data)
        .setSimulateIOErrors(true)
        .setSimulateUnknownLength(true)
        .setSimulatePartialReads(true)
        .build();
  }

  private void assertReadPacket(FakeExtractorInput extractorInput, byte[] expected)
      throws IOException {
    assertThat(readPacket(extractorInput)).isTrue();
    ParsableByteArray payload = oggPacket.getPayload();
    assertThat(Arrays.copyOf(payload.data, payload.limit())).isEqualTo(expected);
  }

  private void assertReadEof(FakeExtractorInput extractorInput) throws IOException {
    assertThat(readPacket(extractorInput)).isFalse();
  }

  private boolean readPacket(FakeExtractorInput input) throws IOException {
    while (true) {
      try {
        return oggPacket.populate(input);
      } catch (FakeExtractorInput.SimulatedIOException e) {
        // Ignore.
      }
    }
  }
}


text:
<?php

declare(strict_types=1);

namespace KejawenLab\Application\SemartHris\Entity;

use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Blameable\Traits\BlameableEntity;
use Gedmo\Mapping\Annotation as Gedmo;
use Gedmo\SoftDeleteable\Traits\SoftDeleteableEntity;
use Gedmo\Timestampable\Traits\TimestampableEntity;
use KejawenLab\Application\SemartHris\Component\Job\Model\JobLevelInterface;
use KejawenLab\Application\SemartHris\Component\Job\Model\JobTitleInterface;
use KejawenLab\Application\SemartHris\Util\StringUtil;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;

/**
 * @ORM\Entity()
 * @ORM\Table(name="job_titles", indexes={@ORM\Index(name="job_titles_idx", columns={"code", "name"})})
 *
 * @ApiResource(
 *     attributes={
 *         "filters"={
 *             "code.search",
 *             "name.search"
 *         },
 *         "normalization_context"={"groups"={"read"}},
 *         "denormalization_context"={"groups"={"write"}}
 *     }
 * )
 *
 * @UniqueEntity("code")
 *
 * @Gedmo\SoftDeleteable(fieldName="deletedAt")
 *
 * @author Muhamad Surya Iksanudin <surya.iksanudin@gmail.com>
 */
class JobTitle implements JobTitleInterface
{
    use BlameableEntity;
    use SoftDeleteableEntity;
    use TimestampableEntity;

    /**
     * @Groups({"read"})
     *
     * @ORM\Id()
     * @ORM\Column(type="uuid", unique=true)
     * @ORM\GeneratedValue(strategy="CUSTOM")
     * @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
     *
     * @var string
     */
    private $id;

    /**
     * @Groups({"write", "read"})
     *
     * @ORM\ManyToOne(targetEntity="KejawenLab\Application\SemartHris\Entity\JobLevel", fetch="EAGER")
     * @ORM\JoinColumn(name="job_level_id", referencedColumnName="id")
     *
     * @var JobLevelInterface
     */
    private $jobLevel;

    /**
     * @Groups({"read", "write"})
     *
     * @ORM\Column(type="string", length=9)
     *
     * @Assert\Length(max=9)
     * @Assert\NotBlank()
     *
     * @var string
     */
    private $code;

    /**
     * @Groups({"read", "write"})
     *
     * @ORM\Column(type="string")
     *
     * @Assert\NotBlank()
     *
     * @var string
     */
    private $name;

    /**
     * @return string
     */
    public function getId(): string
    {
        return (string) $this->id;
    }

    /**
     * @return JobLevelInterface|null
     */
    public function getJobLevel(): ? JobLevelInterface
    {
        return $this->jobLevel;
    }

    /**
     * @param JobLevelInterface|null $jobLevel
     */
    public function setJobLevel(?JobLevelInterface $jobLevel): void
    {
        $this->jobLevel = $jobLevel;
    }

    /**
     * @return string
     */
    public function getCode(): string
    {
        return (string) $this->code;
    }

    /**
     * @param string $code
     */
    public function setCode(string $code): void
    {
        $this->code = StringUtil::uppercase($code);
    }

    /**
     * @return string
     */
    public function getName(): string
    {
        return (string) $this->name;
    }

    /**
     * @param string $name
     */
    public function setName(string $name): void
    {
        $this->name = StringUtil::uppercase($name);
    }

    /**
     * @return string
     */
    public function __toString(): string
    {
        return sprintf('%s - %s', $this->getCode(), $this->getName());
    }
}