text:
.class Lcom/android/server/BluetoothManagerService$ClientDeathRecipient;
.super Ljava/lang/Object;
.source "BluetoothManagerService.java"

# interfaces
.implements Landroid/os/IBinder$DeathRecipient;

# annotations
.annotation system Ldalvik/annotation/EnclosingClass;
    value = Lcom/android/server/BluetoothManagerService;
.end annotation

.annotation system Ldalvik/annotation/InnerClass;
    accessFlags = 0x0
    name = "ClientDeathRecipient"
.end annotation

# instance fields
.field final synthetic this$0:Lcom/android/server/BluetoothManagerService;

# direct methods
.method constructor <init>(Lcom/android/server/BluetoothManagerService;)V
    .locals 0
    .param p1, "this$0"    # Lcom/android/server/BluetoothManagerService;

    .prologue
    .line 427
    iput-object p1, p0, Lcom/android/server/BluetoothManagerService$ClientDeathRecipient;->this$0:Lcom/android/server/BluetoothManagerService;

    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    return-void
.end method

# virtual methods
.method public binderDied()V
    .locals 3

    .prologue
    .line 430
    invoke-static {}, Lcom/android/server/BluetoothManagerService;->-get1()I

    move-result v1

    if-lez v1, :cond_0

    invoke-static {}, Lcom/android/server/BluetoothManagerService;->-get1()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    invoke-static {v1}, Lcom/android/server/BluetoothManagerService;->-set1(I)I

    .line 432
    :cond_0
    invoke-static {}, Lcom/android/server/BluetoothManagerService;->-get1()I

    move-result v1

    if-nez v1, :cond_1

    .line 435
    :try_start_0
    iget-object v1, p0, Lcom/android/server/BluetoothManagerService$ClientDeathRecipient;->this$0:Lcom/android/server/BluetoothManagerService;

    invoke-static {v1}, Lcom/android/server/BluetoothManagerService;->-get2(Lcom/android/server/BluetoothManagerService;)Landroid/bluetooth/IBluetooth;

    move-result-object v1

    if-eqz v1, :cond_1

    .line 436
    iget-object v1, p0, Lcom/android/server/BluetoothManagerService$ClientDeathRecipient;->this$0:Lcom/android/server/BluetoothManagerService;

    invoke-static {v1}, Lcom/android/server/BluetoothManagerService;->-get2(Lcom/android/server/BluetoothManagerService;)Landroid/bluetooth/IBluetooth;

    move-result-object v1

    invoke-interface {v1}, Landroid/bluetooth/IBluetooth;->onBrEdrDown()V
    :try_end_0
    .catch Landroid/os/RemoteException; {:try_start_0 .. :try_end_0} :catch_0

    .line 428
    :cond_1
    :goto_0
    return-void

    .line 438
    :catch_0
    move-exception v0

    .line 439
    .local v0, "e":Landroid/os/RemoteException;
    const-string/jumbo v1, "BluetoothManagerService"

    const-string/jumbo v2, "Unable to call onBrEdrDown"

    invoke-static {v1, v2, v0}, Landroid/util/Log;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Throwable;)I

    goto :goto_0
.end method


text:
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:id="@+id/inventory_fragment_relative_layout"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@drawable/pict_yellow_activity_background"
    tools:context="ondrej.mejzlik.suntrail.fragments.InventoryFragment">

    <TextView
        android:id="@+id/inventory_text_view_loading_message"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/inventory_loading"
        android:textColor="@color/textBlack"
        android:textStyle="bold" />

    <TextView
        android:id="@+id/inventory_title"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentStart="true"
        android:layout_alignParentTop="true"
        android:layout_marginTop="16dp"
        android:paddingEnd="16dp"
        android:paddingStart="16dp"
        android:text="@string/inventory_title"
        android:textColor="@color/spacerBlue"
        android:textStyle="bold" />

    <View
        android:id="@+id/inventory_view_spacer"
        android:layout_width="match_parent"
        android:layout_height="2dp"
        android:layout_alignParentStart="true"
        android:layout_below="@+id/textView"
        android:layout_marginTop="48dp"
        android:background="@color/spacerBlue"
        tools:ignore="UnknownId,UnknownIdInLayout" />

    <LinearLayout
        android:id="@+id/inventory_linear_layout_main"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_below="@+id/inventory_view_spacer"
        android:orientation="vertical">

        <LinearLayout
            android:id="@+id/inventory_linear_layout_top"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_horizontal"
                android:orientation="vertical">

                <ImageButton
                    android:id="@+id/inventory_image_view_ship"
                    style="?android:attr/borderlessButtonStyle"
                    android:layout_width="200dp"
                    android:layout_height="200dp"
                    android:adjustViewBounds="true"
                    android:background="@drawable/transparent_button_background"
                    android:contentDescription="@string/start_new_game_image_description"
                    android:onClick="showShipInfoButtonHandler"
                    android:scaleType="fitCenter"
                    tools:src="@drawable/pict_icarus_info" />

                <TextView
                    android:id="@+id/inventory_text_view_ship_name"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:text="@string/ship_name_icarus"
                    android:textAlignment="center"
                    android:textColor="@color/textBlack" />

            </LinearLayout>

            <LinearLayout
                android:layout_width="wrap_content"
                android:layout_height="match_parent"
                android:layout_marginStart="60dp"
                android:layout_marginTop="15dp"
                android:gravity="center_vertical"
                android:orientation="vertical">

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/inventory_cargo_bay_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/inventory_cargo_bay"
                        android:textColor="@color/textBlack" />

                    <TextView
                        android:id="@+id/inventory_cargo_bay_contents"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="@color/textBlack"
                        android:textSize="30sp"
                        android:textStyle="bold"
                        tools:text="5/15" />

                </LinearLayout>

                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center"
                    android:layout_weight="1"
                    android:gravity="center_horizontal"
                    android:orientation="vertical">

                    <TextView
                        android:id="@+id/inventory_credits_title"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:text="@string/inventory_credits"
                        android:textColor="@color/textBlack" />

                    <TextView
                        android:id="@+id/inventory_credits_amount"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:textColor="@color/textBlack"
                        android:textSize="30sp"
                        android:textStyle="bold"
                        tools:text="256" />

                    <ImageView
                        android:id="@+id/inventory_image_view_coin"
                        android:layout_width="50dp"
                        android:layout_height="50dp"
                        android:contentDescription="@string/inventory_coin_description"
                        android:src="@drawable/pict_coin" />

                </LinearLayout>

            </LinearLayout>

        </LinearLayout>

        <TextView
            android:id="@+id/inventory_cargo_bay_contents_title"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_horizontal"
            android:layout_marginBottom="10dp"
            android:layout_marginTop="16dp"
            android:text="@string/inventory_cargo_bay_contents"
            android:textColor="@color/spacerBlue"
            android:textStyle="bold" />

        <View
            android:id="@+id/inventory_view_spacer_list"
            android:layout_width="match_parent"
            android:layout_height="2dp"
            android:background="@color/spacerBlue"
            tools:ignore="UnknownId,UnknownIdInLayout" />

        <ListView
            android:id="@+id/inventory_list_view_items"
            android:layout_width="450dp"
            android:layout_height="match_parent"
            android:layout_gravity="center"
            tools:listitem="@layout/list_view_item_row" />

    </LinearLayout>

</RelativeLayout>

redpajama_set_name: RedPajamaGithub


text:
<?php
require 'consumer.inc';
require 'OAuth.php';
$host = "https://www.instapaper.com/api/1/bookmarks/add";

parse_str(base64_decode(getenv('POPCLIP_OPTION_AUTHSECRET')));
$url = getenv('POPCLIP_TEXT');

// generate signed request
parse_str(base64_decode(POPCLIP_CONSUMER_INFO));
$consumer = new OAuthConsumer($ck,$cs);
$token = new OAuthToken($oauth_token,$oauth_token_secret);
$params = array('url'=>$url);
$request = OAuthRequest::from_consumer_and_token($consumer, $token, 'POST', $host, $params);
$request->sign_request(new OAuthSignatureMethod_HMAC_SHA1(), $consumer, $token);

// execute request
$ch = curl_init($host);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query(array_merge($params, $request->get_parameters())));
$response = curl_exec($ch);
$code = curl_getinfo($ch, CURLINFO_HTTP_CODE);

if ($code==200) {
	exit(0); // success
}
else if ($code==403) {
	exit(2); // bad auth
}
else {
	exit(1); // other error
}

?>


text:
'use strict';

var chai = require('chai');
var expect = chai.expect;
var sut = require('../lib/validate-rule');
var rule;

describe('validate-rule', function(){
  beforeEach(function(){
    rule = {
      type: 'equal',
      input: 'someId',
      property: 'someProperty'
    };
  });

  it('returns empty array for valid input', function(){
    var result = sut(rule);
    expect(result).to.be.empty;
  });
  it('returns error if the rule does not have a type property', function(){
    delete rule.type;
    var result = sut(rule);
    expect(result.length).to.equal(1);
  });
  it('returns error if the rules does not have a valid type property', function(){
    rule.type = 'notvalid';
    var result = sut(rule);
    expect(result.length).to.equal(1);
  });
  it('returns error if the rule does not have an input property', function(){
    delete rule.input;
    var result = sut(rule);
    expect(result.length).to.be.equal(1);
  });
  it('returns error if input is not a string or function', function(){
    rule.input = {};
    var result = sut(rule);
    expect(result.length).to.be.equal(1);
  });
  it('returns error if rule type is not percent and does not have property property', function(){
    rule.type = 'equal';
    delete rule.property;
    var result = sut(rule);
    expect(result.length).to.be.equal(1);
  });
});


text:
Links

‣My GitHub

‣My Blog

About Me

{{ site.author.about }}

Follow Me

github

google

facebook

linkedin

rss

Copyright © 2022 BenHeart All Rights Reserved.

Powered by Jekyll. Design by PIZn.


text:
exports = module.exports = function install() {
  // TODO:
}


text:
<!DOCTYPE html>

    <meta charset="UTF-8">
    <title>Date Format - jQuery EasyUI Demo</title>
    <link rel="stylesheet" type="text/css" href="../../themes/default/easyui.css">
    <link rel="stylesheet" type="text/css" href="../../themes/icon.css">
    <link rel="stylesheet" type="text/css" href="../demo.css">

