text:
from django.utils.translation import ugettext_lazy as _
from django.utils.translation import ungettext_lazy
from django.utils import http
from django import template
#
from collections import defaultdict

from horizon import tables,exceptions
from django.core.urlresolvers import reverse
#
####from openstack_dashboard.api.salt_database_api import get_group_members_wrap, get_member ,   remove_group , remove_member, update_member
from openstack_dashboard.api.salt_sls_api import get_group_members_sls as get_group_members_wrap
from openstack_dashboard.api.salt_sls_api import get_member_sls as get_member
from openstack_dashboard.api.salt_sls_api import del_group as remove_group
from openstack_dashboard.api.salt_sls_api import remove_everywhere as remove_member
from openstack_dashboard.api.salt_sls_api import update_member_sls as update_member

class EditMemberLink(tables.LinkAction):
    name = "edit_member"
    verbose_name = _("Edit Member")
    url = "horizon:groups:instances:update"
    classes = ("ajax-modal",)
    icon = "pencil"

class CreateGroupLink(tables.LinkAction):
    name = "create_group"
    verbose_name = _("Create Group")
    url = "horizon:groups:instances:create_group"
    classes = ("ajax-modal",)
    icon = "plus"

class AddMemberLink(tables.LinkAction):
    name = "add_member"
    verbose_name = _("Add Member")
    url = "horizon:groups:instances:add_member"
    classes = ("ajax-modal",)
    icon = "plus"

    def get_link_url(self, datum=None):

        group_name = self.table.kwargs.get('group_name',None)

        if group_name:

            url = "horizon:groups:instances:add_member_to_group"

            return reverse(url, args=(group_name,))

        return reverse(self.url)

class UpdateMemberLink(tables.LinkAction):
    name = "update_member"
    verbose_name = _("Update Member")
    url = "horizon:groups:instances:update_member"
    classes = ("ajax-modal",)
    icon = "pencil"

class UpdateGroupRow(tables.Row):

    ajax = True

    def get_data(self, request, group_id):
        group_info = get_group_members_wrap(group_id)
        return group_info

class UpdateMemberRow(tables.Row):

    ajax = True

    def get_data(self, request, member_id):
        member_info = get_member(member_id)
        return member_info

class DeleteGroupsAction(tables.DeleteAction):
    @staticmethod
    def action_present(count):
        return ungettext_lazy(
            u"Delete Group",
            u"Delete Groups",
            count
        )

    @staticmethod
    def action_past(count):
        return ungettext_lazy(
            u"Deleted Group",
            u"Deleted Groups",
            count
        )

    def delete(self, request, obj_id):
        remove_group(obj_id)

class DeleteMembersAction(tables.DeleteAction):
    @staticmethod
    def action_present(count):
        return ungettext_lazy(
            u"Delete Member",
            u"Delete Members",
            count
        )

    @staticmethod
    def action_past(count):
        return ungettext_lazy(
            u"Deleted Member",
            u"Deleted Members",
            count
        )

    def delete(self, request, obj_id):

        group_name=self.table.kwargs.get('group_name',None)

        if group_name !=None:
            member_info = get_member(obj_id)
            current_member_groups = member_info.member_group_names
            current_member_groups.remove(group_name)
            update_member(member_name=obj_id,member_type=str(member_info.member_type),member_group_names=current_member_groups)
            return None

        remove_member(obj_id)

def get_Member_groups(instance):

    template_name = 'groups/instances/_member_groups.html'
    member_groups = instance.member_group_names
    member_name = instance.id

    member_group_conv = []

    for group in member_groups:

       member_group_conv.append(str(group))

    context = {'member_name':member_name , 'member_groups':member_group_conv}

    return template.loader.render_to_string(template_name, context)

def get_Group_members(instance):

    template_name = 'groups/instances/_group_members.html'
    group_name = instance.id
    group_members = instance.members

    members_conv = []

    for member in group_members:

        members_conv.append(str(member))

    context = {'group_name':group_name , 'group_members':members_conv}

    return template.loader.render_to_string(template_name, context)

class GroupsTable(tables.DataTable):
    id = tables.Column("id",  verbose_name = _("Group Name"), link="horizon:groups:instances:group_details")
    members = tables.Column(get_Group_members,  verbose_name = _("Members"))

    class Meta:
        name = "groups"
        verbose_name = _("Groups")
        table_actions = (CreateGroupLink,DeleteGroupsAction)
        row_class = UpdateGroupRow

class MembersTable(tables.DataTable):
    id = tables.Column("id",  verbose_name = _("Member"))
    member_type = tables.Column("member_type",  verbose_name = _("Type"))
    member_group_names = tables.Column(get_Member_groups, verbose_name = _("Member Groups"))

    class Meta:
        name = "members"
        verbose_name = _("Members")
        table_actions = (DeleteMembersAction,AddMemberLink)
        row_actions = (UpdateMemberLink,)
        row_class = UpdateMemberRow

class TasksFilterAction(tables.FilterAction):
    name = "task_filter"

class TaskDetailsFilterAction(tables.FilterAction):
    name = "task_details_filter"


text:
package org.jetbrains.idea.maven.server;

import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.List;
import java.util.Queue;

public interface MavenRemotePull<T> {
  List<T> pull();

}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace FatPanda\Illuminate\WordPress\Console\Commands;

use FatPanda\Illuminate\WordPress\Console\Commands\GeneratorCommand;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class CustomPostTypeMakeCommand extends GeneratorCommand
{
    /**
     * The console command name.
     *
     * @var string
     */
    protected $name = 'make:cpt';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Create a new Custom Post Type model';

    /**
     * The type of class being generated.
     *
     * @var string
     */
    protected $type = 'Custom post type';

    /**
     * Replace the class name for the given stub.
     *
     * @param  string  $stub
     * @param  string  $name
     * @return string
     */
    protected function replaceClass($stub, $name)
    {
        $stub = parent::replaceClass($stub, $name);

        $type = basename(str_replace('\\', '/', strtolower($name)));
        if ($this->option('type')) {
            $type = $this->option('type');
        }

        return str_replace('dummy_type', $type, $stub);
    }

    /**
     * Get the stub file for the generator.
     *
     * @return string
     */
    protected function getStub()
    {
        return realpath(__DIR__.'/../../../../resources/stubs/cpt.stub');
    }

    /**
     * Get the default namespace for the class.
     *
     * @param  string  $rootNamespace
     * @return string
     */
    protected function getDefaultNamespace($rootNamespace)
    {
        return $rootNamespace.'\Models';
    }

    /**
     * Get the console command arguments.
     *
     * @return array
     */
    protected function getArguments()
    {
        return [
            ['name', InputArgument::REQUIRED, 'The name of the custom post type.'],
        ];
    }

    /**
     * Get the console command options.
     *
     * @return array
     */
    protected function getOptions()
    {
        return [
            ['type', null, InputOption::VALUE_OPTIONAL, 'The unique key to indentify this type'],
        ];
    }
}


text:
//
//  JVFloatLabeledTextView.h
//  JVFloatLabeledTextField
//
//  The MIT License (MIT)
//
//  Copyright (c) 2013-2015 Jared Verdi
//  Original Concept by Matt D. Smith
//  http://dribbble.com/shots/1254439--GIF-Mobile-Form-Interaction?list=users
//
//  Permission is hereby granted, free of charge, to any person obtaining a copy of
//  this software and associated documentation files (the "Software"), to deal in
//  the Software without restriction, including without limitation the rights to
//  use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
//  the Software, and to permit persons to whom the Software is furnished to do so,
//  subject to the following conditions:
//
//  The above copyright notice and this permission notice shall be included in all
//  copies or substantial portions of the Software.
//
//  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
//  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
//  FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
//  COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
//  IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
//  CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

#import <UIKit/UIKit.h>

/**
 * `JVFloatLabeledTextView` is a `UITextView` subclass that implements the "Float Label Pattern".
 *
 * Due to space constraints on mobile devices, it is common to rely solely on placeholders as a means to label fields.
 * This presents a UX problem, in that, once the user begins to fill out a form, no labels are present.
 *
 * `JVFloatLabeledTextView` aims to improve the user experience by having placeholders transition into "floating labels"
 * that hover above the text view after it is populated with text.
 *
 * JVFloatLabeledTextView supports iOS 7+.
 *
 * Credits for the concept to Matt D. Smith (@mds), and his original design:  http://mattdsmith.com/float-label-pattern/
 */
IB_DESIGNABLE
@interface JVFloatLabeledTextView : UITextView

/**
 * The placeholder string to be shown in the text view when no other text is present.
 */
@property (nonatomic, copy) IBInspectable NSString * placeholder;

/**
 * Read-only access to the placeholder label.
 */
@property (nonatomic, strong, readonly) UILabel * placeholderLabel;

/**
 * Read-only access to the floating label.
 */
@property (nonatomic, strong, readonly) UILabel * floatingLabel;

/**
 * Padding to be applied to the y coordinate of the floating label upon presentation.
 */
@property (nonatomic) IBInspectable CGFloat floatingLabelYPadding;

/**
 * Padding to be applied to the x coordinate of the floating label upon presentation.
 */
@property (nonatomic) IBInspectable CGFloat floatingLabelXPadding;

/**
 * Padding to be applied to the y coordinate of the placeholder.
 */
@property (nonatomic) IBInspectable CGFloat placeholderYPadding;

/**
 * Font to be applied to the floating label. Defaults to `[UIFont boldSystemFontOfSize:12.0f]`.
 * Provided for the convenience of using as an appearance proxy.
 */
@property (nonatomic, strong) UIFont * floatingLabelFont;

/**
 * Text color to be applied to the floating label while the text view is not a first responder.
 * Defaults to `[UIColor grayColor]`.
 * Provided for the convenience of using as an appearance proxy.
 */
@property (nonatomic, strong) IBInspectable UIColor * floatingLabelTextColor;

/**
 * Text color to be applied to the floating label while the text view is a first responder.
 * Tint color is used by default if an `floatingLabelActiveTextColor` is not provided.
 */
@property (nonatomic, strong) IBInspectable UIColor * floatingLabelActiveTextColor;

/**
 * Indicates whether the floating label should lock to the top of the text view, or scroll away with text when the text
 * view is scrollable. By default, floating labels will lock to the top of the text view and their background color will
 * be set to the text view's background color
 * Note that this works best when floating labels have a non-clear background color.
 */
@property (nonatomic, assign) IBInspectable BOOL floatingLabelShouldLockToTop;

/**
 * Text color to be applied to the placeholder.
 * Defaults to `[[UIColor lightGrayColor] colorWithAlphaComponent:0.65f]`.
 */
@property (nonatomic, strong) IBInspectable UIColor * placeholderTextColor;

/**
 * Indicates whether the floating label's appearance should be animated regardless of first responder status.
 * By default, animation only occurs if the text field is a first responder.
 */
@property (nonatomic, assign) IBInspectable BOOL animateEvenIfNotFirstResponder;

/**
 * Duration of the animation when showing the floating label.
 * Defaults to 0.3 seconds.
 */
@property (nonatomic, assign) NSTimeInterval floatingLabelShowAnimationDuration UI_APPEARANCE_SELECTOR;

/**
 * Duration of the animation when hiding the floating label.
 * Defaults to 0.3 seconds.
 */
@property (nonatomic, assign) NSTimeInterval floatingLabelHideAnimationDuration UI_APPEARANCE_SELECTOR;

/**
 * Force floating label to be always visible
 * Defaults to NO
 */
@property (nonatomic, assign) BOOL alwaysShowFloatingLabel;

/**
 * Top value for textContainerInset
 * Change this value if you need more padding between text input and floating label
 */
@property (nonatomic) CGFloat startingTextContainerInsetTop;

/**
 *  Sets the placeholder and the floating title
 *
 *  @param placeholder The string that to be shown in the text view when no other text is present.
 *  @param floatingTitle The string to be shown above the text view once it has been populated with text by the user.
 */
- (void)setPlaceholder:(NSString *)placeholder floatingTitle:(NSString *)floatingTitle;

@end


text:
element.style {
    min-height: 600px;
}

.file-input {
    overflow-x: auto;
}

