text:
\hypertarget{structrocksdb_1_1BlockBasedTableOptions}{}\section{rocksdb\+:\+:Block\+Based\+Table\+Options Struct Reference}
\label{structrocksdb_1_1BlockBasedTableOptions}\index{rocksdb\+::\+Block\+Based\+Table\+Options@{rocksdb\+::\+Block\+Based\+Table\+Options}}
\subsection*{Public Types}
\begin{DoxyCompactItemize}
\item
enum {\bfseries Index\+Type} \+: char \{ {\bfseries k\+Binary\+Search},
{\bfseries k\+Hash\+Search}
 \}\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a93cf5570b2c1a10470db336b9d83e2ce}{}\label{structrocksdb_1_1BlockBasedTableOptions_a93cf5570b2c1a10470db336b9d83e2ce}

\end{DoxyCompactItemize}
\subsection*{Public Attributes}
\begin{DoxyCompactItemize}
\item
std\+::shared\+\_\+ptr$<$ \hyperlink{classrocksdb_1_1FlushBlockPolicyFactory}{Flush\+Block\+Policy\+Factory} $>$ {\bfseries flush\+\_\+block\+\_\+policy\+\_\+factory}\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ad73f8618a8e2f822a898b6b50351208a}{}\label{structrocksdb_1_1BlockBasedTableOptions_ad73f8618a8e2f822a898b6b50351208a}

\item
bool {\bfseries cache\+\_\+index\+\_\+and\+\_\+filter\+\_\+blocks} = false\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a9b47fc5e2871d2928b6b4c6bffe6017c}{}\label{structrocksdb_1_1BlockBasedTableOptions_a9b47fc5e2871d2928b6b4c6bffe6017c}

\item
bool {\bfseries pin\+\_\+l0\+\_\+filter\+\_\+and\+\_\+index\+\_\+blocks\+\_\+in\+\_\+cache} = false\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ac711b41f7055cdae0e3554b57bfe114f}{}\label{structrocksdb_1_1BlockBasedTableOptions_ac711b41f7055cdae0e3554b57bfe114f}

\item
Index\+Type {\bfseries index\+\_\+type} = k\+Binary\+Search\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ae00971fc952135fe87df4f9f041e5289}{}\label{structrocksdb_1_1BlockBasedTableOptions_ae00971fc952135fe87df4f9f041e5289}

\item
bool {\bfseries hash\+\_\+index\+\_\+allow\+\_\+collision} = true\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a1404fa6a494624d4dca4038e06312003}{}\label{structrocksdb_1_1BlockBasedTableOptions_a1404fa6a494624d4dca4038e06312003}

\item
Checksum\+Type {\bfseries checksum} = k\+C\+R\+C32c\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a1adc5994a69a8cd0e1647148d0c2f752}{}\label{structrocksdb_1_1BlockBasedTableOptions_a1adc5994a69a8cd0e1647148d0c2f752}

\item
bool {\bfseries no\+\_\+block\+\_\+cache} = false\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ae3a1448054303148e9c1d73c0d3a8149}{}\label{structrocksdb_1_1BlockBasedTableOptions_ae3a1448054303148e9c1d73c0d3a8149}

\item
std\+::shared\+\_\+ptr$<$ \hyperlink{classrocksdb_1_1Cache}{Cache} $>$ {\bfseries block\+\_\+cache} = nullptr\hypertarget{structrocksdb_1_1BlockBasedTableOptions_af7012b6cfc023265669ca3db6fd8a6ac}{}\label{structrocksdb_1_1BlockBasedTableOptions_af7012b6cfc023265669ca3db6fd8a6ac}

\item
std\+::shared\+\_\+ptr$<$ \hyperlink{classrocksdb_1_1Cache}{Cache} $>$ {\bfseries block\+\_\+cache\+\_\+compressed} = nullptr\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a333d1974b959b500e643e73d42f079f2}{}\label{structrocksdb_1_1BlockBasedTableOptions_a333d1974b959b500e643e73d42f079f2}

\item
size\+\_\+t {\bfseries block\+\_\+size} = 4 $\ast$ 1024\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ac6d52bc1b24b8420aa8565be69d8c503}{}\label{structrocksdb_1_1BlockBasedTableOptions_ac6d52bc1b24b8420aa8565be69d8c503}

\item
int {\bfseries block\+\_\+size\+\_\+deviation} = 10\hypertarget{structrocksdb_1_1BlockBasedTableOptions_ad32cd3d71e1f30b9962a7c8de3cc16e5}{}\label{structrocksdb_1_1BlockBasedTableOptions_ad32cd3d71e1f30b9962a7c8de3cc16e5}

\item
int {\bfseries block\+\_\+restart\+\_\+interval} = 16\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a8bd604aaca756ab9e6308c8b198283ef}{}\label{structrocksdb_1_1BlockBasedTableOptions_a8bd604aaca756ab9e6308c8b198283ef}

\item
int {\bfseries index\+\_\+block\+\_\+restart\+\_\+interval} = 1\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a23a65c7cba2b2b44386cceb5b2077604}{}\label{structrocksdb_1_1BlockBasedTableOptions_a23a65c7cba2b2b44386cceb5b2077604}

\item
bool {\bfseries use\+\_\+delta\+\_\+encoding} = true\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a115eda587a9b226a49c662310fc66fae}{}\label{structrocksdb_1_1BlockBasedTableOptions_a115eda587a9b226a49c662310fc66fae}

\item
std\+::shared\+\_\+ptr$<$ const \hyperlink{classrocksdb_1_1FilterPolicy}{Filter\+Policy} $>$ {\bfseries filter\+\_\+policy} = nullptr\hypertarget{structrocksdb_1_1BlockBasedTableOptions_accd96f660a1807c81d9f29fa56bfaa7c}{}\label{structrocksdb_1_1BlockBasedTableOptions_accd96f660a1807c81d9f29fa56bfaa7c}

\item
bool {\bfseries whole\+\_\+key\+\_\+filtering} = true\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a28ac408b75f3a8ce18174ef0314790cb}{}\label{structrocksdb_1_1BlockBasedTableOptions_a28ac408b75f3a8ce18174ef0314790cb}

\item
bool {\bfseries skip\+\_\+table\+\_\+builder\+\_\+flush} = false\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a9134bd76833f7acda42d5ed177f94b62}{}\label{structrocksdb_1_1BlockBasedTableOptions_a9134bd76833f7acda42d5ed177f94b62}

\item
uint32\+\_\+t {\bfseries format\+\_\+version} = 2\hypertarget{structrocksdb_1_1BlockBasedTableOptions_a6c14b0303d48e4d6a2ceec75b2d4e0ae}{}\label{structrocksdb_1_1BlockBasedTableOptions_a6c14b0303d48e4d6a2ceec75b2d4e0ae}

\end{DoxyCompactItemize}

The documentation for this struct was generated from the following file\+:\begin{DoxyCompactItemize}
\item
Appserver/src/external/rocksdb/table.\+h\end{DoxyCompactItemize}


text:
import json
from typing import Any, Dict, Mapping, Optional

from mock import patch

from eduid_common.api.exceptions import ApiException
from eduid_common.api.testing import EduidAPITestCase

from eduid_webapp.personal_data.app import PersonalDataApp, pd_init_app

