text:
"""
Imitate the parser representation.
"""
import inspect
import re
import sys
import os
from functools import partial

from jedi._compatibility import builtins as _builtins, unicode
from jedi import debug
from jedi.cache import underscore_memoization, memoize_method
from jedi.evaluate.sys_path import get_sys_path
from jedi.parser.tree import Param, Base, Operator, zero_position_modifier
from jedi.evaluate.helpers import FakeName
from . import fake

_sep = os.path.sep
if os.path.altsep is not None:
    _sep += os.path.altsep
_path_re = re.compile('(?:\.[^{0}]+|[{0}]__init__\.py)$'.format(re.escape(_sep)))
del _sep

class CheckAttribute(object):
    """Raises an AttributeError if the attribute X isn't available."""
    def __init__(self, func):
        self.func = func
        # Remove the py in front of e.g. py__call__.
        self.check_name = func.__name__[2:]

    def __get__(self, instance, owner):
        # This might raise an AttributeError. That's wanted.
        getattr(instance.obj, self.check_name)
        return partial(self.func, instance)

class CompiledObject(Base):
    # comply with the parser
    start_pos = 0, 0
    path = None  # modules have this attribute - set it to None.
    used_names = {}  # To be consistent with modules.

    def __init__(self, obj, parent=None):
        self.obj = obj
        self.parent = parent

    @property
    def py__call__(self):
        def actual(evaluator, params):
            if inspect.isclass(self.obj):
                from jedi.evaluate.representation import Instance
                return [Instance(evaluator, self, params)]
            else:
                return list(self._execute_function(evaluator, params))

        # Might raise an AttributeError, which is intentional.
        self.obj.__call__
        return actual

    @CheckAttribute
    def py__class__(self, evaluator):
        return CompiledObject(self.obj.__class__, parent=self.parent)

    @CheckAttribute
    def py__mro__(self, evaluator):
        return tuple(create(evaluator, cls, self.parent) for cls in self.obj.__mro__)

    @CheckAttribute
    def py__bases__(self, evaluator):
        return tuple(create(evaluator, cls) for cls in self.obj.__bases__)

    def py__bool__(self):
        return bool(self.obj)

    def py__file__(self):
        return self.obj.__file__

    def is_class(self):
        return inspect.isclass(self.obj)

    @property
    def doc(self):
        return inspect.getdoc(self.obj) or ''

    @property
    def params(self):
        params_str, ret = self._parse_function_doc()
        tokens = params_str.split(',')
        if inspect.ismethoddescriptor(self._cls().obj):
            tokens.insert(0, 'self')
        params = []
        for p in tokens:
            parts = [FakeName(part) for part in p.strip().split('=')]
            if len(parts) > 1:
                parts.insert(1, Operator(zero_position_modifier, '=', (0, 0)))
            params.append(Param(parts, self))
        return params

    def __repr__(self):
        return '<%s: %s>' % (type(self).__name__, repr(self.obj))

    @underscore_memoization
    def _parse_function_doc(self):
        if self.doc is None:
            return '', ''

        return _parse_function_doc(self.doc)

    def api_type(self):
        if fake.is_class_instance(self.obj):
            return 'instance'

        cls = self._cls().obj
        if inspect.isclass(cls):
            return 'class'
        elif inspect.ismodule(cls):
            return 'module'
        elif inspect.isbuiltin(cls) or inspect.ismethod(cls) \
                or inspect.ismethoddescriptor(cls):
            return 'function'

    @property
    def type(self):
        """Imitate the tree.Node.type values."""
        cls = self._cls().obj
        if inspect.isclass(cls):
            return 'classdef'
        elif inspect.ismodule(cls):
            return 'file_input'
        elif inspect.isbuiltin(cls) or inspect.ismethod(cls) \
                or inspect.ismethoddescriptor(cls):
            return 'funcdef'

    @underscore_memoization
    def _cls(self):
        # Ensures that a CompiledObject is returned that is not an instance (like list)
        if fake.is_class_instance(self.obj):
            try:
                c = self.obj.__class__
            except AttributeError:
                # happens with numpy.core.umath._UFUNC_API (you get it
                # automatically by doing `import numpy`.
                c = type(None)
            return CompiledObject(c, self.parent)
        return self

    @property
    def names_dict(self):
        # For compatibility with `representation.Class`.
        return self.names_dicts(False)[0]

    def names_dicts(self, search_global, is_instance=False):
        return self._names_dict_ensure_one_dict(is_instance)

    @memoize_method
    def _names_dict_ensure_one_dict(self, is_instance):
        """
        search_global shouldn't change the fact that there's one dict, this way
        there's only one `object`.
        """
        return [LazyNamesDict(self._cls(), is_instance)]

    def get_subscope_by_name(self, name):
        if name in dir(self._cls().obj):
            return CompiledName(self._cls(), name).parent
        else:
            raise KeyError("CompiledObject doesn't have an attribute '%s'." % name)

    def get_index_types(self, evaluator, index_array=()):
        # If the object doesn't have `__getitem__`, just raise the
        # AttributeError.
        if not hasattr(self.obj, '__getitem__'):
            debug.warning('Tried to call __getitem__ on non-iterable.')
            return []
        if type(self.obj) not in (str, list, tuple, unicode, bytes, bytearray, dict):
            # Get rid of side effects, we won't call custom `__getitem__`s.
            return []

        result = []
        from jedi.evaluate.iterable import create_indexes_or_slices
        for typ in create_indexes_or_slices(evaluator, index_array):
            index = None
            try:
                index = typ.obj
                new = self.obj[index]
            except (KeyError, IndexError, TypeError, AttributeError):
                # Just try, we don't care if it fails, except for slices.
                if isinstance(index, slice):
                    result.append(self)
            else:
                result.append(CompiledObject(new))
        if not result:
            try:
                for obj in self.obj:
                    result.append(CompiledObject(obj))
            except TypeError:
                pass  # self.obj maynot have an __iter__ method.
        return result

    @property
    def name(self):
        # might not exist sometimes (raises AttributeError)
        return FakeName(self._cls().obj.__name__, self)

    def _execute_function(self, evaluator, params):
        if self.type != 'funcdef':
            return

        for name in self._parse_function_doc()[1].split():
            try:
                bltn_obj = _create_from_name(builtin, builtin, name)
            except AttributeError:
                continue
            else:
                if isinstance(bltn_obj, CompiledObject) and bltn_obj.obj is None:
                    # We want everything except None.
                    continue
                for result in evaluator.execute(bltn_obj, params):
                    yield result

    @property
    @underscore_memoization
    def subscopes(self):
        """
        Returns only the faked scopes - the other ones are not important for
        internal analysis.
        """
        module = self.get_parent_until()
        faked_subscopes = []
        for name in dir(self._cls().obj):
            f = fake.get_faked(module.obj, self.obj, name)
            if f:
                f.parent = self
                faked_subscopes.append(f)
        return faked_subscopes

    def is_scope(self):
        return True

    def get_self_attributes(self):
        return []  # Instance compatibility

    def get_imports(self):
        return []  # Builtins don't have imports

class LazyNamesDict(object):
    """
    A names_dict instance for compiled objects, resembles the parser.tree.
    """
    def __init__(self, compiled_obj, is_instance):
        self._compiled_obj = compiled_obj
        self._is_instance = is_instance

    def __iter__(self):
        return (v[0].value for v in self.values())

    @memoize_method
    def __getitem__(self, name):
        try:
            getattr(self._compiled_obj.obj, name)
        except AttributeError:
            raise KeyError('%s in %s not found.' % (name, self._compiled_obj))
        return [CompiledName(self._compiled_obj, name)]

    def values(self):
        obj = self._compiled_obj.obj

        values = []
        for name in dir(obj):
            try:
                values.append(self[name])
            except KeyError:
                # The dir function can be wrong.
                pass

        # dir doesn't include the type names.
        if not inspect.ismodule(obj) and obj != type and not self._is_instance:
            values += _type_names_dict.values()
        return values

class CompiledName(FakeName):
    def __init__(self, obj, name):
        super(CompiledName, self).__init__(name)
        self._obj = obj
        self.name = name

    def __repr__(self):
        try:
            name = self._obj.name  # __name__ is not defined all the time
        except AttributeError:
            name = None
        return '<%s: (%s).%s>' % (type(self).__name__, name, self.name)

    def is_definition(self):
        return True

    @property
    @underscore_memoization
    def parent(self):
        module = self._obj.get_parent_until()
        return _create_from_name(module, self._obj, self.name)

    @parent.setter
    def parent(self, value):
        pass  # Just ignore this, FakeName tries to overwrite the parent attribute.

def dotted_from_fs_path(fs_path, sys_path=None):
    """
    Changes `/usr/lib/python3.4/email/utils.py` to `email.utils`.  I.e.
    compares the path with sys.path and then returns the dotted_path. If the
    path is not in the sys.path, just returns None.
    """
    if sys_path is None:
        sys_path = get_sys_path()

    if os.path.basename(fs_path).startswith('__init__.'):
        # We are calculating the path. __init__ files are not interesting.
        fs_path = os.path.dirname(fs_path)

    # prefer
    #   - UNIX
    #     /path/to/pythonX.Y/lib-dynload
    #     /path/to/pythonX.Y/site-packages
    #   - Windows
    #     C:\path\to\DLLs
    #     C:\path\to\Lib\site-packages
    # over
    #   - UNIX
    #     /path/to/pythonX.Y
    #   - Windows
    #     C:\path\to\Lib
    path = ''
    for s in sys_path:
        if (fs_path.startswith(s) and len(path) < len(s)):
            path = s
    return _path_re.sub('', fs_path[len(path):].lstrip(os.path.sep)).replace(os.path.sep, '.')

def load_module(path=None, name=None):
    if path is not None:
        dotted_path = dotted_from_fs_path(path)
    else:
        dotted_path = name

    sys_path = get_sys_path()
    if dotted_path is None:
        p, _, dotted_path = path.partition(os.path.sep)
        sys_path.insert(0, p)

    temp, sys.path = sys.path, sys_path
    try:
        __import__(dotted_path)
    except RuntimeError:
        if 'PySide' in dotted_path or 'PyQt' in dotted_path:
            # RuntimeError: the PyQt4.QtCore and PyQt5.QtCore modules both wrap
            # the QObject class.
            # See https://github.com/davidhalter/jedi/pull/483
            return None
        raise
    except ImportError:
        # If a module is "corrupt" or not really a Python module or whatever.
        debug.warning('Module %s not importable.', path)
        return None
    finally:
        sys.path = temp

    # Just access the cache after import, because of #59 as well as the very
    # complicated import structure of Python.
    module = sys.modules[dotted_path]

    return CompiledObject(module)

docstr_defaults = {
    'floating point number': 'float',
    'character': 'str',
    'integer': 'int',
    'dictionary': 'dict',
    'string': 'str',
}