.file-loading {
    top: 0;
    right: 0;
    width: 25px;
    height: 25px;
    font-size: 999px;
    text-align: right;
    color: #fff;
    background: transparent url('loading.gif') top left no-repeat;
    border: none;
}

.btn-file {
    position: relative;
    overflow: hidden;
}

.btn-file input[type=file] {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 100%;
    min-height: 100%;
    text-align: right;
    opacity: 0;
    filter: alpha(opacity=0);
    opacity: 0;
    background: none repeat scroll 0 0 transparent;
    cursor: inherit;
    display: block;
}

.file-caption .glyphicon {
    display: inline-block;
    min-width: 18px;
    margin-top: 2px;
}

.file-caption-name {
    display: inline-block;
    overflow: hidden;
    max-height: 20px;
    padding-right: 10px;
    word-break: break-all;
}

.file-caption-ellipsis {
    position: absolute;
    right: 10px;
    margin-top: -6px;
    font-size: 1.2em;
    display: none;
    font-weight: bold;
    cursor: default;
}

.kv-has-ellipsis .file-caption-ellipsis {
    display: inline;
}

.kv-has-ellipsis {
    padding-right: 17px;
}

.kv-search-container .kv-search-clear {
    position: absolute;
    padding: 10px;
    right: 0px;
}

.file-error-message {
    background-color: #f2dede;
    color: #a94442;
    text-align: center;
    border-radius: 5px;
    padding: 5px;
}

.file-error-message pre, .file-error-message ul {
    margin: 5px 0;
    text-align: left;
}

.file-caption-disabled {
    background-color: #EEEEEE;
    cursor: not-allowed;
    opacity: 1;
}

.file-input .btn[disabled], .file-input .btn .disabled {
    cursor: not-allowed;
}

.file-preview {
    border-radius: 5px;
    border: 1px solid #ddd;
    padding: 5px;
    width: 100%;
    margin-bottom: 5px;
    height: 400px;
    min-height: 300px;
}

.file-preview-frame {
    display: table;
    margin: 8px;
    height: 160px;
    border: 1px solid #ddd;
    box-shadow: 1px 1px 5px 0px #a2958a;
    padding: 6px;
    float: left;
    text-align: center;
    vertical-align: middle;
}

.file-preview-frame:hover {
    box-shadow: 3px 3px 5px 0px #333;
}

.file-preview-image {
    height: 160px;
    vertical-align: text-center;
}

.file-preview-text {
    width: 160px;
    color: #428bca;
    font-size: 11px;
    text-align: center;
}

.file-preview-other {
    padding-top: 48px;
    text-align: center;
}

.file-preview-other i {
    font-size: 2.4em;
}

.file-other-error {
    width: 100%;
    padding-top: 30px;
    text-align: right
}

.file-input-new .file-preview, .file-input-new .close, .file-input-new .glyphicon-file,
.file-input-new .fileinput-remove-button, .file-input-new .fileinput-upload-button,
.file-input-ajax-new .fileinput-remove-button, .file-input-ajax-new .fileinput-upload-button {
    display: none;
}

.loading {
    background: transparent url('loading.gif') no-repeat scroll center center content-box !important;
}

.wrap-indicator {
    font-weight: bold;
    color: #245269;
    cursor: pointer;
}

.file-actions {
    text-align: left;
}

.file-footer-buttons {
    float: right;
}

.file-thumbnail-footer .file-caption-name {
    padding-top: 4px;
    font-size: 11px;
    color: #777;
}

.file-upload-indicator {
    padding-top: 2px;
    cursor: default;
}

.file-upload-indicator:hover {
    font-size: 1.2em;
    font-weight: bold;
    padding-top: 0;
}

.file-drop-zone {
    border: 1px dashed #aaa;
    border-radius: 4px;
    height: 100%;
    text-align: center;
    vertical-align: middle;
    margin: 12px 15px 12px 12px;
    padding: 5px;
}

.file-drop-zone-title {
    color: #aaa;
    font-size: 40px;
    padding: 85px 10px;
}

.highlighted {
    border: 2px dashed #999 !important;
    background-color: #f0f0f0;
}

.file-uploading {
    background-image: url('loading-sm.gif');
    background-position: center bottom 10px;
    background-repeat: no-repeat;
    opacity: 0.6;
}

.file-icon-large {
    font-size: 1.2em;
}


text:
//
//  GetToAddressListModel.m
//  Order
//
//  Created by 凯东源 on 2017/8/21.
//  Copyright © 2017年 凯东源. All rights reserved.
//

#import "GetToAddressListModel.h"

NSString *const kGetToAddressListModelGetToAddressModel = @"To";

@implementation GetToAddressListModel

-(instancetype)initWithDictionary:(NSDictionary *)dictionary
{
    self = [super init];
    if(dictionary[kGetToAddressListModelGetToAddressModel] != nil && [dictionary[kGetToAddressListModelGetToAddressModel] isKindOfClass:[NSArray class]]){
        NSArray * getToAddressModelDictionaries = dictionary[kGetToAddressListModelGetToAddressModel];
        NSMutableArray * getToAddressModelItems = [NSMutableArray array];
        for(NSDictionary * getToAddressModelDictionary in getToAddressModelDictionaries){
            GetToAddressModel * getToAddressModelItem = [[GetToAddressModel alloc] initWithDictionary:getToAddressModelDictionary];
            [getToAddressModelItems addObject:getToAddressModelItem];
        }
        self.getToAddressModel = getToAddressModelItems;
    }
    return self;
}

/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
-(NSDictionary *)toDictionary
{
    NSMutableDictionary * dictionary = [NSMutableDictionary dictionary];
    if(self.getToAddressModel != nil){
        NSMutableArray * dictionaryElements = [NSMutableArray array];
        for(GetToAddressModel * getToAddressModelElement in self.getToAddressModel){
            [dictionaryElements addObject:[getToAddressModelElement toDictionary]];
        }
        dictionary[kGetToAddressListModelGetToAddressModel] = dictionaryElements;
    }
    return dictionary;

}

/**
 * Implementation of NSCoding encoding method
 */
/**
 * Returns all the available property values in the form of NSDictionary object where the key is the approperiate json key and the value is the value of the corresponding property
 */
- (void)encodeWithCoder:(NSCoder *)aCoder
{
    if(self.getToAddressModel != nil){
        [aCoder encodeObject:self.getToAddressModel forKey:kGetToAddressListModelGetToAddressModel];
    }

}

/**
 * Implementation of NSCoding initWithCoder: method
 */
- (instancetype)initWithCoder:(NSCoder *)aDecoder
{
    self = [super init];
    self.getToAddressModel = [aDecoder decodeObjectForKey:kGetToAddressListModelGetToAddressModel];
    return self;

}

/**
 * Implementation of NSCopying copyWithZone: method
 */
- (instancetype)copyWithZone:(NSZone *)zone
{
    GetToAddressListModel *copy = [GetToAddressListModel new];

    copy.getToAddressModel = [self.getToAddressModel copy];

    return copy;
}

@end


text:
require 'thread_safe'

module ActiveModel
  class Serializer
    extend ActiveSupport::Autoload
    autoload :Configuration
    autoload :ArraySerializer
    autoload :Adapter
    include Configuration

    class << self
      attr_accessor :_attributes
      attr_accessor :_associations
      attr_accessor :_urls
      attr_accessor :_cache
      attr_accessor :_cache_key
      attr_accessor :_cache_options
    end

    def self.inherited(base)
      base._attributes = []
      base._associations = {}
      base._urls = []
    end

    def self.attributes(*attrs)
      @_attributes.concat attrs

      attrs.each do |attr|
        define_method attr do
          object && object.read_attribute_for_serialization(attr)
        end unless method_defined?(attr)
      end
    end

    def self.attribute(attr, options = {})
      key = options.fetch(:key, attr)
      @_attributes.concat [key]
      define_method key do
        object.read_attribute_for_serialization(attr)
      end unless method_defined?(key)
    end

    # Enables a serializer to be automatically cached
    def self.cache(options = {})
      @_cache = ActionController::Base.cache_store if Rails.configuration.action_controller.perform_caching
      @_cache_key = options.delete(:key)
      @_cache_options = (options.empty?) ? nil : options
    end

    # Defines an association in the object should be rendered.
    #
    # The serializer object should implement the association name
    # as a method which should return an array when invoked. If a method
    # with the association name does not exist, the association name is
    # dispatched to the serialized object.
    def self.has_many(*attrs)
      associate(:has_many, attrs)
    end

    # Defines an association in the object that should be rendered.
    #
    # The serializer object should implement the association name
    # as a method which should return an object when invoked. If a method
    # with the association name does not exist, the association name is
    # dispatched to the serialized object.
    def self.belongs_to(*attrs)
      associate(:belongs_to, attrs)
    end

    # Defines an association in the object should be rendered.
    #
    # The serializer object should implement the association name
    # as a method which should return an object when invoked. If a method
    # with the association name does not exist, the association name is
    # dispatched to the serialized object.
    def self.has_one(*attrs)
      associate(:has_one, attrs)
    end

    def self.associate(type, attrs) #:nodoc:
      options = attrs.extract_options!
      self._associations = _associations.dup

      attrs.each do |attr|
        unless method_defined?(attr)
          define_method attr do
            object.send attr
          end
        end

        self._associations[attr] = {type: type, association_options: options}
      end
    end

    def self.url(attr)
      @_urls.push attr
    end

    def self.urls(*attrs)
      @_urls.concat attrs
    end

    def self.serializer_for(resource, options = {})
      if resource.respond_to?(:to_ary)
        config.array_serializer
      else
        options
          .fetch(:association_options, {})
          .fetch(:serializer, get_serializer_for(resource.class))
      end
    end

    def self.adapter
      adapter_class = case config.adapter
      when Symbol
        ActiveModel::Serializer::Adapter.adapter_class(config.adapter)
      when Class
        config.adapter
      end
      unless adapter_class
        valid_adapters = Adapter.constants.map { |klass| ":#{klass.to_s.downcase}" }
        raise ArgumentError, "Unknown adapter: #{config.adapter}. Valid adapters are: #{valid_adapters}"
      end

      adapter_class
    end

    def self._root
      @@root ||= false
    end

    def self._root=(root)
      @@root = root
    end

    def self.root_name
      name.demodulize.underscore.sub(/_serializer$/, '') if name
    end

    attr_accessor :object, :root, :meta, :meta_key, :scope

    def initialize(object, options = {})
      @object   = object
      @options  = options
      @root     = options[:root] || (self.class._root ? self.class.root_name : false)
      @meta     = options[:meta]
      @meta_key = options[:meta_key]
      @scope    = options[:scope]

      scope_name = options[:scope_name]
      if scope_name && !respond_to?(scope_name)
        self.class.class_eval do
          define_method scope_name, lambda { scope }
        end
      end
    end

    def json_key
      if root == true || root.nil?
        self.class.root_name
      else
        root
      end
    end

    def attributes(options = {})
      attributes =
        if options[:fields]
          self.class._attributes & options[:fields]
        else
          self.class._attributes.dup
        end

      attributes.each_with_object({}) do |name, hash|
        hash[name] = send(name)
      end
    end

    def each_association(&block)
      self.class._associations.dup.each do |name, association_options|
        next unless object

        association_value = send(name)

        serializer_class = ActiveModel::Serializer.serializer_for(association_value, association_options)

        serializer = serializer_class.new(
          association_value,
          options.merge(serializer_from_options(association_options))
        ) if serializer_class

        if block_given?
          block.call(name, serializer, association_options[:association_options])
        end
      end
    end

    def serializer_from_options(options)
      opts = {}
      serializer = options.fetch(:association_options, {}).fetch(:serializer, nil)
      opts[:serializer] = serializer if serializer
      opts
    end

    def self.serializers_cache
      @serializers_cache ||= ThreadSafe::Cache.new
    end

    private

    attr_reader :options

    def self.get_serializer_for(klass)
      serializers_cache.fetch_or_store(klass) do
        serializer_class_name = "#{klass.name}Serializer"
        serializer_class = serializer_class_name.safe_constantize

        if serializer_class
          serializer_class
        elsif klass.superclass
          get_serializer_for(klass.superclass)
        end
      end
    end

  end