Date Format

Different date formats are applied to different DateBox components.

<input class="easyui-datebox"></input>
<input class="easyui-datebox" data-options="formatter:myformatter,parser:myparser"></input>


text:
SISTEMA DOCENTE

    <form name="login" method="post" action="<?php if (isset ($this->action)) echo $this->action ?>">
        <input type="hidden" name="guardar" value="1"/>
        <input type="hidden" name="Numero"  value="<?php echo count($this->index)?>"/>
        <input name="Dni"  placeholder='User' type='text'>
        <input name="Clave"  placeholder="Password" type='password'>
        <input type="submit" name="Login"/>
    </form>


text:
(function()
{
  "use strict";

  var app = angular.module("app", ["ngRoute"]); //array zijn uw dependencies

  app.config(function($routeProvider) //$ toont aan dat het een angular var is
  {
    $routeProvider.when("/search",
                  {
                    templateUrl: "ImagesOverview/search.html"
                  })
                  .when("/details/:id",
                  {
                      templateUrl: "ImagesDetails/details.html",
                      controller: "imagesDetailsController"
                  })
                  .otherwise(
                  {
                    redirectTo: "/search"
                  });
  });

  app.directive("flickrimage", function()
  {
    return{
      restrict: "E",
      templateUrl: "directives/flickrimage.html"
    };
  });

})();


text:
Testing of external repositories
================================

Directions
----------

  2. In your repository's top level, create the file `TESTS`.
     Each line should be the local path to a `.py` file containing a `test()` function, like this:

         mission.py
         aircraft/wing/wing_spar.py

  3. (optional) create a `TESTCONFIG` file in the same folder. The following options are supported:
      `pip install` specifies packages your repository requires,
      `gpkit-models` the branch of gpkit-models you're working on,
      and `skipsolvers` the solvers that cannot solve your code.
      Format the file like this:

        pip install : pandas
        gpkit-models branch : 1682
        skipsolvers : cvxopt

  4. Test your repository locally by running `python -c "from gpkit.tests.from_paths import run; run()"`
    (consider saving this line as `runtests.sh` for easy access)

  1. Submit a PR to add the name of your repository to the `EXTERNALTESTS` file in `gpkit-models`


text: streaming message transfer agent and associated services


text:
<?php

$sf_ez_lib_dir = sfConfig::get('sf_ez_lib_dir') ? sfConfig::get('sf_ez_lib_dir').'/' : '';

if (file_exists($sf_ez_lib_dir.'Base/src/base.php'))
{
  // svn installation
  require_once($sf_ez_lib_dir.'Base/src/base.php');
}
elseif (file_exists($sf_ez_lib_dir.'Base/base.php'))
{
  // pear installation
  require_once($sf_ez_lib_dir.'Base/base.php');
}
else
{
  throw new sfAutoloadException('Invalid eZ component library path.');
}

/**
 * This class makes easy to use ez components classes within symfony
 *
 * @package    symfony
 * @subpackage addon
 * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
 * @version    SVN: $Id$
 */
class sfEzComponentsBridge
{
  public static function autoload($class)
  {
    return ezcBase::autoload($class);
  }
}


text:
class MeursingHeading < Sequel::Model
  plugin :oplog, primary_key: [:meursing_table_plan_id,
                               :meursing_heading_number,
                               :row_column_code]
  plugin :conformance_validator

  set_primary_key [:meursing_table_plan_id, :meursing_heading_number, :row_column_code]
end


text:
var gcal = require('google-calendar');
var request = require('request');

var Calendar = {
  getItems: function (cb) {
    request.post(
      {
        url: 'https://www.googleapis.com/oauth2/v4/token',
        form: {
          client_id: sails.config.google.client_id,
          client_secret: sails.config.google.client_secret,
          refresh_token: sails.config.google.refresh_token,
          grant_type: 'refresh_token'
        }
      }, function (err, httpResponse, body) {
        if (err) {
          cb({err: err, httpResponse: httpResponse});
        } else {
          var googleResponse = JSON.parse(body);
          if (typeof googleResponse.access_token !== 'undefined') {
            var token = googleResponse.access_token;
            var google_calendar = new gcal.GoogleCalendar(token);
            google_calendar.events.list(sails.config.google.events_list, function (err, events) {
              if (err) {
                sails.log(err);
                cb({err: err});
              } else {
                cb(events.items);
              }
            });
          } else {
            cb({err: 'Impossible de récupérer le token Google !'});
          }
        }
      });
  },

  getItemsDate: function (date, cb) {
    this.getItems(function (items) {

    });
  },

  getStart: function(item, cb) {
    if(typeof item !== 'undefined' && typeof item.start !== 'undefined') {
      var start = item.start.dateTime;
      var dateStart = new Date(start);
      cb(dateStart);
    } else {
      cb({err: 'Item mal formé ou indéfini.'});
    }
  },

  getInfos: function (item, cb) {
    if(typeof item !== 'undefined' && typeof item.start !== 'undefined' && item.status === 'confirmed') {
      var start = item.start.dateTime;
      var dateStart = new Date(start);
      var text = item.summary;
      cb({err: false, date: dateStart, text: text});
    } else {
      cb({err: 'Item mal formé ou indéfini.'});
    }
  }

};

module.exports = Calendar;


text:
title: Places
image_view: true
---

Recipes

{% if page.image_view %}
	{% for category in site.categories %}

{{ category[0] }}

			{% for recipe in category[1] %}

					{{ recipe.title }}

			{% endfor %}

	{% endfor %}
{% endif %}


text:
CKEDITOR.plugins.setLang( 'toolbar', 'pt-br', {
	toolbarCollapse: 'Diminuir Barra de Ferramentas',
	toolbarExpand: 'Aumentar Barra de Ferramentas',
	toolbarGroups: {
		document: 'Documento',
		clipboard: 'Clipboard/Desfazer',
		editing: 'Edição',
		forms: 'Formulários',
		basicstyles: 'Estilos Básicos',
		paragraph: 'Paragrafo',
		links: 'Links',
		insert: 'Inserir',
		styles: 'Estilos',
		colors: 'Cores',
		tools: 'Ferramentas'
	},
	toolbars: 'Barra de Ferramentas do Editor'
} );


text:
<component name="ProjectDictionaryState">
  <dictionary name="xdrop">
    <words>
      <w>pred</w>
      <w>shortcircuit</w>
    </words>
  </dictionary>
</component>


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>no.mediaserver</groupId>
    <artifactId>mediaserver</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <modules>
        <module>mediaserver-server</module>
    </modules>

</project>


text:
#include <stdlib.h>
#include <stdarg.h>
#include <stdio.h>
#include "platform/mbed_mem_trace.h"
#include "platform/mbed_critical.h"

/******************************************************************************
 * Internal variables, functions and helpers
 *****************************************************************************/

/* The callback function that will be called after a traced memory operations finishes. */
static mbed_mem_trace_cb_t mem_trace_cb;
/* 'trave_level' guards "trace inside trace" situations (for example, the implementation
 * of realloc() might call malloc() internally, and since malloc() is also traced, this could
 * result in two calls to the callback function instead of one. */
static uint8_t trace_level;

/******************************************************************************
 * Public interface
 *****************************************************************************/

void mbed_mem_trace_set_callback(mbed_mem_trace_cb_t cb) {
    mem_trace_cb = cb;
}

void *mbed_mem_trace_malloc(void *res, size_t size, void *caller) {
    if (mem_trace_cb) {
        if (core_util_atomic_incr_u8(&trace_level, 1) == 1) {
            mem_trace_cb(MBED_MEM_TRACE_MALLOC, res, caller, size);
        }
        core_util_atomic_decr_u8(&trace_level, 1);
    }
    return res;
}

void *mbed_mem_trace_realloc(void *res, void *ptr, size_t size, void *caller) {
    if (mem_trace_cb) {
        if (core_util_atomic_incr_u8(&trace_level, 1) == 1) {
            mem_trace_cb(MBED_MEM_TRACE_REALLOC, res, caller, ptr, size);
        }
        core_util_atomic_decr_u8(&trace_level, 1);
    }
    return res;
}

void *mbed_mem_trace_calloc(void *res, size_t num, size_t size, void *caller) {
    if (mem_trace_cb) {
        if (core_util_atomic_incr_u8(&trace_level, 1) == 1) {
            mem_trace_cb(MBED_MEM_TRACE_CALLOC, res, caller, num, size);
        }
        core_util_atomic_decr_u8(&trace_level, 1);
    }
    return res;
}

void mbed_mem_trace_free(void *ptr, void *caller) {
    if (mem_trace_cb) {
        if (core_util_atomic_incr_u8(&trace_level, 1) == 1) {
            mem_trace_cb(MBED_MEM_TRACE_FREE, NULL, caller, ptr);
        }
        core_util_atomic_decr_u8(&trace_level, 1);
    }
}

void mbed_mem_trace_default_callback(uint8_t op, void *res, void *caller, ...) {
    va_list va;
    size_t temp_s1, temp_s2;
    void *temp_ptr;

    va_start(va, caller);
    switch(op) {
        case MBED_MEM_TRACE_MALLOC:
            temp_s1 = va_arg(va, size_t);
            printf(MBED_MEM_DEFAULT_TRACER_PREFIX "m:%p;%p-%u\n", res, caller, temp_s1);
            break;

        case MBED_MEM_TRACE_REALLOC:
            temp_ptr = va_arg(va, void*);
            temp_s1 = va_arg(va, size_t);
            printf(MBED_MEM_DEFAULT_TRACER_PREFIX "r:%p;%p-%p;%u\n", res, caller, temp_ptr, temp_s1);
            break;

        case MBED_MEM_TRACE_CALLOC:
            temp_s1 = va_arg(va, size_t);
            temp_s2 = va_arg(va, size_t);
            printf(MBED_MEM_DEFAULT_TRACER_PREFIX "c:%p;%p-%u;%u\n", res, caller, temp_s1, temp_s2);
            break;

        case MBED_MEM_TRACE_FREE:
            temp_ptr = va_arg(va, void*);
            printf(MBED_MEM_DEFAULT_TRACER_PREFIX "f:%p;%p-%p\n", res, caller, temp_ptr);
            break;

        default:
            printf("?\n");
    }
    va_end(va);
}


