text:
from __future__ import print_function

import functools
import glob
import multiprocessing
import os

from command import PagedCommand

from color import Coloring
import platform_utils

class Status(PagedCommand):
  common = True
  helpSummary = "Show the working tree status"
  helpUsage = """
%prog [<project>...]
"""
  helpDescription = """
'%prog' compares the working tree to the staging area (aka index),
and the most recent commit on this branch (HEAD), in each project
specified.  A summary is displayed, one line per file where there
is a difference between these three states.

The -j/--jobs option can be used to run multiple status queries
in parallel.

The -o/--orphans option can be used to show objects that are in
the working directory, but not associated with a repo project.
This includes unmanaged top-level files and directories, but also
includes deeper items.  For example, if dir/subdir/proj1 and
dir/subdir/proj2 are repo projects, dir/subdir/proj3 will be shown
if it is not known to repo.

# Status Display

The status display is organized into three columns of information,
for example if the file 'subcmds/status.py' is modified in the
project 'repo' on branch 'devwork':

  project repo/                                   branch devwork
   -m     subcmds/status.py

The first column explains how the staging area (index) differs from
the last commit (HEAD).  Its values are always displayed in upper
case and have the following meanings:

 -:  no difference
 A:  added         (not in HEAD,     in index                     )
 M:  modified      (    in HEAD,     in index, different content  )
 D:  deleted       (    in HEAD, not in index                     )
 R:  renamed       (not in HEAD,     in index, path changed       )
 C:  copied        (not in HEAD,     in index, copied from another)
 T:  mode changed  (    in HEAD,     in index, same content       )
 U:  unmerged; conflict resolution required

The second column explains how the working directory differs from
the index.  Its values are always displayed in lower case and have
the following meanings:

 -:  new / unknown (not in index,     in work tree                )
 m:  modified      (    in index,     in work tree, modified      )
 d:  deleted       (    in index, not in work tree                )

"""

  def _Options(self, p):
    p.add_option('-j', '--jobs',
                 dest='jobs', action='store', type='int', default=2,
                 help="number of projects to check simultaneously")
    p.add_option('-o', '--orphans',
                 dest='orphans', action='store_true',
                 help="include objects in working directory outside of repo projects")
    p.add_option('-q', '--quiet', action='store_true',
                 help="only print the name of modified projects")

  def _StatusHelper(self, quiet, project):
    """Obtains the status for a specific project.

    Obtains the status for a project, redirecting the output to
    the specified object.

    Args:
      quiet: Where to output the status.
      project: Project to get status of.

    Returns:
      The status of the project.
    """
    return project.PrintWorkTreeStatus(quiet=quiet)

  def _FindOrphans(self, dirs, proj_dirs, proj_dirs_parents, outstring):
    """find 'dirs' that are present in 'proj_dirs_parents' but not in 'proj_dirs'"""
    status_header = ' --\t'
    for item in dirs:
      if not platform_utils.isdir(item):
        outstring.append(''.join([status_header, item]))
        continue
      if item in proj_dirs:
        continue
      if item in proj_dirs_parents:
        self._FindOrphans(glob.glob('%s/.*' % item) +
                          glob.glob('%s/*' % item),
                          proj_dirs, proj_dirs_parents, outstring)
        continue
      outstring.append(''.join([status_header, item, '/']))

  def Execute(self, opt, args):
    all_projects = self.GetProjects(args)
    counter = 0

    if opt.jobs == 1:
      for project in all_projects:
        state = project.PrintWorkTreeStatus(quiet=opt.quiet)
        if state == 'CLEAN':
          counter += 1
    else:
      with multiprocessing.Pool(opt.jobs) as pool:
        states = pool.map(functools.partial(self._StatusHelper, opt.quiet), all_projects)
        counter += states.count('CLEAN')
    if not opt.quiet and len(all_projects) == counter:
      print('nothing to commit (working directory clean)')

    if opt.orphans:
      proj_dirs = set()
      proj_dirs_parents = set()
      for project in self.GetProjects(None, missing_ok=True):
        proj_dirs.add(project.relpath)
        (head, _tail) = os.path.split(project.relpath)
        while head != "":
          proj_dirs_parents.add(head)
          (head, _tail) = os.path.split(head)
      proj_dirs.add('.repo')

      class StatusColoring(Coloring):
        def __init__(self, config):
          Coloring.__init__(self, config, 'status')
          self.project = self.printer('header', attr='bold')
          self.untracked = self.printer('untracked', fg='red')

      orig_path = os.getcwd()
      try:
        os.chdir(self.manifest.topdir)

        outstring = []
        self._FindOrphans(glob.glob('.*') +
                          glob.glob('*'),
                          proj_dirs, proj_dirs_parents, outstring)

        if outstring:
          output = StatusColoring(self.manifest.globalConfig)
          output.project('Objects not within a project (orphans)')
          output.nl()
          for entry in outstring:
            output.untracked(entry)
            output.nl()
        else:
          print('No orphan files or directories')

      finally:
        # Restore CWD.
        os.chdir(orig_path)


text:
package org.coderswithoutborders.deglancer.func_debug.stage1;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.Button;

import org.coderswithoutborders.deglancer.MainApplication;
import org.coderswithoutborders.deglancer.R;
import org.coderswithoutborders.deglancer.func_debug.stage2.DebugStage2Activity;
import org.coderswithoutborders.deglancer.func_debug.view.StageSelectView;
import org.coderswithoutborders.deglancer.func_debug.view.StatsView;
import org.coderswithoutborders.deglancer.model.Stage;
import org.coderswithoutborders.deglancer.pretest.PreTestActivity;

import android.view.View.OnClickListener;

import javax.inject.Inject;

/**
 * Created by Renier on 2016/05/06.
 */
public class DebugStage1Activity extends AppCompatActivity implements IDebugStage1View {

    @Inject
    IDebugStage1Presenter mPresenter;

    private Button btnAdvance;
    private Button button, button2;
    private StageSelectView mStageSelectView;
    private StatsView mStatsView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        setContentView(R.layout.debug_stage1);

        mStatsView = (StatsView) findViewById(R.id.statsView);

        mStageSelectView = (StageSelectView) findViewById(R.id.stageSelectView);
        mStageSelectView.setStagePickerState(false, true, true);

        btnAdvance = (Button) findViewById(R.id.btnAdvance);
        btnAdvance.setOnClickListener(buttonClickListener);
        button = (Button) findViewById(R.id.btnTakePreTest);
        button.setOnClickListener(buttonClickListener);

        MainApplication.from(getApplicationContext()).getGraph().inject(this);

    }

    View.OnClickListener buttonClickListener = v -> {
        if (v.getId() == R.id.btnAdvance) {
            mPresenter.advanceStageClicked();
        } else if (v.getId() == R.id.btnTakePreTest) {
            mPresenter.clearTestResults();
        }
    };

    @Override
    public void setStage(Stage stage) {
        mStageSelectView.setStage(stage);
    }

    @Override
    protected void onResume() {
        super.onResume();

        if (mPresenter != null) {
            mPresenter.setView(this);
            mPresenter.onAttached();
        }
    }

    @Override
    protected void onPause() {
        if (mPresenter != null) {
            mPresenter.onDetached();
            mPresenter.clearView();
        }

        super.onPause();
    }

    @Override
    public void finishActivity() {
        finish();
    }

    @Override
    public void moveToStage2View() {
        Intent i = new Intent(this, DebugStage2Activity.class);
        startActivity(i);
    }

    @Override
    public void setTitleStage(String stage) {
        setTitle(String.format(getApplicationContext().getString(R.string.activity_debug_stage_activity_title_from_code), stage));
    }

}

redpajama_set_name: RedPajamaGithub


text:
<resources>
    <string name="app_name">FloatAnimationDemo</string>
</resources>


text:
define([
  'jquery',
  'backbone',
  'template'
], function(
  $,
  Backbone,
  Template
){

  var HeaderView = Backbone.View.extend({

    template: Template['app/template/header.hbs'],

    el: "header",

    events: {
      'click .title': 'editProject',
      'click .preview': 'previewProject',
      'click .load': 'loadProject',
      'click .save': 'saveProject'
    },

    initialize: function (model) {
      var _this = this;
      this.model = model;

      Backbone.on('project:save-start', function(){
        $(_this.el).find('.save').addClass('saving').text('Saving');
      });
      Backbone.on('project:save-end', function(){
        $(_this.el).find('.save').removeClass('saving').addClass('success').text('Saved');
        setTimeout(function(){
          $(_this.el).find('.save').removeClass('success').text('Save Project');
        }, 3000);
      });
      Backbone.on('project:save-error', function(){
        $(_this.el).find('.save').addClass('error').text('Error');
      });

      Backbone.on('project:loaded', function(project, storyline){
        $(_this.el).find('.title').html('Storyline Editor Project: ' +project.get('title') +'');
      });
      Backbone.on('project:edit-title', function(title){
        $(_this.el).find('.title').html('Project: ' +title);
      });
      Backbone.on('project:load', function(project, storyline){
        $(_this.el).find('.title').html('Storyline Editor');
      });
    },

    render: function () {
      var html = this.template();
      $(this.el).append(html);
    },

    editProject: function () {
      Backbone.trigger('project:edit', window.project._id);
    },

    previewProject: function () {
      Backbone.trigger('project:preview', window.project._id);
    },

    loadProject: function () {
      Backbone.trigger('project:load');
    },

    saveProject: function () {
      if (window.projectModel) {
        window.projectModel.set('storyline', window.project.storyline);
        Backbone.trigger('project:save-start');
        window.projectModel.save(null, {
          success: function(){
            Backbone.trigger('project:save-end');
          },
          error: function(){
            Backbone.trigger('project:save-error');
          }
        });
      }
    }

  });

  return HeaderView;

});