end


text:
<?php
namespace Slime\Route;

use Slime\Container\Container;
use Slime\Container\ContainerObject;
use Slime\Http\ServerRequest;
use Slime\Http\ServerResponse;
use SlimeInterface\Route\RouteInterface;
use SlimeInterface\Route\RouterInterface;

/**
 * Class Route
 *
 * @package Slime
 *
 * @method ServerRequest _getRequest() _getRequest()
 * @method ServerResponse _getResponse() _getResponse()
 * @method Container _getContainer() _getContainer()
 */
class Route extends ContainerObject implements RouteInterface
{
    /** @var RouterInterface[] */
    protected $aRouter;

    public function addRouter(RouterInterface $Router)
    {
        $this->aRouter[] = $Router;
    }

    public function run()
    {
        $bHit = false;
        foreach ($this->aRouter as $Router) {
            if ($Router->run($bHit) === false) {
                break;
            }
        }
    }
}


text:
from __future__ import print_function
import logging
import psutil
import sys

def init_logger():
    logger = logging.getLogger(__name__)
    logger.setLevel(logging.DEBUG)
    handler = logging.StreamHandler(sys.stderr)
    formatter = logging.Formatter(
        '[DeadlockReporter] %(message)s')
    handler.setFormatter(formatter)
    handler.setLevel(logging.DEBUG)
    logger.addHandler(handler)
    return logger

LOG = init_logger()

class ProcessUtil:
    @classmethod
    def stringify(cls, p, verbose=False):
        assert isinstance(p, psutil.Process)
        cmdline = ' '.join(p.cmdline())
        lim = 32
        if len(cmdline) > lim and not verbose:
            cmdline = cmdline[0:lim] + '..'
        return '%s[pid=%d, exe=%s, cmdline=%s]' % (p.name(), p.pid, p.exe(), cmdline)

    @classmethod
    def dump_tree(cls, p, fn=lambda x: print(x)):
        assert isinstance(p, psutil.Process)
        fn('Process %s' % cls.stringify(p))
        for c in p.children(recursive=True):
            fn('Descendant Process %s' % cls.stringify(c))

    @classmethod
    def kill_tree(cls, p):
        assert isinstance(p, psutil.Process)
        assert isinstance(p, psutil.Process)
        LOG.info('Killing %s', cls.stringify(p))
        for c in p.children(recursive=True):
            LOG.info('Killing %s', cls.stringify(c))
            c.kill()
        p.kill()

class DeadlockReporter(object):
    def __init__(self, command, timeout, kill_on_timeout=False):
        assert isinstance(command, list)
        assert isinstance(timeout, int)
        assert isinstance(kill_on_timeout, bool)
        self.command = command
        self.timeout = timeout
        self.kill_on_timeout = kill_on_timeout
        self._stack_dumpers = {}

    def register_stack_dumper(self,
                              matcher=lambda p: False,
                              dumper=lambda p: print(p)):
        self._stack_dumpers[matcher] = dumper

    def _try_stack_dumpers(self, p):
        for matcher, dumper in self._stack_dumpers.items():
            matched = matcher(p)
            if matched:
                LOG.info('Stack dump for %s available:',
                         ProcessUtil.stringify(p))
                dumper(p)

    def _on_timeout(self, p, e):
        assert isinstance(p, psutil.Process)
        assert isinstance(e, psutil.TimeoutExpired)

        LOG.info('Timed out (%d seconds)', e.seconds)

        self._try_stack_dumpers(p)
        for c in p.children(recursive=True):
            self._try_stack_dumpers(c)

        if self.kill_on_timeout:
            LOG.info('Killing the process')
            ProcessUtil.kill_tree(p)
            sys.exit(1)
        else:
            p.wait()

    def run(self):
        LOG.info('Starting `%s`, timeout=%d seconds',
                 ' '.join(self.command), self.timeout)
        p = psutil.Popen(self.command,
                         stdin=sys.stdin,
                         stdout=sys.stdout,
                         stderr=sys.stderr)
        try:
            p.wait(self.timeout)
        except psutil.TimeoutExpired as te:
            self._on_timeout(p, te)

    def register_known_stack_dumpers(self):

        def java_matcher(p):
            assert isinstance(p, psutil.Process)
            return p.name() == 'java'

        def java_dumper(p):
            assert isinstance(p, psutil.Process)
            jstack = psutil.Popen(['jstack', str(p.pid)],
                                  stdout=sys.stdout,
                                  stderr=sys.stderr)
            jstack.wait()

        self.register_stack_dumper(java_matcher, java_dumper)


text:
@implementation NSURL (YMQueryParameters)

- (NSDictionary *)ym_queryParameters
{
    NSMutableDictionary *queryDict = [[NSMutableDictionary alloc] init];

    NSArray *params = [self.query componentsSeparatedByString:@"&"];
    for (NSString *param in params) {
        NSArray *paramParts = [param componentsSeparatedByString:@"="];

        if (paramParts.count == 2) {
            NSString *paramName = [self ym_stringByDecodingURLFormat: [paramParts objectAtIndex:0]];
            NSString *paramValue = [self ym_stringByDecodingURLFormat: [paramParts objectAtIndex:1]];
            [queryDict setValue:paramValue forKey:paramName];
        }
    }

    return queryDict;
}