def _parse_function_doc(doc):
    """
    Takes a function and returns the params and return value as a tuple.
    This is nothing more than a docstring parser.

    TODO docstrings like utime(path, (atime, mtime)) and a(b [, b]) -> None
    TODO docstrings like 'tuple of integers'
    """
    # parse round parentheses: def func(a, (b,c))
    try:
        count = 0
        start = doc.index('(')
        for i, s in enumerate(doc[start:]):
            if s == '(':
                count += 1
            elif s == ')':
                count -= 1
            if count == 0:
                end = start + i
                break
        param_str = doc[start + 1:end]
    except (ValueError, UnboundLocalError):
        # ValueError for doc.index
        # UnboundLocalError for undefined end in last line
        debug.dbg('no brackets found - no param')
        end = 0
        param_str = ''
    else:
        # remove square brackets, that show an optional param ( = None)
        def change_options(m):
            args = m.group(1).split(',')
            for i, a in enumerate(args):
                if a and '=' not in a:
                    args[i] += '=None'
            return ','.join(args)

        while True:
            param_str, changes = re.subn(r' ?\[([^\[\]]+)\]',
                                         change_options, param_str)
            if changes == 0:
                break
    param_str = param_str.replace('-', '_')  # see: isinstance.__doc__

    # parse return value
    r = re.search('-[>-]* ', doc[end:end + 7])
    if r is None:
        ret = ''
    else:
        index = end + r.end()
        # get result type, which can contain newlines
        pattern = re.compile(r'(,\n|[^\n-])+')
        ret_str = pattern.match(doc, index).group(0).strip()
        # New object -> object()
        ret_str = re.sub(r'[nN]ew (.*)', r'\1()', ret_str)

        ret = docstr_defaults.get(ret_str, ret_str)

    return param_str, ret

class Builtin(CompiledObject):
    @memoize_method
    def get_by_name(self, name):
        return self.names_dict[name][0].parent

def _a_generator(foo):
    """Used to have an object to return for generators."""
    yield 42
    yield foo

def _create_from_name(module, parent, name):
    faked = fake.get_faked(module.obj, parent.obj, name)
    # only functions are necessary.
    if faked is not None:
        faked.parent = parent
        return faked

    try:
        obj = getattr(parent.obj, name)
    except AttributeError:
        # happens e.g. in properties of
        # PyQt4.QtGui.QStyleOptionComboBox.currentText
        # -> just set it to None
        obj = None
    return CompiledObject(obj, parent)

builtin = Builtin(_builtins)
magic_function_class = CompiledObject(type(load_module), parent=builtin)
generator_obj = CompiledObject(_a_generator(1.0))
_type_names_dict = builtin.get_by_name('type').names_dict
none_obj = builtin.get_by_name('None')
false_obj = builtin.get_by_name('False')
true_obj = builtin.get_by_name('True')
object_obj = builtin.get_by_name('object')

def keyword_from_value(obj):
    if obj is None:
        return none_obj
    elif obj is False:
        return false_obj
    elif obj is True:
        return true_obj
    else:
        raise NotImplementedError

def compiled_objects_cache(func):
    def wrapper(evaluator, obj, parent=builtin, module=None):
        # Do a very cheap form of caching here.
        key = id(obj), id(parent), id(module)
        try:
            return evaluator.compiled_cache[key][0]
        except KeyError:
            result = func(evaluator, obj, parent, module)
            # Need to cache all of them, otherwise the id could be overwritten.
            evaluator.compiled_cache[key] = result, obj, parent, module
            return result
    return wrapper

@compiled_objects_cache
def create(evaluator, obj, parent=builtin, module=None):
    """
    A very weird interface class to this module. The more options provided the
    more acurate loading compiled objects is.
    """

    if not inspect.ismodule(obj):
        faked = fake.get_faked(module and module.obj, obj)
        if faked is not None:
            faked.parent = parent
            return faked

    try:
        if parent == builtin and obj.__module__ in ('builtins', '__builtin__'):
            return builtin.get_by_name(obj.__name__)
    except AttributeError:
        pass

    return CompiledObject(obj, parent)


text:
import React from 'react';
import withStyles from 'isomorphic-style-loader/lib/withStyles';
import s from './Instagram.css';
import Link from '../Link';
import Photo from '../Photo';
import WhiteButton from '../WhiteButton';

const instaimage = "https://ucarecdn.com/16944521-198c-4205-9aee-cc61c99a7133/instaimage.png";

class Instagram extends React.Component {

  render() {
    return (

Краще один раз подивитись

Фото проектів з нашого Instagram

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

              <Link to="/">
                <Photo source={instaimage} altText="blablabla" />
              </Link>

#onyx #m-selection

            <Link className={s.link} to="/catalog">
              <WhiteButton>Всі проекти</WhiteButton>
            </Link>

    );
  }
}

export default withStyles(s)(Instagram);

redpajama_set_name: RedPajamaGithub


text:
describe('Shopify#apiPermission', () => {
  'use strict';

  const expect = require('chai').expect;

  const common = require('./common');

  const shopify = common.shopify;
  const scope = common.scope;

  afterEach(() => expect(scope.pendingMocks()).to.deep.equal([]));

  it('deletes an api permission', () => {
    scope.delete('/admin/api_permissions/current.json').reply(200);

    return shopify.apiPermission
      .delete()
      .then((data) => expect(data).to.deep.equal({}));
  });
});


text:
using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using Microsoft.Extensions.Configuration;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Diagnostics;

namespace Geco.Tests.Database.Model
{
    [GeneratedCode("Geco", "1.0.5.0")]
    public partial class TransactionHistoryArchive
    {
        // Key Properties
        public int TransactionID { get; set; }

        // Scalar Properties
        public int ProductID { get; set; }
        public int ReferenceOrderID { get; set; }
        public int ReferenceOrderLineID { get; set; }
        public DateTime TransactionDate { get; set; }
        public string TransactionType { get; set; }
        public int Quantity { get; set; }
        public decimal ActualCost { get; set; }
        public DateTime ModifiedDate { get; set; }

    }
}


text:
@interface RightSidebarViewController : UIViewController

@end


text:
use clap;
use ctrlc;
use notify;
use shell_grunt2;
use time;

use notify::Watcher;
use shell_grunt2::lockfile;
use shell_grunt2::task::{Runnable, RunningTask, Task};
use std::path::{Path, PathBuf};
use std::process;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::mpsc;
use std::sync::Arc;
use std::thread;
use std::time::Duration;

fn update() -> Result<(), Box<dyn (::std::error::Error)>> {
    let target = self_update::get_target();
    self_update::backends::github::Update::configure()
        .repo_owner("SirVer")
        .repo_name("shell_grunt2")
        .target(&target)
        .bin_name("shell_grunt2")
        .show_download_progress(true)
        .show_output(false)
        .no_confirm(true)
        .current_version(self_update::cargo_crate_version!())
        .build()?
        .update()?;
    Ok(())
}

struct ReloadWatcherFile {
    file_name: PathBuf,
    should_reload: Arc<AtomicBool>,
}

struct RunningReloadWatcherFile;

impl RunningTask for RunningReloadWatcherFile {
    fn done(&mut self) -> bool {
        true
    }
    fn wait(self: Box<Self>) {}
    fn interrupt(self: Box<Self>) {}
}

impl Runnable for ReloadWatcherFile {
    fn run(&self) -> Box<dyn RunningTask> {
        self.should_reload.store(true, Ordering::SeqCst);
        Box::new(RunningReloadWatcherFile {})
    }
}

impl Task for ReloadWatcherFile {
    fn should_run(&self, path: &Path) -> bool {
        path == self.file_name
    }

    fn start_delay(&self) -> time::Duration {
        time::Duration::milliseconds(0)
    }
}

fn watch_file_events(watcher_file: impl AsRef<Path>) {
    let saw_interrupt_signal = Arc::new(AtomicBool::new(false));
    let r = saw_interrupt_signal.clone();
    ctrlc::set_handler(move || {
        r.store(true, Ordering::SeqCst);
    })
    .expect("Error setting Ctrl-C handler");

    let current_dir = std::fs::canonicalize(".").unwrap();
    let watcher_file = std::fs::canonicalize(watcher_file.as_ref()).unwrap();
    loop {
        let diff = pathdiff::diff_paths(&watcher_file, &current_dir);
        let disp = match &diff {
            Some(diff) => diff,
            None => &watcher_file,
        };
        println!("Watching file system with tasks from {}", disp.display());

        // Ideally, the RecommendedWatcher would be owned by ShellGrunt2, but whenever I try that,
        // the tool crashes whenever it should receive an event on the channel. So it needs to stay
        // outside. :(
        let (events_tx, events_rx) = mpsc::channel();
        let mut watcher = notify::watcher(events_tx, Duration::from_millis(50)).unwrap();
        watcher
            .watch(&current_dir, notify::RecursiveMode::Recursive)
            .unwrap();
        watcher
            .watch(&watcher_file, notify::RecursiveMode::Recursive)
            .unwrap();

        let should_reload = Arc::new(AtomicBool::new(false));
        let mut tasks: Vec<Box<dyn Task>> = vec![Box::new(ReloadWatcherFile {
            file_name: watcher_file.clone(),
            should_reload: should_reload.clone(),
        })];
        for task in shell_grunt2::lua_task::run_file(&watcher_file) {
            tasks.push(task);
        }
        let mut shell_grunt2 = shell_grunt2::ShellGrunt2::new(&tasks, events_rx);

        loop {
            thread::sleep(std::time::Duration::from_millis(50));
            if saw_interrupt_signal.load(Ordering::SeqCst) {
                return;
            }
            if should_reload.load(Ordering::SeqCst) {
                break;
            }
            shell_grunt2.spin();
        }
    }
}

fn main() {
    let matches = clap::App::new("shell_grunt2")
        .version(self_update::cargo_crate_version!())
        .about("Watches the file system and executes commands from a Lua file.")
        .arg(
            clap::Arg::with_name("file")
                .short("f")
                .takes_value(true)
                .help("Lua file to use [watcher.lua]"),
        )
        .arg(
            clap::Arg::with_name("update")
                .long("update")
                .help("Update binary in-place from latest release"),
        )
        .get_matches();

    if matches.is_present("update") {
        update().unwrap();
        return;
    }

    let watcher_file = matches.value_of("file").unwrap_or("watcher.lua");

    let _lockfile = match lockfile::Lockfile::new(watcher_file) {
        Ok(lockfile) => lockfile,
        Err(lockfile::AlreadyExists(path)) => {
            println!(
                "Another shell grunt is already running for {}. \
                 Delete\n\n    {}\n\nif you sure this is untrue. Exiting.",
                watcher_file,
                path.to_string_lossy()
            );
            process::exit(1);
        }
    };

    watch_file_events(watcher_file);
}


text:
<?php

namespace NilPortugues\SchemaOrg\Classes;

use NilPortugues\SchemaOrg\SchemaClass;

