/*
 * Copyright 1994-2003 Sun Microsystems, Inc.  All Rights Reserved.
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
 *
 * This code is free software; you can redistribute it and/or modify it
 * under the terms of the GNU General Public License version 2 only, as
 * published by the Free Software Foundation.  Sun designates this
 * particular file as subject to the "Classpath" exception as provided
 * by Sun in the LICENSE file that accompanied this code.
 *
 * This code is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 * version 2 for more details (a copy is included in the LICENSE file that
 * accompanied this code).
 *
 * You should have received a copy of the GNU General Public License version
 * 2 along with this work; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
 *
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
 * CA 95054 USA or visit www.sun.com if you need additional information or
 * have any questions.
 */

package sun.tools.tree;

import sun.tools.java.*;
import sun.tools.asm.Label;
import sun.tools.asm.Assembler;
import java.io.PrintStream;
import java.util.Hashtable;

/**
 * WARNING: The contents of this source file are not part of any
 * supported API.  Code that depends on them does so at its own risk:
 * they are subject to change or removal without notice.
 */
public
class BinaryExpression extends UnaryExpression {
    Expression left;

    /**
     * Constructor
     */
    BinaryExpression(int op, long where, Type type, Expression left, Expression right) {
        super(op, where, type, right);
        this.left = left;
    }

    /**
     * Order the expression based on precedence
     */
    public Expression order() {
        if (precedence() > left.precedence()) {
            UnaryExpression e = (UnaryExpression)left;
            left = e.right;
            e.right = order();
            return e;
        }
        return this;
    }

    /**
     * Check a binary expression
     */
    public Vset checkValue(Environment env, Context ctx, Vset vset, Hashtable exp) {
        vset = left.checkValue(env, ctx, vset, exp);
        vset = right.checkValue(env, ctx, vset, exp);

        int tm = left.type.getTypeMask() | right.type.getTypeMask();
        if ((tm & TM_ERROR) != 0) {
            return vset;
        }
        selectType(env, ctx, tm);

        if (type.isType(TC_ERROR)) {
            env.error(where, "invalid.args", opNames[op]);
        }
        return vset;
    }

    /**
     * Check if constant
     */
    public boolean isConstant() {
        switch (op) {
        case MUL:
        case DIV:
        case REM:
        case ADD:
        case SUB:
        case LSHIFT:
        case RSHIFT:
        case URSHIFT:
        case LT:
        case LE:
        case GT:
        case GE:
        case EQ:
        case NE:
        case BITAND:
        case BITXOR:
        case BITOR:
        case AND:
        case OR:
            return left.isConstant() && right.isConstant();
        }
        return false;
    }
    /**
     * Evaluate
     */
    Expression eval(int a, int b) {
        return this;
    }
    Expression eval(long a, long b) {
        return this;
    }
    Expression eval(float a, float b) {
        return this;
    }
    Expression eval(double a, double b) {
        return this;
    }
    Expression eval(boolean a, boolean b) {
        return this;
    }
    Expression eval(String a, String b) {
        return this;
    }
    Expression eval() {
        // See also the eval() code in BinaryShiftExpression.java.
        if (left.op == right.op) {
            switch (left.op) {
              case BYTEVAL:
              case CHARVAL:
              case SHORTVAL:
              case INTVAL:
                return eval(((IntegerExpression)left).value, ((IntegerExpression)right).value);
              case LONGVAL:
                return eval(((LongExpression)left).value, ((LongExpression)right).value);
              case FLOATVAL:
                return eval(((FloatExpression)left).value, ((FloatExpression)right).value);
              case DOUBLEVAL:
                return eval(((DoubleExpression)left).value, ((DoubleExpression)right).value);
              case BOOLEANVAL:
                return eval(((BooleanExpression)left).value, ((BooleanExpression)right).value);
              case STRINGVAL:
                return eval(((StringExpression)left).value, ((StringExpression)right).value);
            }
        }
        return this;
    }

    /**
     * Inline
     */
    public Expression inline(Environment env, Context ctx) {
        left = left.inline(env, ctx);
        right = right.inline(env, ctx);
        return (left == null) ? right : new CommaExpression(where, left, right);
    }
    public Expression inlineValue(Environment env, Context ctx) {
        left = left.inlineValue(env, ctx);
        right = right.inlineValue(env, ctx);
        try {
            return eval().simplify();
        } catch (ArithmeticException e) {
            // Got rid of this error message.  It isn't illegal to
            // have a program which does a constant division by
            // zero.  We return `this' to make the compiler to
            // generate code here.
            // (bugs 4019304, 4089107).
            //
            // env.error(where, "arithmetic.exception");
            return this;
        }
    }

    /**
     * Create a copy of the expression for method inlining
     */
    public Expression copyInline(Context ctx) {
        BinaryExpression e = (BinaryExpression)clone();
        if (left != null) {
            e.left = left.copyInline(ctx);
        }
        if (right != null) {
            e.right = right.copyInline(ctx);
        }
        return e;
    }

    /**
     * The cost of inlining this expression
     */
    public int costInline(int thresh, Environment env, Context ctx) {
        return 1 + ((left != null) ? left.costInline(thresh, env, ctx) : 0) +
                   ((right != null) ? right.costInline(thresh, env, ctx) : 0);
    }

    /**
     * Code
     */
    void codeOperation(Environment env, Context ctx, Assembler asm) {
        throw new CompilerError("codeOperation: " + opNames[op]);
    }
    public void codeValue(Environment env, Context ctx, Assembler asm) {
        if (type.isType(TC_BOOLEAN)) {
            Label l1 = new Label();
            Label l2 = new Label();

            codeBranch(env, ctx, asm, l1, true);
            asm.add(true, where, opc_ldc, new Integer(0));
            asm.add(true, where, opc_goto, l2);
            asm.add(l1);
            asm.add(true, where, opc_ldc, new Integer(1));
            asm.add(l2);
        } else {
            left.codeValue(env, ctx, asm);
            right.codeValue(env, ctx, asm);
            codeOperation(env, ctx, asm);
        }
    }

    /**
     * Print
     */
    public void print(PrintStream out) {
        out.print("(" + opNames[op] + " ");
        if (left != null) {
            left.print(out);
        } else {
            out.print("<null>");
        }
        out.print(" ");
        if (right != null) {
            right.print(out);
        } else {
            out.print("<null>");
        }
        out.print(")");
    }
}

{'repo_name': 'GregBowyer/ManagedRuntimeInitiative', 'stars': '112', 'repo_language': 'Java', 'file_name': 'jar.1', 'mime_type': 'text/plain', 'hash': -4877664539435905605, 'source_dataset': 'data'}


// Copyright 2014 The ql Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

/*
Package driver registers QL sql/drivers named "ql", "ql2" and a memory driver named "ql-mem".

See also [0], [1] and [3].

Usage

A skeleton program using ql/driver.

	package main

	import (
		"database/sql"

		_ "github.com/cznic/ql/driver"
	)

	func main() {
		...
		// Disk file DB
		db, err := sql.Open("ql", "ql.db")  // [2]
		// alternatively
		db, err := sql.Open("ql", "file://ql.db")

		// and/or

		// Disk file DB using V2 format
		db, err := sql.Open("ql2", "ql.db")
		// alternatively
		db, err := sql.Open("ql2", "file://ql.db")

		// and/or

		// RAM DB
		mdb, err := sql.Open("ql-mem", "mem.db")
		// alternatively
		mdb, err := sql.Open("ql", "memory://mem.db")
		if err != nil {
			log.Fatal(err)
		}

		// Use db/mdb here
		...
	}

This package exports nothing.

Links

Referenced from above:

  [0]: http://godoc.org/github.com/cznic/ql
  [1]: http://golang.org/pkg/database/sql/
  [2]: http://golang.org/pkg/database/sql/#Open
  [3]: http://golang.org/pkg/database/sql/driver
*/
package driver