text:
define(['FamilySearch'], function(FamilySearch) {
  describe('Discussion', function() {
    it('references are returned from getPersonDiscussionRefs', function() {
      FamilySearch.getPersonDiscussionRefs('12345').then(function(response) {
        var refs = response.getDiscussionRefs();
        expect(refs.length).toBe(1);
        expect(refs[0].$personId).toBe('12345');
        refs[0].$getDiscussion().then(function(response) {
          var discussion = response.getDiscussion();
          expect(discussion.id).toBe('dis-MMMM-MMM');
        });
      });
    });

    it('is returned from getDiscussion', function() {
      FamilySearch.getDiscussion('dis-MMMM-MMM').then(function(response) {
        var discussion = response.getDiscussion();
        expect(discussion.id).toBe('dis-MMMM-MMM');
        expect(discussion.title).toBe('1900 US Census, Ethel Hollivet');
        expect(discussion.details).toBe('Ethel Hollivet (line 75) with husband Albert Hollivet (line 74); also in the dwelling: step-father Joseph E Watkins (line 72), mother Lina Watkins (line 73), and grandmother -- Lina\'s mother -- Mary Sasnett (line 76).  ');
        expect(discussion.numberOfComments).toBe(2);
        expect(discussion.created).toBeUndefined();  // bad example data
        expect(discussion.modified).toBeUndefined(); // bad example data
        expect(discussion.$getAgentId()).toBe('12345');
        discussion.$getComments().then(function(response) {
          var comments = response.getComments();
          expect(comments.length).toBe(1);
          expect(comments[0].id).toBe('CMMM-MMM');
        });
        discussion.$getAgent().then(function(response) {
          var agent = response.getAgent();
          expect(agent.$getName()).toBe('John Smith');
        });
      });
    });

    it('are returned from getMultiDiscussion', function() {
      FamilySearch.getMultiDiscussion(['dis-MMMM-MMM']).then(function(response) {
        var discussion = response['dis-MMMM-MMM'].getDiscussion();
        expect(discussion.id).toBe('dis-MMMM-MMM');
        expect(discussion.title).toBe('1900 US Census, Ethel Hollivet');
      });
    });

    it('comments are returned from getDiscussionComments', function() {
      FamilySearch.getDiscussionComments('dis-MMMM-MMM').then(function(response) {
        var comments = response.getComments();
        expect(comments.length).toBe(1);
        expect(comments[0].id).toBe('CMMM-MMM');
        expect(comments[0].text).toBe('Just a comment.');
        expect(comments[0].$discussionId).toBe('dis-MMMM-MMM');
        expect(comments[0].created).toBeUndefined();       // bad example data
        expect(comments[0].$getAgentId()).toBeUndefined(); // bad example data
      });
    });

    it('is created', function() {
      var disc = new FamilySearch.Discussion({title: '1900 US Census, Ethel Hollivet', details: 'details'});
      var promise = disc.$save('', true);
      promise.then(function(response) {
        var request = promise.getRequest();
        //noinspection JSUnresolvedFunction
        expect(request.data).toEqualJson({
          'discussions' : [ {
            'title' : '1900 US Census, Ethel Hollivet',
            'details' : 'details'
          } ]
        });
        expect(promise.getStatusCode()).toBe(201);
        expect(response).toBe('dis-MMMM-MMM');
        // discussion has been refreshed from database
        expect(disc.details).toBe('Ethel Hollivet (line 75) with husband Albert Hollivet (line 74); also in the dwelling: step-father Joseph E Watkins (line 72), mother Lina Watkins (line 73), and grandmother -- Lina\'s mother -- Mary Sasnett (line 76).  ');
      });
    });

    it('is updated', function() {
      var disc = new FamilySearch.Discussion({title: '1900 US Census, Ethel Hollivet', details: 'details'});
      disc.id = 'dis-MMMM-MMM';
      var promise = disc.$save('', true);
      promise.then(function(response) {
        var request = promise.getRequest();
        //noinspection JSUnresolvedFunction
        expect(request.data).toEqualJson({
          'discussions' : [ {
            'id' : 'dis-MMMM-MMM',
            'title' : '1900 US Census, Ethel Hollivet',
            'details' : 'details'
          } ]
        });
        expect(promise.getStatusCode()).toBe(201);
        expect(response).toBe('dis-MMMM-MMM');
      });
    });

    it('is deleted', function() {
      var disc = new FamilySearch.Discussion({title: 'title', details: 'details'});
      disc.id = 'dis-MMMM-MMM';
      var promise = disc.$delete();
      promise.then(function(response) {
        expect(promise.getStatusCode()).toBe(204);
        expect(response).toBe('dis-MMMM-MMM');
      });
    });

    it('reference is created', function() {
      var discRef = new FamilySearch.DiscussionRef({$personId: '12345', discussion: 'dis-1'});
      var promise = discRef.$save('change msg');
      promise.then(function(response) {
        var request = promise.getRequest();
        //noinspection JSUnresolvedFunction
        expect(request.data).toEqualJson({
          'persons' : [ {
            'id' : '12345',
            'discussion-references' : [{
              resource: 'https://sandbox.familysearch.org/platform/discussions/discussions/dis-1'
            }],
            'attribution' : { changeMessage: 'change msg' }
          } ]
        });
        expect(promise.getStatusCode()).toBe(201);
        expect(response).toBe('https://sandbox.familysearch.org/platform/tree/persons/12345/discussion-references/dis-1');
      });
    });

    it('reference is deleted', function() {
      var promise = FamilySearch.deleteDiscussionRef('12345','67890');
      promise.then(function(response) {
        expect(promise.getStatusCode()).toBe(204);
        expect(response).toBe('12345');
      });
    });

    it('comment is created', function() {
      var promise = new FamilySearch.Comment({text: 'Just a comment.', $discussionId: 'dis-MMMM-MMM'})
        .$save();
      promise.then(function(response) {
        var request = promise.getRequest();
        //noinspection JSUnresolvedFunction
        expect(request.data).toEqualJson({
          'discussions' : [ {
            'comments' : [ {
              'text' : 'Just a comment.'
            } ]
          } ]
        });
        expect(promise.getStatusCode()).toBe(201);
        expect(response).toBe('cmt-id');
      });
    });

    it('comment is updated', function() {
      var cmt = new FamilySearch.Comment({text: 'Just a comment.', $discussionId: 'dis-MMMM-MMU'});
      cmt.id = 'CMMM-MMM';
      var promise = cmt.$save();
      promise.then(function(response) {
        var request = promise.getRequest();
        //noinspection JSUnresolvedFunction
        expect(request.data).toEqualJson({
          'discussions' : [ {
            'comments' : [ {
              'id' : 'CMMM-MMM',
              'text' : 'Just a comment.'
            } ]
          } ]
        });
        expect(promise.getStatusCode()).toBe(204);
        expect(response).toBe('CMMM-MMM');
      });
    });

    it('comment is deleted', function() {
      var promise = FamilySearch.deleteDiscussionComment('dis-MMMM-MMM', '1');
      promise.then(function(response) {
        expect(promise.getStatusCode()).toBe(204);
        expect(response).toBe('dis-MMMM-MMM');
      });
    });

  });
});


text:
using System.Collections.Generic;

namespace Zeus.Monitors
{
    public interface IHDDMonitor
    {
        IEnumerable<DriveInfo> GetHDDUsage();
    }

    public class DriveInfo
    {
        public DriveInfo(string volumeName, decimal totalSpace, decimal freeSpace)
        {
            VolumeName = volumeName;
            TotalSpace = totalSpace;
            FreeSpace = freeSpace;
        }

        public string VolumeName { get; private set; }

        public decimal TotalSpace { get; private set; }

        public decimal FreeSpace { get; private set; }

        public decimal UsedSpaceInPercent { get { return (TotalSpace == 0) ? 0 : ((TotalSpace - FreeSpace) / TotalSpace) * 100; } }
    }
}


text:
<!DOCTYPE html>
% block head
<link rel="stylesheet" href="{{'style.css'|static}}" />
<title>{% block title %}Gubernator{% endblock %}</title>

% endblock

% block header
% endblock

% block content
% endblock


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>MountItemsPool</title>
<meta name="date" content="2022-10-27">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">

JavaScript is disabled on your browser.

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method

com.facebook.rendercore

Class MountItemsPool

java.lang.Object

com.facebook.rendercore.MountItemsPool

public class MountItemsPool
extends java.lang.Object

Pools of recycled resources.

FUTURE: Consider customizing the pool implementation such that we can match buffer sizes.
 Without this we will tend to expand all buffers to the largest size needed.

Nested Class Summary

Nested Classes

Modifier and Type
Class and Description

static interface
MountItemsPool.ItemPool

Content item pools that RenderCore uses to recycle content (such as Views)

Field Summary

Fields

Modifier and Type
Field and Description

static boolean
isPoolingDisabled

Should be used to disable pooling entirely for debugging, testing, and other use cases.

static boolean
sIsManualCallbacks