text:
webpackJsonp([6],[
/* 0 */
/***/ function(module, exports, __webpack_require__) {

	/* WEBPACK VAR INJECTION */(function(React, ReactDOM) {"use strict";

	Object.defineProperty(exports, "__esModule", {
	    value: true
	});

	var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();

	var _index = __webpack_require__(163);

	function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }

	function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; }

	function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }

	var ModalDemo = function (_React$Component) {
	    _inherits(ModalDemo, _React$Component);

	    function ModalDemo(props) {
	        _classCallCheck(this, ModalDemo);

	        return _possibleConstructorReturn(this, (ModalDemo.__proto__ || Object.getPrototypeOf(ModalDemo)).call(this, props));
	    }

	    _createClass(ModalDemo, [{
	        key: "openModal",
	        value: function openModal(ref) {
	            var node = this.refs[ref];
	            console.log("node:", node);
	            node.open();
	        }
	    }, {
	        key: "handleCancel",
	        value: function handleCancel() {
	            console.log("Cancel 处理器");
	            return true;
	        }
	    }, {
	        key: "handleConfirm",
	        value: function handleConfirm() {
	            console.log("Confirm 处理器");
	            return confirm('close modal?');
	        }
	    }, {
	        key: "handleConfirm1",
	        value: function handleConfirm1() {
	            alert('confirmed');
	            return true;
	        }
	    }, {
	        key: "handleClose",
	        value: function handleClose() {
	            console.log("demo----handleClose");
	            return confirm('close');
	        }
	    }, {
	        key: "render",
	        value: function render() {
	            var content = React.createElement(
	                "article",
	                null,
	                React.createElement(
	                    "h4",
	                    null,
	                    "this is content"
	                ),
	                React.createElement(
	                    "p",
	                    null,
	                    "默认内容"
	                ),
	                React.createElement(
	                    "ul",
	                    null,
	                    React.createElement(
	                        "li",
	                        null,
	                        "第一行"
	                    ),
	                    React.createElement(
	                        "li",
	                        null,
	                        "第二行"
	                    )
	                )
	            );
	            return React.createElement(
	                "div",
	                null,
	                React.createElement(
	                    "ol",
	                    null,
	                    React.createElement(
	                        "li",
	                        null,
	                        React.createElement(
	                            "h3",
	                            null,
	                            "Default modal"
	                        ),
	                        React.createElement(
	                            "button",
	                            { onClick: this.openModal.bind(this, 'modal0') },
	                            "click"
	                        ),
	                        React.createElement(
	                            _index.Modal,
	                            { ref: "modal0", title: React.createElement(
	                                    "h4",
	                                    null,
	                                    "Comfirm deleted"
	                                ) },
	                            content
	                        )
	                    ),
	                    React.createElement(
	                        "li",
	                        null,
	                        React.createElement(
	                            "h3",
	                            null,
	                            "Modal with confirm, cancel action"
	                        ),
	                        React.createElement(
	                            "button",
	                            { onClick: this.openModal.bind(this, 'modal1') },
	                            "click"
	                        ),
	                        React.createElement(
	                            _index.Modal,
	                            { ref: "modal1", onConfirm: this.handleConfirm.bind(this),
	                                onCancel: this.handleCancel.bind(this), confirmText: "确定", cancelText: "取消", closeIcon: "关闭" },
	                            content
	                        )
	                    ),
	                    React.createElement(
	                        "li",
	                        null,
	                        React.createElement(
	                            "h3",
	                            null,
	                            "Modal with only confirm action"
	                        ),
	                        React.createElement(
	                            "button",
	                            { onClick: this.openModal.bind(this, 'modal2') },
	                            "click"
	                        ),
	                        React.createElement(
	                            _index.Modal,
	                            { ref: "modal2", onConfirm: this.handleConfirm1.bind(this) },
	                            content
	                        )
	                    ),
	                    React.createElement(
	                        "li",
	                        null,
	                        React.createElement(
	                            "h3",
	                            null,
	                            "Modal with onClick"
	                        ),
	                        React.createElement(
	                            "button",
	                            { onClick: this.openModal.bind(this, 'modal3') },
	                            "click"
	                        ),
	                        React.createElement(
	                            _index.Modal,
	                            { ref: "modal3", onClose: this.handleClose.bind(this), closeIcon: React.createElement(
	                                    "p",
	                                    null,
	                                    "关闭"
	                                ) },
	                            content
	                        )
	                    ),
	                    React.createElement(
	                        "li",
	                        null,
	                        React.createElement(
	                            "h4",
	                            null,
	                            "Modal force to close"
	                        ),
	                        React.createElement(
	                            "button",
	                            { onClick: this.openModal.bind(this, 'modal4') },
	                            "click"
	                        ),
	                        React.createElement(
	                            _index.Modal,
	                            { ref: "modal4", force: true, onConfirm: this.handleConfirm1.bind(this), confirmText: "确定" },
	                            content
	                        )
	                    )
	                )
	            );
	        }
	    }]);

	    return ModalDemo;
	}(React.Component);

	exports.default = ModalDemo;

	ReactDOM.render(React.createElement(ModalDemo, null), document.querySelector('.app'));
	/* WEBPACK VAR INJECTION */}.call(exports, __webpack_require__(1), __webpack_require__(3)))

/***/ }
]);


text:
var frames = require("ui/frame");

function onTap_About() {
    var navigationEntry = {
        moduleName: "views/about/about",
        transition: {
            name: "slideBottom"
        }
    };
    frames.topmost().navigate(navigationEntry);
}
exports.onTap_About = onTap_About;

function onTap_ContactUs() {
    var navigationEntry = {
        moduleName: "views/contact-us/contact-us",
        transition: {
            name: "slideBottom"
        }
    };
    frames.topmost().navigate(navigationEntry);
}
exports.onTap_ContactUs = onTap_ContactUs;


text:
/*
 * config.h
 *
 *  Created on: Feb 2, 2017
 *      Author: pchero
 */

#ifndef BACKEND_SRC_CONFIG_H_
#define BACKEND_SRC_CONFIG_H_

#include <stdbool.h>
#include <jansson.h>

bool config_init(void);
bool config_update_filename(const char* filename);

#endif /* BACKEND_SRC_CONFIG_H_ */


text:
import React from 'react';
import './Navigation.scss';
import Link from '../Link';

function Navigation() {
  return (

        Home

        About

  );
}

export default Navigation;


text:
#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN

@class OSSTask<ResultType>;

/*!
 A OSSTaskCompletionSource represents the producer side of tasks.
 It is a task that also has methods for changing the state of the
 task by settings its completion values.
 */
@interface OSSTaskCompletionSource<__covariant ResultType> : NSObject

/*!
 Creates a new unfinished task.
 */
+ (instancetype)taskCompletionSource;

/*!
 The task associated with this TaskCompletionSource.
 */
@property (nonatomic, strong, readonly) OSSTask<ResultType> *task;

/*!
 Completes the task by setting the result.
 Attempting to set this for a completed task will raise an exception.
 @param result The result of the task.
 */
- (void)setResult:(nullable ResultType)result;

/*!
 Completes the task by setting the error.
 Attempting to set this for a completed task will raise an exception.
 @param error The error for the task.
 */
- (void)setError:(NSError *)error;

/*!
 Completes the task by setting an exception.
 Attempting to set this for a completed task will raise an exception.
 @param exception The exception for the task.
 */
- (void)setException:(NSException *)exception;

/*!
 Completes the task by marking it as cancelled.
 Attempting to set this for a completed task will raise an exception.
 */
- (void)cancel;

/*!
 Sets the result of the task if it wasn't already completed.
 @returns whether the new value was set.
 */
- (BOOL)trySetResult:(nullable ResultType)result;

/*!
 Sets the error of the task if it wasn't already completed.
 @param error The error for the task.
 @returns whether the new value was set.
 */
- (BOOL)trySetError:(NSError *)error;

/*!
 Sets the exception of the task if it wasn't already completed.
 @param exception The exception for the task.
 @returns whether the new value was set.
 */
- (BOOL)trySetException:(NSException *)exception;

/*!
 Sets the cancellation state of the task if it wasn't already completed.
 @returns whether the new value was set.
 */
- (BOOL)trySetCancelled;

@end

NS_ASSUME_NONNULL_END


text:
<?php
// src/Acme/DemoBundle/Admin/PostAdmin.php

namespace AppBundle\Admin;

use AppBundle\Form\GenreType;
use Sonata\AdminBundle\Admin\Admin;
use Sonata\AdminBundle\Datagrid\ListMapper;
use Sonata\AdminBundle\Datagrid\DatagridMapper;
use Sonata\AdminBundle\Form\FormMapper;
use Sonata\AdminBundle\Show\ShowMapper;

class SeriesAdmin extends Admin
{
    // Fields to be shown on create/edit forms
    protected function configureFormFields(FormMapper $formMapper)
    {
        $formMapper
            ->add('name', null, [
                'attr' => [
                    'class' => 'custom-text',
                ]
            ])
            ->add('releasedAt', 'date', [
                'years' => range(1940, date('Y')+5),
                'data'  => new \DateTime(),
            ])
            ->add('summary')
            ->add('picture')
            ->add('genres'/*, 'collection', [
                'type' => new GenreType(),
                'allow_add'    => true,
                'allow_delete' => true,
            ]*/)
            ->add('country', 'country')

        ;
    }