import "github.com/cznic/ql"

func init() {
	ql.RegisterDriver()
	ql.RegisterDriver2()
	ql.RegisterMemDriver()
}

{'repo_name': 'cznic/ql', 'stars': '1319', 'repo_language': 'Go', 'file_name': 'doc.go', 'mime_type': 'text/plain', 'hash': 4955502289249571360, 'source_dataset': 'data'}


module Private
  module Withdraws
    class BaseController < ::Private::BaseController
      before_action :channel
      before_action :auth_activated!
      before_action :auth_verified!
      before_action :two_factor_activated!

      def channel
        @channel ||= WithdrawChannel.find_by_key(self.controller_name.singularize)
      end

      def model_kls
        "withdraws/#{self.controller_name.singularize}".camelize.constantize
      end

    end
  end
end

{'repo_name': 'peatio/peatio', 'stars': '3370', 'repo_language': 'Ruby', 'file_name': 'confirm_dialog.html', 'mime_type': 'text/plain', 'hash': 6322657166844863827, 'source_dataset': 'data'}


///////////////////////////////////////////////////////////////////////////////////
/// OpenGL Mathematics (glm.g-truc.net)
///
/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
/// 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.
///
/// @ref core
/// @file glm/core/intrinsic_geometric.hpp
/// @date 2009-05-08 / 2011-06-15
/// @author Christophe Riccio
///////////////////////////////////////////////////////////////////////////////////

#ifndef glm_core_intrinsic_geometric
#define glm_core_intrinsic_geometric

#include "setup.hpp"

#if(!(GLM_ARCH & GLM_ARCH_SSE2))
#	error "SSE2 instructions not supported or enabled"
#else

#include "intrinsic_common.hpp"

namespace glm{
namespace detail
{
	//length
	__m128 sse_len_ps(__m128 x);

	//distance
	__m128 sse_dst_ps(__m128 p0, __m128 p1);

	//dot
	__m128 sse_dot_ps(__m128 v1, __m128 v2);

	// SSE1
	__m128 sse_dot_ss(__m128 v1, __m128 v2);

	//cross
	__m128 sse_xpd_ps(__m128 v1, __m128 v2);

	//normalize
	__m128 sse_nrm_ps(__m128 v);

	//faceforward
	__m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref);

	//reflect
	__m128 sse_rfe_ps(__m128 I, __m128 N);

	//refract
	__m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta);

}//namespace detail
}//namespace glm

#include "intrinsic_geometric.inl"

#endif//GLM_ARCH
#endif//glm_core_intrinsic_geometric

{'repo_name': 'myiosemail/ShowTimeVideoLive', 'stars': '254', 'repo_language': 'C++', 'file_name': 'contents.xcworkspacedata', 'mime_type': 'text/xml', 'hash': -4362946783900654472, 'source_dataset': 'data'}


package com.phodal.pholedge.book;

import com.phodal.pholedge.book.model.Book;
import com.phodal.pholedge.book.model.BookRepresentaion;
import com.phodal.pholedge.core.domain.Repository;
import com.phodal.pholedge.core.exception.NotFoundException;
import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class BookRepository implements Repository {
    private final BookMapper bookMapper;

    public BookRepository(BookMapper bookMapper) {
        this.bookMapper = bookMapper;
    }

    public void save(Book book) {
        this.bookMapper.doSave(book);
    }

    public List<BookRepresentaion> list() {
        return this.bookMapper.list();
    }

    public Book byId(String id) {
        try {
            return this.bookMapper.byId(id);
        } catch (EmptyResultDataAccessException e) {
            throw new NotFoundException(id);
        }
    }
}

{'repo_name': 'phodal/coca', 'stars': '359', 'repo_language': 'Go', 'file_name': 'deps_maven.txt', 'mime_type': 'text/plain', 'hash': 2010122887415549568, 'source_dataset': 'data'}


require 'active_support/time'
require 'chronic'
require 'chronic_duration'
require 'json'
require 'rest-client'
require_relative './models'

module PagerBot
  # Handle connecting to PagerDuty
  class PagerDuty
    attr_reader :users, :schedules

    include SemanticLogger::Loggable

    def initialize(opts = {})
      pd_config = opts
      @subdomain = pd_config.fetch(:subdomain)
      @api_key = pd_config.fetch(:api_key)

      @users = PagerBot::Models::Collection.new(
        pd_config.fetch(:users, []), PagerBot::Models::User)
      @schedules = PagerBot::Models::Collection.new(
        pd_config.fetch(:schedules, []), PagerBot::Models::Schedule)

      headers_hash = {
        # :TRICKY: Allow pagerduty v1 API keys.
        "Accept" => "application/vnd.pagerduty+json;version=2",
        "Authorization" => "Token token=#{@api_key}"
      }
      @resource = RestClient::Resource.new(api_base,
        :headers => headers_hash)
    end

    def api_base
      "https://#{@subdomain}.pagerduty.com/api/v1"
    end

    def uri_base
      "https://#{@subdomain}.pagerduty.com"
    end

    def events_api_base
      "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
    end

    def get(url, opts = {})
      begin
        resp = @resource[url].get(opts)
        json_response = JSON.parse(resp, :symbolize_names => true)
        logger.debug("PagerDuty GET", url: url, options: opts, response: json_response)
        json_response
      rescue Exception => e
        params = opts[:params] ? "?#{opts[:params].inspect}" : ""
        logger.error("PagerDuty GET failed", {url: url, options: opts}, e)
        raise RuntimeError.new("Problem talking to PagerDuty: #{e.message}\n" +
          "Request was GET #{url}#{params}")
      end
    end

    def post(url, payload, opts = {})
      begin
        resp = @resource[url].post(payload, opts)
        json_response = JSON.parse(resp, :symbolize_names => true)
        logger.debug("PagerDuty POST", url: url, payload: payload, options: opts, response: json_response)
        json_response
      rescue Exception => e
        params = opts[:params] ? "?#{opts[:params].inspect}" : ""
        logger.error("PagerDuty POST failed", {url: url, payload: payload, options: opts}, e)
        raise RuntimeError.new("Problem talking to PagerDuty: #{e.message}\n"+
          "Request was POST #{url}#{params} / #{payload.inspect}")
      end
    end

    def incidents_api
      base_url = "https://events.pagerduty.com/generic/2010-04-15/create_event.json"
      @incidents_resource ||= RestClient::Resource.new(base_url)
    end

    # return User object for aliases like "i", "johnsmith"
    def find_user(alias_, nickname=nil)
      if nickname && ['me', 'i', 'my'].include?(alias_)
        alias_ = nickname
      end
      user = @users.get(alias_)
      raise Pagerbot::UserNotFoundError.new("I don't know who #{alias_} is.") unless user
      return user
    end

    # schedule name => schedule object
    def find_schedule(schedule_name)
      schedule = @schedules.get(schedule_name)
      unless schedule
        raise Pagerbot::ScheduleNotFoundError.new("Can't find schedule named #{schedule_name}.")
      end
      return schedule
    end

    # Returns a list like:
    # [
    #   {
    #     id: "ABCDEF",
    #     name: "Dan Benamy",
    #     email: "daniel@benamy.info",
    #     color: "orange"
    #   }
    # ]
    def get_schedule_oncall(schedule_id, time)
      response = get(
        "/schedules/#{schedule_id}",
        :params => {
          :since => time.iso8601,
          :until => (time + 1).iso8601
      })
      response[:schedule][:final_schedule][:rendered_schedule_entries].map do |x|
        x[:user]
      end
    end

    def next_oncall(person_id = nil, schedule_id = nil)
      params = {}
      params['include[]'] = 'schedules'
      params['user_ids[]'] = person_id unless person_id.nil?
      params['schedule_ids[]'] = schedule_id unless schedule_id.nil?
      params[:until] = (Time.now + 3.months).iso8601
      params[:earliest] = true

      PagerBot.log.debug("Fetching /oncalls for user/schedule. params=#{params.inspect}")
      response = get('/oncalls', :params => params)

      response[:oncalls][0]
    end

    def parse_time(time, nick, extra_args={})
      begin
        person = find_user(nick)
        return person.parse_time(time, extra_args)
      rescue
        Chronic.time_class = Time
        return Chronic.parse(time, extra_args)
      end
    end

    private

    # reverses the collection of type {id => [aliases...]}
    # returning {alias => id}
    def index_collection(collection, alias_type)
      result = {}
      collection.each do |uid, aliases|
        aliases.each do |name|
          name = Utilities.normalize(name)
          (result[name] ||= Set.new) << uid
        end
      end

      result, rejected = result.partition { |_, uids| uids.length == 1 }

      rejected.each do |name, uids|
        log.warn("#{alias_type.capitalize} alias #{name} is ambiguous: " +
          "#{uids.inspect}. Excluding this alias")
      end

      Hash[result.map { |name, ids| [name, ids.first] }]
    end

    # add aliases for uid to collection and the reverse mapping of collection
    def add_to_collection(uid, aliases, collection, rev_map, type, add_alias=false)
      uid = uid.to_sym
      aliases = aliases.map { |a| Utilities.normalize(a) }
      unless add_alias || collection[uid].nil?
        raise ArgumentError.new(
          "#{type.capitalize} #{uid} (aliases: #{collection[uid]}) already exists!")
      end

      aliases.each do |name|
        raise ArgumentError.new(
          "#{type.capitalize} alias #{name} already exists!") unless rev_map[name].nil?
      end

      (collection[uid] ||= []) << aliases
      aliases.each do |name|
        rev_map[name] = uid
      end
    end
  end