To support Gingerbread (where the registerActivityLifecycleCallbacks API doesn't exist), we
 allow apps to explicitly invoke activity callbacks.

Method Summary

All Methods Static Methods Concrete Methods

Modifier and Type
Method and Description

static java.lang.Object
acquireHostMountContent(Context context,
                       IBinder windowToken,
                       ContentAllocator hostContentProvider)

static java.lang.Object
acquireMountContent(Context context,
                   ContentAllocator poolableMountContent)

static void
clear()

static java.util.List<MountItemsPool.ItemPool>
getMountItemPools()

static void
maybePreallocateContent(Context context,
                       ContentAllocator poolableMountContent)

static void
onContextCreated(Context context)

static void
onContextDestroyed(Context context)

static void
prefillMountContentPool(Context context,
                       int poolSize,
                       ContentAllocator poolableMountContent)

Can be called to fill up a mount content pool for the specified MountContent types.

static void
release(Context context,
       ContentAllocator poolableMountContent,
       java.lang.Object mountContent)

static void
releaseHostMountContent(Context context,
                       IBinder windowToken,
                       ContentAllocator hostContentProvider,
                       java.lang.Object content)

Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

sIsManualCallbacks

public static boolean sIsManualCallbacks

To support Gingerbread (where the registerActivityLifecycleCallbacks API doesn't exist), we
 allow apps to explicitly invoke activity callbacks. If this is enabled we'll throw if we are
 passed a context for which we have no record.

isPoolingDisabled

public static boolean isPoolingDisabled

Should be used to disable pooling entirely for debugging, testing, and other use cases.

Method Detail

acquireMountContent

public static java.lang.Object acquireMountContent(Context context,
                                                   ContentAllocator poolableMountContent)

release

public static void release(Context context,
                           ContentAllocator poolableMountContent,
                           java.lang.Object mountContent)

maybePreallocateContent

public static void maybePreallocateContent(Context context,
                                           ContentAllocator poolableMountContent)

prefillMountContentPool

public static void prefillMountContentPool(Context context,
                                           int poolSize,
                                           ContentAllocator poolableMountContent)

Can be called to fill up a mount content pool for the specified MountContent types. If a pool
 doesn't exist for a Mount Content type, a default one will be created with the specified size.
 PoolSize will only be respected if the RenderUnit does not provide a custom Pool
 implementation.

clear

public static void clear()

acquireHostMountContent

public static java.lang.Object acquireHostMountContent(Context context,
                                                       IBinder windowToken,
                                                       ContentAllocator hostContentProvider)

releaseHostMountContent

public static void releaseHostMountContent(Context context,
                                           IBinder windowToken,
                                           ContentAllocator hostContentProvider,
                                           java.lang.Object content)

onContextCreated

public static void onContextCreated(Context context)

onContextDestroyed

public static void onContextDestroyed(Context context)

getMountItemPools

public static java.util.List<MountItemsPool.ItemPool> getMountItemPools()

Skip navigation links

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Class

Next Class

Frames

No Frames

All Classes

Summary:

Nested |

Field |

Constr |

Method

Detail:

Field |

Constr |

Method


text:
package org.redmine.ta;

import java.io.IOException;
import java.util.Date;
import java.util.List;

import org.redmine.ta.RedmineManager.INCLUDE;
import org.redmine.ta.beans.*;
import org.redmine.ta.internal.RedmineXMLGenerator;
import org.redmine.ta.internal.logging.Logger;
import org.redmine.ta.internal.logging.LoggerFactory;

public class Simple {
    private static final Logger logger = LoggerFactory.getLogger(Simple.class);
    private static final String projectKey = "test";

    private static final Integer queryId = null; // any

    public static void main(String[] args) {
        String redmineHost = "http://ta-dev.dyndns.biz:8099/redmine-1.3.1";
        String apiAccessKey = "e665eabdddfa3744e3cbea0f122445d098f2f4b2";
        RedmineManager mgr = new RedmineManager(redmineHost, apiAccessKey);
        try {
//			getIssueWithRelations(mgr);
//			tryCreateIssue(mgr);
//			tryGetIssues(mgr);
//            tryGetAllIssues(mgr);
//			printCurrentUser(mgr);
//			generateXMLForUser();
//			generateXMLForTimeEntry();
//			getSavedQueries(mgr);
//			getProjects(mgr);
//			tryCreateRelation(mgr);
//            tryGetNews(mgr);
//            getProject(mgr);
//            changeIssueStatus(mgr);
            getVersion(mgr);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }

    private static void getVersion(RedmineManager mgr) throws RedmineException {
        // see Redmine bug http://www.redmine.org/issues/10241
        Version version = mgr.getVersionById(294);
        System.out.println(version);
    }

    private static void changeIssueStatus(RedmineManager mgr) throws RedmineException {
        Issue issue = mgr.getIssueById(1771);
        issue.setSubject("new");
        mgr.update(issue);
    }

    private static void getProject(RedmineManager mgr) throws RedmineException {
        Project test = mgr.getProjectByKey("test");
        System.out.println(test);
    }

    private static void tryGetNews(RedmineManager mgr) throws RedmineException {
        List<News> news = mgr.getNews(null);
        for (News aNew : news) {
            System.out.println(aNew);
        }
    }

    private static void tryCreateRelation(RedmineManager mgr) throws RedmineException {
        IssueRelation r = mgr.createRelation(49, 50, IssueRelation.TYPE.precedes.toString());
        logger.debug("Created relation " + r);
    }

    private static void getProjects(RedmineManager mgr) throws RedmineException {
        List<Project> projects = mgr.getProjects();
        logger.debug("Retrieved projects " + projects);

    }

    private static void getSavedQueries(RedmineManager mgr) throws RedmineException {
        List<SavedQuery> savedQueries = mgr.getSavedQueries("test");
        logger.debug("Retrieved queries " + savedQueries);

    }

    private static void getIssueWithRelations(RedmineManager mgr) throws RedmineException {
        Issue issue = mgr.getIssueById(24580, INCLUDE.relations);
        List<IssueRelation> r = issue.getRelations();
        logger.debug("Retrieved relations " + r);

    }

    private static void tryCreateIssue(RedmineManager mgr) throws RedmineException {
        Issue issue = new Issue();
        issue.setSubject("test123");
        mgr.createIssue(projectKey, issue);
    }

    private static void generateXMLForTimeEntry() {
        TimeEntry o = new TimeEntry();
        o.setId(13);
        o.setIssueId(45);
        o.setActivityId(3);
        o.setProjectId(55);
        o.setUserId(66);
        o.setHours(123f);
        o.setComment("text here");
        o.setSpentOn(new Date());
        String xml = RedmineXMLGenerator.toXML(o);
        logger.debug(xml);
    }

    private static void generateXMLForUser() {
        User u = new User();
        u.setLogin("newlogin");
        String xml = RedmineXMLGenerator.toXML(u);
        logger.debug(xml);

    }

    private static void tryGetIssues(RedmineManager mgr) throws Exception {
        List<Issue> issues = mgr.getIssues(projectKey, queryId);
        for (Issue issue : issues) {
            logger.debug(issue.toString());
        }
    }

    private static void tryGetAllIssues(RedmineManager mgr) throws Exception {
        List<Issue> issues = mgr.getIssues(projectKey, null);
        for (Issue issue : issues) {
            logger.debug(issue.toString());
        }
    }

    private static void printCurrentUser(RedmineManager mgr) throws Exception {
        User currentUser = mgr.getCurrentUser();
        logger.debug("user=" + currentUser.getMail());

        currentUser.setMail("ne@com123.com");
        mgr.update(currentUser);
        logger.debug("updated user");

        User currentUser2 = mgr.getCurrentUser();
        logger.debug("updated user's mail: " + currentUser2.getMail());

    }
}


text:
import unittest

from kraken.core.objects.components.component import Component
from kraken.core.objects.components.component_input import ComponentInput
from kraken.core.objects.components.component_input_port import ComponentInputPort
from kraken.core.objects.components.component_output_port import ComponentOutputPort

class TestComponentInputPort(unittest.TestCase):

    def testSetDataType(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        testSetDataType = cmpInputPort.setDataType('Mat44')

        self.assertTrue(testSetDataType)
        self.assertEqual(cmpInputPort._dataType, 'Mat44')

    def testGetDataType(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        dataType = cmpInputPort.getDataType()

        self.assertEqual(dataType, 'Scalar')

    def testIsConnected(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        self.assertFalse(cmpInputPort.isConnected())

        cmpOutputPort = ComponentOutputPort('testOutput', None, 'Scalar')
        cmpInputPort.setConnection(cmpOutputPort)

        self.assertTrue(cmpInputPort.isConnected())

    def testGetConnection(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpOutputPort = ComponentOutputPort('testOutput', None, 'Scalar')
        cmpInputPort.setConnection(cmpOutputPort)

        cmpInputPortConn = cmpInputPort.getConnection()

        self.assertEqual(cmpInputPortConn, cmpOutputPort)

    def testSetConnection(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpOutputPort1 = ComponentOutputPort('testOutput1', None, 'Mat44')

        self.assertRaises(TypeError, lambda: cmpInputPort.setConnection(cmpOutputPort1))

        cmpOutputPort2 = ComponentOutputPort('testOutput2', None, 'Scalar')
        testSetConn = cmpInputPort.setConnection(cmpOutputPort2)

        self.assertTrue(testSetConn)
        self.assertRaises(ValueError, lambda: cmpInputPort.setConnection(cmpOutputPort2))

    def testRemoveConnection(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpOutputPort = ComponentOutputPort('testOutput', None, 'Scalar')
        testSetConn = cmpInputPort.setConnection(cmpOutputPort)

        self.assertTrue(testSetConn)

        testRemConn = cmpInputPort.removeConnection()
        self.assertTrue(testRemConn)

    def testCanConnectTo(self):
        testComponent = Component('testComponent')

        # Need to ensure the input and output port objects have different
        # parents to allow them to be connected.
        cmpInputPort = ComponentInputPort('testCmpInputPort', testComponent, 'Scalar')
        cmpOutputPort1 = ComponentOutputPort('testOutput1', None, 'Scalar')
        cmpOutputPort2 = ComponentOutputPort('testOutput2', testComponent, 'Scalar')
        cmpOutputPort3 = ComponentOutputPort('testOutput3', None, 'Mat44')
        testCanConn1 = cmpInputPort.canConnectTo(cmpOutputPort1)
        testCanConn2 = cmpInputPort.canConnectTo(cmpOutputPort2)
        testCanConn3 = cmpInputPort.canConnectTo(cmpOutputPort3)

        self.assertTrue(testCanConn1)
        self.assertFalse(testCanConn2)
        self.assertFalse(testCanConn3)

    def testSetTarget(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpInput = ComponentInput('testCmpInput')
        testSetTgt = cmpInputPort.setTarget(cmpInput)

        self.assertTrue(testSetTgt)
        self.assertEqual(cmpInputPort._target, cmpInput)

    def testGetTarget(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpInput = ComponentInput('testCmpInput')
        cmpInputPort.setTarget(cmpInput)

        self.assertEqual(cmpInputPort.getTarget(), cmpInput)

    def testGetIndex(self):
        cmpInputPort = ComponentInputPort('testCmpInputPort', None, 'Scalar')
        cmpInput = ComponentInput('testCmpInput')
        cmpInputPort.setTarget(cmpInput)
        index = cmpInputPort.getIndex()

        self.assertEqual(index, 0)

def suite():
    return unittest.TestLoader().loadTestsFromTestCase(TestComponentInputPort)

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


text:
import os
import pytest
from thefuck.shells import Bash

@pytest.mark.usefixtures('isfile', 'no_memoize', 'no_cache')
class TestBash(object):
    @pytest.fixture
    def shell(self):
        return Bash()

    @pytest.fixture(autouse=True)
    def shell_aliases(self):
        os.environ['TF_SHELL_ALIASES'] = (
            'alias fuck=\'eval $(thefuck $(fc -ln -1))\'\n'
            'alias l=\'ls -CF\'\n'
            'alias la=\'ls -A\'\n'
            'alias ll=\'ls -alF\'')

    @pytest.mark.parametrize('before, after', [
        ('pwd', 'pwd'),
        ('fuck', 'eval $(thefuck $(fc -ln -1))'),
        ('awk', 'awk'),
        ('ll', 'ls -alF')])
    def test_from_shell(self, before, after, shell):
        assert shell.from_shell(before) == after

    def test_to_shell(self, shell):
        assert shell.to_shell('pwd') == 'pwd'

    def test_and_(self, shell):
        assert shell.and_('ls', 'cd') == 'ls && cd'

    def test_or_(self, shell):
        assert shell.or_('ls', 'cd') == 'ls || cd'

    def test_get_aliases(self, shell):
        assert shell.get_aliases() == {'fuck': 'eval $(thefuck $(fc -ln -1))',
                                       'l': 'ls -CF',
                                       'la': 'ls -A',
                                       'll': 'ls -alF'}

    def test_app_alias(self, shell):
        assert 'fuck () {' in shell.app_alias('fuck')
        assert 'FUCK () {' in shell.app_alias('FUCK')
        assert 'thefuck' in shell.app_alias('fuck')
        assert 'PYTHONIOENCODING' in shell.app_alias('fuck')

    def test_app_alias_variables_correctly_set(self, shell):
        alias = shell.app_alias('fuck')
        assert "fuck () {" in alias
        assert 'TF_SHELL=bash' in alias
        assert "TF_ALIAS=fuck" in alias
        assert 'PYTHONIOENCODING=utf-8' in alias
        assert 'TF_SHELL_ALIASES=$(alias)' in alias

    def test_get_history(self, history_lines, shell):
        history_lines(['ls', 'rm'])
        assert list(shell.get_history()) == ['ls', 'rm']

    def test_split_command(self, shell):
        command = 'git log -p'
        command_parts = ['git', 'log', '-p']
        assert shell.split_command(command) == command_parts

    def test_how_to_configure(self, shell, config_exists):
        config_exists.return_value = True
        assert shell.how_to_configure().can_configure_automatically

    def test_how_to_configure_when_config_not_found(self, shell,
                                                    config_exists):
        config_exists.return_value = False
        assert not shell.how_to_configure().can_configure_automatically


text:
import time
import yaml
import logging as log

from src.helpers import _connection_to_elasticsearch, _connection_to_postgres, _make_terms, _process_connection_message, \
    _process_attempt_message, _process_disconnect_message, _get_repeat_messages, _get_latest_timestamp, \
    _sanitize_timestamp, _get_repeat_messages_failed_pull

class Nectar:
    """
    Nectar is part of the Hive. Nectar pulls messages from Elastic Search, processes them and inserts them in a RDB
    """

    def __init__(self, elasticsearch=None, database=None, latest_timestamp=None, repeat_ids=None, minimum_pull_time=None,
                 size_of_pull=None, sort=None):
        """
        Initializes an instance of Nectar
        :param elasticsearch: Elastic Search object with authentication
        :param database: Database object with authentication
        :param latest_timestamp: Latest timestamp to start pulling logs from
        :param repeat_ids: List of repeat IDs
        """
        self.elasticsearch = elasticsearch
        self.database = database
        self.latest_timestamp = latest_timestamp
        self.repeat_ids = repeat_ids
        self.minimum_pull_time = minimum_pull_time
        self.size_of_pull = size_of_pull
        self.sort = sort

    def set_elasticseach(self, address, username, password):
        """
        Sets the Elastic Search object
        :param address: IP address of the Elastic Search server
        :param username: Username of the Elastic Search server
        :param password: Password of the Elastic Search server
        """
        self.elasticsearch = _connection_to_elasticsearch(address, username, password)

    def set_database(self, dbname, address, username, password):
        """
        Sets the Database connection object
        :param dbname: Database name
        :param address: IP address of the Database
        :param username: Username of the Database
        :param password: Password of the Database
        """
        self.database = _connection_to_postgres(dbname, address, username, password)

    def set_latest_timestamp(self, latest_timestamp):
        """
        Sets the latest timestamp
        :param latest_timestamp: latest timestamp (timestamp)
        """
        self.latest_timestamp = latest_timestamp

    def set_repeat_ids(self, repeat_ids):
        """
        Sets repeat IDs
        :param repeat_ids: List of IDs
        """
        self.repeat_ids = repeat_ids

    def set_minimum_pull_time(self, minimum_pull_time):
        """
        Sets minimum pull time
        :param minimum_pull_time:
        :return:
        """
        self.minimum_pull_time = minimum_pull_time

    def set_size_of_pull(self, size_of_pull):
        """
        Sets the size of the pull
        :param size_of_pull:
        :return:
        """
        self.size_of_pull = size_of_pull

    def set_sort(self, sort):
        """
        Sets sort value
        :param sort:
        :return:
        """
        self.sort = sort

    def _pull_messages(self, size):
        """
        Pulls a batch of messages from Elastic Search for processing
        :param size: Amount of messages to pull
        :return: Dictionary of messages
        """

        log.debug("Entering {}".format(self._pull_messages.__name__))

        # Make size dynamic and make timestamp default to be None, thus allowing for autostart

        # If repeat IDs is None then make it a empty list
        if self.repeat_ids is None:
            log.debug("Repeat IDs are empty. Setting to empty list...")
            self.repeat_ids = []

        # Pull from elasticsearch using a couple search terms
        log.debug("Preparing query for pulling")
        response = self.elasticsearch.search(
            body={
                "size": self.size_of_pull,
                "query": {
                    "bool": {
                        "must": {
                            "range": {
                                "@timestamp": {
                                    "gte": self.latest_timestamp
                                }
                            }
                        },
                        "filter": {
                            "exists": {"field": "Message_Type"}
                        },
                        "must_not": [
                            list(map(_make_terms, self.repeat_ids)) if self.repeat_ids else {}
                        ]
                    }
                },
                "sort": {
                    "@timestamp": {
                        "order": "asc"
                    },
                    "Fractional_Sec": {
                        "order": "asc"
                    }
                }
            }
        )

        log.debug("Query successfully pulled")
        messages = response['hits']['hits']
        if messages:
            # Setting repeat IDs and latest timestamp, so you can pull again
            log.debug("Calling {}".format(_get_repeat_messages.__name__))
            self.repeat_ids = _get_repeat_messages(messages)
            log.debug("Called {}".format(_get_repeat_messages.__name__))

            log.debug("Calling {}".format(_get_latest_timestamp.__name__))
            self.latest_timestamp = _get_latest_timestamp(messages)
            log.debug("Called {}".format(_get_latest_timestamp.__name__))

            # TESTING
            for message in messages:
                log.debug(str(message['_source']['@timestamp']) + " " + str(message['_source']['Fractional_Sec']) + " " + message['_id'])
        else:
            log.info("Pull from Elastic Search was empty!")

        log.debug("Exiting {}".format(self._process_messages.__name__))
        return messages

    def _process_messages(self, messages):
        """
        Takes in the dictionary of messages and processes them
        :param messages: Dictionary of messages
        """
        log.debug("Entering {}".format(self._process_messages.__name__))
        log.info("Number of messages to be processed: {}".format(len(messages)))

        # Set geo cached ips to None, each process
        geo_cached_ips = []

        # Loops through all the messages in the pull
        log.debug("Entering message processing loop")
        for message in messages:
            log.debug("------------------------------------------------")
            log.debug("Processing Message ID: {}".format(message["_id"]))

            log.debug("Calling {}".format(_sanitize_timestamp.__name__))
            _sanitize_timestamp(message)
            log.debug("Called {}".format(_sanitize_timestamp.__name__))

            if message['_source']['Message_Type'] == "Connection":
                log.debug("Calling {}".format(_process_connection_message.__name__))
                _process_connection_message(message, self.database)
                log.debug("Called {}".format(_process_connection_message.__name__))
            elif message['_source']['Message_Type'] == "Attempt":
                log.debug("Calling {}".format(_process_attempt_message.__name__))
                try:
                    _process_attempt_message(message, self.database, geo_cached_ips)
                except TypeError:
                    self.latest_timestamp = message['_source']['@timestamp']
                    # Call custom repeat ID function
                    _get_repeat_messages_failed_pull(messages, message['_id'], message['_source']['@timestamp'])
                    # Refresh index
                    self.elasticsearch.indices.refresh(index="_all")
                    log.warning("Failed at processing attempt message. Repulling messages!")
                    raise
                log.debug("Called {}".format(_process_attempt_message.__name__))
            elif message['_source']['Message_Type'] == "Disconnect":
                log.debug("Calling {}".format(_process_disconnect_message.__name__))
                try:
                    _process_disconnect_message(message, self.database)
                except TypeError:
                    self.latest_timestamp = message['_source']['@timestamp']
                    # Call custom repeat ID function
                    _get_repeat_messages_failed_pull(messages, message['_id'], message['_source']['@timestamp'])
                    # Refresh index
                    self.elasticsearch.indices.refresh(index="_all")
                    log.warning("Failed at processing disconnect message. Repulling messages!")
                    raise
                log.debug("Called {}".format(_process_disconnect_message.__name__))
        log.debug("Completed message processing loop")
        log.debug("------------------------------------------------")

        log.debug("Exiting {}".format(self._process_messages.__name__))

    def _sort(self, messages):
        """
        Takes in the raw response, and sorts by timestamp bc elastic search can't do microseconds...
        :param messages: Raw messages from elastic search
        :return: A sort array of messages that is sorted
        """

        log.debug("Entering {}".format(self._sort.__name__))

        log.info("Number of messages to be processed: {}".format(len(messages)))

        for message in messages:
            _sanitize_timestamp(message)

        # Sorts messages by Local_Timestamp
        messages.sort(key=lambda x:x['_source']['Local_Timestamp'])
        log.debug("Exiting {}".format(self._sort.__name__))
        return messages

    def load_config(self, path=None):
        """
        Reads config from yaml files and adds the values to the object
        :param path: Path of where the config file is
        """

        log.debug("Entering {}".format(self.load_config.__name__))

        if not path:
            path = 'config.yaml'

        with open(path, 'r') as file:
            config = yaml.safe_load(file)

        self.set_elasticseach("http://" + config['elasticsearch']['ip'] + ":" + str(config['elasticsearch']['port']),
                              config['elasticsearch']['username'], config['elasticsearch']['password'])

        self.set_database(config['postgres']['db_name'], config['postgres']['ip'], config['postgres']['username'],
                          config['postgres']['password'])

        self.set_latest_timestamp(config['nectar']['latest_timestamp'])

        self.set_size_of_pull(config['nectar']['size_of_pull'])

        self.set_repeat_ids(config['nectar']['repeat_ids'])

        self.set_minimum_pull_time(config['nectar']['minimum_pull_time'])

        self.set_sort(config['nectar']['repeat_ids'])

        log.debug("Exiting {}".format(self.load_config.__name__))

    def run(self):
        """
        Continuously pulls messages and processes them
        :param size: Amount of messages to pull
        :return: $$$$$$
        """

        log.info("Entering {}".format(self.run.__name__))

        # Will make this loop run forever until a crash
        while True:
            # Records the start time of the run
            start_time = time.perf_counter()

            # Pull messages and then process them
            log.debug("Calling {}".format(self._pull_messages.__name__))
            messages = self._pull_messages(self.size_of_pull)
            log.debug("Called {}".format(self._pull_messages.__name__))

            # Check if sort is true and messages has something
            if self.sort and messages:
                log.debug("Calling {}".format(self._sort.__name__))
                messages = self._sort(messages)
                log.debug("Called {}".format(self._sort.__name__))

            if messages:
                log.debug("Calling {}".format(self._process_messages.__name__))
                try:
                    self._process_messages(messages)
                except TypeError:
                    log.warning("")
                log.debug("Called {}".format(self._process_messages.__name__))
            else:
                log.info("No Message found!")

            # Records the end time of the run
            end_time = time.perf_counter()

            if self.minimum_pull_time > end_time - start_time:
                # Prevent Elastic Search from getting slammed
                # Calculate wait time based on min wait time
                log.debug("Going to sleep for {} seconds".format(end_time - start_time))
                time.sleep(end_time - start_time)

        log.error("Exiting {}".format(self.run.__name__))


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using PTrampert.AppArgs.Attributes;
using PTrampert.AppArgs.Exceptions;
using PTrampert.AppArgs.Extensions;

namespace PTrampert.AppArgs
{
    /// <summary>
    /// Parser for parsing ordered arguments.
    /// </summary>
    public class ArgumentParser<T> : ICliParser<T> where T : new()
    {
        private IEnumerable<PropertyInfo> _argumentProperties;

        /// <summary>
        /// Initializes an argument parser.
        /// </summary>
        public ArgumentParser()
        {
            var type = typeof(T);
            _argumentProperties = type.GetRuntimeProperties().Where(pi => pi.GetCustomAttribute<ArgumentAttribute>() != null)
                .OrderBy(pi => pi.GetCustomAttribute<ArgumentAttribute>().Order);
            ArgumentAttributeValidator.ValidateAttributes(_argumentProperties);
        }

        /// <summary>
        /// Parse ordered arguments into the given object.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        /// <returns>The populated object.</returns>
        public T Parse(string[] args)
        {
            return Parse(args, new T());
        }

        /// <summary>
        /// Parse ordered arguments into the given object.
        /// </summary>
        /// <param name="args">Command line arguments.</param>
        /// <param name="obj">The object to store the arguments in.</param>
        /// <returns>The populated object.</returns>
        public T Parse(string[] args, T obj)
        {
            foreach (var prop in _argumentProperties)
            {
                var attrib = prop.GetCustomAttribute<ArgumentAttribute>();
                if (args.Length <= attrib.Order)
                {
                    if (attrib.IsRequired)
                    {
                        throw new MissingArgumentException(attrib.Name ?? prop.Name);
                    }
                    break;
                }
                var parseMethod = prop.PropertyType.GetParseMethod();
                try
                {
                    prop.SetValue(obj, parseMethod(args[attrib.Order]));
                }
                catch (Exception e)
                {
                    throw new ParsingException(attrib.Name ?? prop.Name, e);
                }
            }
            return obj;
        }
    }
}


text:
@interface PodsDummy_Pods_Hashids_Expecta : NSObject
@end
@implementation PodsDummy_Pods_Hashids_Expecta
@end


text:
using NUnit.Framework;
using System;
using Appium.Integration.Tests.Helpers;
using OpenQA.Selenium.Appium;
using OpenQA.Selenium.Remote;
using System.Collections.Generic;
using OpenQA.Selenium.Appium.Android;
using OpenQA.Selenium.Appium.MultiTouch;
using OpenQA.Selenium.Appium.Interfaces;
using System.Threading;

namespace Appium.Integration.Tests.Android
{
	[TestFixture ()]
	public class AndroidTouchActionTest
	{
		private AndroidDriver<AppiumWebElement> driver;

		[TestFixtureSetUp]
		public void BeforeAll(){
			DesiredCapabilities capabilities = Env.isSauce () ?
				Caps.getAndroid501Caps (Apps.get ("androidApiDemos")) :
				Caps.getAndroid19Caps (Apps.get ("androidApiDemos"));
			if (Env.isSauce ()) {
				capabilities.SetCapability("username", Env.getEnvVar("SAUCE_USERNAME"));
				capabilities.SetCapability("accessKey", Env.getEnvVar("SAUCE_ACCESS_KEY"));
				capabilities.SetCapability("name", "android - complex");
				capabilities.SetCapability("tags", new string[]{"sample"});
			}
			Uri serverUri = Env.isSauce () ? AppiumServers.sauceURI : AppiumServers.LocalServiceURIAndroid;
            driver = new AndroidDriver<AppiumWebElement>(serverUri, capabilities, Env.INIT_TIMEOUT_SEC);
			driver.Manage().Timeouts().ImplicitlyWait(Env.IMPLICIT_TIMEOUT_SEC);
            driver.CloseApp();
        }

        [SetUp]
        public void SetUp()
        {
            if (driver != null)
            {
                driver.LaunchApp();
            }
        }

        [TearDown]
        public void TearDowwn()
        {
            if (driver != null)
            {
                driver.CloseApp();
            }
        }

        [TestFixtureTearDown]
		public void AfterAll(){
            if (driver != null)
            {
                driver.Quit();
            }
            if (!Env.isSauce())
            {
                AppiumServers.StopLocalService();
            }
		}

        [Test()]
        public void SimpleTouchActionTestCase()
        {
            IList<AppiumWebElement> els = driver.FindElementsByClassName("android.widget.TextView");

            int number1 = els.Count;

            TouchAction tap = new TouchAction(driver);
            tap.Tap(els[4], 10, 5, 2).Perform();

            els = driver.FindElementsByClassName("android.widget.TextView");

            Assert.AreNotEqual(number1, els.Count);
        }

        [Test ()]
		public void ComplexTouchActionTestCase ()
		{
			IList<AppiumWebElement> els = driver.FindElementsByClassName ("android.widget.TextView");
			var loc1 = els [7].Location;
            AppiumWebElement target = els[1];
            var loc2 = target.Location;
			driver.Swipe (loc1.X, loc1.Y, loc2.X, loc2.Y, 800); //this action includes almost all touch actions
            Assert.AreNotEqual(loc2.Y, target.Location.Y);
		}

        [Test()]
        public void SingleMultiActionTestCase()
        {
            IList<AppiumWebElement> els = driver.FindElementsByClassName("android.widget.TextView");
            var loc1 = els[7].Location;
            AppiumWebElement target = els[1];
            var loc2 = target.Location;

            TouchAction swipe = new TouchAction(driver);

            swipe.Press(loc1.X, loc1.Y).Wait(1000)
                    .MoveTo(loc2.X, loc2.Y).Release();

            MultiAction multiAction = new MultiAction(driver);
            multiAction.Add(swipe).Perform();
            Assert.AreNotEqual(loc2.Y, target.Location.Y);
        }

        [Test()]
        public void SequentalMultiActionTestCase()
        {
            string originalActivity = driver.CurrentActivity;
            IList<AppiumWebElement> els = driver.FindElementsByClassName("android.widget.TextView");
            MultiAction multiTouch = new MultiAction(driver);

            TouchAction tap1 = new TouchAction(driver);
            tap1.Press(els[5]).Wait(1500).Release();

            multiTouch.Add(tap1).Add(tap1).Perform();

            Thread.Sleep(2500);
            els = driver.FindElementsByClassName("android.widget.TextView");

            TouchAction tap2 = new TouchAction(driver);
            tap2.Press(els[1]).Wait(1500).Release();

            MultiAction multiTouch2 = new MultiAction(driver);
            multiTouch2.Add(tap2).Add(tap2).Perform();

            Thread.Sleep(2500);
            Assert.AreNotEqual(originalActivity, driver.CurrentActivity);
        }

    }
}


text:
describe StarterFileGroupsController do
  # TODO: add 'role is from a different course' shared tests to each route test below
  shared_examples 'student and ta not permitted' do
    before { subject }
    context 'a grader' do
      let(:role) { create :ta }
      it 'should not be permitted' do
        expect(response.status).to eq 403
      end
    end
    context 'a student' do
      let(:role) { create :student }
      it 'should not be permitted' do
        expect(response.status).to eq 403
      end
    end
  end

  let(:role) { create :instructor }
  let(:assignment) { create :assignment }
  let(:course) { assignment.course }
  describe '#create' do
    subject { post_as role, :create, params: { name: 'b', assignment_id: assignment.id, course_id: course.id } }
    it_behaves_like 'student and ta not permitted'
    before { subject }
    it 'should create a new starter file group' do
      expect(assignment.reload.starter_file_groups).not_to be_empty
    end
    it 'should set the name' do
      expect(assignment.reload.starter_file_groups.first.name).to eq 'b'
    end
  end
  describe '#destroy' do
    let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment }
    subject { delete_as role, :destroy, params: { id: starter_file_group.id, course_id: course.id } }
    it_behaves_like 'student and ta not permitted'

    it 'should delete the starter file group' do
      subject
      expect { starter_file_group.reload }.to raise_error(ActiveRecord::RecordNotFound)
    end
  end
  describe '#download_file' do
    let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment }
    let(:filename) { 'q2.txt' }
    subject do
      get_as role, :download_file, params: { file_name: filename,
                                             id: starter_file_group.id,
                                             course_id: course.id }
    end
    it_behaves_like 'student and ta not permitted'
    before { subject }
    context 'when a file exists' do
      it 'should download a file' do
        expect(response.body).to eq 'q2 content'
      end
    end
    context 'when a nested file exists' do
      let(:filename) { 'q1/q1.txt' }
      it 'should download a file' do
        expect(response.body).to eq 'q1 content'
      end
    end
    context 'when a file does not exist' do
      let(:filename) { 'q3.txt' }
      it 'should download a file with a warning message' do
        expect(response.body).to eq I18n.t('student.submission.missing_file', file_name: filename)
      end
    end
  end
  describe '#update' do
    subject { put_as role, :update, params: { name: 'b', course_id: course.id, id: starter_file_group.id } }
    let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment, name: 'a' }
    it_behaves_like 'student and ta not permitted'
    it 'can update the name' do
      subject
      expect(starter_file_group.reload.name).to eq 'b'
    end
  end
  describe '#download_files' do
    subject { get_as role, :download_files, params: { course_id: course.id, id: starter_file_group.id } }
    let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment, structure: {} }
    it_behaves_like 'student and ta not permitted'
    context 'when the starter file exists' do
      let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment }
      it 'should send a zip file containing the correct content' do
        subject
        content = []
        Zip::InputStream.open(StringIO.new(response.body)) do |io|
          while (entry = io.get_next_entry)
            content << io.read.strip.force_encoding('utf-8') unless entry.name_is_directory?
          end
        end
        expect(content).to contain_exactly('q1 content', 'q2 content')
      end
    end
    context 'when the starter files do not exist' do
      it 'should send a zip file containing the correct content' do
        subject
        Zip::InputStream.open(StringIO.new(response.body)) do |io|
          expect(io.get_next_entry).to be_nil
        end
      end
    end
  end
  describe '#update_files' do
    let(:unzip) { true }
    let(:new_folders) { [] }
    let(:delete_folders) { [] }
    let(:delete_files) { [] }
    let(:new_files) { [] }
    let(:zipfile) { fixture_file_upload('test_zip.zip', 'application/zip') }
    let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment }
    subject do
      put_as role, :update_files, params: { course_id: course.id,
                                            id: starter_file_group.id,
                                            unzip: unzip,
                                            new_folders: new_folders,
                                            delete_folders: delete_folders,
                                            delete_files: delete_files,
                                            new_files: new_files }
    end
    it_behaves_like 'student and ta not permitted'
    context 'uploading a zip file' do
      let(:new_files) { [zipfile] }
      let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment, structure: {} }
      before { subject }
      context 'when unzip if false' do
        let(:unzip) { 'false' }
        it 'should upload the right files' do
          expect(starter_file_group.files_and_dirs).to contain_exactly('test_zip.zip')
        end
        it 'should create a new starter file entry' do
          expect(starter_file_group.starter_file_entries.pluck(:path)).to include('test_zip.zip')
        end
      end
      context 'when unzip if true' do
        it 'should upload the right files' do
          files = %w[test_zip test_zip/Shapes.java test_zip/zip_subdir test_zip/zip_subdir/TestShapes.java]
          expect(starter_file_group.files_and_dirs).to contain_exactly(*files)
        end
        it 'should create a new starter file entry' do
          expect(starter_file_group.starter_file_entries.pluck(:path)).to include('test_zip')
        end
      end
    end
    context 'uploading a folder' do
      let(:new_folders) { %w[new_folder q1/new_nested_folder] }
      before { subject }
      it 'should create a top level directory' do
        expect(starter_file_group.reload.files_and_dirs).to include('new_folder')
        expect(Dir.exist?(starter_file_group.path + 'new_folder')).to be true
      end
      it 'should create a new starter file entry' do
        expect(starter_file_group.starter_file_entries.pluck(:path)).to include('new_folder')
      end
      it 'should create a nested directory' do
        expect(starter_file_group.files_and_dirs).to include('q1/new_nested_folder')
        expect(Dir.exist?(starter_file_group.path + 'q1/new_nested_folder')).to be true
      end
    end
    context 'deleting a file' do
      let(:delete_files) { %w[q2.txt q1/q1.txt] }
      before { subject }
      it 'should delete a top level file' do
        expect(starter_file_group.reload.files_and_dirs).not_to include('q2.txt')
        expect(File.exist?(starter_file_group.path + 'q2.txt')).to be false
      end
      it 'should delete a nested file' do
        expect(starter_file_group.reload.files_and_dirs).not_to include('q1/q1.txt')
        expect(File.exist?(starter_file_group.path + 'q1/q1.txt')).to be false
      end
      it 'should delete a starter file entry for the top level file' do
        expect(starter_file_group.starter_file_entries.pluck(:path)).not_to include('q2.txt')
      end
      it 'should not delete a starter file entry for the nested file' do
        expect(starter_file_group.starter_file_entries.pluck(:path)).to include('q1')
      end
    end
    context 'deleting a folder' do
      let(:delete_folders) { %w[q1 q2/q2] }
      let(:structure) { { 'q1/': nil, 'q2/q2/': nil, 'q2/q2/q2.txt': 'content' } }
      let(:starter_file_group) { create :starter_file_group_with_entries, assignment: assignment, structure: structure }
      before { subject }
      it 'should delete a top level folder' do
        expect(starter_file_group.reload.files_and_dirs).not_to include('q1')
        expect(Dir.exist?(starter_file_group.path + 'q1')).to be false
      end
      it 'should delete a nested folder' do
        expect(starter_file_group.reload.files_and_dirs).not_to include('q2/q2')
        expect(Dir.exist?(starter_file_group.path + 'q2/q2')).to be false
      end
      it 'should delete a starter file entry for the top level file' do
        expect(starter_file_group.starter_file_entries.pluck(:path)).not_to include('q1')
      end
      it 'should not delete a starter file entry for the nested file' do
        expect(starter_file_group.starter_file_entries.pluck(:path)).to include('q2')
      end
    end
  end
end


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

namespace Light.Data
{
    internal class LightSelectJoin<K> : SelectJoinBase<K>
    {
        private readonly QueryExpression _query;

        private readonly OrderExpression _order;

        private readonly bool _distinct;

        private readonly Region _region;

        private readonly SafeLevel _level;

        public override QueryExpression QueryExpression => _query;

        public override OrderExpression OrderExpression => _order;

        public override bool Distinct => _distinct;

        public override Region Region => _region;

        public override SafeLevel Level => _level;

        protected LightSelectJoin(DataContext context, LambdaExpression expression, List<IJoinModel> models, List<IMap> maps, QueryExpression query, OrderExpression order, bool distinct, Region region, SafeLevel level)
            : base(context, expression, models, maps)
        {
            _query = query;
            _order = order;
            _distinct = distinct;
            _region = region;
            _level = level;
        }

        #region IEnumerable implementation

        public override IEnumerator<K> GetEnumerator()
        {
            var queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, _region);
            return _context.QueryDataDefineReader<K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, Dele).GetEnumerator();
        }

        #endregion

        public override List<K> ToList()
        {
            var queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, _region);
            return _context.QueryDataDefineList<K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, Dele);

        }

        public override K[] ToArray()
        {
            return ToList().ToArray();
        }

        public override K First()
        {
            return ElementAt(0);
        }

        public override K ElementAt(int index)
        {
            var region = new Region(index, 1);
            var queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, region);
            return _context.QueryDataDefineSingle<K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? 0 : region.Start, queryCommand.State, Dele);
        }

        #region async

        public override async Task<List<K>> ToListAsync(CancellationToken cancellationToken = default)
        {
            var queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, _region);
            return await _context.QueryDataDefineListAsync<K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? null : _region, queryCommand.State, Dele, cancellationToken);
        }

        public override async Task<K[]> ToArrayAsync(CancellationToken cancellationToken = default)
        {
            var list = await ToListAsync(cancellationToken);
            return list.ToArray();
        }

        public override async Task<K> FirstAsync(CancellationToken cancellationToken = default)
        {
            return await ElementAtAsync(0, cancellationToken);
        }

        public override async Task<K> ElementAtAsync(int index, CancellationToken cancellationToken = default)
        {
            var region = new Region(index, 1);
            var queryCommand = _context.Database.QueryJoinData(_context, Mapping, Selector, Models, _query, _order, _distinct, region);
            return await _context.QueryDataDefineSingleAsync<K>(Mapping, _level, queryCommand.Command, queryCommand.InnerPage ? 0 : region.Start, queryCommand.State, Dele, cancellationToken);
        }

        #endregion
    }
}


