text:
import os
import sys
import urllib2
import json
import re
from xml.etree import ElementTree

if len(sys.argv) > 2:
    os.system('rm -f .repo/local_manifests/roomservice.xml')

device = sys.argv[1];

def exists_in_tree(lm, repository):
    for child in lm.getchildren():
        if child.attrib['name'].endswith(repository):
            return True
    return False

# in-place prettyprint formatter
def indent(elem, level=0):
    i = "\n" + level*"  "
    if len(elem):
        if not elem.text or not elem.text.strip():
            elem.text = i + "  "
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
        for elem in elem:
            indent(elem, level+1)
        if not elem.tail or not elem.tail.strip():
            elem.tail = i
    else:
        if level and (not elem.tail or not elem.tail.strip()):
            elem.tail = i

def is_in_manifest(projectname):
    try:
        lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
        lm = lm.getroot()
    except:
        lm = ElementTree.Element("manifest")

    for localpath in lm.findall("project"):
        if localpath.get("name") == projectname:
            return 1

    try:
        lm = ElementTree.parse(".repo/local_manifests/device.xml")
        lm = lm.getroot()
    except:
        lm = ElementTree.Element("manifest")

    for localpath in lm.findall("project"):
        if localpath.get("name") == projectname:
            return 1

    try:
        mm = ElementTree.parse(".repo/manifest.xml")
        mm = mm.getroot()
    except:
        mm = ElementTree.Element("manifest")

    for localpath in mm.findall("project"):
        if localpath.get("name") == projectname:
            return 1

    return None

def add_to_manifest(repositories):
    if not os.path.exists(".repo/local_manifests/"):
        os.makedirs(".repo/local_manifests/")
    try:
        lm = ElementTree.parse(".repo/local_manifests/roomservice.xml")
        lm = lm.getroot()
    except:
        lm = ElementTree.Element("manifest")

    for repository in repositories:
        repo_account = repository['account']
        repo_name = repository['repository']
        repo_target = repository['target_path']
        repo_full = repo_account + '/' + repo_name
        repo_revision = repository['revision']
        if exists_in_tree(lm, repo_full):
            print '%s already exists' % repo_full
            continue

        print 'Adding dependency: %s -> %s' % (repo_full, repo_target)
        project = ElementTree.Element("project", attrib = { "path": repo_target,
            "remote": "github", "name": repo_full, "revision": repo_revision })

        if 'branch' in repository:
            project.set('revision',repository['branch'])

        lm.append(project)

    indent(lm, 0)
    raw_xml = ElementTree.tostring(lm)
    raw_xml = '<?xml version="1.0" encoding="UTF-8"?>\n' + raw_xml

    f = open('.repo/local_manifests/roomservice.xml', 'w')
    f.write(raw_xml)
    f.close()

def fetch_dependencies(device):
#    print 'Looking for CXR product dependencies'
    dependencies_path = 'vendor/cxr/dependencies/' + device + '.dependencies'

    syncable_repos = []

    if os.path.exists(dependencies_path):
        dependencies_file = open(dependencies_path, 'r')
        dependencies = json.loads(dependencies_file.read())
        fetch_list = []

        for dependency in dependencies:
            repo_full = dependency['account'] + "/" + dependency['repository']
            print '  Check for %s in local_manifest' % repo_full
            if not is_in_manifest(repo_full):
                fetch_list.append(dependency)
                syncable_repos.append(dependency['target_path'])
            else:
                print '    %s already in local_manifest' % repo_full

        dependencies_file.close()

        if len(fetch_list) > 0:
            print 'Adding dependencies to local_manifest'
            add_to_manifest(fetch_list)
#    else:
#        print 'dependencies definition file not found, bailing out.'

    if len(syncable_repos) > 0:
        print 'Syncing dependencies'
        os.system('repo sync %s' % ' '.join(syncable_repos))

fetch_dependencies(device)


text:
<?php

namespace Google\Service\Contentwarehouse;

class ImageRepositoryAnimatedImagePerdocData extends \Google\Model
{
  protected $aggregatedPornScoresType = ImageSafesearchContentBrainPornAnnotation::class;
  protected $aggregatedPornScoresDataType = '';
  /**
   * @var int
   */
  public $durationMs;

  /**
   * @param ImageSafesearchContentBrainPornAnnotation
   */
  public function setAggregatedPornScores(ImageSafesearchContentBrainPornAnnotation $aggregatedPornScores)
  {
    $this->aggregatedPornScores = $aggregatedPornScores;
  }
  /**
   * @return ImageSafesearchContentBrainPornAnnotation
   */
  public function getAggregatedPornScores()
  {
    return $this->aggregatedPornScores;
  }
  /**
   * @param int
   */
  public function setDurationMs($durationMs)
  {
    $this->durationMs = $durationMs;
  }
  /**
   * @return int
   */
  public function getDurationMs()
  {
    return $this->durationMs;
  }
}

// Adding a class alias for backwards compatibility with the previous class name.
class_alias(ImageRepositoryAnimatedImagePerdocData::class, 'Google_Service_Contentwarehouse_ImageRepositoryAnimatedImagePerdocData');

redpajama_set_name: RedPajamaGithub


text:
Make `ls` output only item names, each on separate line:

```sh
ls -1
```


text:
package scaladex.infra.sql

import doobie._
import scaladex.core.model.GithubInfo
import scaladex.core.model.Project
import scaladex.infra.sql.DoobieUtils.Mappings._
import scaladex.infra.sql.DoobieUtils._

object GithubInfoTable {
  val table: String = "github_info"
  val referenceFields: Seq[String] = Seq("organization", "repository")
  val infoFields: Seq[String] = Seq(
    "homepage",
    "description",
    "logo",
    "stars",
    "forks",
    "watchers",
    "issues",
    "creation_date",
    "readme",
    "contributors",
    "commits",
    "topics",
    "contributing_guide",
    "code_of_conduct",
    "chatroom",
    "open_issues",
    "scala_percentage",
    "license",
    "commit_activity"
  )

  val insert: Update[(Project.Reference, GithubInfo)] =
    insertRequest(table, referenceFields ++ infoFields)

  val insertOrUpdate: Update[(Project.Reference, GithubInfo, GithubInfo)] =
    insertOrUpdateRequest(table, referenceFields ++ infoFields, referenceFields, infoFields)

  val count: Query0[Long] = selectRequest(table, Seq("COUNT(*)"))
}


text:
declare var global: any;
const _global = <any>(typeof window === 'undefined' ? global : window);

import {_dom as _} from './dom-tools';

import {applyCssPrefixes, extendObject, } from '@angular/flex-layout/_private-utils';
import {StyleUtils} from '@angular/flex-layout/core';

export const expect: (actual: any) => NgMatchers = <any> _global.expect;

/**
 * Jasmine matchers that check Angular specific conditions.
 */
export interface NgMatchers extends jasmine.Matchers<any> {
  /**
   * Expect the element to have exactly the given text.
   *
   * ## Example
   *
   * {@example testing/ts/matchers.ts region='toHaveText'}
   */
  toHaveText(expected: string): boolean;

  /**
   * Compare key:value pairs as matching EXACTLY
   */
  toHaveMap(expected: { [k: string]: string }): boolean;

  /**
   * Expect the element to have the given CSS class.
   *
   * ## Example
   *
   * {@example testing/ts/matchers.ts region='toHaveCssClass'}
   */
  toHaveCssClass(expected: string): boolean;

  /**
   * Expect the element to have the given pairs of attribute name and attribute value
   */
  toHaveAttributes(expected: { [k: string]: string }): boolean;

  /**
   * Expect the element to have the given CSS styles injected INLINE
   *
   * ## Example
   *
   * {@example testing/ts/matchers.ts region='toHaveStyle'}
   */
  toHaveStyle(expected: { [k: string]: string } | string): boolean;

  /**
   * Expect the element to have the given CSS inline OR computed styles.
   *
   * ## Example
   *
   * {@example testing/ts/matchers.ts region='toHaveStyle'}
   */
  toHaveStyle(expected: { [k: string]: string } | string): boolean;

  /**
   * Invert the matchers.
   */
  not: NgMatchers;
}

/**
 * NOTE: These custom JASMINE Matchers are used only
 *       in the Karma/Jasmine testing for the Layout Directives
 *       in `src/lib/flex/api`
 */
export const customMatchers: jasmine.CustomMatcherFactories = {

  toEqual: function (util) {
    return {
      compare: function (actual: any, expected: any) {
        return {pass: util.equals(actual, expected)};
      }
    };
  },

  toHaveText: function () {
    return {
      compare: function (actual: any, expectedText: string) {
        const actualText = elementText(actual);
        return {
          pass: actualText == expectedText,
          get message() {
            return 'Expected ' + actualText + ' to be equal to ' + expectedText;
          }
        };
      }
    };
  },

  toHaveCssClass: function () {
    return {compare: buildError(false), negativeCompare: buildError(true)};

    function buildError(isNot: boolean) {
      return function (actual: any, className: string) {
        return {
          pass: _.hasClass(actual, className) == !isNot,
          get message() {
            return `
              Expected ${actual.outerHTML} ${isNot ? 'not ' : ''}
              to contain the CSS class '${className}'
            `;
          }
        };
      };
    }
  },

  toHaveMap: function () {
    return {
      compare: function (actual: { [k: string]: string }, map: { [k: string]: string }) {
        let allPassed: boolean;
        allPassed = Object.keys(map).length !== 0;
        Object.keys(map).forEach(key => {
          allPassed = allPassed && (actual[key] === map[key]);
        });

        return {
          pass: allPassed,
          get message() {
            return `
              Expected ${JSON.stringify(actual)} ${!allPassed ? ' ' : 'not '} to contain the
              '${JSON.stringify(map)}'
            `;
          }
        };
      }
    };
  },

  toHaveAttributes: function () {
    return {
      compare: function (actual: any, map: { [k: string]: string }) {
        let allPassed: boolean;
        let attributeNames = Object.keys(map);
        allPassed = attributeNames.length !== 0;
        attributeNames.forEach(name => {
          allPassed = allPassed && _.hasAttribute(actual, name)
              && _.getAttribute(actual, name) === map[name];
        });
        return {
          pass: allPassed,
          get message() {
            return `
              Expected ${actual.outerHTML} ${allPassed ? 'not ' : ''} attributes to contain
              '${JSON.stringify(map)}'
            `;
          }
        };
      }
    };
  },

  /**
   * Check element's inline styles only
   */
  toHaveStyle: function () {
    return {
      compare: buildCompareStyleFunction(true)
    };
  },

  /**
   * Check element's css stylesheet only (if not present inline)
   */
  toHaveCSS: function () {
    return {
      compare: buildCompareStyleFunction(false)
    };
  }

};

/**
 * Curried value to function to check styles that are inline or in a stylesheet for the
 * specified DOM element.
 */