end

{'repo_name': 'stripe-contrib/pagerbot', 'stars': '270', 'repo_language': 'Ruby', 'file_name': 'intro.html', 'mime_type': 'text/html', 'hash': -4930421807673358932, 'source_dataset': 'data'}


[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
# Set Clipboard

Set the content of the system clipboard
[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## Example Usage

```java
// Java
// base64Content is Base64-encoded content
driver.setClipboard("label", ClipboardContentType.PLAINTEXT, base64Content);
driver.setClipboardText("happy testing");

```

```python
# Python
self.driver.set_clipboard('happy testing')
self.driver.set_clipboard_text('happy testing')

```

```javascript
// Javascript
// webdriver.io example
driver.setClipboard('happy testing', 'plaintext')

// wd example
await driver.setClipboard('happy testing', 'plaintext')

```

```ruby
# Ruby
# ruby_lib example
set_clipboard content: 'happy testing'

# ruby_lib_core example
@driver.set_clipboard content: 'happy testing'

```

```php
# PHP
// PHP Code here

```

```csharp
// C#
// CSharp Code here

```

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## Description

Set the content of the system clipboard

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## Support

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### Appium Server

|Platform|Driver|Platform Versions|Appium Version|Driver Version|
|--------|----------------|------|--------------|--------------|
| iOS | [XCUITest](/docs/en/drivers/ios-xcuitest.md) | 9.3+ | 1.6.0+ | All |
|  | [UIAutomation](/docs/en/drivers/ios-uiautomation.md) | None | None | None |
| Android | [Espresso](/docs/en/drivers/android-espresso.md) | ?+ | 1.9.0+ | All |
|  | [UiAutomator2](/docs/en/drivers/android-uiautomator2.md) | ?+ | 1.6.0+ | All |
|  | [UiAutomator](/docs/en/drivers/android-uiautomator.md) | None | None | None |
| Mac | [Mac](/docs/en/drivers/mac.md) | None | None | None |
| Windows | [Windows](/docs/en/drivers/windows.md) | None | None | None |

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### Appium Clients

|Language|Support|Documentation|
|--------|-------|-------------|
|[Java](https://github.com/appium/java-client/releases/latest)| All | [seleniumhq.github.io](https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/WebElement.html#click--) |
|[Python](https://github.com/appium/python-client/releases/latest)| All | [appium.github.io](https://appium.github.io/python-client-sphinx/webdriver.extensions.html#webdriver.extensions.clipboard.Clipboard.get_clipboard) |
|[Javascript (WebdriverIO)](http://webdriver.io/index.html)| All |  |
|[Javascript (WD)](https://github.com/admc/wd/releases/latest)| All | [github.com](https://github.com/admc/wd/releases) |
|[Ruby](https://github.com/appium/ruby_lib/releases/latest)| All | [iOS](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Ios/Device#set_clipboard-instance_method) [Android](https://www.rubydoc.info/github/appium/ruby_lib_core/Appium/Core/Android/Device#set_clipboard-instance_method) |
|[PHP](https://github.com/appium/php-client/releases/latest)| None | [github.com](https://github.com/appium/php-client/releases/latest) |
|[C#](https://github.com/appium/appium-dotnet-driver/releases/latest)| None | [github.com](https://github.com/appium/appium) |

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## HTTP API Specifications

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### Endpoint

`POST /session/:session_id/appium/device/set_clipboard`

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### URL Parameters

|name|description|
|----|-----------|
|session_id|ID of the session to route the command to|

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### JSON Parameters

|name|type|description|
|----|----|-----------|
| content | `String` | The actual base64 encoded clipboard content. |
| contentType | `string` | The type of the content to get. Plaintext, Image, URL. Android supports only plaintext. |
| label | `string` | Clipboard data label for Android. |

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
### Response

Response from Appium server (`string`)

[//]: # (DO NOT EDIT THIS FILE! This is an auto-generated file. Editing for this document happens in /commands-yml/commands/device/clipboard/set-clipboard.yml)
## See Also

{'repo_name': 'appium/appium', 'stars': '11714', 'repo_language': 'JavaScript', 'file_name': 'AndroidSelectorsTest.java', 'mime_type': 'text/x-java', 'hash': -7156966576393749274, 'source_dataset': 'data'}


# Kernels Usage
To execute the kernel on a GPU one must first create the object of type ```vuh::Program``` matching the kernel interfaces (specialization constants, push constants and buffer bindings)
```cpp
auto program = vuh::Program(device, "kernel.spv");
```
and linking together the ```SPIR-V``` binary and a device to execute that code.
This object is used to set the execution grid sizes ```Program::grid()``` (amount of workgroups in each dimension), specify the values of kernel parameters (by calling ```Program::spec()``` and ```Program::bind()``` functions), and finally launch the kernel ```Program::run()```.
The workgroup dimensions are either hardcoded in the kernel code, or passed via specialization or push constants.
This section sets up the correspondence between the two sides and illustrates different ways to pass the parameters and execute kernels.

In case the corresponding shader has non-empty specialization and/or push constants
interface that should be reflected by a template parameters to ```vuh::Program<Specs, PushConstants>```.

## Specialization Constants
Specialization constants are ```int```, ```float``` or ```bool``` values used as constants in the shader code but can be set up in the client code prior to kernel execution.
In shader specialization constants are declared like
```glsl
layout(constant_id = 0) const int arraySize;
layout(constant_id = 1) const float a = 0.1f; // with a default value
```
Here ```constant_id```-s are used to refer to particular constants in the client code. ```Vuh``` assumes the through numbering of constants starting from 0.
On the client side specialization constants interface is defined by the first template parameter of ```vuh::Program<>``` class.
The declaration corresponding to above two constants interface would write
```cpp
using Specs = vuh::typelist<int, float>;
auto program = vuh::Program<Specs>(device, "kernel.spv");
```
Namely for each constant in the order of their IDs its type should be put into a typelist used to specialize the ```vuh::Program```.
All constants are specified in a single call to ```Program::spec()``` with each parameter corresponding to constants in the order of their id-s.
```cpp
program.spec(42, 3.14f);
```
would set the above values of ```arraySize``` to 42 and ```a``` to 3.14.
Constants sustain their values until the next call to ```Program::spec()``` method.
Not setting specialization constants before launching a kernel would not trigger an error since ```vuh``` is not informed whether constants have default values or not.
One of the use of specialization constants might be setting up the workgroup dimensions:
```glsl
layout(local_size_x_id = 0, local_size_y_id = 1) in; // set up 2d workgroup
```

## Push Constants
Push constants are small structures (normally <= 128 Bytes) residing in the uniform block.
In a shader code their declaration and usage look like
```glsl
layout(push_constant) uniform BlockName {
   float x;
   float y;
   int t;
} instanceName; // instance name

 ... = instanceName.member2; // read a push constant in the shader body
```
On the client side there must be exact same structure declared and passed as a second template parameter to ```vuh::Program```
```cpp
struct PushConstants {
   float x;
   float y;
   int t;
};
auto program = vuh::Program<Specs, PushConstants>(device, "kernel.spv");
```
Here ```Specs``` typelist from a previous subsection used to define the specialization constants interface.
In case there are no specialization constants empty typelist should be passed as a template parameter ```vuh::Program<vuh::typelist<>, PushConstants>(...)```.
Currently ```Vuh``` only supports a single push constant structure per kernel.
Luckily this limitation is easy to bypass since structures in ```C++``` and ```GLSL``` are composable.
Push constants are set in ```vuh::Program::bind()``` call, which accepts push constants structure as a first parameter (unless push constants template parameter is omitted or explicitly set to the empty typelist)
```cpp
program.bind({3.14, 6.28, 42}, ...);
```

## Buffer Bindings
Storage buffers are used to input/output array-like parameters to a kernel.
They are declared in shader source using buffer storage qualifier and block syntax
```glsl
layout(std430, binding = 0) buffer lay0 { float arr_floats[]; };
layout(std430, binding = 0) buffer lay0 { int arr_ints[]; };
```
which allows to bind some buffers to the names ```arr_floats```, ```arr_ints``` and access their values with indexes.
Currently ```vuh``` only supports a single set per kernel and all bindings within a kernel must have consecutive id-s that define the order in which array parameters passed to kernel in ```vuh::Program::bind()``` call
```cpp
auto array_floats = vuh::Array<float>(device, ...);
auto array_ints = vuh::Array<int>(device, ...);
...
program.bind(array_floats, array_ints);
```
Such a call associates the storage buffers allocated on a device to the binding points in a shader code which is to be run.
Naturally buffers must be allocated on the same device where kernel is executed.
In case kernel has both push constants and storage buffers interface the push constants structure is passed as the first parameter to ```bind()``` and all buffer parameters follows
```cpp
program.bind({3.14, 6.28, 42}, array_floats, array_ints);
```
Array types and number on a ```C++``` side should match those in a kernel.
Array parameters bound like this can be used as both input and output parameters.
It is required that prior to calling ```bind()``` function one specifies the grid size and specialization constants (if applicable).
No error will be reported in case one forgets to do that.

## Execution
Once grid dimensions and all shader parameters are specified kernel may be scheduled for an execution on a GPU device.
This is done simply by calling ```Program::run()``` function which triggers kernel execution and returns control to the program once computation is complete.
In simple cases setting all required parameters may be chained, and a convenience ```Program::operator()``` used which combines the ```Program::bind()``` and ```Program::run()``` in a one-liner ``` program.grid().spec()({}, ...); ```.

Program can be rerun multiple times without rebinding or respecifying any parameters (for example when the data in input buffers is updated)
```cpp
...
program1.bind(array1, array2);
program2.bind(array2, array1);
for(;;){ // perpetual buzz
   program1.run(); // update array 1
   program2.run(); // update array 2
}
```
Alternatively one can set up the grid dimensions and specialization constants once, and rebind-rerun the kernel repeatedly if such a need occurs
```cpp
program.grid(128/64).spec(64);
for(size_t i = 0; i < n_repeat; ++i){
   program({128, a}, d_y, d_x);
}
```

{'repo_name': 'Glavnokoman/vuh', 'stars': '197', 'repo_language': 'C++', 'file_name': 'CMakeLists.txt', 'mime_type': 'text/plain', 'hash': 5755048968778688791, 'source_dataset': 'data'}


{
  "behaviorClass": "ObservingWithoutTurn",
  "behaviorID": "ObservingOnChargerIdle",

  "wantsToBeActivatedCondition": {
    "conditionType": "OnCharger"
  },

  "behaviorTimer": "ObservingOnCharger",

  "small_motion_period_s": {
    "nodes": [
      // x = time robot has been observing on the charger, in seconds
      // y = period between small motions, in seconds (may be longer due to waiting for another anim to finish)
      {
        "x": 0.0,
        "y": 0.5
      },
      {
        "x": 5.0,
        "y": 2.0
      },
      {
        "x": 30.0,
        "y": 10.0
      },
      {
        "x": 60.0,
        "y": 30.0
      }
    ]
  },

  "small_motion_period_random_factor": 0.3,

  // multiply the current small motion period by these numbers to find how long to stay in a given state
  "look_up_period_multiplier": 5,
  "look_straight_period_multiplier": 2
}

{'repo_name': 'GooeyChickenman/victor', 'stars': '108', 'repo_language': 'Python', 'file_name': '0.14.1616.ota', 'mime_type': 'text/plain', 'hash': -6389299770416600485, 'source_dataset': 'data'}


1999-03-02 09:44:33 10HmaX-0005vi-00 msg
1999-03-02 09:44:33 10HmaX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmaY-0005vi-00 msg
1999-03-02 09:44:33 10HmaY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmaZ-0005vi-00 msg
2017-07-30 18:51:05.712 10HmaZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbA-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1234] 10HmbB-0005vi-00 msg
1999-03-02 09:44:33 [1234] 10HmbB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1235] 10HmbC-0005vi-00 msg
1999-03-02 09:44:33 [1235] 10HmbC-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1236] 10HmbD-0005vi-00 msg
2017-07-30 18:51:05.712 [1236] 10HmbD-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1237] 10HmbE-0005vi-00 msg
2017-07-30 18:51:05.712 [1237] 10HmbE-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbF-0005vi-00 msg
1999-03-02 09:44:33 10HmbF-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbG-0005vi-00 msg
1999-03-02 09:44:33 10HmbG-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbH-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbH-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbI-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbI-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1238] 10HmbJ-0005vi-00 msg
1999-03-02 09:44:33 [1238] 10HmbJ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1239] 10HmbK-0005vi-00 msg
1999-03-02 09:44:33 [1239] 10HmbK-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1240] 10HmbL-0005vi-00 msg
2017-07-30 18:51:05.712 [1240] 10HmbL-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1241] 10HmbM-0005vi-00 msg
2017-07-30 18:51:05.712 [1241] 10HmbM-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbN-0005vi-00 msg
1999-03-02 09:44:33 10HmbN-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbO-0005vi-00 msg
1999-03-02 09:44:33 10HmbO-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbP-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbP-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbQ-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbQ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1242] 10HmbR-0005vi-00 msg
1999-03-02 09:44:33 [1242] 10HmbR-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1243] 10HmbS-0005vi-00 msg
1999-03-02 09:44:33 [1243] 10HmbS-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1244] 10HmbT-0005vi-00 msg
2017-07-30 18:51:05.712 [1244] 10HmbT-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1245] 10HmbU-0005vi-00 msg
2017-07-30 18:51:05.712 [1245] 10HmbU-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbV-0005vi-00 msg
1999-03-02 09:44:33 10HmbV-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 10HmbW-0005vi-00 msg
1999-03-02 09:44:33 10HmbW-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbX-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbX-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 10HmbY-0005vi-00 msg
2017-07-30 18:51:05.712 10HmbY-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1246] 10HmbZ-0005vi-00 msg
1999-03-02 09:44:33 [1246] 10HmbZ-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
1999-03-02 09:44:33 [1247] 10HmcA-0005vi-00 msg
1999-03-02 09:44:33 [1247] 10HmcA-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1248] 10HmcB-0005vi-00 msg
2017-07-30 18:51:05.712 [1248] 10HmcB-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss
2017-07-30 18:51:05.712 [1249] 10HmcC-0005vi-00 msg
2017-07-30 18:51:05.712 [1249] 10HmcC-0005vi-00 <= CALLER@myhost.test.ex U=CALLER P=local S=sss