- (NSString *)ym_stringByDecodingURLFormat:(NSString *)urlPart
{
    NSString *result = [urlPart stringByReplacingOccurrencesOfString:@"+" withString:@" "];
    result = [result stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
    return result;
}

@end


text:
import {MDCMenuSurfaceAdapter} from './adapter.js';
import {Corner, CornerBit, cssClasses, numbers, strings} from './constants.js';
import {MDCMenuDimensions, MDCMenuDistance, MDCMenuPoint} from './types.js';

interface AutoLayoutMeasurements {
  anchorSize: MDCMenuDimensions;
  bodySize: MDCMenuDimensions;
  surfaceSize: MDCMenuDimensions;
  viewportDistance: MDCMenuDistance;
  viewportSize: MDCMenuDimensions;
  windowScroll: MDCMenuPoint;
}

export class MDCMenuSurfaceFoundation {
  static get cssClasses() {
    return cssClasses;
  }

  static get strings() {
    return strings;
  }

  static get numbers() {
    return numbers;
  }

  static get Corner() {
    return Corner;
  }

  /**
   * @see {@link MDCMenuSurfaceAdapter} for typing information on parameters and return types.
   */
  static get defaultAdapter(): MDCMenuSurfaceAdapter {
    // tslint:disable:object-literal-sort-keys Methods should be in the same order as the adapter interface.
    return {
      addClass: () => undefined,
      removeClass: () => undefined,
      hasClass: () => false,
      hasAnchor: () => false,

      isElementInContainer: () => false,
      isFocused: () => false,
      isRtl: () => false,

      getInnerDimensions: () => ({height: 0, width: 0}),
      getAnchorDimensions: () => null,
      getWindowDimensions: () => ({height: 0, width: 0}),
      getBodyDimensions: () => ({height: 0, width: 0}),
      getWindowScroll: () => ({x: 0, y: 0}),
      setPosition: () => undefined,
      setMaxHeight: () => undefined,
      setTransformOrigin: () => undefined,

      saveFocus: () => undefined,
      restoreFocus: () => undefined,

      notifyClose: () => undefined,
      notifyClosing: () => undefined,
      notifyOpen: () => undefined,
      notifyOpening: () => undefined,
    };
    // tslint:enable:object-literal-sort-keys
  }

  private readonly adapter: MDCMenuSurfaceAdapter;
  private isSurfaceOpen = false;
  private isQuickOpen = false;
  private isHoistedElement = false;
  private isFixedPosition = false;
  private isHorizontallyCenteredOnViewport = false;

  private maxHeight = 0;
  private openBottomBias = 0;

  private openAnimationEndTimerId = 0;
  private closeAnimationEndTimerId = 0;
  private animationRequestId = 0;

  private anchorCorner: Corner = Corner.TOP_START;

  /**
   * Corner of the menu surface to which menu surface is attached to anchor.
   *
   *  Anchor corner --->+----------+
   *                    |  ANCHOR  |
   *                    +----------+
   *  Origin corner --->+--------------+
   *                    |              |
   *                    |              |
   *                    | MENU SURFACE |
   *                    |              |
   *                    |              |
   *                    +--------------+
   */
  private originCorner: Corner = Corner.TOP_START;
  private readonly anchorMargin:
      MDCMenuDistance = {top: 0, right: 0, bottom: 0, left: 0};
  private readonly position: MDCMenuPoint = {x: 0, y: 0};

  private dimensions!: MDCMenuDimensions;         // assigned in open()
  private measurements!: AutoLayoutMeasurements;  // assigned in open()

  constructor(adapter: Partial<MDCMenuSurfaceAdapter>) {
    this.adapter = {...MDCMenuSurfaceFoundation.defaultAdapter, ...adapter};
  }

  init() {
    const {ROOT, OPEN} = MDCMenuSurfaceFoundation.cssClasses;

    if (!this.adapter.hasClass(ROOT)) {
      throw new Error(`${ROOT} class required in root element.`);
    }

    if (this.adapter.hasClass(OPEN)) {
      this.isSurfaceOpen = true;
    }
  }

  destroy() {
    clearTimeout(this.openAnimationEndTimerId);
    clearTimeout(this.closeAnimationEndTimerId);
    // Cancel any currently running animations.
    cancelAnimationFrame(this.animationRequestId);
  }

  /**
   * @param corner Default anchor corner alignment of top-left menu surface
   *     corner.
   */
  setAnchorCorner(corner: Corner) {
    this.anchorCorner = corner;
  }

  /**
   * Flips menu corner horizontally.
   */
  flipCornerHorizontally() {
    this.originCorner = this.originCorner ^ CornerBit.RIGHT;
  }

  /**
   * @param margin Set of margin values from anchor.
   */
  setAnchorMargin(margin: Partial<MDCMenuDistance>) {
    this.anchorMargin.top = margin.top || 0;
    this.anchorMargin.right = margin.right || 0;
    this.anchorMargin.bottom = margin.bottom || 0;
    this.anchorMargin.left = margin.left || 0;
  }

  /** Used to indicate if the menu-surface is hoisted to the body. */
  setIsHoisted(isHoisted: boolean) {
    this.isHoistedElement = isHoisted;
  }

  /**
   * Used to set the menu-surface calculations based on a fixed position menu.
   */
  setFixedPosition(isFixedPosition: boolean) {
    this.isFixedPosition = isFixedPosition;
  }

  /**
   * @return Returns true if menu is in fixed (`position: fixed`) position.
   */
  isFixed() {
    return this.isFixedPosition;
  }

  /** Sets the menu-surface position on the page. */
  setAbsolutePosition(x: number, y: number) {
    this.position.x = this.isFinite(x) ? x : 0;
    this.position.y = this.isFinite(y) ? y : 0;
  }

  /** Sets whether menu-surface should be horizontally centered to viewport. */
  setIsHorizontallyCenteredOnViewport(isCentered: boolean) {
    this.isHorizontallyCenteredOnViewport = isCentered;
  }

  setQuickOpen(quickOpen: boolean) {
    this.isQuickOpen = quickOpen;
  }

  /**
   * Sets maximum menu-surface height on open.
   * @param maxHeight The desired max-height. Set to 0 (default) to
   *     automatically calculate max height based on available viewport space.
   */
  setMaxHeight(maxHeight: number) {
    this.maxHeight = maxHeight;
  }

  /**
   * Set to a positive integer to influence the menu to preferentially open
   * below the anchor instead of above.
   * @param bias A value of `x` simulates an extra `x` pixels of available space
   *     below the menu during positioning calculations.
   */
  setOpenBottomBias(bias: number) {
    this.openBottomBias = bias;
  }

  isOpen() {
    return this.isSurfaceOpen;
  }

  /**
   * Open the menu surface.
   */
  open() {
    if (this.isSurfaceOpen) {
      return;
    }

    this.adapter.notifyOpening();
    this.adapter.saveFocus();

    if (this.isQuickOpen) {
      this.isSurfaceOpen = true;
      this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
      this.dimensions = this.adapter.getInnerDimensions();
      this.autoposition();
      this.adapter.notifyOpen();
    } else {
      this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
      this.animationRequestId = requestAnimationFrame(() => {
        this.dimensions = this.adapter.getInnerDimensions();
        this.autoposition();
        this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
        this.openAnimationEndTimerId = setTimeout(() => {
          this.openAnimationEndTimerId = 0;
          this.adapter.removeClass(
              MDCMenuSurfaceFoundation.cssClasses.ANIMATING_OPEN);
          this.adapter.notifyOpen();
        }, numbers.TRANSITION_OPEN_DURATION);
      });

      this.isSurfaceOpen = true;
    }
  }

  /**
   * Closes the menu surface.
   */
  close(skipRestoreFocus = false) {
    if (!this.isSurfaceOpen) {
      return;
    }

    this.adapter.notifyClosing();

    if (this.isQuickOpen) {
      this.isSurfaceOpen = false;
      if (!skipRestoreFocus) {
        this.maybeRestoreFocus();
      }

      this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
      this.adapter.removeClass(
          MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);
      this.adapter.notifyClose();

      return;
    }

    this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
    requestAnimationFrame(() => {
      this.adapter.removeClass(MDCMenuSurfaceFoundation.cssClasses.OPEN);
      this.adapter.removeClass(
          MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);
      this.closeAnimationEndTimerId = setTimeout(() => {
        this.closeAnimationEndTimerId = 0;
        this.adapter.removeClass(
            MDCMenuSurfaceFoundation.cssClasses.ANIMATING_CLOSED);
        this.adapter.notifyClose();
      }, numbers.TRANSITION_CLOSE_DURATION);
    });

    this.isSurfaceOpen = false;
    if (!skipRestoreFocus) {
      this.maybeRestoreFocus();
    }
  }

  /** Handle clicks and close if not within menu-surface element. */
  handleBodyClick(evt: MouseEvent) {
    const el = evt.target as Element;
    if (this.adapter.isElementInContainer(el)) {
      return;
    }
    this.close();
  }

  /** Handle keys that close the surface. */
  handleKeydown(evt: KeyboardEvent) {
    const {keyCode, key} = evt;

    const isEscape = key === 'Escape' || keyCode === 27;
    if (isEscape) {
      this.close();
    }
  }

  private autoposition() {
    // Compute measurements for autoposition methods reuse.
    this.measurements = this.getAutoLayoutmeasurements();

    const corner = this.getOriginCorner();
    const maxMenuSurfaceHeight = this.getMenuSurfaceMaxHeight(corner);
    const verticalAlignment =
        this.hasBit(corner, CornerBit.BOTTOM) ? 'bottom' : 'top';
    let horizontalAlignment =
        this.hasBit(corner, CornerBit.RIGHT) ? 'right' : 'left';
    const horizontalOffset = this.getHorizontalOriginOffset(corner);
    const verticalOffset = this.getVerticalOriginOffset(corner);
    const {anchorSize, surfaceSize} = this.measurements;

    const position: Partial<MDCMenuDistance> = {
      [horizontalAlignment]: horizontalOffset,
      [verticalAlignment]: verticalOffset,
    };

    // Center align when anchor width is comparable or greater than menu
    // surface, otherwise keep corner.
    if (anchorSize.width / surfaceSize.width >
        numbers.ANCHOR_TO_MENU_SURFACE_WIDTH_RATIO) {
      horizontalAlignment = 'center';
    }

    // If the menu-surface has been hoisted to the body, it's no longer relative
    // to the anchor element
    if (this.isHoistedElement || this.isFixedPosition) {
      this.adjustPositionForHoistedElement(position);
    }

    this.adapter.setTransformOrigin(
        `${horizontalAlignment} ${verticalAlignment}`);
    this.adapter.setPosition(position);
    this.adapter.setMaxHeight(
        maxMenuSurfaceHeight ? maxMenuSurfaceHeight + 'px' : '');

    // If it is opened from the top then add is-open-below class
    if (!this.hasBit(corner, CornerBit.BOTTOM)) {
      this.adapter.addClass(MDCMenuSurfaceFoundation.cssClasses.IS_OPEN_BELOW);
    }
  }

  /**
   * @return Measurements used to position menu surface popup.
   */
  private getAutoLayoutmeasurements(): AutoLayoutMeasurements {
    let anchorRect = this.adapter.getAnchorDimensions();
    const bodySize = this.adapter.getBodyDimensions();
    const viewportSize = this.adapter.getWindowDimensions();
    const windowScroll = this.adapter.getWindowScroll();

    if (!anchorRect) {
      // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together
      anchorRect = {
        top: this.position.y,
        right: this.position.x,
        bottom: this.position.y,
        left: this.position.x,
        width: 0,
        height: 0,
      } as any;
      // tslint:enable:object-literal-sort-keys
    }

    return {
      anchorSize: anchorRect!,
      bodySize,
      surfaceSize: this.dimensions,
      viewportDistance: {
        // tslint:disable:object-literal-sort-keys Positional properties are more readable when they're grouped together
        top: anchorRect!.top,
        right: viewportSize.width - anchorRect!.right,
        bottom: viewportSize.height - anchorRect!.bottom,
        left: anchorRect!.left,
        // tslint:enable:object-literal-sort-keys
      },
      viewportSize,
      windowScroll,
    };
  }

  /**
   * Computes the corner of the anchor from which to animate and position the
   * menu surface.
   *
   * Only LEFT or RIGHT bit is used to position the menu surface ignoring RTL
   * context. E.g., menu surface will be positioned from right side on TOP_END.
   */
  private getOriginCorner(): Corner {
    let corner = this.originCorner;

    const {viewportDistance, anchorSize, surfaceSize} = this.measurements;
    const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;

    const isAnchoredToBottom = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);

    let availableTop;
    let availableBottom;
    if (isAnchoredToBottom) {
      availableTop =
          viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.bottom;
      availableBottom =
          viewportDistance.bottom - MARGIN_TO_EDGE - this.anchorMargin.bottom;
    } else {
      availableTop =
          viewportDistance.top - MARGIN_TO_EDGE + this.anchorMargin.top;
      availableBottom = viewportDistance.bottom - MARGIN_TO_EDGE +
          anchorSize.height - this.anchorMargin.top;
    }

    const isAvailableBottom = availableBottom - surfaceSize.height > 0;
    if (!isAvailableBottom &&
        availableTop > availableBottom + this.openBottomBias) {
      // Attach bottom side of surface to the anchor.
      corner = this.setBit(corner, CornerBit.BOTTOM);
    }

    const isRtl = this.adapter.isRtl();
    const isFlipRtl = this.hasBit(this.anchorCorner, CornerBit.FLIP_RTL);
    const hasRightBit = this.hasBit(this.anchorCorner, CornerBit.RIGHT) ||
        this.hasBit(corner, CornerBit.RIGHT);

    // Whether surface attached to right side of anchor element.
    let isAnchoredToRight = false;

    // Anchored to start
    if (isRtl && isFlipRtl) {
      isAnchoredToRight = !hasRightBit;
    } else {
      // Anchored to right
      isAnchoredToRight = hasRightBit;
    }

    let availableLeft;
    let availableRight;
    if (isAnchoredToRight) {
      availableLeft =
          viewportDistance.left + anchorSize.width + this.anchorMargin.right;
      availableRight = viewportDistance.right - this.anchorMargin.right;
    } else {
      availableLeft = viewportDistance.left + this.anchorMargin.left;
      availableRight =
          viewportDistance.right + anchorSize.width - this.anchorMargin.left;
    }

    const isAvailableLeft = availableLeft - surfaceSize.width > 0;
    const isAvailableRight = availableRight - surfaceSize.width > 0;
    const isOriginCornerAlignedToEnd =
        this.hasBit(corner, CornerBit.FLIP_RTL) &&
        this.hasBit(corner, CornerBit.RIGHT);

    if (isAvailableRight && isOriginCornerAlignedToEnd && isRtl ||
        !isAvailableLeft && isOriginCornerAlignedToEnd) {
      // Attach left side of surface to the anchor.
      corner = this.unsetBit(corner, CornerBit.RIGHT);
    } else if (
        isAvailableLeft && isAnchoredToRight && isRtl ||
        (isAvailableLeft && !isAnchoredToRight && hasRightBit) ||
        (!isAvailableRight && availableLeft >= availableRight)) {
      // Attach right side of surface to the anchor.
      corner = this.setBit(corner, CornerBit.RIGHT);
    }

    return corner;
  }

  /**
   * @param corner Origin corner of the menu surface.
   * @return Maximum height of the menu surface, based on available space. 0
   *     indicates should not be set.
   */
  private getMenuSurfaceMaxHeight(corner: Corner): number {
    if (this.maxHeight > 0) {
      return this.maxHeight;
    }

    const {viewportDistance} = this.measurements;

    let maxHeight = 0;
    const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);
    const isBottomAnchored = this.hasBit(this.anchorCorner, CornerBit.BOTTOM);
    const {MARGIN_TO_EDGE} = MDCMenuSurfaceFoundation.numbers;

    // When maximum height is not specified, it is handled from CSS.
    if (isBottomAligned) {
      maxHeight = viewportDistance.top + this.anchorMargin.top - MARGIN_TO_EDGE;
      if (!isBottomAnchored) {
        maxHeight += this.measurements.anchorSize.height;
      }
    } else {
      maxHeight = viewportDistance.bottom - this.anchorMargin.bottom +
          this.measurements.anchorSize.height - MARGIN_TO_EDGE;
      if (isBottomAnchored) {
        maxHeight -= this.measurements.anchorSize.height;
      }
    }

    return maxHeight;
  }

  /**
   * @param corner Origin corner of the menu surface.
   * @return Horizontal offset of menu surface origin corner from corresponding
   *     anchor corner.
   */
  private getHorizontalOriginOffset(corner: Corner): number {
    const {anchorSize} = this.measurements;

    // isRightAligned corresponds to using the 'right' property on the surface.
    const isRightAligned = this.hasBit(corner, CornerBit.RIGHT);
    const avoidHorizontalOverlap =
        this.hasBit(this.anchorCorner, CornerBit.RIGHT);

    if (isRightAligned) {
      const rightOffset = avoidHorizontalOverlap ?
          anchorSize.width - this.anchorMargin.left :
          this.anchorMargin.right;

      // For hoisted or fixed elements, adjust the offset by the difference
      // between viewport width and body width so when we calculate the right
      // value (`adjustPositionForHoistedElement`) based on the element
      // position, the right property is correct.
      if (this.isHoistedElement || this.isFixedPosition) {
        return rightOffset -
            (this.measurements.viewportSize.width -
             this.measurements.bodySize.width);
      }

      return rightOffset;
    }

    return avoidHorizontalOverlap ? anchorSize.width - this.anchorMargin.right :
                                    this.anchorMargin.left;
  }

  /**
   * @param corner Origin corner of the menu surface.
   * @return Vertical offset of menu surface origin corner from corresponding
   *     anchor corner.
   */
  private getVerticalOriginOffset(corner: Corner): number {
    const {anchorSize} = this.measurements;
    const isBottomAligned = this.hasBit(corner, CornerBit.BOTTOM);
    const avoidVerticalOverlap =
        this.hasBit(this.anchorCorner, CornerBit.BOTTOM);

    let y = 0;
    if (isBottomAligned) {
      y = avoidVerticalOverlap ? anchorSize.height - this.anchorMargin.top :
                                 -this.anchorMargin.bottom;
    } else {
      y = avoidVerticalOverlap ?
          (anchorSize.height + this.anchorMargin.bottom) :
          this.anchorMargin.top;
    }
    return y;
  }

  /**
   * Calculates the offsets for positioning the menu-surface when the
   * menu-surface has been hoisted to the body.
   */
  private adjustPositionForHoistedElement(position: Partial<MDCMenuDistance>) {
    const {windowScroll, viewportDistance, surfaceSize, viewportSize} =
        this.measurements;

    const props =
        Object.keys(position) as Array<keyof Partial<MDCMenuDistance>>;

    for (const prop of props) {
      let value = position[prop] || 0;

      if (this.isHorizontallyCenteredOnViewport &&
          (prop === 'left' || prop === 'right')) {
        position[prop] = (viewportSize.width - surfaceSize.width) / 2;
        continue;
      }

      // Hoisted surfaces need to have the anchor elements location on the page
      // added to the position properties for proper alignment on the body.
      value += viewportDistance[prop];

      // Surfaces that are absolutely positioned need to have additional
      // calculations for scroll and bottom positioning.
      if (!this.isFixedPosition) {
        if (prop === 'top') {
          value += windowScroll.y;
        } else if (prop === 'bottom') {
          value -= windowScroll.y;
        } else if (prop === 'left') {
          value += windowScroll.x;
        } else {  // prop === 'right'
          value -= windowScroll.x;
        }
      }

      position[prop] = value;
    }
  }

  /**
   * The last focused element when the menu surface was opened should regain
   * focus, if the user is focused on or within the menu surface when it is
   * closed.
   */
  private maybeRestoreFocus() {
    const isRootFocused = this.adapter.isFocused();
    const ownerDocument = this.adapter.getOwnerDocument ?
        this.adapter.getOwnerDocument() :
        document;
    const childHasFocus = ownerDocument.activeElement &&
        this.adapter.isElementInContainer(ownerDocument.activeElement);
    if (isRootFocused || childHasFocus) {
      // Wait before restoring focus when closing the menu surface. This is
      // important because if a touch event triggered the menu close, and the
      // subsequent mouse event occurs after focus is restored, then the
      // restored focus would be lost.
      setTimeout(() => {
        this.adapter.restoreFocus();
      }, numbers.TOUCH_EVENT_WAIT_MS);
    }
  }

  private hasBit(corner: Corner, bit: CornerBit): boolean {
    return Boolean(corner & bit);  // tslint:disable-line:no-bitwise
  }

  private setBit(corner: Corner, bit: CornerBit): Corner {
    return corner | bit;  // tslint:disable-line:no-bitwise
  }

  private unsetBit(corner: Corner, bit: CornerBit): Corner {
    return corner ^ bit;
  }

  /**
   * isFinite that doesn't force conversion to number type.
   * Equivalent to Number.isFinite in ES2015, which is not supported in IE.
   */
  private isFinite(num: number): boolean {
    return typeof num === 'number' && isFinite(num);
  }
}