text:
<?xml version="1.0" encoding="UTF-8"?>

<resources xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <string name="glance_error_layout_title" msgid="2896109737634971880">"Glance 應用程式小工具錯誤"</string>
    <string name="glance_error_layout_text" msgid="8513923302775602854">"使用 "<tt>"adb logcat"</tt>" 搜尋 "<tt>"GlanceAppWidget"</tt>",查看確實的錯誤資料"</string>
</resources>


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

using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Reflection;
using Serilog.Core;
using Serilog.Debugging;
using Serilog.Events;

namespace Serilog.Extras.DestructureByIgnoring
{
    class DestructureByIgnoringPolicy<TDestructure> : IDestructuringPolicy
    {
        private readonly IEnumerable<PropertyInfo> _propertiesToInclude;
        private readonly Type _destructureType;

        public DestructureByIgnoringPolicy(params Expression<Func<TDestructure, object>>[] ignoredProperties)
        {
            _destructureType = typeof(TDestructure);
            var namesOfPropertiesToIgnore = ignoredProperties.Select(GetNameOfPropertyToIgnore).ToArray();
            var runtimeProperties = _destructureType.GetRuntimeProperties();

            _propertiesToInclude = runtimeProperties.Where(p => !namesOfPropertiesToIgnore.Contains(p.Name)).ToArray();
        }