{'repo_name': 'Exim/exim', 'stars': '505', 'repo_language': 'C', 'file_name': 'g2h', 'mime_type': 'text/x-perl', 'hash': 5144288659016450335, 'source_dataset': 'data'}


card-tools

Lovelace Card Tools

{'repo_name': 'thomasloven/lovelace-card-tools', 'stars': '118', 'repo_language': 'JavaScript', 'file_name': 'lit-element.js', 'mime_type': 'text/plain', 'hash': -7438010999396960309, 'source_dataset': 'data'}


<template>

      <slot name="header"></slot>

      <el-table
        ref="elTable"
        :data="d2CrudData"
        v-bind="options"
        @current-change="handleCurrentChange"
        @select="handleSelect"
        @select-all="handleSelectAll"
        @selection-change="handleSelectionChange"
        @sort-change="handleSortChange"
        @cell-mouse-enter="handleCellMouseEnter"
        @cell-mouse-leave="handleCellMouseLeave"
        @cell-click="handleCellClick"
        @cell-dblclick="handleCellDblclick"
        @row-click="handleRowClick"
        @row-contextmenu="handleRowContextmenu"
        @row-dblclick="handleRowDblclick"
        @header-click="handleHeaderClick"
        @header-contextmenu="handleHeaderContextmenu"
      >
        <el-table-column
          v-if="selectionRow || selectionRow === ''"
          type="selection"
          :label="handleAttribute(selectionRow.title, '')"
          v-bind="selectionRow"
        >
        </el-table-column>
        <el-table-column
          v-if="indexRow || indexRow === ''"
          type="index"
          :label="handleAttribute(indexRow.title, '')"
          v-bind="indexRow"
        >
        </el-table-column>

        <el-table-column
          v-for="(item, index) in columns"
          :key="index"
          :label="handleAttribute(item.title, '')"
          :prop="handleAttribute(item.key, null)"
          v-bind="item"
        >
          <template slot-scope="scope">
            <el-input
              v-if="item.component && item.component.name === 'el-input'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-input>
            <el-input-number
              v-else-if="item.component && item.component.name === 'el-input-number'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-input-number>
            <el-radio-group
              v-else-if="item.component && item.component.name === 'el-radio'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
              <template v-if="item.component.buttonMode">
                <el-radio-button
                  v-for="option in item.component.options"
                  :key="option.value"
                  :label="option.value"
                >
                  {{option.label}}
                </el-radio-button>
              </template>
              <template v-else>
                <el-radio
                  v-for="option in item.component.options"
                  :key="option.value"
                  :label="option.value"
                >
                  {{option.label}}
                </el-radio>
              </template>
            </el-radio-group>
            <el-checkbox-group
              v-else-if="item.component && item.component.name === 'el-checkbox'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
              <template v-if="item.component.buttonMode">
                <el-checkbox-button
                  v-for="option in item.component.options"
                  :key="option.value"
                  :label="option.value"
                >
                  {{option.label}}
                </el-checkbox-button>
              </template>
              <template v-else>
                <el-checkbox
                  v-for="option in item.component.options"
                  :key="option.value"
                  :label="option.value"
                >
                  {{option.label}}
                </el-checkbox>
              </template>
            </el-checkbox-group>
            <el-select
              v-else-if="item.component && item.component.name === 'el-select'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
              <el-option
                v-for="option in item.component.options"
                :key="option.value"
                v-bind="option"
              >
              </el-option>
            </el-select>
            <el-cascader
              v-else-if="item.component && item.component.name === 'el-cascader'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-cascader>
            <el-switch
              v-else-if="item.component && item.component.name === 'el-switch'"
              v-model="scope.row[item.key]"
              v-bind="item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-switch>
            <el-slider
              v-else-if="item.component && item.component.name === 'el-slider'"
              v-model="scope.row[item.key]"
              v-bind="item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-slider>
            <el-time-select
              v-else-if="item.component && item.component.name === 'el-time-select'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-time-select>
            <el-time-picker
              v-else-if="item.component && item.component.name === 'el-time-picker'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-time-picker>
            <el-date-picker
              v-else-if="item.component && item.component.name === 'el-date-picker'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-date-picker>
            <el-rate
              v-else-if="item.component && item.component.name === 'el-rate'"
              v-model="scope.row[item.key]"
              v-bind="item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-rate>
            <el-color-picker
              v-else-if="item.component && item.component.name === 'el-color-picker'"
              v-model="scope.row[item.key]"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item.component) : item.component"
              @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item.key, value: scope.row[item.key], row: scope.row})"
            >
            </el-color-picker>
            <render-custom-component
              v-else-if="item.component && item.component.name"
              v-model="scope.row[item.key]"
              :component-name="item.component.name"
              :props="item.component.props ? item.component.props : null"
              :scope="scope">
            </render-custom-component>
            <render-component
              v-else-if="item.component && item.component.render"
              :render-function="item.component.render"
              :scope="scope"
            >
            </render-component>
            <template v-else>{{item.formatter ? item.formatter(scope.row, scope.column, _get(scope.row, item.key), scope.$index) : _get(scope.row, item.key)}}</template>
          </template>
          <template v-if="item.children">
            <el-table-column
              v-for="(item2, index2) in item.children"
              :key="index2"
              :label="handleAttribute(item2.title, '')"
              :prop="handleAttribute(item2.key, null)"
              v-bind="item2"
            >
              <template slot-scope="scope">
                <el-input
                  v-if="item2.component && item2.component.name === 'el-input'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-input>
                <el-input-number
                  v-else-if="item2.component && item2.component.name === 'el-input-number'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-input-number>
                <el-radio-group
                  v-else-if="item2.component && item2.component.name === 'el-radio'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                  <template v-if="item2.component.buttonMode">
                    <el-radio-button
                      v-for="option in item2.component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-radio-button>
                  </template>
                  <template v-else>
                    <el-radio
                      v-for="option in item2.component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-radio>
                  </template>
                </el-radio-group>
                <el-checkbox-group
                  v-else-if="item2.component && item2.component.name === 'el-checkbox'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                  <template v-if="item2.component.buttonMode">
                    <el-checkbox-button
                      v-for="option in item2.component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-checkbox-button>
                  </template>
                  <template v-else>
                    <el-checkbox
                      v-for="option in item2.component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-checkbox>
                  </template>
                </el-checkbox-group>
                <el-select
                  v-else-if="item2.component && item2.component.name === 'el-select'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                  <el-option
                    v-for="option in item2.component.options"
                    :key="option.value"
                    v-bind="option"
                  >
                  </el-option>
                </el-select>
                <el-cascader
                  v-else-if="item2.component && item2.component.name === 'el-cascader'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-cascader>
                <el-switch
                  v-else-if="item2.component && item2.component.name === 'el-switch'"
                  v-model="scope.row[item2.key]"
                  v-bind="item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-switch>
                <el-slider
                  v-else-if="item2.component && item2.component.name === 'el-slider'"
                  v-model="scope.row[item2.key]"
                  v-bind="item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-slider>
                <el-time-select
                  v-else-if="item2.component && item2.component.name === 'el-time-select'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-time-select>
                <el-time-picker
                  v-else-if="item2.component && item2.component.name === 'el-time-picker'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-time-picker>
                <el-date-picker
                  v-else-if="item2.component && item2.component.name === 'el-date-picker'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-date-picker>
                <el-rate
                  v-else-if="item2.component && item2.component.name === 'el-rate'"
                  v-model="scope.row[item2.key]"
                  v-bind="item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-rate>
                <el-color-picker
                  v-else-if="item2.component && item2.component.name === 'el-color-picker'"
                  v-model="scope.row[item2.key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item2.component) : item2.component"
                  @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item2.key, value: scope.row[item2.key], row: scope.row})"
                >
                </el-color-picker>
                <render-custom-component
                  v-else-if="item2.component && item2.component.name"
                  v-model="scope.row[item2.key]"
                  :component-name="item2.component.name"
                  :props="item2.component.props ? item2.component.props : null"
                  :scope="scope">
                </render-custom-component>
                <render-component
                  v-else-if="item2.component && item2.component.render"
                  :render-function="item2.component.render"
                  :scope="scope"
                >
                </render-component>
                <template v-else>{{item2.formatter ? item2.formatter(scope.row, scope.column, _get(scope.row, item2.key), scope.$index) : _get(scope.row, item2.key)}}</template>
              </template>
              <template v-if="item2.children">
                <el-table-column
                  v-for="(item3, index3) in item2.children"
                  :key="index3"
                  :label="handleAttribute(item3.title, '')"
                  :prop="handleAttribute(item3.key, null)"
                  v-bind="item3"
                >
                  <template slot-scope="scope">
                    <el-input
                      v-if="item3.component && item3.component.name === 'el-input'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-input>
                    <el-input-number
                      v-else-if="item3.component && item3.component.name === 'el-input-number'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-input-number>
                    <el-radio-group
                      v-else-if="item3.component && item3.component.name === 'el-radio'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                      <template v-if="item3.component.buttonMode">
                        <el-radio-button
                          v-for="option in item3.component.options"
                          :key="option.value"
                          :label="option.value"
                        >
                          {{option.label}}
                        </el-radio-button>
                      </template>
                      <template v-else>
                        <el-radio
                          v-for="option in item3.component.options"
                          :key="option.value"
                          :label="option.value"
                        >
                          {{option.label}}
                        </el-radio>
                      </template>
                    </el-radio-group>
                    <el-checkbox-group
                      v-else-if="item3.component && item3.component.name === 'el-checkbox'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                      <template v-if="item3.component.buttonMode">
                        <el-checkbox-button
                          v-for="option in item3.component.options"
                          :key="option.value"
                          :label="option.value"
                        >
                          {{option.label}}
                        </el-checkbox-button>
                      </template>
                      <template v-else>
                        <el-checkbox
                          v-for="option in item3.component.options"
                          :key="option.value"
                          :label="option.value"
                        >
                          {{option.label}}
                        </el-checkbox>
                      </template>
                    </el-checkbox-group>
                    <el-select
                      v-else-if="item3.component && item3.component.name === 'el-select'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                      <el-option
                        v-for="option in item3.component.options"
                        :key="option.value"
                        v-bind="option"
                      >
                      </el-option>
                    </el-select>
                    <el-cascader
                      v-else-if="item3.component && item3.component.name === 'el-cascader'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-cascader>
                    <el-switch
                      v-else-if="item3.component && item3.component.name === 'el-switch'"
                      v-model="scope.row[item3.key]"
                      v-bind="item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-switch>
                    <el-slider
                      v-else-if="item3.component && item3.component.name === 'el-slider'"
                      v-model="scope.row[item3.key]"
                      v-bind="item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-slider>
                    <el-time-select
                      v-else-if="item3.component && item3.component.name === 'el-time-select'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-time-select>
                    <el-time-picker
                      v-else-if="item3.component && item3.component.name === 'el-time-picker'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-time-picker>
                    <el-date-picker
                      v-else-if="item3.component && item3.component.name === 'el-date-picker'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-date-picker>
                    <el-rate
                      v-else-if="item3.component && item3.component.name === 'el-rate'"
                      v-model="scope.row[item3.key]"
                      v-bind="item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-rate>
                    <el-color-picker
                      v-else-if="item3.component && item3.component.name === 'el-color-picker'"
                      v-model="scope.row[item3.key]"
                      v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item3.component) : item3.component"
                      @change="$emit('cell-data-change', {rowIndex: scope.$index, key: item3.key, value: scope.row[item3.key], row: scope.row})"
                    >
                    </el-color-picker>
                    <render-custom-component
                      v-else-if="item3.component && item3.component.name"
                      v-model="scope.row[item3.key]"
                      :component-name="item3.component.name"
                      :props="item3.component.props ? item3.component.props : null"
                      :scope="scope">
                    </render-custom-component>
                    <render-component
                      v-else-if="item3.component && item3.component.render"
                      :render-function="item3.component.render"
                      :scope="scope"
                    >
                    </render-component>
                    <template v-else>{{item3.formatter ? item3.formatter(scope.row, scope.column, _get(scope.row, item3.key), scope.$index) : _get(scope.row, item3.key)}}</template>
                  </template>

                </el-table-column>
              </template>

            </el-table-column>
          </template>

        </el-table-column>

        <el-table-column
          v-if="rowHandle"
          :label="handleAttribute(rowHandle.columnHeader, '操作')"
          v-bind="rowHandle"
        >
          <template slot-scope="scope">
            <el-button
              v-if="rowHandle.edit && handleRowHandleButtonShow(rowHandle.edit.show, scope.$index, scope.row)"
              :disabled="handleRowHandleButtonDisabled(rowHandle.edit.disabled, scope.$index, scope.row)"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, rowHandle.edit) : rowHandle.edit"
              @click="handleEdit(scope.$index, scope.row)"
            >
              {{handleAttribute(rowHandle.edit.text, '编辑')}}
            </el-button>
            <el-button
              v-if="rowHandle.remove && handleRowHandleButtonShow(rowHandle.remove.show, scope.$index, scope.row)"
              :type="handleAttribute(rowHandle.remove.type, 'danger')"
              :disabled="handleRowHandleButtonDisabled(rowHandle.remove.disabled, scope.$index, scope.row)"
              v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, rowHandle.remove) : rowHandle.remove"
              @click="handleRemove(scope.$index, scope.row)"
            >
              {{handleAttribute(rowHandle.remove.text, '删除')}}
            </el-button>
            <template
              v-for="(item, index) in handleAttribute(rowHandle.custom, [])"
              :key="index">
              <el-button
                v-if="handleRowHandleButtonShow(item.show, scope.$index, scope.row)"
                :disabled="handleRowHandleButtonDisabled(item.disabled, scope.$index, scope.row)"
                v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, item) : item"
                @click="$emit(item.emit, {index: scope.$index, row: scope.row})"
              >
                {{item.text}}
              </el-button>
            </template>
          </template>
        </el-table-column>
      </el-table>

      <el-pagination
        v-bind="pagination"
        @size-change="handlePaginationSizeChange"
        @current-change="handlePaginationCurrentChange"
        @prev-click="handlePaginationPrevClick"
        @next-click="handlePaginationNextClick"
      >
      </el-pagination>

    <el-dialog
      v-if="isDialogShow"
      :title="formMode === 'edit' ? editTitle : addTitle"
      :visible.sync="isDialogShow"
      :before-close="handleDialogCancel"
      v-bind="formOptions"
    >
      <el-form
        ref="form"
        :model="formData"
        :rules="handleFormRulesMode()"
        v-bind="formOptions"
      >
        <el-row v-bind="formOptions">
          <template v-for="(value, key, index) in formData" :key="index">
            <el-col
              v-if="handleFormTemplateMode(key).component ? handleAttribute(handleFormTemplateMode(key).component.show, true) : true"
              :span="handleFormTemplateMode(key).component ? handleAttribute(handleFormTemplateMode(key).component.span, 24) : 24"
              :offset="handleFormTemplateMode(key).component ? handleAttribute(handleFormTemplateMode(key).component.offset, 0) : 0"
            >
              <el-form-item
                :label="handleFormTemplateMode(key).title"
                :prop="key"
              >
                <el-input
                  v-if="(!handleFormTemplateMode(key).component) ||((!handleFormTemplateMode(key).component.name) && (!handleFormTemplateMode(key).component.render)) || handleFormTemplateMode(key).component.name === 'el-input'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-input>
                <el-input-number
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-input-number'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-input-number>
                <el-radio-group
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-radio'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                  <template v-if="handleFormTemplateMode(key).component.buttonMode">
                    <el-radio-button
                      v-for="option in handleFormTemplateMode(key).component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-radio-button>
                  </template>
                  <template v-else>
                    <el-radio
                      v-for="option in handleFormTemplateMode(key).component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-radio>
                  </template>
                </el-radio-group>
                <el-checkbox-group
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-checkbox'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                  <template v-if="handleFormTemplateMode(key).component.buttonMode">
                    <el-checkbox-button
                      v-for="option in handleFormTemplateMode(key).component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-checkbox-button>
                  </template>
                  <template v-else>
                    <el-checkbox
                      v-for="option in handleFormTemplateMode(key).component.options"
                      :key="option.value"
                      :label="option.value"
                    >
                      {{option.label}}
                    </el-checkbox>
                  </template>
                </el-checkbox-group>
                <el-select
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-select'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                  <el-option
                    v-for="option in handleFormTemplateMode(key).component.options"
                    :key="option.value"
                    v-bind="option"
                  >
                  </el-option>
                </el-select>
                <el-cascader
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-cascader'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-cascader>
                <el-switch
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-switch'"
                  v-model="formData[key]"
                  v-bind="handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-switch>
                <el-slider
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-slider'"
                  v-model="formData[key]"
                  v-bind="handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-slider>
                <el-time-select
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-time-select'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-time-select>
                <el-time-picker
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-time-picker'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-time-picker>
                <el-date-picker
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-date-picker'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-date-picker>
                <el-rate
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-rate'"
                  v-model="formData[key]"
                  v-bind="handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-rate>
                <el-color-picker
                  v-else-if="handleFormTemplateMode(key).component.name === 'el-color-picker'"
                  v-model="formData[key]"
                  v-bind="$d2CrudSize ? Object.assign({ size: $d2CrudSize}, handleFormTemplateMode(key).component) : handleFormTemplateMode(key).component"
                  @change="$emit('form-data-change', {key: key, value: value})"
                >
                </el-color-picker>
                <render-custom-component
                  v-else-if="handleFormTemplateMode(key).component.name"
                  v-model="formData[key]"
                  :component-name="handleFormTemplateMode(key).component.name"
                  :props="handleFormTemplateMode(key).component.props ? handleFormTemplateMode(key).component.props : null"
                >
                </render-custom-component>
                <render-component
                  v-else-if="handleFormTemplateMode(key).component.render"
                  :render-function="handleFormTemplateMode(key).component.render"
                  :scope="formData[key]"
                >
                </render-component>
              </el-form-item>
            </el-col>
          </template>
        </el-row>
      </el-form>

        <el-button
          :size="formOptions ? handleAttribute(formOptions.saveButtonSize, null) : null"
          :type="formOptions ? handleAttribute(formOptions.saveButtonType, null) : null"
          :icon="formOptions ? handleAttribute(formOptions.saveButtonIcon, null) : null"
          :loading="formOptions ? handleAttribute(formOptions.saveLoading, false) : false"
          @click="handleDialogSave"
        >
        {{formOptions ? handleAttribute(formOptions.saveButtonText, '确定') : '确定'}}
        </el-button>

    </el-dialog>