class PersonalDataTests(EduidAPITestCase):
    app: PersonalDataApp

    def setUp(self):
        super(PersonalDataTests, self).setUp(copy_user_to_private=True)

    def load_app(self, config: Mapping[str, Any]) -> PersonalDataApp:
        """
        Called from the parent class, so we can provide the appropriate flask
        app for this test case.
        """
        return pd_init_app('testing', config)

    def update_config(self, config: Dict[str, Any]) -> Dict[str, Any]:
        config.update(
            {
                'available_languages': {'en': 'English', 'sv': 'Svenska'},
                'msg_broker_url': 'amqp://dummy',
                'am_broker_url': 'amqp://dummy',
                'celery_config': {'result_backend': 'amqp', 'task_serializer': 'json'},
            }
        )
        return config

    # parameterized test methods

    def _get_user(self, eppn: Optional[str] = None):
        """
        Send a GET request to get the personal data of a user

        :param eppn: the eppn of the user
        """
        response = self.browser.get('/user')
        self.assertEqual(response.status_code, 302)  # Redirect to token service

        eppn = eppn or self.test_user_data['eduPersonPrincipalName']
        with self.session_cookie(self.browser, eppn) as client:
            response2 = client.get('/user')

            return json.loads(response2.data)

    def _get_user_all_data(self, eppn: Optional[str] = None):
        """
        Send a GET request to get all the data of a user

        :param eppn: the eppn of the user
        """
        response = self.browser.get('/all-user-data')
        self.assertEqual(response.status_code, 302)  # Redirect to token service

        eppn = eppn or self.test_user_data['eduPersonPrincipalName']
        with self.session_cookie(self.browser, eppn) as client:
            response2 = client.get('/all-user-data')

            return json.loads(response2.data)

    @patch('eduid_common.api.am.AmRelay.request_user_sync')
    def _post_user(self, mock_request_user_sync: Any, mod_data: Optional[dict] = None):
        """
        POST personal data for some user

        :param eppn: the eppn of the user
        """
        mock_request_user_sync.side_effect = self.request_user_sync
        eppn = self.test_user_data['eduPersonPrincipalName']
        with self.session_cookie(self.browser, eppn) as client:
            with self.app.test_request_context():
                with client.session_transaction() as sess:
                    data = {
                        'given_name': 'Peter',
                        'surname': 'Johnson',
                        'display_name': 'Peter Johnson',
                        'language': 'en',
                        'csrf_token': sess.get_csrf_token(),
                    }
                if mod_data:
                    data.update(mod_data)
            response = client.post('/user', data=json.dumps(data), content_type=self.content_type_json)
            return json.loads(response.data)

    def _get_user_nins(self, eppn: Optional[str] = None):
        """
        GET a list of all the nins of some user

        :param eppn: the eppn of the user
        """
        response = self.browser.get('/nins')
        self.assertEqual(response.status_code, 302)  # Redirect to token service

        eppn = eppn or self.test_user_data['eduPersonPrincipalName']
        with self.session_cookie(self.browser, eppn) as client:
            response2 = client.get('/nins')

            return json.loads(response2.data)

    # actual test methods

    def test_get_user(self):
        user_data = self._get_user()
        self.assertEqual(user_data['type'], 'GET_PERSONAL_DATA_USER_SUCCESS')
        self.assertEqual(user_data['payload']['given_name'], 'John')
        self.assertEqual(user_data['payload']['surname'], 'Smith')
        self.assertEqual(user_data['payload']['display_name'], 'John Smith')
        self.assertEqual(user_data['payload']['language'], 'en')
        # Check that unwanted data is not serialized
        self.assertIsNotNone(self.test_user.to_dict().get('passwords'))
        self.assertIsNone(user_data['payload'].get('passwords'))

    def test_get_unknown_user(self):
        with self.assertRaises(ApiException):
            self._get_user(eppn='fooo-fooo')

    def test_get_user_all_data(self):
        user_data = self._get_user_all_data()
        self.assertEqual(user_data['type'], 'GET_PERSONAL_DATA_ALL_USER_DATA_SUCCESS')
        self.assertEqual(user_data['payload']['given_name'], 'John')
        self.assertEqual(user_data['payload']['surname'], 'Smith')
        self.assertEqual(user_data['payload']['display_name'], 'John Smith')
        self.assertEqual(user_data['payload']['language'], 'en')
        phones = user_data['payload']['phones']
        self.assertEqual(len(phones), 2)
        self.assertEqual(phones[0]['number'], u'+34609609609')
        self.assertTrue(phones[0]['verified'])
        nins = user_data['payload']['nins']
        self.assertEqual(len(nins), 2)
        self.assertEqual(nins[0]['number'], u'197801011234')
        self.assertTrue(nins[0]['verified'])
        emails = user_data['payload']['emails']
        self.assertEqual(len(emails), 2)
        self.assertEqual(emails[0]['email'], u'johnsmith@example.com')
        self.assertTrue(emails[0]['verified'])

        # Check that unwanted data is not serialized
        self.assertIsNotNone(self.test_user.to_dict().get('passwords'))
        self.assertIsNone(user_data['payload'].get('passwords'))

    def test_get_unknown_user_all_data(self):
        with self.assertRaises(ApiException):
            self._get_user_all_data(eppn='fooo-fooo')

    def test_post_user(self):
        resp_data = self._post_user()
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_SUCCESS')
        self.assertEqual(resp_data['payload']['surname'], 'Johnson')
        self.assertEqual(resp_data['payload']['given_name'], 'Peter')
        self.assertEqual(resp_data['payload']['display_name'], 'Peter Johnson')
        self.assertEqual(resp_data['payload']['language'], 'en')

    def test_post_user_bad_csrf(self):
        resp_data = self._post_user(mod_data={'csrf_token': 'wrong-token'})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['csrf_token'], ['CSRF failed to validate'])

    def test_post_user_no_given_name(self):
        resp_data = self._post_user(mod_data={'given_name': ''})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['given_name'], ['pdata.field_required'])

    def test_post_user_blank_given_name(self):
        resp_data = self._post_user(mod_data={'given_name': ' '})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['given_name'], ['pdata.field_required'])

    def test_post_user_no_surname(self):
        resp_data = self._post_user(mod_data={'surname': ''})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['surname'], ['pdata.field_required'])

    def test_post_user_blank_surname(self):
        resp_data = self._post_user(mod_data={'surname': ' '})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['surname'], ['pdata.field_required'])

    def test_post_user_no_display_name(self):
        resp_data = self._post_user(mod_data={'display_name': ''})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['display_name'], ['pdata.field_required'])

    def test_post_user_no_language(self):
        resp_data = self._post_user(mod_data={'language': ''})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['language'], ["Language '' is not available"])

    def test_post_user_unknown_language(self):
        resp_data = self._post_user(mod_data={'language': 'es'})
        self.assertEqual(resp_data['type'], 'POST_PERSONAL_DATA_USER_FAIL')
        self.assertEqual(resp_data['payload']['error']['language'], ["Language 'es' is not available"])

    def test_get_user_nins(self):
        nin_data = self._get_user_nins()
        self.assertEqual(nin_data['type'], 'GET_PERSONAL_DATA_NINS_SUCCESS')
        self.assertEqual(nin_data['payload']['nins'][1]['number'], '197801011235')
        self.assertEqual(len(nin_data['payload']['nins']), 2)

redpajama_set_name: RedPajamaGithub


text:
'use strict';