/**
 * METHODSTART.
 *
 * @method static \NilPortugues\SchemaOrg\Properties\OpeningHoursProperty openingHours()
 * @method static \NilPortugues\SchemaOrg\Properties\AddressProperty address()
 * @method static \NilPortugues\SchemaOrg\Properties\AggregateRatingProperty aggregateRating()
 * @method static \NilPortugues\SchemaOrg\Properties\BranchCodeProperty branchCode()
 * @method static \NilPortugues\SchemaOrg\Properties\ContainedInPlaceProperty containedInPlace()
 * @method static \NilPortugues\SchemaOrg\Properties\ContainsPlaceProperty containsPlace()
 * @method static \NilPortugues\SchemaOrg\Properties\ContainedInProperty containedIn()
 * @method static \NilPortugues\SchemaOrg\Properties\EventProperty event()
 * @method static \NilPortugues\SchemaOrg\Properties\EventsProperty events()
 * @method static \NilPortugues\SchemaOrg\Properties\FaxNumberProperty faxNumber()
 * @method static \NilPortugues\SchemaOrg\Properties\GeoProperty geo()
 * @method static \NilPortugues\SchemaOrg\Properties\GlobalLocationNumberProperty globalLocationNumber()
 * @method static \NilPortugues\SchemaOrg\Properties\IsicV4Property isicV4()
 * @method static \NilPortugues\SchemaOrg\Properties\LogoProperty logo()
 * @method static \NilPortugues\SchemaOrg\Properties\HasMapProperty hasMap()
 * @method static \NilPortugues\SchemaOrg\Properties\MapProperty map()
 * @method static \NilPortugues\SchemaOrg\Properties\MapsProperty maps()
 * @method static \NilPortugues\SchemaOrg\Properties\OpeningHoursSpecificationProperty openingHoursSpecification()
 * @method static \NilPortugues\SchemaOrg\Properties\PhotoProperty photo()
 * @method static \NilPortugues\SchemaOrg\Properties\PhotosProperty photos()
 * @method static \NilPortugues\SchemaOrg\Properties\ReviewProperty review()
 * @method static \NilPortugues\SchemaOrg\Properties\ReviewsProperty reviews()
 * @method static \NilPortugues\SchemaOrg\Properties\TelephoneProperty telephone()
 * @method static \NilPortugues\SchemaOrg\Properties\AdditionalPropertyProperty additionalProperty()
 * @method static \NilPortugues\SchemaOrg\Properties\AdditionalTypeProperty additionalType()
 * @method static \NilPortugues\SchemaOrg\Properties\AlternateNameProperty alternateName()
 * @method static \NilPortugues\SchemaOrg\Properties\DescriptionProperty description()
 * @method static \NilPortugues\SchemaOrg\Properties\ImageProperty image()
 * @method static \NilPortugues\SchemaOrg\Properties\MainEntityOfPageProperty mainEntityOfPage()
 * @method static \NilPortugues\SchemaOrg\Properties\NameProperty name()
 * @method static \NilPortugues\SchemaOrg\Properties\SameAsProperty sameAs()
 * @method static \NilPortugues\SchemaOrg\Properties\UrlProperty url()
 * @method static \NilPortugues\SchemaOrg\Properties\PotentialActionProperty potentialAction()
 * METHODEND.
 *
 * A theater or other performing art center.
 */
class PerformingArtsTheater extends SchemaClass
{
    /**
     * @var string
     */
    protected static $schemaUrl = 'http://schema.org/PerformingArtsTheater';

    /**
     * @var array
     */
    protected static $supportedMethods = [
        'additionalProperty' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\AdditionalPropertyProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'additionalType' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\AdditionalTypeProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'address' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\AddressProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'aggregateRating' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\AggregateRatingProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'alternateName' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\AlternateNameProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'branchCode' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\BranchCodeProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'containedIn' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ContainedInProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'containedInPlace' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ContainedInPlaceProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'containsPlace' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ContainsPlaceProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'description' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\DescriptionProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'event' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\EventProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'events' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\EventsProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'faxNumber' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\FaxNumberProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'geo' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\GeoProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'globalLocationNumber' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\GlobalLocationNumberProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'hasMap' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\HasMapProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'image' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ImageProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'isicV4' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\IsicV4Property',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'logo' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\LogoProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'mainEntityOfPage' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\MainEntityOfPageProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'map' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\MapProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'maps' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\MapsProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'name' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\NameProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'openingHours' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\OpeningHoursProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\CivicStructure',
        ],
        'openingHoursSpecification' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\OpeningHoursSpecificationProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'photo' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\PhotoProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'photos' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\PhotosProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'potentialAction' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\PotentialActionProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'review' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ReviewProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'reviews' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\ReviewsProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'sameAs' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\SameAsProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
        'telephone' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\TelephoneProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Place',
        ],
        'url' => [
            'propertyClass' => '\NilPortugues\SchemaOrg\Properties\UrlProperty',
            'schemaClass' => '\NilPortugues\SchemaOrg\Classes\Thing',
        ],
    ];
}


text:
// Copyright 1997-2009 Omni Development, Inc.  All rights reserved.
//
// This software may only be used and reproduced according to the
// terms in the file OmniSourceLicense.html, which should be
// distributed with this project and can also be found at
// <http://www.omnigroup.com/developer/sourcecode/sourcelicense/>.
//
// $Id$

#import <Foundation/NSString.h>
#import <Foundation/NSBundle.h>

#import <OmniBase/assertions.h>
#import <OmniBase/objc.h>

#if defined(__cplusplus)
extern "C" {
#endif

#if defined(__GNUC__)
#define NORETURN __attribute__ ((noreturn))
#else
#define NORETURN
#endif

/* The LLVM clang scan-build support has some attributes for declaring exceptions to the normal CF/Cocoa rules.  These are only valid for clang, not GCC. */
#if defined(__clang__)
    #define CLANG_RETURNS_NS_RETAINED __attribute__((ns_returns_retained))
    #define CLANG_RETURNS_CF_RETAINED __attribute__((cf_returns_retained))
#else
    #define CLANG_RETURNS_NS_RETAINED
    #define CLANG_RETURNS_CF_RETAINED
#endif

/*
 * only certain compilers support __attribute__((deprecated))
 * Apple has a similar definition but it's too inclusive
 */
#if defined(MAC_OS_X_VERSION_10_5) && defined(MAC_OS_X_VERSION_MIN_REQUIRED) && defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1))) && (MAC_OS_X_VERSION_MIN_REQUIRED >= MAC_OS_X_VERSION_10_5)
#define OB_DEPRECATED_ATTRIBUTE __attribute__((deprecated))
#else
#define OB_DEPRECATED_ATTRIBUTE
#endif

// This uses the OMNI_BUNDLE_IDENTIFIER compiler define set by the OmniGroup/Configurations/*Global*.xcconfig to look up the bundle for the calling code.
#define OMNI_BUNDLE _OBBundleWithIdentifier(OMNI_BUNDLE_IDENTIFIER)
static inline NSBundle *_OBBundleWithIdentifier(NSString *identifier)
{
    OBPRECONDITION([identifier length] > 0); // Did you forget to set OMNI_BUNDLE_IDENTIFIER in your target?
    NSBundle *bundle = [NSBundle bundleWithIdentifier:identifier];
    OBPOSTCONDITION(bundle); // Did you set it to the wrong thing?
    return bundle;
}

extern void _OBRequestConcreteImplementation(id self, SEL _cmd, const char *file, unsigned int line) NORETURN;
extern void _OBRejectUnusedImplementation(id self, SEL _cmd, const char *file, unsigned int line) NORETURN;
extern void _OBRejectInvalidCall(id self, SEL _cmd, const char *file, unsigned int line, NSString *format, ...) NORETURN;

#define OBRequestConcreteImplementation(self, sel) _OBRequestConcreteImplementation((self), (sel), __FILE__, __LINE__)
#define OBRejectUnusedImplementation(self, sel) _OBRejectUnusedImplementation((self), (sel), __FILE__, __LINE__)
#define OBRejectInvalidCall(self, sel, format, ...) _OBRejectInvalidCall((self), (sel), __FILE__, __LINE__, (format), ## __VA_ARGS__)

extern NSString * const OBAbstractImplementation;
extern NSString * const OBUnusedImplementation;

void OBRecordBacktrace(uintptr_t ctxt, int optype);
/*.doc.
  Records a backtrace for possible debugging use in the future. ctxt and optype are free for the caller to use for their own purposes, but optype must be nonzero.
*/

#undef NORETURN

extern IMP OBRegisterInstanceMethodWithSelector(Class aClass, SEL oldSelector, SEL newSelector);
/*.doc.
Provides the same functionality as +[NSObject registerInstanceMethod:withMethodTypes:forSelector: but does it without provoking +initialize on the target class.  Returns the original implementation.
*/

extern IMP OBReplaceMethodImplementation(Class aClass, SEL oldSelector, IMP newImp);
/*.doc.
Replaces the given method implementation in place.  Returns the old implementation.
*/

IMP OBReplaceMethodImplementationFromMethod(Class aClass, SEL oldSelector, Method newMethod);
/*.doc.
Replaces the given method implementation in place.  Returns the old implementation.
*/

extern IMP OBReplaceMethodImplementationWithSelector(Class aClass, SEL oldSelector, SEL newSelector);
/*.doc.
Calls the above, but determines newImp by looking up the instance method for newSelector.  Returns the old implementation.
*/

extern IMP OBReplaceMethodImplementationWithSelectorOnClass(Class destClass, SEL oldSelector, Class sourceClass, SEL newSelector);
/*.doc.
Calls OBReplaceMethodImplementation.  Derives newImp from newSelector on sourceClass and changes method implementation for oldSelector on destClass.
*/

extern Class OBClassImplementingMethod(Class cls, SEL sel);

// This returns YES if the given pointer is a class object
static inline BOOL OBPointerIsClass(id object)
{
    if (object) {
        Class cls = object_getClass(object);
        return class_isMetaClass(cls);
    }
    return NO;
}

// This returns the class object for the given pointer.  For an instance, that means getting the class.  But for a class object, that means returning the pointer itself

static inline Class OBClassForPointer(id object)
{
    if (!object)
	return object;

    if (OBPointerIsClass(object))
	return object;
    else
	return object->isa;
}

static inline BOOL OBClassIsSubclassOfClass(Class subClass, Class superClass)
{
    while (subClass) {
        if (subClass == superClass)
            return YES;
        else
            subClass = class_getSuperclass(subClass);
    }
    return NO;
}

extern BOOL OBIsRunningUnitTests(void);

extern NSString *OBShortObjectDescription(id anObject);

extern CFStringRef const OBBuildByCompilerVersion;

// This macro ensures that we call [super initialize] in our +initialize (since this behavior is necessary for some classes in Cocoa), but it keeps custom class initialization from executing more than once.
#define OBINITIALIZE \
    do { \
        static BOOL hasBeenInitialized = NO; \
        [super initialize]; \
        if (hasBeenInitialized) \
            return; \
        hasBeenInitialized = YES;\
    } while (0);

// Sometimes a value is computed but not expected to be used and we wish to avoid clang dead store warnings.  For example, when laying out a stack of views, we might keep a running total of the used height and might want to do this for the last item stacked up (in case something is added later).
#define OB_UNUSED_VALUE(v) do { \
    void *__ptr __attribute__((unused)) = &v; /* ensure it is actually an l-value */ \
    typeof(v) __unused_value __attribute__((unused)) = v; \
} while(0)

#ifdef USING_BUGGY_CPP_PRECOMP
// Versions of cpp-precomp released before April 2002 have a bug that makes us have to do this
#define NSSTRINGIFY(name) @ ## '"' ## name ## '"'
#elif defined(__GNUC__)
    #if __GNUC__ < 3 || (__GNUC__ == 3 && __GNUC_MINOR__ < 3)
        // GCC before 3.3 requires this format
        #define NSSTRINGIFY(name) @ ## #name
    #else
        // GCC 3.3 requires this format
        #define NSSTRINGIFY(name) @#name
    #endif