</template>

{'repo_name': 'd2-projects/d2-crud', 'stars': '259', 'repo_language': 'Vue', 'file_name': 'dialog.js', 'mime_type': 'text/plain', 'hash': -7107156680183581517, 'source_dataset': 'data'}


define("ace/mode/c9search_highlight_rules",["require","exports","module","ace/lib/oop","ace/lib/lang","ace/mode/text_highlight_rules"], function(require, exports, module) {
"use strict";

var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;

function safeCreateRegexp(source, flag) {
    try {
        return new RegExp(source, flag);
    } catch(e) {}
}

var C9SearchHighlightRules = function() {
    this.$rules = {
        "start" : [
            {
                tokenNames : ["c9searchresults.constant.numeric", "c9searchresults.text", "c9searchresults.text", "c9searchresults.keyword"],
                regex : /(^\s+[0-9]+)(:)(\d*\s?)([^\r\n]+)/,
                onMatch : function(val, state, stack) {
                    var values = this.splitRegex.exec(val);
                    var types = this.tokenNames;
                    var tokens = [{
                        type: types[0],
                        value: values[1]
                    }, {
                        type: types[1],
                        value: values[2]
                    }];

                    if (values[3]) {
                        if (values[3] == " ")
                            tokens[1] = { type: types[1], value: values[2] + " " };
                        else
                            tokens.push({ type: types[1], value: values[3] });
                    }
                    var regex = stack[1];
                    var str = values[4];

                    var m;
                    var last = 0;
                    if (regex && regex.exec) {
                        regex.lastIndex = 0;
                        while (m = regex.exec(str)) {
                            var skipped = str.substring(last, m.index);
                            last = regex.lastIndex;
                            if (skipped)
                                tokens.push({type: types[2], value: skipped});
                            if (m[0])
                                tokens.push({type: types[3], value: m[0]});
                            else if (!skipped)
                                break;
                        }
                    }
                    if (last < str.length)
                        tokens.push({type: types[2], value: str.substr(last)});
                    return tokens;
                }
            },
            {
                regex : "^Searching for [^\\r\\n]*$",
                onMatch: function(val, state, stack) {
                    var parts = val.split("\x01");
                    if (parts.length < 3)
                        return "text";

                    var options, search, replace;

                    var i = 0;
                    var tokens = [{
                        value: parts[i++] + "'",
                        type: "text"
                    }, {
                        value: search = parts[i++],
                        type: "text" // "c9searchresults.keyword"
                    }, {
                        value: "'" + parts[i++],
                        type: "text"
                    }];
                    if (parts[2] !== " in") {
                        replace = parts[i];
                        tokens.push({
                            value: "'" + parts[i++] + "'",
                            type: "text"
                        }, {
                            value: parts[i++],
                            type: "text"
                        });
                    }
                    tokens.push({
                        value: " " + parts[i++] + " ",
                        type: "text"
                    });
                    if (parts[i+1]) {
                        options = parts[i+1];
                        tokens.push({
                            value: "(" + parts[i+1] + ")",
                            type: "text"
                        });
                        i += 1;
                    } else {
                        i -= 1;
                    }
                    while (i++ < parts.length) {
                        parts[i] && tokens.push({
                            value: parts[i],
                            type: "text"
                        });
                    }

                    if (replace) {
                        search = replace;
                        options = "";
                    }

                    if (search) {
                        if (!/regex/.test(options))
                            search = lang.escapeRegExp(search);
                        if (/whole/.test(options))
                            search = "\\b" + search + "\\b";
                    }

                    var regex = search && safeCreateRegexp(
                        "(" + search + ")",
                        / sensitive/.test(options) ? "g" : "ig"
                    );
                    if (regex) {
                        stack[0] = state;
                        stack[1] = regex;
                    }

                    return tokens;
                }
            },
            {
                regex : "^(?=Found \\d+ matches)",
                token : "text",
                next : "numbers"
            },
            {
                token : "string", // single line
                regex : "^\\S:?[^:]+",
                next : "numbers"
            }
        ],
        numbers:[{
            regex : "\\d+",
            token : "constant.numeric"
        }, {
            regex : "$",
            token : "text",
            next : "start"
        }]
    };
    this.normalizeRules();
};

oop.inherits(C9SearchHighlightRules, TextHighlightRules);

exports.C9SearchHighlightRules = C9SearchHighlightRules;

});