describe('column directive tests', function() {

  var $compile,
      $rootScope,
      $scope,
      directive,
      dashboard;

  // Load the myApp module, which contains the directive
  beforeEach(module('adf'));

  // Store references to $rootScope and $compile
  // so they are available to all tests in this describe block
  beforeEach(inject(function(_$compile_, _$rootScope_, _dashboard_){
      // The injector unwraps the underscores (_) from around the parameter names when matching
      dashboard = _dashboard_;
      dashboard.widgets = [];
      dashboard.widgets['test'] = {
        title: 'Test',
        template: '
Hello
'
      };

      $compile = _$compile_;
      $rootScope = _$rootScope_;
      $scope = $rootScope.$new();
      directive = '<adf-dashboard-column column="column" adf-model="adfModel" options="options" edit-mode="editMode" />';

      $scope.column = {};
      $scope.adfModel = {};
      $scope.options = {};
      $scope.editMode = false;
  }));

  function compileTemplate(template) {
      // Compile a piece of HTML containing the directive
      var el = $compile(template)($scope);
      $scope.$digest();
      return el;
  }

  it('should render a single column without widgets', function() {
      var element = compileTemplate(directive);
      expect(element.hasClass("column")).toBeTruthy();
      expect(element.attr("adf-id").length).toBeDefined();
      expect(element.find(".widget").length).toBe(0);
  });

  it('should render a single column with a single widget', function() {
      $scope.column = {
        widgets: [{
          type: 'test'
        }]
      };

      var element = compileTemplate(directive);
      expect(element.hasClass("column")).toBeTruthy();
      expect(element.find(".widget").length).toBe(1);
      expect(element.find("div.test-widget").text()).toBe('Hello');
  });

  it('should render a single column with a nested row', function() {
      $scope.column = {
        rows: [{}]
      };

      var element = compileTemplate(directive);
      expect(element.find(".row").length).toBe(1);
  });

    it('should create the sortable', function () {
        spyOn(Sortable, 'create');

        var element = compileTemplate(directive);
        $scope.$digest();

        expect(Sortable.create).toHaveBeenCalled();
    });

  describe('applySortable', function () {
    var fromElement, itemElement, sourceColumn, desinationColumn, event, element, onAdd, onRemove, onUpdate;

    beforeEach(function () {
      spyOn(Sortable, 'create')
      .and.callFake(function (element, options) {
        onAdd = options.onAdd;
        onRemove = options.onRemove;
        onUpdate = options.onUpdate;
      });

      spyOn($rootScope, '$broadcast').and.callThrough();

      fromElement = angular.element("
")[0];
      itemElement = angular.element("
")[0];
      sourceColumn = {cid: '1', widgets: [{wid: '2', type: 'test'}]};
      desinationColumn = {cid: '2', widgets: []};

      $scope.adfModel.rows = [
        {
          columns: [sourceColumn]
        }
      ];

      $scope.column = desinationColumn;

      event = {
        from: fromElement,
        item: itemElement
      };

      element = compileTemplate(directive);
      $scope.$digest();
    });

    it('should broadcast an event after adding the widget to the column', function () {

      onAdd(event);

      expect(Sortable.create).toHaveBeenCalled();
      expect($rootScope.$broadcast).toHaveBeenCalled();
    });

    it('should broadcast an event after removing the widget from the column', function () {

      onRemove(event);

      expect(Sortable.create).toHaveBeenCalled();
      expect($rootScope.$broadcast).toHaveBeenCalled();
    });
  });
});


text:
package org.apache.ignite.internal.processors.cache.query.continuous;

import org.apache.ignite.cache.CacheAtomicityMode;

import static org.apache.ignite.cache.CacheAtomicityMode.TRANSACTIONAL;

/**
 *
 */
public class IgniteCacheContinuousQueryClientTxReconnectTest extends IgniteCacheContinuousQueryClientReconnectTest {
    /** {@inheritDoc} */
    @Override protected CacheAtomicityMode atomicMode() {
        return TRANSACTIONAL;
    }
}


text:
/**
 *

 * Provides implementation of {@link cz.cuni.mff.spl.evaluator.output.EvaluatorOutput}
 * for generating HTML pages describing evaluation results.
 *

 * Main class is {@link cz.cuni.mff.spl.evaluator.output.impl.html2.Html2EvaluatorOutput}.
 *

 * Note: Number 2 in name of package and main class has no special meaning other than
 * this is second implementation of HTML output which uses XSLT for output creation.
 * The first implementation used direct HTML generation using {@link java.lang.StringBuilder}s
 * and was completely removed.
 */
package cz.cuni.mff.spl.evaluator.output.impl.html2;


text:
package io.v.vdl.psi.impl;

import java.util.List;
import org.jetbrains.annotations.*;
import com.intellij.lang.ASTNode;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiElementVisitor;
import com.intellij.psi.util.PsiTreeUtil;
import static io.v.vdl.psi.VdlTypes.*;
import io.v.vdl.psi.VdlCompositeElementImpl;
import io.v.vdl.psi.*;

public class VdlErrorDetailImpl extends VdlCompositeElementImpl implements VdlErrorDetail {

  public VdlErrorDetailImpl(ASTNode node) {
    super(node);
  }

  public void accept(@NotNull VdlVisitor visitor) {
    visitor.visitErrorDetail(this);
  }

  public void accept(@NotNull PsiElementVisitor visitor) {
    if (visitor instanceof VdlVisitor) accept((VdlVisitor)visitor);
    else super.accept(visitor);
  }

  @Override
  @Nullable
  public VdlActionIdentifier getActionIdentifier() {
    return findChildByClass(VdlActionIdentifier.class);
  }

  @Override
  @Nullable
  public VdlErrorLanguageSpec getErrorLanguageSpec() {
    return findChildByClass(VdlErrorLanguageSpec.class);
  }

}


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

<!DOCTYPE document PUBLIC "-//APACHE//DTD Documentation V2.0//EN" "http://forrest.apache.org/dtd/document-v20.dtd">

<document>

    <title>Index</title>

Symbols
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z

Symbols

  +        addition operator

  ?:       bincond operator

  /* */   comments - multi-line

  --       comments - single-line

  #         deference operator (map)

  .         deference operator (tuple, bag)

  ::        disambiguate operator

  /         division operator

  ==       equal operator

  >         greater than operator

  >=       greater than or equal to operator

  <         less than operator

  <=       less than or equal to operator

  %        modulo operator

  *         multiplication operator

  !=        not equal operator

  ..         project-range expression

  -         sign operator (negative)

  +        sign operator (positive)

  *         star expression

  -         subtraction operator

  ( )       type construction operator (tuple)

  { }       type construction operator (bag)

  [ ]       type construction operator (map)

A (top) ----------------------------------------------

ABS function

accumulator interface

ACOS function

 AddForEach optimization rule

aggregate functions

aggregations (hash-based) in map task

algebraic interface

aliases (for fields, relations). See referencing.

Amazon S3

AND (Boolean)

arithmetic operators

ASIN function

ATAN function

autoship (streaming). See also ship

AVG function

B (top) ----------------------------------------------

backward compatibility (multi-query execution)

bag functions

bags (data type)

    and memory allocation

    and relations

    and schemas

    and TOBAG function

    and type construction operators

    schemas for multiple types

    syntax

batch mode. See also memory management

bincond operator ( ?: )

BinStorage function

Boolean expressions

Boolean operators

    AND operator

    OR operator

    NOT operator

BoundScript.java object

building Pig

built in functions

C (top) ----------------------------------------------

cache (streaming)

case sensitivity

casting types

    cast operators

    custom converters (BinStorage)

    relations to scalars

    See also types tables

CBRT function

CEIL function

checkSchema method

COGROUP operator

 ColumnMapKeyPrune optimization rule

combiner

comments (in Pig Scripts)

comparison operators

compression (of data)

    handling compression

    compressing results of intermediate jobs

CONCAT function

constants

    and data types

    and nulls

convergence (Python example)

COS function

COSH function

COUNT function

COUNT_STAR function

CROSS operator

D (top) ----------------------------------------------

-D command line option

data

    combining input files

    compression (handling)

    compression (results of intermediate jobs)

    loading

    load/store functions (built in functions)

    load/store functions (user defined functions)

    storing final results

    storing intermediate results (and HDFS)

    storing intermediate results (and performance)

    working with

data types. See types

debugging

    diagnostic operators

    with exec and run commands

    and Pig Latin

decorators. See Python

deference operators

    tuple or bag ( . )

    map ( #  )

DEFINE (macros) operator

DEFINE (UDFs, streaming) operator

DESCRIBE operator

DIFF function

disambiguate operator ( :: )

distributed file systems (and Pig Scripts)

DISTINCT operator

DISTINCT and optimization

distributed cache

downloading Pig

DUMP See also  Store vs. Dump

dynamic invokers

E (top) ----------------------------------------------

embedded Pig

    and Groovy

    invocation basics

    invocation details (compile, bind, run)

    and Java

    and JavaScript

    and PigRunner API

    and PigServer Interface

    and Python

EmbeddedPigStats class

error handling (multi-query execution)

eval functions (built in functions)

eval functions (user defined functions). See also Java UDFs

exec command

executing Pig. See running Pig

exectution modes

    local mode

    mapreduce mode

execution plans

    logical plan

    mapreduce plan

    physical plan

EXP function

EXPLAIN operator

expressions

    Boolean expressions

    field expressions

    general expressions

    and Pig Latin

    project-range expressions

    star  expressions ( * )

    tuple expressions

F (top) ----------------------------------------------

field expressions

fields

    definition of

    field delimiters

    referencing

    referencing complex types

FILTER operator

FILTER and performance

 filter functions

 FilterLogicExpressionSimplifier optimization rule

flatten operator

FLOOR function

FOREACH operator

fs command

FsShell commands

G (top) ----------------------------------------------

general expressions

getAllErrorMessages method

getAllStats method

getInputFormat method

getNext method

getOutputFormat method

globs

    and BinStorage function

    and LOAD operator

    and REGISTER statement

Groovy and embedded Pig

Groovy UDFs. See also UDFs

GROUP operator

 GroupByConstParallelSetter optimization rule

grunt shell

H (top) ----------------------------------------------

Hadoop

    FsShell commands

    Hadoop globbing

    HadoopJobHistoryLoader

    hadoop partitioner. See PARTITION BY

    Hadoop properties

    versions supported

HDFS

help command

I (top) ----------------------------------------------

identifiers See also referencing

ILLUSTRATE operator

IMPORT (macros) operator

INDEXOF function

installing Pig

    builds

    downloads

    software requirements

interactive mode

isEmbedded method

IsEmpty function

is not null operator

is null operator

J (top) ----------------------------------------------

 JsonLoader

 JsonStorage

 Java and embedded Pig

Java objects

    BoundScript.java

    pig.java

    PigProgressNotificationListener.java

    PigStats.java

JavaScript and embedded Pig

JavaScript UDFs. See also UDFs

Java UDFs

    eval functions

       accumulator interface

       aggregate functions

       algebraic interface

       and distributed cache

       and error handling

       filter functions

       and function overloading

       and import lists

       and Pig types

       and reporting progress

       and schemas

       using the functions

       writing the functions

    load/store functions

    See also UDFs

JOIN (inner) operator

JOIN (outer) operator

joins

    inner joins

    join optimizations

    merge joins

    merge-sparse joins

    outer joins

    replicated joins

    self joins

    skewed joins

K (top) ----------------------------------------------

keywords. See reserved keywords

kill command

L (top) ----------------------------------------------

LAST_INDEX_OF function

LCFIRST function

LIMIT operator

LIMIT and optimization

 LimitOptimizer optimization rule

LOAD operator

LoadCaster interface

LoadFunc class

    getInputFormat method

    getNext method

    LoadCaster ubterface

    LoadMetadata interface

    LoadPushDown interface

    prepareToRead method

    pushProjection method

    relativeToAbsolutePath method

    setLocation method

    setUdfContextSignature method

Load Functions. See load/store functions

LoadMetadata interface

LoadPushDown interface

load/store functions

    built in functions

    user defined functions (UDFs)

local mode

LOG function

LOG10 function

logical execution plan

LOWER function

LTRIM function

M (top) ----------------------------------------------

macros

    defining macros

    expanding macros

    importing macros

map task and hash-based aggregation

MapReduce

    MapReduce job ids and Pig scripts

    setting the number of reduce tasks

mapreduce execution plan

mapreduce mode

MAPREDUCE operator

maps (data type)

    and schemas

    schemas for multiple types

    syntax

    and TOMAP function

    and type construction operators

matches. See pattern matching

math functions

MAX function

memory management. See also batch mode

 MergeFilter optimization rule

 MergeForEach optimization rule

merge joins

merge-sparse joins

MIN function

modulo operator ( % )

multi-query execution

N (top) ----------------------------------------------

names (for fields, relations). See referencing.

nested blocks (FOREACH operator)

NOT (Boolean)

null operators

nulls

    and constants

    dropping before a join (performance)

    and JOIN operator

    and load functions

    operations that produce

    and Pig Latin

O (top) ----------------------------------------------

optimization rules

    AddForEach

    ColumnMapKeyPrune

    FilterLogicExpressionSimplifier

    GroupByConstParallelSetter

    LimitOptimizer

    MergeFilter

    MergeForEach

    PushDownForEachFlatten

    PushUpFilter

    SplitFilter

OR (Boolean)

ORDER BY operator

outputFunctionSchema Python decorator

outputSchema Python decorator

P (top) ----------------------------------------------

-P command line option

PARALLEL

    and performance

    setting default_parallel

parameter substitution

PARTITION BY

    and CROSS

    and DISTINCT

    and GROUP

    and JOIN (inner)

    and JOIN (outer)

pattern matching

performance (writing efficient code)

    optimization rules for

    performance enhancers

    See also Pig Latin

physical execution plan

pig.cachedbag.memusage property

PigDump function

Piggy Bank

Pig Latin

    automated generation of (Python example)

    Pig Latin statements

    See also performance (writing efficient code)

Pig macros. See macros

pig.java object

PigProgressNotificationListener interface

PigProgressNotificationListener.java object

PigRunner API.  See also PigStats class

Pig Scripts

    and batch mode

    and comments

    and distributed file systems

    and exec command

    and MapReduce job ids

    and run command

PigServer interface

PigStats class

    EmbeddedPigStats class

    getAllErrorMessages method

    getAllStats method

    isEmbedded method

    SimplePigStats class

    See also PigRunner API

PigStats.java object

Pig Statistics

    pig.alias

    pig.command.line

    pig.hadoop.version

    pig.input.dirs

    pig.job.feature

    pig.map.output.dirs

    pig.parent.jobid

    pig.reduce.output.dirs

    pig.script

    pig.script.features

    pig.script.id

    pig.version

PigStorage function

Pig tutorial

Pig types. See data types

PigUnit

positional notation

prepareToRead method

prepareToWrite method

projection

    example of

    and performance

project-range expressions

properties

    specifying Hadoop properties

    specifying Pig properties

 PushDownForEachFlatten optimization rule

pushProjection method

 PushUpFilter optimization rule

putNext method

Python and embedded Pig

Python UDFs. See also UDFs

Q (top) ----------------------------------------------

quit (command)

R (top) ----------------------------------------------

RANDOM function

referencing

    fields

    fields and complex types

    relations

    See also identifiers

REGEX_EXTRACT function

REGEX_EXTRACT_ALL function

REGISTER statement

regular expressions. See pattern matching

relations

    casting to scalars

    and Pig Latin

    referencing

relativeToAbsolutePath method

relToAbsPathForStoreLocation method

REPLACE function

replicated joins

requirements (for Pig)

reserved keywords

ROUND function

RTRIM function

run command

running Pig

    exec command

    execution modes

    execution order

    execution plans

    multi-query execution

    run command

S (top) ----------------------------------------------

SAMPLE operator

schemaFunction Python decorator

schemas

    for complex data types (tuples, bags, maps)

    and decorators (Python UDFs)

    and FOREACH

    and LOAD, STREAM

    ONSCHEMA clause (UNION operator)

    and Pig Latin

    and PigStorage (function)

    and return types (JavaScript UDFs)

    for simple data types (int, long, float, double, chararray, bytearray)

    unknown (null) schemas

set command

setLocation method

setStoreFuncUDFContextSignature method

setStoreLocation method

setUdfContextSignature method

sh command

shell commands

ship (streaming). See also autoship

sign operators

    negative ( - )

    positive ( + )

SimplePigStats class

SIN function

SINH function

SIZE function

skewed joins

software requirements. See requirements

specialized joins

    merge joins

    and performance

    replicated joins

    skewed joins

SPLIT operator

 SplitFilter optimization rule

splits (implicit, explicit)

SQRT function

star expression ( * )

statements (Pig Latin)

statistics. See Pig statistics

STORE operator. See also  Store vs. Dump

Store functions. See load/store functions

StoreFunc class

    checkSchema method

    getOutputFormat method

    prepareToWrite method

    putNext method

    relToAbsPathForStoreLocation method

    setStoreFuncUDFContextSignature method

    setStoreLocation method

    StoreMetadata interface

StoreMetadata interface

Store vs. Dump

STREAM operator

streaming (DEFINE operator)

string functions

STRSPLIT function

SUBSTRING function

SUM function

T (top) ----------------------------------------------

TAN function

TANH function

TextLoader function

TOBAG function

TOKENIZE function

TOMAP function

TOP function

TOTUPLE function

TRIM function

tuple expressions

tuple functions

tuples (data type)

    and relations

    and schemas

    syntax

    and TOTUPLE function

    and type construction operators

type construction operators (tuple, bag, map)

type conversions. See casting types, types tables

types (simple and complex)

types and performance

types tables

    for addition, subtraction

    for equal, not equal

    for matches

    for multiplication, division

    for negative (negation)

    for nulls

    See also casting types

tutorial (for Pig)

U (top) ----------------------------------------------

UCFIRST function

UDFs

    and function instantiation

    and monitoring

    passing configurations to

    and performance (Accumulator Interface)

    and performance (Algebraic Interface)

    Piggy Bank (repository)

    UDF interfaces

    See also Java UDFs, JavaScript UDFs, Python UDFs

UNION operator

UPPER function

user defined functions. See UDFs

utility commands

V (top)

W (top)

X (top)

Y (top)

Z (top)

</document>


text:
#ifndef TORRENT_NETWORK_THREAD_POOL_HPP_INCLUDED
#define TORRENT_NETWORK_THREAD_POOL_HPP_INCLUDED

#include "libtorrent/thread_pool.hpp"
#include <boost/shared_ptr.hpp>
#include <vector>

namespace libtorrent
{

	class peer_connection;
	class buffer;

	struct socket_job
	{
		socket_job() : type(none), vec(NULL), recv_buf(NULL), buf_size(0) {}
#if __cplusplus >= 201103L
		socket_job(socket_job const&) = default;
		socket_job& operator=(socket_job const&) = default;
#endif

		enum job_type_t
		{
			read_job = 0,
			write_job,
			none
		};

		job_type_t type;

		// used for write jobs
		std::vector<boost::asio::const_buffer> const* vec;
		// used for read jobs
		char* recv_buf;
		int buf_size;
		boost::array<boost::asio::mutable_buffer, 2> read_vec;

		boost::shared_ptr<peer_connection> peer;
		// defined in session_impl.cpp
		~socket_job();
	};

	// defined in session_impl.cpp
	struct network_thread_pool : thread_pool<socket_job>
	{
		void process_job(socket_job const& j, bool post);
	};
}

#endif // TORRENT_NETWORK_THREAD_POOL_HPP_INCLUDED


text:
import unittest

from deploy import Unit

class TestUnit(unittest.TestCase):

    def test_create(self):
        i = Unit('foo', 'inactive', 'spawn')

        self.assertEqual(i.__str__(), 'foo')
        self.assertEqual(i.name, 'foo')
        self.assertEqual(i.state, 'inactive')
        self.assertEqual(i.required_action, 'spawn')
        self.assertEqual(i.details, 'foo inactive')

    def test_invalid_state(self):
        with self.assertRaises(Exception):
            i = Unit('foo', 'xxxx', 'spawn')

    def test_invalid_action(self):
        with self.assertRaises(Exception):
            i = Unit('foo', 'inactive', 'xxx')

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


text:
<!DOCTYPE html>

	<meta charset="utf-8">
	<title>Setting :: Doolally</title>
	<?php echo $globalStyle; ?>

    <?php echo $headerView; ?>

Change Pin

            <?php
                if(isSessionVariableSet($this->isUserSession) === true)
                {
                   ?>
                    <form action="<?php echo base_url();?>login/changePin/json" id="pinForm" method="post" class="form-horizontal" role="form">
                        <input type="hidden" name="userId" value="<?php echo $userId;?>"/>

                            New:

                                        <input class="form-control loginPin1" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin2" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin3" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin4" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                            Confirm:

                                        <input class="form-control loginPin5" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin6" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin7" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                                        <input class="form-control loginPin8" oninput="maxLengthCheck(this)" type="number" maxlength="1" placeholder="0" />

                        <input type="hidden" name="LoginPin" />

                                <button type="submit" class="btn btn-primary">Submit</button>

                    </form>
                    <?php
                }
            else
            {
                redirect(base_url());
            }
            ?>

    <?php echo $footerView; ?>

<?php echo $globalJs; ?>


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

 <LINK REL="STYLESHEET" TYPE="text/css" HREF="plsqldoc.css">
 <TITLE>Package pete</TITLE>
 <META name="object" content="PACKAGE">
 <META name="name" content="pete">
 <META name="description" content="Configuration pete.run(a_suite_in => 'suite_code');">

index

Package pete

Configuration pete.run(a_suite_in => 'suite_code');

\a suite

    \a script

        \a case in order

            \a block in order

                execute immediate block

Convention pete.run(a_suite_in => 'suite_code'

         a_style_in => pete_runner.convention);

\a schema

    if \e pete_before_all.run

    \a package unordered

        if \e pete_before_each.run

        if \e package.before_all

        \a method in order (subprogram_id)

            if \e package.before_each

            execute immediate method

            if \e package.after_each

        if \e package.after_all

        if \e pete_after_each.run

    if \e pete_after_all.run

run pro jiný nepovinný parametr by pouštěl "subset" toho výše: a_package_in - jednu package a_script in - jeden skript a_method_in - jednu metodu a_case_in - jeden test case.

Pri vyplnění a_package_in nebo a_method_in jde o "konvencni" spoustění a proto budou rovněž spuštěny všechny before/after metody/package

a_style_in nepovinny, pouze, pokud dle obsahu parametru ke spousteni nepujde rozhodnout, který styl uživatel myslí (budou k dipozici oba)

Program units

run

Runs test

run_test_suite

Runs a suite

run_test_script

Runs a script identified by id

run_test_script

Runs a script identified by code

run_test_case

Runs a test case identified by id

run_test_case

Runs a script identified by code

run_test_package

Runs tests for a given package.

run_all_tests

Runs all availaible tests.

init

core

Exceptions

ge_ambiguous_input

Thrown if the input can't be clearly interpreted

ge_conflicting_input

Thrown if more conflicting parameters are set

Constants

gc_AMBIGUOUS_INPUT

gc_CONFLICTING_INPUT

run

PROCEDURE run
(
    a_suite_name_in         IN VARCHAR2 DEFAULT NULL,
    a_package_name_in       IN VARCHAR2 DEFAULT NULL,
    a_method_name_in        IN VARCHAR2 DEFAULT NULL,
    a_script_code_in        IN VARCHAR2 DEFAULT NULL,
    a_case_code_in          IN VARCHAR2 DEFAULT NULL,
    a_style_conventional_in IN BOOLEAN DEFAULT NULL
)

Runs test
Universal run procedure. Can be used to run any unit of work of either testing style.

Other public run procedures call this one. It accepts only - configuration parameters (a_suite_name_in, a_script_code_in, a_case_code_in) or - conventional parameters (a_suite_name_in, a_package_name_in, a_method_name_in) not a combination from both sets testing style can be explicitly set by a_style_conventional_in parameter

Parameters

a_suite_name_in

Runs a suite of tests of a given name. If there are suites of both testing styles then throws an ge_ambiguous_input exception

a_package_name_in

Runs all tests following convention in a given package

a_method_name_mask_in

Runs only tests of a given mask in a given package. Must be used with param a_package_in

a_script_code_in

Runs a test script of a given code

a_case_code_in

Runs a test case of a given code

a_style_conventional

If true

Throws exceptions

ge_ambiguous_input

ge_conflicting_input

ge_ambiguous_input

ge_ambiguous_input EXCEPTION;

Thrown if the input can't be clearly interpreted

gc_AMBIGUOUS_INPUT

gc_AMBIGUOUS_INPUT CONSTANT PLS_INTEGER := -20001;

ge_conflicting_input

ge_conflicting_input EXCEPTION;

Thrown if more conflicting parameters are set

gc_CONFLICTING_INPUT

gc_CONFLICTING_INPUT CONSTANT PLS_INTEGER := -20001;

run_test_suite

PROCEDURE run_test_suite
(
    a_suite_name_in         IN VARCHAR2 DEFAULT NULL,
    a_style_conventional_in IN BOOLEAN DEFAULT NULL
)

Runs a suite

Parameters

a_suite_name_in

a_style_conventional

Throws exceptions

ge_ambiguous_input If the input can't be clearly interpreted

run_test_script

PROCEDURE run_test_script(a_id_in IN NUMBER)

Runs a script identified by id

Parameters

a_id_in

id of the script to be run

run_test_script

PROCEDURE run_test_script(a_script_code_in IN VARCHAR2)

Runs a script identified by code

Parameters

a_script_code_in

code of the script to be run

run_test_case

PROCEDURE run_test_case(a_id_in IN NUMBER)

Runs a test case identified by id

Parameters

a_id_in

id of the script to be run

run_test_case

PROCEDURE run_test_case(a_case_code_in IN VARCHAR2)

Runs a script identified by code

Parameters

a_script_code_in

Code of the script to be run

run_test_package

PROCEDURE run_test_package
(
    a_package_name_in     IN VARCHAR2,
    a_method_name_like_in IN VARCHAR2 DEFAULT NULL
)

Runs tests for a given package. Such tests are in a test package which can be derived from the given one.

throws tests not found if there are no tests to be run

Parameters

a_package_in

a_method_name_like_in

a_is_test_package_in

a_prefix_in

run_all_tests

PROCEDURE run_all_tests

Runs all availaible tests. That means all configured scripts from table pete_scripts and all test packages conforming convention.

init

PROCEDURE init
(
    a_log_to_dbms_output_in IN BOOLEAN DEFAULT TRUE,
    a_log_to_table_in       IN BOOLEAN DEFAULT TRUE
)

core


text:
/**
 * @file
 *   This file implements the OpenThread APIs for handling IPv4 (NAT64) messages
 */

#include "openthread-core-config.h"

#include <openthread/border_router.h>
#include <openthread/ip6.h>
#include <openthread/nat64.h>

#include "border_router/routing_manager.hpp"
#include "common/debug.hpp"
#include "common/instance.hpp"
#include "net/ip4_types.hpp"
#include "net/ip6_headers.hpp"
#include "net/nat64_translator.hpp"

using namespace ot;

// Note: We support the following scenrios:
// - Using OpenThread's routing manager, while using external NAT64 translator (like tayga).
// - Using OpenThread's NAT64 translator, while using external routing manager.
// So OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE translator and OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE are two
// separate build flags and they are not depending on each other.

#if OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
otError otNat64SetIp4Cidr(otInstance *aInstance, const otIp4Cidr *aCidr)
{
    return AsCoreType(aInstance).Get<Nat64::Translator>().SetIp4Cidr(AsCoreType(aCidr));
}

otMessage *otIp4NewMessage(otInstance *aInstance, const otMessageSettings *aSettings)
{
    return AsCoreType(aInstance).Get<Nat64::Translator>().NewIp4Message(Message::Settings::From(aSettings));
}

otError otNat64Send(otInstance *aInstance, otMessage *aMessage)
{
    return AsCoreType(aInstance).Get<Nat64::Translator>().SendMessage(AsCoreType(aMessage));
}

void otNat64SetReceiveIp4Callback(otInstance *aInstance, otNat64ReceiveIp4Callback aCallback, void *aContext)
{
    AsCoreType(aInstance).Get<Ip6::Ip6>().SetNat64ReceiveIp4DatagramCallback(aCallback, aContext);
}

void otNat64InitAddressMappingIterator(otInstance *aInstance, otNat64AddressMappingIterator *aIterator)
{
    AssertPointerIsNotNull(aIterator);

    AsCoreType(aInstance).Get<Nat64::Translator>().InitAddressMappingIterator(*aIterator);
}

otError otNat64GetNextAddressMapping(otInstance *                   aInstance,
                                     otNat64AddressMappingIterator *aIterator,
                                     otNat64AddressMapping *        aMapping)
{
    AssertPointerIsNotNull(aIterator);
    AssertPointerIsNotNull(aMapping);

    return AsCoreType(aInstance).Get<Nat64::Translator>().GetNextAddressMapping(*aIterator, *aMapping);
}

void otNat64GetCounters(otInstance *aInstance, otNat64ProtocolCounters *aCounters)
{
    AsCoreType(aInstance).Get<Nat64::Translator>().GetCounters(AsCoreType(aCounters));
}

void otNat64GetErrorCounters(otInstance *aInstance, otNat64ErrorCounters *aCounters)
{
    AsCoreType(aInstance).Get<Nat64::Translator>().GetErrorCounters(AsCoreType(aCounters));
}

otError otNat64GetCidr(otInstance *aInstance, otIp4Cidr *aCidr)
{
    return AsCoreType(aInstance).Get<Nat64::Translator>().GetIp4Cidr(AsCoreType(aCidr));
}

otNat64State otNat64GetTranslatorState(otInstance *aInstance)
{
    return MapEnum(AsCoreType(aInstance).Get<Nat64::Translator>().GetState());
}
#endif // OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE

#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
otNat64State otNat64GetPrefixManagerState(otInstance *aInstance)
{
    return MapEnum(AsCoreType(aInstance).Get<BorderRouter::RoutingManager>().GetNat64PrefixManagerState());
}
#endif

#if OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE || OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
void otNat64SetEnabled(otInstance *aInstance, bool aEnabled)
{
#if OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE
    AsCoreType(aInstance).Get<BorderRouter::RoutingManager>().SetNat64PrefixManagerEnabled(aEnabled);
#endif
#if OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE
    AsCoreType(aInstance).Get<Nat64::Translator>().SetEnabled(aEnabled);
#endif
}
#endif // OPENTHREAD_CONFIG_NAT64_TRANSLATOR_ENABLE || OPENTHREAD_CONFIG_NAT64_BORDER_ROUTING_ENABLE

bool otIp4IsAddressEqual(const otIp4Address *aFirst, const otIp4Address *aSecond)
{
    return AsCoreType(aFirst) == AsCoreType(aSecond);
}

void otIp4ExtractFromIp6Address(uint8_t aPrefixLength, const otIp6Address *aIp6Address, otIp4Address *aIp4Address)
{
    AsCoreType(aIp4Address).ExtractFromIp6Address(aPrefixLength, AsCoreType(aIp6Address));
}

otError otIp4AddressFromString(const char *aString, otIp4Address *aAddress)
{
    AssertPointerIsNotNull(aString);
    return AsCoreType(aAddress).FromString(aString);
}

otError otNat64SynthesizeIp6Address(otInstance *aInstance, const otIp4Address *aIp4Address, otIp6Address *aIp6Address)
{
    otError                          err = OT_ERROR_NONE;
    NetworkData::ExternalRouteConfig nat64Prefix;

    VerifyOrExit(AsCoreType(aInstance).Get<NetworkData::Leader>().GetPreferredNat64Prefix(nat64Prefix) == OT_ERROR_NONE,
                 err = OT_ERROR_INVALID_STATE);
    AsCoreType(aIp6Address).SynthesizeFromIp4Address(nat64Prefix.GetPrefix(), AsCoreType(aIp4Address));

exit:
    return err;
}

void otIp4AddressToString(const otIp4Address *aAddress, char *aBuffer, uint16_t aSize)
{
    AssertPointerIsNotNull(aBuffer);

    AsCoreType(aAddress).ToString(aBuffer, aSize);
}

void otIp4CidrToString(const otIp4Cidr *aCidr, char *aBuffer, uint16_t aSize)
{
    AssertPointerIsNotNull(aBuffer);

    AsCoreType(aCidr).ToString(aBuffer, aSize);
}


text:
<?php

namespace app\models;

use Yii;
use yii\helpers\ArrayHelper;
use app\models\CacProveedores;
use yii\db\Query;

/**
 * This is the model class for table "cac_alimentos".
 *
 * @property integer $alimiden
 * @property integer $cac_proveedores_providen
 * @property string $alimnomb
 * @property string $alimpeun
 * @property string $alimpeto
 * @property string $alimdesc
 * @property resource $alimimag
 * @property integer $usuamodi
 * @property string $fechmodi
 *
 * @property CacProveedores $cacProveedoresProviden
 * @property CacCompras[] $cacCompras
 */
class CacAlimentos extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'cac_alimentos';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['cac_proveedores_providen'], 'required'],
            [['cac_proveedores_providen', 'usuamodi'], 'integer'],
            [['alimpeun', 'alimpeto'], 'number'],
            [['fechmodi'], 'safe'],
            [['alimnomb'], 'string', 'max' => 50],
            [['alimdesc'], 'string', 'max' => 200],
            [['alimcodi'], 'string', 'max' => 30],
            [['alimimag'], 'file', 'extensions' => 'jpg, jpeg, gif, png, bmp', 'mimeTypes' => 'image/jpeg, image/gif, image/png, image/bmp', 'skipOnEmpty' => true, 'maxSize' => 1024000, 'tooBig' => 'Tamaño de Imágen Máximo 1MB'],
            [['cac_proveedores_providen'], 'exist', 'skipOnError' => true, 'targetClass' => CacProveedores::className(), 'targetAttribute' => ['cac_proveedores_providen' => 'providen']],
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'alimiden' => 'Identificador del Alimento',
            'cac_proveedores_providen' => 'Proveedor',
            'alimnomb' => 'Nombre del Alimento',
            'alimdesc' => 'Descripción del Alimento',
            'alimpeun' => 'Peso Unitario',
            'alimpeto' => 'Peso Total',
            'alimimag' => 'Alimimag',
            'alimcodi' => 'Alimcodi',
            'usuamodi' => 'Usuamodi',
            'fechmodi' => 'Fechmodi',
        ];
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCacProveedoresProviden()
    {
        return $this->hasOne(CacProveedores::className(), ['providen' => 'cac_proveedores_providen']);
    }

    /**
     * @return \yii\db\ActiveQuery
     */
    public function getCacCompras()
    {
        return $this->hasMany(CacCompras::className(), ['cac_alimentos_alimiden' => 'alimiden']);
    }

    public static function getListaProveedores()
    {
      $opciones = CacProveedores::find()->where(['cac_tipoProveedores_tipriden'=>2])->all();
      return ArrayHelper::map($opciones, 'providen', 'provnomb');
    }
}