#endif

// An easy way to define string constants.  For example, "NSSTRINGIFY(foo)" produces @"foo" and "DEFINE_NSSTRING(foo);" produces: NSString *foo = @"foo";

#define DEFINE_NSSTRING(name) \
	NSString * const name = NSSTRINGIFY(name)

// Emits a warning indicating that an obsolete method has been called.

#define OB_WARN_OBSOLETE_METHOD \
    do { \
        static BOOL warned = NO; \
            if (!warned) { \
                warned = YES; \
                    NSLog(@"Warning: obsolete method %c[%@ %s] invoked", OBPointerIsClass(self)?'+':'-', OBClassForPointer(self), _cmd); \
            } \
            OBASSERT_NOT_REACHED("obsolete method called"); \
    } while(0)

// Apple doesn't have an NSNotFound equivalent for NSUInteger values (NSNotFound is an NSInteger).
// Note that for APIs which should match Foundation APIs, you'll need to use NSNotFound even for NSUInteger values.
#define OB_NSUInteger_NotFound (~(NSUInteger)0)

#if NSGEOMETRY_TYPES_SAME_AS_CGGEOMETRY_TYPES
// Returns a copy of the method signature with the NSGeometry types replaced with CG types.  The result should be free'd by the caller.
__private_extern__ const char *_OBGeometryAdjustedSignature(const char *sig);
#endif

#if defined(__cplusplus)
} // extern "C"
#endif


text:
package software.amazon.awssdk.transfer.s3;

import static org.assertj.core.api.Assertions.assertThat;

import nl.jqno.equalsverifier.EqualsVerifier;
import org.junit.jupiter.api.Test;

class CompletedDirectoryUploadTest {

    @Test
    void equalsHashcode() {
        EqualsVerifier.forClass(CompletedDirectoryUpload.class)
                      .withNonnullFields("failedTransfers")
                      .verify();
    }

    @Test
    void defaultBuilder() {
        assertThat(CompletedDirectoryUpload.builder().build().failedTransfers())
            .isEmpty();
    }
}


text:
<?php

namespace CoreBundle\Repository;

use Doctrine\ORM\EntityRepository;

/**
 * TypeDaysRepeatRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class TypeDaysRepeatRepository extends EntityRepository
{
}


text:
#include "test_yaffs_access_EINVAL.h"

int test_yaffs_access_EINVAL(void)
{
	int output=0;
	int error=0;

	output= yaffs_access(FILE_PATH,255);
	if (output<0){
		error=yaffs_get_error();
		if ( abs(error)== EINVAL){
			return 1;
		} else {
			print_message("error does not match expected error\n",2);
			return -1;
		}
	} else{
		print_message("accessed an existing file with bad mode (which is a bad thing\n",2);

		return -1;
	}
}

int test_yaffs_access_EINVAL_clean(void)
{
	return 1;
}


text:
<?php

declare(strict_types=1);

namespace Kerox\Messenger\Tests\TestCase\Api;

use GuzzleHttp\Client;
use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response;
use Kerox\Messenger\Api\User;
use Kerox\Messenger\Exception\MessengerException;
use PHPUnit\Framework\TestCase;

class UserTest extends TestCase
{
    /**
     * @var \Kerox\Messenger\Api\User
     */
    protected $userApi;

    public function setUp(): void
    {
        $bodyResponse = file_get_contents(__DIR__ . '/../../Mocks/Response/User/user.json');
        $mockedResponse = new MockHandler([
            new Response(200, [], $bodyResponse),
        ]);

        $handler = HandlerStack::create($mockedResponse);
        $client = new Client([
            'handler' => $handler,
        ]);

        $this->userApi = new User('abcd1234', $client);
    }

    public function testGetProfile(): void
    {
        $response = $this->userApi->profile('1234abcd');

        self::assertSame('Peter', $response->getFirstName());
        self::assertSame('Chang', $response->getLastName());
        self::assertSame('https://fbcdn-profile-a.akamaihd.net/hprofile-ak-xpf1/v/t1.0-1/p200x200/13055603_10105219398495383_8237637584159975445_n.jpg?oh=1d241d4b6d4dac50eaf9bb73288ea192&oe=57AF5C03&__gda__=1470213755_ab17c8c8e3a0a447fed3f272fa2179ce', $response->getProfilePic());
        self::assertSame('en_US', $response->getLocale());
        self::assertSame(-7., $response->getTimezone());
        self::assertSame('male', $response->getGender());
    }

    public function testGetProfileWithInvalidField(): void
    {
        $this->expectException(MessengerException::class);
        $this->expectExceptionMessage('username is not a valid value. fields must only contain "first_name, last_name, profile_pic, locale, timezone, gender".');
        $this->userApi->profile('1234abcd', ['username']);
    }
}


text:
from setuptools import setup, Extension, Command, find_packages
import sys,os,platform
osname=platform.uname()[0].lower()

VERSION = '0.1.0'
DESCRIPTION = "zBzOCR is specifically designed for usage with zBzQuiz web API which can be used to extract text from images."
LONG_DESCRIPTION = """
zBzOCR is specifically designed for usage with zBzQuiz web API which can be used to extract text from images.

It also comes with a setup.py front-end that
will allow you to easily install it on your system.
"""

CLASSIFIERS = filter(None, map(str.strip,
"""
Intended Audience :: Educational Institute
License :: Apache License version 2.0
Programming Language :: Python
Operating System :: Linux :: MacOS X
Topic :: Education Software
Topic :: Office/Business
""".splitlines()))

setup(
    name="zBzOCR",
    version=VERSION,
    description=DESCRIPTION,
    long_description=LONG_DESCRIPTION,
    classifiers=CLASSIFIERS,
    author="Bhavyanshu Parasher",
    author_email="bhavyanshu@codershangout.org",
    url="https://github.com/bhavyanshu/zBzQuiz",
    license="Apache License, Version 2.0",
    packages = find_packages(),
    platforms=['any'],
    zip_safe=True,
    install_requires = [
        'setuptools',
        'docutils',
	'pillow',
        ],
)


text:
const AbstractController = Jymfony.Bundle.FrameworkBundle.Controller.AbstractController;
const ContainerInterface = Jymfony.Component.DependencyInjection.ContainerInterface;
const Inject = Jymfony.Component.DependencyInjection.Annotation.Inject;

/**
 * @memberOf Jymfony.Bundle.FrameworkBundle.Tests.Fixtures.Controller
 */
export default class ConcreteController extends AbstractController {
    get container() {
        return this._container;
    }

    @Inject(ContainerInterface)
    set container(container) {
        super.container = container;
    }
}


text:
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.usfirst.frc2877.AerialAssist2014Robot.subsystems;

import edu.wpi.first.wpilibj.CANJaguar;
import edu.wpi.first.wpilibj.can.CANTimeoutException;
import org.usfirst.frc2877.AerialAssist2014Robot.Robot;

/**
 *
 * @author Administrator
 *
 * Helper class for managing a CAN-based Jaguar
 *
 *
 */
public class CANJag {
    public CANJaguar m_jag;
    public double m_voltage;
    public double m_current;
    public String m_description;
    public String m_lasterror = null;
    public boolean m_status = false;

    public CANJag(int jagnum, String descr) {
        m_description = descr;
        System.out.print("CAN init " + jagnum + " " + descr);
        try {
            m_jag = new CANJaguar(jagnum);
            System.out.println(" OK");
        } catch (Exception ex) {
            m_lasterror = ex.getMessage();
            System.out.println(" FAILED: " + m_lasterror);
            m_status = false;
        }
        m_status = true;
    }

    public CANJaguar getJag()
    {
        return m_jag;
    }

    public double getVoltage()
    {
        try {
            m_voltage = m_jag.getOutputVoltage();
        } catch  (Exception ex) {
            m_lasterror = ex.getMessage();
            // suppress this printout for Roadkill with broken
            //System.out.println(m_lasterror + " " + m_description);
            m_status = false;
            return 0.0;
        }
        return m_voltage;
    }

    public double getCurrent() {
        try {
            m_current = m_jag.getOutputCurrent();
        } catch  (Exception ex) {
            m_lasterror = ex.getMessage();
            // suppress this printout for Roadkill with broken
            //System.out.println(m_lasterror + " " + m_description);
            m_status = false;
            return 0.0;
        }
        m_status = true;
        return m_current;
    }

    public boolean getStat() {
        return m_status;
    }

    public String getDescr() {
        return m_description;
    }

}


text:
def get_starting_line(logFile,delimeter,skipln):
    raw_log = open(logFile) # open file
    raw_lines = raw_log.read().split('\n') # split file by line
    line_cnt = 0
    for line in raw_lines:
      if delimeter in str(line): # look for delimiter
        line_cnt += skipln # add offset
        break;
      line_cnt += 1
    return raw_lines,line_cnt

# MAIN
#############################

import csv
import datetime
import sys

for logFile in sys.argv[1:]: # iterate through arguments - each of which is a log file

  # read lines from the log file and identify the start of the data that will be
  # copied into the CSV
  log_lines, line_cnt = get_starting_line(logFile,"# Broadband LOG Results",3)

  # prepare CSV writer object
  dest_name = logFile+'.csv' # append '.csv' to create CSV file name
  log_csv = open(dest_name,'wb')
  log_writer = csv.writer(log_csv,dialect='excel')

  for line in log_lines[line_cnt:]: # iterate through lines in the log file
      words = line.split() # split line by whitespace
      if len(words) >= 4: # read until a line is unreadable - the end of the data

          # parse the line day/date and data
          year,month,day = words[0].split('-')
          hours,mins,secs = words[1].split(':')
          data = words[3]

          # convert to numbers
          year = int(year)
          month = int(month)
          day = int(day)
          hours = int(hours)
          mins = int(mins)
          secs = int(secs)
          data = float(data)

          # write row to CSV
          log_writer.writerow([year,month,day,hours,mins,secs,data])

      else:
          break # break when line is unreadable

  print "Decibel readings CSV File created with filename '%s'"%dest_name


text:
from django.contrib import admin
from django.contrib.auth.admin import UserAdmin
from django.contrib.auth.models import User
from traceability.models.employee import Employee

class EmployeeInline(admin.StackedInline):
    model = Employee
    can_delete = False

class UserAdmin(UserAdmin):
    inlines = (EmployeeInline, )


text:
NewtonImageResize
=================

AppleScript Image Resizer Service for Android Developers

Resize properly all your resources by using this simple AppleScript

Use Automator to install this script as Service and enjoy!

How to:
=======
http://macgrunt.com/2012/07/31/turn-an-applescript-into-a-service/


text: export { ImageCopy20 as default } from "../../";


text:
import { FirebaseError } from "../error";
import { HostingOptions } from "./options";

/**
 * A regex to test for valid duration strings.
 */
export const DURATION_REGEX = /^(\d+)([hdm])$/;

/**
 * Basic durations in milliseconds.
 */
export enum Duration {
  MINUTE = 60 * 1000,
  HOUR = 60 * 60 * 1000,
  DAY = 24 * 60 * 60 * 1000,
}

const DURATIONS: { [d: string]: Duration } = {
  m: Duration.MINUTE,
  h: Duration.HOUR,
  d: Duration.DAY,
};