function buildCompareStyleFunction(inlineOnly = true) {
  return function (actual: any, styles: { [k: string]: string } | string, styler: StyleUtils) {
    const found = {};
    const styleMap: {[k: string]: string} = {};

    if (typeof styles === 'string') {
      styleMap[styles] = '';
    } else {
      Object.assign(styleMap, styles);
    }

    let allPassed = Object.keys(styleMap).length !== 0;
    Object.keys(styleMap).forEach(prop => {
      let {elHasStyle, current} = hasPrefixedStyles(actual, prop, styleMap[prop], inlineOnly,
        styler);
      allPassed = allPassed && elHasStyle;
      if (!elHasStyle) {
        extendObject(found, current);
      }
    });

    return {
      pass: allPassed,
      get message() {
        const expectedValueStr = (typeof styles === 'string') ? styleMap :
            JSON.stringify(styleMap, null, 2);
        const foundValueStr = inlineOnly ? actual.outerHTML : JSON.stringify(found);
        return `
          Expected ${foundValueStr}${!allPassed ? '' : ' not'} to contain the
          CSS ${typeof styles === 'string' ? 'property' : 'styles'} '${expectedValueStr}'
        `;
      }
    };
  };
}

/**
 * Validate presence of requested style or use fallback
 * to possible `prefixed` styles. Useful when some browsers
 * (Safari, IE, etc) will use prefixed style instead of defaults.
 */
function hasPrefixedStyles(actual: HTMLElement,
                           key: string,
                           value: string,
                           inlineOnly: boolean,
                           styler: StyleUtils) {
  const current = {};

  if (value === '*') {
    return {elHasStyle: styler.lookupStyle(actual, key, inlineOnly) !== '', current};
  }

  value = value.trim();
  let elHasStyle = styler.lookupStyle(actual, key, inlineOnly) === value;
  if (!elHasStyle) {
    let prefixedStyles = applyCssPrefixes({[key]: value});
    Object.keys(prefixedStyles).forEach(prop => {
      // Search for optional prefixed values
      elHasStyle = elHasStyle ||
        styler.lookupStyle(actual, prop, inlineOnly) === prefixedStyles[prop];
    });
  }
  // Return BOTH confirmation and current computed key values (if confirmation == false)
  return {elHasStyle, current};
}

function elementText(n: any): string {
  const hasNodes = (m: any) => {
    const children = _.childNodes(m);
    return children && children['length'];
  };

  if (n instanceof Array) {
    return n.map(elementText).join('');
  }

  if (_.isCommentNode(n)) {
    return '';
  }

  if (_.isElementNode(n) && _.tagName(n) == 'CONTENT') {
    return elementText(Array.prototype.slice.apply(_.getDistributedNodes(n)));
  }

  if (_.hasShadowRoot(n)) {
    return elementText(_.childNodesAsList(_.getShadowRoot(n)));
  }

  if (hasNodes(n)) {
    return elementText(_.childNodesAsList(n));
  }

  return _.getText(n);
}


text:
var nuxeo = require('nuxeo'),
  async = require('async'),
  path = require('path'),
  fs = require('fs');

exports.import = function(config) {
  var client = new nuxeo.Client({
    baseURL: config.baseURL,
    username: config.username,
    password: config.password,
    timeout: config.timeout
  });

  // uncomment this header when importing on Nuxeo < 7.4
  // client.header('X-NXDocumentJsonLegacy', true);

  var localPath = config.localPath;
  // TODO replace with path.isAbsolute() when switching to node 0.11.x
  if (localPath[0] !== '/') {
    localPath = path.join(process.cwd(), localPath);
  }

  // Format: Type_source_lifecycestate_dc:valid_dc:creator_filename.doc
  var readFilename = function(filename, isFolder) {
    var eles = filename.split('_');

    // when no Type defined, or only Type and filename
    var properties = {};
    if (eles.length === 1) {
      properties['dc:title'] = eles[0];
      return {
        type: isFolder ? 'Folder' : 'File',
        filename: eles[0],
        properties: properties
      };
    } else if (eles.length === 2) {
      properties['dc:title'] = eles[1];
      return {
        type: eles[0],
        filename: eles[1],
        properties: properties
      };
    }

    // Wrong format
    if (eles.length < 6) {
      console.error('Wrong filename format: ' + filename);
      return null;
    }

    // compute the transition to follow
    var transition;
    switch (eles[2]) {
      case 'approved':
        transition = 'approve';
        break;
      case 'obsolete':
        transition = 'obsolete';
        break;
      case 'deleted':
        transition = 'delete';
        break;
    }

    // compute the default properties
    var properties = {};
    if (eles[3]) {
      properties['dc:valid'] = eles[3];
    }
    if (eles[4]) {
      properties['dc:creator'] = eles[4];
    }
    if (eles[1]) {
      properties['dc:source'] = eles[1];
    }
    properties['dc:title'] = eles[5];

    return {
      type: eles[0],
      lifecycleState: eles[2],
      transition: transition,
      properties: properties,
      filename: eles[5]
    };
  };

  var createDocumentFromFile = function(file, remotePath, callback) {
    if (config.verbose) {
      console.log('Create document from file: ' + file);
    }

    var metadata = readFilename(path.basename(file), false);
    // Note type
    if (metadata.type === 'Note') {
      var content = fs.readFileSync(file, {
        encoding: 'UTF-8'
      });
      metadata.properties['note:note'] = content;
    }

    client.document(remotePath)
      .create({
        type: metadata.type,
        name: metadata.filename,
        properties: metadata.properties
      }, function(err, doc) {
        if (err) {
          callback(err, file, null, metadata);
        } else {
          if (config.verbose) {
            console.log('Created remote file: ' + doc.path);
          }

          if (callback) {
            callback(null, file, doc, metadata);
          }
        }
      });
  };

  var uploadBlob = function(file, doc, metadata, callback) {
    if (config.verbose) {
      console.log('Upload blob for: ' + file);
    }

    if (metadata.type === 'Note') {
      callback(null, doc, metadata);
      return;
    }

    // attach the Blob
    // create the uploader bound to the operation
    var uploader = client.operation('Blob.Attach')
      .params({
        document: doc.uid,
        save: true,
        xpath: 'file:content'
      })
      .uploader();

    // upload the file
    uploader.uploadFile(fs.createReadStream(file), function(err, data) {
      if (err) {
        if (config.verbose) {
          console.error('Error while uploading file: ' + file);
        }
        callback(err);
        return;
      }

      // when done, execute the operation
      uploader.execute(function(err, data) {
        if (err) {
          if (config.verbose) {
            console.error('Error while attaching file: ' + file + ' to ' + doc.path);
          }
          callback(err);
          return;
        }

        // successfully attached blob
        if (config.verbose) {
          console.log('Attached blob to: ' + doc.path);
        }
        callback(null, doc, metadata);
      });
    });
  };

  var createFolder = function(dir, remotePath, callback) {
    if (config.verbose) {
      console.log('Create folder: ' + dir);
    }

    var metadata = readFilename(path.basename(dir), true);

    client.document(remotePath)
      .create({
        type: metadata.type,
        name: metadata.filename,
        properties: metadata.properties
      }, function(err, doc) {
        if (err) {
          callback(err, dir, metadata);
        } else {
          if (config.verbose) {
            console.log('Created remote folder: ' + doc.path);
          }

          callback(null, doc, metadata);
        }
      });
  };

  var followTransition = function(doc, metadata, callback) {
    if (!metadata.transition) {
      if (config.verbose) {
        console.log('Not following transition for: ' + doc.path);
      }

      callback(null, doc, metadata);
      return;
    }

    if (config.verbose) {
      console.log('Following transition for: ' + doc.path);
    }

    var operation = client.operation('Document.SetLifeCycle')
      .param('value', metadata.transition)
      .input(doc.uid);

    operation.execute(function(err, updatedDoc, response) {
      if (err) {
        if (config.verbose) {
          console.error('Error while following transition ' + metadata.transition + ' on doc ' + doc.path);
        }
        callback(err);
        return;
      }

      if (config.verbose) {
        console.log('Followed transition  ' + metadata.transition + ' on doc ' + updatedDoc.path);
      }

      callback(null, updatedDoc, metadata);
    });
  };

  var setACE = function(doc, metadata, callback) {
    if (metadata.lifecycleState !== 'obsolete') {
      if (config.verbose) {
        console.log('Not setting ACE for: ' + doc.path);
      }

      callback(null, doc, metadata);
      return;
    }

    if (config.verbose) {
      console.log('Setting ACE for: ' + doc.path);
    }

    var operation = client.operation('Document.SetACE')
      .param('user', 'quality')
      .param('permission', 'Read')
      .input(doc.uid);

    operation.execute(function(err, updatedDoc, response) {
      if (err) {
        if (config.verbose) {
          console.error('Error while setting Read ACE for "quality" group on doc ' + doc.path);
        }
        callback(err);
        return;
      }

      if (config.verbose) {
        console.log('Setted Read ACE for "quality" group on doc ' + updatedDoc.path);
      }

      callback(null, updatedDoc, metadata);
    });
  }

  // for the final report
  var filesCount = 0,
    foldersCount = 0,
    filesCreated = 0,
    foldersCreated = 0,
    filesNotWellProcessed = [],
    foldersNotWellProcessed = [];

  // our queue to process documents creation
  var queue = async.queue(function(task, queueCallback) {
    if (config.verbose) {
      console.log('Started task for: ' + task.absPath);
    }

    var isDirectory = fs.statSync(task.absPath).isDirectory();
    var funcs = [];
    if (isDirectory) {
      funcs.push(createFolder.bind(this, task.absPath, task.remotePath));
      foldersCount++;
    } else {
      funcs = funcs.concat([
        createDocumentFromFile.bind(this, task.absPath, task.remotePath),
        uploadBlob
      ]);
      filesCount++;
    }
    funcs = funcs.concat([
      followTransition,
      setACE
    ]);

    async.waterfall(funcs, function(err, doc, metadata) {
      if (err) {
        if (isDirectory) {
          foldersNotWellProcessed.push({
            path: task.absPath,
            err: err
          });
        } else {
          filesNotWellProcessed.push({
            path: task.absPath,
            err: err
          });
        }

        if (config.verbose) {
          console.log('Taks in error for: ' + task.absPath);
        }
        queueCallback(); // next task
        return;
      }

      if (config.verbose) {
        console.log('Finished task for: ' + task.absPath);
      }

      queueCallback();
      if (isDirectory) {
        foldersCreated++;
        walk(task.absPath, doc.path);
      } else {
        filesCreated++;
      }
    });
  }, config.maxConcurrentRequests);

  // walk the whole directory tree
  var walk = function(localPath, remotePath) {
    fs.readdir(localPath, function(err, files) {
      if (fs.statSync(localPath).isFile()) {
        queue.push({
          absPath: localPath,
          remotePath: remotePath
        });
      } else {
        fs.readdir(localPath, function(err, files) {
          files.forEach(function(file) {
            var absPath = path.join(localPath, file);
            queue.push({
              absPath: absPath,
              remotePath: remotePath
            });
          });
        });
      }
    });
  };

  var start = new Date();
  walk(localPath, config.remotePath);

  process.on('exit', function() {
    var end = new Date();

    console.log('');
    console.log('Report Summary');
    console.log('--------------');
    console.log('  Total documents processed   ' + (foldersCreated + filesCreated) + '/' + (foldersCount + filesCount));
    console.log('    Files processed           ' + filesCreated + '/' + filesCount);
    console.log('    Folders processed         ' + foldersCreated + '/' + foldersCount);
    console.log('  Total time                  ' + (end - start) + 'ms');
    console.log('  Average time per document   ' + ((end - start) / (foldersCreated + filesCreated)) + 'ms');
    console.log('');
    if (filesNotWellProcessed.length > 0) {
      console.log('Files not well processed');
      console.log('------------------------');
      filesNotWellProcessed.forEach(function(file) {
        console.log(file.path);
        console.log('  Reason: ' + file.err.message);
        if (config.verbose) {
          console.log('  Error');
          console.log(JSON.stringify(file.err, null, 2));
        }
        console.log('');
      });
    }
    if (foldersNotWellProcessed.length > 0) {
      console.log('Folders not well processed');
      console.log('--------------------------');
      foldersNotWellProcessed.forEach(function(folder) {
        console.log(folder.path);
        console.log('  Reason: ' + folder.err.message);
        if (config.verbose) {
          console.log('  Error');
          console.log('  ' + JSON.stringify(folder.err, null, 2));
        }
        console.log('');
      });
    }
    console.log('');
  });
};