text:
package org.scalacheck

import language.higherKinds

import util.{FreqMap, Buildable, Buildable2}

sealed abstract class Arbitrary[T] {
  val arbitrary: Gen[T]
}

/** Defines implicit [[org.scalacheck.Arbitrary]] instances for common types.
 *

 *  ScalaCheck
 *  uses implicit [[org.scalacheck.Arbitrary]] instances when creating properties
 *  out of functions with the `Prop.property` method, and when
 *  the `Arbitrary.arbitrary` method is used. For example, the
 *  following code requires that there exists an implicit
 *  `Arbitrary[MyClass]` instance:
 *

 *
 *  {{{
 *    val myProp = Prop.forAll { myClass: MyClass =>
 *      ...
 *    }
 *
 *    val myGen = Arbitrary.arbitrary[MyClass]
 *  }}}
 *
 *

 *  The required implicit definition could look like this:
 *

 *
 *  {{{
 *    implicit val arbMyClass: Arbitrary[MyClass] = Arbitrary(...)
 *  }}}
 *
 *

 *  The factory method `Arbitrary(...)` takes a generator of type
 *  `Gen[T]` and returns an instance of `Arbitrary[T]`.
 *

 *
 *

 *  The `Arbitrary` module defines implicit [[org.scalacheck.Arbitrary]]
 *  instances for common types, for convenient use in your properties and
 *  generators.
 *

 */