text:
(function (nock, chai, Promise) {
    'use strict';

    var expect = chai.expect;
    chai.use(require('chai-as-promised'));
    chai.use(require('dirty-chai'));
    chai.config.includeStack = true;

    // Disable outgoing connections to non-mocked endpoints.
    nock.disableNetConnect();

    //Setup mock for the Codacy API endpoint.
    function setupMockEndpoint(token, commitId, bodyValidator, statusCode) {
        return new Promise(function (resolve) {
            expect(token).to.be.ok();
            expect(commitId).to.be.ok();
            expect(bodyValidator).to.be.ok();

            return resolve(nock('https://api.codacy.com')
                .post('/2.0/coverage/' + commitId + '/javascript', function (body) {
                    var result = bodyValidator.validate(body);

                    return !result.error;
                })
                .reply(statusCode || 200));
        });
    }

    function setupLangMockEndpoint(token, commitId, bodyValidator, language) {
        return new Promise(function (resolve) {
            expect(token).to.be.ok();
            expect(commitId).to.be.ok();
            expect(bodyValidator).to.be.ok();

            return resolve(nock('https://api.codacy.com')
                .post('/2.0/coverage/' + commitId + '/' + language, function (body) {

                    console.error('<BODY>');
                    console.error(body);
                    console.error('</BODY>');

                    var result = bodyValidator.validate(body);
                    return !(result.error);
                }).reply(200));
        });
    }

    function setupMockAccountApiEndpoint(apiToken, commitId, username, projectName, bodyValidator) {
        return new Promise(function (resolve) {
            expect(apiToken).to.be.ok();
            expect(commitId).to.be.ok();
            expect(username).to.be.ok();
            expect(projectName).to.be.ok();
            expect(bodyValidator).to.be.ok();
            return resolve(nock('https://api.codacy.com')
                .post('/2.0/' + username + '/' + projectName + '/commit/' + commitId + '/coverage' + '/javascript', function(body) {
                    var result = bodyValidator.validate(body);
                    return !result.error;
                }).reply(200));
        });
    }

    module.exports = {
        setupMockEndpoint: setupMockEndpoint,
        setupLangMockEndpoint: setupLangMockEndpoint,
        setupMockAccountApiEndpoint: setupMockAccountApiEndpoint,
        chai: chai,
        clearEnvironmentVariables: function () {
            process.env.CODACY_GIT_COMMIT = '';
            process.env.TRAVIS_COMMIT = '';
            process.env.DRONE_COMMIT = '';
            process.env.GIT_COMMIT = '';
            process.env.CIRCLE_SHA1 = '';
            process.env.CI_COMMIT_ID = '';
            process.env.WERCKER_GIT_COMMIT = '';
            process.env.BUILDKITE_COMMIT = '';
        }
    };
}(require('nock'), require('chai'), require('bluebird')));


text:
body {
  background-color: #eaeaea;
}

#page .closed {
  display: none;
}

.bold {
  font-weight: bold;
}

.italic {
  font-style: italic;
}

.underline {
  text-decoration: underline;
}

.emphasis {
  font-weight: bold;
  font-style: italic;
}

.divider-20 {
  margin-top: 10px;
  margin-bottom: 10px;
}

a {
  cursor: pointer;
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.spinner {
  background-image: url("../images/spinner_16.gif");
  background-position: top left;
  background-repeat: no-repeat;
  padding-left: 20px;
}

.btn-focus {
  color: #2da0db;
  text-shadow: 0px 1px 0px white;
}
.btn-focus:hover {
  color: #2da0db;
}
.btn-focus[disabled]:hover {
  color: rgb(51, 51, 51);
}

.btn-hover {
  visibility: hidden;
}

.btn-clear {
  padding: 5px 0px 5px 0px;
  width: 100%;
}

.btn-filter {
  padding: 5px 0px 5px 0px;
  margin-bottom: 8px;
  width: 100%;
}

input.filter-date {
  cursor: pointer;
  background-color: white;
}

.sp4n-label {
  text-shadow: 0px 1px 0px white;
  padding: 4px 12px;
  line-height: 20px;
  display: inline;
}

.filter-label {
  cursor: default;
}

.overlord-tabs {
  margin-bottom: 0px;
}
.tab-content {
  padding-top: 15px;
  background-color: white;
  border-left: 1px solid rgb(221, 221, 221);
  border-right: 1px solid rgb(221, 221, 221);
  border-bottom: 1px solid rgb(221, 221, 221);
}

.growl-dialog {
  position: fixed;
  z-index: 1000;
  width: 400px;
  background-color: white;
  border: 1px solid rgba(0, 0, 0, 0.4);
  border-radius: 4px 4px 2px 2px;
  outline: 0px none;
  box-shadow: 0px 3px 7px rgba(0, 0, 0, 0.4);
  background-clip: padding-box;
}
.growl-dialog-error {
  color: #d00000;
}
.growl-dialog-hover {
  background-color: #fefefe;
  border: 1px solid rgba(0, 0, 0, 0.6);
  box-shadow: 0px 3px 7px rgba(0, 0, 0, 0.5);
}
.growl-dialog-header {
  padding: 3px 8px;
  background-color: rgb(245, 245, 245);
  background-image: url("../images/modal-header-bg.png");
  background-position: bottom left;
  background-repeat: repeat-x;
  border-radius: 6px 6px 0px 0px;
  border-bottom: 1px solid rgb(223, 223, 223);
}
.growl-dialog-header-title {
  font-size: 13px;
  font-weight: bold;
}
.growl-dialog-body {
  position: relative;
  max-height: 200px;
  padding: 8px;
  overflow-y: auto;
  line-height: normal;
  font-size: 12px;
}

.input-name {
  width: 95%;
}
.input-value {
  width: 95%;
}

.hero-unit {
  background-color: transparent;
  border-bottom: 1px solid rgb(187, 187, 187);
  border-radius: 0px;
}

.breadcrumb {
  border: 1px solid rgb(211, 211, 211);
  background-image: url("../images/gradient-bg.png");
  background-position: bottom left;
  background-repeat: repeat-x;
}

.breadcrumb .active {
  font-weight: bold;
}

.table-striped tbody tr:nth-child(2n) td, .table-striped tbody tr:nth-child(2n) th {
  background-color: white;
}

.tooltip-inner {
  background-color: #666;
  color: #fafafa;
  text-shadow: 0px 1px 0px black;
}

.tooltip.in {
  opacity: 1.0;
}

.tooltip.top .tooltip-arrow {
  border-top-color: #666;
}
.tooltip.right .tooltip-arrow {
  border-right-color: #666;
}
.tooltip.left .tooltip-arrow {
  border-left-color: #666;
}
.tooltip.bottom .tooltip-arrow {
  border-bottom-color: #666;
}

footer {
  color: #666;
  text-shadow: 0px 1px 0px white;
  margin-bottom: 10px;
}

footer p {
  margin: 0px;
  padding: 0px;
}

footer hr {
  border-bottom: 1px solid #bbb;
}

.situation-details .nav-tabs {
  border-left: 1px solid rgb(221, 221, 221);
  border-right: 1px solid rgb(221, 221, 221);
}
.situation-details .nav-tabs li a {
  color: #666;
  border-radius: 0px;
  border-top: 0px;
  border-left: 0px;
  border-right: 1px solid rgb(221, 221, 221);
  border-bottom: 1px solid rgb(221, 221, 221);
  margin-right: 0px;
  background-color: rgb(234, 234, 234);
}
.situation-details .nav-tabs li a:hover {
  border-right: 1px solid rgb(221, 221, 221);
  background-color: rgb(234, 234, 234);
  color: #007ca3;
}
.situation-details .nav-tabs li.active a, .situation-details .nav-tabs li.active a:hover, .situation-details .nav-tabs li.active a:focus {
  border-top: 0px;
  border-left: 0px;
  border-right: 1px solid rgb(221, 221, 221);
  background-color: white;
}
.situation-details .nav-tabs li.active a {
  border-bottom: 1px solid white;
}

.source-editor-wrapper {
  background-color: #fff8f8;
  position: relative;
  height: 350px;
  border: 1px solid rgb(221, 221, 221);
  margin-bottom: 15px;
}

.source-editor {
  left: 0px;
  top: 0px;
  bottom: 1px;
  right: 1px;
  background: white;
}

.situation-details #details {
  padding-bottom: 20px;
}

.situation-details #message {
  padding-bottom: 15px;
}
.situation-details #message .message-meta-data-section-header {
  float: none;
  margin-top: 15px;
  padding-bottom: 15px;
}
.situation-details #message .message-meta-data-section-value {
  border: 1px solid rgb(221, 221, 221);
  margin-top: 10px;
  padding: 8px;
  width: 90%;
}

.modal-header {
  padding: 1px 15px;
  background-color: #f5f5f5;
  background-image: url("../images/modal-header-bg.png");
  background-position: bottom left;
  background-repeat: repeat-x;
  border-radius: 6px 6px 0px 0px;
  border-bottom: 1px solid #dfdfdf;
}
.modal-header h4 {
  font-size: 110%;
  text-shadow: 0px 1px 0px white;
}
.modal-header .close {
  margin-top: 10px;
}

.filter-sidebar {
  border: 1px solid rgb(211, 211, 211);
}

.filter-inner {
  padding: 9px 15px 0px;
}

.filter-header {
  text-indent: 15px;
  background-color: rgb(31, 151, 216);
}
.filter-header a {
  padding-top: 5px;
  color: white;
  margin-top: 3px;
  margin-bottom: 3px;
}
.filter-header span.caret {
  color: white;
  margin-top: 8px;
  margin-right: 8px;
  border-top: 4px solid white;
}

.action-sidebar {
  border: 1px solid rgb(211, 211, 211);
}

.action-inner {
  padding: 9px 15px 0px;
}