text:
package com.contained.game.user;

import java.awt.Color;
import java.awt.Point;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;

import com.contained.game.Contained;
import com.contained.game.network.ClientPacketHandlerUtil;
import com.contained.game.util.MiniGameUtil;

import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.server.MinecraftServer;
import net.minecraft.util.ChatComponentText;

/**
 * Represents a group of players which share a common territory.
 */
public class PlayerTeam {

	public String id;
	public String displayName;
	public HashMap<String, PlayerTeamPermission> permissions;
	public int colorID; //Index for format codes below
	public int dimID;

	/*
	 *  http://minecraft.gamepedia.com/Formatting_codes
	 */
	public static final String[] formatCodes = {
		"§0", "§1", "§2", "§3", "§4", "§5", "§6", "§7", "§8", "§9",
		"§a", "§b", "§c", "§d", "§e", "§f"
	};
	public static final int[] formatColors = {
		0x000000,
		0x0000AA,
		0x00AA00,
		0x00AAAA,
		0xAA0000,
		0xAA00AA,
		0xFFAA00,
		0xAAAAAA,
		0x555555,
		0x5555FF,
		0x55FF55,
		0x55FFFF,
		0xFF5555,
		0xFF55FF,
		0xFFFF55,
		0xFFFFFF
	};
	public static final int[] rgbColors = {
		Color.BLACK.hashCode(),
		new Color(0,0, 170).hashCode(), //Dark Blue
		new Color(0, 170, 0).hashCode(), //Dark Green
		new Color(0, 170, 170).hashCode(), //Dark Aqua
		new Color(170, 0, 0).hashCode(), //Dark Red
		new Color(170, 0, 170).hashCode(), //Dark Purple
		new Color(255, 170, 0).hashCode(), //Gold
		new Color(170, 170, 170).hashCode(), //Gray
		new Color(85, 85, 85).hashCode(), //Dark Gray
		new Color(85, 85, 255).hashCode(), //Blue
		new Color(85, 255, 85).hashCode(), //Green
		new Color(85, 255, 255).hashCode(), //Aqua
		new Color(255, 85, 85).hashCode(), //Red
		new Color(255, 85, 255).hashCode(), //Light Purple
		new Color(255, 255, 85).hashCode(), //Yellow
		Color.WHITE.hashCode()
	};

	public PlayerTeam(int dimID) {
		this(UUID.randomUUID().toString(), dimID);
	}

	public PlayerTeam(String id, int dimID) {
		this(id, "", 0, dimID);
	}

	public PlayerTeam(String name, int color, int dimID) {
		this(UUID.randomUUID().toString(), name, color, dimID);
	}

	public PlayerTeam(String id, String name, int color, int dimID) {
		this.id = id;
		this.dimID = dimID;
		this.displayName = name;
		this.permissions = new HashMap<String, PlayerTeamPermission>();
		setColor(color);
	}

	public PlayerTeam(NBTTagCompound ntc) {
		this.readFromNBT(ntc);
	}

	/**
	 * Removes the team, and all of its associated data (territory, players, etc)
	 */
	public void disbandTeam() {
		MinecraftServer.getServer().getCommandManager().executeCommand(MinecraftServer.getServer(), "say The team, "+displayName+", has been disbanded.");

		//For all players in this team, have them leave the team.
		for (PlayerTeamIndividual player : Contained.teamMemberData) {
			if (player.teamID != null && player.teamID.equals(this.id))
				player.leaveTeam();
		}

		//Remove team's territory.
		ArrayList<Point> territoryToRemove = new ArrayList<Point>();
		for (Point p : Contained.getTerritoryMap(dimID).keySet()) {
			if (Contained.getTerritoryMap(dimID).get(p).equals(this.id))
				territoryToRemove.add(p);
		}
		for (Point p : territoryToRemove) //Second pass, to avoid concurrent modification.
			MiniGameUtil.removeTerritoryBlock(p, dimID);

		//Remove any pending invitations involving this team.
		ArrayList<PlayerTeamInvitation> invitationsToRemove = new ArrayList<PlayerTeamInvitation>();
		for (PlayerTeamInvitation invite : Contained.teamInvitations) {
			if (invite.teamID != null && invite.teamID.equals(this.id))
				invitationsToRemove.add(invite);
		}
		for (PlayerTeamInvitation invite : invitationsToRemove)
			Contained.teamInvitations.remove(invite);

		//Remove any custom permissions involving this team.
		for (PlayerTeam team : Contained.getTeamList(dimID))
			team.permissions.remove(this.id);

		//Remove the team.
		Contained.getTeamList(dimID).remove(this);

		Contained.channel.sendToAll(ClientPacketHandlerUtil.packetSyncTeams(Contained.getTeamList(dimID)).toPacket());
		Contained.channel.sendToAll(ClientPacketHandlerUtil.packetSyncTerritories(Contained.getTerritoryMap(dimID)).toPacket());
	}

	/**
	 * Gets all of the players from this team that are currently online.
	 */
	public ArrayList<EntityPlayer> getOnlinePlayers() {
		ArrayList<EntityPlayer> ret = new ArrayList<EntityPlayer>();
		@SuppressWarnings("rawtypes")
		List onlinePlayers = MinecraftServer.getServer().getConfigurationManager().playerEntityList;
		for (Object o : onlinePlayers) {
			if (o instanceof EntityPlayer) {
				EntityPlayer p = (EntityPlayer)o;
				PlayerTeamIndividual pdata = PlayerTeamIndividual.get(p);
				if (pdata.teamID != null && pdata.teamID.equals(this.id))
					ret.add(p);
			}
		}
		return ret;
	}

	/*
	 * Gets all of the players from this team both online/offline
	 */
	public List<String> getTeamPlayers(){
		List<String> list = new ArrayList<String>();

		for(PlayerTeamIndividual pdata : Contained.teamMemberData){
			if(pdata.teamID != null && pdata.teamID.equals(this.id))
				list.add(pdata.playerName);
		}

		return list;
	}

	/*
	 * Gets all of the players that have logged into the server
	 */
	public List<String> getPlayersList(){
		List<String> list = new ArrayList<String>();

		for(PlayerTeamIndividual pdata : Contained.teamMemberData)
			list.add(pdata.playerName);

		return list;
	}

	/*
	 * Get all of the players that are not in a team
	 */
	public List<String> getLonerList(String username){
		List<String> list = new ArrayList<String>();

		for(PlayerTeamIndividual pdata : Contained.teamMemberData){
			if(pdata.teamID == null)
				list.add(pdata.playerName);
		}

		return list;
	}

	/**
	 * Sends a chat message to all players on this team.
	 */
	public void sendMessageToTeam(String msg) {
		ArrayList<EntityPlayer> teamMembers = getOnlinePlayers();
		for(EntityPlayer member : teamMembers)
			member.addChatComponentMessage(new ChatComponentText(msg));
	}

	/**
	 * Get the number of players currently in this team.
	 */
	public int numMembers() {
		int members = 0;
		for(PlayerTeamIndividual player : Contained.teamMemberData) {
			if (player.teamID != null && player.teamID.equals(this.id))
				members++;
		}
		return members;
	}

	/**
	 * Get the number of blocks of land this team owns.
	 */
	public int territoryCount() {
		int count = 0;
		for(Point territory : Contained.getTerritoryMap(dimID).keySet()) {
			if (Contained.getTerritoryMap(dimID).get(territory).equals(id))
				count++;
		}
		return count;
	}

	/**
	 * Sets the player's color via a string command.
	 * Accepted commands:
	 *

	 *
"random": Set this team to a random color.

	 *
[0-9] or [a-f]: Set to the color associated with the corresponding format code.

	 *
An integer: Set to the color indexed by this number.

	 *

	 * @return Whether or not the given command was valid.
	 */
	public boolean setColor(String command) {
		String lcmd = command.toLowerCase();
		if (lcmd.equals("random")) {
			randomColor();
			return true;
		}
		else {
			try {
				int index = Integer.parseInt(lcmd);
				setColor(index);
				return true;
			} catch (NumberFormatException e) {
				for(int i=0; i<formatCodes.length; i++) {
					if (lcmd.contains(String.valueOf(formatCodes[i].charAt(1)))) {
						setColor(i);
						return true;
					}
				}
			}
		}
		return false;
	}

	public void setColor(int id) {
		this.colorID = Math.min(PlayerTeam.formatColors.length-1, Math.max(0,id));
	}

	public void randomColor() {
		setColor((int)(Math.random()*formatColors.length));
	}

	public String getFormatCode() {
		return formatCodes[this.colorID];
	}

	public String formattedName() {
		return getFormatCode()+"§l"+displayName;
	}

	public int getColor() {
		return formatColors[this.colorID];
	}

	public int getColorID() {
		return this.colorID;
	}

	public PlayerTeamPermission getPermissions(String teamID) {
		if (teamID == null)
			return (new PlayerTeamPermission());
		if (teamID.equals(this.id)) {
			//Requested permissions for our own team. Nothing should be disabled.
			PlayerTeamPermission retPerm = new PlayerTeamPermission();
			retPerm.setAllowAll();
			return retPerm;
		}
		else if (!this.permissions.containsKey(teamID)) {
			//We don't have the requested team stored, return default permissions.
			if (teamID.equals(getDefaultPermissionsKey()))
				return (new PlayerTeamPermission());
			else
				return getDefaultPermissions();
		}
		else
			return this.permissions.get(teamID);
	}

	public PlayerTeamPermission getDefaultPermissions() {
		return getPermissions(getDefaultPermissionsKey());
	}

	public void setDefaultPermissions(PlayerTeamPermission perm) {
		this.permissions.put(getDefaultPermissionsKey(), perm);
	}

	public static String getDefaultPermissionsKey() {
		return "default";
	}

	public void writeToNBT(NBTTagCompound ntc) {
		ntc.setString("id", this.id);
		ntc.setInteger("color", this.colorID);
		ntc.setInteger("dimID", this.dimID);
		ntc.setString("name", this.displayName);

		NBTTagList permList = new NBTTagList();
		for(String team : this.permissions.keySet()) {
			NBTTagCompound permData = new NBTTagCompound();
			permData.setString("teamID", team);
			this.permissions.get(team).writeToNBT(permData);
			permList.appendTag(permData);
		}
		ntc.setTag("permissions", permList);
	}