        public bool TryDestructure(object value, ILogEventPropertyValueFactory propertyValueFactory, out LogEventPropertyValue result)
        {
            if (value == null || value.GetType() != typeof(TDestructure))
            {
                result = null;
                return false;
            }

            result = BuildStructure(value, propertyValueFactory);

            return true;
        }

        private LogEventPropertyValue BuildStructure(object value, ILogEventPropertyValueFactory propertyValueFactory)
        {
            var structureProperties = new List<LogEventProperty>();
            foreach (var propertyInfo in _propertiesToInclude)
            {
                object propertyValue;
                try
                {
                    propertyValue = propertyInfo.GetValue(value);
                }
                catch (TargetInvocationException ex)
                {
                    SelfLog.WriteLine("The property accessor {0} threw exception {1}", propertyInfo, ex);
                    propertyValue = "The property accessor threw an exception: " + ex.InnerException.GetType().Name;
                }

                var logEventPropertyValue = BuildLogEventProperty(propertyValue, propertyValueFactory);

                structureProperties.Add(new LogEventProperty(propertyInfo.Name, logEventPropertyValue));
            }

            return new StructureValue(structureProperties, _destructureType.Name);
        }

        private static LogEventPropertyValue BuildLogEventProperty(object propertyValue, ILogEventPropertyValueFactory propertyValueFactory)
        {
            return propertyValue == null ? new ScalarValue(null) : propertyValueFactory.CreatePropertyValue(propertyValue, true);
        }