/**
 * The maximum TTL duration for a channel: 30 days (represented in milliseconds).
 */
export const MAX_DURATION = 30 * Duration.DAY;

/**
 * The default TTL duration for a channel: 7 days (represented in milliseconds).
 */
export const DEFAULT_DURATION = 7 * Duration.DAY;

/**
 * calculateChannelExpireTTL returns the ms duration from the provided flag.
 * This will throw an error if the duration is greater than 30d.
 * @param flag string duration (e.g. "1d").
 * @return a duration in milliseconds.
 */
export function calculateChannelExpireTTL(flag: NonNullable<HostingOptions["expires"]>): number {
  const match = DURATION_REGEX.exec(flag);
  if (!match) {
    throw new FirebaseError(
      `"expires" flag must be a duration string (e.g. 24h or 7d) at most 30d`
    );
  }
  const d = parseInt(match[1], 10) * DURATIONS[match[2]];
  if (isNaN(d)) {
    throw new FirebaseError(`Failed to parse provided expire time "${flag}"`);
  }
  if (d > MAX_DURATION) {
    throw new FirebaseError(`"expires" flag may not be longer than 30d`);
  }
  return d;
}


text:
'use strict';

var _ = require('lodash')
	;

var tokenRegx = /{([^}]+)}/g;

module.exports = function (template, data) {
  // We should probably use something the pre-compiles
  return template.replace(tokenRegx, function (match, inner) {
    return data[inner];
  });
};

module.exports.tokens = function (template) {
  return _.uniq((template.match(tokenRegx) || []).map(function (wrappedToken) {
    return wrappedToken.substring(1, wrappedToken.length - 1);
  }));
};


text:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
	id="WebApp_ID" version="2.5">

	<display-name>pagination demo</display-name>

	<context-param>
		<param-name>org.richfaces.enableControlSkinning</param-name>
		<param-value>true</param-value>
	</context-param>

	<context-param>
		<param-name>org.richfaces.skin</param-name>
		<param-value>emeraldTown</param-value>
	</context-param>

	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:applicationContext.xml</param-value>
	</context-param>

	<listener>
		<listener-class>com.sun.faces.config.ConfigureListener</listener-class>
	</listener>

	<listener>
       <listener-class>
           org.springframework.web.context.ContextLoaderListener
       </listener-class>
   </listener>

   <listener>
      <listener-class>
         org.springframework.web.context.request.RequestContextListener
      </listener-class>
   </listener>

	<servlet>
		<servlet-name>FacesServlet</servlet-name>
		<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
		<load-on-startup>1</load-on-startup>
	</servlet>
	<servlet-mapping>
		<servlet-name>FacesServlet</servlet-name>
		<url-pattern>*.xhtml</url-pattern>
	</servlet-mapping>

	<!-- <welcome-file-list>
		<welcome-file>xhtml/login.xhtml</welcome-file>
	</welcome-file-list> -->

</web-app>