	public void readFromNBT(NBTTagCompound ntc) {
		this.id = ntc.getString("id");
		this.displayName = ntc.getString("name");
		this.dimID = ntc.getInteger("dimID");
		setColor(ntc.getInteger("color"));

		this.permissions = new HashMap<String, PlayerTeamPermission>();
		NBTTagList permList = ntc.getTagList("permissions", (byte)10);
		for(int i=0; i<permList.tagCount(); i++) {
			NBTTagCompound permData = permList.getCompoundTagAt(i);
			String team = permData.getString("teamID");
			this.permissions.put(team, new PlayerTeamPermission(permData));
		}
	}

	@Override
	public boolean equals(Object o) {
		if (o instanceof PlayerTeam) {
			PlayerTeam pt = (PlayerTeam)o;
			if (pt.id.equals(this.id))
				return true;
		} else if (o instanceof String) {
			String id = (String)o;
			if (id.equals(this.id))
				return true;
		}
		return false;
	}

	@Override
	public int hashCode() {
		return this.id.hashCode();
	}

	@Override
	public String toString() {
		return this.id;
	}

	public static PlayerTeam get(ArrayList<PlayerTeam> teams, Object comp) {
		for (int i=0; i<teams.size(); i++) {
			if (teams.get(i).equals(comp))
				return teams.get(i);
		}
		return null;
	}

	public static PlayerTeam get(Object comp, int dim) {
		return PlayerTeam.get(Contained.getTeamList(dim), comp);
	}

	public static PlayerTeam get(Object comp) {
		for(int i : Contained.teamData.keySet()) {
			PlayerTeam team = PlayerTeam.get(Contained.teamData.get(i), comp);
			if (team != null)
				return team;
		}
		return null;
	}
}


text:
package commandParsing.structuralCommandParsing;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Queue;
import workspaceState.Turtle;
import workspaceState.WorkspaceState;
import commandParsing.CommandParser;
import commandParsing.drawableObectGenerationInterfaces.TurtleGenerator;
import commandParsing.exceptions.RunTimeNullPointerException;
import commandParsing.exceptions.SLOGOException;
import drawableobject.DrawableObject;

/**
 * This parses commands meant to be sent to multiple turtles.
 *
 * @author Stanley Yuan
 *
 */

public abstract class MultipleTurtleCommand extends StructuralCommand implements TurtleGenerator {

    List<Turtle> savedListOfTurtles = new ArrayList<Turtle>();
    List<Integer> activeTurtleIDList = new ArrayList<Integer>();

    public MultipleTurtleCommand (WorkspaceState someWorkspace) {
        super(someWorkspace);
    }

    @Override
    public abstract double parse (Iterator<String> commandStringIterator,
                                  Queue<DrawableObject> objectQueue)
                                          throws SLOGOException;

    protected void determineTurtlesToActivate (Iterator<String> commands,
                                               Queue<DrawableObject> objectQueue)
                                                       throws SLOGOException {
        double value = 0;
        while (commands.hasNext()) {
            String stringOfInterest = commands.next();
            CommandParser parser = createParser(stringOfInterest, workspace);
            value = parser.parse(commands, objectQueue);
            activeTurtleIDList.add((int) value);
        }
        returnValue = value;
    }

    protected int makeAndActivateGivenTurtles (Queue<DrawableObject> objectQueue)
            throws RunTimeNullPointerException {
        int lastTurtleID = 0;
        for (int i : activeTurtleIDList) {
            if (workspace.turtles.hasTurtleWithID(i)) {
                workspace.turtles.activateTurtle(i);
            }
            else {
                workspace.turtles.addTurtle(i);
                Turtle newTurtle = workspace.turtles.getLastAddedTurtle();
                objectQueue.add(generateDrawableObjectRepresentingTurtle(newTurtle));
            }
            lastTurtleID = i;
        }
        return lastTurtleID;
    }

    protected void saveCurrentActiveTurtles () {
        savedListOfTurtles.addAll(workspace.turtles.getActiveTurtles());
    }

    protected void restoreActiveTurtles () throws RunTimeNullPointerException {
        for (Turtle t : savedListOfTurtles) {
            workspace.turtles.activateTurtle(t.getID());
        }
    }

}


text:
'use strict';

var utils = require('./bookshelf-utils')
  ;

function init(knex, meta, tableMap) {
  var Orm = require('bookshelf').initialize(knex)
    , Db = {}
    , emu = meta.xattrs.type // json | text
    ;

  function createModel(tablename, obj) {
    var ucamel = tablename
      , snake = utils.str.underscored(tablename)
      ;

    if (!obj.tableName) {
      obj.tableName = snake;
    }

    if ('undefined' === typeof obj.hasTimestamps) {
      obj.hasTimestamps = ['created_at', 'updated_at'];
    }

    console.log('tableMap');
    console.log(tableMap);
    obj.format = utils.format(emu, 'xattrs', tableMap[snake], []/*jsonCols*/);
    obj.parse = utils.parse(emu, 'xattrs', tableMap[snake], []/*(jsonCols*/);
    Db[ucamel] = Orm.Model.extend(obj);

    return Db[ucamel];
  }

  function createModels(map) {
    Object.keys(map).forEach(function (key) {
      console.log(map, key, map[key]);
      createModel(key, map[key]);
    });
  }

  createModels(
    { Data:
      { idAttribute: 'uuid'
      }
    }
  , { AddressBooks:
      { idAttribute: 'uuid'
      }
    /*
    , users: function () {
        this.belongsTo(Db.Accounts, 'logins_accounts', 'login_typed_uid', 'account_uuid');
      }
    */
    }
  );

  /*
  Db.Logins = Orm.Model.extend({
    tableName: 'logins'
  , idAttribute: 'typedUid'
  , accounts: function () {
      this.belongsToMany(Db.Accounts, 'logins_accounts', 'login_typed_uid', 'account_uuid');
      //return this.hasMany(Db.Accounts, 'account_uuid').through(Db.AccountsLogins, 'account_uuid');
    }
    // format before saving
  , hasTimestamps: ['created_at', 'updated_at']
  , format: zipXattrs('xattrs', [
    , 'typedUid'
    , 'uid'
    , 'type'
    , 'primaryAccountId'
    , 'createdAt'
    , 'updatedAt'
    ])
    // parse while retrieving
  , parse: inflateXattrs('xattrs')
  });

  Db.Accounts = Orm.Model.extend({
    tableName: 'accounts'
  , idAttribute: 'uuid'
  , logins: function () {
      //this.hasMany(Db.Logins, 'typed_uid').through(Db.AccountsLogins, 'login_typed_uid');
      return this.belongsToMany(Db.Logins, 'accounts_logins', 'account_uuid', 'login_typed_uid');
    }
  , hasTimestamps: ['created_at', 'updated_at']
  , format: zipXattrs('xattrs', [
      'uuid'
    , 'createdAt'
    , 'updatedAt'
    ])
  , parse: inflateXattrs('xattrs')
  });

  Db.AccountsLogins = Orm.Model.extend({
    tableName: 'logins_accounts'
  , hasTimestamps: ['created_at', 'updated_at']

    // relations
  , account: function() {
      return this.belongsTo(Db.Accounts, 'account_uuid');
    }
  , login: function() {
      return this.belongsTo(Db.Logins, 'login_typed_uid');
    }

    // meta
  , format: zipXattrs('xattrs', [
      'createdAt'
    , 'updatedAt'
    ])
  , parse: inflateXattrs('xattrs')
  });
  */

  return Db;
}

module.exports.create = function myCreate(knex) {
  var tablesMap = {}
    , info
    ;

  function createTables() {
    console.log('[create tables]');
    return require('../migrations').create(knex).then(function () {
      return myCreate(knex);
    });
  }

  try {
    info = knex('_st_meta_').columnInfo();
  } catch(e) {
    console.error("Couldn't get columnInfo");
    console.error(e);
    return createTables();
  }

  return info.then(function (meta) {
    if (0 === Object.keys(meta).length) {
      console.error('[no keys]', meta);
      return createTables();
    }

    // TODO provide an array
    var table = 'data'
      ;

    return knex(table).columnInfo().then(function (cols) {
      tablesMap[table] = cols;
    }).then(function () {
      return init(knex, meta, tablesMap);
    }, function (err) {
      console.error('[no table]', table);
      console.error(err);
    });
  }, function (err) {
    console.error('[bookshelf-models] [ERROR]');
    console.error(err);
  });
};


text:
(function () {

	window.App ={
		Models: {},
		Collections: {},
		Views: {},
		Grids: {}
	};

	window.template = function(id) {
		return _.template( $('#' + id).html() );
	};

	App.Models.Sensors = Backbone.Model.extend({

		defaults: {
			Ingles: null,
			Espanol: null,
			code: null,
			interfases: []

		},
	});

	App.Collections.Sensors = Backbone.Collection.extend({
		model: App.Models.Sensors,
		search: function(opts){
			var result = this.where( opts );
			var resultCollection = new App.Collections.Sensors(result);
			return resultCollection;
		}

	});

	var SensorsCollection = new App.Collections.Sensors;

	SensorsCollection.url = '/assets/js/sensores.min.json';
	SensorsCollection.fetch();

	App.Grids.Sensors = new bbGrid.View({

		container: $('#bbGrid-search'),
		rows: 10,
		rowList: [10, 15, 25, 50, 100],
		collection: SensorsCollection,
		colModel: [{ title: 'Clave', index: true, name: 'id', filter: true, filterType: 'input', sorttype: 'string'},
		           { title: 'Nombre en Español', index: true, name: 'Espanol', filter: true, filterType: 'input'},
		           { title: 'Interfases Compatibles', index: true, name: 'interfases', filter: true, filterType: 'input'}],

	});

})();


text:
def start(objects):
    print(objects)
    return "PublishContent"


text:
#ifndef __LUA_H
#define __LUA_H

#include <lua.h>
#include <lualib.h>
#include <lauxlib.h>
#include <glib.h>
#include <err.h>

/*!
 * \defgroup lua Lua
 * Functions to manipulate the Lua context.
 *
 * @{
 */

int luaL_error_handler (lua_State *L);

/*!
 * @param L The lua VM state.
 * @param idx Index of the stack.
 * @return A reference on the function or 0.
 *
 * Check if lua_stack[idx] is a function, return a reference in that
 * case.
 */
static inline int luaL_checkfunction (lua_State *L, int idx)
{
     luaL_checktype (L, idx, LUA_TFUNCTION);
     lua_pushvalue (L, idx);
     return luaL_ref (L, LUA_REGISTRYINDEX);
}

/*!
 * @param L The lua VM state.
 * @param ref The function's reference.
 * @param nargs Number of arguments.
 * @param nreturns Number of return values.
 *
 * Call a function (using lua_call()).
 */
static inline void luaL_callfunction (lua_State *L, int ref, int nargs, int nreturns)
{
     if (ref)
     {
          int errfunc;

          lua_rawgeti (L, LUA_REGISTRYINDEX, ref);

          /* Move function before arguments */
          lua_insert (L, - nargs - 1);

          /* push error handler and move it before args and function */
          lua_pushcfunction (L, luaL_error_handler);
          lua_insert (L, - nargs - 2);
          errfunc = lua_gettop (L) - nargs - 1;

          if (lua_pcall (L, nargs, nreturns, - nargs - 2))
          {
               warn ("%s", lua_tostring (L, -1));
               lua_pop (L, 2);
               return;
          }

          lua_remove (L, errfunc);
     }
}