define("ace/mode/matching_brace_outdent",["require","exports","module","ace/range"], function(require, exports, module) {
"use strict";

var Range = require("../range").Range;

var MatchingBraceOutdent = function() {};

(function() {

    this.checkOutdent = function(line, input) {
        if (! /^\s+$/.test(line))
            return false;

        return /^\s*\}/.test(input);
    };

    this.autoOutdent = function(doc, row) {
        var line = doc.getLine(row);
        var match = line.match(/^(\s*\})/);

        if (!match) return 0;

        var column = match[1].length;
        var openBracePos = doc.findMatchingBracket({row: row, column: column});

        if (!openBracePos || openBracePos.row == row) return 0;

        var indent = this.$getIndent(doc.getLine(openBracePos.row));
        doc.replace(new Range(row, 0, row, column-1), indent);
    };

    this.$getIndent = function(line) {
        return line.match(/^\s*/)[0];
    };

}).call(MatchingBraceOutdent.prototype);

exports.MatchingBraceOutdent = MatchingBraceOutdent;
});

define("ace/mode/folding/c9search",["require","exports","module","ace/lib/oop","ace/range","ace/mode/folding/fold_mode"], function(require, exports, module) {
"use strict";

var oop = require("../../lib/oop");
var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode;

var FoldMode = exports.FoldMode = function() {};
oop.inherits(FoldMode, BaseFoldMode);

(function() {

    this.foldingStartMarker = /^(\S.*:|Searching for.*)$/;
    this.foldingStopMarker = /^(\s+|Found.*)$/;

    this.getFoldWidgetRange = function(session, foldStyle, row) {
        var lines = session.doc.getAllLines(row);
        var line = lines[row];
        var level1 = /^(Found.*|Searching for.*)$/;
        var level2 = /^(\S.*:|\s*)$/;
        var re = level1.test(line) ? level1 : level2;

        var startRow = row;
        var endRow = row;

        if (this.foldingStartMarker.test(line)) {
            for (var i = row + 1, l = session.getLength(); i < l; i++) {
                if (re.test(lines[i]))
                    break;
            }
            endRow = i;
        }
        else if (this.foldingStopMarker.test(line)) {
            for (var i = row - 1; i >= 0; i--) {
                line = lines[i];
                if (re.test(line))
                    break;
            }
            startRow = i;
        }
        if (startRow != endRow) {
            var col = line.length;
            if (re === level1)
                col = line.search(/\(Found[^)]+\)$|$/);
            return new Range(startRow, col, endRow, 0);
        }
    };

}).call(FoldMode.prototype);

});

