text:
<?php

use PHPUnit\Framework\TestCase;

class Pickup {}
class Delivery {}
class Package {}
class Service {}

class OrderBuilderTest extends TestCase
{
    public function testToHash()
    {
        $order = new \Skydrop\Order\OrderBuilder(
            [
                'pickup'   => $this->getStdStub(),
                'delivery' => $this->getStdStub(),
                'service'  => $this->getStdStub(),
                'package'  => $this->getStdStub()
            ]
        );

        $expected = array_merge(
            $order->getPickup()->toHash(),
            $order->getDelivery()->toHash(),
            $order->getPackage()->toHash(),
            $order->getService()->toHash()
        );

        $this->assertSame($order->toHash(), $expected);
    }

    private function getStdStub()
    {
        $std = $this->getMockBuilder('StdStub')
            ->setMethods(['toHash'])
            ->getMock();

        $array = [
            'std' => [
                'std' => 'std',
            ]
        ];
        $std->expects($this->any())
            ->method('toHash')
            ->will($this->returnValue($array));

        return $std;
    }
}


text:
package org.apache.sysml.runtime.instructions.cp;

import org.apache.sysml.parser.Expression.DataType;
import org.apache.sysml.runtime.DMLRuntimeException;
import org.apache.sysml.runtime.controlprogram.context.ExecutionContext;
import org.apache.sysml.runtime.instructions.InstructionUtils;
import org.apache.sysml.runtime.matrix.operators.Operator;
import org.apache.sysml.runtime.matrix.operators.SimpleOperator;
import org.apache.sysml.runtime.util.IndexRange;

public abstract class IndexingCPInstruction extends UnaryCPInstruction
{
	protected CPOperand rowLower, rowUpper, colLower, colUpper;

	public IndexingCPInstruction(Operator op, CPOperand in, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){
		super(op, in, out, opcode, istr);
		rowLower = rl;
		rowUpper = ru;
		colLower = cl;
		colUpper = cu;
	}

	public IndexingCPInstruction(Operator op, CPOperand lhsInput, CPOperand rhsInput, CPOperand rl, CPOperand ru, CPOperand cl, CPOperand cu, CPOperand out, String opcode, String istr){
		super(op, lhsInput, rhsInput, out, opcode, istr);
		rowLower = rl;
		rowUpper = ru;
		colLower = cl;
		colUpper = cu;
	}

	protected IndexRange getIndexRange(ExecutionContext ec) throws DMLRuntimeException {
		return new IndexRange( //rl, ru, cl, ru
			(int)(ec.getScalarInput(rowLower.getName(), rowLower.getValueType(), rowLower.isLiteral()).getLongValue()-1),
			(int)(ec.getScalarInput(rowUpper.getName(), rowUpper.getValueType(), rowUpper.isLiteral()).getLongValue()-1),
			(int)(ec.getScalarInput(colLower.getName(), colLower.getValueType(), colLower.isLiteral()).getLongValue()-1),
			(int)(ec.getScalarInput(colUpper.getName(), colUpper.getValueType(), colUpper.isLiteral()).getLongValue()-1));
	}

	public static IndexingCPInstruction parseInstruction ( String str )
		throws DMLRuntimeException
	{
		String[] parts = InstructionUtils.getInstructionPartsWithValueType(str);
		String opcode = parts[0];

		if ( opcode.equalsIgnoreCase("rangeReIndex") ) {
			if ( parts.length == 7 ) {
				// Example: rangeReIndex:mVar1:Var2:Var3:Var4:Var5:mVar6
				CPOperand in, rl, ru, cl, cu, out;
				in = new CPOperand();
				rl = new CPOperand();
				ru = new CPOperand();
				cl = new CPOperand();
				cu = new CPOperand();
				out = new CPOperand();
				in.split(parts[1]);
				rl.split(parts[2]);
				ru.split(parts[3]);
				cl.split(parts[4]);
				cu.split(parts[5]);
				out.split(parts[6]);
				if( in.getDataType()==DataType.MATRIX )
					return new MatrixIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, opcode, str);
				else if (in.getDataType() == DataType.FRAME)
					return new FrameIndexingCPInstruction(new SimpleOperator(null), in, rl, ru, cl, cu, out, opcode, str);
				else
					throw new DMLRuntimeException("Can index only on Frames or Matrices");
			}
			else {
				throw new DMLRuntimeException("Invalid number of operands in instruction: " + str);
			}
		}
		else if ( opcode.equalsIgnoreCase("leftIndex")) {
			if ( parts.length == 8 ) {
				// Example: leftIndex:mVar1:mvar2:Var3:Var4:Var5:Var6:mVar7
				CPOperand lhsInput, rhsInput, rl, ru, cl, cu, out;
				lhsInput = new CPOperand();
				rhsInput = new CPOperand();
				rl = new CPOperand();
				ru = new CPOperand();
				cl = new CPOperand();
				cu = new CPOperand();
				out = new CPOperand();
				lhsInput.split(parts[1]);
				rhsInput.split(parts[2]);
				rl.split(parts[3]);
				ru.split(parts[4]);
				cl.split(parts[5]);
				cu.split(parts[6]);
				out.split(parts[7]);
				if( lhsInput.getDataType()==DataType.MATRIX )
					return new MatrixIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, str);
				else if (lhsInput.getDataType() == DataType.FRAME)
					return new FrameIndexingCPInstruction(new SimpleOperator(null), lhsInput, rhsInput, rl, ru, cl, cu, out, opcode, str);
				else
					throw new DMLRuntimeException("Can index only on Frames or Matrices");
			}
			else {
				throw new DMLRuntimeException("Invalid number of operands in instruction: " + str);
			}
		}
		else {
			throw new DMLRuntimeException("Unknown opcode while parsing a MatrixIndexingCPInstruction: " + str);
		}
	}
}