/*!
 * @param L The lua VM state.
 * @param idx Index of the stack.
 *
 * Check if lua_stack[idx] is a table (raise an error if not).
 */
static inline void luaL_checktable (lua_State *L, int idx)
{
     luaL_checktype (L, idx, LUA_TTABLE);
}

/*!
 * @param L The lua VM state.
 * @param idx Index of the stack.
 * @return A boolean.
 *
 * Check if lua_stack[idx] is a boolean, return it.
 */
static inline gboolean luaL_checkboolean (lua_State *L, int idx)
{
     luaL_checktype (L, idx, LUA_TBOOLEAN);
     return lua_toboolean (L, idx);
}

/*!
 * \def LUA_TCLIPBOARD
 * Userdata type associated to \class{GtkClipboard}.
 */
#define LUA_TCLIPBOARD "Clipboard"

/*!
 * \def LUA_TREGEX
 * Userdata type associated to \class{GRegex}.
 */
#define LUA_TREGEX     "Regex"

/*!
 * \def LUA_TWEBVIEW
 * Userdata type associated to #WebView.
 */
#define LUA_TWEBVIEW   "WebView"

/*!
 * \def LUA_TNOTEBOOK
 * Userdata type associated to #Notebook.
 */
#define LUA_TNOTEBOOK  "Notebook"

gboolean lua_ctx_init (GError **err);
gboolean lua_ctx_parse (const char *file, GError **err);
void lua_ctx_close (void);

/* push objects */
extern void lua_pushwebview (lua_State *L, WebView *w);
extern void lua_pushnotebook (lua_State *L, Notebook *n);

/* Used for __index and __newindex */

typedef int (*luaI_func) (lua_State *L, gpointer v);

/*!
 * \struct luaI_reg
 * Member info for get and set handlers
 */
typedef struct
{
     const gchar *name;       /*!< member name. */
     luaI_func func;          /*!< get or set function for type of member. */
     size_t offset;           /*!< offset of member with its type. */
} luaI_reg;

void luaI_add (lua_State *L, const luaI_reg *l);
int luaI_index (lua_State *L);
int luaI_newindex (lua_State *L);

int luaI_getint (lua_State *L, gpointer v);
int luaI_setint (lua_State *L, gpointer v);

int luaI_getbool (lua_State *L, gpointer v);
int luaI_setbool (lua_State *L, gpointer v);

int luaI_getstring (lua_State *L, gpointer v);
int luaI_setstring (lua_State *L, gpointer v);

/*!
 * \def LUAL_REGISTER_DECL (name, lua_type)
 * @param name Package's name.
 * @param lua_type Lua type's name.
 *
 * Register a package in lua.
 */