        private static string GetNameOfPropertyToIgnore(Expression<Func<TDestructure, object>> ignoredProperty)
        {
            return ignoredProperty.GetPropertyNameFromExpression();
        }
    }
}


text:
(function (global, factory) {
  if (typeof define === "function" && define.amd) {
    define([], factory);
  } else if (typeof exports !== "undefined") {
    factory();
  } else {
    var mod = {
      exports: {}
    };
    factory();
    global.bootstrapTableEtEE = mod.exports;
  }
})(this, function () {
  'use strict';

  /**
   * Bootstrap Table Estonian translation
   * Author: kristjan@logist.it>
   */
  (function ($) {
    $.fn.bootstrapTable.locales['et-EE'] = {
      formatLoadingMessage: function formatLoadingMessage() {
        return 'Päring käib, palun oota';
      },
      formatRecordsPerPage: function formatRecordsPerPage(pageNumber) {
        return pageNumber + ' rida lehe kohta';
      },
      formatShowingRows: function formatShowingRows(pageFrom, pageTo, totalRows) {
        return 'N\xE4itan tulemusi ' + pageFrom + ' kuni ' + pageTo + ' - kokku ' + totalRows + ' tulemust';
      },
      formatDetailPagination: function formatDetailPagination(totalRows) {
        return 'Showing ' + totalRows + ' rows';
      },
      formatSearch: function formatSearch() {
        return 'Otsi';
      },
      formatNoMatches: function formatNoMatches() {
        return 'Päringu tingimustele ei vastanud ühtegi tulemust';
      },
      formatPaginationSwitch: function formatPaginationSwitch() {
        return 'Näita/Peida lehtedeks jagamine';
      },
      formatRefresh: function formatRefresh() {
        return 'Värskenda';
      },
      formatToggle: function formatToggle() {
        return 'Lülita';
      },
      formatColumns: function formatColumns() {
        return 'Veerud';
      },
      formatFullscreen: function formatFullscreen() {
        return 'Fullscreen';
      },
      formatAllRows: function formatAllRows() {
        return 'Kõik';
      },
      formatAutoRefresh: function formatAutoRefresh() {
        return 'Auto Refresh';
      },
      formatExport: function formatExport() {
        return 'Export data';
      },
      formatClearFilters: function formatClearFilters() {
        return 'Clear filters';
      },
      formatJumpto: function formatJumpto() {
        return 'GO';
      },
      formatAdvancedSearch: function formatAdvancedSearch() {
        return 'Advanced search';
      },
      formatAdvancedCloseButton: function formatAdvancedCloseButton() {
        return 'Close';
      }
    };

    $.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.locales['et-EE']);
  })(jQuery);
});