object Arbitrary {

  import Gen.{const, choose, sized, frequency, oneOf, containerOf, resize}
  import collection.{immutable, mutable}
  import java.util.Date

  /** Creates an Arbitrary instance */
  def apply[T](g: => Gen[T]): Arbitrary[T] = new Arbitrary[T] {
    lazy val arbitrary = g
  }

  /** Returns an arbitrary generator for the type T. */
  def arbitrary[T](implicit a: Arbitrary[T]): Gen[T] = a.arbitrary

  /**** Arbitrary instances for each AnyVal ****/

  /** Arbitrary AnyVal */
  implicit lazy val arbAnyVal: Arbitrary[AnyVal] = Arbitrary(oneOf(
    arbitrary[Unit], arbitrary[Boolean], arbitrary[Char], arbitrary[Byte],
    arbitrary[Short], arbitrary[Int], arbitrary[Long], arbitrary[Float],
    arbitrary[Double]
  ))

  /** Arbitrary instance of Boolean */
  implicit lazy val arbBool: Arbitrary[Boolean] =
    Arbitrary(oneOf(true, false))

  /** Arbitrary instance of Int */
  implicit lazy val arbInt: Arbitrary[Int] = Arbitrary(
    Gen.chooseNum(Int.MinValue, Int.MaxValue)
  )