    // Fields to be shown on filter forms
    protected function configureDatagridFilters(DatagridMapper $datagridMapper)
    {
        $datagridMapper
            ->add('name')
            ->add('releasedAt')
            ->add('genres')
            ->add('country')
        ;
    }

    // Fields to be shown on lists
    protected function configureListFields(ListMapper $listMapper)
    {
        $listMapper
            ->addIdentifier('id')
            ->add('name')
            ->add('releasedAt')
            ->add('genres')
            ->add('country')
            ->add('_action', 'actions', [
                'actions' => [
                    'show'   => [],
                    'edit'   => [],
                    'delete' => [],
                ],
            ])
        ;
    }

    protected function configureShowFields(ShowMapper $showMapper)
    {
        // Fields to be shown on show action
        $showMapper
            ->add('id')
            ->add('name')
            ->add('releasedAt')
            ->add('summary')
            ->add('picture')
            ->add('genres')
            ->add('country')
        ;
    }
}


text:
package com.scriptedpapers.androidfadeedittextview;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
 * Testing Fundamentals
 */
public class ApplicationTest extends ApplicationTestCase<Application> {
    public ApplicationTest() {
        super(Application.class);
    }
}


text:
package io.airlift.discovery.client;

import com.google.inject.Binder;
import com.google.inject.Module;
import com.google.inject.Provider;
import com.google.inject.Provides;
import com.google.inject.Scopes;
import com.google.inject.multibindings.Multibinder;
import io.airlift.node.NodeInfo;

import javax.annotation.PreDestroy;
import javax.inject.Singleton;

import java.net.URI;
import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.ScheduledThreadPoolExecutor;

import static com.google.common.base.Preconditions.checkState;
import static io.airlift.concurrent.Threads.daemonThreadsNamed;
import static io.airlift.configuration.ConfigurationModule.bindConfig;
import static io.airlift.http.client.HttpClientBinder.httpClientBinder;
import static io.airlift.json.JsonCodecBinder.jsonCodecBinder;
import static org.weakref.jmx.guice.ExportBinder.newExporter;

public class DiscoveryModule
        implements Module
{
    @Override
    public void configure(Binder binder)
    {
        // bind service inventory
        binder.bind(ServiceInventory.class).in(Scopes.SINGLETON);
        bindConfig(binder).to(ServiceInventoryConfig.class);

        // for legacy configurations
        bindConfig(binder).to(DiscoveryClientConfig.class);

        // bind discovery client and dependencies
        binder.bind(DiscoveryLookupClient.class).to(HttpDiscoveryLookupClient.class).in(Scopes.SINGLETON);
        binder.bind(DiscoveryAnnouncementClient.class).to(HttpDiscoveryAnnouncementClient.class).in(Scopes.SINGLETON);
        jsonCodecBinder(binder).bindJsonCodec(ServiceDescriptorsRepresentation.class);
        jsonCodecBinder(binder).bindJsonCodec(Announcement.class);

        // bind the http client
        httpClientBinder(binder).bindAsyncHttpClient("discovery", ForDiscoveryClient.class);

        // bind announcer
        binder.bind(Announcer.class).in(Scopes.SINGLETON);

        // Must create a multibinder for service announcements or construction will fail if no
        // service announcements are bound, which is legal for processes that don't have public services
        Multibinder.newSetBinder(binder, ServiceAnnouncement.class);

        // bind selector factory
        binder.bind(CachingServiceSelectorFactory.class).in(Scopes.SINGLETON);
        binder.bind(ServiceSelectorFactory.class).to(MergingServiceSelectorFactory.class).in(Scopes.SINGLETON);

        binder.bind(ScheduledExecutorService.class)
                .annotatedWith(ForDiscoveryClient.class)
                .toProvider(DiscoveryExecutorProvider.class)
                .in(Scopes.SINGLETON);

        // bind selector manager with initial empty multibinder
        Multibinder.newSetBinder(binder, ServiceSelector.class);
        binder.bind(ServiceSelectorManager.class).in(Scopes.SINGLETON);

        newExporter(binder).export(ServiceInventory.class).withGeneratedName();
    }

    @SuppressWarnings("deprecation")
    @Provides
    @ForDiscoveryClient
    public URI getDiscoveryUri(ServiceInventory serviceInventory, DiscoveryClientConfig config)
    {
        Iterable<ServiceDescriptor> discovery = serviceInventory.getServiceDescriptors("discovery");
        for (ServiceDescriptor descriptor : discovery) {
            if (descriptor.getState() != ServiceState.RUNNING) {
                continue;
            }

            try {
                return new URI(descriptor.getProperties().get("https"));
            }
            catch (Exception ignored) {
            }
            try {
                return new URI(descriptor.getProperties().get("http"));
            }
            catch (Exception ignored) {
            }
        }
        if (config != null) {
            return config.getDiscoveryServiceURI();
        }
        return null;
    }

    @Provides
    @Singleton
    public MergingServiceSelectorFactory createMergingServiceSelectorFactory(
            CachingServiceSelectorFactory factory,
            Announcer announcer,
            NodeInfo nodeInfo)
    {
        return new MergingServiceSelectorFactory(factory, announcer, nodeInfo);
    }

    private static class DiscoveryExecutorProvider
            implements Provider<ScheduledExecutorService>
    {
        private ScheduledExecutorService executor;

        @Override
        public ScheduledExecutorService get()
        {
            checkState(executor == null, "provider already used");
            executor = new ScheduledThreadPoolExecutor(5, daemonThreadsNamed("Discovery-%s"));
            return executor;
        }

        @PreDestroy
        public void destroy()
        {
            if (executor != null) {
                executor.shutdownNow();
            }
        }
    }
}


text:
package com.paypal.selion.platform.mobile.android;

import com.paypal.selion.logger.SeLionLogger;
import com.paypal.selion.platform.grid.SeLionAppiumAndroidDriver;
import com.paypal.selion.platform.mobile.elements.MobileSlider;
import com.paypal.test.utilities.logging.SimpleLogger;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.Point;
import org.openqa.selenium.WebElement;

/**
 * UiSlider represents a Slider widget for Android UI automation framework.
 */
public class UiSlider extends UiObject implements MobileSlider {
    private static final SimpleLogger logger = SeLionLogger.getLogger();
    private static final int MIN_END_X = 1;
    private static final int VALUE_UPPER_LIMIT = 1;

    public UiSlider(String locator) {
        super(locator);
    }

    /**
     * it is not accurate and is best to used only for setting value to 0 or 1, otherwise the result is close to parameter
     * @param value The desired decimal value from 0 to 1, inclusive. 0 represents far left and 1 represent far right.
     */
    @Override
    public void dragToValue(double value) {
        logger.entering(value);
        WebElement webElement = findElement(locator);
        Point currentLocation = webElement.getLocation();
        Dimension elementSize = webElement.getSize();
        int x = currentLocation.getX();
        int y = currentLocation.getY() + (elementSize.getHeight() / 2);
        int pos = Double.valueOf(value * (elementSize.getWidth())).intValue();
        int endX = x + pos;
        // full width will throw exception
        if (value >= VALUE_UPPER_LIMIT) {
            endX--;
        }
        // endX == 0 move to the middle
        if (endX < MIN_END_X) {
            endX = MIN_END_X;
        }
        if (driver instanceof SeLionAppiumAndroidDriver) {
            ((SeLionAppiumAndroidDriver) driver).tap(1, endX, y, 100);
        } else {
            driver.swipe(x, y,endX, y);
        }
        logger.exiting();
    }
}


text:
package com.riversoft.core.script;

/**
 * @author Borball
 *
 */
public interface ScriptExecutor {

    Object evaluateScript(String script, ScriptExecutionContext context);

}


text:
package com.adobe.acs.commons.forms.helpers;

import com.adobe.acs.commons.forms.Form;
import com.day.cq.wcm.api.Page;
import org.apache.sling.api.SlingHttpServletRequest;
import org.apache.sling.api.SlingHttpServletResponse;
import org.apache.sling.api.resource.Resource;
import org.apache.sling.commons.json.JSONException;

import javax.servlet.ServletException;
import java.io.IOException;

public interface FormHelper {
    static final String EXTENSION = ".html";

    static final String DEFAULT_FORM_SELECTOR = "post";
    static final String FORM_NAME_INPUT = ":form";
    static final String FORM_RESOURCE_INPUT = ":formResource";

    /**
	 * Gets the From from either the POST Requests parameters or the GET
	 * request's (synthetic) attributes.
	 *
	 * @param formName
	 * @param request
	 * @return
	 */
	public Form getForm(String formName, SlingHttpServletRequest request);

	/**
	 * Returns a series of hidden fields used to persist multi-page form data
	 * between forms.
	 *
	 * @param form
	 * @param keys
	 * @return
	 * @throws java.io.IOException
	 */
	public String getFormInputsHTML(Form form, String... keys);

    /**
     * Gets the Form Selector for the form POST request
     *
     * @param slingRequest
     * @return
     */
    public String getFormSelector(final SlingHttpServletRequest slingRequest);

    /**
     * Builds the form's action URI based on the provided resource's path
     *
     * Appends ".post.html" to the resource's path.
     *
     * @param resource
     * @return
     */
    public String getAction(final Resource resource);