.action-header {
  text-indent: 15px;
  background-color: rgb(31, 151, 216);
}
.action-header a {
  padding-top: 5px;
  color: white;
  margin-top: 3px;
  margin-bottom: 3px;
}
.action-header span.caret {
  color: white;
  margin-top: 8px;
  margin-right: 8px;
  border-top: 4px solid white;
}

.services {
  padding: 0px;
}

.overlord-actions {
  border: 1px solid rgb(211, 211, 211);
  border-top-left-radius: 5px;
  border-top-right-radius: 5px;
  background-image: url("../images/gradient-bg.png");
  background-position: left bottom;
  background-repeat: repeat-x;
  background-color: rgb(242, 242, 242);
  padding: 10px;
}
.overlord-details-actions {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 0px;
  padding-right: 0px;
}

.overlord-none, .overlord-searching {
  float: left;
  width: 100%;
  background-color: white;
  border-left: 1px solid rgb(211, 211, 211);
  border-right: 1px solid rgb(211, 211, 211);
  border-bottom: 1px solid rgb(211, 211, 211);
  margin-bottom: 20px;
}
.overlord-searching span {
  padding-top: 10px;
  padding-bottom: 10px;
  padding-left: 36px;
  float: left;
  background-position: 16px 11px;
}
.overlord-none span {
  padding: 10px;
  float: left;
  font-style: italic;
}

.overlord-table {
  border-left: 1px solid rgb(211, 211, 211);
  border-right: 1px solid rgb(211, 211, 211);
  border-bottom: 1px solid rgb(211, 211, 211);
}
.overlord-standalone-table {
  border-top: 1px solid rgb(211, 211, 211);
}

.overlord-table thead th, .overlord-table tbody td {
  border-left: 1px solid rgb(211, 211, 211);
}
.overlord-table thead th {
  background-color: white;
}
.overlord-standalone-table thead th {
  background-color: rgb(31, 151, 216);
  color: white;
  text-shadow: 1px 1px 3px #444;
}

.sortable-column-header {
  color: rgb(0, 85, 128);
}
.sortable-column-icon {
  font-size: 8px;
  color: rgb(0, 85, 128);
}

.details-icon {
  margin-left: 10px;
  margin-top: 5px;
  float: left;
}

.details-title {
  font-weight: bold;
  font-size: 16px;
  text-shadow: 1px 1px 2px rgb(170, 170, 170);
  padding-right: 15px;
}

.details-meta-data-section {
  margin-top: 15px;
}

.details-meta-data-section .btn {
  margin-top: 5px;
}

.details-meta-data-section-header {
  font-weight: bold;
  float: left;
}

.details-meta-data-section-label {
  white-space: nowrap;
  min-width: 130px;
  float: left;
}

.details-meta-data-section-value {
  float: left;
}

.message-meta-data-section-header {
  font-weight: bold;
  float: left;
}

.message-meta-data-section-label {
  white-space: nowrap;
  min-width: 130px;
  float: left;
}

.text-error {
  color: #b94a48;
}

.message-meta-data-section-value {
  float: left;
}

.reference-details, .service-details {
  border-left: 1px solid rgb(211, 211, 211);
  border-bottom: 1px solid rgb(211, 211, 211);
  border-right: 1px solid rgb(211, 211, 211);
  background-color: white;
  padding-bottom: 15px;
}
.situation-details {
  background-color: white;
}

.situation-details .tab-content {
  padding-top: 0px;
}
.situation-details .nav-tabs {
  margin-bottom: 0px;
}

.controls-checkbox {
  margin-bottom: 5px;
}

.filter-checkbox span {
  padding-left: 5px;
}

.icon {
  width: 16px;
  height: 16px;
  background-position: top left;
}

.icon-download-fault {
  background-image: url("../images/icon-download-fault.png");
}
.icon-download-initial {
  background-image: url("../images/icon-download-initial.png");
}
.icon-retry {
  background-image: url("../images/icon-retry.png");
}
.icon-context {
  background-image: url("../images/icon-context.png");
}
.icon-properties {
  background-image: url("../images/icon-properties.png");
}

.icon-severity-low {
  background-image: url("../images/icon-warning-low.png");
}
.icon-severity-medium {
  background-image: url("../images/icon-warning-medium.png");
}
.icon-severity-high {
  background-image: url("../images/icon-warning-high.png");
}
.icon-severity-critical {
  background-image: url("../images/icon-warning-critical.png");
}

.table-actions {
  padding-left: 5px;
  padding-right: 5px;
}
.table-actions .icon {
  margin-left: 4px;
}

.sitwatch-notification {
  text-align: center;
  border-radius: 4px 4px 4px 4px;
  min-height: 30px;
  padding: 8px 15px;
  font-weight: bold;
  font-size: 13px;
}

.sitwatch-events {
  position: absolute;
  width: 350px;
  height: 500px;
  right: 20px;
  top: 55px;
  background-color: #fffff0;
  border: 1px solid rgb(211, 211, 211);
  border-radius: 2px;
  padding: 0px;
  box-shadow: 2px 2px 2px #AAA;
  overflow: auto;
}

.sitwatch-event {
  font-size: 11px;
  border-bottom: 1px solid rgb(211,211,211);
  overflow: hidden;
  padding: 10px;
}
.sitwatch-event:hover {
  background-color: #f6f6e8;
}
.sitwatch-event span {
  float: left;
}
.sitwatch-event .title {
  font-weight: bold;
}
.sitwatch-event .timestamp {
  float: right;
}
.sitwatch-event .icon {
  float: left;
  margin-right: 5px;
}
.sitwatch-event .subject {
  line-height: 12px;
}

.call-trace-detail {
  padding: 19px;
  background-color: rgb(251, 250, 241);
  border: 1px solid rgb(227, 227, 227);
  border-radius: 4px 4px 4px 4px;
  box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.05) inset;
  margin-bottom: 10px;
}

.call-trace .tree li.leaf_li > span {
  cursor: pointer;
}
.call-trace .tree li.leaf_li > span:hover {
  background-color: #df8505;
  border: 1px solid #c67605;
  color: #fff;
}


text:
require 'haml/template/options'
require 'haml/engine'
require 'haml/helpers/action_view_mods'
require 'haml/helpers/action_view_extensions'

if defined?(ActionPack::VERSION::STRING) &&
    ActionPack::VERSION::STRING == "2.3.6"
  raise "Haml does not support Rails 2.3.6. Please upgrade to 2.3.7 or later."
end

module Haml
  # The class that keeps track of the global options for Haml within Rails.
  module Template
    # Enables integration with the Rails 2.2.5+ XSS protection,
    # if it's available and enabled.
    #
    # @return [Boolean] Whether the XSS integration was enabled.
    def try_enabling_xss_integration
      return false unless (ActionView::Base.respond_to?(:xss_safe?) && ActionView::Base.xss_safe?) ||
        # We check for ActiveSupport#on_load here because if we're loading Haml that way, it means:
        # A) we're in Rails 3 so XSS support is always on, and
        # B) we might be in Rails 3 beta 3 where the load order is broken and xss_safe? is undefined
        (defined?(ActiveSupport) && Haml::Util.has?(:public_method, ActiveSupport, :on_load))

      Haml::Template.options[:escape_html] = true

      Haml::Util.module_eval {def rails_xss_safe?; true; end}

      require 'haml/helpers/xss_mods'
      Haml::Helpers.send(:include, Haml::Helpers::XssMods)

      Haml::Precompiler.module_eval do
        def precompiled_method_return_value_with_haml_xss
          "::Haml::Util.html_safe(#{precompiled_method_return_value_without_haml_xss})"
        end
        alias_method :precompiled_method_return_value_without_haml_xss, :precompiled_method_return_value
        alias_method :precompiled_method_return_value, :precompiled_method_return_value_with_haml_xss
      end

      true
    end
  end
end

unless Haml::Util.rails_env == "development"
  Haml::Template.options[:ugly] ||= true
end

if Haml::Util.ap_geq_3?
  Haml::Template.options[:format] ||= :html5
end

# Decide how we want to load Haml into Rails.
# Patching was necessary for versions <= 2.0.1,
# but we can make it a normal handler for higher versions.
if defined?(ActionView::TemplateHandler) ||
    (defined?(ActionView::Template) && defined?(ActionView::Template::Handler))
  require 'haml/template/plugin'
else
  require 'haml/template/patch'
end

# Enable XSS integration. Use Rails' after_initialize method
# so that integration will be checked after the rails_xss plugin is loaded
# (for Rails 2.3.* where it's not enabled by default).
#
# If we're running under Rails 3, though, we don't want to use after_intialize,
# since Haml loading has already been deferred via ActiveSupport.on_load.
if defined?(Rails.configuration.after_initialize) &&
    !(defined?(ActiveSupport) && Haml::Util.has?(:public_method, ActiveSupport, :on_load))
  Rails.configuration.after_initialize {Haml::Template.try_enabling_xss_integration}
else
  Haml::Template.try_enabling_xss_integration
end

if Haml::Util.rails_root
  # Update init.rb to the current version
  # if it's out of date.
  #
  # We can probably remove this as of v1.9,
  # because the new init file is sufficiently flexible
  # to not need updating.
  rails_init_file = File.join(Haml::Util.rails_root, 'vendor', 'plugins', 'haml', 'init.rb')
  haml_init_file = Haml::Util.scope('init.rb')
  begin
    if File.exists?(rails_init_file)
      require 'fileutils'
      FileUtils.cp(haml_init_file, rails_init_file) unless FileUtils.cmp(rails_init_file, haml_init_file)
    end
  rescue SystemCallError
    Haml::Util.haml_warn <<END