  /** Arbitrary instance of Long */
  implicit lazy val arbLong: Arbitrary[Long] = Arbitrary(
    Gen.chooseNum(Long.MinValue, Long.MaxValue)
  )

  /** Arbitrary instance of Float */
  implicit lazy val arbFloat: Arbitrary[Float] = Arbitrary(
    Gen.chooseNum(
      Float.MinValue, Float.MaxValue
      // I find that including these by default is a little TOO testy.
      // Float.Epsilon, Float.NaN, Float.PositiveInfinity, Float.NegativeInfinity
    )
  )

  /** Arbitrary instance of Double */
  implicit lazy val arbDouble: Arbitrary[Double] = Arbitrary(
    Gen.chooseNum(
      Double.MinValue / 2, Double.MaxValue / 2
      // As above.  Perhaps behind some option?
      // Double.Epsilon, Double.NaN, Double.PositiveInfinity, Double.NegativeInfinity
    )
  )

  /** Arbitrary instance of Char */
  implicit lazy val arbChar: Arbitrary[Char] = Arbitrary(
    Gen.frequency(
      (0xD800-Char.MinValue, Gen.choose[Char](Char.MinValue,0xD800-1)),
      (Char.MaxValue-0xDFFF, Gen.choose[Char](0xDFFF+1,Char.MaxValue))
    )
  )

  /** Arbitrary instance of Byte */
  implicit lazy val arbByte: Arbitrary[Byte] = Arbitrary(
    Gen.chooseNum(Byte.MinValue, Byte.MaxValue)
  )

  /** Arbitrary instance of Short */
  implicit lazy val arbShort: Arbitrary[Short] = Arbitrary(
    Gen.chooseNum(Short.MinValue, Short.MaxValue)
  )

  /** Absolutely, totally, 100% arbitrarily chosen Unit. */
  implicit lazy val arbUnit: Arbitrary[Unit] = Arbitrary(const(()))

  /**** Arbitrary instances of other common types ****/

  /** Arbitrary instance of String */
  implicit lazy val arbString: Arbitrary[String] =
    Arbitrary(arbitrary[List[Char]] map (_.mkString))

  /** Arbitrary instance of Date */
  implicit lazy val arbDate: Arbitrary[Date] = Arbitrary(for {
    l <- arbitrary[Long]
    d = new Date
  } yield new Date(d.getTime + l))

  /** Arbitrary instance of Throwable */
  implicit lazy val arbThrowable: Arbitrary[Throwable] =
    Arbitrary(oneOf(const(new Exception), const(new Error)))

  /** Arbitrary instance of Exception */
  implicit lazy val arbException: Arbitrary[Exception] =
    Arbitrary(const(new Exception))

  /** Arbitrary instance of Error */
  implicit lazy val arbError: Arbitrary[Error] =
    Arbitrary(const(new Error))

  /** Arbitrary BigInt */
  implicit lazy val arbBigInt: Arbitrary[BigInt] = {
    def chooseBigInt: Gen[BigInt] =
      sized((s: Int) => choose(-s, s)) map (x => BigInt(x))

    def chooseReallyBigInt: Gen[BigInt] = for {
      bi <- chooseBigInt
      n <- choose(32,128)
    } yield bi << n

    Arbitrary(
      frequency(
        (5, chooseBigInt),
        (10, chooseReallyBigInt),
        (1, BigInt(0)),
        (1, BigInt(1)),
        (1, BigInt(-1)),
        (1, BigInt(Int.MaxValue) + 1),
        (1, BigInt(Int.MinValue) - 1),
        (1, BigInt(Long.MaxValue)),
        (1, BigInt(Long.MinValue)),
        (1, BigInt(Long.MaxValue) + 1),
        (1, BigInt(Long.MinValue) - 1)
      )
    )
  }

  /** Arbitrary BigDecimal */
  implicit lazy val arbBigDecimal: Arbitrary[BigDecimal] = {
    import java.math.MathContext._
    val mcGen = oneOf(UNLIMITED, DECIMAL32, DECIMAL64, DECIMAL128)
    val bdGen = for {
      x <- arbBigInt.arbitrary
      mc <- mcGen
      limit <- const(if(mc == UNLIMITED) 0 else math.max(x.abs.toString.length - mc.getPrecision, 0))
      scale <- Gen.chooseNum(Int.MinValue + limit , Int.MaxValue)
    } yield {
      try {
        BigDecimal(x, scale, mc)
      } catch {
        case ae: java.lang.ArithmeticException => BigDecimal(x, scale, UNLIMITED) // Handle the case where scale/precision conflict
      }
    }
    Arbitrary(bdGen)
  }

  /** Arbitrary java.lang.Number */
  implicit lazy val arbNumber: Arbitrary[Number] = {
    val gen = Gen.oneOf(
      arbitrary[Byte], arbitrary[Short], arbitrary[Int], arbitrary[Long],
      arbitrary[Float], arbitrary[Double]
    )
    Arbitrary(gen map (_.asInstanceOf[Number]))
    // XXX TODO - restore BigInt and BigDecimal
    // Arbitrary(oneOf(arbBigInt.arbitrary :: (arbs map (_.arbitrary) map toNumber) : _*))
  }

  /** Generates an arbitrary property */
  implicit lazy val arbProp: Arbitrary[Prop] = {
    import Prop._
    val undecidedOrPassed = forAll { b: Boolean =>
      b ==> true
    }
    Arbitrary(frequency(
      (4, falsified),
      (4, passed),
      (3, proved),
      (3, undecidedOrPassed),
      (2, undecided),
      (1, exception(null))
    ))
  }

  /** Arbitrary instance of test parameters */
  implicit lazy val arbTestParameters: Arbitrary[Test.Parameters] =
    Arbitrary(for {
      _minSuccTests <- choose(10,200)
      _maxDiscardRatio <- choose(0.2f,10f)
      _minSize <- choose(0,500)
      sizeDiff <- choose(0,500)
      _maxSize <- choose(_minSize, _minSize + sizeDiff)
      _workers <- choose(1,4)
    } yield new Test.Parameters.Default {
      override val minSuccessfulTests = _minSuccTests
      override val maxDiscardRatio = _maxDiscardRatio
      override val minSize = _minSize
      override val maxSize = _maxSize
      override val workers = _workers
    })

  /** Arbitrary instance of gen params */
  implicit lazy val arbGenParams: Arbitrary[Gen.Parameters] =
    Arbitrary(for {
      sz <- arbitrary[Int] suchThat (_ >= 0)
    } yield (new Gen.Parameters.Default {
      override val size = sz
    }))

  // Higher-order types //

  /** Arbitrary instance of [[org.scalacheck.Gen]] */
  implicit def arbGen[T](implicit a: Arbitrary[T]): Arbitrary[Gen[T]] =
    Arbitrary(frequency(
      (5, arbitrary[T] map (const(_))),
      (1, Gen.fail)
    ))

  /** Arbitrary instance of the Option type */
  implicit def arbOption[T](implicit a: Arbitrary[T]): Arbitrary[Option[T]] =
    Arbitrary(sized(n =>
      // When n is larger, make it less likely that we generate None,
      // but still do it some of the time. When n is zero, we always
      // generate None, since it's the smallest value.
      frequency(
        (n, resize(n / 2, arbitrary[T]).map(Some(_))),
        (1, const(None)))))

  /** Arbitrary instance of the Either type */
  implicit def arbEither[T, U](implicit at: Arbitrary[T], au: Arbitrary[U]): Arbitrary[Either[T, U]] =
    Arbitrary(oneOf(arbitrary[T].map(Left(_)), arbitrary[U].map(Right(_))))

  /** Arbitrary instance of any [[org.scalacheck.util.Buildable]] container
   *  (such as lists, arrays, streams, etc). The maximum size of the container
   *  depends on the size generation parameter. */
  implicit def arbContainer[C[_],T](implicit
    a: Arbitrary[T], b: Buildable[T,C], t: C[T] => Traversable[T]
  ): Arbitrary[C[T]] = Arbitrary(containerOf[C,T](arbitrary[T]))

  /** Arbitrary instance of any [[org.scalacheck.util.Buildable2]] container
   *  (such as maps, etc). The maximum size of the container depends on the size
   *  generation parameter. */
  implicit def arbContainer2[C[_,_],T,U](implicit
    a: Arbitrary[(T,U)], b: Buildable2[T,U,C], t: C[T,U] => Traversable[(T,U)]
  ): Arbitrary[C[T,U]] = Arbitrary(containerOf[C,T,U](arbitrary[(T,U)]))

  // Functions //

  /** Arbitrary instance of Function1 */
  implicit def arbFunction1[T1,R](implicit a: Arbitrary[R]
  ): Arbitrary[T1 => R] = Arbitrary(
    for(r <- arbitrary[R]) yield (t1: T1) => r
  )

  /** Arbitrary instance of Function2 */
  implicit def arbFunction2[T1,T2,R](implicit a: Arbitrary[R]
  ): Arbitrary[(T1,T2) => R] = Arbitrary(
    for(r <- arbitrary[R]) yield (t1: T1, t2: T2) => r
  )

  /** Arbitrary instance of Function3 */
  implicit def arbFunction3[T1,T2,T3,R](implicit a: Arbitrary[R]
  ): Arbitrary[(T1,T2,T3) => R] = Arbitrary(
    for(r <- arbitrary[R]) yield (t1: T1, t2: T2, t3: T3) => r
  )

  /** Arbitrary instance of Function4 */
  implicit def arbFunction4[T1,T2,T3,T4,R](implicit a: Arbitrary[R]
  ): Arbitrary[(T1,T2,T3,T4) => R] = Arbitrary(
    for(r <- arbitrary[R]) yield (t1: T1, t2: T2, t3: T3, t4: T4) => r
  )

  /** Arbitrary instance of Function5 */
  implicit def arbFunction5[T1,T2,T3,T4,T5,R](implicit a: Arbitrary[R]
  ): Arbitrary[(T1,T2,T3,T4,T5) => R] = Arbitrary(
    for(r <- arbitrary[R]) yield (t1: T1, t2: T2, t3: T3, t4: T4, t5: T5) => r
  )

  // Tuples //