text:
<?php

	$LANGUAGE = array(

		// context menu related text
		'Use Database' => "Използвайте база данни",
		'Drop Database' => "Drop Database",
		'Empty Database' => "Празна база данни",
		'Drop all tables from this database' => "Отстранете всички таблици от тази база данни",
		'Select statement' => "Изберете отчет",
		'Insert statement' => "Вмъкване на отчет",
		'Update statement' => "Актуализация на отчета",
		'Describe' => "Опишете",
		'Show create command' => "Покажи създаде команда",
		'View data' => "Преглед на данните",
		'Alter Table' => "Alter таблица",
		'Indexes' => "Индекси",
		'Engine Type' => "Двигател",
		'More operations' => "Повече операции",
		'Truncate' => "Пресечен",
		'Drop' => "Капка",
		'Rename' => "Преименувам",
		'Export table data' => "Експортиране на данни от таблица",
		'Create Table' => "Създаване на таблица",
		'Create View' => "Създаване на виртуална",
		'Create Procedure' => "Създаване на дейността",
		'Create Function' => "Създаване на функция",
		'Create Trigger' => "Създаване Trigger",
		'Create Event' => "Създаване на събитие",
		'Show/Hide Panel' => "Покажи / скрий група",
		'Show/Hide Header' => "Покажи / скрий Header",
		'Copy all queries to clipboard' => "Копиране на всички запитвания към клипборда",
		'Clear history' => "Изчистване на историята",
		'Copy Column values' => "Копие на колона values",
		'Copy to clipboard' => "Копиране в клипборда",
		'Generate SQL Filter' => "Генериране на SQL филтър",
		'Database Manager' => "Мениджъра на базата данни",
		'Manage databases' => "Управление на бази данни",

		// main menu related text
		'Database' => "База данни",
		'Refresh' => "Обнови",
		'Refresh database object list' => "Обнови списъка обект на база данни",
		'Create new' => "Създаване на нова",
		'Export' => "Износ",
		'Export database to external file' => "Износ база данни към външни файлове",
		'Objects' => "Обекти",
		'Create Table' => "Създаване на таблица",
		'Create a new table in the database' => "Създаване на нова таблица в базата данни",
		'Create View' => "Създаване на виртуална",
		'Create a new view in the database' => "Създаване на нов поглед в базата данни",
		'Create Stored Procedure' => "Създаване съхранявана Процедурния",
		'Create a new stored procedure in the database' => "Създаване на нова процедура, съхранявани в базата данни",
		'Create Function' => "Създаване на функция",
		'Create a new user defined function in the database' => "Създаване на нов потребител определена функция в базата данни",
		'Create Trigger' => "Създаване Trigger",
		'Create a new trigger in the database' => "Създаване на нов задейства в базата данни",
		'Create Event' => "Създаване на събитие",
		'Create a new event in the database' => "Създаване на ново събитие в базата данни",
		'Data' => "Данни",
		'Import batch file' => "Внос партиди",
		'Import multiple queries from batch file' => "Внос множество запитвания от команден файл",
		'Export database' => "Износ база данни",
		'Export database to batch file as sql dump' => "Износ база данни за партиди, както SQL дъмп",
		'Export current results' => "Износ текущите резултати",
		'Export query results to clipboard or files' => "Износ резултатите от заявката в клипборда или файлове",
		'Tools' => "Инструменти",
		'Process Manager' => "Process Manager",
		'View and manage database processes' => "Преглед и управление на база данни процеси",
		'Repair Tables' => "Ремонт таблици",
		'Analyze and repair database tables' => "Анализ и ремонт таблиците в базата данни",
		'User Manager' => "Управление на потребителите",
		'Manage database users' => "Управление на база данни на потребителите",
		'Search in Database' => "Търсене в базата данни",
		'Search for text in the database' => "Търсене на текст в базата данни",
		'Information' => "Информация",
		'Server/Connection Details' => "Server / Връзка Детайли",
		'View mysql server and connection details' => "Преглед на MySQL сървър и детайли връзка",
		'Server Variables' => "Сървър Променливи",
		'View mysql server variables' => "Преглед на MySQL сървър променливи",
		'Database Summary' => "База данни Резюме",
		'View current database summary stats' => "Преглед на текущата статистика данни обобщение",
		'Interface' => "Интерфейс",
		'Options' => "Опции",
		'Configure application options' => "Конфигуриране на настройки на",
		'UI Theme' => "UI Тема",
		'Database Objects' => "Обекти на база данни",
		'Toggle Object Viewer' => "Превключване на обекта Viewer",
		'Help contents' => "Помощ съдържание",
		'Learn the basics of using MyWebSQL' => "Запознайте се с основните положения при използването MyWebSQL",
		'QuickStart Tutorials' => "QuickStart уроци",
		'See quick hands-on tutorial of MyWebSQL interface' => "Вижте бърз практически урок на MyWebSQL интерфейс",
		'Online documentation' => "Онлайн документация",
		'View online documentation on project website' => "Вижте онлайн документацията на сайта на проекта",
		'Request a Feature' => "Заявка за елемент",
		'If you would like your most favourite feature to be part of MyWebSQL, please click here to inform about it' => "Ако искате да получите най-функция от нас да бъдем част от MyWebSQL, моля, кликнете тук, за да информира за това",
		'Report a Problem' => "Съобщи за проблем",
		'Check for updates' => "Проверка за актуализации",
		'Check for updated versions of the application online' => "Проверка за обновени версии на заявлението онлайн",
		'Logout' => "Изход",
		'Logout from this session' => "Изход от тази сесия",
		'Language' => "Език",
		'SQL Editor' => "SQL Editor",
		'Toggle SQL Editor' => "Превключване на SQL Editor",
		'Experimental' => "Експериментален",
		'Import table data' => "Импортиране на таблицата с данни",
		'Import table data from external file' => "Импортиране на данни на таблица от външен файл",
		'Batch operations' => "Партиди операции",
		'Perform one or more batch operations on database' => "Извършва една или повече партидни операции на база данни",
		'Create a new schema in the database' => "Създаване на нова схема в базата данни",
		'Create Schema' => "Създаване на схема",
		'Table Description' => "Таблица Описание",
		'Database Manager' => "Мениджъра на базата данни",
		'Manage databases' => "Управление на бази данни",
		'Backup database on the server as SQL dump' => "Резервната база данни на сървъра, като SQL дъмп",
		'Backup Database' => "Резервната база данни",

		// messages
		'Your browser appears to be very old and does not support all features required to run MyWebSQL.' => "Вашият браузър изглежда е много стар и не поддържа всички функции, необходими за работата MyWebSQL.",
		'Try using a newer version of the browser to run this application.' => "Опитайте се да използвате по-нова версия на браузъра, за стартиране на приложението",

		// text used on various screens in the interface
		'Visit Project website' => "Посетете сайта на проекта",
		'version' => "версия",
		'Loading' => "Товарене",
		'Quick Edit Options' => "Бързо Редактиране на настройките",
		'Press {{KEY}} to set NULL' => "Натиснете {{KEY}} да NULL",
		'MySQL Server' => "MySQL Server",
		'Logged in as: {{USER}}' => "Влезли сте като: {{USER}}",
		'Results' => "Резултати",
		'Messages' => "Съобщения",
		'Information' => "Информация",
		'History' => "История",
		'There are no results to show in this view' => "Не е намерена нито да се показват в този изглед",
		'Refresh results' => "Обновяване на резултатите",
		'Please wait' => "Моля, изчакайте",
		'Query All' => "Запитване Всички",
		'Query' => "Запитване",
		'Add Record' => "Добави Записът",
		'Delete Record(s)' => "Изтриване на запис (а)",
		'Update Record(s)' => "Актуализация Запис (и)",
		'Generate SQL' => "Генериране на SQL",
		'Database name' => "База данни име",
		'Select database after creation' => "Изберете базата данни след създаването",
		'Database connection failed to the server' => "Свързване на база данни не е на сървъра",
		'Host' => "Приемащата",
		'User' => "Потребител",
		'Select a database to begin' => "Изберете база данни, за да започне",
		'Select/unselect All records' => "Изберете / откажете от избора Всички записи",
		'Primary key column' => "Първичен ключ колона",
		'Unique key column' => "Отделни ключови колона",
		'Showing records {{START}} - {{END}}' => "Показва {{START}} - {{END}}",
		'Showing first {{MAX}} records only' => "Показване на първа {{MAX}} записа само",
		'1 query successfully executed' => "Една заявка е изпълнена успешно",
		'{{NUM}} queries successfully executed' => "{{NUM}} заявки е изпълнена успешно",
		'{{NUM}} record(s) were affected' => "{{NUM}} запис (а) са засегнати",
		'{{NUM}} record(s) updated' => "{{NUM}} запис (а) се актуализира",
		'Error occurred while executing the query' => "Възникна грешка при изпълнение на заявката",
		'{{NUM}} queries failed to execute' => "{{NUM}} заявки не успя да се изпълни",
		'Click to view/edit column data [{{NUM}} Bytes]' => "Щракнете тук за преглед / редактиране на данните в колона [{{NUM}} байта]",
		'Blob data is not editable' => "Blob данни не може да се редактира",
		'Blob data saved' => "Blob данните, записани",
		'Failed to save blob data' => "Не може да се спаси петно данни",
		'The process with id [{{PID}}] was killed' => "Процесът с идентификатор [{{PID}}] е бил убит",
		'No such process [id = {{PID}}]' => "Няма такъв процес [ID = {{PID}}]",
		'Select a process and click the button to kill the process' => "Изберете процес и кликнете върху бутона, за да убие процес",
		'Process ID' => "ID процес",
		'Command' => "Команда",
		'Time' => "Време",
		'Info' => "Информация",
		'Kill Process' => "Kill процес",
		'Failed to get process list' => "Не може да се получи списък процес",
		'The command executed successfully' => "Командата изпълнена успешно",
		'Invalid server configuration' => "Невалидна конфигурация сървър",
		'Invalid Credentials' => "Невалидна пълномощията",
		'New database successfully created' => "Нова база данни е създаден успешно",
		'File upload failed. Please try again' => "Качване на файлове не успя. Моля опитайте отново",
		'No queries were executed during import' => "Не заявки са били екзекутирани по време на вноса",
		'Maximum upload filesize is {{SIZE}}' => "Максимален размер на файла качите е {{SIZE}}",
		'Supported filetypes / extensions are: ({{LIST}})' => "Поддържани типове файлове / разширения са: ({{LIST}})",
		'Database summary' => "База данни обобщение",
		'Server Variables' => "Сървър Променливи",
		'Any existing object with the same name should be dropped manually before executing the creation command' => "Всеки съществуващ обект със същото име, трябва да се пуска ръчно преди да изпълни създаването команда",
		'Only create commands are accepted' => "Само създават команди се приемат",
		'User ID' => "User ID",
		'Password' => "Парола",
		'Login' => "Вход",
		'Create new database object' => "Създаване на нов обект от база данни",
		'Enter command for object creation' => "Въведете командата за създаване на обекта",
		'Submit' => "Изпращане",
		'Show blob data as: {{TYPE}}' => "Покажи петно данни: {{TYPE}}",
		'Blob data for column {{NAME}}' => "Blob данни за колона {{NAME}}",
		'Create command for {{TYPE}} {{NAME}}' => "Създаване на команда за {{TYPE}} {{NAME}}",
		'Table Engine (type)' => "Таблица на двигателя (тип)",
		'Change Table Type' => "Промяна на таблицата Тип",
		'The requested page is not available on the server' => "Заявената страница не е на разположение на сървъра",
		'Error' => "Грешка",
		'It appears that you attempted to submit an invalid request to the server' => "Оказва се, че сте се опитали да представят невалидна заявка към сървъра",
		'The request has been denied. Reloading the page might solve the problem' => "Искането е било отказано. Презареждане на страницата може да реши проблема",
		'Access Denied' => "Достъпът е отказан",
		'Help' => "Помощ",
		'To see most up-to-date help contents, please visit {{LINK}}' => "За да видите най актуална съдържанието на помощта, моля посетете {{LINK}}",
		'It appears that your browser session has expired' => "Оказва се, че вашия браузър сесия е изтекла",
		'Please refresh the webpage to re-login' => "Моля, обновяване на уеб страницата да се възстанови вход",
		'Table information' => "Таблица информация",
		'Edit' => "Редактиране",
		'Save' => "Запази",
		'Either the database is empty, or there was an error retrieving list of database objects' => "Всяка база данни е празен, или е имало грешка при получаването на списъка с обекти на база данни",
		'Please try closing and re-opening this dialog again' => "Моля, опитайте затваряне и отваряне на този диалогов прозорец отново",
		'Structure' => "Структура",
		'Table Data' => "Данни от таблица",
		'Structure and Table Data' => "Структура и таблица на данните",
		'Options' => "Опции",
		'Set Auto increment field values to NULL' => "Задайте Auto стойности на полето нарастване на NULL",
		'Add DROP command before create statements' => "Добави DROP команда преди създаване на отчети",
		'Export' => "Износ",
		'Import' => "Внос",
		'Export Database' => "Износ база данни",
		'Export Table' => "Износ таблица",
		'Server information' => "Информация за сървъра",
		'Mysql version' => "Mysql версия",
		'Version comment' => "Версия коментар",
		'Character sets' => "Набор от символи",
		'Server character set' => "Сървър набор от символи",
		'Client character set' => "Клиент набор от символи",
		'Database character set' => "База данни набор от символи",
		'Results character set' => "Резултати от набор от символи",
		'Export As' => "Експортиране като",
		'Insert Statements' => "Вмъкване на отчет",
		'Include field names in query' => "Включи имената на полетата в заявка",
		'XML' => "XML",
		'XHTML' => "XHTML",
		'Plain Text (One record per line)' => "Обикновен текст (по един запис на ред)",
		'Fields separated by:' => "Сфера, разделени с:",
		'Export Results' => "Резултати от износа",
		'Select SQL batch file to import' => "Изберете SQL файл партида за внос",
		'Continue processing even if error occurs' => "Продължете обработката, дори ако възникне грешка",
		'Basic Information' => "Основна информация",
		'Table Properties' => "Свойства на таблицата",
		'Table Name' => "Името на таблицата",
		'Field Name' => "Полето Име",
		'Data Type' => "Тип данни",
		'Length' => "Дължина",
		'Default value' => "Стойността по подразбиране",
		'Unsigned' => "Неподписан",
		'Zero Fill' => "Zero Fill",
		'Primary Key' => "Първичен ключ",
		'Auto Increment' => "Auto Increment",
		'Not NULL' => "Не NULL",
		'Character Set' => "Character Set",
		'Collation' => "Сравняване",
		'Comment' => "Коментар",
		'Waiting for table information to be submitted' => "В очакване на таблицата данни за изпращане",
		'Add field' => "Добави областта",
		'Delete selected field' => "Изтриване на избраното поле",
		'Clear Table Information' => "Изчистване на таблица Информация",
		'List of values' => "Списък на ценностите",
		'Query Results' => "Запитване Резултати",
		'Data for {{TABLE}}' => "Данни за {{TABLE}}",
		'Select tables to be analyzed/repaired' => "Изберете таблици, за да се анализират / ремонт",
		'Operation to perform' => "Операция за изпълнение",
		'Analyze' => "Анализирайте",
		'Check' => "Проверка",
		'Optimize' => "Оптимизиране на",
		'Repair' => "Ремонт",
		'Skip Binary logging' => "Напред Binary сеч",
		'Default' => "По подразбиране",
		'Quick' => "Бързо",
		'Fast' => "Бързо",
		'Medium' => "Среда",
		'Extended' => "Разширен",
		'Changed' => "Променен",
		'Use Frm files (MyISAM tables)' => "Използвайте FRM файлове (MyISAM таблици)",
		'User Information' => "Информация за потребител",
		'Global Privileges' => "Global привилегиите",
		'Database Privileges' => "База данни привилегиите",
		'Import File' => "Внос на файла",
		'Index Manager' => "Индекс Manager",
		'Edit table structure' => "Редактиране на структурата на таблицата",
		'Save All Changes' => "Запази Всички Промени",
		'Changes are not saved until you press [Save All Changes]' => "Промени не се съхраняват, докато натиснете [Запази Всички Промени]",
		'Field Length' => "Дължината на полето",
		'Select objects to include in export' => "Избира обекти да бъдат включени в износа",
		'Export type' => "Износ тип",
		'Select All/None' => "Избиране на всички / нито един",
		'Add User' => "Добавяне на потребител",
		'Update User' => "Актуализация на потребителя",
		'Delete selected User' => "Изтриване на избрания потребител",
		'Remove Password' => "Премахване на парола",
		'Select tables to search' => "Изберете таблицата за търсене",
		'Search Options' => "Опции за търсене",
		'Search in following field types' => "Търсене в следните типове полета",
		'Numeric Fields' => "Числови полета",
		'Character Fields' => "Символ Сфера",
		'Text Fields' => "Текстови полета",
		'Date/Time Fields' => "Дата / Час Сфера",
		'Comparison Type' => "Сравнение Тип",
		'Text to search' => "Текст за търсене",
		'Search' => "Търсене",
		'Search Results' => "Резултати от търсенето",
		'Number of matches' => "Брой на мача",
		'Search results for {{KEYWORD}} in the database' => "Резултати от търсенето за {{}} KEYWORD в базата данни",
		'{{NUM}} match(es)' => "{{NUM}} мач (и)",
		'Copy query to editor' => "Копие заявка за редактор",
		'Done' => "Съставено",
		'SQL Editor' => "SQL Editor",
		'Create Copy' => "Създаване Copy",
		'Minimize All' => "Намаляване на всички",
		'Copy Record(s)' => "Копиране Record (а)",
		'YAML' => "YAML",
		'Comma Separated (CSV for Excel)' => "Разделени със запетаи (CSV за Excel)",
		'Select data file to import' => "Изберете файл с данни за внос",
		'Select table for data import' => "Изберете маса за внос на данни",
		'First line contains column names' => "Първият ред съдържа имената на колоните",
		'Select objects to operate upon' => "Изберете обекти, за да оперират",
		'Operations to perform' => "Операции, за да изпълняват",
		'Add prefix string to name' => "Добави префикс низ, за да назовем",
		'Delete prefix string from name' => "Изтриване на низ префикс от име",
		'Command text' => "Command текст",
		'DROP selected database objects' => "Пускайте избрани обекти от база данни",
		'Batch operation results' => "Резултатите от периодично действие",
		'Operation' => "Операция",
		'Status' => "Статус",
		'{{NUM}} queries generated' => "{{NUM}} запитва генерира",
		'Please select one or more operations to perform' => "Моля, изберете една или повече операции, за да изпълняват",
		'Quick Search' => "Бързо търсене",
		'{{NAME}} client library is not installed' => "{{NAME}} клиентската библиотека не е инсталиран",
		'{{NAME}} extension is not installed' => "{{NAME}} разширение не е инсталиран",
		'SQLite database folder is inaccessible or not writable' => "SQLite база данни папка е недостъпна или не записваеми",
		'Maximize/Restore Results Pane' => "Максимизиране / възстановяване Резултати екран",
		'Select databases to operate upon' => "Изберете бази данни, за да се оперира",
		'DROP selected databases' => "Пускайте избрани бази данни",
		'The following operation is irreversible' => "Следващата операция е необратима",
		'Potential data loss might occur' => "Потенциална загуба на данни може да се случи",
		'Add TRUNCATE command before insert statements' => "Добави съкращава командата, преди да вмъкнете отчети",
		'Select objects to include in backup' => "Изберете обекти да се включат в гръб",
		'Backup folder does not exist or is not writable' => "Папка Backup не съществува или не е записваем",
		'Backup type' => "Backup тип",
		'Database backup successfully created' => "Резервната база данни е създадена успешно",
		'Failed to create database backup' => "Грешка при създаване на резервната база данни",
		'Generate Bulk insert statements' => "Генериране на насипни отчети вмъкване",
		'Maximum size of SQL statement' => "Максимален размер на изявление SQL",
		'Show record count with table names' => "Покажи брой рекорд с имена на таблици",
		'Sort Table listing by' => "Листинг Сортиране на таблицата по",
		'Name' => "Име",
		'Last Update Time' => "Последно обновяване Time",
		'Maximum records to display in result set' => "Максимални записи за да се покаже в резултат набор",
		'Show popup dialog for editing large text data' => "Покажи изскачащ диалогов за редактиране на големи данни, текст",
		'Miscellaneous' => "Разни",
		'Reset all confirmation dialogs' => "Връщане на всички диалогови прозорци за потвърждение",
		'Record Editing' => "Записът Editing",

	);

	// javascript
	$LANGUAGE_JS = array(
		'all' => "всички",
		'all selected' => "всички избрани",
		'An error occured while refreshing the object list.' => "Възникна грешка при опресняване на обекта списъка.",
		'Are you sure you want to clear all field information from table?' => "Наистина ли искате да изчистите всички области на информация от масата?",
		'Are you sure you want to delete this user account?' => "Наистина ли искате да изтриете този акаунт?",
		'Are you sure you want to DROP all objects from the database {{NAME}}?' => "Наистина ли искате да се откажа, всички обекти от базата данни на {{NAME}}?",
		'Are you sure you want to DROP selected objects?' => "Сигурни ли сте че искате да пуснете избраните обекти?",
		'Are you sure you want to DROP the database {{NAME}}?' => "Наистина ли искате да се откажа, базата данни {{NAME}}?",
		'Are you sure you want to drop this object? {{NAME}}' => "Наистина ли искате да пуснете този обект? {{NAME}}",
		'Are you sure you want to execute {{SELECTED}} queries?' => "Наистина ли искате да изпълните {{SELECTED}} заявки?",
		'Are you sure you want to logout?' => "Наистина ли искате да излезете?",
		'Are you sure you want to truncate the table {{NAME}}?' => "Наистина ли искате да съкрати таблицата {{NAME}}?",
		'Blob Data [{{SIZE}}]' => "Петно на данни [{{SIZE}}]",
		'Cancel' => "Отказ",
		'Check for Updates' => "Проверка за актуализации",
		'Clear command history?' => "Ясно команда история?",
		'Close' => "Тясно",
		'Confirm Action' => "Потвърждение за действие",
		'Confirm and do not ask me again about this choice' => "Потвърдете и не ме питай повече за този избор",
		'Copy Object' => "Копиране на обекти",
		'Create Database' => "Създаване на база данни",
		'Create Primary Index on this field' => "Създаване на първичен индекс на тази област",
		'Databases' => "Данни",
		'Default value [Use quotes to specify string values]' => "Стойността по подразбиране [Използвайте кавички, за да определят низови стойности]",
		'Disallow NULL values in Field' => "Забрана за NULL стойности в полето",
		'Enter new index name' => "Въведете ново име индекс",
		'Enter new name for the database object' => "Въведете новото име на обект на база данни",
		'Enter the text to search in database' => "Въведете текст за търсене в базата данни",
		'Error' => "Грешка",
		'Events' => "Събития",
		'Execute query' => "Изпълнение на заявката",
		'Exports results' => "Износът резултати",
		'Failed to refresh the results.' => "Проблем при обновяване на резултатите.",
		'Field Datatype' => "Поле ТипДанни",
		'Field Name' => "Полето Име",
		'Field value is Auto Incremented' => "На поле е Auto увеличава",
		'Functions' => "Функции",
		'Indexes Updated' => "Актуализиран индекси",
		'Maximum Length of field value' => "Максималната дължина на стойност на поле",
		'Navigation Error. Try reloading the page' => "Навигационна грешка. Опитайте да презаредите страницата",
		'New settings saved and applied' => "Нови настройки запазени и прилагани",
		'New version is available' => "Новата версия е достъпна",
		'Next' => "Следваща",
		'No' => "Не",
		'No Table selected' => "Не таблица избрани",
		'Not enough room to show this pane.' => "Няма достатъчно място да се покаже прозорец.",
		'OK' => "OK",
		'One or more field information is incomplete' => "Един или повече области информацията е непълна",
		'Open' => "Отворен",
		'Operation failed' => "Операцията бе неуспешна",
		'Pad field values with leading zeros' => "Pad областта стойности с нули",
		'Pane' => "Екран",
		'Passwords do not match' => "Паролите не съвпадат",
		'Pin' => "Щифт",
		'Please select one or more operations to perform' => "Моля, изберете една или повече операции, за да изпълняват",
		'Please type in one or more queries in the SQL editor!' => "Моля, въведете една или повече заявки в SQL редактор!",
		'Please wait...' => "Моля, изчакайте ...",
		'Previous' => "Предишна",
		'Procedures' => "Процедури",
		'Prompt' => "Бърз",
		'Refresh results' => "Обновяване на резултатите",
		'Refreshing object list' => "Обновяване на обект списък",
		'Rename Object' => "Преименуване на обект",
		'Resize' => "Живея",
		'Results page:' => "Страница с резултати:",
		'Select a database to view privileges for the user' => "Изберете базата данни, за да видите привилегии за потребителя",
		'Select an index to view / edit its details' => "Изберете индекс за разглеждане / редактиране му детайли",
		'Select at least one field type for searching' => "Изберете най-малко едно поле тип за търсене",
		'Select objects to operate upon' => "Изберете обекти, за да оперират",
		'selector' => "селектор",
		'Slide Open' => "Слайд Open",
		'Table information requires at least one valid field' => "Таблица информацията се нуждае от поне една валидна областта",
		'Table name is required' => "Таблица Необходимо е име на",
		'Table successfully created' => "Таблица създаден успешно",
		'Table successfully modified' => "Таблица успешно промяна",
		'Tables' => "Таблици",
		'Text Data [{{SIZE}}]' => "Текстови данни [{{SIZE}}]",
		'There is no record in the results to export' => "Няма данни в резултат на износ",
		'This attribute is not required for selected field type' => "Този атрибут не се изисква за избрания тип поле",
		'Triggers' => "Тригери",
		'Un-Pin' => "Un-Пин",
		'Unsigned numbered field only' => "Неподписани номерирани областта само",
		'Update check failed' => "Актуализация проверка не успя",
		'User information is incomplete or invalid' => "Потребителят информация е непълна или невалидни",
		'User Manager' => "Управление на потребителите",
		'Views' => "Видян",
		'WARNING' => "ПРЕДУПРЕЖДЕНИЕ",
		'Yes' => "Да",
		'You have the latest version' => "Вие имате последната версия",

	);