define("ace/mode/c9search",["require","exports","module","ace/lib/oop","ace/mode/text","ace/mode/c9search_highlight_rules","ace/mode/matching_brace_outdent","ace/mode/folding/c9search"], function(require, exports, module) {
"use strict";

var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var C9SearchHighlightRules = require("./c9search_highlight_rules").C9SearchHighlightRules;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var C9StyleFoldMode = require("./folding/c9search").FoldMode;

var Mode = function() {
    this.HighlightRules = C9SearchHighlightRules;
    this.$outdent = new MatchingBraceOutdent();
    this.foldingRules = new C9StyleFoldMode();
};
oop.inherits(Mode, TextMode);

(function() {

    this.getNextLineIndent = function(state, line, tab) {
        var indent = this.$getIndent(line);
        return indent;
    };

    this.checkOutdent = function(state, line, input) {
        return this.$outdent.checkOutdent(line, input);
    };

    this.autoOutdent = function(state, doc, row) {
        this.$outdent.autoOutdent(doc, row);
    };

    this.$id = "ace/mode/c9search";
}).call(Mode.prototype);

exports.Mode = Mode;

});

{'repo_name': 'ecomfe/echarts-examples', 'stars': '207', 'repo_language': 'JavaScript', 'file_name': 'index.jade', 'mime_type': 'text/plain', 'hash': -316247043516639725, 'source_dataset': 'data'}