  /** Arbitrary instance of 2-tuple */
  implicit def arbTuple2[T1,T2](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2]
  ): Arbitrary[(T1,T2)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
    } yield (t1,t2))

  /** Arbitrary instance of 3-tuple */
  implicit def arbTuple3[T1,T2,T3](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3]
  ): Arbitrary[(T1,T2,T3)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
    } yield (t1,t2,t3))

  /** Arbitrary instance of 4-tuple */
  implicit def arbTuple4[T1,T2,T3,T4](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4]
  ): Arbitrary[(T1,T2,T3,T4)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
    } yield (t1,t2,t3,t4))

  /** Arbitrary instance of 5-tuple */
  implicit def arbTuple5[T1,T2,T3,T4,T5](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4],
    a5: Arbitrary[T5]
  ): Arbitrary[(T1,T2,T3,T4,T5)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
      t5 <- arbitrary[T5]
    } yield (t1,t2,t3,t4,t5))

  /** Arbitrary instance of 6-tuple */
  implicit def arbTuple6[T1,T2,T3,T4,T5,T6](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4],
    a5: Arbitrary[T5], a6: Arbitrary[T6]
  ): Arbitrary[(T1,T2,T3,T4,T5,T6)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
      t5 <- arbitrary[T5]
      t6 <- arbitrary[T6]
    } yield (t1,t2,t3,t4,t5,t6))

  /** Arbitrary instance of 7-tuple */
  implicit def arbTuple7[T1,T2,T3,T4,T5,T6,T7](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4],
    a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7]
  ): Arbitrary[(T1,T2,T3,T4,T5,T6,T7)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
      t5 <- arbitrary[T5]
      t6 <- arbitrary[T6]
      t7 <- arbitrary[T7]
    } yield (t1,t2,t3,t4,t5,t6,t7))

  /** Arbitrary instance of 8-tuple */
  implicit def arbTuple8[T1,T2,T3,T4,T5,T6,T7,T8](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4],
    a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8]
  ): Arbitrary[(T1,T2,T3,T4,T5,T6,T7,T8)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
      t5 <- arbitrary[T5]
      t6 <- arbitrary[T6]
      t7 <- arbitrary[T7]
      t8 <- arbitrary[T8]
    } yield (t1,t2,t3,t4,t5,t6,t7,t8))

  /** Arbitrary instance of 9-tuple */
  implicit def arbTuple9[T1,T2,T3,T4,T5,T6,T7,T8,T9](implicit
    a1: Arbitrary[T1], a2: Arbitrary[T2], a3: Arbitrary[T3], a4: Arbitrary[T4],
    a5: Arbitrary[T5], a6: Arbitrary[T6], a7: Arbitrary[T7], a8: Arbitrary[T8],
    a9: Arbitrary[T9]
  ): Arbitrary[(T1,T2,T3,T4,T5,T6,T7,T8,T9)] =
    Arbitrary(for {
      t1 <- arbitrary[T1]
      t2 <- arbitrary[T2]
      t3 <- arbitrary[T3]
      t4 <- arbitrary[T4]
      t5 <- arbitrary[T5]
      t6 <- arbitrary[T6]
      t7 <- arbitrary[T7]
      t8 <- arbitrary[T8]
      t9 <- arbitrary[T9]
    } yield (t1,t2,t3,t4,t5,t6,t7,t8,t9))

}


text:
from collections import defaultdict
from xml.etree import ElementTree
from corehq.apps.fixtures.models import FixtureDataItem, FixtureDataType
from casexml.apps.phone.models import OTARestoreUser
from corehq.apps.products.fixtures import product_fixture_generator_json
from corehq.apps.programs.fixtures import program_fixture_generator_json

def item_lists_by_domain(domain):
    ret = list()
    for data_type in FixtureDataType.by_domain(domain):
        structure = {
            f.field_name: {
                'name': f.field_name,
                'no_option': True
            } for f in data_type.fields
        }

        for attr in data_type.item_attributes:
            structure['@' + attr] = {
                'name': attr,
                'no_option': True
            }

        uri = 'jr://fixture/%s:%s' % (ItemListsProvider.id, data_type.tag)
        ret.append({
            'id': data_type.tag,
            'uri': uri,
            'path': u"/{tag}_list/{tag}".format(tag=data_type.tag),
            'name': data_type.tag,
            'structure': structure,

            # DEPRECATED PROPERTIES
            'sourceUri': uri,
            'defaultId': data_type.tag,
            'initialQuery': u"instance('{tag}')/{tag}_list/{tag}".format(tag=data_type.tag),
        })

    products = product_fixture_generator_json(domain)
    if products:
        ret.append(products)
    programs = program_fixture_generator_json(domain)
    if programs:
        ret.append(programs)
    return ret

class ItemListsProvider(object):
    id = 'item-list'

    def __call__(self, restore_user, version, last_sync=None, app=None):
        assert isinstance(restore_user, OTARestoreUser)

        all_types = dict([(t._id, t) for t in FixtureDataType.by_domain(restore_user.domain)])
        global_types = dict([(id, t) for id, t in all_types.items() if t.is_global])

        items_by_type = defaultdict(list)

        def _set_cached_type(item, data_type):
            # set the cached version used by the object so that it doesn't
            # have to do another db trip later
            item._data_type = data_type

        for global_fixture in global_types.values():
            items = list(FixtureDataItem.by_data_type(restore_user.domain, global_fixture))
            _ = [_set_cached_type(item, global_fixture) for item in items]
            items_by_type[global_fixture._id] = items

        other_items = restore_user.get_fixture_data_items()
        data_types = {}

        for item in other_items:
            if item.data_type_id in global_types:
                continue  # was part of the global type so no need to add here
            if item.data_type_id not in data_types:
                try:
                    data_types[item.data_type_id] = all_types[item.data_type_id]
                except (AttributeError, KeyError):
                    continue
            items_by_type[item.data_type_id].append(item)
            _set_cached_type(item, data_types[item.data_type_id])

        fixtures = []
        all_types_to_sync = data_types.values() + global_types.values()
        for data_type in all_types_to_sync:
            fixtures.append(self._get_fixture_element(
                data_type.tag,
                restore_user.user_id,
                sorted(items_by_type[data_type.get_id], key=lambda x: x.sort_key)
            ))
        for data_type_id, data_type in all_types.iteritems():
            if data_type_id not in global_types and data_type_id not in data_types:
                fixtures.append(self._get_fixture_element(data_type.tag, restore_user.user_id, []))
        return fixtures

    def _get_fixture_element(self, tag, user_id, items):
        fixture_element = ElementTree.Element(
            'fixture',
            attrib={
                'id': ':'.join((self.id, tag)),
                'user_id': user_id
            }
        )
        item_list_element = ElementTree.Element('%s_list' % tag)
        fixture_element.append(item_list_element)
        for item in items:
            item_list_element.append(item.to_xml())
        return fixture_element

item_lists = ItemListsProvider()


text:
package org.kie.workbench.common.widgets.client.menu;

import org.uberfire.backend.vfs.Path;
import org.uberfire.ext.editor.commons.client.validation.Validator;
import org.uberfire.mvp.Command;
import org.uberfire.workbench.model.menu.MenuItem;
import org.uberfire.workbench.model.menu.Menus;

public interface FileMenuBuilder {

    FileMenuBuilder addSave( final MenuItem menuItem );

    FileMenuBuilder addSave( final Command command );

    FileMenuBuilder addNewTopLevelMenu( final MenuItem menu );

    FileMenuBuilder addDelete( final Command command );

    FileMenuBuilder addDelete( final Path path );

    FileMenuBuilder addRename( final Command command );

    FileMenuBuilder addRename( final Path path );

    FileMenuBuilder addRename( final Path path,
                               final Validator validator );

    FileMenuBuilder addCopy( final Command command );

    FileMenuBuilder addCopy( final Path path );

    FileMenuBuilder addCopy( final Path path,
                             final Validator validator );

    FileMenuBuilder addValidate( final Command command );

    FileMenuBuilder addRestoreVersion( final Path path );

    FileMenuBuilder addCommand( final String caption,
                                final Command command );

    Menus build();
}


text:
package stone.ast;

import stone.Token;

/**
 * Created by liubang on 2017/6/13.
 */
public class Name extends ASTLeaf {
    public Name(Token t) {
        super(t);
    }

    public String name() {
        return getToken().getText();
    }
}


text:
namespace System.Web.Compilation {

using System;
using System.Resources;
using System.IO;

/// BuildProvider for .resources files
internal class ResourcesBuildProvider : BaseResourcesBuildProvider {

    protected override IResourceReader GetResourceReader(Stream inputStream) {
        return new ResourceReader(inputStream);
    }
}

}


text:
package com.microsoft.cll.android;

import android.util.Log;

/**
 * Handles android logging using logcat
 */

public class AndroidLogger implements ILogger {
    private Verbosity verbosity;

    private static AndroidLogger INSTANCE;
    private static Object InstanceLock = new Object();

    public static ILogger getInstance() {
        if(INSTANCE == null) {
            synchronized (InstanceLock) {
                if(INSTANCE == null) {
                    INSTANCE = new AndroidLogger();
                }
            }
        }
        return INSTANCE;
    }

    /**
     * Create an android logger with the default verbosity of none
     */
    private AndroidLogger() {
        setVerbosity(Verbosity.NONE);
    }

    /**
     * Sets the verbosity level. Any thing at or above the set verbosity will be written to log
     * @param verbosity The verbosity level to use
     */
    @Override
    public void setVerbosity(Verbosity verbosity) {
        this.verbosity = verbosity;
    }

    /**
     * Log information messages
     * @param TAG The Tag to log with
     * @param message The message to log
     */
    @Override
    public void info(String TAG, String message) {
        if(verbosity == Verbosity.INFO) {
            Log.i(TAG, message);
        }
    }

    /**
     * Log debug messages
     * @param TAG The Tag to log with
     * @param message The message to log
     */
    @Override
    public void warn(String TAG, String message) {
        if(verbosity == Verbosity.WARN || verbosity == Verbosity.INFO) {
            Log.d(TAG, message);
        }
    }

    /**
     * Log error messages
     * @param TAG The Tag to log with
     * @param message The message to log
     */
    @Override
    public void error(String TAG, String message) {
        if(verbosity == Verbosity.ERROR || verbosity == Verbosity.WARN || verbosity == Verbosity.INFO) {
            Log.e(TAG, message);
        }
    }
}