?>


text:
using UnityEngine;
using UnityEditor;
using System.Collections;
using System.Collections.Generic;
using UnityEngine.UI.Windows.Plugins.Flow;
using System.Linq;
using System;
using UnityEditor.UI.Windows.Plugins.DevicePreview.Output;
using UnityEngine.UI.Windows.Plugins.DevicePreview;

namespace UnityEditor.UI.Windows.Plugins.DevicePreview {

	public class DevicePreviewWindow : EditorWindowExt {

		public class GameView {

			public DevicePreviewWindow root;

			public float width = 600f;
			public float height = 400f;

			private IDeviceOutput deviceOutput;

			private bool isActive = false;

			public GameView(DevicePreviewWindow root) {

				this.root = root;

				EditorApplication.update += this.OnUpdate;

			}

			~GameView() {

				EditorApplication.update -= this.OnUpdate;

			}

			public void Resize(float width, float height) {

				this.width = width;
				this.height = height;

			}

			//private DevicePreviewCamera previewCamera;
			private RenderTexture tempRenderTexture;
			private Texture2D tempScreenshot;

			private int currentWidth;
			private int currentHeight;
			private float ppi;
			private ScreenOrientation orientation;
			public bool SetResolution(int width, int height, float ppi, ScreenOrientation orientation, IDeviceOutput deviceOutput) {

				var result = false;

				this.orientation = orientation;
				this.deviceOutput = deviceOutput;

				this.ppi = ppi;
				this.currentWidth = width;
				this.currentHeight = height;

				this.tempScreenshot = new Texture2D(width, height, TextureFormat.RGB24, false);

				this.tempRenderTexture = new RenderTexture(width, height, 24, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default);
				/*
				if (this.previewCamera == null) {

					var go = new GameObject("__TempCamera");
					this.previewCamera = go.AddComponent<DevicePreviewCamera>();

				}

				this.previewCamera.Initialize(this.tempRenderTexture, () => {

					this.root.Repaint();
					GameObject.DestroyImmediate(this.previewCamera.gameObject);

				});*/

				var size = new Vector2(this.width, this.height);
				var imageSize = new Vector2(this.currentWidth, this.currentHeight);
				var factor = this.GetFactor(imageSize, size);
				var k = Screen.dpi / this.ppi;

				if (factor / k < 1f) {

					result = true;

				}

				this.isActive = true;

				this.Update();

				return result;

			}

			public void CleanUp() {

				//if (this.previewCamera != null) this.previewCamera.CleanUp();

			}

			public void Update() {

				if (this.isActive == false) return;

				this.OnUpdate();

			}

			public void OnGUI() {

				if (this.isActive == false) {

					var warningOffset = 15f;

					var style = new GUIStyle("flow node 6");
					style.alignment = TextAnchor.MiddleCenter;
					style.fontStyle = FontStyle.Bold;

					style.margin = new RectOffset();
					style.padding = new RectOffset();
					style.contentOffset = Vector2.zero;

					var content = new GUIContent("YOU HAVE NO DEVICE SELECTED");
					var contentRect = GUILayoutUtility.GetRect(content, style);

					var width = contentRect.width + warningOffset;
					var height = contentRect.height + warningOffset;

					var centerRect = new Rect(this.width * 0.5f - width * 0.5f, this.height * 0.5f - height * 0.5f, width, height);
					GUI.Label(centerRect, content, style);

					this.root.selectedId = -1;

					return;

				}

				var rectStyle = new GUIStyle("flow node 0");

				var size = new Vector2(this.width, this.height);

				GUI.Box(new Rect(0f, 0f, size.x, size.y), string.Empty, rectStyle);

				var drawRect = this.GetRectFromSize(this.currentWidth, this.currentHeight);
				var drawRectLandscape = this.GetRectFromSize(this.orientation == ScreenOrientation.Landscape ? this.currentWidth : this.currentHeight, this.orientation == ScreenOrientation.Landscape ? this.currentHeight : this.currentWidth);

				var deviceOutput = this.deviceOutput as IDeviceOutput;
				if (deviceOutput == null) {

					var offset = 5f;
					var backRect = new Rect(drawRect.x - offset, drawRect.y - offset, drawRect.width + offset * 2f, drawRect.height + offset * 2f);
					var oldColor = GUI.color;
					GUI.color = Color.black;
					GUI.Box(backRect, string.Empty, rectStyle);
					GUI.color = oldColor;

				}

				if (deviceOutput != null) {

					deviceOutput.SetRect(new Rect(0f, 0f, size.x, size.y), drawRect, drawRectLandscape, this.orientation);

					deviceOutput.DoPreGUI();

				}

				GUI.DrawTexture(drawRect, this.tempRenderTexture);

				if (deviceOutput != null) {

					deviceOutput.DoPostGUI();

				}

			}