HAML WARNING:
#{rails_init_file} is out of date and couldn't be automatically updated.
Please run `haml --rails #{File.expand_path(Haml::Util.rails_root)}' to update it.
END
  end
end


text:
module Addressbook
  class Contact < ActiveRecord::Base
    belongs_to :owner, polymorphic: true
  end
end


text:
namespace boosted_learning {

struct datum;
class WeakLearner
{

public:

    typedef std::vector<size_t> indices_t;
    typedef Eigen::VectorXd feature_vector_type;
    typedef TrainingData::objectClassLabel_t objectClassLabel_t;
    typedef std::vector<double> weights_t;

    WeakLearner();

    WeakLearner(const bool silent_mode, const int negClass,
                            TrainingData::const_shared_ptr_t trainingData,
                            const std::vector<objectClassLabel_t> & classes);

    void train_decision_tree(boost::shared_ptr<WeakClassifierDecisionTree> decision_tree, const weights_t &weights, const weights_t::value_type sumWeights=1.0);
    void train_stump_set(boost::shared_ptr<WeakClassifierStumpSet> stump_set, const weights_t &weights);
    weights_t determine_stump_set_weights(const weights_t &weights, boost::shared_ptr<WeakClassifierStumpSet> stump_set);

protected:

    void find_root_feature_threshold(
            const weights_t &weights,
            std::vector<bool> & indices,
            const size_t min_feature_index,
            weights_t::value_type &error_min, int &threshold_min, int &alphaMin) const;
    int find_leaf_feature_threshold(
            const weights_t &weights, const std::vector<bool> &indices ,const bool isLeft,
            const size_t min_feature_index,
            weights_t::value_type &error_min, int &threshold_min, int &alphaMin) const;

    void get_error_estimate_root(const weights_t &weights,
            const size_t featureIndex, weights_t::value_type &error) const;
    void getErrorEstimate_leaves(const weights_t &weights,
            const std::vector<bool> &indices, const size_t featureIndex,
            weights_t::value_type &error_left, weights_t::value_type &error_right) const;

    int create_root_node(const weights_t &weights, DecisionStump::decision_stump_p &stump,
            weights_t::value_type &min_error, std::vector<bool> &indices) const;
    weights_t::value_type create_sibling_nodes(const weights_t &weights,
            std::vector<bool> &indices, DecisionStump::decision_stump_p &nodeLeft, DecisionStump::decision_stump_p &nodeRight) const;

    weights_t::value_type get_error_from_bins(const feature_vector_type &bin_neg, const feature_vector_type &bin_pos)const ;

    void sort_indices_based_on_data_positions(indices_t &positions, const size_t start) const;

    bool _silent_mode; // both
    const objectClassLabel_t _negative_class;
    TrainingData::const_shared_ptr_t _training_data;
    const std::vector<objectClassLabel_t> _classes;

private:
    void calc_error_thresh_alpha(std::vector<datum> & data,
                     const weights_t::value_type & sumpos,
                     const weights_t::value_type & sumNeg,
                     weights_t::value_type &error_min,
                     int &threshold_min,
                     int &alphaMin) const;
};

struct datum{
    FeaturesResponses::element feature_response;
    WeakLearner::objectClassLabel_t sample_class;
    weights_t::value_type weight;
};

} // end of namespace boosted_learning

#endif // WeakLearner_H


text:
package org.apache.camel.component.infinispan.policy;

import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.apache.camel.model.ModelCamelContext;
import org.apache.camel.model.RouteDefinition;
import org.apache.camel.support.service.ServiceHelper;
import org.infinispan.commons.api.BasicCacheContainer;
import org.junit.Assert;
import org.junit.Test;

abstract class InfinispanRoutePolicyTestBase {
    private static final String CACHE_NAME = "camel-route-policy";
    private static final String CACHE_KEY = "route-policy";

    protected abstract BasicCacheContainer createCacheManager() throws Exception;

    // *******************************************
    //
    // *******************************************

    @Test
    public void testLeadership()throws Exception {
        BasicCacheContainer cacheManager = createCacheManager();

        InfinispanRoutePolicy policy1 = InfinispanRoutePolicy.withManager(cacheManager);
        policy1.setLockMapName(CACHE_NAME);
        policy1.setLockKey(CACHE_KEY);
        policy1.setLockValue("route1");

        InfinispanRoutePolicy policy2 = InfinispanRoutePolicy.withManager(cacheManager);
        policy2.setLockMapName(CACHE_NAME);
        policy2.setLockKey(CACHE_KEY);
        policy2.setLockValue("route2");

        CamelContext context = new DefaultCamelContext();

        try {
            context = new DefaultCamelContext();
            context.start();

            context.adapt(ModelCamelContext.class).addRouteDefinition(RouteDefinition.fromUri("direct:r1").routePolicy(policy1).to("mock:p1"));

            for (int i = 0; i < 10 && !policy1.isLeader(); i++) {
                Thread.sleep(250);
            }

            context.adapt(ModelCamelContext.class).addRouteDefinition(RouteDefinition.fromUri("direct:r2").routePolicy(policy2).to("mock:p2"));

            Assert.assertTrue(policy1.isLeader());
            Assert.assertFalse(policy2.isLeader());

            policy1.shutdown();

            for (int i = 0; i < 10 && !policy2.isLeader(); i++) {
                Thread.sleep(250);
            }

            Assert.assertFalse(policy1.isLeader());
            Assert.assertTrue(policy2.isLeader());

        } finally {
            ServiceHelper.stopService(context);

            if (cacheManager != null) {
                cacheManager.stop();
            }
        }
    }
}


text:
package org.apache.asterix.tools.test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileFilter;
import java.io.FileReader;
import java.util.ArrayList;
import java.util.Collection;
import java.util.logging.Logger;

import org.junit.AfterClass;
import org.junit.Assume;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import org.junit.runners.Parameterized.Parameters;

import org.apache.asterix.test.base.AsterixTestHelper;
import org.apache.asterix.tools.datagen.AdmDataGen;

@RunWith(Parameterized.class)
public class AdmDataGenTest {

    private static final Logger LOGGER = Logger.getLogger(AdmDataGenTest.class.getName());

    private static final String SEPARATOR = File.separator;
    private static final String EXTENSION_QUERY = "adg";
    private static final String FILENAME_IGNORE = "ignore.txt";
    private static final String FILENAME_ONLY = "only.txt";
    private static final String PATH_BASE = "src" + SEPARATOR + "test" + SEPARATOR + "resources" + SEPARATOR + "adgts"
            + SEPARATOR;
    private static final String PATH_QUERIES = PATH_BASE + "dgscripts" + SEPARATOR;
    private static final String PATH_EXPECTED = PATH_BASE + "results" + SEPARATOR;
    private static final String PATH_ACTUAL = "adgtest" + SEPARATOR;

    private static final ArrayList<String> ignore = AsterixTestHelper.readFile(FILENAME_IGNORE, PATH_BASE);
    private static final ArrayList<String> only = AsterixTestHelper.readFile(FILENAME_ONLY, PATH_BASE);

    @BeforeClass
    public static void setUp() throws Exception {
        File outdir = new File(PATH_ACTUAL);
        if (outdir.exists()) {
            AsterixTestHelper.deleteRec(outdir);
        }
        outdir.mkdirs();
    }

    @AfterClass
    public static void tearDown() throws Exception {
        // _bootstrap.stop();
        File outdir = new File(PATH_ACTUAL);
        File[] files = outdir.listFiles();
        if (files == null || files.length == 0) {
            outdir.delete();
        }
    }

    private static void suiteBuild(File dir, Collection<Object[]> testArgs, String path) {
        for (File file : dir.listFiles()) {
            if (file.isDirectory() && !file.getName().startsWith(".")) {
                suiteBuild(file, testArgs, path + file.getName() + SEPARATOR);
            }
            if (file.isFile() && file.getName().endsWith(EXTENSION_QUERY)
            // && !ignore.contains(path + file.getName())
            ) {
                File expectedDir = new File(PATH_EXPECTED + path);
                File actualDir = new File(PATH_ACTUAL + SEPARATOR + path);
                testArgs.add(new Object[] { file, expectedDir, actualDir });
            }
        }
    }

    @Parameters
    public static Collection<Object[]> tests() {
        Collection<Object[]> testArgs = new ArrayList<Object[]>();
        suiteBuild(new File(PATH_QUERIES), testArgs, "");
        return testArgs;
    }

    private File actualDir;
    private File expectedDir;
    private File scriptFile;

    public AdmDataGenTest(File scriptFile, File expectedDir, File actualDir) {
        this.scriptFile = scriptFile;
        this.expectedDir = expectedDir;
        this.actualDir = actualDir;
    }

    @Test
    public void test() throws Exception {
        String scriptFileShort = scriptFile.getPath().substring(PATH_QUERIES.length())
                .replace(SEPARATOR.charAt(0), '/');
        if (!only.isEmpty()) {
            if (!only.contains(scriptFileShort)) {
                LOGGER.info("SKIP TEST: \"" + scriptFile.getPath()
                        + "\" \"only.txt\" not empty and not in \"only.txt\".");
            }
            Assume.assumeTrue(only.contains(scriptFileShort));
        }
        if (ignore.contains(scriptFileShort)) {
            LOGGER.info("SKIP TEST: \"" + scriptFile.getPath() + "\" in \"ignore.txt\".");
        }
        Assume.assumeTrue(!ignore.contains(scriptFileShort));

        LOGGER.info("RUN TEST: \"" + scriptFile.getPath() + "\"");

        actualDir.mkdirs();
        AdmDataGen adg = new AdmDataGen(scriptFile, actualDir);
        try {
            adg.init();
            adg.dataGen();
        } catch (Exception e) {
            throw new Exception("Data gen. ERROR for " + scriptFile + ": " + e.getMessage(), e);
        }

        if (!expectedDir.isDirectory()) {
            throw new Exception(expectedDir + " is not a directory.");
        }
        if (!actualDir.isDirectory()) {
            throw new Exception(expectedDir + " is not a directory.");
        }

        File[] expectedFileSet = expectedDir.listFiles(AdmFileFilter.INSTANCE);
        File[] actualFileSet = actualDir.listFiles(AdmFileFilter.INSTANCE);

        if (expectedFileSet.length != actualFileSet.length) {
            throw new Exception("Expecting " + expectedFileSet.length + " files and found " + actualFileSet.length
                    + " files instead.");
        }

        for (File expectedFile : expectedFileSet) {
            if (expectedFile.isHidden()) {
                continue;
            }
            File actualFile = null;
            for (File f : actualFileSet) {
                if (f.getName().equals(expectedFile.getName())) {
                    actualFile = f;
                    break;
                }
            }
            if (actualFile == null) {
                throw new Exception("Could not find file " + expectedFile.getName());
            }

            BufferedReader readerExpected = new BufferedReader(new FileReader(expectedFile));
            BufferedReader readerActual = new BufferedReader(new FileReader(actualFile));

            String lineExpected, lineActual;
            int num = 1;
            try {
                while ((lineExpected = readerExpected.readLine()) != null) {
                    lineActual = readerActual.readLine();
                    // Assert.assertEquals(lineExpected, lineActual);
                    if (lineActual == null) {
                        throw new Exception("Result for " + scriptFile + " changed at line " + num + ":\n< "
                                + lineExpected + "\n> ");
                    }
                    if (!lineExpected.equals(lineActual)) {
                        throw new Exception("Result for " + scriptFile + " changed at line " + num + ":\n< "
                                + lineExpected + "\n> " + lineActual);
                    }
                    ++num;
                }
                lineActual = readerActual.readLine();
                // Assert.assertEquals(null, lineActual);
                if (lineActual != null) {
                    throw new Exception("Result for " + scriptFile + " changed at line " + num + ":\n< \n> "
                            + lineActual);
                }
            } finally {
                readerExpected.close();
                readerActual.close();
            }
        }
        AsterixTestHelper.deleteRec(actualDir);
    }

    private static class AdmFileFilter implements FileFilter {

        public static final AdmFileFilter INSTANCE = new AdmFileFilter();

        private AdmFileFilter() {
        }

        @Override
        public boolean accept(File path) {
            if (path.isHidden() || !path.isFile()) {
                return false;
            }
            return path.getName().endsWith(".adm");
        }
    }

}


text:
/**********************************************************************************/
/* BitcoinRandomGen.java                                                          */
/* ------------------------------------------------------------------------------ */
/* DESCRIPTION: This class implements a random number generator via the blockchain*/
/* We create a BitCoinRandomGen Object which has a next method taking an integer  */
/* argument n, and returns a random byte array associated with the block of height n on the blockchain, */
/* obtained by creating a PRF with key equal to the block's merkle root, and evaluated on the block's */
/* nonce
/* USAGE:  */
/* ------------------------------------------------------------------------------ */
/* EXAMPLE:                                                                       */
/*                                                                                */
/**********************************************************************************/
package test;

import info.blockchain.api.blockexplorer.*;

import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
public class BitcoinRandomGen
{
	public BitcoinRandomGen()
	{
	}

	public static byte[] getRandomAtHeight(long tarheight)
	{
		BlockExplorer bexp = new BlockExplorer();
		LatestBlock curblock;
		try {
			curblock = bexp.getLatestBlock();
		}
		catch (Exception e)
		{
			System.out.println("Server error");
			return null;
		}
		long curheight = curblock.getHeight();
		while (curheight != tarheight)
		{
			try {
			curblock = bexp.getLatestBlock();
			}
			catch (Exception e)
			{
				System.out.println("Server error");
				return null;
			}
			curheight = curblock.getHeight();
		}

		// Now our curblock should be the target block
		Block tarblock;
		try {
			tarblock = bexp.getBlock(curblock.getHash());
		}
		catch (Exception e)
		{
			System.out.println("Server error");
			return null;
		}
		String merkle = tarblock.getMerkleRoot();
		byte[] key = merkle.getBytes(StandardCharsets.UTF_8);
		PRF prf = new PRF(key);
		long nonce = tarblock.getNonce();
		byte[] noncebytes = ByteBuffer.allocate(Long.SIZE / Byte.SIZE).putLong(nonce).array();
		return prf.eval(noncebytes);
	}

	public static void main(String[] args)
	{
		long n = Long.parseLong(args[0]);
		System.out.println(BitcoinRandomGen.getRandomAtHeight(n));
	}
}


text:
'use strict';

const defaultTo = require('lodash/defaultTo');
const VertexBuffer = require('../../../webgl/vertex/VertexBuffer');
const WebGLOverlayRenderer = require('../WebGLOverlayRenderer');

// Constants

/**
 * Shader GLSL source.
 *
 * @private
 * @constant {object}
 */
const SHADER_GLSL = {
	vert:
		`
		precision highp float;
		attribute vec2 aPosition;
		attribute vec2 aNormal;
		uniform vec2 uViewOffset;
		uniform float uScale;
		uniform float uLineWidth;
		uniform float uPixelRatio;
		uniform float uPointRadius;
		uniform mat4 uProjectionMatrix;
		void main() {
			vec2 wPosition = (aPosition * uScale) - uViewOffset;
			gl_Position = uProjectionMatrix * vec4(wPosition, 0.0, 1.0);
			gl_PointSize = uPointRadius * 2.0 * uPixelRatio;
		}
		`,
	frag:
		`
		#ifdef GL_OES_standard_derivatives
			#extension GL_OES_standard_derivatives : enable
		#endif
		precision highp float;
		uniform vec4 uPointColor;
		uniform float uOpacity;
		void main() {
			vec2 cxy = 2.0 * gl_PointCoord - 1.0;
			float radius = dot(cxy, cxy);
			float alpha = 1.0;
			#ifdef GL_OES_standard_derivatives
				float delta = fwidth(radius);
				alpha = 1.0 - smoothstep(1.0 - delta, 1.0 + delta, radius);
			#else
				if (radius > 1.0) {
					discard;
				}
			#endif
			gl_FragColor = vec4(uPointColor.rgb, uPointColor.a * alpha * uOpacity);
		}
		`
};

// Private Methods

const bufferPoints = function(points) {
	const buffer = new Float32Array(points.length * 2);
	for (let i=0; i<points.length; i++) {
		const point = points[i];
		buffer[i*2] = point.x;
		buffer[i*2+1] = point.y;
	}
	return buffer;
};

const createVertexBuffer = function(gl, points) {
	const data = bufferPoints(points);
	return new VertexBuffer(
		gl,
		data,
		{
			0: {
				size: 2,
				type: 'FLOAT'
			}
		},
		{
			mode: 'POINTS',
			count: points.length
		});
};

/**
 * Class representing a webgl point overlay renderer.
 */
class PointOverlayRenderer extends WebGLOverlayRenderer {

	/**
	 * Instantiates a new PointOverlayRenderer object.
	 *
	 * @param {object} options - The overlay options.
	 * @param {Array} options.pointColor - The color of the points.
	 * @param {number} options.pointRadius - The pixel radius of the points.
	 */
	constructor(options = {}) {
		super(options);
		this.pointColor = defaultTo(options.pointColor, [ 1.0, 0.0, 1.0, 1.0 ]);
		this.pointRadius = defaultTo(options.pointRadius, 4);
		this.shader = null;
		this.ext = null;
		this.points = null;
	}

	/**
	 * Executed when the overlay is attached to a plot.
	 *
	 * @param {Layer} overlay - The overlay to attach the renderer to.
	 *
	 * @returns {PointOverlayRenderer} The renderer object, for chaining.
	 */
	onAdd(overlay) {
		super.onAdd(overlay);
		this.ext = this.gl.getExtension('OES_standard_derivatives');
		this.shader = this.createShader(SHADER_GLSL);
		return this;
	}

	/**
	 * Executed when the overlay is removed from a plot.
	 *
	 * @param {Layer} overlay - The overlay to remove the renderer from.
	 *
	 * @returns {PointOverlayRenderer} The renderer object, for chaining.
	 */
	onRemove(overlay) {
		this.shader = null;
		this.ext = null;
		this.points = null;
		super.onRemove(overlay);
		return this;
	}

	/**
	 * Generate any underlying buffers.
	 *
	 * @returns {PointOverlayRenderer} The overlay object, for chaining.
	 */
	refreshBuffers() {
		// clip points to only those that are inside the cell
		const clipped = this.overlay.getClippedGeometry();
		// generate the buffer
		if (clipped && clipped.length > 0) {
			this.points = createVertexBuffer(this.gl, clipped);
		} else {
			this.points = null;
		}
	}

	/**
	 * The draw function that is executed per frame.
	 *
	 * @returns {PointOverlayRenderer} The overlay object, for chaining.
	 */
	draw() {
		if (!this.points) {
			return this;
		}

		const gl = this.gl;
		const shader = this.shader;
		const points = this.points;
		const plot = this.overlay.plot;
		const cell = plot.cell;
		const proj = this.getOrthoMatrix();
		const scale = Math.pow(2, plot.zoom - cell.zoom);
		const opacity = this.overlay.opacity;

		// get view offset in cell space
		const offset = cell.project(plot.viewport, plot.zoom);

		// set blending func
		gl.enable(gl.BLEND);
		gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);

		// bind shader
		shader.use();

		// set global uniforms
		shader.setUniform('uProjectionMatrix', proj);
		shader.setUniform('uViewOffset', [ offset.x, offset.y ]);
		shader.setUniform('uScale', scale);
		shader.setUniform('uPointColor', this.pointColor);
		shader.setUniform('uPointRadius', this.pointRadius);
		shader.setUniform('uPixelRatio', plot.pixelRatio);
		shader.setUniform('uOpacity', opacity);

		// draw the points
		points.bind();
		points.draw();

		return this;
	}
}

module.exports = PointOverlayRenderer;


text:
<?xml version="1.0" encoding="utf-8"?>
<databaseChangeLog
    xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.4.xsd">

    <include file="classpath:config/liquibase/changelog/00000000000000_initial_schema.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20151216075608_added_entity_Technology.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20151216080458_added_entity_Course.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20151216081513_added_entity_Enrolment.xml" relativeToChangelogFile="false"/>
    <include file="classpath:config/liquibase/changelog/20160105000000_initial_content.xml" relativeToChangelogFile="false"/>
    <!-- jhipster-needle-005 - JHipster will add liquibase changelogs here -->
</databaseChangeLog>


text:
package org.vitrivr.cineast.core.data;

import com.carrotsearch.hppc.IntObjectHashMap;
import java.util.EnumSet;
import java.util.HashMap;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;

public enum MediaType {

  VIDEO(0, "v", "video"),
  IMAGE(1, "i", "image"),
  AUDIO(2, "a", "audio"),
  MODEL3D(3, "m", "3dmodel"),
  IMAGE_SEQUENCE(4, "is", "imagesequence"),
  UNKNOWN(99, "u", "unknown");

  public static final char DELIMITER = '_';
  private static final IntObjectHashMap<MediaType> idToType = new IntObjectHashMap<>();
  private static final HashMap<String, MediaType> prefixToType = new HashMap<>();
  private static final HashMap<String, MediaType> nameToType = new HashMap<>();

  static {
    for (MediaType t : EnumSet.allOf(MediaType.class)) {
      if (idToType.containsKey(t.getId())) {
        throw new IllegalStateException("duplicate id (" + t.getId() + ") in Mediatype: " + t
            + " collides with " + idToType.get(t.getId()));
      }
      idToType.put(t.getId(), t);

      if (prefixToType.containsKey(t.getPrefix())) {
        throw new IllegalStateException("duplicate prefix (" + t.getPrefix() + ") in Mediatype: "
            + t + " collides with " + prefixToType.get(t.getPrefix()));
      }
      prefixToType.put(t.getPrefix(), t);

      if (nameToType.containsKey(t.getPrefix())) {
        throw new IllegalStateException("duplicate name (" + t.getName() + ") in Mediatype: " + t
            + " collides with " + nameToType.get(t.getName()));
      }
      nameToType.put(t.getName().toLowerCase(), t);
    }
  }

  private final int id;
  private final String prefix;
  private final String name;
  /**
   * Constructs a new media type given the id, the prefix and the name.
   *
   * @param id     numeric id to use to identify the type in the persistent storage layer
   * @param prefix the prefix of the MediaType without a trailing delimiter such as '_'
   * @param name   the name of the media type
   */
  MediaType(int id, String prefix, String name) {
    this.id = id;
    this.prefix = prefix;
    this.name = name.trim();
  }

  /**
   * @return the MediaType associated with this id or null in case there is none.
   */
  public static MediaType fromId(int id) {
    return idToType.get(id);
  }

  /**
   * @return the MediaType associated with this prefix or null in case there is none.
   */
  public static MediaType fromPrefix(String prefix) {
    if (prefix == null) {
      return null;
    }
    return prefixToType.get(prefix.trim().toLowerCase());
  }

  /**
   * @return the MediaType associated with this name or null in case there is none.
   */
  public static MediaType fromName(String name) {
    if (name == null) {
      return null;
    }
    return nameToType.get(name.trim().toLowerCase());
  }

  public static boolean existsId(int id) {
    return idToType.containsKey(id);
  }

  public static boolean existsPrefix(String prefix) {
    return prefixToType.containsKey(prefix);
  }

  public static boolean existsName(String name) {
    return nameToType.containsKey(name.trim().toLowerCase());
  }

  /**
   * generates an id of the form (prefix)_(object id) assuming the delimiter is '_'.
   *
   * @param type     the type for which an id is to be generated
   * @param objectId the globally unique id of the object
   * @throws IllegalArgumentException if objectId is empty
   * @throws NullPointerException     if type or objectId is null
   */
  public static String generateId(MediaType type, String objectId) throws IllegalArgumentException, NullPointerException {
    if (type == null) {
      throw new NullPointerException("Media type cannot be null!");
    }
    if (objectId == null) {
      throw new NullPointerException("Object ID cannot be null!");
    }
    if (objectId.isEmpty()) {
      throw new IllegalArgumentException("Object ID must not be empty!");
    }

    return type.getPrefix() + DELIMITER + objectId;
  }

  /**
   * Parses the provided object ID and decomposes it into a pair containing the {@link MediaType}, the ID of the media object.
   *
   * @param objectId The object ID that should be parsed.
   * @return Resulting pair.
   */
  public static Pair<MediaType, String> parseObjectId(String objectId) {
    final String[] components = objectId.split(String.valueOf(DELIMITER));
    return new ImmutablePair<>(MediaType.fromPrefix(components[0]), components[1]);
  }

  /**
   * generates a segment id of the form (prefix)_(object id)_(sequence number) assuming the delimiter is '_'.
   *
   * @param type           the type for which an id is to be generated
   * @param objectId       the globally unique id of the object (without MediaType prefix)
   * @param sequenceNumber the number of the segment within the object
   * @throws IllegalArgumentException if shot sequence number is negative or objectId is empty
   * @throws NullPointerException     if type or objectId is null
   */
  public static String generateSegmentId(MediaType type, String objectId, long sequenceNumber)
      throws IllegalArgumentException, NullPointerException {
    if (sequenceNumber < 0) {
      throw new IllegalArgumentException("sequenceNumber must be non-negative");
    }

    return generateId(type, objectId) + DELIMITER + sequenceNumber;

  }

  /**
   * generates a segment id of the form (prefix)_(object id)_(sequence number) assuming the delimiter is '_'
   *
   * @param objectId       the globally unique id of the object (with MediaType prefix)
   * @param sequenceNumber the number of the segment within the object
   * @throws IllegalArgumentException if shot sequence number is negative or objectId is empty
   * @throws NullPointerException     if type or objectId is null
   */
  public static String generateSegmentId(String objectId, long sequenceNumber) throws IllegalArgumentException, NullPointerException {
    if (sequenceNumber < 0) {
      throw new IllegalArgumentException("sequenceNumber must be non-negative");
    }
    return objectId + DELIMITER + sequenceNumber;
  }

  /**
   * Parses the provided segmentId and decomposes it into a pair containing the ID of the media object and the segment's sequence number.
   *
   * @param segmentId The segment ID that should be parsed.
   * @return Resulting pair.
   */
  public static Pair<String, Long> parsesSegmentId(String segmentId) {
    final String[] components = segmentId.split(String.valueOf(DELIMITER));
    StringBuilder sb = new StringBuilder();
    sb.append(components[0]);
    for (int i = 1; i < components.length - 1; ++i) {
      sb.append(DELIMITER);
      sb.append(components[i]);
    }
    return new ImmutablePair<>(sb.toString(), Long.valueOf(components[components.length - 1]));
  }

  public int getId() {
    return this.id;
  }

  /**
   * @return the prefix of the MediaType without a trailing delimiter such as '_'.
   */
  public String getPrefix() {
    return this.prefix;
  }

  public String getName() {
    return this.name;
  }
}