#define LUAL_REGISTER_DECL(name,lua_type)                        \
int luaL_##name##_register (lua_State *L)                        \
{                                                                \
     int metatable, methods;                                     \
                                                                 \
     luaL_openlib (L, lua_type, cream_##name##_methods, 0);      \
     methods = lua_gettop (L);                                   \
                                                                 \
     luaL_newmetatable (L, lua_type);                            \
     luaL_openlib (L, 0, cream_##name##_meta, 0);                \
     metatable = lua_gettop (L);                                 \
                                                                 \
     lua_pushliteral (L, "__metatable");                         \
     lua_pushvalue (L, methods);                                 \
     lua_rawset (L, metatable);                                  \
                                                                 \
     lua_pushliteral (L, "__index");                             \
     lua_pushvalue (L, metatable);                               \
     luaI_add (L, cream_##name##_getters);                       \
     lua_pushvalue (L, methods);                                 \
     lua_pushcclosure (L, luaI_index, 2);                        \
     lua_rawset (L, metatable);                                  \
                                                                 \
     lua_pushliteral (L, "__newindex");                          \
     lua_newtable (L);                                           \
     luaI_add (L, cream_##name##_setters);                       \
     lua_pushcclosure (L, luaI_newindex, 1);                     \
     lua_rawset (L, metatable);                                  \
                                                                 \
     lua_pop (L, 1);                                             \
     return 1;                                                   \
}

/*! @} */

#endif /* __LUA_H */


text:
#ifndef DragClientEfl_h
#define DragClientEfl_h

#include "DragClient.h"

namespace WebCore {
class DragClientEfl : public WebCore::DragClient {
public:
    virtual void willPerformDragDestinationAction(WebCore::DragDestinationAction, WebCore::DragData*);
    virtual void willPerformDragSourceAction(WebCore::DragSourceAction, const WebCore::IntPoint&, WebCore::Clipboard*);
    virtual WebCore::DragDestinationAction actionMaskForDrag(WebCore::DragData*);

    virtual WebCore::DragSourceAction dragSourceActionMaskForPoint(const WebCore::IntPoint& windowPoint);

    virtual void startDrag(WebCore::DragImageRef dragImage, const WebCore::IntPoint& dragImageOrigin, const WebCore::IntPoint& eventPos, WebCore::Clipboard*, WebCore::Frame*, bool linkDrag = false);

    virtual void dragControllerDestroyed();
};
}

#endif // DragClientEfl_h


text:
/*
 * securityGroups.js: Instance methods for working with security groups
 * for Openstack Networking
 *
 * (C) 2015 Rackspace
 *      Shaunak Kashyap
 * MIT LICENSE
 */

var urlJoin = require('url-join');

var securityGroupsResourcePath = '/security-groups';

// Declaring variables for helper functions defined later
var _convertSecurityGroupToWireFormat;

/**
 * client.getSecurityGroups
 *
 * @description get the list of security groups for an account
 *
 * @param {object|Function}   options
 * @param {Function}          callback
 */
exports.getSecurityGroups = function (options, callback) {
  var self = this;

  if (typeof options === 'function') {
    callback = options;
    options = {};
  }

  var getSecurityGroupOpts = {
    path: securityGroupsResourcePath
  };

  this._request(getSecurityGroupOpts, function (err, body) {
    if (err) {
      return callback(err);
    }
    else if (!body || !body.security_groups || !(body.security_groups instanceof Array)) {
      return new Error('Malformed API Response');
    }

    return callback(err, body.security_groups.map(function (securityGroup) {
      return new self.models.SecurityGroup(self, securityGroup);
    }));
  });
};

/**
 * client.getSecurityGroup
 *
 * @description get the details for a specific securityGroup
 *
 * @param {String|object}     securityGroup     the securityGroup or securityGroupId
 * @param callback
 */
exports.getSecurityGroup = function (securityGroup, callback) {
  var self = this,
    securityGroupId = securityGroup instanceof this.models.SecurityGroup ? securityGroup.id : securityGroup;
  self.emit('log::trace', 'Getting details for security group', securityGroupId);
  this._request({
    path: urlJoin(securityGroupsResourcePath, securityGroupId),
    method: 'GET'
  }, function (err, body) {
    if (err) {
      return callback(err);
    }

    if (!body ||!body.security_group) {
      return new Error('Malformed API Response');
    }

    callback(err, new self.models.SecurityGroup(self, body.security_group));
  });
};

/**
 * client.createSecurityGroup
 *
 * @description create a new security group
 *
 * @param object      securityGroup
 * @param string      securityGroup.name        Name of security group.
 * @param {string}    securityGroup.description Description of security group.
 * @param {string}    securityGroup.tenantId    The ID of the tenant who owns the security group. Only administrative users can specify a tenant ID other than their own.
 * @param callback
 */
exports.createSecurityGroup = function (securityGroup, callback) {
  var self = this;

  securityGroup = _convertSecurityGroupToWireFormat(securityGroup);

  var createSecurityGroupOpts = {
    method: 'POST',
    path: securityGroupsResourcePath,
    body: { 'security_group': securityGroup }
  };

  self.emit('log::trace', 'Creating security group', securityGroup);
  this._request(createSecurityGroupOpts, function (err,body) {
    return err
      ? callback(err)
      : callback(err, new self.models.SecurityGroup(self, body.securityGroup));
  });
};

/**
 * client.destroySecurityGroup
 *
 * @description Delete a specific securityGroup
 *
 * @param {String|object}     securityGroup     the securityGroup or securityGroup ID
 * @param callback
 */
exports.destroySecurityGroup = function (securityGroup, callback) {
  var self = this,
    securityGroupId = securityGroup instanceof this.models.SecurityGroup ? securityGroup.id : securityGroup;
  self.emit('log::trace', 'Deleting security group', securityGroupId);
  this._request({
    path: urlJoin(securityGroupsResourcePath,securityGroupId),
    method: 'DELETE'
  }, function (err) {
    if (err) {
      return callback(err);
    }
    callback(err, securityGroupId);
  });
};

/**
 * _convertSecurityGroupToWireFormat
 *
 * @description convert SecurityGroup instance into its wire representation.
 *
 * @param {object}     details    the SecurityGroup instance.
 */
_convertSecurityGroupToWireFormat = function (details){
    var wireFormat = {};
    wireFormat.name = details.name;
    wireFormat.description = details.description;
    wireFormat.tenant_id = details.tenant_id || details.tenantId;
    return wireFormat;
};


text:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:background="@color/common_bg"
    android:orientation="vertical">

    <TextView
        android:id="@+id/tv_pay_state"
        android:layout_width="match_parent"
        android:layout_height="68dp"
        android:drawableLeft="@drawable/pay_success"
        android:drawablePadding="@dimen/activity_horizontal_margin"
        android:gravity="center_vertical"
        android:padding="@dimen/activity_horizontal_margin"
        android:text="@string/pay_success"
        android:textColor="@color/textPrimary"
        android:visibility="gone"
        android:textSize="20sp" />

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:padding="@dimen/activity_horizontal_margin">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/release_from"
            android:textColor="@color/textPrimary"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_from"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:textColor="@color/textSecondary"
            android:textSize="14sp" />
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/colorDividerLight"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"></View>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:padding="@dimen/activity_horizontal_margin">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/release_send"
            android:textColor="@color/textPrimary"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_send"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:textColor="@color/textSecondary"
            android:textSize="14sp" />
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/colorDividerLight"
        android:paddingLeft="@dimen/activity_horizontal_margin"
        android:paddingRight="@dimen/activity_horizontal_margin"></View>

    <RelativeLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/white"
        android:padding="@dimen/activity_horizontal_margin">

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/pay_amount"
            android:textColor="@color/textPrimary"
            android:textSize="16sp" />

        <TextView
            android:id="@+id/tv_amount"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentRight="true"
            android:textColor="@color/textSecondary"
            android:textSize="14sp" />
    </RelativeLayout>

    <com.wills.help.widget.MyRadioGroup
        android:id="@+id/rg_pay"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="@dimen/activity_vertical_margin"
        android:orientation="vertical">

        <RelativeLayout
            android:id="@+id/rl_balance"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/iv_balance"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/pay_balance" />

            <TextView
                android:id="@+id/tv_balance"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_toRightOf="@id/iv_balance"
                android:text="@string/pay_balance"
                android:textColor="@color/textPrimary" />

            <TextView
                android:id="@+id/tv_balance_amount"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@id/tv_balance"
                android:layout_below="@id/tv_balance"
                android:textColor="@color/textSecondary"
                android:textSize="12sp" />

            <RadioButton
                android:id="@+id/rb_balance"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:background="@drawable/chekbox"
                android:button="@null"
                android:checked="true" />
        </RelativeLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:background="@color/colorDividerLight"></View>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/iv_ali"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/pay_ali" />

            <TextView
                android:id="@+id/tv_ali"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_toRightOf="@id/iv_ali"
                android:text="@string/pay_ali"
                android:textColor="@color/textPrimary" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@id/tv_ali"
                android:layout_below="@id/tv_ali"
                android:text="@string/pay_ali_content"
                android:textColor="@color/textSecondary"
                android:textSize="12sp" />

            <RadioButton
                android:id="@+id/rb_ali"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:background="@drawable/chekbox"
                android:button="@null"
                android:checked="false" />
        </RelativeLayout>

        <View
            android:layout_width="match_parent"
            android:layout_height="0.5dp"
            android:background="@color/colorDividerLight"></View>

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@color/white"
            android:padding="@dimen/activity_horizontal_margin">

            <ImageView
                android:id="@+id/iv_wx"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:src="@drawable/pay_wx" />

            <TextView
                android:id="@+id/tv_wx"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginLeft="@dimen/activity_horizontal_margin"
                android:layout_toRightOf="@id/iv_wx"
                android:text="@string/pay_wx"
                android:textColor="@color/textPrimary"
                android:textSize="14sp" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignLeft="@id/tv_wx"
                android:layout_below="@id/tv_wx"
                android:text="@string/pay_wx_content"
                android:textColor="@color/textSecondary"
                android:textSize="12sp" />

            <RadioButton
                android:id="@+id/rb_wx"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentRight="true"
                android:layout_centerVertical="true"
                android:background="@drawable/chekbox"
                android:button="@null" />
        </RelativeLayout>
    </com.wills.help.widget.MyRadioGroup>

    <Button
        android:id="@+id/btn_submit"
        android:layout_width="match_parent"
        android:layout_height="@dimen/btn_submit_height"
        android:layout_margin="@dimen/activity_horizontal_margin"
        android:background="@drawable/btn_selector"
        android:text="@string/pay"
        android:textColor="@color/white"
        android:textSize="16sp" />
</LinearLayout>


text:
/* eslint-disable max-classes-per-file */
import React from 'react';
import { QueryFormData, ChartMetadata, ChartPlugin } from '@superset-ui/core';

const DIMENSION_STYLE = {
  fontSize: 36,
  fontWeight: 700,
  flex: '1 1 auto',
  display: 'flex',
  alignItems: 'center',
};

export const TestComponent = ({
  formData,
  message,
  width,
  height,
}: {
  formData?: unknown;
  message?: string;
  width?: number;
  height?: number;
}) => (

      {message ?? 'custom component'}

      {[width, height].join('x')}

      {JSON.stringify(formData)}

);

export const ChartKeys = {
  DILIGENT: 'diligent-chart',
  LAZY: 'lazy-chart',
  SLOW: 'slow-chart',
  BUGGY: 'buggy-chart',
};

export class DiligentChartPlugin extends ChartPlugin<QueryFormData> {
  constructor() {
    super({
      metadata: new ChartMetadata({
        name: ChartKeys.DILIGENT,
        thumbnail: '',
      }),
      Chart: TestComponent,
      transformProps: x => x,
    });
  }
}

function identity<T>(x: T) {
  return x;
}

export class LazyChartPlugin extends ChartPlugin<QueryFormData> {
  constructor() {
    super({
      metadata: new ChartMetadata({
        name: ChartKeys.LAZY,
        thumbnail: '',
      }),
      // this mirrors `() => import(module)` syntax
      loadChart: () => Promise.resolve({ default: TestComponent }),
      // promise without .default
      loadTransformProps: () => Promise.resolve(identity),
    });
  }
}

export class SlowChartPlugin extends ChartPlugin<QueryFormData> {
  constructor() {
    super({
      metadata: new ChartMetadata({
        name: ChartKeys.SLOW,
        thumbnail: '',
      }),
      loadChart: () =>
        new Promise(resolve => {
          setTimeout(() => {
            resolve(TestComponent);
          }, 1000);
        }),
      transformProps: x => x,
    });
  }
}

export class BuggyChartPlugin extends ChartPlugin<QueryFormData> {
  constructor() {
    super({
      metadata: new ChartMetadata({
        name: ChartKeys.BUGGY,
        thumbnail: '',
      }),
      Chart: () => {
        throw new Error('The component is too buggy to render.');
      },
      transformProps: x => x,
    });
  }
}


text:
Checker bindings for Xamarin.Android which are Grpc dependencies (Grpc.Core).

The Checker Framework enhances Java's type system to make it more powerful and useful. This
lets software developers detect and prevent errors in their Java programs. The Checker Framework
includes compiler plug-ins ("checkers") that find bugs or verify their absence. It also permits
users to write compiler plug-ins.

*   https://repo1.maven.org/maven2/org/checkerframework/checker/

*   https://mvnrepository.com/artifact/org.checkerframework

*   packages bound

    *   `Checker` (`io.checkerframework.checker`)


text:
<?php
namespace eMapper\MySQL\Fluent;

use eMapper\Fluent\AbstractFluentDeleteTest;
use eMapper\MySQL\MySQLConfig;

/**
 *
 * @author emaphp
 * @group mysql
 * @group fluent
 */
class FluentDeleteTest extends AbstractFluentDeleteTest {
	use MySQLConfig;
}
?>


text:
/*
Класс описывает комнату, в которой будет находиться что-то.
В каждой комнате должно быть:
1) Сцена - this.Scene; Может быть импортирована из файла
2) Ограничивающая область - this.SkyBox;
3) Освещение - this.Lightning;
4) Функция, которая должна быть обработана в комнате, каждый момент времени - this.update();
5)
*/
var _Room = function ()
{
	this.Scene = new THREE.Scene();

	this.SkyBox = new THREE.Mesh(new THREE.BoxGeometry(), new THREE.MeshStandardMaterial());

	this.UpdatableObjects = [];
};
/*
Основная функция, обрабатывающая все процессы, происходящие в комнате
*/
_Room.prototype.update = function ()
{

};

_Room.prototype.loadSceneFromFile = function ()
{

};

_Room.prototype.addUserToScene = function (user)
{
	this.Scene.add(user);
};


text:
ControleMultimidiaUniversal
===========================

ControleMultimidiaUniversal


text:
#ifndef V_GROUPCACHE_H
#define V_GROUPCACHE_H

#include "v_kernel.h"
#include "v_cache.h"

#define v_groupCache(o) (C_CAST((o),v_groupCache))
#define v_groupCacheEmpty(_this) v_cacheEmpty(v_cache(_this))

v_cache
v_groupCacheNew (
    v_kernel kernel,
    v_cacheKind kind);

#define v_groupCacheInsert(_this,item) \
        v_cacheInsert(v_cache(_this),v_cacheNode(item))

#define v_groupCacheWalk(_this,_action,_arg) \
        v_cacheWalk(v_cache(_this),_action,_arg)

#define v_groupCacheDeinit(_this) \
        v_cacheDeinit(v_cache(_this))

/* inner class: v_groupCacheItem */

#define v_groupCacheItem(o) (C_CAST((o),v_groupCacheItem))

#define v_groupCacheRemove(_this,item) \
        v_cacheRemove(v_cache(_this),v_cacheNode(item))

#define v_groupCacheItemRemove(_this,kind) \
        v_cacheNodeRemove(v_cacheNode(_this),kind)

#define v_groupCacheItemInstance(_this) \
        c_keep(v_cacheNode(_this)->instance)

v_groupCacheItem
v_groupCacheItemNew (
    v_groupInstance groupInstance,
    v_instance instance);

#endif


text:
var Product = function(){
	this.productTitle = "";
	this.productDescription = "";
	this.productCategory = "";
	this.images = [];
	this.price = "";
  	this.colorSize = [];

	this.addColorSize = function(newColorSize){
		this.colorSize.push(newColorSize);
	}

	this.addImg = function(newImage){
		this.images.push(newImage);
	}

	this.deleteColorSize = function(toBeDeleted){
    console.log("deleteFunc", this.colorSize);
    console.log("deleteFunc", toBeDeleted);
		for (var i = 0; i < this.colorSize.length; i++){
			if (this.colorSize[i].$$hashKey === toBeDeleted.$$hashKey){
        this.colorSize.splice(i, 1);
			}
		}
    console.log(this.colorSize);
	}

};


text:
// Copyright (c) 2017 Uber Technologies, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.

'use strict';

var TypedError = require('error/typed');

var errors = {
    MaxRetriesReached: TypedError({
        type: 'ringpop.backoff.max-retries-reached',
        message: 'backoff reached max number of retries. retries={retries}, attempt={attempt}.',
        retries: null,
        attempt: null
    }),
    RetryTimedOut: TypedError({
        type: 'ringpop.backoff.retry-timed-out',
        message: 'backoff timed out. timeout={timeout}, duration={duration}',
        timeout: null,
        duration: null
    })
};

/**
 * Backoff provides exponential backoff. Every time {Backoff.retry} is called,
 * the delay increases exponentially until it reaches maxDelay.
 *
 * @param {Object} opts The opts
 * @param {Number} [opts.minDelay=500] the minimum delay in ms
 * @param {Number} [opts.maxDelay=1500] the maximum delay in ms
 * @param {Number} [opts.retries] the number of retries
 * @param {Number} [opts.timeout] the timeout of retrying in ms
 * @param {Number} [opts.timers] mock timers-module during tests
 * @param {Number} [opts.random] mock Math.random during tests
 *
 * @constructor
 */
function Backoff(opts) {
    this.minDelay = opts.minDelay || 500;
    this.maxDelay = opts.maxDelay || 15000;
    this.retries = opts.retries;
    this.timeout = opts.timeout;

    /* Used for mocking */
    this._timers = opts.timers || require('timers');
    this._random = opts.random || Math.random;
    this._now = opts.timers && opts.timers.now || Date.now;

    this.attempt = 0;
    this.firstTry = null;
    this.timer = undefined;
}

Backoff.Errors = errors;

Backoff.prototype._delay = function _delay(){
    var minDelay = this.minDelay * Math.pow(2, this.attempt);
    var withFuzz = Math.floor(this._random() *
            (minDelay * 0.5)) + minDelay;
    var delay = Math.min(this.maxDelay, withFuzz);

    return delay;
};

/**
 * Retry will call callback after an exponentially increasing delay.
 * @param callback the callback to call after the delay with an optional error
 * argument. Error will be set if:
 * - If opts.timeout is set and retry is called after the timeout is passed;
 * - If opts.retries is set and retry is called after the number of attempts exceeds it;
 *
 * When both are unset, callback is always called without an error.
 */
Backoff.prototype.retry = function retry(callback) {
    var self = this;
    if (!self.firstTry) {
        self.firstTry = self._now();
    }

    if (self.retries !== undefined && self.attempt >= self.retries) {
        setImmediate(callback, errors.MaxRetriesReached({retries: self.retries, attempt:self.attempt}));
        return;
    }

    var duration = self._now() - self.firstTry;
    if (self.timeout !== undefined && duration > self.timeout) {
        setImmediate(callback, errors.RetryTimedOut({timeout: self.timeout, duration: duration}));
        return;
    }

    var delay = self._delay();
    self.timer = self._timers.setTimeout(function onTimeout() {
        self.attempt++;
        self._timers.clearTimeout(self.timer);
        self.timer = undefined;

        callback();
    }, delay);
    return;
};

module.exports = Backoff;


text:
package com.thoughtworks.go.remote.request;

import com.thoughtworks.go.server.service.AgentRuntimeInfo;

public interface AgentRequest {
    AgentRuntimeInfo getAgentRuntimeInfo();
}


text:
using Logic.ConclusionTypes.BehaviourContracts;
using Logic.JudgementTypes.BehaviourContracts;

namespace Logic.ConclusionTypes
{
    class EmptyType : IConclusionType
    {
        public int GetIdent()
        {
            return 0;
        }
    }
}


text:
import {
  Predicate,
  PredicateResponse
} from '@salesforce/salesforcedx-utils-vscode';
import * as fs from 'fs';
import * as path from 'path';
import { workspace } from 'vscode';
import { SFDX_PROJECT_FILE } from '../constants';
import { nls } from '../messages';
import { workspaceUtils } from '../util';

export class IsSfdxProjectOpened implements Predicate<typeof workspace> {
  public apply(item: typeof workspace): PredicateResponse {
    if (!workspaceUtils.hasRootWorkspace()) {
      return PredicateResponse.of(
        false,
        nls.localize('predicates_no_folder_opened_text')
      );
    } else if (
      !fs.existsSync(
        path.join(workspaceUtils.getRootWorkspacePath(), SFDX_PROJECT_FILE)
      )
    ) {
      return PredicateResponse.of(
        false,
        nls.localize('predicates_no_sfdx_project_found_text')
      );
    } else {
      return PredicateResponse.true();
    }
  }
}


text:
using System.Runtime.InteropServices;
using System.Security;

namespace FusionPInvoke
{
    [Guid("f3549d9c-fc73-4793-9c00-1cd204254c0c")]
    [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
    public interface IEnumDefinitionIdentity
    {
        [SecurityCritical]
        uint Next(int celt, [Out, MarshalAs(UnmanagedType.LPArray)] IDefinitionIdentity[] definitionIdentity);

        [SecurityCritical]
        void Skip(int celt);

        [SecurityCritical]
        void Reset();

        [SecurityCritical]
        IEnumDefinitionIdentity Clone();
    }
}


text:
import os
from setuptools import setup, find_packages

def read(fname):
    return open(os.path.join(os.path.dirname(__file__), fname)).read()

setup(
    name="gpiozero",
    version="0.1.0",
    author="Ben Nuttall",
    description="A simple interface to everyday GPIO components used with Raspberry Pi",
    license="BSD",
    keywords=[
        "raspberrypi",
        "gpio",
    ],
    url="https://github.com/RPi-Distro/gpio-zero",
    packages=find_packages(),
    install_requires=[
        "RPi.GPIO",
        "w1thermsensor",
    ],
    long_description=read('README.rst'),
    classifiers=[
        "Development Status :: 1 - Planning",
        "Intended Audience :: Education",
        "Topic :: Education",
        "Topic :: System :: Hardware",
        "License :: OSI Approved :: BSD License",
        "Programming Language :: Python :: 2",
        "Programming Language :: Python :: 3",
    ],
)


text:
class PrefRegistrySimple;
class PrefService;

namespace component_updater {

class ComponentUpdateService;

// Execute the SwReporter if one is available, otherwise 1) register with the
// component updater, 2) save a preference in |prefs| identifying that an
// attempt to execute the reporter tool was made, so that calls to
// ExecutePending below will be able to continue the work if it doesn't complete
// before the Chrome session ends. It will also allow the component updater to
// know if there is a pending execution or not when an update happens. This must
// be called from the UI thread.
void ExecuteSwReporter(ComponentUpdateService* cus, PrefService* prefs);

// ExecutePending will only register/execute the SwReporter if a preference is
// set in |prefs|, identifying that an attempt to register/execute the
// SwReporter has already been made by calling ExecuteSwReporter above. But only
// if the max number of retries has not been reached yet. This must be called
// from the UI thread.
void ExecutePendingSwReporter(ComponentUpdateService* cus, PrefService* prefs);

// Register user preferences related to the SwReporter.
void RegisterPrefsForSwReporter(PrefRegistrySimple* registry);

}  // namespace component_updater

#endif  // CHROME_BROWSER_COMPONENT_UPDATER_SW_REPORTER_INSTALLER_WIN_H_


text:
using Airbraker.Data;
using System.Collections.Generic;

namespace Airbraker
{
    /// <summary>
    /// Represents a stack trace parser
    /// </summary>
    public interface IStackTraceParser
    {
        /// <summary>
        /// Parses a stack trace string into <see cref="AirbrakeTraceLine"/> enumeration.
        /// </summary>
        /// <param name="stackTrace">String data containing the stack trace information.</param>
        /// <returns><see cref="IEnumerable{T}"/> of <see cref="AirbrakeTraceLine"/></returns>
        IEnumerable<AirbrakeTraceLine> Parse(string stackTrace);
    }
}


text:
[![build status][travis-image]][travis-url]
[![Coverage Status][coveralls-image]][coveralls-url]
[![gitter][gitter-image]][gitter-url]
[![Dependency Status][DependencyStatus-image]][DependencyStatus-url]

[travis-image]: https://api.travis-ci.org/leoliew/generator-sails-diy.svg?branch=master
[travis-url]: https://travis-ci.org/leoliew/generator-sails-diy
[coveralls-image]: https://coveralls.io/repos/leoliew/generator-sails-diy/badge.svg?branch=master
[coveralls-url]: https://coveralls.io/r/leoliew/generator-sails-diy
[gitter-image]: https://badges.gitter.im/leoliew/generator-sails-diy.svg
[gitter-url]: https://gitter.im/leoliew/generator-sails-diy?utm_source=share-link&utm_medium=link&utm_campaign=share-link
[DependencyStatus-image]: https://gemnasium.com/leoliew/generator-sails-diy.svg
[DependencyStatus-url]:https://gemnasium.com/leoliew/generator-sails-diy

sails yeoman generator

## Getting Started

* ```npm install -g yo``` (Make sure you have [yo](https://github.com/yeoman/yo) installed)
* ```npm set registry https://registry.npmjs.org/``` (Make sure you npm registry is official)
* ```npm install -g generator-sails-diy``` (Install the generators)
* ```mkdir my-project && cd $_``` (Create project directory and `cd` into it)
* ```yo sails-diy``` (Run sails-diy generator)
* ```sails lift``` (To run project)
* ```npm test``` (To test)
* ```npm run coverage``` (To test and make coverage report)

## Generator Command

* ```yo sails-diy:controller Test```(Create a controller in your app)
* ```yo sails-diy:model Ticket --rest```(Create a model in your app)
* ```yo sails-diy:cron cron1 cron2```(Create a cron in your app)
* ```yo sails-diy:service ping```(Create a service in your app)
* ```yo sails-diy:policy auth```(Create a policy in your app)
* ```npm start```(Compose your API and run)
* ```npm test```(Run unit test in your project)

## TODO

* install adapter that version is Assign
* multiply adapter chooser
* use "request-info" package in this project

## License

MIT


text:
require 'google/api_client'
require 'google/api_client/client_secrets'
require 'google/api_client/auth/installed_app'
require 'base64'
require 'pp'

client = Google::APIClient.new(
  :application_name => 'Example Ruby application',
  :application_version => '1.0.0'
)

# use pkc12
key = Google::APIClient::KeyUtils.load_from_pkcs12('client.p12', 'notasecret')
client.authorization = Signet::OAuth2::Client.new(
  :token_credential_uri => 'https://accounts.google.com/o/oauth2/token',
  :audience => 'https://accounts.google.com/o/oauth2/token',
  :scope => ['https://www.googleapis.com/auth/pubsub','https://www.googleapis.com/auth/cloud-platform'],
  :issuer => '848252309922-665kbdgdnoernrh0fslg99d3e7j9atrf@developer.gserviceaccount.com',
  :signing_key => key)
client.authorization.fetch_access_token!

# use OAuth 2.0
# client_secrets = Google::APIClient::ClientSecrets.load
#
# flow = Google::APIClient::InstalledAppFlow.new(
#   :client_id => client_secrets.client_id,
#   :client_secret => client_secrets.client_secret,
#   :scope => ['https://www.googleapis.com/auth/pubsub','https://www.googleapis.com/auth/cloud-platform']
# )
#
# client.authorization = flow.authorize

pubsub = client.discovered_api('pubsub', 'v1beta2')

pp Time.now
# Make an API call.
result = client.execute(
  :api_method => pubsub.projects.topics.publish,
  :parameters => {
    'topic' => 'projects/dev-yamashita/topics/topic-pubsub-api-appengine-sample'
  },
  :body_object => {
    'messages' => [
      {
        'data' => Base64.encode64('message from app2'),
        'attributes' => {
          'data1' => 'good',
          'data2' => 'bad',
        }
      }
    ]
  }
)
pp Time.now
puts result.data.to_json
result = client.execute(
  :api_method => pubsub.projects.topics.publish,
  :parameters => {
    'topic' => 'projects/dev-yamashita/topics/topic-pubsub-api-appengine-sample'
  },
  :body_object => {
    'messages' => [
      {
        'data' => Base64.encode64('うっひょー2'),
        'attributes' => {
          'data3' => 'good',
          'data4' => 'bad',
        }
      }
    ]
  }
)
pp Time.now
puts result.data.to_json


text:
using System;
using System.Collections.Generic;
using System.Collections.Concurrent;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Stylus.Util;

namespace Stylus.Query
{
    /// <summary>
    /// Flattened tuples as intermediate results
    /// </summary>
    public class QuerySolutions
    {
        public List<string> Heads { set; get; }

        public List<long[]> Records { set; get; }

        // public ConcurrentBag<List<long>> Records { set; get; }

        public QuerySolutions()
        {
            this.Heads = new List<string>();
            this.Records = new List<long[]>();
        }

        public QuerySolutions(QuerySolutions other)
        {
            this.Heads = new List<string>(other.Heads);
            this.Records = new List<long[]>(other.Records);
        }

        public void AppendRecord(long[] tuple)
        {
            this.Records.Add(tuple);
        }

        public void AppendRecords(IEnumerable<long[]> tuples)
        {
            this.Records.AddRange(tuples);
        }

        private bool Invalid(long[] record)
        {
            return record == null;
        }

        public QuerySolutions Join(QuerySolutions other)
        {
            if (this.Heads.Count == 0)
            {
                return other;
            }
            if (other.Heads.Count == 0)
            {
                return this;
            }

            var self_dict = GetHeadDict();
            var other_dict = other.GetHeadDict();
            var join_cols = new Dictionary<string, Tuple<int, int>>();
            List<int> self_join_indexes = new List<int>();
            List<int> other_join_indexes = new List<int>();
            foreach (var skvp in self_dict)
            {
                string key = skvp.Key;
                if (other_dict.ContainsKey(key))
                {
                    join_cols.Add(key, Tuple.Create(skvp.Value, other_dict[key]));
                    self_join_indexes.Add(skvp.Value);
                    other_join_indexes.Add(other_dict[key]);
                }
            }

            if (join_cols.Count == 0)
            {
                this.Product(other);
                return this;
            }

            List<string> union_head = new List<string>(this.Heads);
            union_head.AddRange(other.Heads);
            union_head = union_head.Distinct().ToList();
            QuerySolutions join_binding = new QuerySolutions();
            join_binding.Heads = union_head;

            int[] signed_indexes = new int[union_head.Count];
            for (int i = 0; i < union_head.Count; i++)
            {
                string col_name = union_head[i];
                if (self_dict.ContainsKey(col_name))
                {
                    signed_indexes[i] = self_dict[col_name];
                }
                else
                {
                    signed_indexes[i] = -(other_dict[col_name] + 1);
                }
            }

            join_binding.Records = new List<long[]>();

            Dictionary<int, List<int>> hash_self_indexes = new Dictionary<int, List<int>>();
            for (int i = 0; i < this.Records.Count; i++)
            {
                var srecord = this.Records[i];
                if (Invalid(srecord))
                {
                    continue;
                }
                int sr_hash = ListUtil.GetHashCode(srecord, self_join_indexes);
                List<int> recs;
                if (!hash_self_indexes.TryGetValue(sr_hash, out recs))
                {
                    recs = new List<int>() { i };
                    hash_self_indexes[sr_hash] = recs;
                }
                else
                {
                    recs.Add(i);
                }
            }

            // Parallel:
            //foreach (var orecord in other.Records)
            Parallel.ForEach(other.Records, orecord =>
            {
                if (Invalid(orecord))
                {
                    //continue;
                    return;
                }
                int or_hash = ListUtil.GetHashCode(orecord, other_join_indexes);
                List<int> sr_indexes;
                if (!hash_self_indexes.TryGetValue(or_hash, out sr_indexes))
                {
                    //continue;
                    return;
                }
                else
                {
                    foreach (var sr_index in sr_indexes)
                    {
                        var srecord = this.Records[sr_index];
                        if (PartialEquals(srecord, self_join_indexes, orecord, other_join_indexes))
                        {
                            lock (join_binding)
                            {
                                join_binding.Records.Add(MergeRecord(srecord, orecord, signed_indexes));
                            }
                        }
                    }
                }
            });

            return join_binding;
        }

        private bool PartialEquals(long[] array1, List<int> indexes1, long[] array2, List<int> indexes2)
        {
            int cnt = indexes1.Count;
            if (cnt != indexes2.Count)
            {
                return false;
            }
            for (int i = 0; i < cnt; i++)
            {
                if (array1[indexes1[i]] != array2[indexes2[i]])
                {
                    return false;
                }
            }
            return true;
        }

        private long[] MergeRecord(long[] srecord, long[] orecord, int[] signed_indexes)
        {
            long[] result = new long[signed_indexes.Length];
            for (int i = 0; i < signed_indexes.Length; i++)
            {
                int index = signed_indexes[i];
                if (index >= 0)
                {
                    result[i] = srecord[index];
                }
                else
                {
                    result[i] = orecord[-index - 1];
                }
            }
            return result;
        }

        private void ThrowIfNoCol(params string[] col_names)
        {
            foreach (var col_name in col_names)
            {
                ThrowUtil.ThrowIf(!ContainCol(col_name), "Column not found: " + col_name);
            }
        }

        public void Filter(Func<long[], bool> func)
        {
            for (int i = 0; i < this.Records.Count; i++)
            {
                var record = this.Records[i];
                if (!Invalid(record) && !func(record))
                {
                    this.Records[i] = null;
                }
            }
            //this.Records = this.Records.Where(r => func(r)).ToList();
        }

        public void Filter(string col, Func<long, bool> func)
        {
            ThrowIfNoCol(col);
            int index = this.GetHeadDict()[col];
            for (int i = 0; i < this.Records.Count; i++)
            {
                var record = this.Records[i];
                if (!Invalid(record) && !func(record[index]))
                {
                    this.Records[i] = null;
                }
            }
            //this.Records = this.Records.Where(r => func(r[index])).ToList();
        }

        public void Filter(string col1, string col2, Func<long, long, bool> func)
        {
            ThrowIfNoCol(col1, col2);

            int index1 = this.GetHeadDict()[col1];
            int index2 = this.GetHeadDict()[col2];
            for (int i = 0; i < this.Records.Count; i++)
            {
                var record = this.Records[i];
                if (!Invalid(record) && !func(record[index1], record[index2]))
                {
                    this.Records[i] = null;
                }
            }

            //this.Records = this.Records.Where(r => func(r[index1], r[index2])).ToList();
        }

        public void Filter(string col1, string col2, string col3, Func<long, long, long, bool> func)
        {
            ThrowIfNoCol(col1, col2, col3);

            int index1 = this.GetHeadDict()[col1];
            int index2 = this.GetHeadDict()[col2];
            int index3 = this.GetHeadDict()[col3];
            for (int i = 0; i < this.Records.Count; i++)
            {
                var record = this.Records[i];
                if (!Invalid(record) && !func(record[index1], record[index2], record[index3]))
                {
                    this.Records[i] = null;
                }
            }

            //this.Records = this.Records.Where(r => func(r[index1], r[index2], r[index3])).ToList();
        }

        public QuerySolutions Expand(Func<List<string>, List<string>> head_op, Func<long[], List<long[]>> expand_op)
        {
            QuerySolutions tb = new QuerySolutions();
            tb.Heads = head_op(this.Heads);
            tb.RefreshDict();
            foreach (var record in this.Records)
            {
                if (Invalid(record))
                {
                    continue;
                }
                tb.AppendRecords(expand_op(record));
            }
            return tb;
        }

        public QuerySolutions Expand(string col, string expand_col, Func<long, List<long>> expand_op)
        {
            ThrowIfNoCol(col);

            int op_index = this.GetHeadDict()[col];
            QuerySolutions tb = new QuerySolutions();
            tb.Heads = new List<string>(this.Heads);
            tb.Heads.Add(expand_col);
            tb.RefreshDict();

            int nlen = tb.Heads.Count;
            foreach (var record in this.Records)
            {
                if (Invalid(record))
                {
                    continue;
                }
                long element = record[op_index];
                List<long> expansion = expand_op(element);

                tb.AppendRecords(expansion.Select(item =>
                {
                    long[] nr = new long[nlen];
                    Array.Copy(record, nr, record.Length);
                    nr[nlen - 1] = item;
                    return nr;
                }));
            }
            return tb;
        }

        public void Product(QuerySolutions other)
        {
            if (this.Heads.Count == 0)
            {
                this.Heads = new List<string>(other.Heads);
                this.Records = new List<long[]>(other.Records);
            }
            else
            {
                int tr_len = this.Heads.Count;
                int or_len = other.Heads.Count;

                this.Heads.AddRange(other.Heads);
                List<long[]> nrs = new List<long[]>();

                foreach (var tr in this.Records)
                {
                    if (Invalid(tr))
                    {
                        continue;
                    }
                    foreach (var or in other.Records)
                    {
                        if (Invalid(or))
                        {
                            continue;
                        }
                        long[] nr = new long[tr_len + or_len];
                        Array.Copy(tr, nr, tr_len);
                        Array.Copy(or, 0, nr, tr_len, or_len);
                        nrs.Add(nr);
                    }
                }
                this.Records = nrs;
            }

            RefreshDict();
        }

        public void Product(string col, IEnumerable<long> values)
        {
            if (this.Heads.Count == 0)
            {
                this.Heads = new List<string>() { col };
                this.Records = new List<long[]>(values.Select(v => new long[] { v }));
            }
            else
            {
                this.Heads.Add(col);
                List<long[]> nrs = new List<long[]>();

                int nlen = this.Heads.Count;

                foreach (var tr in this.Records)
                {
                    if (Invalid(tr))
                    {
                        continue;
                    }

                    nrs.AddRange(values.Select(item =>
                    {
                        long[] nr = new long[nlen];
                        Array.Copy(tr, nr, tr.Length);
                        nr[nlen - 1] = item;
                        return nr;
                    }));
                }
                this.Records = nrs;
            }

            RefreshDict();
        }

        private void RefreshDict()
        {
            this.dict = new Dictionary<string, int>();
            for (int i = 0; i < Heads.Count; i++)
            {
                dict.Add(Heads[i], i);
            }
        }

        private Dictionary<string, int> dict = null;

        private Dictionary<string, int> GetHeadDict()
        {
            if (this.dict == null)
            {
                this.dict = new Dictionary<string, int>();
                for (int i = 0; i < Heads.Count; i++)
                {
                    dict.Add(Heads[i], i);
                }
            }
            return this.dict;
        }

        public bool ContainCol(string col_name)
        {
            return GetHeadDict().ContainsKey(col_name);
        }

        public QuerySolutions Select(params string[] col_names)
        {
            ThrowIfNoCol(col_names);

            List<int> select_cols = new List<int>(col_names.Select(c => GetHeadDict()[c]));
            QuerySolutions binding = new QuerySolutions();
            binding.Heads = new List<string>(col_names);

            int len = select_cols.Count;
            foreach (var record in this.Records)
            {
                if (Invalid(record))
                {
                    continue;
                }
                long[] select_record = new long[len];

                for (int i = 0; i < len; i++)
                {
                    select_record[i] = record[select_cols[i]];
                }

                binding.AppendRecord(select_record);
            }
            return binding;
        }

        public HashSet<long> DistinctValues(string col)
        {
            ThrowIfNoCol(col);

            int index = GetHeadDict()[col];
            return new HashSet<long>(this.Records.Where(r => !Invalid(r)).Select(r => r[index]));
        }

        public Dictionary<string, HashSet<long>> DistinctValues()
        {
            Dictionary<string, HashSet<long>> distincts = new Dictionary<string, HashSet<long>>();
            foreach (var col in this.Heads)
            {
                distincts.Add(col, new HashSet<long>());
            }
            foreach (var record in this.Records)
            {
                if (Invalid(record))
                {
                    continue;
                }
                for (int i = 0; i < this.Heads.Count; i++)
                {
                    distincts[this.Heads[i]].Add(record[i]);
                }
            }
            return distincts;
        }

        public void Shrink()
        {
            this.Records = this.Records.Where(r => !Invalid(r)).ToList();
        }

        public string Brief()
        {
            StringBuilder builder = new StringBuilder();
            builder.AppendLine("Heads: " + string.Join(", ", this.Heads));
            builder.AppendLine("#Records: " + this.Records.Count);
            return builder.ToString();
        }

        public string Detail()
        {
            return this.ToString();
        }

        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();
            builder.AppendLine(string.Join(", ", this.Heads));
            foreach (var record in this.Records)
            {
                if (Invalid(record))
                {
                    continue;
                }
                builder.AppendLine(string.Join(", ", record));
            }
            return builder.ToString();
        }
    }
}