			public void OnUpdate() {

				if (this.isActive == false) return;

				// Clear screen
				//Graphics.Blit(Texture2D.blackTexture, this.tempRenderTexture);

				var allCameras = Camera.allCameras.OrderBy((c) => c.depth);
				foreach (var camera in allCameras) {

					Graphics.Blit(this.TakeScreenshot(camera), this.tempRenderTexture);

				}

			}

			public Texture2D TakeScreenshot(Camera camera) {

				if (this.tempRenderTexture == null) {

					return null;

				}

				var width = this.tempRenderTexture.width;
				var height = this.tempRenderTexture.height;

				camera.targetTexture = this.tempRenderTexture;
				camera.Render();

				RenderTexture.active = this.tempRenderTexture;

				this.tempScreenshot.ReadPixels(new Rect(0f, 0f, width, height), 0, 0);
				this.tempScreenshot.Apply(false);

				camera.targetTexture = null;

				RenderTexture.active = null;

				return this.tempScreenshot;

			}

			private float GetFactor(Vector2 inner, Vector2 boundingBox) {

				float widthScale = 0, heightScale = 0;
				if (inner.x != 0)
					widthScale = boundingBox.x / inner.x;
				if (inner.y != 0)
					heightScale = boundingBox.y / inner.y;

				return Mathf.Min(widthScale, heightScale);

			}

			private Rect GetRectFromSize(float currentWidth, float currentHeight) {

				var size = new Vector2(this.width, this.height);
				var imageSize = new Vector2(currentWidth, currentHeight);

				var factor = this.GetFactor(imageSize, size);
				var k = Screen.dpi / this.ppi;

				var newImageSize = Vector2.zero;
				if (factor / k < 1f) {

					newImageSize = imageSize * factor;

				} else {

					var deviceSize = imageSize * k;
					newImageSize = deviceSize;

				}

				return new Rect((size.x - newImageSize.x) * 0.5f, (size.y - newImageSize.y) * 0.5f, newImageSize.x, newImageSize.y);

			}

		}

		private const float PANEL_WIDTH = 250f;
		private const float MARGIN = 5f;

		public static DevicePreviewWindow ShowEditor(System.Action onClose) {

			var editor = DevicePreviewWindow.CreateInstance<DevicePreviewWindow>();
			var title = "UIW Prev";
			#if !UNITY_4
			editor.titleContent = new GUIContent(title, Resources.Load<Texture2D>("UI.Windows/Icons/FlowIcon"));
			#else
			editor.title = title;
			#endif
			editor.position = new Rect(0f, 0f, 1f, 1f);

			editor.gameView = new GameView(editor);

			editor.onClose = onClose;

			editor.Show();
			editor.Focus();

			Parser.Collect(forced: false);

			return editor;

		}

		public override void OnClose() {

			this.Validate();

			this.gameView.CleanUp();

			if (this.onClose != null) this.onClose();

		}

		public void Validate() {

			if (Parser.manufacturerToDevices == null || Parser.manufacturerToDevices.Count == 0) {

				Parser.Collect(forced: false);

			}

			if (this.gameView == null) this.gameView = new GameView(this);

		}

		public override void Update() {

			this.Validate();

			this.gameView.Update();

			this.Repaint();

		}

		private void OnGUI() {

			this.Validate();

			var rectStyle = new GUIStyle("flow node 0");

			var rect = new Rect(0f, 0f, PANEL_WIDTH, this.position.height);

			GUI.Box(rect, string.Empty, rectStyle);

			GUILayout.BeginArea(rect);
			{

				this.DrawDevicesList();

			}
			GUILayout.EndArea();

			rect = new Rect(PANEL_WIDTH + MARGIN, 0f, this.position.width - PANEL_WIDTH - MARGIN, this.position.height);

			this.gameView.Resize(rect.width, rect.height);

			GUI.Box(rect, string.Empty, rectStyle);

			GUILayout.BeginArea(rect);
			{

				this.gameView.OnGUI();

			}
			GUILayout.EndArea();

		}

		private System.Action onClose;

		public GameView gameView;

		private List<bool> directoriesFoldOut = new List<bool>();

		private int selectedId = -1;
		private Vector2 scrollPosition;
		private double lastClickTime = 0d;

		private void DrawDevicesList() {

			var scrollWidth = 20f;
			var offset = 10;

			var elementStyle = new GUIStyle("flow node hex 0");
			elementStyle.contentOffset = Vector2.zero;
			elementStyle.fixedWidth = PANEL_WIDTH - scrollWidth - offset;
			elementStyle.margin = new RectOffset(offset, 0, 0, 0);
			elementStyle.padding = new RectOffset(20, 20, 10, 20);
			elementStyle.alignment = TextAnchor.MiddleLeft;

			var elementStyleSelected = new GUIStyle("flow node hex 1 on");
			elementStyleSelected.contentOffset = Vector2.zero;
			elementStyleSelected.fixedWidth = PANEL_WIDTH - scrollWidth - offset;
			elementStyleSelected.margin = new RectOffset(offset, 0, 0, 0);
			elementStyleSelected.padding = new RectOffset(20, 20, 10, 20);
			elementStyleSelected.alignment = TextAnchor.MiddleLeft;

			var elementStylePortrait = new GUIStyle("flow node hex 2");
			elementStylePortrait.contentOffset = Vector2.zero;
			elementStylePortrait.fixedWidth = PANEL_WIDTH - scrollWidth - offset;
			elementStylePortrait.margin = new RectOffset(offset, 0, 0, 0);
			elementStylePortrait.padding = new RectOffset(20, 20, 10, 20);
			elementStylePortrait.alignment = TextAnchor.MiddleLeft;

			var elementStyleSelectedPortrait = new GUIStyle("flow node hex 2 on");
			elementStyleSelectedPortrait.contentOffset = Vector2.zero;
			elementStyleSelectedPortrait.fixedWidth = PANEL_WIDTH - scrollWidth - offset;
			elementStyleSelectedPortrait.margin = new RectOffset(offset, 0, 0, 0);
			elementStyleSelectedPortrait.padding = new RectOffset(20, 20, 10, 20);
			elementStyleSelectedPortrait.alignment = TextAnchor.MiddleLeft;

			var headerLabel = new GUIStyle(EditorStyles.whiteLargeLabel);
			headerLabel.padding = new RectOffset(0, 0, 0, 0);
			headerLabel.margin = new RectOffset(0, 0, 0, 0);

			var miniLabel = new GUIStyle(EditorStyles.miniLabel);
			miniLabel.padding = new RectOffset(0, 0, 0, 0);
			miniLabel.margin = new RectOffset(0, 0, 0, 0);

			var foldOutStyle = new GUIStyle("flow node hex 4");
			foldOutStyle.contentOffset = Vector2.zero;
			foldOutStyle.fixedWidth = PANEL_WIDTH - scrollWidth;
			foldOutStyle.font = headerLabel.font;
			foldOutStyle.fontSize = headerLabel.fontSize;
			foldOutStyle.padding = new RectOffset(20, 20, 15, 15);
			foldOutStyle.alignment = TextAnchor.MiddleLeft;

			var foldOutStyleSelected = new GUIStyle("flow node hex 4 on");
			foldOutStyleSelected.contentOffset = Vector2.zero;
			foldOutStyleSelected.fixedWidth = PANEL_WIDTH - scrollWidth;
			foldOutStyleSelected.font = headerLabel.font;
			foldOutStyleSelected.fontSize = headerLabel.fontSize;
			foldOutStyleSelected.padding = new RectOffset(20, 20, 15, 15);
			foldOutStyleSelected.alignment = TextAnchor.MiddleLeft;

			this.scrollPosition = EditorGUILayout.BeginScrollView(this.scrollPosition, false, false);

			var i = 0;
			var directories = Parser.manufacturerToDevices;
			if (this.directoriesFoldOut.Count != directories.Count) {

				this.directoriesFoldOut = new List<bool>();

				for (i = 0; i < directories.Count; ++i) {

					this.directoriesFoldOut.Add(false);

				}

			}

			i = 0;
			var f = 0;
			foreach (var directory in directories) {

				if (GUILayout.Button(directory.Key, this.directoriesFoldOut[f] ? foldOutStyleSelected : foldOutStyle) == true) {

					this.directoriesFoldOut[f] = !this.directoriesFoldOut[f];

				}

				if (this.directoriesFoldOut[f] == true) {

					GUILayout.BeginVertical();

					var list = directory.Value;
					if (list != null && list.Count > 0) {

						foreach (var item in list) {

							var style = this.selectedId == i ? (item.orientation == ScreenOrientation.Landscape ? elementStyleSelected : elementStyleSelectedPortrait) : (item.orientation == ScreenOrientation.Landscape ? elementStyle : elementStylePortrait);

							if (item.current == true) {

								item.width = Mathf.RoundToInt(this.gameView.width);
								item.height = Mathf.RoundToInt(this.gameView.height);
								item.orientation = item.orientation;

							}

							if (GUILayout.Button(item.model, style) == true) {

								// Apply Device Info
								if (EditorApplication.timeSinceStartup - this.lastClickTime < 0.3d && this.selectedId == i) {

									item.orientation = (item.orientation == ScreenOrientation.Landscape) ? ScreenOrientation.Portrait : ScreenOrientation.Landscape;

								}

								this.selectedId = i;

								this.lastClickTime = EditorApplication.timeSinceStartup;

								IDeviceOutput specialInstance = null;
								if (string.IsNullOrEmpty(item.deviceOutput) == false) {

									var outputNamespace = "UnityEditor.UI.Windows.Plugins.DevicePreview.Output";
									var type = outputNamespace + "." + item.deviceOutput;

									var specialOutput = System.Type.GetType(type);
									if (specialOutput != null) {

										specialInstance = Activator.CreateInstance(specialOutput) as IDeviceOutput;

									} else {

										Debug.LogWarning("Class not found: " + type);

									}

								}

								if (this.gameView.SetResolution(item.width, item.height, item.ppi, item.orientation, specialInstance) == true) {

									this.ShowNotification(new GUIContent("Drawing screen (" + item.width.ToString() + "x" + item.height.ToString() + ") doesn't fit into your window size (" + this.gameView.width.ToString() + "x" + this.gameView.height.ToString() + ")."));

								} else {

									this.RemoveNotification();

								}

								this.Repaint();

							}

							var rect = GUILayoutUtility.GetLastRect();
							rect.x += style.padding.left;
							rect.y += rect.height - style.padding.bottom;
							GUI.Label(rect, "Resolution: " + item.width.ToString() + "x" + item.height.ToString() + " (" + item.ppi.ToString() + ")", miniLabel);

							++i;

						}

					}

					GUILayout.EndVertical();

				} else {

					i += directory.Value.Count;

				}

				++f;

			}

			EditorGUILayout.EndScrollView();

		}

	}

}