redpajama_set_name: RedPajamaGithub


text:
Automated tests related to manual tasks.

## Dependencies
  - [com.centurylink.mdw.base](https://github.com/CenturyLinkCloud/mdw/blob/master/mdw-workflow/assets/com/centurylink/mdw/base/readme.md)
  - [com.centurylink.mdw.testing](https://github.com/CenturyLinkCloud/mdw/blob/master/mdw-workflow/assets/com/centurylink/mdw/testing/readme.md)
  - [com.centurylink.mdw.servicenow](https://github.com/CenturyLinkCloud/mdw/blob/master/mdw-workflow/assets/com/centurylink/mdw/servicenow/readme.md)


text: java -server -cp ../lib/hazelcast-all-3.3.3.jar com.hazelcast.client.console.ClientConsoleApp


text:
module Teleporter
  class Engine < ::Rails::Engine
  end
end


text:
<!DOCTYPE html>

    <meta charset="utf-8" />
    <title>UX Rocket Treelist Unit Tests</title>

    <link rel="stylesheet" href="../node_modules/mocha/mocha.css" />


text:
#include "tensorflow/core/kernels/cwise_ops_common.h"
#include "tensorflow/core/kernels/cwise_ops_gradients.h"

namespace tensorflow {
REGISTER4(UnaryOp, CPU, "Atanh", functor::atanh, float, double,
          complex64, complex128);

#ifdef TENSORFLOW_USE_SYCL
REGISTER2(UnaryOp, SYCL, "Atanh", functor::atanh, float, double);
#endif // TENSORFLOW_USE_SYCL

#if GOOGLE_CUDA
REGISTER2(UnaryOp, GPU, "Atanh", functor::atanh, float, double);
#endif
}  // namespace tensorflow


text:
struct curl_slist* HttpNative_SListAppend(struct curl_slist* list, const char* headerValue)
{
    return curl_slist_append(list, headerValue);
}

void HttpNative_SListFreeAll(struct curl_slist* list)
{
    curl_slist_free_all(list);
}


text:
package com.google.cloud.notebooks.v1.samples;

// [START notebooks_v1_generated_NotebookService_StopInstance_LRO_async]
import com.google.api.gax.longrunning.OperationFuture;
import com.google.cloud.notebooks.v1.Instance;
import com.google.cloud.notebooks.v1.NotebookServiceClient;
import com.google.cloud.notebooks.v1.OperationMetadata;
import com.google.cloud.notebooks.v1.StopInstanceRequest;

public class AsyncStopInstanceLRO {

  public static void main(String[] args) throws Exception {
    asyncStopInstanceLRO();
  }

  public static void asyncStopInstanceLRO() throws Exception {
    // This snippet has been automatically generated and should be regarded as a code template only.
    // It will require modifications to work:
    // - It may require correct/in-range values for request initialization.
    // - It may require specifying regional endpoints when creating the service client as shown in
    // https://cloud.google.com/java/docs/setup#configure_endpoints_for_the_client_library
    try (NotebookServiceClient notebookServiceClient = NotebookServiceClient.create()) {
      StopInstanceRequest request = StopInstanceRequest.newBuilder().setName("name3373707").build();
      OperationFuture<Instance, OperationMetadata> future =
          notebookServiceClient.stopInstanceOperationCallable().futureCall(request);
      // Do something.
      Instance response = future.get();
    }
  }
}
// [END notebooks_v1_generated_NotebookService_StopInstance_LRO_async]


text:
package com.fiskra.ws.repo;

import org.springframework.data.jpa.repository.JpaRepository;

import com.fiskra.ws.model.User;

public interface UserRepository extends JpaRepository<User, Long> {

	public User findByName(String name);

	public User findByEmail(String email);
}


text:
<?php

use Hubzero\Content\Migration\Base;

// No direct access
defined('_HZEXEC_') or die();

/**
 * Migration script for adding User - Constantcontact plugin
 **/
class Migration20190728000000PlgUserDomainrestriction extends Base
{
	/**
	 * Up
	 **/
	public function up()
	{
		$this->addPluginEntry('user', 'domainrestriction', 0);
	}

	/**
	 * Down
	 **/
	public function down()
	{
		$this->deletePluginEntry('user', 'domainrestriction');
	}
}


text:
e<?php
/*
 * Generated by CRUDigniter v3.0 Beta
 * www.crudigniter.com
 */

class AbastecimientosController extends CI_Controller{
    function __construct()
    {
        parent::__construct();
    }

    /*
     * Listing of listaalmacen
     */
    function index()
    {
        $data['listaalmacen'] = $this->Almacenmodel->get_all_listaalmacen();

        $data['_view'] = 'almacen/index';
        $this->load->view('layouts/main',$data);
    }

	function getListaAnexo1($idImg) {
		if(isset($idImg)) {
			$this->load->model('Abastecimientosmodel');
			$data['all_listaempleado'] = $this->Abastecimientosmodel->get_all_listaanexo1($idImg);
		}
	}

}


text:
package org.apache.druid.query.groupby;

import com.google.common.collect.ImmutableList;
import org.apache.druid.data.input.impl.CSVParseSpec;
import org.apache.druid.data.input.impl.DimensionsSpec;
import org.apache.druid.data.input.impl.StringInputRowParser;
import org.apache.druid.data.input.impl.TimestampSpec;
import org.apache.druid.java.util.common.granularity.Granularities;
import org.apache.druid.java.util.common.guava.MergeSequence;
import org.apache.druid.java.util.common.guava.Sequence;
import org.apache.druid.java.util.common.guava.Sequences;
import org.apache.druid.java.util.common.io.Closer;
import org.apache.druid.query.Query;
import org.apache.druid.query.QueryPlus;
import org.apache.druid.query.QueryRunner;
import org.apache.druid.query.aggregation.CountAggregatorFactory;
import org.apache.druid.query.context.ResponseContext;
import org.apache.druid.query.dimension.DefaultDimensionSpec;
import org.apache.druid.query.spec.LegacySegmentSpec;
import org.apache.druid.segment.CloserRule;
import org.apache.druid.segment.IncrementalIndexSegment;
import org.apache.druid.segment.Segment;
import org.apache.druid.segment.TestHelper;
import org.apache.druid.segment.incremental.IncrementalIndex;
import org.apache.druid.segment.incremental.OnheapIncrementalIndex;
import org.apache.druid.timeline.SegmentId;
import org.junit.After;
import org.junit.Before;
import org.junit.Rule;
import org.junit.Test;

import java.io.IOException;
import java.util.Arrays;
import java.util.List;

/**
 *
 */
public class GroupByQueryRunnerFactoryTest
{
  @Rule
  public CloserRule closerRule = new CloserRule(true);

  private GroupByQueryRunnerFactory factory;
  private Closer resourceCloser;

  @Before
  public void setup()
  {
    this.resourceCloser = Closer.create();
    final TestGroupByBuffers buffers = resourceCloser.register(TestGroupByBuffers.createDefault());
    this.factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(new GroupByQueryConfig(), buffers);
  }

  @After
  public void teardown() throws IOException
  {
    factory = null;
    resourceCloser.close();
  }

  @Test
  public void testMergeRunnersEnsureGroupMerging()
  {
    GroupByQuery query = GroupByQuery
        .builder()
        .setDataSource("xx")
        .setQuerySegmentSpec(new LegacySegmentSpec("1970/3000"))
        .setGranularity(Granularities.ALL)
        .setDimensions(new DefaultDimensionSpec("tags", "tags"))
        .setAggregatorSpecs(new CountAggregatorFactory("count"))
        .build();

    QueryRunner mergedRunner = factory.getToolchest().mergeResults(
        new QueryRunner()
        {
          @Override
          public Sequence run(QueryPlus queryPlus, ResponseContext responseContext)
          {
            return factory.getToolchest().mergeResults(
                new QueryRunner()
                {
                  @Override
                  public Sequence run(QueryPlus queryPlus, ResponseContext responseContext)
                  {
                    final Query query = queryPlus.getQuery();
                    try {
                      return new MergeSequence(
                          query.getResultOrdering(),
                          Sequences.simple(
                              Arrays.asList(
                                  factory.createRunner(createSegment()).run(queryPlus, responseContext),
                                  factory.createRunner(createSegment()).run(queryPlus, responseContext)
                              )
                          )
                      );
                    }
                    catch (Exception e) {
                      throw new RuntimeException(e);
                    }
                  }
                }
            ).run(queryPlus, responseContext);
          }
        }
    );

    Sequence<ResultRow> result = mergedRunner.run(QueryPlus.wrap(query), ResponseContext.createEmpty());

    List<ResultRow> expectedResults = Arrays.asList(
        GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", "t1", "count", 2L),
        GroupByQueryRunnerTestHelper.createExpectedRow(query, "1970-01-01T00:00:00.000Z", "tags", "t2", "count", 4L)
    );

    TestHelper.assertExpectedObjects(expectedResults, result.toList(), "");
  }

  private Segment createSegment() throws Exception
  {
    IncrementalIndex incrementalIndex = new OnheapIncrementalIndex.Builder()
        .setSimpleTestingIndexSchema(new CountAggregatorFactory("count"))
        .setConcurrentEventAdd(true)
        .setMaxRowCount(5000)
        .build();

    StringInputRowParser parser = new StringInputRowParser(
        new CSVParseSpec(
            new TimestampSpec("timestamp", "iso", null),
            new DimensionsSpec(DimensionsSpec.getDefaultSchemas(ImmutableList.of("product", "tags"))),
            "\t",
            ImmutableList.of("timestamp", "product", "tags"),
            false,
            0
        ),
        "UTF-8"
    );

    String[] rows = new String[]{
        "2011-01-12T00:00:00.000Z,product_1,t1",
        "2011-01-13T00:00:00.000Z,product_2,t2",
        "2011-01-14T00:00:00.000Z,product_3,t2",
        };

    for (String row : rows) {
      incrementalIndex.add(parser.parse(row));
    }

    closerRule.closeLater(incrementalIndex);

    return new IncrementalIndexSegment(incrementalIndex, SegmentId.dummy("test"));
  }
}


text:
<TextView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/textview_discution_content"
    style="@style/TypefaceStyle.ProximaNova"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:paddingLeft="8dip"
    android:paddingRight="8dip"
    android:textColor="@color/apptheme_background"/>


text:
<!DOCTYPE HTML>

  <title>Test for Bug 493251</title>

  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>

Mozilla Bug 493251


text:
from django.conf.urls import url
from django.conf.urls import include

from apps.blog import views

post_patterns = [
    url(r'^(?P<slug>[-\w]+)/$', views.PostDetailView.as_view(),
        name='post_details'),
    url(r'^$', views.PostListView.as_view(), name='post_list'),
]

comment_patterns = [
    url(r'^list/$', views.CommentListView.as_view(), name='comment_list'),
]

urlpatterns = [
    url(r'^', include(post_patterns,)),
    url(r'^comment/', include(comment_patterns,)),
]


text:
package com.qiniu.storage;

import com.qiniu.common.QiniuException;
import com.qiniu.http.Client;
import com.qiniu.http.MethodType;
import com.qiniu.http.RequestStreamBody;
import com.qiniu.util.StringMap;
import com.qiniu.util.StringUtils;
import okhttp3.MediaType;
import okhttp3.RequestBody;
import okio.BufferedSink;

import java.io.InputStream;
import java.net.URL;
import java.net.URLEncoder;
import java.util.*;

/**
 * api 基类
 */
public class Api {

    private final Client client;

    protected Api(Client client) {
        this.client = client;
    }

    protected com.qiniu.http.Response requestByClient(Request request) throws QiniuException {
        if (client == null) {
            ApiUtils.throwInvalidRequestParamException("client");
        }

        if (request == null) {
            ApiUtils.throwInvalidRequestParamException("request");
        }

        request.prepareToRequest();

        if (request.method == MethodType.GET) {
            return client.get(request.getUrl().toString(), request.getHeader());
        } else if (request.method == MethodType.POST) {
            return client.post(request.getUrl().toString(), request.getRequestBody(), request.getHeader());
        } else if (request.method == MethodType.PUT) {
            return client.put(request.getUrl().toString(), request.getRequestBody(), request.getHeader());
        } else if (request.method == MethodType.DELETE) {
            return client.delete(request.getUrl().toString(), request.getRequestBody(), request.getHeader());
        } else {
            throw QiniuException.unrecoverable("暂不支持这种请求方式");
        }
    }

    /**
     * api 请求基类
     */
    public static class Request {

        /**
         * 请求的 urlPrefix, scheme + host
         * eg: https://upload.qiniu.com
         */
        private final String urlPrefix;

        /**
         * 请求 url 的 path
         */
        private String path;

        /**
         * 请求 url 的 信息,最终会被按顺序拼接作为 path /Segment0/Segment1
         */
        private final List<String> pathSegments = new ArrayList<>();

        /**
         * 请求 url 的 query
         * 由 queryInfo 拼接
         */
        private String query;

        /**
         * 请求 url 的 query 信息,最终会被拼接作为 query key0=value0&key1=value1
         */
        private final List<Pair<String, String>> queryPairs = new ArrayList<>();

        /**
         * Http 请求方式
         */
        private MethodType method;

        /**
         * 请求头
         */
        private final Map<String, String> header = new HashMap<>();

        /**
         * 请求 body
         */
        private RequestBody body;
        /**
         * 请求时,每次从流中读取的数据大小
         * 注: body 使用 InputStream 时才有效
         */
        private long streamBodySinkSize = 1024 * 10;

        /**
         * 构造请求对象
         *
         * @param urlPrefix 请求的 urlPrefix, scheme + host
         */
        protected Request(String urlPrefix) {
            this.urlPrefix = urlPrefix;
        }

        /**
         * 获取请求的 urlPrefix, scheme + host
         * eg: https://upload.qiniu.com
         *
         * @return urlPrefix
         */
        public String getUrlPrefix() {
            return urlPrefix;
        }

        /**
         * 获取 请求的 Host
         *
         * @return Host
         * @throws QiniuException 解析 urlPrefix 时的异常
         */
        public String getHost() throws QiniuException {
            try {
                URL url = new URL(urlPrefix);
                return url.getHost();
            } catch (Exception e) {
                throw new QiniuException(e);
            }
        }

        /**
         * 添加 path 信息,注意 path 添加顺序
         * 所有的 path item 最终会按照顺序被拼接作为 path
         * eg: /item0/item1
         *
         * @param segment 被添加 path segment
         */
        protected void addPathSegment(String segment) {
            if (segment == null) {
                return;
            }
            pathSegments.add(segment);
            path = null;
        }

        /**
         * 获取 url 的 path 信息
         *
         * @return path 信息
         * @throws QiniuException 异常
         */
        public String getPath() throws QiniuException {
            if (path == null) {
                buildPath();
            }
            return path;
        }

        /**
         * 根据 queryInfo 组装 query 字符串
         *
         * @throws QiniuException 组装 query 时的异常,一般为缺失必要参数的异常
         */
        protected void buildPath() throws QiniuException {
            path = "/" + StringUtils.join(pathSegments, "/");
        }

        /**
         * 增加 query 键值对
         *
         * @param key   key
         * @param value value
         */
        protected void addQueryPair(String key, String value) {
            if (StringUtils.isNullOrEmpty(key)) {
                return;
            }
            queryPairs.add(new Pair<String, String>(key, value));
            query = null;
        }

        /**
         * 获取 query 字符串
         *
         * @return query 字符串
         * @throws QiniuException 组装 query 时的异常,一般为缺失必要参数的异常
         */
        public String getQuery() throws QiniuException {
            if (StringUtils.isNullOrEmpty(query)) {
                buildQuery();
            }
            return query;
        }

        /**
         * 根据 queryInfo 组装 query 字符串
         *
         * @throws QiniuException 组装 query 时的异常,一般为缺失必要参数的异常
         */
        protected void buildQuery() throws QiniuException {

            StringBuilder builder = new StringBuilder();

            for (Pair<String, String> pair : queryPairs) {
                if (builder.length() > 0) {
                    builder.append("&");
                }

                try {
                    builder.append(URLEncoder.encode(pair.getKey(), "UTF-8"));
                    if (pair.getValue() != null) {
                        builder.append("=");
                        builder.append(URLEncoder.encode(pair.getValue(), "UTF-8"));
                    }
                } catch (Exception e) {
                    throw new QiniuException(e);
                }
            }

            query = builder.toString();
        }

        /**
         * 设置 Http 请求方式
         *
         * @param method Http 请求方式
         */
        protected void setMethod(MethodType method) {
            this.method = method;
        }

        /**
         * 增加请求头
         *
         * @param key   key
         * @param value value
         */
        public void addHeaderField(String key, String value) {
            if (StringUtils.isNullOrEmpty(key) || StringUtils.isNullOrEmpty(value)) {
                return;
            }
            header.put(key, value);
        }

        /**
         * 获取请求头信息
         *
         * @return 请求头信息
         * @throws QiniuException 异常
         */
        public StringMap getHeader() throws QiniuException {
            StringMap header = new StringMap();
            for (String key : this.header.keySet()) {
                header.put(key, this.header.get(key));
            }
            return header;
        }

        /**
         * 获取 URL
         *
         * @return url
         * @throws QiniuException 异常
         */
        public URL getUrl() throws QiniuException {
            try {
                URL url = new URL(urlPrefix);
                String file = url.getFile();
                String path = getPath();
                if (!StringUtils.isNullOrEmpty(path)) {
                    file += path;
                }

                String query = getQuery();
                if (!StringUtils.isNullOrEmpty(query)) {
                    file += '?' + query;
                }
                return new URL(url.getProtocol(), url.getHost(), url.getPort(), file);
            } catch (Exception e) {
                throw new QiniuException(e);
            }
        }

        /**
         * 设置请求体
         * 请求数据:在 body 中,从 bodyOffset 开始,获取 bodySize 大小的数据作为请求体
         *
         * @param body        请求数据源
         * @param offset      请求数据在 body 中的偏移量
         * @param size        请求数据大小
         * @param contentType 请求数据类型
         */
        protected void setBody(byte[] body, int offset, int size, String contentType) {
            if (StringUtils.isNullOrEmpty(contentType)) {
                contentType = Client.DefaultMime;
            }
            MediaType type = MediaType.parse(contentType);
            this.body = RequestBody.create(type, body, offset, size);
        }

        /**
         * 设置请求体
         *
         * @param body        请求数据源
         * @param contentType 请求数据类型
         * @param limitSize   最大读取 body 的大小;body 有多余则被舍弃;body 不足则会上传多有 body;
         *                    如果提前不知道 body 大小,但想上传所有 body,limitSize 设置为 -1 即可;
         */
        protected void setBody(InputStream body, String contentType, long limitSize) {
            if (StringUtils.isNullOrEmpty(contentType)) {
                contentType = Client.DefaultMime;
            }
            MediaType type = MediaType.parse(contentType);
            this.body = new RequestStreamBody(body, type, limitSize);
        }

        /**
         * 使用 streamBody 时,每次读取 streamBody 的大小,读取后发送
         * 默认:{@link Api.Request#streamBodySinkSize}
         * 相关:{@link RequestStreamBody#writeTo(BufferedSink) sinkSize}
         *
         * @param streamBodySinkSize 每次读取 streamBody 的大小
         * @return Request
         */
        public Request setStreamBodySinkSize(long streamBodySinkSize) {
            this.streamBodySinkSize = streamBodySinkSize;
            return this;
        }

        /**
         * 是否有请求体
         *
         * @return 是否有请求体
         */
        public boolean hasBody() {
            return body != null;
        }

        private RequestBody getRequestBody() {
            if (hasBody()) {
                if (body instanceof RequestStreamBody) {
                    ((RequestStreamBody) body).setSinkSize(streamBodySinkSize);
                }
                return body;
            } else {
                return RequestBody.create(null, new byte[0]);
            }
        }

        /**
         * 构造 body 信息,如果需要设置请求体,子类需要重写
         *
         * @throws QiniuException 异常
         */
        protected void buildBodyInfo() throws QiniuException {

        }

        /**
         * 准备上传 做一些参数检查 以及 参数构造
         *
         * @throws QiniuException 异常,一般为参数缺失
         */
        protected void prepareToRequest() throws QiniuException {
            buildPath();
            buildQuery();
            buildBodyInfo();
        }

        protected static class Pair<K, V> {

            /**
             * Key of this Pair.
             */
            private K key;

            /**
             * Gets the key for this pair.
             *
             * @return key for this pair
             */
            K getKey() {
                return key;
            }

            /**
             * Value of this this Pair.
             */
            private V value;

            /**
             * Gets the value for this pair.
             *
             * @return value for this pair
             */
            V getValue() {
                return value;
            }

            /**
             * Creates a new pair
             *
             * @param key   The key for this pair
             * @param value The value to use for this pair
             */
            protected Pair(K key, V value) {
                this.key = key;
                this.value = value;
            }

            /**
             *
String representation of this
             * Pair.

             *
             *
The default name/value delimiter '=' is always used.

             *
             * @return String representation of this Pair
             */
            @Override
            public String toString() {
                return key + "=" + value;
            }

            /**
             *
Generate a hash code for this Pair.

             *
             *
The hash code is calculated using both the name and
             * the value of the Pair.

             *
             * @return hash code for this Pair
             */
            @Override
            public int hashCode() {
                // name's hashCode is multiplied by an arbitrary prime number (13)
                // in order to make sure there is a difference in the hashCode between
                // these two parameters:
                //  name: a  value: aa
                //  name: aa value: a
                return key.hashCode() * 13 + (value == null ? 0 : value.hashCode());
            }

            /**
             *
Test this Pair for equality with another
             * Object.

             *
             *
If the Object to be tested is not a
             * Pair or is null, then this method
             * returns false.

             *
             *
Two Pairs are considered equal if and only if
             * both the names and values are equal.

             *
             * @param o the Object to test for
             *          equality with this Pair
             * @return true if the given Object is
             * equal to this Pair else false
             */
            @Override
            public boolean equals(Object o) {
                if (this == o) return true;
                if (o instanceof Pair) {
                    Pair pair = (Pair) o;
                    if (!Objects.equals(key, pair.key)) return false;
                    if (!Objects.equals(value, pair.value)) return false;
                    return true;
                }
                return false;
            }
        }
    }

    /**
     * api 响应基类
     */
    public static class Response {

        /**
         * 响应数据
         */
        private final StringMap dataMap;

        /**
         * 原响应结果
         */
        private final com.qiniu.http.Response response;

        /**
         * 构建 Response
         *
         * @param response com.qiniu.http.Response
         * @throws QiniuException 解析 data 异常
         */
        protected Response(com.qiniu.http.Response response) throws QiniuException {
            this.dataMap = response.jsonToMap();
            this.response = response;
        }

        /**
         * 获取 response data map
         *
         * @return data map
         */
        public StringMap getDataMap() {
            return dataMap;
        }

        /**
         * 获取 com.qiniu.http.Response,信息量更大
         *
         * @return com.qiniu.http.Response
         */
        public com.qiniu.http.Response getResponse() {
            return response;
        }

        /**
         * 请求是否成功
         *
         * @return 是否成功
         */
        public boolean isOK() {
            return response.isOK();
        }

        /**
         * 根据 keyPath 读取 data map 中对应的 String value
         * eg:
         * dataMap: {"key00" : { "key10" : "key10_value"}}
         * keyPath = new String[]{"key00", "key10"}
         * 调用方法后 value = key10_value
         *
         * @param keyPath keyPath
         * @return keyPath 对应的 String value
         */
        public String getStringValueFromDataMap(String... keyPath) {
            Object value = getValueFromDataMap(keyPath);
            if (value == null) {
                return null;
            }
            return value.toString();
        }

        /**
         * 根据 keyPath 读取 data map 中对应的 Long value
         * eg:
         * dataMap: {"key00" : { "key10" : 10}}
         * keyPath = new String[]{"key00", "key10"}
         * 调用方法后 value = 10
         *
         * @param keyPath keyPath
         * @return keyPath 对应的 Long value
         */
        public Long getLongValueFromDataMap(String... keyPath) {
            Object value = getValueFromDataMap(keyPath);
            return ApiUtils.objectToLong(value);
        }

        /**
         * 根据 keyPath 读取 data map 中对应的 Integer value
         * eg:
         * dataMap: {"key00" : { "key10" : 10}}
         * keyPath = new String[]{"key00", "key10"}
         * 调用方法后 value = 10
         *
         * @param keyPath keyPath
         * @return keyPath 对应的 Integer value
         */
        public Integer getIntegerValueFromDataMap(String... keyPath) {
            Object value = getValueFromDataMap(keyPath);
            return ApiUtils.objectToInteger(value);
        }

        /**
         * 根据 keyPath 读取 data map 中对应的 value
         * eg:
         * dataMap: {"key00" : { "key10" : "key10_value"}}
         * keyPath = new String[]{"key00", "key10"}
         * 调用方法后 value = key10_value
         *
         * @param keyPath keyPath
         * @return keyPath 对应的 value
         */
        public Object getValueFromDataMap(String... keyPath) {
            if (dataMap == null) {
                return null;
            }
            return ApiUtils.getValueFromMap(dataMap.map(), keyPath);
        }
    }
}


text:
package org.giweet.scenario.parser;

import static org.junit.Assert.*;

import java.util.Locale;

import org.giweet.scenario.Keyword;
import org.giweet.scenario.KeywordType;
import org.junit.Test;

public class KeywordParserTest {

	private KeywordParser keywordParser;

	@Test
	public void canGetKeywordInEnglish() {
		keywordParser = new KeywordParser(Locale.ENGLISH);

		assertNoKeyword("");
		assertNoKeyword("givengiven");
		assertNoKeyword("no given");
		assertNoKeyword(", given");
		assertKeyword(KeywordType.SCENARIO, "Scenario: ", "Scenario: ");
		assertKeyword(KeywordType.SCENARIO, "   scenario   : ", "   scenario   : ");
		assertKeyword(KeywordType.GIVEN, "given ", "given given");
		assertKeyword(KeywordType.GIVEN, "given", "given");
		assertKeyword(KeywordType.GIVEN, "\t\t\t\tgiven ", "\t\t\t\tgiven test");
		assertKeyword(KeywordType.GIVEN, "\u00a0given ", "\u00a0given test");
		assertKeyword(KeywordType.WHEN, "when ", "when when");
		assertKeyword(KeywordType.WHEN, "when", "when");
		assertKeyword(KeywordType.WHEN, "\t\t\t\twhen ", "\t\t\t\twhen test");
		assertKeyword(KeywordType.WHEN, "\u00a0when ", "\u00a0when test");
		assertKeyword(KeywordType.THEN, "then ", "then then");
		assertKeyword(KeywordType.THEN, "then", "then");
		assertKeyword(KeywordType.THEN, "\t\t\t\tthen ", "\t\t\t\tthen test");
		assertKeyword(KeywordType.THEN, "\u00a0then ", "\u00a0then test");
		assertKeyword(KeywordType.AND, "and ", "and then");
		assertKeyword(KeywordType.AND, "and", "and");
		assertKeyword(KeywordType.AND, "\t\t\t\tand ", "\t\t\t\tand test");
		assertKeyword(KeywordType.AND, "\u00a0and ", "\u00a0and test");
		assertKeyword(KeywordType.EXAMPLES, "examples:\n", "examples:\nexample here");
		assertKeyword(KeywordType.EXAMPLES, "examples:", "examples:");
		assertKeyword(KeywordType.META, "@", "@test");
		assertKeyword(KeywordType.META, "@", "@ test");
	}

	@Test
	public void canGetKeywordInFrench() {
		keywordParser = new KeywordParser(Locale.FRENCH);

		assertNoKeyword("");
		assertNoKeyword("etet");
		assertNoKeyword("aucun alors");
		assertNoKeyword(", quand");
		assertKeyword(KeywordType.SCENARIO, "Scenario: ", "Scenario: ");
		assertKeyword(KeywordType.SCENARIO, "Scénario: ", "Scénario: ");
		assertKeyword(KeywordType.SCENARIO, "   scenario   : ", "   scenario   : ");
		assertKeyword(KeywordType.GIVEN, "étant donné que ", "étant donné que ");
		assertKeyword(KeywordType.GIVEN, "étant donné que", "étant donné que");
		assertKeyword(KeywordType.GIVEN, "étant donné qu'", "étant donné qu'il");
		assertKeyword(KeywordType.GIVEN, "Etant donnés que", "Etant donnés que");
		assertKeyword(KeywordType.GIVEN, "\t\t\t\tétant  donné  que\t", "\t\t\t\tétant  donné  que\t");
		assertKeyword(KeywordType.WHEN, "quand ", "quand quand");
		assertKeyword(KeywordType.WHEN, "quand", "quand");
		assertKeyword(KeywordType.WHEN, "\t\t\t\tquand ", "\t\t\t\tquand test");
		assertKeyword(KeywordType.WHEN, "\u00a0quand ", "\u00a0quand test");
		assertKeyword(KeywordType.THEN, "alors ", "alors alors");
		assertKeyword(KeywordType.THEN, "alors", "alors");
		assertKeyword(KeywordType.THEN, "\t\t\t\talors ", "\t\t\t\talors test");
		assertKeyword(KeywordType.THEN, "\u00a0alors ", "\u00a0alors test");
		assertKeyword(KeywordType.AND, "et ", "et il");
		assertKeyword(KeywordType.AND, "et", "et");
		assertKeyword(KeywordType.AND, "\t\t\t\tet ", "\t\t\t\tet test");
		assertKeyword(KeywordType.AND, "Et que ", "Et que ceci");
		assertKeyword(KeywordType.AND, "Et que", "Et que");
		assertKeyword(KeywordType.AND, "et qu'", "et qu'il");
		assertKeyword(KeywordType.EXAMPLES, "exemples:\n", "exemples:\nmettre les exemples ici");
		assertKeyword(KeywordType.META, "@", "@test");
		assertKeyword(KeywordType.META, "@", "@ test");
	}

	private void assertKeyword(KeywordType expectedKeywordType, String expectedStringValue, String string) {
		for (KeywordType keywordType : KeywordType.values()) {
			Keyword keyword = keywordParser.getKeyword(string, keywordType);
			if (keywordType != expectedKeywordType) {
				assertNull(keyword);
			}
			else {
				assertNotNull("keyword must not be null", keyword);
				assertEquals(expectedKeywordType, keyword.getType());
				assertEquals(expectedStringValue, keyword.toString());

			}
		}
	}

	private void assertNoKeyword(String string) {
		for (KeywordType keywordType : KeywordType.values()) {
			assertNull(keywordParser.getKeyword(string, keywordType));
		}
	}
}


text:
<!DOCTYPE html>

		<title></title>

		</map>


text:
package androidx.annotation;

public @interface Nullable {
}


text:
package org.lightframe.components;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Map;

import org.lightframe.components.client.ui.VSuperImmediateTextField;

import com.vaadin.data.Property;
import com.vaadin.terminal.PaintException;
import com.vaadin.terminal.PaintTarget;
import com.vaadin.ui.TextField;

/**
 * A text input widget that recognizes each keypress and informs the server side
 * about the event.
 *
 * @author Henrik Paul
 * @see TextField
 */
public class SuperImmediateTextField extends TextField {

    /**
     * A class that is informed whenever a {@link SuperImmediateTextField} is
     * typed upon.
     *
     * @author Henrik Paul
     * @see SuperImmediateTextField#addListener(KeyPressListener)
     * @see SuperImmediateTextField#removeListener(KeyPressListener)
     */
    public interface KeyPressListener extends Serializable {
        /**
         * Inform that a key has been pressed in an
         * {@link SuperImmediateTextField}.
         *
         * @param event
         */
        public void keyPressed(KeyPressEvent event);
    }

    /**
     * An event that is sent whenever a key is pressed in a
     * {@link SuperImmediateTextField}.
     *
     * @author Henrik Paul
     */
    public interface KeyPressEvent extends Serializable {
        /**
         * Get the source of the {@link KeyPressEvent}.
         *
         * @return The {@link SuperImmediateTextField} that was typed upon.
         */
        public SuperImmediateTextField getSource();
    }

    private static final long serialVersionUID = -8423510242229989097L;

    private final KeyPressEvent keypressEvent = new KeyPressEvent() {
        private static final long serialVersionUID = 1L;

        public SuperImmediateTextField getSource() {
            return SuperImmediateTextField.this;
        }
    };

    private final Collection<KeyPressListener> listeners = new ArrayList<KeyPressListener>();

    private int delayMillis = VSuperImmediateTextField.DEFAULT_DELAY;

    /**
     * @see TextField#TextField()
     */
    public SuperImmediateTextField() {
        super();
    }

    /**
     * @see TextField#TextField(Property)
     */
    public SuperImmediateTextField(Property dataSource) {
        super(dataSource);
    }

    /**
     * @see TextField#TextField(String, Property)
     */
    public SuperImmediateTextField(String caption, Property dataSource) {
        super(caption, dataSource);
    }

    /**
     * @see TextField#TextField(String, String)
     */
    public SuperImmediateTextField(String caption, String value) {
        super(caption, value);
    }

    /**
     * @see TextField#TextField(String)
     */
    public SuperImmediateTextField(String caption) {
        super(caption);
    }

    @Override
    public String getTag() {
        return "superimmediatetextfield";
    }

    @Override
    @SuppressWarnings("unchecked")
    public void changeVariables(Object source, Map variables) {
        super.changeVariables(source, variables);

        if (variables.containsKey(VSuperImmediateTextField.PROPERTY_KEYPRESSED)) {
            fireKeyPressEvent();
        }
    }

    protected void fireKeyPressEvent() {
        for (KeyPressListener listener : listeners) {
            listener.keyPressed(keypressEvent);
        }
    }

    public void addListener(KeyPressListener listener) {
        if (listener != null) {
            listeners.add(listener);
        }
    }

    public void removeListener(KeyPressListener listener) {
        listeners.remove(listener);
    }

    /**
     * Set the delay to wait until the super immediate event is sent from when
     * the user starts typing.
     *
     * @param delayInMillis
     *            How many milliseconds to wait. If negative, no event will be
     *            sent.
     */
    public void setDelay(final int delayInMillis) {
        delayMillis = delayInMillis;
        requestRepaint();
    }

    /**
     * Get the time waited between the user's start of typing and when the super
     * immediate event.
     *
     * @return The delayed time in milliseconds. A negative result indicates
     *         that no events will be sent.
     */
    public int getDelay() {
        return delayMillis;
    }

    @Override
    public void paintContent(PaintTarget target) throws PaintException {
        super.paintContent(target);

        target.addAttribute(VSuperImmediateTextField.ATTRIBUTE_DELAY,
                delayMillis);
    }
}


text:
Wee-grid is an extremely simple, customizable, and responsive CSS grid. Both media query breakpoints and number of grid columns are customizable. Wee-grid uses [Sass](http://sass-lang.com/) for precompiling CSS, [PostCSS](https://postcss.org/) for optimization, and [webpack](https://webpack.js.org/) for builds.

## Usage

### Media Query Breakpoints
By default wee-grid uses a 12-column grid over 4 media query breakpoints. Media queries are configured for mobile-first usage.

| Breakpoint | Width  |
|------------|--------|
| sm         | 567px  |
| md         | 768px  |
| lg         | 992px  |
| xl         | 1200px |

### CSS Classes for Grid Column Containers

Column containers have the the following name convention:

`col-[breakpoint]-[number of columns]-[column set size]`

**Examples:**

```
col-sm-4-12
col-md-6-12
col-lg-8-12
```

_(CSS class names can use simpler fractions by creating custom column sets.)_

### Building a Grid

Wrap a grid row within an element with a `wg` CSS class.  The following grid contains two containers that are initially the width of the screen. When the `md` breakpoint is reached each container will be half the width of the screen.

```
<div class="wg">
  <div class="col-md-6-12">foo</div>
  <div class="col-md-6-12">bar</div>
</div>

```

The grid uses standard CSS floats and drops so multiple rows can be created in an element within a `wg` class. Just make sure that all containers span columns gracefully to avoid float drops.

```
<div class="wg">
  <div class="col-md-6-12">foo</div>
  <div class="col-md-6-12">bar</div>
  <div class="col-md-10-12">foo</div>
  <div class="col-md-2-12">bar</div>
</div>

```

Multiple `col-` classes can be used for behavior at multiple breakpoints.

```
<div class="wg">
  <div class="col-sm-4-12 col-md-6-12 col-lg-2-12">foo</div>
  <div class="col-sm-8-12 col-md-6-12 col-lg-10-12">foo</div>
</div>

```
## Customization

### Breakpoints
Default breakpoints are listed in `src/_config.scss`. They may be changed to different sizes and unit types.

```
$breakpoints: (
	sm : 567px,
	md : 768px,
	lg : 992px,
	xl : 1200px,
);
```

_If you add or change the name of a breakpoint, be sure to use that name in your column class. For example if you add an `xxl` breakpoint you'll want to use class names like `col-xxl-6-12`._

### Column Sets

Change the number of grid columns used in `src/wee-grid.scss`. By default a 12-column grid is built but as per the commented examples, multiple column sets can be defined and used at once. Each column set is created from a Sass mixin. You can create new column sets using any positive integer.

```
// --------- Specify Column Set(s) ---------- //
//
// Multiple columnsets may be used.
//
// @include column-set(2);
// @include column-set(4);
// @include column-set(6);
// @include column-set(8);
@include column-set(12);
// @include column-set(16);
```

By enabling the `@include column-set(2)` column set we can use simpler, more intuitive class names.  Instead of using the `col-md-6-12` CSS class, we'd use simpler fractions.

```
<div class="wg">
  <div class="col-md-1-2">foo</div>
  <div class="col-md-1-2">bar</div>
</div>

```

## Contributing

Contributions are welcome. Remember that wee-grid wants to stay as simple as possible. It wants to be a grid, not a responsive framework. :-)

1. Fork this repository (https://github.com/ecarlisle/wee-grid/fork).
2. Create your feature branch (git checkout -b my-new-feature)
3. Commit your changes (git commit -am 'Here is some new awesomeness!')
4. Push to the branch (git push origin my-new-feature)
5. Create a new Pull Request


text:
<?xml version="1.0" encoding="utf-8"?>
<transitionSet xmlns:android="http://schemas.android.com/apk/res/android"
    android:duration="@integer/google_play_services_version">
    <slide />
    <changeBounds />
</transitionSet>