    /**
     * Builds the form's action URI based on the provided resource's path
     *
     * Appends ".html/<suffix>" to the resource's path.
     *
     * @param resource
     * @param formSelector
     * @return
     */
    public String getAction(final Resource resource, String formSelector);

    /**
     * Builds the form's action URI based on the provided page's path
     *
     * Appends ".html/<suffix>/<formSelector>" to the page's path.
     *
     * @param page
     * @return
     */
    public String getAction(final Page page);

    /**
     * Builds the form's action URI based on the provided page's path
     *
     * Appends ".html/<suffix>/<formSelector>" to the page's path.
     *
     * @param page
     * @param formSelector
     * @return
     */
    public String getAction(final Page page, String formSelector);

    /**
     * Builds the form's action URI based on the provided path
     *
     * Appends ".html/<suffix>" to the path.
     *
     * @param path
     * @return
     */
    public String getAction(final String path);

    /**
     * Builds the form's action URI based on the provided path
     *
     * Appends ".html/<suffix>/<formSelector>" to the path.
     *
     * @param path
     * @param formSelector
     * @return
     */
    public String getAction(final String path, final String formSelector);

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing FormHelper's `render(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     * @param form
     * @param path
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderForm(Form form, String path, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing FormHelper's `render(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     *  @param form
     * @param page
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderForm(Form form, Page page, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing `.renderForm(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     * @param form
     * @param resource
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderForm(Form form, Resource resource, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing FormHelper's `render(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     * @param form
     * @param path
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderOtherForm(Form form, String path, String selectors, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing FormHelper's `render(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     *  @param form
     * @param page
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderOtherForm(Form form, Page page, String selectors, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

    /**
     * Wrapped method to create a interface from FormHelper to normalize APIs that are commonly used.
     *
     *  - Wraps implementing FormHelper's `render(..)` method (sendRedirect or forwardAsGet) in the implementing FormHelper
     *
     * @param form
     * @param resource
     * @param request
     * @param response
     * @throws IOException
     * @throws ServletException
     * @throws JSONException
     */
    public void renderOtherForm(Form form, Resource resource, String selectors, SlingHttpServletRequest request, SlingHttpServletResponse response) throws IOException, ServletException, JSONException;

}


text:
package org.apache.olingo.odata2.api.batch;

import org.apache.olingo.odata2.api.exception.MessageReference;
import org.apache.olingo.odata2.api.exception.ODataMessageException;

public class BatchException extends ODataMessageException {

  /**
   *
   */
  private static final long serialVersionUID = 1L;

  /** INVALID_CHANGESET_BOUNDARY requires 1 content value ('line number') */
  public static final MessageReference INVALID_CHANGESET_BOUNDARY = createMessageReference(BatchException.class,
      "INVALID_CHANGESET_BOUNDARY");

  /** INVALID_BOUNDARY_DELIMITER requires 1 content value ('line number') */
  public static final MessageReference INVALID_BOUNDARY_DELIMITER = createMessageReference(BatchException.class,
      "INVALID_BOUNDARY_DELIMITER");

  /** MISSING_BOUNDARY_DELIMITER requires 1 content value('line number') */
  public static final MessageReference MISSING_BOUNDARY_DELIMITER = createMessageReference(BatchException.class,
      "MISSING_BOUNDARY_DELIMITER");

  /** MISSING_CLOSE_DELIMITER requires 1 content value ('line number') */
  public static final MessageReference MISSING_CLOSE_DELIMITER = createMessageReference(BatchException.class,
      "MISSING_CLOSE_DELIMITER");

  /** MISSONG MANDATORY HEADER requires 1 content value ('header name') */
  public static final MessageReference MISSING_MANDATORY_HEADER = createMessageReference(BatchException.class,
      "MISSING_MANDATORY_HEADER");

  /** INVALID_QUERY_OPERATION_METHOD requires 1 content value ('line number') */
  public static final MessageReference INVALID_QUERY_OPERATION_METHOD = createMessageReference(BatchException.class,
      "INVALID_QUERY_OPERATION_METHOD");

  /** INVALID_CHANGESET_METHOD requires 1 content value ('line number') */
  public static final MessageReference INVALID_CHANGESET_METHOD = createMessageReference(BatchException.class,
      "INVALID_CHANGESET_METHOD");

  /** INVALID_QUERY_PARAMETER requires no content value */
  public static final MessageReference INVALID_QUERY_PARAMETER = createMessageReference(BatchException.class,
      "INVALID_QUERY_PARAMETER");

  /** INVALID_URI requires 1 content value('line number') */
  public static final MessageReference INVALID_URI = createMessageReference(BatchException.class, "INVALID_URI");

  /** INVALID_BOUNDARY requires 1 content value('line number') */
  public static final MessageReference INVALID_BOUNDARY = createMessageReference(BatchException.class,
      "INVALID_BOUNDARY");

  /** NO_MATCH_WITH_BOUNDARY_STRING requires 2 content value ('required boundary', 'line number') */
  public static final MessageReference NO_MATCH_WITH_BOUNDARY_STRING = createMessageReference(BatchException.class,
      "NO_MATCH_WITH_BOUNDARY_STRING");

  /** MISSING_CONTENT_TYPE requires no content value */
  public static final MessageReference MISSING_CONTENT_TYPE = createMessageReference(BatchException.class,
      "MISSING_CONTENT_TYPE");

  /** INVALID_CONTENT_TYPE requires 1 content value ('required content-type') */
  public static final MessageReference INVALID_CONTENT_TYPE = createMessageReference(BatchException.class,
      "INVALID_CONTENT_TYPE");

  /** MISSING_PARAMETER_IN_CONTENT_TYPE requires no content value */
  public static final MessageReference MISSING_PARAMETER_IN_CONTENT_TYPE = createMessageReference(BatchException.class,
      "MISSING_PARAMETER_IN_CONTENT_TYPE");

  /** INVALID_HEADER requires 1 content value ('header', 'line number') */
  public static final MessageReference INVALID_HEADER = createMessageReference(BatchException.class, "INVALID_HEADER");

  /** INVALID_ACCEPT_HEADER requires 1 content value ('header') */
  public static final MessageReference INVALID_ACCEPT_HEADER = createMessageReference(BatchException.class,
      "INVALID_ACCEPT_HEADER");

  /** INVALID_ACCEPT_LANGUAGE_HEADER requires 1 content value ('header') */
  public static final MessageReference INVALID_ACCEPT_LANGUAGE_HEADER = createMessageReference(BatchException.class,
      "INVALID_ACCEPT_LANGUAGE_HEADER");

  /** INVALID_CONTENT_TRANSFER_ENCODING requires 1 content value */
  public static final MessageReference INVALID_CONTENT_TRANSFER_ENCODING = createMessageReference(BatchException.class,
      "INVALID_CONTENT_TRANSFER_ENCODING");

  /** MISSING_BLANK_LINE requires 2 content value ('supplied line','line number') */
  public static final MessageReference MISSING_BLANK_LINE = createMessageReference(BatchException.class,
      "MISSING_BLANK_LINE");

  /** INVALID_PATHINFO requires no content value */
  public static final MessageReference INVALID_PATHINFO = createMessageReference(BatchException.class,
      "INVALID_PATHINFO");

  /** MISSING_METHOD requires 1 content value ('request line') */
  public static final MessageReference MISSING_METHOD = createMessageReference(BatchException.class, "MISSING_METHOD");

  /** INVALID_REQUEST_LINE requires 2 content value ('request line', 'line number') */
  public static final MessageReference INVALID_REQUEST_LINE = createMessageReference(BatchException.class,
      "INVALID_REQUEST_LINE");

  /** INVALID_STATUS_LINE requires 2 content value ('status line', 'line number') */
  public static final MessageReference INVALID_STATUS_LINE = createMessageReference(BatchException.class,
      "INVALID_STATUS_LINE");

  /** TRUNCETED_BODY requires 1 content value ('line number') */
  public static final MessageReference TRUNCATED_BODY = createMessageReference(BatchException.class, "TRUNCATED_BODY");

  /** UNSUPPORTED_ABSOLUTE_PATH requires 1 content value ('line number') */
  public static final MessageReference UNSUPPORTED_ABSOLUTE_PATH = createMessageReference(BatchException.class,
      "UNSUPPORTED_ABSOLUTE_PATH");

  public BatchException(final MessageReference messageReference) {
    super(messageReference);
  }

  public BatchException(final MessageReference messageReference, final Throwable cause) {
    super(messageReference, cause);
  }

  public BatchException(final MessageReference messageReference, final String errorCode) {
    super(messageReference, errorCode);
  }

  public BatchException(final MessageReference messageReference, final Throwable cause, final String errorCode) {
    super(messageReference, cause, errorCode);
  }

}


text:
<?php

namespace App\Http\Controllers\Admin;

use Illuminate\Http\Request;

use App\Http\Requests;

use App\Http\Model\Links;

use Illuminate\Support\Facades\Input;

use  Illuminate\Support\Facades\Validator;

// +--------------------------------+--------------------------------+------------------------+
// | Method                         | URI                            | Name                   |
// +--------------------------------+--------------------------------+------------------------+
// | GET|HEAD                       | admin/links                    | admin.links.index      |
// | POST                           | admin/links                    | admin.links.store      |
// | GET|HEAD                       | admin/links/create             | admin.links.create     |
// | GET|HEAD                       | admin/links/{links}            | admin.links.show       |
// | PUT|PATCH                      | admin/links/{links}            | admin.links.update     |
// | DELETE                         | admin/links/{links}            | admin.links.destroy    |
// | GET|HEAD                       | admin/links/{links}/edit       | admin.links.edit       |
// +--------------------------------+--------------------------------+------------------------+

/**
 * 后台友情链接控制器
 * @return [type] [description]
 */
class LinksController extends CommonController
{
    /**
     * 友情链接列表视图
     * GET|HEAD                       | admin/links                 | admin.links.index
     * @return \Illuminate\Http\Response
     */
    public function index()
    {
        $data = Links::orderBy('sort', 'ASC')->get();

        return view('admin.links.index', compact('data'));
    }

    /**
     * 添加友情链接视图
     * GET|HEAD                       | admin/links/create          | admin.links.create
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        return view('admin.links.add', compact('data'));
    }

    /**
     * Store a newly created resource in storage.
     * POST                           | admin/links                 | admin.links.store
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        $input = Input::except('_token');

        $rules = [
            'name' => 'required',
            'url' => 'required'
        ];

        $message = [
            'name.required' => '请输入链接名称!',
            'url.required' => '请输入URL!'
        ];

        $validator = Validator::make($input, $rules, $message);
        if($validator->passes())
        {
            if(Links::create($input))
            {
                return redirect('admin/links');
            }
            else
            {
                return back()->with('errors', '添加失败,请重试');
            }
        }
        else
        {
            return back()->withErrors($validator->errors($validator));
        }
    }

    /**
     * Display the specified resource.
     * GET|HEAD                       | admin/links/{links}      | admin.links.show
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     * GET|HEAD                       | admin/links/{links}/edit | admin.links.edit
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        $links = Links::find($id);

        return view('admin/links/edit', compact('links'));
    }

    /**
     * Update the specified resource in storage.
     * PUT|PATCH                      | admin/links/{links}      | admin.links.update
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        $input = Input::except(['_token', '_method']);

        $rules = [
            'name' => 'required',
            'url' => 'required'
        ];

        $message = [
            'name.required' => '请输入链接名称!',
            'url.required' => '请输入URL!'
        ];

        $validator = Validator::make($input, $rules, $message);
        if($validator->passes())
        {
            if(Links::where('id', $id)->update($input))
            {
                return redirect('admin/links');
            }
            else
            {
                return back()->with('errors', '您没有修改 或 修改失败,请重试');
            }
        }
        else
        {
            return back()->withErrors($validator->errors($validator));
        }

    }

    /**
     * Remove the specified resource from storage.
     * DELETE                         | admin/links/{links}      | admin.links.destroy
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        if(Links::where('id', $id)->delete())
        {
            return 0; // 删除成功,返回错误码0
        }
        else
        {
            return 1; // 删除失败,返回错误码1
        }
    }

    /**
     * 异步更新友情链接的排序字段`sort`
     * @return [type] [description]
     */
    public function changeSort()
    {
        $input = Input::all();

        if(Links::where('id', $input['id'])->update(['sort' => $input['sort']]))
        {
            return 1;
        }
        else
        {
            return 0;
        }
    }
}


text:
<?php

namespace Oro\Bundle\CalendarBundle\Tests\Unit\Manager;

use Oro\Bundle\CalendarBundle\Manager\AttendeeRelationManager;
use Oro\Bundle\CalendarBundle\Entity\Attendee as AttendeeEntity;
use Oro\Bundle\CalendarBundle\Tests\Unit\Fixtures\Entity\Attendee;
use Oro\Bundle\CalendarBundle\Tests\Unit\Fixtures\Entity\User;
use Oro\Bundle\UserBundle\Entity\Email;

class AttendeeRelationManagerTest extends \PHPUnit_Framework_TestCase
{
    /** @var AttendeeRelationManager */
    protected $attendeeRelationManager;

    /** @var User[] */
    protected $users;

    public function setUp()
    {
        $this->users = [
            'u1@example.com' => (new User())->setEmail('u1@example.com'),
            'u2@example.com' => (new User())->addEmail((new Email())->setEmail('u2@example.com')),
            'u3@example.com' => (new User())->setEmail('u3@example.com'),
            'u4@example.com' => (new User())->setEmail('u4@example.com'),
        ];

        $userRepository = $this->getMockBuilder('Oro\Bundle\UserBundle\Entity\Repository\UserRepository')
            ->disableOriginalConstructor()
            ->getMock();
        $userRepository->expects($this->any())
            ->method('findUsersByEmails')
            ->will($this->returnCallback(function (array $emails) {
                return array_values(array_intersect_key($this->users, array_flip($emails)));
            }));

        $registry = $this->getMock('Doctrine\Common\Persistence\ManagerRegistry');
        $registry
            ->expects($this->any())
            ->method('getRepository')
            ->with('OroUserBundle:User')
            ->will($this->returnValue($userRepository));

        $nameFormatter = $this->getMockBuilder('Oro\Bundle\LocaleBundle\Formatter\NameFormatter')
            ->disableOriginalConstructor()
            ->getMock();

        $nameFormatter->expects($this->any())
            ->method('format')
            ->will($this->returnCallback(function ($person) {
                return $person->getFullName();
            }));

        $dqlNameFormatter = $this->getMockBuilder('Oro\Bundle\LocaleBundle\DQL\DQLNameFormatter')
            ->disableOriginalConstructor()
            ->getMock();

        $this->attendeeRelationManager = new AttendeeRelationManager($registry, $nameFormatter, $dqlNameFormatter);
    }

    /**
     * @dataProvider createAttendeeProvider
     */
    public function testCreateAttendee($relatedEntity, $expectedAttendee)
    {
        $this->assertEquals($expectedAttendee, $this->attendeeRelationManager->createAttendee($relatedEntity));
    }

    public function createAttendeeProvider()
    {
        $user = (new User())
            ->setFirstName('first')
            ->setLastName('last')
            ->setEmail('email@example.com');

        return [
            [
                null,
                null
            ],
            [
                new AttendeeEntity(),
                null,
            ],
            [
                $user,
                (new AttendeeEntity())
                    ->setDisplayName('first last')
                    ->setEmail('email@example.com')
                    ->setUser($user),
            ]
        ];
    }

    public function testGetRelatedEntity()
    {
        $user = new User();
        $attendee = (new Attendee())
            ->setUser($user);

        $this->assertSame($user, $this->attendeeRelationManager->getRelatedEntity($attendee));
    }

    /**
     * @dataProvider getRelatedDisplayNameProvider
     */
    public function testGetRelatedDisplayName($attendee, $expectedDisplayName)
    {
        $this->assertEquals($expectedDisplayName, $this->attendeeRelationManager->getRelatedDisplayName($attendee));
    }

    public function getRelatedDisplayNameProvider()
    {
        return [
            [
                (new Attendee())
                    ->setDisplayName('display name'),
                'display name'
            ],
            [
                (new Attendee())
                    ->setUser(
                        (new User())
                            ->setFirstName('first')
                            ->setLastName('last')
                    ),
                'first last'
            ],
            [
                (new Attendee())
                    ->setDisplayName('display name')
                    ->setUser(
                        (new User())
                            ->setFirstName('first')
                            ->setLastName('last')
                    ),
                'first last'
            ],
        ];
    }

    public function testBindAttendees()
    {
        $attendees = $this->getInitialAttendees();
        $this->attendeeRelationManager->bindAttendees($attendees);

        $this->assertEquals($this->getExpectedAttendees(), $attendees);
    }

    protected function getInitialAttendees()
    {
        return [
            (new Attendee(1))
                ->setEmail('u1@example.com'),
            (new Attendee())
                ->setEmail('u2@example.com'),
            (new Attendee())
                ->setEmail('u3@example.com'),
            (new Attendee())
                ->setEmail('nonExisting@example.com'),
            (new Attendee())
                ->setEmail('u4@example.com')
                ->setUser(new User()),
        ];
    }

    protected function getExpectedAttendees()
    {
        return [
            (new Attendee(1))
                ->setEmail('u1@example.com')
                 ->setUser($this->users['u1@example.com'])
                 ->setDisplayName($this->users['u1@example.com']->getFullName()),
            (new Attendee())
                ->setEmail('u2@example.com')
                ->setUser($this->users['u2@example.com'])
                ->setDisplayName($this->users['u2@example.com']->getFullName()),
            (new Attendee())
                ->setEmail('u3@example.com')
                ->setUser($this->users['u3@example.com'])
                ->setDisplayName($this->users['u3@example.com']->getFullName()),
            (new Attendee())
                ->setEmail('nonExisting@example.com'),
            (new Attendee())
                ->setEmail('u4@example.com')
                ->setUser(new User()),
        ];
    }
}


text:
package com.roothema.cloud.patterns.testing.domain;

/**
 * Created by roothema on 2015.04.29..
 */
public class DummyDomainObject {

    private final String message;
    private final String from;
    private final String to;

    public DummyDomainObject(String message, String from, String to) {
        this.message =  message;
        this.from = from;
        this.to = to;
    }
}


text:
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Rendering;

namespace Microsoft.MixedReality.Toolkit.Utilities
{
    /// <summary>
    /// Component which can be used to render an outline around a mesh renderer. Enabling this component introduces an additional render pass
    /// of the object being outlined, but is designed to run performantly on mobile Mixed Reality devices and does not utilize any post processes.
    /// This behavior is designed to be used in conjunction with the MRTK/Standard shader. Limitations of this effect include it not working well
    /// on objects which are not watertight (or required to be two sided) and depth sorting issues can occur on overlapping objects.
    /// </summary>
    [RequireComponent(typeof(MeshRenderer))]
    [AddComponentMenu("Scripts/MRTK/Core/MeshOutline")]
    public class MeshOutline : BaseMeshOutline
    {
        private const string vertexExtrusionKeyword = "_VERTEX_EXTRUSION";
        private const string vertexExtrusionSmoothNormalsKeyword = "_VERTEX_EXTRUSION_SMOOTH_NORMALS";
        private const string vertexExtrusionValueName = "_VertexExtrusionValue";

        private MeshRenderer meshRenderer = null;
        private MaterialPropertyBlock propertyBlock = null;
        private int vertexExtrusionValueID = 0;
        private Material[] defaultMaterials = null;
        private MeshSmoother createdMeshSmoother = null;

        #region MonoBehaviour Implementation

        /// <summary>
        /// Gathers initial render state.
        /// </summary>
        private void Awake()
        {
            meshRenderer = GetComponent<MeshRenderer>();
            propertyBlock = new MaterialPropertyBlock();
            vertexExtrusionValueID = Shader.PropertyToID(vertexExtrusionValueName);
            defaultMaterials = meshRenderer.sharedMaterials;
        }

        /// <summary>
        /// Enables the outline.
        /// </summary>
        private void OnEnable()
        {
            ApplyOutlineMaterial();
        }

        /// <summary>
        /// Resets the renderer materials to the default settings.
        /// </summary>
        private void OnDisable()
        {
            meshRenderer.materials = defaultMaterials;
        }

        /// <summary>
        /// Removes any components this component has created.
        /// </summary>
        private void OnDestroy()
        {
            Destroy(createdMeshSmoother);
        }

        #endregion MonoBehaviour Implementation

        #region BaseMeshOutline Implementation

        /// <summary>
        /// Prepares and applies the current outline material to the renderer.
        /// </summary>
        protected override void ApplyOutlineMaterial()
        {
            if (outlineMaterial != null && meshRenderer != null)
            {
                Debug.AssertFormat(outlineMaterial.IsKeywordEnabled(vertexExtrusionKeyword),
                                   "The material \"{0}\" does not have vertex extrusion enabled, no outline will be rendered.", outlineMaterial.name);

                // Ensure that the outline material always renders before the default materials.
                outlineMaterial.renderQueue = GetMinRenderQueue(defaultMaterials) - 1;

                // If smooth normals are requested, make sure the mesh has smooth normals.
                if (outlineMaterial.IsKeywordEnabled(vertexExtrusionSmoothNormalsKeyword))
                {
                    var meshSmoother = (createdMeshSmoother == null) ? gameObject.GetComponent<MeshSmoother>() : createdMeshSmoother;

                    if (meshSmoother == null)
                    {
                        createdMeshSmoother = gameObject.AddComponent<MeshSmoother>();
                        meshSmoother = createdMeshSmoother;
                    }

                    meshSmoother.SmoothNormals();
                }

                ApplyOutlineWidth();

                // Add the outline material as another material pass.
                var materials = new List<Material>(defaultMaterials);
                materials.Add(outlineMaterial);
                meshRenderer.materials = materials.ToArray();
            }
        }

        /// <summary>
        /// Updates the current vertex extrusion value used by the shader.
        /// </summary>
        protected override void ApplyOutlineWidth()
        {
            if (meshRenderer != null && propertyBlock != null)
            {
                meshRenderer.GetPropertyBlock(propertyBlock);
                propertyBlock.SetFloat(vertexExtrusionValueName, outlineWidth);
                meshRenderer.SetPropertyBlock(propertyBlock);
            }
        }

        #endregion BaseMeshOutline Implementation

        /// <summary>
        /// Searches for the minimum render queue value in a list of materials.
        /// </summary>
        /// <param name="materials">The list of materials to search.</param>
        /// <returns>The minimum render queue value.</returns>
        private static int GetMinRenderQueue(Material[] materials)
        {
            var min = int.MaxValue;

            foreach (var material in materials)
            {
                if (material != null)
                {
                    min = Mathf.Min(min, material.renderQueue);
                }
            }

            if (min == int.MaxValue)
            {
                min = (int)RenderQueue.Background;
            }

            return min;
        }
    }
}


text:
import datetime
from typing import Iterator
import uuid

from google.cloud import bigquery
import pytest

import view

def temp_suffix() -> str:
    now = datetime.datetime.now()
    return f"{now.strftime('%Y%m%d%H%M%S')}_{uuid.uuid4().hex[:8]}"

@pytest.fixture(autouse=True)
def bigquery_client_patch(
    monkeypatch: pytest.MonkeyPatch, bigquery_client: bigquery.Client
) -> None:
    monkeypatch.setattr(bigquery, "Client", lambda: bigquery_client)

@pytest.fixture(scope="module")
def view_dataset_id(bigquery_client: bigquery.Client, project_id: str) -> Iterator[str]:
    dataset_id = f"{project_id}.view_{temp_suffix()}"
    bigquery_client.create_dataset(dataset_id)
    yield dataset_id
    bigquery_client.delete_dataset(dataset_id, delete_contents=True)

@pytest.fixture(scope="module")
def view_id(bigquery_client: bigquery.Client, view_dataset_id: str) -> Iterator[str]:
    view_id = f"{view_dataset_id}.my_view"
    yield view_id
    bigquery_client.delete_table(view_id, not_found_ok=True)

@pytest.fixture(scope="module")
def source_dataset_id(
    bigquery_client: bigquery.Client, project_id: str
) -> Iterator[str]:
    dataset_id = f"{project_id}.view_{temp_suffix()}"
    bigquery_client.create_dataset(dataset_id)
    yield dataset_id
    bigquery_client.delete_dataset(dataset_id, delete_contents=True)

@pytest.fixture(scope="module")
def source_table_id(
    bigquery_client: bigquery.Client, source_dataset_id: str
) -> Iterator[str]:
    source_table_id = f"{source_dataset_id}.us_states"
    job_config = bigquery.LoadJobConfig(
        schema=[
            bigquery.SchemaField("name", "STRING"),
            bigquery.SchemaField("post_abbr", "STRING"),
        ],
        skip_leading_rows=1,
    )
    load_job = bigquery_client.load_table_from_uri(
        "gs://cloud-samples-data/bigquery/us-states/us-states.csv",
        source_table_id,
        job_config=job_config,
    )
    load_job.result()
    yield source_table_id
    bigquery_client.delete_table(source_table_id, not_found_ok=True)

def test_view(
    capsys: pytest.CaptureFixture[str],
    view_id: str,
    view_dataset_id: str,
    source_table_id: str,
    source_dataset_id: str,
) -> None:
    override_values = {
        "view_id": view_id,
        "source_id": source_table_id,
    }
    got = view.create_view(override_values)
    assert source_table_id in got.view_query
    out, _ = capsys.readouterr()
    assert view_id in out

    got = view.get_view(override_values)
    assert source_table_id in got.view_query
    assert "'W%'" in got.view_query
    out, _ = capsys.readouterr()
    assert view_id in out
    assert source_table_id in out
    assert "'W%'" in out

    got = view.update_view(override_values)
    assert source_table_id in got.view_query
    assert "'M%'" in got.view_query
    out, _ = capsys.readouterr()
    assert view_id in out

    project_id, dataset_id, table_id = view_id.split(".")
    overrides: view.OverridesDict = {
        "analyst_group_email": "cloud-dpes-bigquery@google.com",
        "view_dataset_id": view_dataset_id,
        "source_dataset_id": source_dataset_id,
        "view_reference": {
            "projectId": project_id,
            "datasetId": dataset_id,
            "tableId": table_id,
        },
    }
    view_dataset, source_dataset = view.grant_access(overrides)
    assert len(view_dataset.access_entries) != 0
    assert len(source_dataset.access_entries) != 0
    out, _ = capsys.readouterr()
    assert "cloud-dpes-bigquery@google.com" in out
    assert table_id in out


text:
require_migration

describe CopyAgentIdToMiqServerIdInJobsTable do
  let(:job_stub) { migration_stub(:Job) }
  let(:job_name) { "Hello Test Job" }

  migration_context :up do
    it "copies data from 'agent_id' to 'miq_server_id' column on jobs table" do
      job = job_stub.create!(:name => job_name, :agent_id => 111)

      migrate

      expect(job.reload.miq_server_id).to eq 111
    end
  end

  migration_context :down do
    it "nullifies 'miq_server_id' column on jobs table" do
      job = job_stub.create!(:name => job_name, :miq_server_id => 111)

      migrate

      expect(job.reload.miq_server_id).to be_nil
    end
  end
end


text:
import Worker
from copy import copy
import numpy as np

class Species(object):
    def __init__(self, worker, maxAge):
        self.age = 0
        self.worker = worker
        self.maxAge = maxAge
        self.bestWorker = copy(worker)
        self.bestFitness = self.bestWorker.fitness
        self.bestGenome = self.bestWorker.genome
        self.lastImprovement = 0
        self.mutationRate = 0.2
        self.completionFlag = False
        self.numImprovements = 1
    def evaluate_worker(self):
        self.age += 1
        self.lastImprovement += 1
        self.mutationRate = max(np.exp(-self.numImprovements),0.05)
        self.worker.mutate_genome(self.age,mutationRate=self.mutationRate)
        self.worker.evaluate_genome()
        self.set_best()
        self.worker.mutate_random_parameter(self.age)
        self.worker.evaluate_genome()
        self.set_best()
        #print(self.worker.genome)
    def set_best(self):
        if self.worker.fitness >= self.bestWorker.fitness:
            self.lastImprovement = 0
            self.numImprovements+=1
            self.bestWorker = copy(self.worker)
            self.bestFitness = self.bestWorker.fitness
            self.bestGenome = self.bestWorker.genome
        else:
            del self.worker
            self.worker = copy(self.bestWorker)
    def speciate(self):
        if float(self.lastImprovement)>=self.maxAge*0.25:
            self.numImprovements = 1
        if self.age>=self.maxAge or float(self.lastImprovement) >= 10 + self.age/2:
            self.completionFlag=True
    def report(self):
        output = "-Species report-\nBest fitness: {}\nBest genome: {}".format(self.bestFitness, self.bestGenome)
        return output


text:
using System.Collections.Generic;
using Microsoft.VisualStudio.Debugger.Interop;

namespace Microsoft.PythonTools.Debugger.DebugEngine {
    // This class manages breakpoints for the engine.
    class BreakpointManager {
        private AD7Engine m_engine;
        private System.Collections.Generic.List<AD7PendingBreakpoint> m_pendingBreakpoints;
        private Dictionary<PythonBreakpoint, AD7BoundBreakpoint> _breakpointMap = new Dictionary<PythonBreakpoint, AD7BoundBreakpoint>();

        public BreakpointManager(AD7Engine engine) {
            m_engine = engine;
            m_pendingBreakpoints = new System.Collections.Generic.List<AD7PendingBreakpoint>();
        }

        // A helper method used to construct a new pending breakpoint.
        public void CreatePendingBreakpoint(IDebugBreakpointRequest2 pBPRequest, out IDebugPendingBreakpoint2 ppPendingBP) {
            AD7PendingBreakpoint pendingBreakpoint = new AD7PendingBreakpoint(pBPRequest, m_engine, this);
            ppPendingBP = (IDebugPendingBreakpoint2)pendingBreakpoint;
            m_pendingBreakpoints.Add(pendingBreakpoint);
        }

        // Called from the engine's detach method to remove the debugger's breakpoint instructions.
        public void ClearBoundBreakpoints() {
            foreach (AD7PendingBreakpoint pendingBreakpoint in m_pendingBreakpoints) {
                pendingBreakpoint.ClearBoundBreakpoints();
            }
        }

        public void AddBoundBreakpoint(PythonBreakpoint breakpoint, AD7BoundBreakpoint boundBreakpoint) {
            _breakpointMap[breakpoint] = boundBreakpoint;
        }

        public void RemoveBoundBreakpoint(PythonBreakpoint breakpoint) {
            _breakpointMap.Remove(breakpoint);
        }

        public AD7BoundBreakpoint GetBreakpoint(PythonBreakpoint breakpoint) {
            return _breakpointMap[breakpoint];
        }
    }
}


text:
import java.io.*;
import java.util.*;

public class Solution{
    public static void main(String[] args) throws IOException {
        StringBuffer sb = new StringBuffer();
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        int N = Integer.parseInt(br.readLine());
        int[] A = new int[N];

        N = 0;
        for(String a : br.readLine().split(" ")){
            A[N++] = Integer.parseInt(a);
        }

        Tree tree = new Tree();
        for(int a : A){
            tree.add(a);
            sb.append(tree.getDistance() + "\n");
        }

        System.out.print(sb);
    }
    public static class Tree{
        private Node root;
        private long treeDistance;

        public Tree(){
            this.root = null;
            this.treeDistance = 0L;
        }

        public void add(int value){

            if (this.root == null){
                this.root = new Node(value);
                return;
            }

            List<Node> parents = new ArrayList<Node>();

            Node node = this.root;
            do {

                node.size++;
                parents.add(node);

                if (value < node.value){
                    if (node.left == null){
                        node = node.left = new Node(value);
                        break;
                    }
                    node = node.left;
                } else {
                    if (node.right == null){
                        node = node.right = new Node(value);
                        break;
                    }
                    node = node.right;
                }

            } while (true);

            int depth = 0;
            for(int i = parents.size() - 1; i >= 0; --i){
                Node parent = parents.get(i);

                parent.distance += ++depth;

                this.treeDistance += ((long)depth)*(parent.size - node.size) + (parent.distance - node.distance - node.size);

                node = parent;
            }
        }

        public long getDistance(){
            return this.treeDistance;
        }

        private class Node{
            public Node left;
            public Node right;
            public int size;
            public int value;
            public long distance;

            public Node(int value){
                this.value = value;
                this.left = null;
                this.right = null;
                this.size = 1;
                this.distance = 0L;
            }
        }
    }
}


text:
<?php
namespace Ent\VisualComposer;

use Ent\VisualComposer\Traits\RenderComponent;

class ShortCode extends \WPBakeryShortCode {
    use RenderComponent;
}


text:
#include <boost/thread.hpp>
#include <boost/foreach.hpp>
#include <boost/function.hpp>
#include <boost/smart_ptr.hpp>
#include <boost/make_shared.hpp>

#include "visensor/visensor_datatypes.hpp"
#include "serial_bridge/SerialHost.hpp"

namespace visensor {

SerialHost::SerialHost()
{
  //start processing thread
  worker_thread = boost::make_shared<boost::thread>(&SerialHost::processSerialData, this);
}

SerialHost::~SerialHost() {
  //stop thread
  try {
    if(worker_thread)
      worker_thread->interrupt();
  } catch (const std::exception &ex) {
    VISENSOR_DEBUG("SerialHost exception in destructor: %s\n", ex.what());
  }

  //wait for it to stop
  worker_thread->join();
}

//the threaded function that works on the queue of finished measurements
void SerialHost::processSerialData() {

  while (1) {
    boost::this_thread::interruption_point();

    //get the newest measurement (waits if no new msgs available..)
    ViSerialData::Ptr data_ptr = data_queue_.pop();

    //send out to user application
    publishSerialData(data_ptr);
  }
}

void SerialHost::setSerialDataCallback(boost::function<void(ViSerialData::Ptr)> callback) {
  user_callbacks_.push_back(callback);
}

void SerialHost::publishSerialData(ViSerialData::Ptr& data_ptr) {
  if (user_callbacks_.empty() == 0) {
    BOOST_FOREACH( boost::function<void(ViSerialData::Ptr)> callback, user_callbacks_)
        { callback(data_ptr); }
  }
}

void SerialHost::addDataToPublishQueue(ViSerialData::Ptr data_ptr)
{
  data_queue_.push(data_ptr);
}

} /* namespace visensor */


text:
<!DOCTYPE html>

    <title></title>
    <link rel="stylesheet" type="text/css" href="lib/jasmine-1.3.1/jasmine.css">

    <input      data-key="k1" id="in-text" type="text" />
    <textarea   data-key="k2" id="textarea" rows="5" cols="30"></textarea>
    <input      data-key="k3" id="in-checkbox" type="checkbox"/>
    <input      data-key="k4" id="in-radio" type="radio"/>
    <select     data-key="k5" id="select" name="select">
        <option value="value1">Value 1</option>
        <option value="value2" selected>Value 2</option>
        <option value="value3">Value 3</option>
    </select>
    <select     data-key="k6" id="select-mul" multiple="true">
        <option value="value1">Value 1</option>
        <option value="value2" selected>Value 2</option>
        <option value="value3">Value 3</option>
    </select>

dd

    ss
    ss2

        <input      data-key="k10.k101" type="text" />

                <h data-key="k10.k102">Deep H</h>


text:
#ifndef OTIUM_CHECK_BOX_H
#define OTIUM_CHECK_BOX_H

#define OTIUM_CHECK_BOX_TEXT_OFFSET 3

namespace Otium
{

class CheckBox : public Input
{
OTIUM_DECL_INTERNAL_ID(CheckBox);

public:
	enum State
	{
		STATE_DEFAULT = 0,
		STATE_ACTIVE,

		STATE_COUNT
	};

private:
	State _state;

	SrcPosition _sx[STATE_COUNT];
	SrcPosition _sy[STATE_COUNT];
	SrcSize     _sw;
	SrcSize     _sh;

public:
	CheckBox(const char* name)
		: Input(name),  _state(STATE_DEFAULT)
	{
		GetText()->SetAlignment(ALIGN_CENTER_Y);
	}

	virtual ~CheckBox()
	{
	}

	/* override */
	void OnMouseButtonEvent(Position x, Position y, MouseButton button, bool down)
	{
		if (down && In(x, y))
		{
			_state = _state == STATE_DEFAULT ? STATE_ACTIVE : STATE_DEFAULT;

			if (Click)
				Click(this, x, y);
		}
	}

	/* override */
	void OnRender()
	{
		IManager::Get()->Render(GetAbsX(), GetAbsY(), GetWidth(), GetHeight(), GetSrcX(_state), GetSrcY(_state), GetSrcWidth(), GetSrcHeight());

		GetText()->Render(GetAbsX() + OTIUM_CHECK_BOX_TEXT_OFFSET + static_cast<Position>(GetWidth()), GetAbsY() + static_cast<Position>(GetHeight() / static_cast<Size>(2)));
	}

	inline SrcPosition GetSrcX(State state) const { return _sx[state]; }

	inline SrcPosition GetSrcY(State state) const { return _sy[state]; }

	inline SrcSize GetSrcWidth() const { return _sw; }

	inline SrcSize GetSrcHeight() const { return _sh; }

	inline State GetState() const { return _state; }

	inline void SetSrcX(State state, SrcPosition sx) { _sx[state] = sx; }

	inline void SetSrcY(State state, SrcPosition sy) { _sy[state] = sy; }

	inline void SetSrcWidth(SrcSize sw) { _sw = sw; }

	inline void SetSrcHeight(SrcSize sh)  { _sh = sh; }

	inline void SetSrcPosition(State state, SrcPosition sx, SrcPosition sy) { _sx[state] = sx; _sy[state] = sy; }

	inline void SetSrcSize(SrcSize sw, SrcSize sh) { _sw = sw; _sh = sh; }
};

}

#undef OTIUM_CHECK_BOX_TEXT_OFFSET

#endif


text:
<?php

namespace Symfony\Component\Validator;

/**
 * Default implementation of the ConstraintValidatorFactoryInterface.
 *
 * This enforces the convention that the validatedBy() method on any
 * Constraint will return the class name of the ConstraintValidator that
 * should validate the Constraint.
 */
class ConstraintValidatorFactory implements ConstraintValidatorFactoryInterface
{
    protected $validators = array();

    /**
     * {@inheritdoc}
     */
    public function getInstance(Constraint $constraint)
    {
        $className = $constraint->validatedBy();

        if (!isset($this->validators[$className]) || $className === 'Symfony\Component\Validator\Constraints\CollectionValidator') {
            $this->validators[$className] = new $className();
        }

        return $this->validators[$className];
    }
}


text:
import React, {Component, PropTypes} from 'react'
import Text from 'Components/Text'
import Select from 'Components/Select'
import Checkbox from 'Components/Checkbox'
import Calendar from 'Components/Calendar'

class FormItem extends Component {
    state = {
        Input: '',
        Checked: false,
        shouldUpdate: true
    };

    componentWillMount(){
        let item = this.props.item
        if (typeof item.value !== 'undefined'){
            this.state.Input = item.value
            this.state.Checked = item.value
        }
    }

    componentWillReceiveProps(nextProps) {
        let item = nextProps.item
        if (item.length) {
            this.setState(this.state)
        }
        if (typeof item.value !== 'undefined') {
            this.state.uInput = item.value
            this.state.uCheck = item.value
            this.setState(this.state)
        }
        else if (item.valueLabel === this.props.valueLabel
            && item.dispLabel === this.props.dispLabel
            && item.disabled === this.props.disabled) {
            this.state.shouldUpdate = false
        }
    }

    _buttonAct(e, item) {
        let value = item.value
        let param = (typeof item.param == 'undefined' ? {} : item.param)
        if (typeof item.trigger == 'string') {
            this.props[item.trigger](value, param)
        } else if (typeof item.trigger == 'function') {
            item.trigger(value, param)
        }
    }

    render(){
        const { item, className, ...props } = this.props

        const formItem = function(item,idx) {
            let trigger = typeof item.trigger === 'function' ? item.trigger : props[item.trigger]
            let displayLabel = typeof item.dispLabel === 'function' ? item.dispLabel() : item.dispLabel
            let valueLabel = typeof item.valueLabel === 'function' ? item.valueLabel() : item.valueLabel
            if (displayLabel !== 0 && !displayLabel){
                displayLabel = ''
            }
            if (valueLabel !== 0 && !valueLabel){
                valueLabel = ''
            }
            switch (item.type){
                case 'button':
                    return (
                        this._buttonAct(e,item)}>
                            {displayLabel}

                    )
                case 'img':
                    return (
                        this._buttonAct(e,item)} alt={item.dispLabel}>

                    )
                case 'badge':
                    return (

                            {displayLabel ? {displayLabel} : null}
                             this._buttonAct(e, item)}>

                    )
                    break
                case 'text':
                    return (
                        <Text { ...item } trigger={trigger} key={idx}/>
                    )
                    break
                case 'select':
                    return (
                        <Select { ...item } trigger={trigger} key={idx}/>
                    )
                    break
                case 'date':
                    return (
                        <Calendar { ...item } trigger={trigger} key={idx}/>
                    )
                    break
                case 'checkbox':
                    return (
                        <Checkbox { ...item } trigger={trigger} key={idx}/>
                    )
                    break
                case 'plain':
                default:
                    let title =  item.title? item.title: null
                    return (

                            {displayLabel ? {displayLabel} : null}
                            {valueLabel}

                    )
                    break
            }
        }
        let classname = className ? className + ' form-group':'form-group'
        classname = classname +' form-group-'+(item.type||'plain')
        if(item.list&&item.type=='form'){
            classname = item.className ? item.classNameOverride ? item.className : item.className + ' form-group ' : classname
            return (

                    {item.list.map((i, index) => innerItem.call(this, i, index))}

            )
        }
        return (

                {(item.length ?
                    item.map((i, index) => {
                        return formItem.call(this, i, index)
                    })
                    : formItem.call(this, item, 0))}
                {(item.errorInfo ?
                    {item.errorInfo}
                    : null)}
                {(!item.errorInfo && item.info ?
                    {item.info}
                    : null)}
                {(!item.errorInfo && item.hint ?
                    {item.hint}
                    : null)}

        )
    }
}

export default FormItem


text:
var builder = require('botbuilder');

module.exports = {
    Label: 'Is Not SRL Member',
    Dialog: [

        function (session) {
            return session.endDialog();
        },
    ]
}


text:
<?php

// No direct access.
defined('_JEXEC') or die;

// Include the component HTML helpers.
JHtml::addIncludePath(JPATH_COMPONENT.'/helpers/html');

// Load the tooltip behavior.
JHtml::_('behavior.tooltip');
JHtml::_('behavior.multiselect');

$user		= JFactory::getUser();
$listOrder	= $this->escape($this->state->get('list.ordering'));
$listDirn	= $this->escape($this->state->get('list.direction'));
$canOrder	= $user->authorise('core.edit.state', 'com_users');
$saveOrder	= $listOrder == 'a.ordering';
?>
<form action="<?php echo JRoute::_('index.php?option=com_users&view=levels');?>" method="post" id="adminForm" name="adminForm">
	<fieldset id="filter-bar">

			<?php echo JText::_('COM_USERS_SEARCH_ACCESS_LEVELS'); ?>
			<input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" title="<?php echo JText::_('COM_USERS_SEARCH_TITLE_LEVELS'); ?>" />
			<button type="submit"><?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button>
			<button type="button" onclick="document.id('filter_search').value='';this.form.submit();"><?php echo JText::_('JSEARCH_RESET'); ?></button>

	</fieldset>

					<input type="checkbox" name="checkall-toggle" value="" title="<?php echo JText::_('JGLOBAL_CHECK_ALL'); ?>" onclick="Joomla.checkAll(this)" />

					<?php echo JHtml::_('grid.sort', 'COM_USERS_HEADING_LEVEL_NAME', 'a.title', $listDirn, $listOrder); ?>

					<?php echo JHtml::_('grid.sort',  'JGRID_HEADING_ORDERING', 'a.ordering', $listDirn, $listOrder); ?>
					<?php if ($canOrder && $saveOrder) :?>
						<?php echo JHtml::_('grid.order',  $this->items, 'filesave.png', 'levels.saveorder'); ?>
					<?php endif; ?>

					<?php echo JText::_('JGRID_HEADING_ID'); ?>

					<?php echo $this->pagination->getListFooter(); ?>

		<?php $count = count($this->items); ?>
		<?php foreach ($this->items as $i => $item) :
			$ordering	= ($listOrder == 'a.ordering');
			$canCreate	= $user->authorise('core.create',		'com_users');
			$canEdit	= $user->authorise('core.edit',			'com_users');
			$canChange	= $user->authorise('core.edit.state',	'com_users');
			?>
			<tr class="row<?php echo $i % 2; ?>">

					<?php echo JHtml::_('grid.id', $i, $item->id); ?>

					<?php if ($canEdit) : ?>
					<a href="<?php echo JRoute::_('index.php?option=com_users&task=level.edit&id='.$item->id);?>">
						<?php echo $this->escape($item->title); ?>
					<?php else : ?>
						<?php echo $this->escape($item->title); ?>
					<?php endif; ?>

					<?php if ($canChange) : ?>
						<?php if ($saveOrder) :?>
							<?php if ($listDirn == 'asc') : ?>
								<?php echo $this->pagination->orderUpIcon($i, true, 'levels.orderup', 'JLIB_HTML_MOVE_UP', $ordering); ?>
								<?php echo $this->pagination->orderDownIcon($i, $count, true, 'levels.orderdown', 'JLIB_HTML_MOVE_DOWN', $ordering); ?>
							<?php elseif ($listDirn == 'desc') : ?>
								<?php echo $this->pagination->orderUpIcon($i, true, 'levels.orderdown', 'JLIB_HTML_MOVE_UP', $ordering); ?>
								<?php echo $this->pagination->orderDownIcon($i, $count, true, 'levels.orderup', 'JLIB_HTML_MOVE_DOWN', $ordering); ?>
							<?php endif; ?>
						<?php endif; ?>
						<?php $disabled = $saveOrder ?  '' : 'disabled="disabled"'; ?>
						<input type="text" name="order[]" size="5" value="<?php echo $item->ordering;?>" <?php echo $disabled ?> class="text-area-order" />
					<?php else : ?>
						<?php echo $item->ordering; ?>
					<?php endif; ?>

					<?php echo (int) $item->id; ?>

		<?php endforeach; ?>

		<input type="hidden" name="task" value="" />
		<input type="hidden" name="boxchecked" value="0" />
		<input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" />
		<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" />
		<?php echo JHtml::_('form.token'); ?>

</form>