text:
class Main {
	static MyTest mytest;
	public static void main(String[] args) {

		int length = 15;
		int ret;
		int i;
		String teststring = "This is a test";
		int len = 14;

		int[] arrayOfInts = new int[10];
		int[] newArray;
		double[] arrayOfDbls = new double[5];

		mytest = new MyTest();

		//test getLine routine
		StringBuffer sb = new StringBuffer("Testing getLine routine.");
		String s = new String();
		s = sb.toString();
		ret = mytest.getLine(s, sb.length());
		if (ret == -1) {
		   System.out.println("Error in getLine routine");
		}
		ret = mytest.getLine(teststring, teststring.length());
		if (ret == -1) {
		   System.out.println("Error in getLine routine");
		}
		System.out.println ("Return value from getLine: " + ret);

		// test array routine
		for (i = 0; i< arrayOfInts.length;i++) {
		   arrayOfInts[i] = i;
		}
		for (i=0; i<arrayOfDbls.length; i++) {
		   arrayOfDbls[i] = 3.33 * i;
		}
		ret = 0;
		ret = mytest.getIntValue(arrayOfInts, arrayOfDbls);
		System.out.println("Return value ret: " + ret);

// create new array to size of arrayOfInts

		newArray = mytest.createArray(arrayOfInts);

	        for (i = 0; i < newArray.length; i++) {
		   System.out.println("new array: " + newArray[i]);
		}

		// call native method to get info
		i = mytest.getInfo();
		System.out.println("Value of i: " + i);

		ret = mytest.myInt;
		System.out.println("Value of myInt: " + ret);
		System.out.println("Value of myDbl: " + mytest.myDbl);
		System.out.println("Value of myFlt: " + mytest.myFlt);

		ret = mytest.createString(teststring, len);

		System.out.println("Check for exceptions");
		ret = 0;
		for (i = 98; i<102; i++) {
		   try {
			ret = mytest.handleError(i);
		   } catch (IllegalArgumentException e) {
			System.out.println("illegal arg. exception occurred");
			System.out.println("Message: " + e.getMessage());
		   } catch (Throwable e) {
			System.out.println("Caught an error");
			System.out.println("Message: " + e.getMessage());
		   }
		}
		ret = 0;
		try {
		   	ret = mytest.handleError2();
			System.out.println("Return value from error2: "
					+ ret);
		} catch (Throwable e) {
			System.out.println("Caught error in second routine");
			System.out.println("Return value: " + ret);
		}
	}
}


text:
#ifndef SDL_TIMER_HH
#define SDL_TIMER_HH

#include "Core.hh"
#include "System/SDLScopedLock.hh"

#include <utility>
#include <map>
#include <memory>
#include <iostream>

typedef struct _SDL_TimerID *SDL_TimerID;

namespace SDLut
{
namespace system
{
//Simple overloaded implementations
void Delay(long millisec);
long GetTicks();

//these should be used through the timer class, not directly
//NB : AddGlobalTimer should not be called from an other thread than the main one. Timers will behave strangely in multithreaded applications...
//NB2: if interval <=0, it's replaced by 1
SDL_TimerID AddGlobalTimer(unsigned int interval, unsigned int callback (unsigned int, void*) , void *param);
//passing pointer on callback object ( no auto_ptr because no sink here )
SDL_TimerID AddGlobalTimer(unsigned int interval, Core::Callback2Base<unsigned int,void*, unsigned int> * , void *param);
bool RemoveGlobalTimer(SDL_TimerID t);

/*
template <class TClass>
class Timer
{

    //Functor for Timer Callback
    //the only constraint about the callback function is that it should return int (next interval to apply)
    //and the arguments should be void* to be able to pass anything...

    class Callback : public TSpecificFunctor2<TClass,unsigned int,unsigned int>
    {
    public:
        Callback(TClass* ptobj, unsigned int (TClass::*ptfunc) (unsigned int interval,void * args))
                : TSpecificFunctor2<TClass,unsigned int,unsigned int>(ptobj,ptfunc)
        {
        }

    };

    //structure for arguments
    typedef struct
    {
        int lookupindex;
        void* args;
    } cbargs;

    //index of this functor instance in the static lookuptable
    unsigned int _index;

    std::auto_ptr<cbargs> _cbargs;

    //static table lookup that stores pointer to callback
    static std::map<unsigned int, Callback* > _cbtable;
    static std::map<unsigned int, SDL_TimerID* > _timertable;
    static Mutex mtx;// to protect the process of timer creation / deletion

public:

    //static callback function who calls the right functor from the table
    static unsigned int callback(unsigned int, void* args);

    SDL_TimerID _timerid; //set after timer is started
    //_timerid != 0  means the timer has been launched.

    Timer();
    ~Timer();

    void setCallback(TClass* instance, unsigned int (TClass::*func) (unsigned int, void*) , void* args);

    bool launch(unsigned int interval);
    bool abort();
};

template <class TClass>
std::map<unsigned int,typename Timer<TClass>::Callback* > Timer<TClass>::_cbtable;
template <class TClass>
std::map<unsigned int,SDL_TimerID* > Timer<TClass>::_timertable;
template <class TClass>
Mutex Timer<TClass>::mtx;

template <class TClass>
unsigned int Timer<TClass>::callback(unsigned int interval, void* args)
{
    try
    {
        cbargs* callargs= static_cast<cbargs*>(args);
        typename std::map<unsigned int,Callback* >::iterator itcb=_cbtable.find(callargs->lookupindex);
        if ( itcb == _cbtable.end() ) return 0; //stop callback : function to call doesnt exists

        //Do the actual client callback
        int res = itcb->second->call(interval,callargs->args);

        //critical section
        ScopedLock lock(mtx);

        if ( res == 0 ) // to set timer to 0 and erase it from the list, to flag termination of timer, so it can be launched again.
        {
            std::map<unsigned int,SDL_TimerID* >::iterator ittimer=_timertable.find(callargs->lookupindex);
            if ( ittimer != _timertable.end() )
            {
                *(ittimer->second) = 0;
                _timertable.erase(ittimer);
            }
            //else doesnt exists anymore ? should not happen, but it s fine...
        }
        return res;

        //This fix the problem when calling a timer from another timer, by handling return 0 to cancel next timer call.
        //however it seems to bug from time to time in P0.
        //
        //cbargs* callargs= static_cast<cbargs*>(args);
        //typename std::map<unsigned int,Callback* >::iterator itcb=_cbtable.find(callargs->lookupindex);
        //if ( itcb == _cbtable.end() ) return 0; //stop callback : function to call doesnt exists

        ////find corresponding timer
        //std::map<unsigned int,SDL_TimerID* >::iterator ittimer=_timertable.find(callargs->lookupindex);

        ////Do the actual client callback if timer still exist ( not aborted or terminated )
        //int res = 0;
        //if ( ittimer != _timertable.end() )
        //{
        //	res = itcb->second->call(interval,callargs->args);
        //	if ( res == 0)
        //	{
        //		 // to set timer to 0 and erase it from the list, to flag termination of timer, so it can be launched again.
        //		*(ittimer->second) = 0;
        //		_timertable.erase(ittimer);
        //	}
        //}

        //return res;
    }
    catch (std::exception &exc)
    {
        throw std::logic_error("Error in template <class TClass> Timer<TClass>::callback(), " + (std::string)exc.what());
    }
    catch (...)
    {
        throw std::logic_error("Unhandled Error in template <class TClass> Timer<TClass>::callback()");
    }
}

template<class TClass>
void Timer<TClass>::setCallback(TClass* instance,unsigned int (TClass::*func) (unsigned int, void*), void* args)
{
    try
    {
        //critical section
        ScopedLock lock(mtx);

        typename std::map<unsigned int, Callback*>::iterator it=_cbtable.find(_index);
        if ( it != _cbtable.end() )
        {
            delete it->second;
        }
        _cbtable[_index] = new Callback(instance,func);

        //reinit _cbargs when needed
        //if (_cbargs.get() != 0)
        //{
        //	delete _cbargs, _cbargs = NULL;
        //}
        _cbargs.reset( new cbargs() );
        _cbargs->lookupindex = _index;
        _cbargs->args = args;

    }
    catch (std::exception &exc)
    {
        throw std::logic_error("Error in template <class TClass> Timer<TClass>::setCallback(), " + (std::string)exc.what());
    }
    catch (...)
    {
        throw std::logic_error("Unhandled Error in template <class TClass> Timer<TClass>::setCallback()");
    }
}

template<class TClass>
Timer<TClass>::Timer() : _cbargs(0), _timerid()
{
    try
    {

        //setting the index for the current instance
        static unsigned int index=0;
        _index = index;
        index++;
        //preparing callback
        //_cbtable.push_back(NULL);
        //useful ? really ??

    }
    catch (std::exception &exc)
    {
        throw std::logic_error("Error in template <class TClass> Timer<TClass> Constructor, " + (std::string)exc.what());
    }
    catch (...)
    {
        throw std::logic_error("Unhandled Error in template <class TClass> Timer<TClass> Constructor");
    }
}

template<class TClass>
Timer<TClass>::~Timer()
{
    abort();// destructor abort a running timer if needed
    //if (_cbargs != NULL)
    //	delete _cbargs, _cbargs = NULL;

    //critical section
    ScopedLock lock(mtx);

    typename std::map<unsigned int, Callback*>::iterator it=_cbtable.find(_index);
    if (it != _cbtable.end())
    {
        delete it->second;
        _cbtable.erase(it);
    }
}

//returns true if the timer has been successfully launched. A timer can be launched only once. If this timer has already been launched this will return false.
//returns false if the timer could not be launched.
//NB : a timer cannot be launched from another timer's callback. Timer may behave strangely in multithreaded applications
template<class TClass>
bool Timer<TClass>::launch(unsigned int interval)
{
    try
    {
        //critical section
        ScopedLock lock(mtx);

        if ( interval > 0 && _timerid == 0 && _timertable.count(_index) == 0)
        {
            _timerid = AddGlobalTimer(interval,callback,_cbargs.get());
            std::pair<std::map<unsigned int,SDL_TimerID* >::iterator, bool > result = _timertable.insert(std::make_pair(_index,&_timerid));
            return result.second;
        }
        return false;

    }
    catch (std::exception &exc)
    {
        throw std::logic_error("Error in template <class TClass> Timer<TClass>::launch(), " + (std::string)exc.what());
    }
    catch (...)
    {
        throw std::logic_error("Unhandled Error in template <class TClass> Timer<TClass>::launch()");
    }
}

//return true if abort successful. return false if abortion failed ( the timer may already have stopped for example )
template<class TClass>
bool Timer<TClass>::abort()
{
    try
    {
        //critical section
        ScopedLock lock(mtx);

        if (_timerid != 0 && _timertable.count(_index) != 0 && RemoveGlobalTimer(_timerid) )
        {
            _timerid = 0;
            _timertable.erase(_index);
        }
        return (_timerid == 0 );

    }
    catch (std::exception &exc)
    {
        throw std::logic_error("Error in template <class TClass> Timer<TClass>::abort(), " + (std::string)exc.what());
    }
    catch (...)
    {
        throw std::logic_error("Unhandled Error in template <class TClass> Timer<TClass>::abort()");
    }
}
*/
}
}

#endif