text:
namespace Azure.ResourceManager.Communication
{
    public partial class CommunicationManagementClient
    {
        protected CommunicationManagementClient() { }
        public CommunicationManagementClient(string subscriptionId, Azure.Core.TokenCredential tokenCredential, Azure.ResourceManager.Communication.CommunicationManagementClientOptions options = null) { }
        public CommunicationManagementClient(System.Uri endpoint, string subscriptionId, Azure.Core.TokenCredential tokenCredential, Azure.ResourceManager.Communication.CommunicationManagementClientOptions options = null) { }
        public virtual Azure.ResourceManager.Communication.CommunicationServiceOperations CommunicationService { get { throw null; } }
        public virtual Azure.ResourceManager.Communication.Operations Operations { get { throw null; } }
        public virtual Azure.ResourceManager.Communication.OperationStatusesOperations OperationStatuses { get { throw null; } }
    }
    public partial class CommunicationManagementClientOptions : Azure.Core.ClientOptions
    {
        public CommunicationManagementClientOptions() { }
    }
    public partial class CommunicationServiceCreateOrUpdateOperation : Azure.Operation<Azure.ResourceManager.Communication.Models.CommunicationServiceResource>
    {
        protected CommunicationServiceCreateOrUpdateOperation() { }
        public override bool HasCompleted { get { throw null; } }
        public override bool HasValue { get { throw null; } }
        public override string Id { get { throw null; } }
        public override Azure.ResourceManager.Communication.Models.CommunicationServiceResource Value { get { throw null; } }
        public override Azure.Response GetRawResponse() { throw null; }
        public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response> UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
    }
    public partial class CommunicationServiceDeleteOperation : Azure.Operation<Azure.Response>
    {
        protected CommunicationServiceDeleteOperation() { }
        public override bool HasCompleted { get { throw null; } }
        public override bool HasValue { get { throw null; } }
        public override string Id { get { throw null; } }
        public override Azure.Response Value { get { throw null; } }
        public override Azure.Response GetRawResponse() { throw null; }
        public override Azure.Response UpdateStatus(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response> UpdateStatusAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Response>> WaitForCompletionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public override System.Threading.Tasks.ValueTask<Azure.Response<Azure.Response>> WaitForCompletionAsync(System.TimeSpan pollingInterval, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
    }
    public partial class CommunicationServiceOperations
    {
        protected CommunicationServiceOperations() { }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.NameAvailability> CheckNameAvailability(Azure.ResourceManager.Communication.Models.NameAvailabilityParameters nameAvailabilityParameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.NameAvailability>> CheckNameAvailabilityAsync(Azure.ResourceManager.Communication.Models.NameAvailabilityParameters nameAvailabilityParameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> Get(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource>> GetAsync(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.LinkedNotificationHub> LinkNotificationHub(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.LinkNotificationHubParameters linkNotificationHubParameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.LinkedNotificationHub>> LinkNotificationHubAsync(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.LinkNotificationHubParameters linkNotificationHubParameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Pageable<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> ListByResourceGroup(string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.AsyncPageable<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> ListByResourceGroupAsync(string resourceGroupName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Pageable<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> ListBySubscription(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.AsyncPageable<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> ListBySubscriptionAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceKeys> ListKeys(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceKeys>> ListKeysAsync(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceKeys> RegenerateKey(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.RegenerateKeyParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceKeys>> RegenerateKeyAsync(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.RegenerateKeyParameters parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.ResourceManager.Communication.CommunicationServiceCreateOrUpdateOperation StartCreateOrUpdate(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.CommunicationServiceResource parameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.ResourceManager.Communication.CommunicationServiceCreateOrUpdateOperation> StartCreateOrUpdateAsync(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.CommunicationServiceResource parameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.ResourceManager.Communication.CommunicationServiceDeleteOperation StartDelete(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.ResourceManager.Communication.CommunicationServiceDeleteOperation> StartDeleteAsync(string resourceGroupName, string communicationServiceName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource> Update(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.CommunicationServiceResource parameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.CommunicationServiceResource>> UpdateAsync(string resourceGroupName, string communicationServiceName, Azure.ResourceManager.Communication.Models.CommunicationServiceResource parameters = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
    }
    public partial class Operations
    {
        protected Operations() { }
        public virtual Azure.Pageable<Azure.ResourceManager.Communication.Models.Operation> List(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual Azure.AsyncPageable<Azure.ResourceManager.Communication.Models.Operation> ListAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
    }
    public partial class OperationStatusesOperations
    {
        protected OperationStatusesOperations() { }
        public virtual Azure.Response<Azure.ResourceManager.Communication.Models.OperationStatus> Get(string location, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
        public virtual System.Threading.Tasks.Task<Azure.Response<Azure.ResourceManager.Communication.Models.OperationStatus>> GetAsync(string location, string operationId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; }
    }
}
namespace Azure.ResourceManager.Communication.Models
{
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public readonly partial struct ActionType : System.IEquatable<Azure.ResourceManager.Communication.Models.ActionType>
    {
        private readonly object _dummy;
        private readonly int _dummyPrimitive;
        public ActionType(string value) { throw null; }
        public static Azure.ResourceManager.Communication.Models.ActionType Internal { get { throw null; } }
        public bool Equals(Azure.ResourceManager.Communication.Models.ActionType other) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override bool Equals(object obj) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override int GetHashCode() { throw null; }
        public static bool operator ==(Azure.ResourceManager.Communication.Models.ActionType left, Azure.ResourceManager.Communication.Models.ActionType right) { throw null; }
        public static implicit operator Azure.ResourceManager.Communication.Models.ActionType (string value) { throw null; }
        public static bool operator !=(Azure.ResourceManager.Communication.Models.ActionType left, Azure.ResourceManager.Communication.Models.ActionType right) { throw null; }
        public override string ToString() { throw null; }
    }
    public partial class CommunicationServiceKeys
    {
        internal CommunicationServiceKeys() { }
        public string PrimaryConnectionString { get { throw null; } }
        public string PrimaryKey { get { throw null; } }
        public string SecondaryConnectionString { get { throw null; } }
        public string SecondaryKey { get { throw null; } }
    }
    public partial class CommunicationServiceResource : Azure.ResourceManager.Communication.Models.Resource
    {
        public CommunicationServiceResource() { }
        public string DataLocation { get { throw null; } set { } }
        public string HostName { get { throw null; } }
        public string ImmutableResourceId { get { throw null; } }
        public string Location { get { throw null; } set { } }
        public string NotificationHubId { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.ProvisioningState? ProvisioningState { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.SystemData SystemData { get { throw null; } }
        public System.Collections.Generic.IDictionary<string, string> Tags { get { throw null; } }
        public string Version { get { throw null; } }
    }
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public readonly partial struct CreatedByType : System.IEquatable<Azure.ResourceManager.Communication.Models.CreatedByType>
    {
        private readonly object _dummy;
        private readonly int _dummyPrimitive;
        public CreatedByType(string value) { throw null; }
        public static Azure.ResourceManager.Communication.Models.CreatedByType Application { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.CreatedByType Key { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.CreatedByType ManagedIdentity { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.CreatedByType User { get { throw null; } }
        public bool Equals(Azure.ResourceManager.Communication.Models.CreatedByType other) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override bool Equals(object obj) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override int GetHashCode() { throw null; }
        public static bool operator ==(Azure.ResourceManager.Communication.Models.CreatedByType left, Azure.ResourceManager.Communication.Models.CreatedByType right) { throw null; }
        public static implicit operator Azure.ResourceManager.Communication.Models.CreatedByType (string value) { throw null; }
        public static bool operator !=(Azure.ResourceManager.Communication.Models.CreatedByType left, Azure.ResourceManager.Communication.Models.CreatedByType right) { throw null; }
        public override string ToString() { throw null; }
    }
    public partial class ErrorAdditionalInfo
    {
        internal ErrorAdditionalInfo() { }
        public object Info { get { throw null; } }
        public string Type { get { throw null; } }
    }
    public partial class ErrorDetail
    {
        internal ErrorDetail() { }
        public System.Collections.Generic.IReadOnlyList<Azure.ResourceManager.Communication.Models.ErrorAdditionalInfo> AdditionalInfo { get { throw null; } }
        public string Code { get { throw null; } }
        public System.Collections.Generic.IReadOnlyList<Azure.ResourceManager.Communication.Models.ErrorDetail> Details { get { throw null; } }
        public string Message { get { throw null; } }
        public string Target { get { throw null; } }
    }
    public enum KeyType
    {
        Primary = 0,
        Secondary = 1,
    }
    public partial class LinkedNotificationHub
    {
        internal LinkedNotificationHub() { }
        public string ResourceId { get { throw null; } }
    }
    public partial class LinkNotificationHubParameters
    {
        public LinkNotificationHubParameters(string resourceId, string connectionString) { }
        public string ConnectionString { get { throw null; } }
        public string ResourceId { get { throw null; } }
    }
    public partial class LocationResource
    {
        public LocationResource() { }
        public string Location { get { throw null; } set { } }
    }
    public partial class NameAvailability
    {
        internal NameAvailability() { }
        public string Message { get { throw null; } }
        public bool? NameAvailable { get { throw null; } }
        public string Reason { get { throw null; } }
    }
    public partial class NameAvailabilityParameters
    {
        public NameAvailabilityParameters(string type, string name) { }
        public string Name { get { throw null; } }
        public string Type { get { throw null; } }
    }
    public partial class Operation
    {
        internal Operation() { }
        public Azure.ResourceManager.Communication.Models.ActionType? ActionType { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.OperationDisplay Display { get { throw null; } }
        public bool? IsDataAction { get { throw null; } }
        public string Name { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.Origin? Origin { get { throw null; } }
    }
    public partial class OperationDisplay
    {
        internal OperationDisplay() { }
        public string Description { get { throw null; } }
        public string Operation { get { throw null; } }
        public string Provider { get { throw null; } }
        public string Resource { get { throw null; } }
    }
    public partial class OperationStatus
    {
        internal OperationStatus() { }
        public System.DateTimeOffset? EndTime { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.ErrorDetail Error { get { throw null; } }
        public string Id { get { throw null; } }
        public float? PercentComplete { get { throw null; } }
        public System.DateTimeOffset? StartTime { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.Status? Status { get { throw null; } }
    }
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public readonly partial struct Origin : System.IEquatable<Azure.ResourceManager.Communication.Models.Origin>
    {
        private readonly object _dummy;
        private readonly int _dummyPrimitive;
        public Origin(string value) { throw null; }
        public static Azure.ResourceManager.Communication.Models.Origin System { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Origin User { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Origin UserSystem { get { throw null; } }
        public bool Equals(Azure.ResourceManager.Communication.Models.Origin other) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override bool Equals(object obj) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override int GetHashCode() { throw null; }
        public static bool operator ==(Azure.ResourceManager.Communication.Models.Origin left, Azure.ResourceManager.Communication.Models.Origin right) { throw null; }
        public static implicit operator Azure.ResourceManager.Communication.Models.Origin (string value) { throw null; }
        public static bool operator !=(Azure.ResourceManager.Communication.Models.Origin left, Azure.ResourceManager.Communication.Models.Origin right) { throw null; }
        public override string ToString() { throw null; }
    }
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public readonly partial struct ProvisioningState : System.IEquatable<Azure.ResourceManager.Communication.Models.ProvisioningState>
    {
        private readonly object _dummy;
        private readonly int _dummyPrimitive;
        public ProvisioningState(string value) { throw null; }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Canceled { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Creating { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Deleting { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Failed { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Moving { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Running { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Succeeded { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Unknown { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.ProvisioningState Updating { get { throw null; } }
        public bool Equals(Azure.ResourceManager.Communication.Models.ProvisioningState other) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override bool Equals(object obj) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override int GetHashCode() { throw null; }
        public static bool operator ==(Azure.ResourceManager.Communication.Models.ProvisioningState left, Azure.ResourceManager.Communication.Models.ProvisioningState right) { throw null; }
        public static implicit operator Azure.ResourceManager.Communication.Models.ProvisioningState (string value) { throw null; }
        public static bool operator !=(Azure.ResourceManager.Communication.Models.ProvisioningState left, Azure.ResourceManager.Communication.Models.ProvisioningState right) { throw null; }
        public override string ToString() { throw null; }
    }
    public partial class RegenerateKeyParameters
    {
        public RegenerateKeyParameters() { }
        public Azure.ResourceManager.Communication.Models.KeyType? KeyType { get { throw null; } set { } }
    }
    public partial class Resource
    {
        public Resource() { }
        public string Id { get { throw null; } }
        public string Name { get { throw null; } }
        public string Type { get { throw null; } }
    }
    [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
    public readonly partial struct Status : System.IEquatable<Azure.ResourceManager.Communication.Models.Status>
    {
        private readonly object _dummy;
        private readonly int _dummyPrimitive;
        public Status(string value) { throw null; }
        public static Azure.ResourceManager.Communication.Models.Status Canceled { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Status Creating { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Status Deleting { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Status Failed { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Status Moving { get { throw null; } }
        public static Azure.ResourceManager.Communication.Models.Status Succeeded { get { throw null; } }
        public bool Equals(Azure.ResourceManager.Communication.Models.Status other) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override bool Equals(object obj) { throw null; }
        [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
        public override int GetHashCode() { throw null; }
        public static bool operator ==(Azure.ResourceManager.Communication.Models.Status left, Azure.ResourceManager.Communication.Models.Status right) { throw null; }
        public static implicit operator Azure.ResourceManager.Communication.Models.Status (string value) { throw null; }
        public static bool operator !=(Azure.ResourceManager.Communication.Models.Status left, Azure.ResourceManager.Communication.Models.Status right) { throw null; }
        public override string ToString() { throw null; }
    }
    public partial class SystemData
    {
        internal SystemData() { }
        public System.DateTimeOffset? CreatedAt { get { throw null; } }
        public string CreatedBy { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.CreatedByType? CreatedByType { get { throw null; } }
        public System.DateTimeOffset? LastModifiedAt { get { throw null; } }
        public string LastModifiedBy { get { throw null; } }
        public Azure.ResourceManager.Communication.Models.CreatedByType? LastModifiedByType { get { throw null; } }
    }
    public partial class TaggedResource
    {
        public TaggedResource() { }
        public System.Collections.Generic.IDictionary<string, string> Tags { get { throw null; } }
    }
}


text:
import libegomotion

def main(job_id, params):
    print 'Job #%d' % job_id
    print params
    loss = libegomotion.run(
        "/home/kivan/source/cv-stereo/config_files/config_kitti_00.txt",
        int(params['patch_size'][0]), int(params['num_levels'][0]),
        float(params['scale_factor'][0]), int(params['max_dist_stereo'][0]),
        int(params['max_dist_mono'][0]))
    print loss
    return loss

redpajama_set_name: RedPajamaGithub


text:
from __future__ import unicode_literals
from datetime import timedelta
from workalendar.core import WesternCalendar, ChristianMixin
from workalendar.registry import iso_register

@iso_register('CY')
class Cyprus(WesternCalendar, ChristianMixin):
    name = 'Cyprus'

    include_epiphany = True
    include_clean_monday = True
    include_good_friday = True
    include_easter_saturday = True
    include_easter_sunday = True
    include_easter_monday = True
    include_whit_monday = True
    whit_monday_label = 'Pentecost Monday'
    include_christmas_eve = True
    include_christmas_day = True
    include_boxing_day = True

    FIXED_HOLIDAYS = WesternCalendar.FIXED_HOLIDAYS + (
        (3, 25, "Greek Independence Day"),
        (4, 1, "Cyprus National Day"),
        (5, 1, "Labour Day"),
        (7, 15, "Dormition of the Theotokos"),
        (10, 1, "Cyprus Independence Day"),
        (10, 28, "Greek National Day"),
    )

    def get_variable_days(self, year):
        days = super(Cyprus, self).get_variable_days(year)
        days.append((self.get_easter_monday(year) +
                     timedelta(days=1), "Easter Tuesday"))
        return days


text:
<!DOCTYPE html>
<html>
<head>
    <script type="text/javascript" src="/buildService/app/browser-polyfill.js"></script>
    <script type="text/javascript" src="/buildService/app/config.js"></script>
    <script type="text/javascript" src="/buildService/app/index.js"></script>
    <script type="text/javascript" src="app-fastopt.js"></script>
</head>
<body>
    <script>
        app.App().main();
    </script>
    Hello.
</body>
</html>


text:
void fd_hal_accelerometer_initialize(void) {
    fd_lis3dh_initialize();
}

void fd_hal_accelerometer_set_sample_callback(fd_hal_accelerometer_sample_callback_t callback) {
    fd_lis3dh_set_sample_callback(callback);
}

void fd_hal_accelerometer_sleep(void) {
    fd_lis3dh_sleep();
}

void fd_hal_accelerometer_wake(void) {
    fd_lis3dh_wake();
}

void fd_hal_accelerometer_read_fifo(void) {
    fd_lis3dh_read_fifo();
}

void fd_hal_accelerometer_read(int16_t *x, int16_t *y, int16_t *z) {
    fd_lis3dh_read(x, y, z);
}


text:
<menu xmlns:android="http://schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/action_browse"
        android:orderInCategory="100"
        android:showAsAction="always"
        android:title="@string/action_browse"/>
<!--     <item -->
<!--         android:id="@+id/action_debug" -->
<!--         android:orderInCategory="100" -->
<!--         android:showAsAction="always" -->
<!--         android:title="@string/action_debug"/> -->
    <item
        android:id="@+id/action_guide"
        android:orderInCategory="100"
        android:showAsAction="always"
        android:title="@string/action_guide"/>
</menu>


text:
var ExchangeOhlcQuotation = require("./exchange_ohlc_quotation")

function  ExchangeOhlcDescription( symbol, time, exchange_redis_store ) {
  //attr_accessor :quotations, :fields, :initial_values, :time, :exchange_redis_store
  //attr_accessor :symbol, :name, :digits, :field_price_index
  //attr_accessor :new_value, :last_settle, :open_value, :high_value, :low_value, :close_value
  //#          商品,最新, 涨跌, 开盘, 最高,最低, 收盘, 涨跌, 涨跌幅
  //# fields = [Name,Price,Arrow,Open,High,Low,Close,Fluctuatation,FluctuatationRate]
    this.symbol = symbol;
    this.quotations = [];
    this.time = time;

    this.exchange_redis_store = exchange_redis_store;

    this.initialize_fields = function( item ){
      this.symbol = item.symbol;
      console.log( "initial " + symbol + time.format("HH:mm:ss") );
      //logger.debug( "initial " + symbol + " " + this.new_value );
    }
}

ExchangeOhlcDescription.prototype.pushMessage = function (data, time ) {
  if( this.quotations.length == 0 )
  {
    this.initialize_fields( data )
  }

  {
      var new_quotation = new ExchangeOhlcQuotation( this, data, time )
      // limitate quotations 's size
      if( this.quotations.length> 3600 ){
        this.quotations.splice(0, 3600);
      }
      this.quotations.push( new_quotation )
      console.log( this.symbol + " " + time.format("HH:mm:ss") + " " + new_quotation.open );
      this.exchange_redis_store.store( new_quotation )

  }
}

module.exports = ExchangeOhlcDescription;

ExchangeOhlcDescription.prototype.constructor = ExchangeOhlcDescription; // make stacktraces readable


text:
--+ holdcas on;

create table t_basic005(i1 integer, i2 integer, i3 integer);
create index basic005_idx_one on t_basic005(i1);
create index basic005_idx_two on t_basic005(i2);
create index basic005_idx_one_two on t_basic005(i1, i2);
create index basic005_idx_two_three on t_basic005(i2, i3);
create index basic005_idx_one_three on t_basic005(i1, i3);
create index basic005_idx_all on t_basic005(i1, i2, i3);

insert into t_basic005 values (1, 3, 2), (1, 2, 3), (1, 1, 1);
insert into t_basic005 values (2, 3, 2), (2, 2, 3), (2, 1, 1);

commit;
update statistics on t_basic005;

select /*+ recompile */ i1 from t_basic005 where i1 < 4 order by 1;
select /*+ recompile */ * from t_basic005 where i1 < 4 order by 1,2,3;

select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one_two(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one_three(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_all(+) order by 1;

select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_two(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_two_three(+) order by 1;

select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+), basic005_idx_two(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+), basic005_idx_one_two(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+), basic005_idx_one_three(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+), basic005_idx_all(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1 < 4 using index basic005_idx_one(+), basic005_idx_two_three(+) order by 1;

select /*+ recompile */ i1 from t_basic005 where i1<4 using index basic005_idx_one, basic005_idx_one_two(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1<4 using index basic005_idx_one_two, basic005_idx_one_three(+) order by 1;
select /*+ recompile */ i1 from t_basic005 where i1<4 using index basic005_idx_one_three(+), basic005_idx_one_two order by 1;
select /*+ recompile */ i1 from t_basic005 where i1<4 using index basic005_idx_one_two, basic005_idx_all(+) order by 1;

drop index basic005_idx_one on t_basic005;
drop index basic005_idx_two on t_basic005;
drop index basic005_idx_one_two on t_basic005;
drop index basic005_idx_one_three on t_basic005;
drop index basic005_idx_two_three on t_basic005;
drop index basic005_idx_all on t_basic005;
drop table t_basic005;

commit;
--+ holdcas off;


text:
package de.bund.bva.isyfact.datetime.format;

import java.time.LocalDate;
import java.util.Arrays;
import java.util.Collection;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;

import static org.junit.Assert.assertEquals;

/**

 */
@RunWith(Parameterized.class)
public class InFormatParseToLocalDateTest {

    @Parameterized.Parameters(name = "{index}: parseToLocalDate({0}) => {1}")
    public static Collection<Object[]> data() {
        return Arrays.asList(
            new Object[][] { { "1.1.1", LocalDate.of(1, 1, 1) }, { "1.1.11", LocalDate.of(11, 1, 1) },
                { "1.1.111", LocalDate.of(111, 1, 1) }, { "1.1.1111", LocalDate.of(1111, 1, 1) },
                { "01.01.1", LocalDate.of(1, 1, 1) }, { "01.01.11", LocalDate.of(11, 1, 1) },
                { "01.01.111", LocalDate.of(111, 1, 1) }, { "01.01.1111", LocalDate.of(1111, 1, 1) } });
    }

    @Parameterized.Parameter
    public String input;

    @Parameterized.Parameter(1)
    public LocalDate expected;

    @Test
    public void parseToLocalDate() throws Exception {
        assertEquals(expected, InFormat.parseToLocalDate(input));
    }
}


text:
var gotoLabels= {};
var whileLabels = {};

// overload the original Selenium reset function
Selenium.prototype.reset = function() {
    // reset the labels
    this.initialiseLabels();
    // proceed with original reset code
    this.defaultTimeout = Selenium.DEFAULT_TIMEOUT;
    this.browserbot.selectWindow("null");
    this.browserbot.resetPopups();
}

/*
This toolkit is the work of Andrey Yegorov & Darren DeRidder of the Ottawa office of Kindsight

Dave Hunt packaged it into a FireFox plugin

The ForEach stuff at the bottom below the separator is a contribution by Martin H. Bramwell, 2011/11
*/

var forEachLabels = {}; // mhb:20111107

/*
* --- Initialize Conditional Elements --- *
* Run through the script collecting line numbers of all conditional elements
* There are three a results arrays: goto labels, while pairs and forEach pairs
*
*/
Selenium.prototype.initialiseLabels = function()
{
    gotoLabels = {};
    whileLabels = { ends: {}, whiles: {} };
    forEachLabels = { forends: {}, fors: {} }; // mhb:20111107
    var command_rows = [];
    var numCommands = testCase.commands.length;
    for (var i = 0; i < numCommands; ++i) {
        var x = testCase.commands[i];
        command_rows.push(x);
    }
    var cycles = [];
    var forEachCmds = [];
    for( var i = 0; i < command_rows.length; i++ ) {
        if (command_rows[i].type == 'command')
        switch( command_rows[i].command.toLowerCase() ) {
            case "label":
                gotoLabels[ command_rows[i].target ] = i;
                break;
            case "while":
            case "endwhile":
                cycles.push( [command_rows[i].command.toLowerCase(), i] )
                break;
            case "storefor":
            case "endfor":
                forEachCmds.push( [command_rows[i].command.toLowerCase(), i] )
                break;
        }
    }
    var i = 0;
    while( cycles.length ) {
        if( i >= cycles.length ) {
            throw new Error( "non-matching while/endWhile found" );
        }
        switch( cycles[i][0] ) {
            case "while":
                if( ( i+1 < cycles.length ) && ( "endwhile" == cycles[i+1][0] ) ) {
                    // pair found
                    whileLabels.ends[ cycles[i+1][1] ] = cycles[i][1];
                    whileLabels.whiles[ cycles[i][1] ] = cycles[i+1][1];
                    cycles.splice( i, 2 );
                    i = 0;
                } else ++i;
                break;
            case "endwhile":
                ++i;
                break;
        }
    }

/* ---- mhb: 20111107 --- begin --- */
    var idxFE = 0;
    while( forEachCmds.length ) {
        if( idxFE >= forEachCmds.length ) {
            throw new Error( "non-matching storeFor/endFor found" );
        }
        switch( forEachCmds[idxFE][0] ) {
            case "storefor":
                if( ( idxFE+1 < forEachCmds.length ) && ("endfor" == forEachCmds[idxFE+1][0]) ) {
                    // pair found
                    forEachLabels.forends[ forEachCmds[idxFE+1][1] ] = forEachCmds[idxFE][1];
                    forEachLabels.fors[ forEachCmds[idxFE][1] ] = forEachCmds[idxFE+1][1];
                    forEachCmds.splice( idxFE, 2 );
                    idxFE = 0;
                } else ++idxFE;
                break;
            case "endfor":
                ++idxFE;
                break;
        }
    }
/* ---- mhb: 20111107 --- end --- */

}

Selenium.prototype.continueFromRow = function( row_num )
{
    if(row_num == undefined || row_num == null || row_num < 0) {
        throw new Error( "Invalid row_num specified." );
    }
    testCase.debugContext.debugIndex = row_num;
}

// do nothing. simple label
Selenium.prototype.doLabel = function(){};

Selenium.prototype.doGotolabel = function( label )
{
    if( undefined == gotoLabels[label] ) {
        throw new Error( "Specified label '" + label + "' is not found." );
    }
    this.continueFromRow( gotoLabels[ label ] );
};

Selenium.prototype.doGoto = Selenium.prototype.doGotolabel;

Selenium.prototype.doGotoIf = function( condition, label )
{
    if( eval(condition) ) this.doGotolabel( label );
}

Selenium.prototype.doWhile = function( condition )
{
    if( !eval(condition) ) {
        var last_row = testCase.debugContext.debugIndex;
        var end_while_row = whileLabels.whiles[ last_row ];
        if( undefined == end_while_row ) throw new Error( "Corresponding 'endWhile' is not found." );
        this.continueFromRow( end_while_row );
    }
}

Selenium.prototype.doEndWhile = function()
{
    var last_row = testCase.debugContext.debugIndex;
    var while_row = whileLabels.ends[ last_row ] - 1;
    if( undefined == while_row ) throw new Error( "Corresponding 'While' is not found." );
    this.continueFromRow( while_row );
}

/* ------- ForEach looping Contributed by Martin "Hasan" Bramwell 2011/11/07 ------- */

/*
* Note. I'm neither a JavaScript nor a Selenium pro.
* There are surely some nice fix-ups that a real expert would spot in a minute.
* If you have an idea of a better way please let me know.
* Some 'nice-to-have' ideas :
* -- a 'For' command instead of a 'storeFor' command
* -- nested ForEach
* --
*/

var iteratorsMap = {};
var collectionsMap = {};

Selenium.prototype.getFor = function( _nameCollection )
{

if( eval(iteratorsMap[_nameCollection].hasNext()) ) {
return iteratorsMap[_nameCollection].next();
} else {
var last_foreach_row = testCase.debugContext.debugIndex;
var end_for_row = forEachLabels.fors[ last_foreach_row ];
if( undefined == end_for_row ) throw new Error( "Corresponding 'endFor' could not be found." );
this.continueFromRow( end_for_row );
}
}

Selenium.prototype.doEndFor = function()
{
var last_foreach_row = testCase.debugContext.debugIndex;
var for_row = forEachLabels.forends[ last_foreach_row ] - 1;
if( undefined == for_row ) throw new Error( "Corresponding 'storeFor' could not be found." );
this.continueFromRow( for_row );
}

Selenium.prototype.doAddToCollection = function(_nameCollection, _valueToStore) {
var initialized = true;

if ((iteratorsMap == undefined) || (collectionsMap == undefined)) initialized = false;

if (collectionsMap[_nameCollection] == undefined) initialized = false;

if (!initialized) throw new Error( "You must first call '|addCollection | " + _nameCollection + "||' in order to initialize it." );

collectionsMap[_nameCollection].add(_valueToStore);
iteratorsMap[_nameCollection] = collectionsMap[_nameCollection].iterator();

};

Selenium.prototype.doAddCollection = function(_nameCollection) {

if (iteratorsMap == undefined) {
iteratorsMap = new Array();
}

if (collectionsMap == undefined) {
collectionsMap = new Array();
}

collectionsMap[_nameCollection] = new Collection(new Array());

};

function Iterator(_collection)
{
var privateCollection = _collection;
var total = privateCollection.length;
var cursor = 0;

function doNext() {
return privateCollection[cursor++];
}

function doHasNext() { return cursor < total; }
function doRemainderCount() { return total - cursor; }

this.next = doNext;
this.hasNext = doHasNext;
this.remainderCount = doRemainderCount;

}

function Collection(_collection)
{
var privateCollection = _collection;

function doSize() { return privateCollection.length; }
this.size = doSize;

function doIterator() {
return new Iterator(privateCollection);
}

function doAdd(_value) {
privateCollection[privateCollection.length] = _value;
}

this.iterator = doIterator;
this.add = doAdd;

}

//Timer extension

var globalTime = new Object();
Selenium.prototype.doTimerStart = function(target) {
 var dt1 = new Date();
 if (target == null || target == "")
 {
  LOG.info ("Target not present so timer was not started");
 } else {
  globalTime[target] = dt1;
 }
 delete dt1;
};
Selenium.prototype.doTimerStop = function(target) {
 var dt = new Date();
 if (target == null || target == "")
 {
  LOG.info ("Please specify a target");
 } else if (globalTime [target] == null) {
  LOG.info ("Start time was not called for " + target);
 } else {
   LOG.info ("Time Passed for " + target + " : " + Math.floor (dt - globalTime[target]));
  delete globalTime[target]; }
 delete dt;
};

Selenium.prototype.doDisplayCurrentPageLoadTime = function(target) {
 var dt = new Date();
 if (target == null || target == "")
 {
  LOG.info ("Please specify a target");
 } else if (globalTime [target] == null) {
  LOG.info ("Start time was not called for " + target);
 } else {
	  var location = this.page().getCurrentWindow().location;
   LOG.info ("URL: " + location + " " + Math.floor (dt - globalTime[target]));
  delete globalTime[target]; }
 delete dt;
};

Selenium.prototype.doTypeTelerikControls = function (locator, value) {

var element = this.page().findElement(locator);
var script = "$find('" + element.getAttribute('id') + "').set_value('" + value + "')";

try {
this.browserbot.getCurrentWindow().eval(script);
}
catch (e) {
throw new SeleniumError("Threw an exception: " + e.message);
}

};

//
// Locates an element by a partial match on id
//
PageBot.prototype.locateElementByPartialId = function(text, inDocument) {
    return this.locateElementByXPath("//*[contains(./@id, 'Z')][1]".replace(/Z/,text), inDocument);
};

//
// Custom type for Telerik Rad Text Box Controls
//
Selenium.prototype.doTypeTelerikRadTextBox = function (locator, value) {

    var element = this.page().findElement(locator);
    var script = "$find('" + element.getAttribute('id') + "').set_value('" + value + "')";

    try {
        this.browserbot.getCurrentWindow().eval(script);
    }
    catch (e) {
        throw new SeleniumError("Threw an exception: " + e.message);
    }

};

//
// Custom type for Telerik Rad Date Picker Controls
//Or use these commands:
// $find('ctl05_adminControlStatus_adminControlClosedDateField_dfClosedDate_rdpFieldDate_dateInput').set_selectedDate(new Date('2012-03-27'));
//

//	runScript
//	$find('rwOpportunityWizard').get_contentFrame().contentWindow.$find('ctl05_adminControlStatus_adminControlClosedDateField_dfClosedDate_rdpFieldDate_dateInput').set_selectedDate(new Date('2011-10-07'));
//	2011-10-07
//

Selenium.prototype.doTypeTelerikRadDatePicker = function (locator, value) {

    var element = this.page().findElement(locator);
    var script = "$find('" + element.getAttribute('id') + "').set_selectedDate(new Date('"+ value + "'));";

    try
	{
        this.browserbot.getCurrentWindow().eval(script);
    }
    catch (e)
	{
        throw new SeleniumError("Threw an exception: " + e.message);
    }

};

//
// Custom type for Telerik Rad Numeric text Box Controls
//
Selenium.prototype.doTypeTelerikRadNumericTextBox = function (locator, value) {
	var iFrame = "rwOpportunityWizard";
    var element = this.page().findElement(locator);
    var script ="$find('" + element.getAttribute('id') + "').set_value('" + value + "')";

    try
	{
        this.browserbot.getCurrentWindow().eval(script);
    }
    catch (e)
	{
        throw new SeleniumError("Threw an exception: " + e.message);
    }

};


text:
<?php

namespace Symfony\Component\VarDumper\Caster;

use Symfony\Component\VarDumper\Cloner\Stub;

/**
 * Helper for filtering out properties in casters.
 *
 * @author Nicolas Grekas <p@tchwork.com>
 *
 * @final
 */
class Caster
{
    const EXCLUDE_VERBOSE = 1;
    const EXCLUDE_VIRTUAL = 2;
    const EXCLUDE_DYNAMIC = 4;
    const EXCLUDE_PUBLIC = 8;
    const EXCLUDE_PROTECTED = 16;
    const EXCLUDE_PRIVATE = 32;
    const EXCLUDE_NULL = 64;
    const EXCLUDE_EMPTY = 128;
    const EXCLUDE_NOT_IMPORTANT = 256;
    const EXCLUDE_STRICT = 512;

    const PREFIX_VIRTUAL = "\0~\0";
    const PREFIX_DYNAMIC = "\0+\0";
    const PREFIX_PROTECTED = "\0*\0";

    /**
     * Casts objects to arrays and adds the dynamic property prefix.
     *
     * @param object $obj          The object to cast
     * @param string $class        The class of the object
     * @param bool   $hasDebugInfo Whether the __debugInfo method exists on $obj or not
     *
     * @return array The array-cast of the object, with prefixed dynamic properties
     */
    public static function castObject($obj, $class, $hasDebugInfo = false)
    {
        if ($hasDebugInfo) {
            $a = $obj->__debugInfo();
        } elseif ($obj instanceof \Closure) {
            $a = array();
        } else {
            $a = (array) $obj;
        }
        if ($obj instanceof \__PHP_Incomplete_Class) {
            return $a;
        }

        if ($a) {
            static $publicProperties = array();

            $i = 0;
            $prefixedKeys = array();
            foreach ($a as $k => $v) {
                if (isset($k[0]) ? "\0" !== $k[0] : \PHP_VERSION_ID >= 70200) {
                    if (!isset($publicProperties[$class])) {
                        foreach (get_class_vars($class) as $prop => $v) {
                            $publicProperties[$class][$prop] = true;
                        }
                    }
                    if (!isset($publicProperties[$class][$k])) {
                        $prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
                    }
                } elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) {
                    $prefixedKeys[$i] = "\0".get_parent_class($class).'@anonymous'.strrchr($k, "\0");
                }
                ++$i;
            }
            if ($prefixedKeys) {
                $keys = array_keys($a);
                foreach ($prefixedKeys as $i => $k) {
                    $keys[$i] = $k;
                }
                $a = array_combine($keys, $a);
            }
        }

        return $a;
    }

    /**
     * Filters out the specified properties.
     *
     * By default, a single match in the $filter bit field filters properties out, following an "or" logic.
     * When EXCLUDE_STRICT is set, an "and" logic is applied: all bits must match for a property to be removed.
     *
     * @param array    $a                The array containing the properties to filter
     * @param int      $filter           A bit field of Caster::EXCLUDE_* constants specifying which properties to filter out
     * @param string[] $listedProperties List of properties to exclude when Caster::EXCLUDE_VERBOSE is set, and to preserve when Caster::EXCLUDE_NOT_IMPORTANT is set
     * @param int      &$count           Set to the number of removed properties
     *
     * @return array The filtered array
     */
    public static function filter(array $a, $filter, array $listedProperties = array(), &$count = 0)
    {
        $count = 0;

        foreach ($a as $k => $v) {
            $type = self::EXCLUDE_STRICT & $filter;

            if (null === $v) {
                $type |= self::EXCLUDE_NULL & $filter;
                $type |= self::EXCLUDE_EMPTY & $filter;
            } elseif (false === $v || '' === $v || '0' === $v || 0 === $v || 0.0 === $v || array() === $v) {
                $type |= self::EXCLUDE_EMPTY & $filter;
            }
            if ((self::EXCLUDE_NOT_IMPORTANT & $filter) && !\in_array($k, $listedProperties, true)) {
                $type |= self::EXCLUDE_NOT_IMPORTANT;
            }
            if ((self::EXCLUDE_VERBOSE & $filter) && \in_array($k, $listedProperties, true)) {
                $type |= self::EXCLUDE_VERBOSE;
            }

            if (!isset($k[1]) || "\0" !== $k[0]) {
                $type |= self::EXCLUDE_PUBLIC & $filter;
            } elseif ('~' === $k[1]) {
                $type |= self::EXCLUDE_VIRTUAL & $filter;
            } elseif ('+' === $k[1]) {
                $type |= self::EXCLUDE_DYNAMIC & $filter;
            } elseif ('*' === $k[1]) {
                $type |= self::EXCLUDE_PROTECTED & $filter;
            } else {
                $type |= self::EXCLUDE_PRIVATE & $filter;
            }

            if ((self::EXCLUDE_STRICT & $filter) ? $type === $filter : $type) {
                unset($a[$k]);
                ++$count;
            }
        }

        return $a;
    }

    public static function castPhpIncompleteClass(\__PHP_Incomplete_Class $c, array $a, Stub $stub, $isNested)
    {
        if (isset($a['__PHP_Incomplete_Class_Name'])) {
            $stub->class .= '('.$a['__PHP_Incomplete_Class_Name'].')';
            unset($a['__PHP_Incomplete_Class_Name']);
        }

        return $a;
    }
}


text:
var expect  = require('code').expect;
var Lab     = require('lab');
var lab     = exports.lab = Lab.script();
var Server  = require('../lib/server');

lab.experiment('server', function () {

  lab.test('should load server without errors', function (done) {

    Server.inject({
      method: 'GET',
      url: '/test'
    }, function (res) {
      expect(res.statusCode).to.equal(404);
      done();
    });
  });
});


text:
<bill session="111" type="h" number="1042" updated="2009-03-07T11:51:18-05:00">
	<status><introduced date="1234414800" datetime="2009-02-12"/></status>

	<introduced date="1234414800" datetime="2009-02-12"/>
	<titles>
		<title type="official" as="introduced">To prohibit the provision of medical treatment to enemy combatants detained by the United States at Naval Station, Guantanamo Bay, Cuba, in the same facility as a member of the Armed Forces or Department of Veterans Affairs medical facility.</title>
	</titles>
	<sponsor id="400279"/>
	<cosponsors>
		<cosponsor id="400086" joined="2009-02-12"/>
		<cosponsor id="400627" joined="2009-02-12"/>
		<cosponsor id="400057" joined="2009-02-12"/>
		<cosponsor id="400077" joined="2009-02-12"/>
		<cosponsor id="412311" joined="2009-02-12"/>
		<cosponsor id="400433" joined="2009-02-12"/>
		<cosponsor id="400141" joined="2009-02-12"/>
		<cosponsor id="412255" joined="2009-03-04"/>
	</cosponsors>
	<actions>
		<action date="1234414800" datetime="2009-02-12"><text>Referred to the Committee on Armed Services, and in addition to the Committee on Veterans' Affairs, for a period to be subsequently determined by the Speaker, in each case for consideration of such provisions as fall within the jurisdiction of the committee concerned.</text></action>
		<action date="1234414800" datetime="2009-02-12"><text>Referred to House Armed Services</text></action>
		<action date="1234414800" datetime="2009-02-12"><text>Referred to House Veterans' Affairs</text></action>
		<action date="1234414800" datetime="2009-02-12"><committee name="House Veterans' Affairs"/><text>Referred to the Subcommittee on Health.</text></action>
	</actions>
	<committees>
		<committee name="House Armed Services" subcommittee="" activity="Referral, In Committee" />
		<committee name="House Veterans' Affairs" subcommittee="" activity="Referral, In Committee" />
		<committee name="House Veterans' Affairs" subcommittee="Health" activity="Referral" />
	</committees>
	<relatedbills>

	</relatedbills>
	<subjects>

	</subjects>
	<amendments>

	</amendments>

	2/12/2009--Introduced.
Prohibits an enemy combatant detained by the United States at Naval Station Guantanamo Bay, Cuba, from receiving medical treatment at: (1) a military medical facility of the Department of Defense (DOD) that provides medical treatment to members of the Armed Forces; or (2) a medical facility of the Department of Veterans Affairs (VA).

</bill>


text:
    <smart-table rows="gridData" columns="gridColumns"
                 config="gridConfig"
                 class="table table-hover"></smart-table>


text:
import 'should'

import app from '../src'
import fs from 'fs'
import path from 'path'
import request from 'supertest'

describe('HTTP APP TEST', () => {
    describe('Koa GET /', () => {
        it('should 200', (done) => {
            request(app.listen())
                .get('/')
                .set('Accept', 'application/text')
                .expect('Content-Type', /text/)
                .end((err, res) => {
                    if (err) {
                        throw new Error(err)
                    }
                    // console.log(res)
                    res.status.should.equal(200)
                        // console.log(res.text)
                    res.text.should.equal("<!DOCTYPE html>\n\n  \n    <title>koa2 title</title>\n    <link rel='stylesheet' href='/static/stylesheets/style.css' />\n  \n  \n
koa2 title
\n
EJS Welcome to koa2 title
\n  \n\n")
                    done()
                })
        })
    })

    describe('Koa Static, GET /static/stylesheets/style.css', () => {
        it('should 200', (done) => {
            const styleCssContent = fs.readFileSync(path.join(__dirname, '../public/static/stylesheets/style.css'), 'utf-8')
            request(app.listen())
                .get('/static/stylesheets/style.css')
                .set('Accept', 'application/text')
                .expect('Content-Type', /text/)
                .end((err, res) => {
                    if (err) {
                        throw new Error(err)
                    }
                    // console.log(res)
                    res.status.should.equal(200)
                        // console.log(res.text)
                    res.text.should.equal(styleCssContent)
                    done()
                })
        })
    })

    describe('GET /pathNotMatchAny', () => {
        it('should 404', (done) => {
            request(app.listen())
                .get('/pathNotMatchAny')
                .set('Accept', 'application/text')
                .expect('Content-Type', /text/)
                .end((err, res) => {
                    if (err) {
                        throw new Error(err)
                    }
                    // console.log(res)
                    res.status.should.equal(404)
                    done()
                })
        })
    })
})


text:
@extends('newsages.admin::layout')

@section('header')

	  {{ trans('newsages::user.register') }}

@endsection

@section('content')
<form method="POST" action="{{ route('admin.users.store') }}" accept-charset="UTF-8">
	{!! Form::token() !!}

has('name') ? ' has-error' : '' }}">
	    <input type="text" class="form-control" name="name" value="{{ old('name') }}"
        placeholder=" {{ trans('newsages::user.name') }}" >
        {!! $errors->first('name', '
:message
') !!}

has('email') ? ' has-error' : '' }}">
        <input type="text" class="form-control" name="email" value="{{ old('email') }}"
        placeholder= "{{ trans('newsages::user.email_address') }}">
        {!! $errors->first('email', '
:message
') !!}

has('password') ? ' has-error' : '' }}">
        <input type="password" class="form-control" name="password"
        placeholder="{{ trans('newsages::user.password') }}">
        {!! $errors->first('password', '
:message
') !!}

has('password_confirmation') ? ' has-error' : '' }}">
        <input type="password" class="form-control" name="password_confirmation"
        placeholder="{{ trans('newsages::user.confirm_password') }}">
        {!! $errors->first('password_confirmation', '
:message
') !!}

has('credits') ? ' has-error' : '' }}">
        <input type="number" min="0" step="1" class="form-control" name="credits"
        placeholder="{{ trans('newsages::user.credits') }}">
        {!! $errors->first('password', '
:message
') !!}

		{{ Form::select('role', $roles,null,array('class' => 'form-control btn-primary')) }}

        <button type="submit" class="btn btn-primary">
            {{trans('newsages::user.add')}}
        </button>

			{{trans('newsages::user.cancel')}}

</form>

@endsection


text:
describe("insertHTML", function() {

	it("Library is defined", function() {
		expect(insertHTML).not.to.be.undefined;
	});

	it("HTML can be copied given an element", function() {

		var div = document.createElement("div");

		insertHTML("example/template1.html", div);

		expect(div.innerHTML).not.to.equal("");
		expect(div.children.length).to.equal(1);

		if(div.children.length) {
			expect(div.children[0].children.length).to.equal(2);
			expect(div.children[0].children[1].innerHTML).to.equal("x");
		}
	});

	it("HTML can be copied given a selector", function() {

		document.body.innerHTML = document.body.innerHTML + "

";

		insertHTML("example/template1.html", "#qwerty");

		var div = document.getElementById("qwerty");

		expect(div.innerHTML).not.to.equal("");
		expect(div.children.length).to.equal(1);

		if(div.children.length) {
			expect(div.children[0].children.length).to.equal(2);
			expect(div.children[0].children[1].innerHTML).to.equal("x");
		}

	});

	it("HTML can be copied with a callback", function(done) {

		var div = document.createElement("div");

		// Lets use a different URL so the browser does not cache it.
		insertHTML("example/template2.html", div, function() {

			expect(div.innerHTML).to.equal("Hello");

			done();

		});

		expect(div.innerHTML).to.equal("");

	});

});


text:
@interface HCPLocalDevOptions()

@end

@implementation HCPLocalDevOptions

- (instancetype)init {
    self = [super init];
    if (self) {
        self.enabled = NO;
    }

    return self;
}

@end


text:
import unittest
import connection
from ssh_tunnelmanager import TunnelManager
from configmanager import ConfigManager, ConfigManagerError
from getpass import getpass
from kp import KeePassError, get_password

conn = None
master = None

def setUpModule():
	global master
	global conn
	print("SShTest")
	master = "test"
	try:
		conn = connection.Connection()
		conn.start()
	except ConnectionRefusedError:
		print("is ssh-shepherd running?")

def tearDownModule():
	conn.stop()

def connect_command_builder(connection, perm): # KeyValue
	try:
		command = connection["adress"] + "_" + connection["user"]+ "_" + \
			get_pass(connection["keepass"]) + "_" + str(connection["sshport"])  + "_" + str(connection["remoteport"]) + "_" + perm
		return command
	except (KeyError, KeePassError) as e:
		try:
			command = connection["adress"] + "_" + connection["user"]+ "_" + \
				connection["passwd"] + "_" + str(connection["sshport"])  + "_" + str(connection["remoteport"]) + "_" + perm
			return command
		except KeyError as e:
			raise KeePassError("No KP or Passwd")
	return command

def get_pass(alias):
		file = "test.kdb"
		if master == None:
			raise KeePassError("Master Password Not Set")
		try:
			return get_password(file, master, alias)
		except KeePassError as e:
			print (e)
			raise e

def create_command(server,perm):
	conf = ConfigManager("config/lista_test.yaml")
	connection =  conf.get(server)["connection"]
	try:
		cmd = connect_command_builder(connection,perm)
	except KeyError:
		cmd = None
	return cmd

def send_command(command):
	try:
		conn.send(command)
		t = None
		while t == None:
			t = conn.get_state()
		return t
	except AttributeError as e:
		print (e)

class SShTest(unittest.TestCase):

	def test1_connection_to_ssh_shepherd(self):
		self.assertIsNotNone(conn)

	def test8_invalid_ssh_port(self):
		cmd =  create_command("InvalidSSHPort","no")
		ans = send_command(cmd)
		status = ans.split("_")[0]
		self.assertEqual("bad", status)

	def test7_invalid_user_name(self):
		cmd =  create_command("InvalidUsername","no")
		ans = send_command(cmd)
		status = ans.split("_")[0]
		self.assertEqual("bad", status)

	def test3_should_be_ok(self):
		cmd =  create_command("ShouldBeOK","no")
		ans = send_command(cmd)
		status = ans.split("_")[0]
		self.assertEqual("ok", status)

	def test6_create_permanent(self):
		conf = ConfigManager("config/lista_test.yaml")
		connection =  conf.get("ShouldBeOK")["connection"]
		try:
			cmd = connect_command_builder(connection,"yes")
		except KeyError as e:
			self.fail("KeyError" + e)

		ans = send_command(cmd)
		status = ans.split("_")[0]
		if status != "ok":
			self.fail("Unable to create tunnel")

		to_find = connection["adress"] + ":" + str(connection["remoteport"])
		self.assertEqual(-1, ans.find(to_find,ans.find("perm")))

		dc = cmd.split("_")[0] + ":" + cmd.split("_")[4]
		ans = send_command("clean;" + dc)

	def test5_disconnect(self):
		conf = ConfigManager("config/lista_test.yaml")
		connection =  conf.get("ShouldBeOK")["connection"]
		try:
			cmd = connect_command_builder(connection,"no")
		except KeyError as e:
			self.fail("KeyError" + e)
		ans = send_command(cmd)
		status = ans.split("_")[0]
		if status != "ok":
			self.fail("Unable to create tunnel")
		dc = cmd.split("_")[0] + ":" + cmd.split("_")[4]
		ans = send_command("clean;" + dc)
		to_find = connection["adress"] + ":" + str(connection["remoteport"])
		self.assertEqual(-1, ans.find(to_find))

	def test4_list_command(self):
		conf = ConfigManager("config/lista_test.yaml")
		connection =  conf.get("ShouldBeOK")["connection"]
		try:
			cmd = connect_command_builder(connection,"no")
		except KeyError as e:
			self.fail("KeyError" + e)
		ans = send_command(cmd)
		status = ans.split("_")[0]

		if status != "ok":
			self.fail("Unable to create tunnel")

		ans = send_command("list")
		to_find = connection["adress"] + ":" + str(connection["remoteport"])
		self.assertNotEqual(-1, ans.find(to_find))

if __name__ == '__main__':
	unittest.main(verbosity=2)


text:
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>W28639_text</title>
        <link rel="stylesheet" type="text/css" href="style.css" />

                «

    <p class="styleSans12000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans1.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans19.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">

    <p class="styleSans670.0000<enum PANGO_WEIGHT_NORMAL of type PangoWeight><enum PANGO_STYLE_NORMAL of type PangoStyle>">EOG Resources ParshaII 92-28H
Section 28 T152N R90W Mountrail County, North Dakota
'35 itch Olson, (I , ellsite Geologist
NC NESET CONSULTING —' SERVICE
6844 Highway 40, Tioga ND, 58852 (701) 664-1492


text:
<!DOCTYPE html>

    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>Interface IRegistersExpressionEvaluator
   </title>
    <meta name="viewport" content="width=device-width">
    <meta name="title" content="Interface IRegistersExpressionEvaluator
   ">
    <meta name="generator" content="docfx 2.56.6.0">

    <link rel="shortcut icon" href="../favicon.ico">
    <link rel="stylesheet" href="../styles/docfx.vendor.css">
    <link rel="stylesheet" href="../styles/docfx.css">
    <link rel="stylesheet" href="../styles/main.css">
    <meta property="docfx:navrel" content="../toc.html">
    <meta property="docfx:tocrel" content="toc.html">

              <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar">
                Toggle navigation

              </button>

              <form class="navbar-form navbar-right" role="search" id="search">

                  <input type="text" class="form-control" id="search-query" placeholder="Search" autocomplete="off">

              </form>

          Show / Hide Table of Contents

Interface IRegistersExpressionEvaluator

An object which is used to register implementations of IEvaluatesExpression to be used
for specific expression types.

Namespace: ZptSharp.Expressions

Assembly: ZptSharp.Abstractions.dll

Syntax

public interface IRegistersExpressionEvaluator

Methods

    |
    Improve this Doc

    View Source

GetEvaluatorType(String)

Gets the evaluator type for the specified expressionType.

Declaration

Type GetEvaluatorType(string expressionType)

Parameters

        Type
        Name
        Description

        System.String
        expressionType

Expression type.

Returns

        Type
        Description

        System.Type

The evaluator type.

    |
    Improve this Doc

    View Source

GetRegisteredExpressionTypes()

Gets a collection of all of the registered expression types.

Declaration

IReadOnlyCollection<string> GetRegisteredExpressionTypes()

Returns

        Type
        Description

        System.Collections.Generic.IReadOnlyCollection<System.String>

The all registered types.

    |
    Improve this Doc

    View Source

IsRegistered(String)

Gets a value that indicates whether there is an evaluator type registered for
the specified expressionType.

Declaration

bool IsRegistered(string expressionType)

Parameters

        Type
        Name
        Description

        System.String
        expressionType

Expression type.

Returns

        Type
        Description

        System.Boolean

true, if an evaluator type is registered, false otherwise.

                    Improve this Doc

                    View Source

In This Article

              Back to top

            Generated by DocFX


text:
package com.orm;

import android.content.Context;
import android.database.SQLException;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteException;
import android.util.Log;
import com.orm.dsl.Column;
import com.orm.dsl.NotNull;
import com.orm.dsl.Unique;
import com.orm.util.NamingHelper;
import com.orm.util.NumberComparator;
import com.orm.util.QueryBuilder;
import com.orm.util.ReflectionUtil;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.lang.reflect.Field;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import static com.orm.util.ReflectionUtil.getDomainClasses;

public class SchemaGenerator {

    private Context context;

    public SchemaGenerator(Context context) {
        this.context = context;
    }

    public void createDatabase(SQLiteDatabase sqLiteDatabase) {
        List<Class> domainClasses = getDomainClasses(context);
        for (Class domain : domainClasses) {
            createTable(domain, sqLiteDatabase);
        }
    }

    public void doUpgrade(SQLiteDatabase sqLiteDatabase, int oldVersion, int newVersion) {
        List<Class> domainClasses = getDomainClasses(context);
        for (Class domain : domainClasses) {
            try {  // we try to do a select, if fails then (?) there isn't the table
                sqLiteDatabase.query(NamingHelper.toSQLName(domain), null, null, null, null, null, null);
            } catch (SQLiteException e) {
                Log.i("Sugar", String.format("Creating table on update (error was '%s')",
                        e.getMessage()));
                createTable(domain, sqLiteDatabase);
            }
        }
        executeSugarUpgrade(sqLiteDatabase, oldVersion, newVersion);
    }

    public void deleteTables(SQLiteDatabase sqLiteDatabase) {
        List<Class> tables = getDomainClasses(context);
        for (Class table : tables) {
            sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + NamingHelper.toSQLName(table));
        }
    }

    private boolean executeSugarUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        boolean isSuccess = false;

        try {
            List<String> files = Arrays.asList(this.context.getAssets().list("sugar_upgrades"));
            Collections.sort(files, new NumberComparator());
            for (String file : files) {
                Log.i("Sugar", "filename : " + file);

                try {
                    int version = Integer.valueOf(file.replace(".sql", ""));

                    if ((version > oldVersion) && (version <= newVersion)) {
                        executeScript(db, file);
                        isSuccess = true;
                    }
                } catch (NumberFormatException e) {
                    Log.i("Sugar", "not a sugar script. ignored." + file);
                }

            }
        } catch (IOException e) {
            Log.e("Sugar", e.getMessage());
        }

        return isSuccess;
    }

    private void executeScript(SQLiteDatabase db, String file) {
        try {
            InputStream is = this.context.getAssets().open("sugar_upgrades/" + file);
            BufferedReader reader = new BufferedReader(new InputStreamReader(is));
            String line;
            while ((line = reader.readLine()) != null) {
                Log.i("Sugar script", line);
                db.execSQL(line.toString());
            }
        } catch (IOException e) {
            Log.e("Sugar", e.getMessage());
        }

        Log.i("Sugar", "Script executed");
    }

    private void createTable(Class<?> table, SQLiteDatabase sqLiteDatabase) {
        Log.i("Sugar", "Create table");
        List<Field> fields = ReflectionUtil.getTableFields(table);
        String tableName = NamingHelper.toSQLName(table);
        StringBuilder sb = new StringBuilder("CREATE TABLE ");
        sb.append(tableName).append(" ( ID INTEGER PRIMARY KEY AUTOINCREMENT ");

        for (Field column : fields) {
            String columnName = NamingHelper.toSQLName(column);
            String columnType = QueryBuilder.getColumnType(column.getType());

            if (columnType != null) {
                if (columnName.equalsIgnoreCase("Id")) {
                    continue;
                }

                if (column.isAnnotationPresent(Column.class)) {
                    Column columnAnnotation = column.getAnnotation(Column.class);
                    columnName = columnAnnotation.name();

                    sb.append(", ").append(columnName).append(" ").append(columnType);

                    if (columnAnnotation.notNull()) {
                        if (columnType.endsWith(" NULL")) {
                            sb.delete(sb.length() - 5, sb.length());
                        }
                        sb.append(" NOT NULL");
                    }

                    if (columnAnnotation.unique()) {
                        sb.append(" UNIQUE");
                    }

                } else {
                    sb.append(", ").append(columnName).append(" ").append(columnType);

                    if (column.isAnnotationPresent(NotNull.class)) {
                        if (columnType.endsWith(" NULL")) {
                            sb.delete(sb.length() - 5, sb.length());
                        }
                        sb.append(" NOT NULL");
                    }

                    if (column.isAnnotationPresent(Unique.class)) {
                        sb.append(" UNIQUE");
                    }
                }
            }
        }

        sb.append(" ) ");
        Log.i("Sugar", "Creating table " + tableName);

        if (!"".equals(sb.toString())) {
            try {
                sqLiteDatabase.execSQL(sb.toString());
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

}


text:
<?php

namespace Junk\Bundle\GiftBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Junk\Bundle\GiftBundle\Entity\User;

/**
 * Event
 *
 * @ORM\Table(name="event")
 * @ORM\Entity(repositoryClass="Junk\Bundle\GiftBundle\Repository\EventRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class Event
{
    /**
     * @var int
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var \DateTime
     *
     * @ORM\Column(name="startdate", type="datetime")
     */
    private $startdate;

    /**
     * @var string
     *
     * @ORM\Column(name="name", type="string", length=255)
     */
    private $name;

    /**
     * @var string
     *
     * @ORM\Column(name="token", type="string", length=255)
     */
    private $token;

    /**
     * @var bool
     *
     * @ORM\Column(name="is_distributed", type="boolean")
     */
    private $isDistributed = false;

    /**
     * @var string
     *
     * @ORM\Column(name="shared_token", type="string", length=255)
     */
    private $sharedToken;

    /**
    * @var User
    *
    * @ORM\ManyToOne(targetEntity="User")
    */
    private $owner;

    public function getOwner(){
      return $this->owner;
    }

    public function setOwner($user){
      $this->owner = $user;
      return $this;
    }

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

    /**
     * Set startdate
     *
     * @param \DateTime $startdate
     *
     * @return Event
     */
    public function setStartdate($startdate)
    {
        $this->startdate = $startdate;

        return $this;
    }

    /**
     * Get startdate
     *
     * @return \DateTime
     */
    public function getStartdate()
    {
        return $this->startdate;
    }

    /**
     * Set name
     *
     * @param string $name
     *
     * @return Event
     */
    public function setName($name)
    {
        $this->name = $name;

        return $this;
    }

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

    /**
     * Set token
     *
     * @param string $token
     *
     * @return Event
     */
    public function setToken($token)
    {
        $this->token = $token;

        return $this;
    }

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

    /**
     * Set isDistributed
     *
     * @param boolean $isDistributed
     *
     * @return Event
     */
    public function setIsDistributed($isDistributed)
    {
        $this->isDistributed = $isDistributed;

        return $this;
    }

    /**
     * Get isDistributed
     *
     * @return bool
     */
    public function getIsDistributed()
    {
        return $this->isDistributed;
    }

    /**
     * Set sharedToken
     *
     * @param string $sharedToken
     *
     * @return Event
     */
    public function setSharedToken($sharedToken)
    {
        $this->sharedToken = $sharedToken;

        return $this;
    }

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

    /**
    * @ORM\PrePersist
    */
    public function prePersist(){
      $this->token = md5(time().rand(0,9999999));
      $this->sharedToken = md5(time().rand(0,9999999));
    }
}


text:
package org.openengsb.core.test;

import org.openengsb.core.api.Event;
import org.openengsb.core.api.model.annotation.Model;

@Model
public class NullEvent2 extends Event {
    private Object testProperty;

    public Object getTestProperty() {
        return testProperty;
    }

    public void setTestProperty(Object testProperty) {
        this.testProperty = testProperty;
    }
}


text:
package ironbreakowl;

import junit.framework.TestCase;

import java.util.Arrays;

public class NonStringArgumentBinderTest extends TestCase {
    public void testBind() {
        NonStringArgumentBinder binder = new NonStringArgumentBinder("a=? and b=?", new Object[] {"A", "B"},
                makeTrueArrays(2));
        assertEquals("a=? and b=?", binder.selection);
        assertEquals(2, binder.selectionArgs.length);
        assertEquals("A", binder.selectionArgs[0]);
        assertEquals("B", binder.selectionArgs[1]);

        binder = new NonStringArgumentBinder("a=? and b=?", new Object[] {1, "a"}, makeTrueArrays(2));
        assertEquals("a=1 and b=?", binder.selection);
        assertEquals(1, binder.selectionArgs.length);
        assertEquals("a", binder.selectionArgs[0]);

        binder = new NonStringArgumentBinder("a=? and b=? or c=?", new Object[] {"a", 1, "b"}, makeTrueArrays(3));
        assertEquals("a=? and b=1 or c=?", binder.selection);
        assertEquals(2, binder.selectionArgs.length);
        assertEquals("a", binder.selectionArgs[0]);
        assertEquals("b", binder.selectionArgs[1]);

        binder = new NonStringArgumentBinder("a=? and b=? and c=? and d=?", new Object[] {"a", true, false, 2},
                makeTrueArrays(4));
        assertEquals("a=? and b=1 and c=0 and d=2", binder.selection);
        assertEquals(1, binder.selectionArgs.length);
        assertEquals("a", binder.selectionArgs[0]);

        binder = new NonStringArgumentBinder("a='?' and b=?", new Object[] {2}, makeTrueArrays(1));
        assertEquals("a='?' and b=2", binder.selection);
        assertEquals(0, binder.selectionArgs.length);
    }

    private static boolean[] makeTrueArrays(int length) {
        boolean[] arrays = new boolean [length];
        Arrays.fill(arrays, true);
        return arrays;
    }
}


text:
class TreeNode:
    def __init__(self, x):
        self.val = x
        self.left = None
        self.right = None

class Solution:
    def upsideDownBinaryTree(self, root: TreeNode) -> TreeNode:
        if root is None:
            return None

        n_origin = root
        n_copied = TreeNode(root.val)

        while n_origin.left:
            new_node = TreeNode(n_origin.left.val)
            new_node.left = n_origin.right
            new_node.right = n_copied
            n_copied = new_node
            n_origin = n_origin.left

        return n_copied


text:
WPF Stopwatch Control

This is a simple WPF stopwatch control. It wraps a single Label control where the time is shown.
You can control the stopwatch with the Start(), Stop() and Pause() methods.


text:
namespace NLog.Targets.Wrappers
{
    using System.Collections.Generic;
    using System.Threading;
    using NLog.Common;

    ///
    /// Provides fallback-on-error.
    ///
    /// <seealso href="https://github.com/nlog/nlog/wiki/FallbackGroup-target">Documentation on NLog Wiki</seealso>
    /// <example>
    ///
This example causes the messages to be written to server1,
    /// and if it fails, messages go to server2.

    ///

    /// To set up the target in the configuration file,
    /// use the following syntax:
    ///

    ///
    ///

    /// The above examples assume just one target and a single rule. See below for
    /// a programmatic configuration that's equivalent to the above config file:
    ///

    ///
    /// </example>
    [Target("FallbackGroup", IsCompound = true)]
    public class FallbackGroupTarget : CompoundTargetBase
    {
        private long _currentTarget;

        ///
        /// Initializes a new instance of the <see cref="FallbackGroupTarget"/> class.
        ///
        public FallbackGroupTarget()
            : this(new Target[0])
        {
        }

        ///
        /// Initializes a new instance of the <see cref="FallbackGroupTarget"/> class.
        ///
        /// <param name="name">Name of the target.</param>
        /// <param name="targets">The targets.</param>
        public FallbackGroupTarget(string name, params Target[] targets)
            : this(targets)
        {
            Name = name;
        }

        ///
        /// Initializes a new instance of the <see cref="FallbackGroupTarget" /> class.
        ///
        /// <param name="targets">The targets.</param>
        public FallbackGroupTarget(params Target[] targets)
            : base(targets)
        {
        }

        ///
        /// Gets or sets a value indicating whether to return to the first target after any successful write.
        ///
        /// <docgen category='Fallback Options' order='10' />
        public bool ReturnToFirstOnSuccess { get; set; }

        ///
        /// Gets or sets whether to enable batching, but fallback will be handled individually
        ///
        /// <docgen category='Retrying Options' order='10' />
        public bool EnableBatchWrite { get; set; } = true;

        ///
        /// Forwards the log event to the sub-targets until one of them succeeds.
        ///
        /// <param name="logEvents">The log event.</param>
        protected override void WriteAsyncThreadSafe(IList<AsyncLogEventInfo> logEvents)
        {
            if (logEvents.Count == 1)
            {
                WriteAsyncThreadSafe(logEvents[0]);
            }
            else if (EnableBatchWrite)
            {
                var targetToInvoke = (int)Interlocked.Read(ref _currentTarget);

                for (int i = 0; i < logEvents.Count; ++i)
                {
                    logEvents[i] = WrapWithFallback(logEvents[i], targetToInvoke);
                }

                Targets[targetToInvoke].WriteAsyncLogEvents(logEvents);
            }
            else
            {
                for (int i = 0; i < logEvents.Count; ++i)
                {
                    WriteAsyncThreadSafe(logEvents[i]);
                }
            }
        }

        /// <inheritdoc/>
        protected override void WriteAsyncThreadSafe(AsyncLogEventInfo logEvent)
        {
            Write(logEvent);
        }

        ///
        /// Forwards the log event to the sub-targets until one of them succeeds.
        ///
        protected override void Write(AsyncLogEventInfo logEvent)
        {
            var targetToInvoke = (int)Interlocked.Read(ref _currentTarget);
            var result = WrapWithFallback(logEvent, targetToInvoke);
            Targets[targetToInvoke].WriteAsyncLogEvent(result);
        }

        private AsyncLogEventInfo WrapWithFallback(AsyncLogEventInfo logEvent, int targetToInvoke)
        {
            for (int i = 0; i < Targets.Count; ++i)
            {
                if (i != targetToInvoke)
                {
                    Targets[i].PrecalculateVolatileLayouts(logEvent.LogEvent);
                }
            }

            AsyncContinuation continuation = null;
            int tryCounter = 0;
            continuation = ex =>
            {
                if (ex is null)
                {
                    // success
                    if (ReturnToFirstOnSuccess)
                    {
#pragma warning disable S1066 // Collapsible "if" statements should be merged
                        if (Interlocked.Read(ref _currentTarget) != 0)
#pragma warning restore S1066 // Collapsible "if" statements should be merged
                        {
                            InternalLogger.Debug("{0}: Target '{1}' succeeded. Returning to the first one.", this, Targets[targetToInvoke]);
                            Interlocked.Exchange(ref _currentTarget, 0);
                        }
                    }

                    logEvent.Continuation(null);
                    return;
                }

                // failure
                InternalLogger.Warn(ex, "{0}: Target '{1}' failed. Proceeding to the next one.", this, Targets[targetToInvoke]);

                // error while writing, go to the next one
                tryCounter++;
                int nextTarget = (targetToInvoke + 1) % Targets.Count;
                Interlocked.CompareExchange(ref _currentTarget, nextTarget, targetToInvoke);
                if (tryCounter >= Targets.Count)
                {
                    targetToInvoke = -1;
                }
                else
                {
                    targetToInvoke = nextTarget;
                }

                if (targetToInvoke >= 0)
                {
                    Targets[targetToInvoke].WriteAsyncLogEvent(logEvent.LogEvent.WithContinuation(continuation));
                }
                else
                {
                    logEvent.Continuation(ex);
                }
            };

            return logEvent.LogEvent.WithContinuation(continuation);
        }
    }
}


text:
<?xml version="1.0" ?>
<xliff version="1.0">
  <file orginal="global" source-language="en" datatype="plaintext">
    <body>
      <trans-unit id="">
        <source>Title</source>
        <target>タイトル</target>
      </trans-unit>
      <trans-unit id="">
        <source>Body</source>
        <target>本文</target>
      </trans-unit>
      <trans-unit id="">
        <source>Created at</source>
        <target>作成日時</target>
      </trans-unit>
      <trans-unit id="">
        <source>Public</source>
        <target>全体に公開</target>
      </trans-unit>
      <trans-unit id="">
        <source>Post a diary</source>
        <target>日記を書く</target>
      </trans-unit>
      <trans-unit id="">
        <source>Edit the diary</source>
        <target>日記を編集する</target>
      </trans-unit>
      <trans-unit id="">
        <source>Edit this diary</source>
        <target>この日記を編集する</target>
      </trans-unit>
      <trans-unit id="">
        <source>Delete this diary</source>
        <target>この日記を削除する</target>
      </trans-unit>
      <trans-unit id="">
        <source>Recently Posted Diaries</source>
        <target>最新日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Recently Posted Diaries of %my_friend%</source>
        <target>%my_friend%最新日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diaries of %my_friend%</source>
        <target>%my_friend%の日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diaries of %1%</source>
        <target>%1%さんの日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary of %1%</source>
        <target>%1%さんの日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>There are no diaries.</source>
        <target>日記がありません。</target>
      </trans-unit>
      <trans-unit id="">
        <source>View this diary</source>
        <target>詳細を見る</target>
      </trans-unit>
      <trans-unit id="">
        <source>More</source>
        <target>もっと見る</target>
      </trans-unit>
      <trans-unit id="">
        <source>Save</source>
        <target>確定</target>
      </trans-unit>
      <trans-unit id="">
        <source>Photo 1</source>
        <target>写真1</target>
      </trans-unit>
      <trans-unit id="">
        <source>Photo 2</source>
        <target>写真2</target>
      </trans-unit>
      <trans-unit id="">
        <source>Photo 3</source>
        <target>写真3</target>
      </trans-unit>
      <trans-unit id="">
        <source>Required.</source>
        <target>必須項目です。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Comments</source>
        <target>コメント</target>
      </trans-unit>
      <trans-unit id="">
        <source>Post a diary comment</source>
        <target>コメントを書く</target>
      </trans-unit>
      <trans-unit id="">
        <source>Public flag</source>
        <target>公開範囲</target>
      </trans-unit>
      <trans-unit id="">
        <source>The diary was deleted successfully.</source>
        <target>日記を削除しました。</target>
      </trans-unit>
      <trans-unit id="">
        <source>[1]1 diary has new comments|(1,Inf]%1% diaries have new comments</source>
        <target>[1,Inf]%1% 件の日記に新着コメントがあります</target>
      </trans-unit>
      <trans-unit id="">
        <source>View %1% per page</source>
        <target>%1%件ずつ表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>View Latest</source>
        <target>最新を表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>View Oldest First</source>
        <target>最初から表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>Older</source>
        <target>前を表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>Newer</source>
        <target>次を表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>No. %1% - %2%</source>
        <target>%1%番~%2%番を表示</target>
      </trans-unit>
      <trans-unit id="">
        <source>Profile of %1%</source>
        <target>%1%さんのページ</target>
      </trans-unit>
      <trans-unit id="">
        <source>Recently Posted Diaries of All</source>
        <target>全体の最新日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>My Diaries</source>
        <target>自分の日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Previous Diary</source>
        <target>前の日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Next Diary</source>
        <target>次の日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>Delete the comment</source>
        <target>コメント削除</target>
      </trans-unit>
      <trans-unit id="">
        <source>Do you really delete this comment?</source>
        <target>本当にこのコメントを削除しますか?</target>
      </trans-unit>
      <trans-unit id="">
        <source>Go back to the diary page</source>
        <target>日記のページへ戻る</target>
      </trans-unit>
      <trans-unit id="">
        <source>The comment was deleted successfully.</source>
        <target>コメントを削除しました。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Delete the diary</source>
        <target>日記を削除する</target>
      </trans-unit>
      <trans-unit id="">
        <source>Do you really delete this diary?</source>
        <target>本当にこの日記を削除しますか?</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary Search</source>
        <target>日記検索</target>
      </trans-unit>
      <trans-unit id="">
        <source>Search Results</source>
        <target>検索結果</target>
      </trans-unit>
      <trans-unit id="">
        <source>Your search "%1%" did not match any diaries.</source>
        <target>「%1%」に一致する日記は見つかりませんでした。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary Comment History</source>
        <target>日記コメント記入履歴</target>
      </trans-unit>
      <trans-unit id="">
        <source>remove the current photo</source>
        <target>現在の画像を削除する</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary List</source>
        <target>日記リスト</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary Comment List</source>
        <target>日記コメントリスト</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary</source>
        <target>日記</target>
      </trans-unit>
      <trans-unit id="">
        <source>There are no diary comments.</source>
        <target>日記コメントがありません。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary Configuration</source>
        <target>日記設定</target>
      </trans-unit>
      <trans-unit id="">
        <source>Default public flag for your new diaries. Past diaries are not changed.</source>
        <target>日記を新しく書く際の公開範囲の初期値です。これまでに書かれた日記の公開範囲は変更されません。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Body is required.</source>
        <target>本文を入力してください。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Diary ID</source>
        <target>日記ID</target>
      </trans-unit>
      <trans-unit id="">
        <source>Your search "%1%" did not match any diary comments.</source>
        <target>「%1%」に一致する日記コメントは見つかりませんでした。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Your comment is visible to all users on the Web.</source>
        <target>この日記へのコメントはWeb全体に公開されます。</target>
      </trans-unit>
      <trans-unit id="">
        <source>[Diary] %1%</source>
        <target>[日記] %1%</target>
      </trans-unit>
      <trans-unit id="">
        <source>Read comment</source>
        <target>コメントを読む</target>
      </trans-unit>
      <trans-unit id="">
        <source>Please input 0 or greater.</source>
        <target>0以上の数字を入力してください。</target>
      </trans-unit>
      <trans-unit id="">
        <source>Cancel</source>
        <target>キャンセル</target>
      </trans-unit>
      <trans-unit id="">
        <source>less than 5 seconds ago</source>
        <target>5秒以内</target>
      </trans-unit>
      <trans-unit id="">
        <source>less than 10 seconds ago</source>
        <target>10秒以内</target>
      </trans-unit>
      <trans-unit id="">
        <source>less than 20 seconds ago</source>
        <target>20秒以内</target>
      </trans-unit>
      <trans-unit id="">
        <source>half a minute ago</source>
        <target>30秒以内</target>
      </trans-unit>
      <trans-unit id="">
        <source>less than a minute ago</source>
        <target>1分以内</target>
      </trans-unit>
      <trans-unit id="">
        <source>1 minute ago</source>
        <target>1分前</target>
      </trans-unit>
      <trans-unit id="">
        <source>%minutes% minutes ago</source>
        <target>%minutes%分前</target>
      </trans-unit>
      <trans-unit id="">
        <source>about 1 hour ago</source>
        <target>1時間前</target>
      </trans-unit>
      <trans-unit id="">
        <source>about %hours% hours ago</source>
        <target>%hours%時間前</target>
      </trans-unit>
      <trans-unit id="">
        <source>1 day ago</source>
        <target>1日前</target>
      </trans-unit>
      <trans-unit id="">
        <source>%days% days ago</source>
        <target>%days%日前</target>
      </trans-unit>
      <trans-unit id="">
        <source>about 1 month ago</source>
        <target>1ヶ月前</target>
      </trans-unit>
      <trans-unit id="">
        <source>%months% months ago</source>
        <target>%months%ヶ月前</target>
      </trans-unit>
      <trans-unit id="">
        <source>about 1 year ago</source>
        <target>1年前</target>
      </trans-unit>
      <trans-unit id="">
        <source>over %years% years ago</source>
        <target>%years%年以上前</target>
      </trans-unit>
    </body>
  </file>
</xliff>


text:
#include <aws/medialive/model/AvailConfiguration.h>
#include <aws/core/utils/json/JsonSerializer.h>

#include <utility>

using namespace Aws::Utils::Json;
using namespace Aws::Utils;

namespace Aws
{
namespace MediaLive
{
namespace Model
{

AvailConfiguration::AvailConfiguration() :
    m_availSettingsHasBeenSet(false)
{
}

AvailConfiguration::AvailConfiguration(JsonView jsonValue) :
    m_availSettingsHasBeenSet(false)
{
  *this = jsonValue;
}

AvailConfiguration& AvailConfiguration::operator =(JsonView jsonValue)
{
  if(jsonValue.ValueExists("availSettings"))
  {
    m_availSettings = jsonValue.GetObject("availSettings");

    m_availSettingsHasBeenSet = true;
  }

  return *this;
}

JsonValue AvailConfiguration::Jsonize() const
{
  JsonValue payload;

  if(m_availSettingsHasBeenSet)
  {
   payload.WithObject("availSettings", m_availSettings.Jsonize());

  }

  return payload;
}

} // namespace Model
} // namespace MediaLive
} // namespace Aws


text:
<?php

namespace App\ProductBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class ProductType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('name')
            ->add('description')
            ->add('price')
            ->add('amount')
            ->add('category')
            ->add('save', 'submit', ['label' => "Zapisz produkt"])
        ;
    }

    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'App\ProductBundle\Entity\Product'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'app_productbundle_product';
    }
}