<?php
/**
 * Created by PhpStorm.
 * User: Jaeger <JaegerCode@gmail.com>
 * Date: 2017/9/21
 */

namespace QL;

use QL\Contracts\ServiceProviderContract;
use QL\Exceptions\ServiceNotFoundException;
use QL\Providers\EncodeServiceProvider;
use Closure;
use QL\Providers\HttpServiceProvider;
use QL\Providers\PluginServiceProvider;
use QL\Providers\SystemServiceProvider;

class Kernel
{
    protected $providers = [
        SystemServiceProvider::class,
        HttpServiceProvider::class,
        EncodeServiceProvider::class,
        PluginServiceProvider::class
    ];

    protected $binds;
    protected $ql;

    /**
     * Kernel constructor.
     * @param $ql
     */
    public function __construct(QueryList $ql)
    {
        $this->ql = $ql;
        $this->binds = collect();
    }

    public function bootstrap()
    {
        //注册服务提供者
        $this->registerProviders();
        return $this;
    }

    public function registerProviders()
    {
        foreach ($this->providers as $provider) {
            $this->register(new $provider());
        }
    }

    public function bind(string $name,Closure $provider)
    {
        $this->binds[$name] = $provider;
    }

    public function getService(string $name)
    {
        if(!$this->binds->offsetExists($name)){
            throw new ServiceNotFoundException("Service: {$name} not found!");
        }
        return $this->binds[$name];
    }

    private function register(ServiceProviderContract $instance)
    {
        $instance->register($this);
    }

}

{'repo_name': 'yhf7952/mmPic', 'stars': '120', 'repo_language': 'PHP', 'file_name': 'composer.json', 'mime_type': 'text/plain', 'hash': -7204016201627384478, 'source_dataset': 'data'}


// <snippetfollowupwithaccount2>

 // Instantiate an account object. Note the use of the option set enumerations defined in OptionSets.cs.
 // See the Entity Metadata topic in the SDK documentation to determine
 // which attributes must be set for each entity.
 Account account = new Account { Name = "Fourth Coffee" };
 account.AccountCategoryCode = new OptionSetValue((int)AccountAccountCategoryCode.PreferredCustomer);
 account.CustomerTypeCode = new OptionSetValue((int)AccountCustomerTypeCode.Investor);

 // Create an account record named Sample Fourth Coffee.
 _accountId = _serviceProxy.Create(account);

// </snippetfollowupwithaccount2>

{'repo_name': 'MicrosoftDocs/dynamics-365-customer-engagement', 'stars': '134', 'repo_language': 'HTML', 'file_name': 'facility-scheduling.md', 'mime_type': 'text/plain', 'hash': -3810905946104124605, 'source_dataset': 'data'}