text:
import uuid

# Note this import doesn't actually exist
import foo

from .a import x

class Y(object):
    x = x[0]

def test(default=None):
    return default

class BaseModel(object):
    uuid = test(default=uuid.uuid4)

class bar(object):
    foo = foo.baz


text:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Resource ModuleID="1" OwnerModuleID="1" ResRefID="7" Folder="\Core Scripts\" ResRefName="plot_core" IsCore="1" OwnerIsCore="1" Type="3" State="0" ObjectName="" Relationship="" ResType="nss" URI="bw-db://.\BWDATOOLSET/bw_dragonage_content\plot_core.nss?moduleid=1&resrefid=7" Requested="0">
	<Agent type="empty">
		<ResRefName>plot_core</ResRefName>
		<LocalCopy type="bool">False</LocalCopy>
		<text>//::///////////////////////////////////////////////
//:: Plot Events Template
//:: Copyright (c) 2003 Bioware Corp.
//:://////////////////////////////////////////////
/*
    Plot events
*/
//:://////////////////////////////////////////////
//:: Created By: Yaron
//:: Created On: July 21st, 2006
//:://////////////////////////////////////////////

#include "log_h"
#include "utility_h"
#include "wrappers_h"
#include "plot_h"

//#include "PLOT_NAME_GOES_HERE"

int StartingConditional()
{
    event eParms = GetCurrentEvent();                // Contains all input parameters
    int nType = GetEventType(eParms);               // GET or SET call
    string strPlot = GetEventString(eParms, 0);         // Plot GUID
    int nFlag = GetEventInteger(eParms, 1);          // The bit flag # being affected
    object oParty = GetEventCreator(eParms);      // The owner of the plot table for this script
    object oConversationOwner = GetEventObject(eParms, 0); // Owner on the conversation, if any
    int nPlotType = GetEventInteger(eParms, 5);
    int bIsTutorial = GetM2DAInt(TABLE_PLOT_TYPES, "IsTutorial", nPlotType);
    int bIsCodex = GetM2DAInt(TABLE_PLOT_TYPES, "IsCodex", nPlotType);
    int nResult = FALSE; // used to return value for DEFINED GET events
    object oPC = GetHero();

    plot_GlobalPlotHandler(eParms); // any global plot operations, including debug info

    if(nType == EVENT_TYPE_SET_PLOT) // actions -> normal flags only
    {
        int nValue = GetEventInteger(eParms, 2);        // On SET call, the value about to be written (on a normal SET that should be '1', and on a 'clear' it should be '0')
        int nOldValue = GetEventInteger(eParms, 3);     // On SET call, the current flag value (can be either 1 or 0 regardless if it's a set or clear event)
        // IMPORTANT: The flag value on a SET event is set only AFTER this script finishes running!

        switch(nFlag)
        {

        }
     }
     else // EVENT_TYPE_GET_PLOT -> defined conditions only
     {

        switch(nFlag)
        {

        }

    }

    plot_OutputDefinedFlag(eParms, nResult);
    return nResult;
}</text>
	</Agent>
</Resource>


text:
namespace Microsoft.AspNet.Razor.Generator.Compiler.CSharp
{
    public class CSharpBaseTypeVisitor : CodeVisitor<CSharpCodeWriter>
    {
        public CSharpBaseTypeVisitor(CSharpCodeWriter writer, CodeGeneratorContext context)
            : base(writer, context) { }

        public string CurrentBaseType { get; set; }

        protected override void Visit(SetBaseTypeChunk chunk)
        {
            CurrentBaseType = chunk.TypeName;
        }
    }
}


text:
package org.wso2.carbon.apimgt.rest.api.admin.dto;

import com.google.gson.annotations.SerializedName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import java.util.Objects;

/**
 * HeaderConditionDTO
 */
public class HeaderConditionDTO   {
  @SerializedName("headerName")
  private String headerName = null;

  @SerializedName("headerValue")
  private String headerValue = null;

  public HeaderConditionDTO headerName(String headerName) {
    this.headerName = headerName;
    return this;
  }

   /**
   * Get headerName
   * @return headerName
  **/
  @ApiModelProperty(required = true, value = "")
  public String getHeaderName() {
    return headerName;
  }

  public void setHeaderName(String headerName) {
    this.headerName = headerName;
  }

  public HeaderConditionDTO headerValue(String headerValue) {
    this.headerValue = headerValue;
    return this;
  }

   /**
   * Get headerValue
   * @return headerValue
  **/
  @ApiModelProperty(required = true, value = "")
  public String getHeaderValue() {
    return headerValue;
  }

  public void setHeaderValue(String headerValue) {
    this.headerValue = headerValue;
  }

  @Override
  public boolean equals(java.lang.Object o) {
    if (this == o) {
      return true;
    }
    if (o == null || getClass() != o.getClass()) {
      return false;
    }
    HeaderConditionDTO headerCondition = (HeaderConditionDTO) o;
    return Objects.equals(this.headerName, headerCondition.headerName) &&
        Objects.equals(this.headerValue, headerCondition.headerValue);
  }

  @Override
  public int hashCode() {
    return Objects.hash(headerName, headerValue);
  }

  @Override
  public String toString() {
    StringBuilder sb = new StringBuilder();
    sb.append("class HeaderConditionDTO {\n");

    sb.append("    headerName: ").append(toIndentedString(headerName)).append("\n");
    sb.append("    headerValue: ").append(toIndentedString(headerValue)).append("\n");
    sb.append("}");
    return sb.toString();
  }

  /**
   * Convert the given object to string with each line indented by 4 spaces
   * (except the first line).
   */
  private String toIndentedString(java.lang.Object o) {
    if (o == null) {
      return "null";
    }
    return o.toString().replace("\n", "\n    ");
  }
}