text:
<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ Copyright 2017 Paweł Typiak
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the License.
  ~ You may obtain a copy of the License at
  ~
  ~      http://www.apache.org/licenses/LICENSE-2.0
  ~
  ~ Unless required by applicable law or agreed to in writing, software
  ~ distributed under the License is distributed on an "AS IS" BASIS,
  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  ~ See the License for the specific language governing permissions and
  ~ limitations under the License.
-->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical" android:layout_width="match_parent"
    android:layout_height="match_parent">
    <LinearLayout
        android:id="@+id/weather_details_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingLeft="@dimen/main_activity_sublayout_horizontal_margin"
        android:paddingRight="@dimen/main_activity_sublayout_horizontal_margin"
        android:paddingTop="@dimen/main_activity_sublayout_vertical_margin"
        android:paddingBottom="@dimen/main_activity_sublayout_vertical_margin"
        >
        <paweltypiak.weatherial.customViews.RobotoMediumFontTextView
            android:id="@+id/weather_details_layout_header_text"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/main_activity_subheader_bottom_margin"
            android:gravity="center"
            android:textSize="@dimen/header_text_size"
            android:text="@string/details_header"
            android:textColor="@color/colorPrimary"
            />
        <LinearLayout
            android:id="@+id/weather_details_layout_additional_conditions_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="@dimen/main_activity_sublayout_vertical_margin"
            android:orientation="horizontal"
            android:baselineAligned="false"
            >
            <LinearLayout
                android:id="@+id/weather_details_layout_additional_conditions_layout_direction_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <RelativeLayout
                    android:id="@+id/weather_details_layout_direction_icon_layout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginBottom="@dimen/additional_conditions_icons_bottom_margin"
                    android:orientation="vertical"
                    >
                    <ImageView
                        android:id="@+id/weather_details_layout_direction_north_icon_image"
                        android:layout_width="@dimen/additional_conditions_icons_size"
                        android:layout_height="@dimen/additional_conditions_icons_size"
                        />
                    <ImageView
                        android:id="@+id/weather_details_layout_direction_image"
                        android:layout_width="@dimen/additional_conditions_icons_size"
                        android:layout_height="@dimen/additional_conditions_icons_size"
                        />
                </RelativeLayout>
                <TextView
                    android:id="@+id/weather_details_layout_direction_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textSize="@dimen/additional_conditions_text_size"
                    />
            </LinearLayout>
            <LinearLayout
                android:id="@+id/weather_details_layout_speed_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal"
                >
                <android.support.v4.widget.Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"/>
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <ImageView
                        android:id="@+id/weather_details_layout_speed_image"
                        android:layout_width="@dimen/additional_conditions_icons_size"
                        android:layout_height="@dimen/additional_conditions_icons_size"
                        android:layout_marginBottom="@dimen/additional_conditions_icons_bottom_margin"
                        android:layout_gravity="center"
                        />
                    <TextView
                        android:id="@+id/weather_details_layout_speed_text"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:ems="5"
                        android:textSize="@dimen/additional_conditions_text_size"
                        />
                </LinearLayout>
                <android.support.v4.widget.Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"/>
            </LinearLayout>
            <LinearLayout
                android:id="@+id/weather_details_layout_pressure_layout"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="horizontal">
                <android.support.v4.widget.Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="1"/>
                <LinearLayout
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:orientation="vertical">
                    <ImageView
                        android:id="@+id/weather_details_layout_pressure_image"
                        android:layout_width="@dimen/additional_conditions_icons_size"
                        android:layout_height="@dimen/additional_conditions_icons_size"
                        android:layout_marginBottom="@dimen/additional_conditions_icons_bottom_margin"
                        android:layout_gravity="center"
                        />
                    <TextView
                        android:id="@+id/weather_details_layout_pressure_text"
                        android:layout_width="wrap_content"
                        android:layout_height="wrap_content"
                        android:gravity="center"
                        android:ems="5"
                        android:textSize="@dimen/additional_conditions_text_size"
                        />
                </LinearLayout>
                <android.support.v4.widget.Space
                    android:layout_width="0dp"
                    android:layout_height="match_parent"
                    android:layout_weight="2"/>
            </LinearLayout>
            <LinearLayout
                android:id="@+id/weather_details_layout_humidity_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="vertical"
                >
                <ImageView
                    android:id="@+id/weather_details_layout_humidity_image"
                    android:layout_width="@dimen/additional_conditions_icons_size"
                    android:layout_height="@dimen/additional_conditions_icons_size"
                    android:layout_marginBottom="@dimen/additional_conditions_icons_bottom_margin"
                    />
                <TextView
                    android:id="@+id/weather_details_layout_humidity_text"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:textSize="@dimen/additional_conditions_text_size"
                    />
            </LinearLayout>
        </LinearLayout>
        <View
            android:id="@+id/weather_details_layout_subdivider"
            android:layout_width="match_parent"
            android:layout_height="@dimen/divider_size"
            android:layout_marginBottom="@dimen/main_activity_sublayout_vertical_margin"/>
        <LinearLayout
            android:id="@+id/weather_details_layout_sun_path_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            >
            <RelativeLayout
                android:id="@+id/weather_details_layout_sun_path_progress_icon_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <ImageView
                    android:id="@+id/weather_details_layout_sun_path_progress_icon_image"
                    android:layout_width="@dimen/sun_path_progress_icon_size"
                    android:layout_height="@dimen/sun_path_progress_icon_size"
                    />
            </RelativeLayout>
            <LinearLayout
                android:id="@+id/weather_details_layout_sun_path_progress_bar_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                >
                <ImageView
                    android:id="@+id/weather_details_layout_sun_path_progress_bar_left_boundary_image"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    />
                <LinearLayout
                    android:layout_width="0dp"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:layout_gravity="center_vertical"
                    >
                    <View
                        android:id="@+id/weather_details_layout_sun_path_progress_bar_progress_view"
                        android:layout_width="wrap_content"
                        android:layout_height="@dimen/sun_path_progress_bar_view_size"/>
                    <View
                        android:id="@+id/weather_details_layout_sun_path_progress_bar_background_view"
                        android:layout_width="0dp"
                        android:layout_height="@dimen/sun_path_progress_bar_view_size"
                        android:layout_weight="1"/>
                </LinearLayout>
                <ImageView
                    android:id="@+id/weather_details_layout_sun_path_progress_bar_right_boundary_image"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    />
            </LinearLayout>
            <RelativeLayout
                android:id="@+id/weather_details_layout_sun_path_arrow_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">
                <ImageView
                    android:id="@+id/weather_details_layout_sun_path_left_arrow_image"
                    android:layout_width="@dimen/sun_path_arrow_icon_size"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:layout_alignParentLeft="true"
                    android:scaleType="centerInside"
                    />
                <ImageView
                    android:id="@+id/weather_details_layout_sun_path_right_arrow_image"
                    android:layout_width="@dimen/sun_path_arrow_icon_size"
                    android:layout_height="wrap_content"
                    android:adjustViewBounds="true"
                    android:layout_alignParentRight="true"
                    android:scaleType="centerInside"
                    android:rotation="180"
                    />
            </RelativeLayout>
            <RelativeLayout
                android:id="@+id/weather_details_layout_sun_path_time_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                >
                <TextView
                    android:id="@+id/weather_details_layout_sun_path_left_time_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:layout_alignParentLeft="true"
                    android:includeFontPadding="false"
                    />
                <TextView
                    android:id="@+id/weather_details_layout_sun_path_right_time_text"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center"
                    android:layout_alignParentRight="true"
                    android:includeFontPadding="false"
                    />
            </RelativeLayout>
        </LinearLayout>
    </LinearLayout>
    <View
        android:id="@+id/weather_details_layout_bottom_divider"
        android:layout_width="match_parent"
        android:layout_height="@dimen/divider_size"
        android:background="@color/dividerLightBackground"
        />
</LinearLayout>


text:
package org.apache.spark.deploy.master

import org.apache.spark.SparkConf
import org.apache.spark.util.{IntParam, Utils}

/**
  * Command-line parser for the master.<br>
  * MasterArguments为Master解析命令行参数
  */
private[spark] class MasterArguments(args: Array[String], conf: SparkConf) {

  /**
    * 先从系统环境变量获取,然后在解析命令行参数。如果有相同的则覆盖
    */
  var host = Utils.localHostName()
  /**
    * 先从系统环境变量获取,然后在解析命令行参数。如果有相同的则覆盖
    */
  var port = 7077
  /**
    * 先从系统环境变量获取,然后在解析命令行参数。如果有相同的则覆盖
    */
  var webUiPort = 8080

  var propertiesFile: String = null

  // Check for settings in environment variables
  if (System.getenv("SPARK_MASTER_HOST") != null) {
    host = System.getenv("SPARK_MASTER_HOST")
  }
  if (System.getenv("SPARK_MASTER_PORT") != null) {
    port = System.getenv("SPARK_MASTER_PORT").toInt
  }
  if (System.getenv("SPARK_MASTER_WEBUI_PORT") != null) {
    webUiPort = System.getenv("SPARK_MASTER_WEBUI_PORT").toInt
  }
  //TODO 解析命令行参数。如果有相同的则覆盖
  parse(args.toList)

  // This mutates the SparkConf, so all accesses to it must be made after this line
  propertiesFile = Utils.loadDefaultSparkProperties(conf, propertiesFile)

  if (conf.contains("spark.master.ui.port")) {
    webUiPort = conf.get("spark.master.ui.port").toInt
  }

  def parse(args: List[String]): Unit = args match {
    case ("--ip" | "-i") :: value :: tail =>
      Utils.checkHost(value, "ip no longer supported, please use hostname " + value)
      host = value
      parse(tail)

    case ("--host" | "-h") :: value :: tail =>
      Utils.checkHost(value, "Please use hostname " + value)
      host = value
      parse(tail)

    case ("--port" | "-p") :: IntParam(value) :: tail =>
      port = value
      parse(tail)

    case "--webui-port" :: IntParam(value) :: tail =>
      webUiPort = value
      parse(tail)

    case ("--properties-file") :: value :: tail =>
      propertiesFile = value
      parse(tail)

    case ("--help") :: tail =>
      printUsageAndExit(0)

    case Nil => {}

    case _ =>
      printUsageAndExit(1)
  }

  /**
    * Print usage and exit JVM with the given exit code.
    */
  def printUsageAndExit(exitCode: Int) {
    System.err.println(
      "Usage: Master [options]\n" +
        "\n" +
        "Options:\n" +
        "  -i HOST, --ip HOST     Hostname to listen on (deprecated, please use --host or -h) \n" +
        "  -h HOST, --host HOST   Hostname to listen on\n" +
        "  -p PORT, --port PORT   Port to listen on (default: 7077)\n" +
        "  --webui-port PORT      Port for web UI (default: 8080)\n" +
        "  --properties-file FILE Path to a custom Spark properties file.\n" +
        "                         Default is conf/spark-defaults.conf.")
    System.exit(exitCode)
  }
}

redpajama_set_name: RedPajamaGithub


text:
#ifndef MAINUI_H_
#define MAINUI_H_

#include <QtGui>
#include <QtCore>
#include <QUiLoader>

namespace Inversitive {

class MainUI : public QWidget {

	Q_OBJECT

public:
	MainUI(QWidget *parent = 0);
	virtual ~MainUI();

private:
	QUiLoader 	*loader;
	QFile		*ui_file;
	QVBoxLayout	*layout;
	QWidget		*loaded_widget;
	QPropertyAnimation	*animation;
	QTextEdit 	*edit;
	QPushButton	*save;
	bool		expanded;

private slots:
	void		Press();
	void		AnimationOver();
	void		SaveFile();
};

}

#endif /* MAINUI_H_ */


text:
require "status_response/version"
require "status_response/controller_methods"

module StatusResponse
  class Engine < Rails::Engine
    initializer "status_response.controller_methods" do |app|
      ActionController::Base.send :include, StatusResponse::ControllerMethods
    end
  end
end


text:
#set($symbol_pound='#')
#set($symbol_dollar='$')
#set($symbol_escape='\')

package ${package};

import java.util.Date;

/**
 * Example Java class providing data to be called by .jsp
 *
 * @author technosf
 * @since 0.0.1
 * @version 0.0.1
 */
public class MyApp
{
    /**
     * Whats the date?
     *
     * @return the date
     */
    public String getHelloDate()
    {
        return new Date().toString();
    }
}


text:
/**
 * @file    ARMCMx/GCC/crt0.c
 * @brief   Generic GCC Cortex-Mx startup file.
 *
 * @addtogroup ARMCMx_GCC_STARTUP
 * @{
 */

#include <stdint.h>

#if !defined(FALSE)
#define FALSE       0
#endif

#if !defined(TRUE)
#define TRUE        (!FALSE)
#endif

#define SCB_CPACR               *((uint32_t *)0xE000ED88U)
#define SCB_FPCCR               *((uint32_t *)0xE000EF34U)
#define SCB_FPDSCR              *((uint32_t *)0xE000EF3CU)
#define FPCCR_ASPEN             (0x1U << 31)
#define FPCCR_LSPEN             (0x1U << 30)

typedef void (*funcp_t)(void);
typedef funcp_t * funcpp_t;

#define SYMVAL(sym) (uint32_t)(((uint8_t *)&(sym)) - ((uint8_t *)0))

/*
 * Area fill code, it is a macro because here functions cannot be called
 * until stacks are initialized.
 */
#define fill32(start, end, filler) {                                        \
  uint32_t *p1 = (start);                                                   \
  uint32_t *p2 = (end);                                                     \
  while (p1 < p2)                                                           \
    *p1++ = (filler);                                                       \
}

/*===========================================================================*/
/**
 * @name    Startup settings
 * @{
 */
/*===========================================================================*/

/**
 * @brief   Control special register initialization value.
 * @details The system is setup to run in privileged mode using the PSP
 *          stack (dual stack mode).
 */
#if !defined(CRT0_CONTROL_INIT) || defined(__DOXYGEN__)
#define CRT0_CONTROL_INIT           0x00000002
#endif

/**
 * @brief   Stack segments initialization switch.
 */
#if !defined(CRT0_STACKS_FILL_PATTERN) || defined(__DOXYGEN__)
#define CRT0_STACKS_FILL_PATTERN    0x55555555
#endif

/**
 * @brief   Stack segments initialization switch.
 */
#if !defined(CRT0_INIT_STACKS) || defined(__DOXYGEN__)
#define CRT0_INIT_STACKS            TRUE
#endif

/**
 * @brief   DATA segment initialization switch.
 */
#if !defined(CRT0_INIT_DATA) || defined(__DOXYGEN__)
#define CRT0_INIT_DATA              TRUE
#endif

/**
 * @brief   BSS segment initialization switch.
 */
#if !defined(CRT0_INIT_BSS) || defined(__DOXYGEN__)
#define CRT0_INIT_BSS               TRUE
#endif

/**
 * @brief   Constructors invocation switch.
 */
#if !defined(CRT0_CALL_CONSTRUCTORS) || defined(__DOXYGEN__)
#define CRT0_CALL_CONSTRUCTORS      TRUE
#endif

/**
 * @brief   Destructors invocation switch.
 */
#if !defined(CRT0_CALL_DESTRUCTORS) || defined(__DOXYGEN__)
#define CRT0_CALL_DESTRUCTORS       TRUE
#endif

/** @} */

/*===========================================================================*/
/**
 * @name    Symbols from the scatter file
 */
/*===========================================================================*/

/**
 * @brief   Main stack lower boundary.
 * @details This symbol must be exported by the linker script and represents
 *          the main stack lower boundary.
 */
extern uint32_t __main_stack_base__;

/**
 *
 * @brief   Main stack initial position.
 * @details This symbol must be exported by the linker script and represents
 *          the main stack initial position.
 */
extern uint32_t __main_stack_end__;

/**
 * @brief   Process stack lower boundary.
 * @details This symbol must be exported by the linker script and represents
 *          the process stack lower boundary.
 */
extern uint32_t __process_stack_base__;

/**
 * @brief   Process stack initial position.
 * @details This symbol must be exported by the linker script and represents
 *          the process stack initial position.
 */
extern uint32_t __process_stack_end__;

/**
 * @brief   ROM image of the data segment start.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern uint32_t _textdata;

/**
 * @brief   Data segment start.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern uint32_t _data;

/**
 * @brief   Data segment end.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern uint32_t _edata;

/**
 * @brief   BSS segment start.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern uint32_t _bss_start;

/**
 * @brief   BSS segment end.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern uint32_t _bss_end;

/**
 * @brief   Constructors table start.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern funcp_t __init_array_start;

/**
 * @brief   Constructors table end.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern funcp_t __init_array_end;

/**
 * @brief   Destructors table start.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern funcp_t __fini_array_start;

/**
 * @brief   Destructors table end.
 * @pre     The symbol must be aligned to a 32 bits boundary.
 */
extern funcp_t __fini_array_end;

/** @} */

/**
 * @brief   Application @p main() function.
 */
extern void main(void);

/**
 * @brief   Early initialization.
 * @details This hook is invoked immediately after the stack initialization
 *          and before the DATA and BSS segments initialization. The
 *          default behavior is to do nothing.
 * @note    This function is a weak symbol.
 */
#if !defined(__DOXYGEN__)
__attribute__((weak))
#endif
void __early_init(void) {}

/**
 * @brief   Late initialization.
 * @details This hook is invoked after the DATA and BSS segments
 *          initialization and before any static constructor. The
 *          default behavior is to do nothing.
 * @note    This function is a weak symbol.
 */
#if !defined(__DOXYGEN__)
__attribute__((weak))
#endif
void __late_init(void) {}

/**
 * @brief   Default @p main() function exit handler.
 * @details This handler is invoked or the @p main() function exit. The
 *          default behavior is to enter an infinite loop.
 * @note    This function is a weak symbol.
 */
#if !defined(__DOXYGEN__)
__attribute__((noreturn, weak))
#endif
void _default_exit(void) {
  while (1)
    ;
}

/**
 * @brief   Reset vector.
 */
#if !defined(__DOXYGEN__)
__attribute__((naked))
#endif
void Reset_Handler(void) {
  uint32_t psp, reg;

  /* Process Stack initialization, it is allocated starting from the
     symbol __process_stack_end__ and its lower limit is the symbol
     __process_stack_base__.*/
  asm volatile ("cpsid   i");
  psp = SYMVAL(__process_stack_end__);
  asm volatile ("msr     PSP, %0" : : "r" (psp));

#if CORTEX_USE_FPU
  /* Initializing the FPU context save in lazy mode.*/
  SCB_FPCCR = FPCCR_ASPEN | FPCCR_LSPEN;

  /* CP10 and CP11 set to full access.*/
  SCB_CPACR |= 0x00F00000;

  /* FPSCR and FPDSCR initially zero.*/
  reg = 0;
  asm volatile ("vmsr    FPSCR, %0" : : "r" (reg) : "memory");
  SCB_FPDSCR = reg;

  /* CPU mode initialization, enforced FPCA bit.*/
  reg = CRT0_CONTROL_INIT | 4;
#else
  /* CPU mode initialization.*/
  reg = CRT0_CONTROL_INIT;
#endif
  asm volatile ("msr     CONTROL, %0" : : "r" (reg));
  asm volatile ("isb");

  /* Early initialization hook invocation.*/
  __early_init();

#if CRT0_INIT_STACKS
  /* Main and Process stacks initialization.*/
  fill32(&__main_stack_base__,
         &__main_stack_end__,
         CRT0_STACKS_FILL_PATTERN);
  fill32(&__process_stack_base__,
         &__process_stack_end__,
         CRT0_STACKS_FILL_PATTERN);
#endif

#if CRT0_INIT_DATA
  /* DATA segment initialization.*/
  {
    uint32_t *tp, *dp;

    tp = &_textdata;
    dp = &_data;
    while (dp < &_edata)
      *dp++ = *tp++;
  }
#endif

#if CRT0_INIT_BSS
  /* BSS segment initialization.*/
  fill32(&_bss_start, &_bss_end, 0);
#endif

  /* Late initialization hook invocation.*/
  __late_init();

#if CRT0_CALL_CONSTRUCTORS
  /* Constructors invocation.*/
  {
    funcpp_t fpp = &__init_array_start;
    while (fpp < &__init_array_end) {
      (*fpp)();
      fpp++;
    }
  }
#endif

  /* Invoking application main() function.*/
  main();

#if CRT0_CALL_DESTRUCTORS
  /* Destructors invocation.*/
  {
    funcpp_t fpp = &__fini_array_start;
    while (fpp < &__fini_array_end) {
      (*fpp)();
      fpp++;
    }
  }
#endif

  /* Invoking the exit handler.*/
  _default_exit();
}

/** @} */


text:
// [START earthengine__apidocs__ee_geometry_type]
// Define a Geometry object.
var geometry = ee.Geometry({
  'type': 'Polygon',
  'coordinates':
    [[[-122.081, 37.417],
      [-122.086, 37.421],
      [-122.084, 37.418],
      [-122.089, 37.416]]]
});

// Apply the type method to the Geometry object.
var geometryType = geometry.type();

// Print the result to the console.
print('geometry.type(...) =', geometryType);

// Display relevant geometries on the map.
Map.setCenter(-122.085, 37.422, 15);
Map.addLayer(geometry,
             {'color': 'black'},
             'Geometry [black]: geometry');
// [END earthengine__apidocs__ee_geometry_type]


text:
/**
 * ModelMapper is an intelligent object mapping library.
 *
 *

 * The principal public APIs in this package are:
 *
 *

 *
{@link org.modelmapper.ModelMapper}
 *
The class you instantiate to perform object mapping, load mapping definitions and register mappers.
 *
 *
{@link org.modelmapper.PropertyMap}
 *
The class you extend to define mappings between source and destination properties.
 *
 *
{@link org.modelmapper.TypeMap}
 *
The interface you use to perform configuration, introspection and mapping between two types.
 *
 *
{@link org.modelmapper.Converter}
 *
The interface you implement to perform custom mapping between two types or property hierarchies.
 *
 *
{@link org.modelmapper.Provider}
 *
The interface you implement to provide instances of destination types.
 *
 *
{@link org.modelmapper.Condition}
 *
The interface you implement to conditionally create a mapping.
 *

 */
package org.modelmapper;


text:
package be.studiocredo

import be.studiocredo.reservations.TicketGenerator
import be.studiocredo.util.ServiceReturnValues._
import com.github.tototoshi.slick.JodaSupport._
import com.google.inject.Inject
import models.entities._
import models.ids.OrderId
import models.schema.tables._
import org.joda.time.DateTime
import play.api.db.slick.Config.driver.simple._

import scala.slick.session.Session

class TicketService @Inject()(orderService: OrderService) {
  val TicketQ = Query(TicketDistributionLog)

  def find(id: OrderId)(implicit s: Session): List[TicketDistribution] = {
    TicketQ.filter(q => q.orderId === id).sortBy(_.serial.desc).list
  }

  def find(id: OrderId, serial: Int)(implicit s: Session): Option[TicketDistribution] = {
    TicketQ.filter(q => q.orderId === id && q.serial === serial).firstOption
  }

  def find(ticket: TicketDistribution)(implicit s: Session): Option[TicketDistribution] = {
    TicketQ.filter(q => q.orderId === ticket.order && q.serial === ticket.serial && q.date === ticket.date).firstOption
  }

  def findOrCreate(order: OrderId)(implicit s: Session): Either[ServiceFailure, TicketDistribution] = {
    find(order).headOption.fold(create(order))(Right(_))
  }

  def create(orderId: OrderId)(implicit s: Session): Either[ServiceFailure, TicketDistribution] = {
    orderService.find(orderId) match {
      case None => Left(serviceFailure("ticket.order.notfound"))
      case Some(order) =>
        val ticket = TicketDistribution(order.id, nextSerial(order.id), DateTime.now)
        TicketDistributionLog.*.insert(ticket)
        Right(ticket)
    }
  }

  def createForNew()(implicit s: Session): List[TicketDistribution] = {
    val now = DateTime.now
    val paidOrders = orderService.findPaidForUpcomingShows()
    val processedOrders = ( for {
      ticket <- TicketQ
      if ticket.orderId inSet paidOrders
    } yield ticket.orderId ).list

    (paidOrders.toSet -- processedOrders.toSet).map { order =>
      val ticket = TicketDistribution(order, nextSerial(order), now)
      TicketDistributionLog.*.insert(ticket)
      ticket
    }.toList
  }

  def generate(ticket: TicketDistribution, url: String)(implicit s: Session): Either[ServiceFailure, TicketDocument] = {
    find(ticket.order, ticket.serial) match {
      case None => Left(serviceFailure("ticket.notfound"))
      case Some(actualTicket) =>
        orderService.get(actualTicket.order) match {
          case None => Left(serviceFailure("ticket.order.notfound"))
          case Some(order) =>
            TicketGenerator.create(order, actualTicket, url) match {
              case None => Left(serviceFailure("ticket.generation.failed"))
              case Some(ticketDocument) => Right(ticketDocument)
            }
        }
    }
  }

  private def nextSerial(id: OrderId)(implicit s: Session): Int = {
    Query(TicketDistributionLog.where(_.orderId === id).map(_.serial).max).first.getOrElse(0) + 1
  }
}


text:
try:
    from builtins import object
except ImportError:
    pass

from transitions.core import Enum
from transitions.extensions.markup import MarkupMachine, HierarchicalMarkupMachine, rep
from .utils import Stuff
from functools import partial

from unittest import TestCase, skipIf

try:
    from unittest.mock import MagicMock
except ImportError:
    from mock import MagicMock

try:
    import enum
except ImportError:
    enum = None

class SimpleModel(object):

    def after_func(self):
        pass

class TestRep(TestCase):

    def test_rep_string(self):
        self.assertEqual(rep("string"), "string")

    def test_rep_function(self):
        def check():
            return True
        self.assertTrue(check())
        self.assertEqual(rep(check, MarkupMachine.format_references), "check")

    def test_rep_partial_no_args_no_kwargs(self):
        def check():
            return True
        pcheck = partial(check)
        self.assertTrue(pcheck())
        self.assertEqual(rep(pcheck, MarkupMachine.format_references), "check()")

    def test_rep_partial_with_args(self):
        def check(result):
            return result
        pcheck = partial(check, True)
        self.assertTrue(pcheck())
        self.assertEqual(rep(pcheck, MarkupMachine.format_references), "check(True)")

    def test_rep_partial_with_kwargs(self):
        def check(result=True):
            return result
        pcheck = partial(check, result=True)
        self.assertTrue(pcheck())
        self.assertEqual(rep(pcheck, MarkupMachine.format_references), "check(result=True)")

    def test_rep_partial_with_args_and_kwargs(self):
        def check(result, doublecheck=True):
            return result == doublecheck
        pcheck = partial(check, True, doublecheck=True)
        self.assertTrue(pcheck())
        self.assertEqual(rep(pcheck, MarkupMachine.format_references), "check(True, doublecheck=True)")

    def test_rep_callable_class(self):
        class Check(object):
            def __init__(self, result):
                self.result = result

            def __call__(self):
                return self.result

            def __repr__(self):
                return "%s(%r)" % (type(self).__name__, self.result)

        ccheck = Check(True)
        self.assertTrue(ccheck())
        self.assertEqual(rep(ccheck, MarkupMachine.format_references), "Check(True)")

class TestMarkupMachine(TestCase):

    def setUp(self):
        self.machine_cls = MarkupMachine
        self.states = ['A', 'B', 'C', 'D']
        self.transitions = [
            {'trigger': 'walk', 'source': 'A', 'dest': 'B'},
            {'trigger': 'run', 'source': 'B', 'dest': 'C'},
            {'trigger': 'sprint', 'source': 'C', 'dest': 'D'}
        ]
        self.num_trans = len(self.transitions)
        self.num_auto = len(self.states) ** 2

    def test_markup_self(self):
        m1 = self.machine_cls(states=self.states, transitions=self.transitions, initial='A')
        m1.walk()
        m2 = self.machine_cls(markup=m1.markup)
        self.assertTrue(m1.state == m2.state or m1.state.name == m2.state)
        self.assertEqual(len(m1.models), len(m2.models))
        self.assertEqual(sorted(m1.states.keys()), sorted(m2.states.keys()))
        self.assertEqual(sorted(m1.events.keys()), sorted(m2.events.keys()))
        m2.run()
        m2.sprint()
        self.assertNotEqual(m1.state, m2.state)

    def test_markup_model(self):
        model1 = SimpleModel()
        m1 = self.machine_cls(model1, states=self.states, transitions=self.transitions, initial='A')
        model1.walk()
        m2 = self.machine_cls(markup=m1.markup)
        model2 = m2.models[0]
        self.assertIsInstance(model2, SimpleModel)
        self.assertEqual(len(m1.models), len(m2.models))
        self.assertTrue(model1.state == model2.state or model1.state.name == model2.state)
        self.assertEqual(sorted(m1.states.keys()), sorted(m2.states.keys()))
        self.assertEqual(sorted(m1.events.keys()), sorted(m2.events.keys()))

    def test_conditions_unless(self):
        s = Stuff(machine_cls=self.machine_cls)
        s.machine.add_transition('go', 'A', 'B', conditions='this_passes',
                                 unless=['this_fails', 'this_fails_by_default'])
        t = s.machine.markup['transitions']
        self.assertEqual(len(t), 1)
        self.assertEqual(t[0]['trigger'], 'go')
        self.assertEqual(len(t[0]['conditions']), 1)
        self.assertEqual(len(t[0]['unless']), 2)

    def test_auto_transitions(self):
        m1 = self.machine_cls(states=self.states, transitions=self.transitions, initial='A')
        m2 = self.machine_cls(states=self.states, transitions=self.transitions, initial='A',
                              auto_transitions_markup=True)

        self.assertEqual(len(m1.markup.get('transitions')), self.num_trans)
        self.assertEqual(len(m2.markup.get('transitions')), self.num_trans + self.num_auto)
        m1.add_transition('go', 'A', 'B')
        m2.add_transition('go', 'A', 'B')
        self.num_trans += 1
        self.assertEqual(len(m1.markup.get('transitions')), self.num_trans)
        self.assertEqual(len(m2.markup.get('transitions')), self.num_trans + self.num_auto)
        m1.auto_transitions_markup = True
        m2.auto_transitions_markup = False
        self.assertEqual(len(m1.markup.get('transitions')), self.num_trans + self.num_auto)
        self.assertEqual(len(m2.markup.get('transitions')), self.num_trans)

class TestMarkupHierarchicalMachine(TestMarkupMachine):

    def setUp(self):
        self.states = ['A', 'B', {'name': 'C',
                                  'children': ['1', '2', {'name': '3', 'children': ['a', 'b', 'c']}]}]

        self.transitions = [
            {'trigger': 'walk', 'source': 'A', 'dest': 'C_1'},
            {'trigger': 'run', 'source': 'C_1', 'dest': 'C_3_a'},
            {'trigger': 'sprint', 'source': 'C', 'dest': 'B'}
        ]

        # MarkupMachine cannot be imported via get_predefined as of now
        # We want to be able to run these tests without (py)graphviz
        self.machine_cls = HierarchicalMarkupMachine
        self.num_trans = len(self.transitions)
        self.num_auto = len(self.states) * 9

    def test_nested_definitions(self):
        states = [{'name': 'A'},
                  {'name': 'B'},
                  {'name': 'C',
                   'children': [
                       {'name': '1'},
                       {'name': '2'}],
                   'transitions': [
                       {'trigger': 'go',
                        'source': '1',
                        'dest': '2'}],
                   'initial': '2'}]
        machine = self.machine_cls(states=states, initial='A', auto_transitions=False, name='TestMachine')
        markup = {k: v for k, v in machine.markup.items() if v and k != 'models'}
        self.assertEqual(dict(initial='A', states=states, name='TestMachine'), markup)

@skipIf(enum is None, "enum is not available")
class TestMarkupMachineEnum(TestMarkupMachine):

    class States(Enum):
        A = 1
        B = 2
        C = 3
        D = 4

    def setUp(self):
        self.machine_cls = MarkupMachine
        self.states = TestMarkupMachineEnum.States
        self.transitions = [
            {'trigger': 'walk', 'source': self.states.A, 'dest': self.states.B},
            {'trigger': 'run', 'source': self.states.B, 'dest': self.states.C},
            {'trigger': 'sprint', 'source': self.states.C, 'dest': self.states.D}
        ]
        self.num_trans = len(self.transitions)
        self.num_auto = len(self.states)**2


text:
package com.alibaba.dubbo.remoting.exchange.codec;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;

import com.alibaba.dubbo.common.extension.ExtensionLoader;
import com.alibaba.dubbo.common.io.Bytes;
import com.alibaba.dubbo.common.io.StreamUtils;
import com.alibaba.dubbo.common.io.UnsafeByteArrayInputStream;
import com.alibaba.dubbo.common.io.UnsafeByteArrayOutputStream;
import com.alibaba.dubbo.common.logger.Logger;
import com.alibaba.dubbo.common.logger.LoggerFactory;
import com.alibaba.dubbo.common.serialize.ObjectInput;
import com.alibaba.dubbo.common.serialize.ObjectOutput;
import com.alibaba.dubbo.common.serialize.Serialization;
import com.alibaba.dubbo.common.utils.StringUtils;
import com.alibaba.dubbo.remoting.Channel;
import com.alibaba.dubbo.remoting.RemotingException;
import com.alibaba.dubbo.remoting.exchange.Request;
import com.alibaba.dubbo.remoting.exchange.Response;
import com.alibaba.dubbo.remoting.exchange.support.DefaultFuture;
import com.alibaba.dubbo.remoting.telnet.codec.TelnetCodec;

/**
 * ExchangeCodec.
 *
 * @author qianlei
 * @author william.liangf
 */
public class ExchangeCodec extends TelnetCodec {

    private static final Logger     logger             = LoggerFactory.getLogger(ExchangeCodec.class);

    // header length.
    protected static final int      HEADER_LENGTH      = 16;

    // magic header.
    protected static final short    MAGIC              = (short) 0xdabb;

    protected static final byte     MAGIC_HIGH         = Bytes.short2bytes(MAGIC)[0];

    protected static final byte     MAGIC_LOW          = Bytes.short2bytes(MAGIC)[1];

    // message flag.
    protected static final byte     FLAG_REQUEST       = (byte) 0x80;

    protected static final byte     FLAG_TWOWAY        = (byte) 0x40;

    protected static final byte     FLAG_EVENT     = (byte) 0x20;

    protected static final int      SERIALIZATION_MASK = 0x1f;

    private static Map<Byte, Serialization> ID_SERIALIZATION_MAP   = new HashMap<Byte, Serialization>();
    static {
        Set<String> supportedExtensions = ExtensionLoader.getExtensionLoader(Serialization.class).getSupportedExtensions();
        for (String name : supportedExtensions) {
            Serialization serialization = ExtensionLoader.getExtensionLoader(Serialization.class).getExtension(name);
            byte idByte = serialization.getContentTypeId();
            if (ID_SERIALIZATION_MAP.containsKey(idByte)) {
                logger.error("Serialization extension " + serialization.getClass().getName()
                             + " has duplicate id to Serialization extension "
                             + ID_SERIALIZATION_MAP.get(idByte).getClass().getName()
                             + ", ignore this Serialization extension");
                continue;
            }
            ID_SERIALIZATION_MAP.put(idByte, serialization);
        }
    }

    public Short getMagicCode() {
        return MAGIC;
    }

    public void encode(Channel channel, OutputStream os, Object msg) throws IOException {
        if (msg instanceof Request) {
            encodeRequest(channel, os, (Request) msg);
        } else if (msg instanceof Response) {
            encodeResponse(channel, os, (Response) msg);
        } else {
            super.encode(channel, os, msg);
        }
    }

    public Object decode(Channel channel, InputStream is) throws IOException {
        int readable = is.available();
        byte[] header = new byte[Math.min(readable, HEADER_LENGTH)];
        is.read(header);
        return decode(channel, is, readable, header);
    }

    protected Object decode(Channel channel, InputStream is, int readable, byte[] header) throws IOException {
        // check magic number.
        if (readable > 0 && header[0] != MAGIC_HIGH
                || readable > 1 && header[1] != MAGIC_LOW) {
            int length = header.length;
            if (header.length < readable) {
                header = Bytes.copyOf(header, readable);
                is.read(header, length, readable - length);
            }
            for (int i = 1; i < header.length - 1; i ++) {
                if (header[i] == MAGIC_HIGH && header[i + 1] == MAGIC_LOW) {
                    UnsafeByteArrayInputStream bis = ((UnsafeByteArrayInputStream) is);
                    bis.position(bis.position() - header.length + i);
                    header = Bytes.copyOf(header, i);
                    break;
                }
            }
            return super.decode(channel, is, readable, header);
        }
        // check length.
        if (readable < HEADER_LENGTH) {
            return NEED_MORE_INPUT;
        }

        // get data length.
        int len = Bytes.bytes2int(header, 12);
        checkPayload(channel, len);

        int tt = len + HEADER_LENGTH;
        if( readable < tt ) {
            return NEED_MORE_INPUT;
        }

        // limit input stream.
        if( readable != tt )
            is = StreamUtils.limitedInputStream(is, len);

        byte flag = header[2], proto = (byte)( flag & SERIALIZATION_MASK );
        Serialization s = getSerializationById(proto);
        if (s == null) {
            s = getSerialization(channel);
        }
        ObjectInput in = s.deserialize(channel.getUrl(), is);
        // get request id.
        long id = Bytes.bytes2long(header, 4);
        if( ( flag & FLAG_REQUEST ) == 0 ) {
            // decode response.
            Response res = new Response(id);
            if (( flag & FLAG_EVENT ) != 0){
                res.setEvent(Response.HEARTBEAT_EVENT);
            }
            // get status.
            byte status = header[3];
            res.setStatus(status);
            if( status == Response.OK ) {
                try {
                    Object data;
                    if (res.isHeartbeat()) {
                        data = decodeHeartbeatData(channel, in);
                    } else if (res.isEvent()) {
                        data = decodeEventData(channel, in);
                    } else {
                        data = decodeResponseData(channel, in, getRequestData(id));
                    }
                    res.setResult(data);
                } catch (Throwable t) {
                    res.setStatus(Response.CLIENT_ERROR);
                    res.setErrorMessage(StringUtils.toString(t));
                }
            } else {
                res.setErrorMessage(in.readUTF());
            }
            return res;
        } else {
            // decode request.
            Request req = new Request(id);
            req.setVersion("2.0.0");
            req.setTwoWay( ( flag & FLAG_TWOWAY ) != 0 );
            if (( flag & FLAG_EVENT ) != 0 ){
                req.setEvent(Request.HEARTBEAT_EVENT);
            }
            try {
                Object data;
                if (req.isHeartbeat()) {
                    data = decodeHeartbeatData(channel, in);
                } else if (req.isEvent()) {
                    data = decodeEventData(channel, in);
                } else {
                    data = decodeRequestData(channel, in);
                }
                req.setData(data);
            } catch (Throwable t) {
                // bad request
                req.setBroken(true);
                req.setData(t);
            }
            return req;
        }
    }

    protected Object getRequestData(long id) {
        DefaultFuture future = DefaultFuture.getFuture(id);
        if (future == null)
            return null;
        Request req = future.getRequest();
        if (req == null)
            return null;
        return req.getData();
    }

    protected void encodeRequest(Channel channel, OutputStream os, Request req) throws IOException {
        Serialization serialization = getSerialization(channel);
        // header.
        byte[] header = new byte[HEADER_LENGTH];
        // set magic number.
        Bytes.short2bytes(MAGIC, header);

        // set request and serialization flag.
        header[2] = (byte) (FLAG_REQUEST | serialization.getContentTypeId());

        if (req.isTwoWay()) header[2] |= FLAG_TWOWAY;
        if (req.isEvent()) header[2] |= FLAG_EVENT;

        // set request id.
        Bytes.long2bytes(req.getId(), header, 4);

        // encode request data.
        UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream(1024);
        ObjectOutput out = serialization.serialize(channel.getUrl(), bos);
        if (req.isEvent()) {
            encodeEventData(channel, out, req.getData());
        } else {
            encodeRequestData(channel, out, req.getData());
        }
        out.flushBuffer();
        bos.flush();
        bos.close();
        byte[] data = bos.toByteArray();
        Bytes.int2bytes(data.length, header, 12);

        // write
        os.write(header); // write header.
        os.write(data); // write data.
    }

    protected void encodeResponse(Channel channel, OutputStream os, Response res) throws IOException {
        try {
            Serialization serialization = getSerialization(channel);
            // header.
            byte[] header = new byte[HEADER_LENGTH];
            // set magic number.
            Bytes.short2bytes(MAGIC, header);
            // set request and serialization flag.
            header[2] = serialization.getContentTypeId();
            if (res.isHeartbeat()) header[2] |= FLAG_EVENT;
            // set response status.
            byte status = res.getStatus();
            header[3] = status;
            // set request id.
            Bytes.long2bytes(res.getId(), header, 4);

            UnsafeByteArrayOutputStream bos = new UnsafeByteArrayOutputStream(1024);
            ObjectOutput out = serialization.serialize(channel.getUrl(), bos);
            // encode response data or error message.
            if (status == Response.OK) {
                if (res.isHeartbeat()) {
                    encodeHeartbeatData(channel, out, res.getResult());
                } else {
                    encodeResponseData(channel, out, res.getResult());
                }
            }
            else out.writeUTF(res.getErrorMessage());
            out.flushBuffer();
            bos.flush();
            bos.close();

            byte[] data = bos.toByteArray();
            Bytes.int2bytes(data.length, header, 12);
            // write
            os.write(header); // write header.
            os.write(data); // write data.
        } catch (Throwable t) {
            // 发送失败信息给Consumer,否则Consumer只能等超时了
            if (! res.isEvent() && res.getStatus() != Response.BAD_RESPONSE) {
                try {
                    // FIXME 在Codec中打印出错日志?在IoHanndler的caught中统一处理?
                    logger.warn("Fail to encode response: " + res + ", send bad_response info instead, cause: " + t.getMessage(), t);

                    Response r = new Response(res.getId(), res.getVersion());
                    r.setStatus(Response.BAD_RESPONSE);
                    r.setErrorMessage("Failed to send response: " + res + ", cause: " + StringUtils.toString(t));
                    channel.send(r);

                    return;
                } catch (RemotingException e) {
                    logger.warn("Failed to send bad_response info back: " + res + ", cause: " + e.getMessage(), e);
                }
            }

            // 重新抛出收到的异常
            if (t instanceof IOException) {
                throw (IOException) t;
            } else if (t instanceof RuntimeException) {
                throw (RuntimeException) t;
            } else if (t instanceof Error) {
                throw (Error) t;
            } else  {
                throw new RuntimeException(t.getMessage(), t);
            }
        }
    }

    private static final Serialization getSerializationById(Byte id) {
        return ID_SERIALIZATION_MAP.get(id);
    }

    @Override
    protected Object decodeData(ObjectInput in) throws IOException {
        return decodeRequestData(in);
    }

    @Deprecated
    protected Object decodeHeartbeatData(ObjectInput in) throws IOException {
        try {
            return in.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(StringUtils.toString("Read object failed.", e));
        }
    }

    protected Object decodeRequestData(ObjectInput in) throws IOException {
        try {
            return in.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(StringUtils.toString("Read object failed.", e));
        }
    }

    protected Object decodeResponseData(ObjectInput in) throws IOException {
        try {
            return in.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(StringUtils.toString("Read object failed.", e));
        }
    }

    @Override
    protected void encodeData(ObjectOutput out, Object data) throws IOException {
        encodeRequestData(out, data);
    }

    private void encodeEventData(ObjectOutput out, Object data) throws IOException {
        out.writeObject(data);
    }

    @Deprecated
    protected void encodeHeartbeatData(ObjectOutput out, Object data) throws IOException {
        encodeEventData(out, data);
    }

    protected void encodeRequestData(ObjectOutput out, Object data) throws IOException {
        out.writeObject(data);
    }

    protected void encodeResponseData(ObjectOutput out, Object data) throws IOException {
        out.writeObject(data);
    }

    @Override
    protected Object decodeData(Channel channel, ObjectInput in) throws IOException {
        return decodeRequestData(channel ,in);
    }

    private Object decodeEventData(Channel channel, ObjectInput in) throws IOException {
        try {
            return in.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(StringUtils.toString("Read object failed.", e));
        }
    }

    @Deprecated
    protected Object decodeHeartbeatData(Channel channel, ObjectInput in) throws IOException {
        try {
            return in.readObject();
        } catch (ClassNotFoundException e) {
            throw new IOException(StringUtils.toString("Read object failed.", e));
        }
    }

    protected Object decodeRequestData(Channel channel, ObjectInput in) throws IOException {
        return decodeRequestData(in);
    }

    protected Object decodeResponseData(Channel channel, ObjectInput in) throws IOException {
        return decodeResponseData(in);
    }

    protected Object decodeResponseData(Channel channel, ObjectInput in, Object requestData) throws IOException {
        return decodeResponseData(channel, in);
    }

    @Override
    protected void encodeData(Channel channel, ObjectOutput out, Object data) throws IOException {
        encodeRequestData(channel, out, data);
    }

    private void encodeEventData(Channel channel, ObjectOutput out, Object data) throws IOException {
        encodeEventData(out, data);
    }
    @Deprecated
    protected void encodeHeartbeatData(Channel channel, ObjectOutput out, Object data) throws IOException {
        encodeHeartbeatData(out, data);
    }

    protected void encodeRequestData(Channel channel, ObjectOutput out, Object data) throws IOException {
        encodeRequestData(out, data);
    }

    protected void encodeResponseData(Channel channel, ObjectOutput out, Object data) throws IOException {
        encodeResponseData(out, data);
    }

}


text:
	var kw = ('abstract boolean break byte case catch char class const continue debugger default delete do double'+
	' else enum export extends false final finally float for function goto var void volatile while with'+
	' if implements import in instanceof int interface long native new null package private protected public'+
	' return short static super switch synchronized this throw throws transient true try typeof').split(' ');
	var j = kw.length, jskw = {};
	while(j--){
		jskw[kw[j]] = true;
	}
	kw = null;

	var undef, reg_rep = /[\n\t\r\"\\]/g,
		rep = {'\r':'\\r', '\n':'\\n', '\t':'\\t', '"':'\\"', '\\':'\\\\'};
	/*--
		将提取出的注释数据字符串化。
		因为数据的值类型只有字符串或数组,或其他一些基本类型,所以字符串化起来比较简单。
	*/
	function stringify(data){
		switch(typeof data){
			case 'string':
				return '"'+ data.replace(reg_rep, function(a){
					return rep[a];
				}) +'"';

			case 'object':
				if(data===null){return 'null'}
				var res = [], k, v;
				if(data instanceof Array){
					var l = data.length;
					for(k = 0; k < l; k++){
						v = stringify(data[k]);
						v===undef || res.push(v);
					}
					return '['+ res.join(',') +']';
				}else{
					for(k in data){
						if(data.hasOwnProperty(k) && k){
							v = stringify(data[k]);
							jskw[k] && (k = '"'+k+'"');
							v===undef || res.push(k +':'+ v);
						}
					}
					return '{'+ res.join(',') +'}';
				}

			case 'number':
				return isFinite(data) ? data.toString() : 'null';

			case 'undefined':
			case 'unknown':
				return;
			case 'function':
			case 'boolean':
			case 'regexp':
				return data.toString();
		}
	}

	module.exports = stringify;


text:
// Config file for running Rollup in "watch" mode
// This adds a sanity check to help ourselves to run 'rollup -w' as needed.

// Needed to create files loadable by IE8
import rollupGitVersion from 'rollup-plugin-git-version'

import gitRev from 'git-rev-sync'

const branch = gitRev.branch();
const rev = gitRev.short();

const version = require('../package.json').version + '+' + branch + '.' + rev;

const banner = `
/*
 * Leaflet ${version}, a JS library for interactive maps. http://leafletjs.com
 * (c) 2010-2016 Vladimir Agafonkin, (c) 2010-2011 CloudMade
 */

`;

export default {
	format: 'umd',
	name: 'L',
	banner,
	entry: 'src/Leaflet.js',
	dest: 'dist/leaflet-src.js',
	plugins: [
		rollupGitVersion()
	],
	sourceMap: true,
	legacy: true // Needed to create files loadable by IE8
};


text:
package com.cosmos.utils.database;

public abstract class CommonDBPager {

	public abstract String getPageRecordSql(String sql,int pageNumber,int pageSize);

	public String getRecoreCountSql(String sql) {
		StringBuilder result = new StringBuilder(sql.toUpperCase());
		int length = result.length();
		int index = 0;
		while(index < length){
			char ch = result.charAt(index);
			if(ch == '('){
				index = result.indexOf(")", index) + 1;
				continue;
			} else if(ch == ' '){
				if(index + 6 < length){
					String substring = result.substring(index + 1, index + 5);
					if(substring.equals("FROM ") || substring.equals("FROM(")){
						result.delete(0, index+1);
						break;
					}
				} else {
					break;
				}
			} else if(ch == 'F'){
				if(index + 5 < length){
					String substring = result.substring(index, index + 5);
					if(substring.equals("FROM ") || substring.equals("FROM(")){
						result.delete(0, index);
						break;
					}
				} else {
					break;
				}
			}
			index++;
		}
		result.insert(0, "SELECT COUNT(*) ");
		return result.toString();
	}
}


text:
#!python3
# -*- coding:utf-8 -*-
import os
import sys
import time
import ctypes
import shutil
import subprocess
IsPy3 = sys.version_info[0] >= 3
if IsPy3:
    import winreg
else:
    import codecs
    import _winreg as winreg

BuildType = 'Release'
IsRebuild = True
Build = 'Rebuild'
Update = False
Copy = False
CleanAll = False
BuildTimeout = 30*60
Bit = 'Win32'
Dlllib = 'dll'
MSBuild = None
IncrediBuild = None
UseMSBuild = True #默认用MSBuild编译,如果为False则用IncrediBuild编译

#不同项目只需修改下面5个变量
SlnFile = '../BigNumber.sln' #相对于本py脚本路径的相对路径
UpdateDir = [] #相对于本py脚本路径的相对路径,填空不更新
ExecBatList = [] #相对于本py脚本路径的相对路径,编译前调用的脚本,可填空,执行bat会先cd到bat目录再执行
MSBuildFirstProjects = [r'BigNumber'] #使用MSBuild需要工程文件在解决方案sln中的路径
     # MSBuild首先编译的项目,填空不指定顺序
IncrediBuildFirstProjects = ['BigNumber'] #使用IncrediBuild只需工程名字
     #IncrediBuild首先编译的项目,填空不指定顺序

class ConsoleColor():
    '''This class defines the values of color for printing on console window'''
    Black = 0
    DarkBlue = 1
    DarkGreen = 2
    DarkCyan = 3
    DarkRed = 4
    DarkMagenta = 5
    DarkYellow = 6
    Gray = 7
    DarkGray = 8
    Blue = 9
    Green = 10
    Cyan = 11
    Red = 12
    Magenta = 13
    Yellow = 14
    White = 15

class Coord(ctypes.Structure):
    _fields_ = [('X', ctypes.c_short), ('Y', ctypes.c_short)]

class SmallRect(ctypes.Structure):
    _fields_ = [('Left', ctypes.c_short),
               ('Top', ctypes.c_short),
               ('Right', ctypes.c_short),
               ('Bottom', ctypes.c_short),
              ]

class ConsoleScreenBufferInfo(ctypes.Structure):
    _fields_ = [('dwSize', Coord),
               ('dwCursorPosition', Coord),
               ('wAttributes', ctypes.c_uint),
               ('srWindow', SmallRect),
               ('dwMaximumWindowSize', Coord),
              ]

class Win32API():
    '''Some native methods for python calling'''
    StdOutputHandle = -11
    ConsoleOutputHandle = None
    DefaultColor = None

    @staticmethod
    def SetConsoleColor(color):
        '''Change the text color on console window'''
        if not Win32API.DefaultColor:
            if not Win32API.ConsoleOutputHandle:
                Win32API.ConsoleOutputHandle = ctypes.windll.kernel32.GetStdHandle(Win32API.StdOutputHandle)
            bufferInfo = ConsoleScreenBufferInfo()
            ctypes.windll.kernel32.GetConsoleScreenBufferInfo(Win32API.ConsoleOutputHandle, ctypes.byref(bufferInfo))
            Win32API.DefaultColor = int(bufferInfo.wAttributes & 0xFF)
        if IsPy3:
            sys.stdout.flush() # need flush stdout in python 3
        ctypes.windll.kernel32.SetConsoleTextAttribute(Win32API.ConsoleOutputHandle, color)

    @staticmethod
    def ResetConsoleColor():
        '''Reset the default text color on console window'''
        if IsPy3:
            sys.stdout.flush() # need flush stdout in python 3
        ctypes.windll.kernel32.SetConsoleTextAttribute(Win32API.ConsoleOutputHandle, Win32API.DefaultColor)

class Logger():
    LogFile = '@AutomationLog.txt'
    LineSep = '\n'
    @staticmethod
    def Write(log, consoleColor = -1, writeToFile = True, printToStdout = True):
        '''
        consoleColor: value in class ConsoleColor, such as ConsoleColor.DarkGreen
        if consoleColor == -1, use default color
        '''
        if printToStdout:
            isValidColor = (consoleColor >= ConsoleColor.Black and consoleColor <= ConsoleColor.White)
            if isValidColor:
                Win32API.SetConsoleColor(consoleColor)
            try:
                sys.stdout.write(log)
            except UnicodeError as e:
                Win32API.SetConsoleColor(ConsoleColor.Red)
                isValidColor = True
                sys.stdout.write(str(type(e)) + ' can\'t print the log!\n')
            if isValidColor:
                Win32API.ResetConsoleColor()
        if not writeToFile:
            return
        if IsPy3:
            logFile = open(Logger.LogFile, 'a+', encoding = 'utf-8')
        else:
            logFile = codecs.open(Logger.LogFile, 'a+', 'utf-8')
        try:
            logFile.write(log)
            # logFile.flush() # need flush in python 3, otherwise log won't be saved
        except Exception as ex:
            logFile.close()
            sys.stdout.write('can not write log with exception: {0} {1}'.format(type(ex), ex))

    @staticmethod
    def WriteLine(log, consoleColor = -1, writeToFile = True, printToStdout = True):
        '''
        consoleColor: value in class ConsoleColor, such as ConsoleColor.DarkGreen
        if consoleColor == -1, use default color
        '''
        Logger.Write(log + Logger.LineSep, consoleColor, writeToFile, printToStdout)

    @staticmethod
    def Log(log, consoleColor = -1, writeToFile = True, printToStdout = True):
        '''
        consoleColor: value in class ConsoleColor, such as ConsoleColor.DarkGreen
        if consoleColor == -1, use default color
        '''
        t = time.localtime()
        log = '{0}-{1:02}-{2:02} {3:02}:{4:02}:{5:02} - {6}{7}'.format(t.tm_year, t.tm_mon, t.tm_mday,
            t.tm_hour, t.tm_min, t.tm_sec, log, Logger.LineSep)
        Logger.Write(log, consoleColor, writeToFile, printToStdout)

    @staticmethod
    def DeleteLog():
        if os.path.exists(Logger.LogFile):
            os.remove(Logger.LogFile)

def GetMSBuildPath():
    if Bit == 'Win32':
        cmd = 'call "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat" x86\nwhere msbuild'
    elif Bit == 'x64':
        cmd = 'call "%VS120COMNTOOLS%..\\..\\VC\\vcvarsall.bat" amd64\nwhere msbuild'
    ftemp = open('GetMSBuildPath.bat', 'wt')
    ftemp.write(cmd)
    ftemp.close()
    p = subprocess.Popen('GetMSBuildPath.bat', stdout = subprocess.PIPE)
    p.wait()
    lines = p.stdout.read().decode().splitlines()
    os.remove('GetMSBuildPath.bat')
    for line in lines:
        if 'MSBuild.exe' in line:
            return line

def GetIncrediBuildPath():
    try:
        key=winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r'SOFTWARE\Classes\IncrediBuild.MonitorFile\shell\open\command')
        value, typeId = winreg.QueryValueEx(key, '')
        if value:
            start = value.find('"')
            end = value.find('"', start + 1)
            path = value[start+1:end]
            buildConsole = os.path.join(os.path.dirname(path), 'BuildConsole.exe')
            return buildConsole
    except FileNotFoundError as e:
        Logger.WriteLine('can not find IncrediBuild', ConsoleColor.Red)

def UpdateCode():
    # put git to path first
    if not shutil.which('git.exe'):
        Logger.Log('找不到git.exe. 请确认安装git时将git\bin目录路径加入到环境变量path中!!!\n, 跳过更新代码!!!', ConsoleColor.Yellow)
        return false
    oldDir = os.getcwd()
    for dir in UpdateDir:
        os.chdir(dir)
        ret = os.system('git pull')
        os.chdir(oldDir)
        if ret != 0:
            Logger.Log('update {0} failed'.format(dir), ConsoleColor.Yellow)
            return false
    return True

def BuildProject(cmd):
    for i in range(6):
        Logger.WriteLine(cmd, ConsoleColor.Cyan)
        buildFailed = True
        startTime = time.time()
        p = subprocess.Popen(cmd) #IncrediBuild不能使用stdout=subprocess.PIPE,否则会导致p.wait()不返回,可能是IncrediBuild的bug
        if IsPy3:
            try:
                buildFailed = p.wait(BuildTimeout)
            except subprocess.TimeoutExpired as e:
                Logger.Log('{0}'.format(e), ConsoleColor.Yellow)
                p.kill()
        else:
            buildFailed = p.wait()
        if not UseMSBuild:
            #IncrediBuild的返回值不能说明编译是否成功,需要提取输出判断
            fin = open('IncrediBuild.log')
            for line in fin:
                if line.startswith('=========='):
                    Logger.Write(line, ConsoleColor.Cyan, writeToFile = True if IsPy3 else False)
                    if IsPy3:
                        start = line.find('失败') + 3  #========== 生成: 成功 1 个,失败 0 个,最新 0 个,跳过 0 个 ==========
                    else:#为了兼容py2做的特殊处理,很恶心
                        start = 0
                        n2 = 0
                        while 1:
                            if line[start].isdigit():
                                n2 += 1
                                if n2 == 2:
                                    break
                                start = line.find(' ', start)
                            start += 1
                    end = line.find(' ', start)
                    failCount = int(line[start:end])
                    buildFailed = failCount > 0
                else:
                    Logger.Write(line, ConsoleColor.Red, writeToFile = True if IsPy3 else False, printToStdout = True if ' error ' in line else False)
            fin.close()
        costTime = time.time() - startTime
        Logger.WriteLine('build cost time: {0:.1f}s\n'.format(costTime), ConsoleColor.Green)
        if not buildFailed:
            return True
    return False

def BuildAllProjects():
    buildSuccess = False
    cmds = []
    if UseMSBuild:
        if IsRebuild:
            if CleanAll:
                cmds.append('{0} {1} /t:Clean /p:Configuration={2} /nologo /maxcpucount /filelogger /consoleloggerparameters:ErrorsOnly'.format(MSBuild, SlnFile, 'Debug'))
                cmds.append('{0} {1} /t:Clean /p:Configuration={2} /nologo /maxcpucount /filelogger /consoleloggerparameters:ErrorsOnly'.format(MSBuild, SlnFile, 'Release'))
            else:
                cmds.append('{0} {1} /t:Clean /p:Configuration={2} /nologo /maxcpucount /filelogger /consoleloggerparameters:ErrorsOnly'.format(MSBuild, SlnFile, BuildType))
        for project in MSBuildFirstProjects:
            cmds.append('{0} {1} /t:{2} /p:Configuration={3};platform={4} /nologo /maxcpucount /filelogger /consoleloggerparameters:ErrorsOnly'.format(MSBuild, SlnFile,  project, BuildType, Bit))
        cmds.append('{0} {1} /p:Configuration={2};platform={3} /nologo /maxcpucount /filelogger /consoleloggerparameters:ErrorsOnly'.format(MSBuild, SlnFile, BuildType, Bit))
    else: #IncrediBuild
        if IsRebuild:
            if CleanAll:
                cmds.append('"{0}" {1} /clean /cfg="{2}|{3}" /nologo /out=IncrediBuild.log'.format(IncrediBuild, SlnFile, 'Debug', Bit))
                cmds.append('"{0}" {1} /clean /cfg="{2}|{3}" /nologo /out=IncrediBuild.log'.format(IncrediBuild, SlnFile, 'Release', Bit))
            else:
                cmds.append('"{0}" {1} /clean /cfg="{2}|{3}" /nologo /out=IncrediBuild.log'.format(IncrediBuild, SlnFile, BuildType, Bit))
        for project in IncrediBuildFirstProjects:
            cmds.append('"{0}" {1} /build /prj={2} /cfg="{3}|{4}" /nologo /out=IncrediBuild.log'.format(IncrediBuild, SlnFile, project, BuildType, Bit))
        cmds.append('"{0}" {1} /build /cfg="{2}|{3}" /nologo /out=IncrediBuild.log'.format(IncrediBuild, SlnFile, BuildType, Bit))
    for cmd in cmds:
        buildSuccess = BuildProject(cmd)
        if not buildSuccess:
            break
    return buildSuccess

def main():
    if UseMSBuild:
        if not os.path.exists(MSBuild):
            Logger.Log('can not find msbuild.exe', ConsoleColor.Red)
            return 1
    else:
        if not os.path.exists(IncrediBuild):
            Logger.Log('can not find msbuild.exe', ConsoleColor.Red)
            return 1
    dir = os.path.dirname(__file__)
    if dir:
        oldDir = os.getcwd()
        os.chdir(dir)
    if Update:
        if not UpdateCode():
            return 1
        Logger.Log('git update succeed', ConsoleColor.Green)
    if Copy:
        for bat in ExecBatList:
            oldBatDir = os.getcwd()
            batDir = os.path.dirname(bat)
            batName = os.path.basename(bat)
            if batDir:
                os.chdir(batDir)
            start = time.clock()
            os.system(batName)
            Logger.Log('run "{}" cost {:.1f} seconds'.format(batName, time.clock() - start), ConsoleColor.Green)
            if batDir:
                os.chdir(oldBatDir)
    buildSuccess = BuildAllProjects()
    if buildSuccess:
        Logger.Log('build succeed', ConsoleColor.Green)
    else:
        Logger.Log('build failed', ConsoleColor.Red)
    if dir:
        os.chdir(oldDir)
    return 0 if buildSuccess else 1

if __name__ == '__main__':
    Logger.Log('run with argv ' + str(sys.argv), ConsoleColor.Green)
    sys.argv = [x.lower() for x in sys.argv]
    start_time = time.time()
    if 'debug' in sys.argv:
        BuildType = 'Debug'
    if 'lib' in sys.argv:
        Dlllib = 'lib'
        SlnFile = '../BigNumber_lib.sln'
        MSBuildFirstProjects = [r'BigNumber_lib']
        IncrediBuildFirstProjects = ['BigNumber_lib']
    if '64' in sys.argv:
        Bit = 'x64'
    if 'build' in sys.argv:
        IsRebuild = False
        Build = 'Build'
    if 'update' in sys.argv:
        Update = True
    if 'copy' in sys.argv:
        Copy = True
    if 'clean' in sys.argv:
        CleanAll = True
    if 'incredibuild' in sys.argv:
        UseMSBuild = False
    if UseMSBuild:
        MSBuild = GetMSBuildPath()
        if not MSBuild:
            Logger.Log('can not find MSBuild.exe', ConsoleColor.Red)
            exit(1)
    else:
        IncrediBuild = GetIncrediBuildPath()
        if not IncrediBuild:
            Logger.Log('can not find BuildConsole.exe', ConsoleColor.Red)
            exit(1)
    cwd = os.getcwd()
    Logger.WriteLine('current dir is: {0}, {1}: {2}'.format(cwd, Build, BuildType))
    ret = main()
    end_time = time.time()
    cost_time = end_time-start_time
    Logger.WriteLine('all build cost time: {0:.2f} seconds'.format(cost_time), ConsoleColor.Green)
    exit(ret)


text:
layout: page
title: Contributing
permalink: /contributing/
---

* toc
{:toc}

## Getting started with the Kythe codebase

[Instructions to build Kythe from source]({{site.baseuri}}/getting-started)

## Code review

All changes to Kythe must go through code review before being submitted, and
each individual or corporate contributor must sign an appropriate [Contributor
License Agreement](https://cla.developers.google.com/about).  Once your CLA is
submitted (or if you already submitted one for another Google project), make a
commit adding yourself to the
[AUTHORS]({{site.data.development.source_browser}}/AUTHORS) and
[CONTRIBUTORS]({{site.data.development.source_browser}}/CONTRIBUTORS)
files. This commit can be part of your first Differential code review.

The Kythe team has chosen to use a [Phabricator](http://phabricator.org/)
instance located at
[{{site.url}}/phabricator]({{site.url}}{{site.data.development.phabricator}})
for code reviews.  This requires some local setup for each developer:

### Installing arcanist

{% highlight bash %}
ARC_PATH=~/apps/arc # path to install arcanist/libphutil

sudo apt-get install php5 php5-curl
mkdir -p "$ARC_PATH"
pushd "$ARC_PATH"
git clone https://github.com/phacility/libphutil.git
git clone https://github.com/phacility/arcanist.git
popd

# add arc to your PATH
echo "export PATH=\"${ARC_PATH}/arcanist/bin:\$PATH\"" >> ~/.bashrc
source ~/.bashrc

arc install-certificate # in Kythe repository root
{% endhighlight %}

### Using arcanist

{% highlight bash %}
git checkout master
arc feature feature-name # OR git checkout -b feature-name
# do some changes
git add ...                    # add the changes
git commit -m "Commit message" # commit the changes
arc diff --browse              # send the commit for review
# go through code review in Phabricator UI...
# get change accepted

arc land                       # merge the change into master
{% endhighlight %}

For core contributors with write access to the Kythe repository, `arc land` will
merge the change into master and push it to Github.  Others should request that
someone else land their change for them once the change has been reviewed and
accepted.

{% highlight bash %}
# Land a reviewed change
arc patch D1234
arc land
{% endhighlight %}

## Contribution Ideas

Along with working off of our [tasks
list]({{site.data.development.phabricator}}/maniphest) (and, in particular, the
[Wishlist]({{site.data.development.phabricator}}/maniphest/query/uFWarCNL9v7z/)),
there are many ways to contribute to Kythe.

### New Extractors and Indexers

Kythe is built on the idea of having a common set of tools across programming
languages so Kythe is always happy to
[add another language to its family]({{site.baseurl}}/docs/kythe-compatible-compilers.html).

### Build System Integration

In order to use Kythe's compilation extractors, they must be given precise
information about how a compilation is processed.  Currently, Kythe has
[built-in support]({{site.data.development.source_browser}}/kythe/extractors/bazel/extract.sh)
for Bazel and rudimentary support for
[CMake]({{site.data.development.source_browser}}/kythe/extractors/cmake/).
Contributing support for more build systems like [Gradle](https://gradle.org)
will greatly help the ease of use for Kythe and increase the breadth of what it
can index.

### User Interfaces

Kythe emits a lot of data and there are *many* ways to interpret/display it all.
Kythe has provided a
[sample UI]({{site.baseuri}}/examples#visualizing-cross-references), but it
currently only scratches the surface of Kythe's data.  Other ideas for
visualizers include an interactive graph, a documentation browser and a source file
hierarchical overview.


text:
from common.helpers import default_compare

def sort(array, compare=default_compare):
  pos = 1
  while pos < len(array):
    if compare(array[pos], array[pos - 1]) >= 0:
      pos += 1
    else:
      array[pos], array[pos - 1] = array[pos - 1], array[pos]
      if pos > 1:
        pos -= 1
  return array


text:
Mongoid::Fields.option :metadata do |model, field, value|
  value
end


text:
package net.antify.security.provider;

import java.security.Provider;
import java.security.Security;

import org.apache.tools.ant.AntClassLoader;
import org.apache.tools.ant.BuildException;
import org.apache.tools.ant.Project;
import org.apache.tools.ant.taskdefs.Classloader;

/**
 *
Used to dynamically add a {@link #Provider} to the next position
 * available of {@link Security} providers. This task is inheriting
 * the (experimental) {@link Classloader} task: it will load necessary
 * libraries prior to add the provider.
 *

 *
Addition are not permanent,
 * it is only effective for the time Ant is running. To statically install
 * a provider, you must modify the java.security file.
 * Refer to Sun documentation: http://java.sun.com/javase/technologies/security/
 *

 * @author ninth.nails
 * @see Java Cryptography Architecture API Specification & Reference
 */
public class AddProviderTask extends Classloader {
	/**
	 * The class loader name.
	 */
	private String loaderName;

	/**
	 * Fully qualified class name of the provider.
	 */
	private String provider;

	@SuppressWarnings("unchecked")
	@Override
	public void execute() throws BuildException {
		// Executing parent class loader task
		super.execute();

		if (provider == null) {
			throw new BuildException("Specify the provider");
		}

		log("Adding provider "+provider, Project.MSG_INFO);

		// Check if the provider is already installed
		Provider[] providers = Security.getProviders();

		// This attribute is automatically placed in each Provider
		String key = "Provider.id className";

		for (int i = 0; i < providers.length; i++) {
			Provider pro = providers[i];

			if (provider.equals(pro.getProperty(key))) {
				log("Provider "+provider+" is already installed", Project.MSG_INFO);

				// No need to add the provider
				return;
			}
		}

		// Get either the core class loader name or the one specified
		String name = (loaderName == null) ? SYSTEM_LOADER_REF : loaderName;

		// Retrieve the class loader
		AntClassLoader acl = (AntClassLoader) getProject().getReference(name);

		// Look up the provider class
		Class clazz;
		try {
			clazz = acl.findClass(provider);
		} catch (ClassNotFoundException e) {
			throw new BuildException(e);
		}

		if (clazz != null) {
			Provider p;
			// Create new provider instance
			try {
				// According to Sun documentation, Provider implementors need to
				// ensure there is a public constructor without any arguments.
				// http://java.sun.com/j2se/1.5.0/docs/guide/security/HowToImplAProvider.html#Step 1
				p = (Provider) clazz.newInstance();
			} catch (Exception e) {
				throw new BuildException("Unable to instantiate provider "+clazz.toString(), e);
			}

			if (p != null) {
				// Adding the provider to the list
				try {
					Security.addProvider(p);

					log("Provider added.", Project.MSG_INFO);
				} catch (Exception e) {
					throw new BuildException(e);
				}
			} else {
				throw new BuildException("Provider "+provider+" has not been added.");
			}
		} else {
			new ClassNotFoundException(provider);
		}
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void setName(String name) {
		super.setName(name);
		this.loaderName = name;
	}

	/**
	 * Name of the provider. Fully qualified class name.
	 * @param provider
	 */
	public void setProvider(String provider) {
		this.provider = provider;
	}
}


text:
from tests.baseSsaTest import BaseSsaTC
from tests.bitOpt.bitWidthReductionCmp import BitWidthReductionCmp2Values, \
    BitWidthReductionCmpReducibleEq, BitWidthReductionCmpReducibleNe, \
    BitWidthReductionCmpReducibleLt, BitWidthReductionCmpReducibleLe, \
    BitWidthReductionCmpReducibleGt, BitWidthReductionCmpReducibleGe

class BitWidthReductionCmp_example_TC(BaseSsaTC):
    __FILE__ = __file__

    def test_BitWidthReductionCmpReducibleEq_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleEq)

    def test_BitWidthReductionCmpReducibleNe_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleNe)

    def test_BitWidthReductionCmpReducibleLt_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleLt)

    def test_BitWidthReductionCmpReducibleLe_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleLe)

    def test_BitWidthReductionCmpReducibleGt_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleGt)

    def test_BitWidthReductionCmpReducibleGe_ll(self):
        self._test_ll(BitWidthReductionCmpReducibleGe)

    def test_BitWidthReductionCmp2Values_ll(self):
        self._test_ll(BitWidthReductionCmp2Values)

if __name__ == "__main__":
    import unittest
    suite = unittest.TestSuite()
    # suite.addTest(BitWidthReductionCmp_example_TC('test_BitWidthReductionCmpReducible_ll'))
    suite.addTest(unittest.makeSuite(BitWidthReductionCmp_example_TC))
    runner = unittest.TextTestRunner(verbosity=3)
    runner.run(suite)


text:
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND noninteractive

ADD https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh /tmp/miniconda.sh
ADD https://bitbucket.org/MDukhan/yeppp/downloads/yeppp-1.0.0.tar.bz2 /tmp/yeppp-1.0.0.tar.bz2
ADD https://raw.githubusercontent.com/dceoy/print-github-tags/master/print-github-tags /usr/local/bin/print-github-tags

RUN set -e \
      && ln -sf bash /bin/sh

RUN set -e \
      && apt-get -y update \
      && apt-get -y dist-upgrade \
      && apt-get -y install --no-install-recommends --no-install-suggests \
        autoconf automake ca-certificates cmake curl g++ gcc git libbz2-dev \
        libc6-dev libcurl4-gnutls-dev libfreetype6 libgsl-dev liblzma-dev \
        libncurses5-dev libperl-dev libreadline-dev libssl-dev libz-dev make \
        unzip \
      && apt-get -y autoremove \
      && apt-get clean \
      && rm -rf /var/lib/apt/lists/*

RUN set -e \
      && /bin/bash /tmp/miniconda.sh -b -p /opt/conda \
      && /opt/conda/bin/conda update -n base -c defaults conda \
      && /opt/conda/bin/conda clean -ya \
      && ln -s /opt/conda/etc/profile.d/conda.sh /etc/profile.d/conda.sh \
      && echo '. /opt/conda/etc/profile.d/conda.sh' >> /etc/profile \
      && rm -f /tmp/miniconda.sh

ENV PATH /opt/conda/envs/smoove-env/bin:/opt/conda/bin:${PATH}

RUN set -e \
      && conda config --add channels defaults \
      && conda config --add channels bioconda \
      && conda config --add channels conda-forge \
      && conda create -n smoove-env \
        python=2.7 awscli numpy scipy cython pysam toolshed pyvcf pyfaidx \
        cyvcf2 svtyper svtools \
      && echo 'source activate smoove-env' >> /etc/profile \
      && conda clean -ya \
      && rm -rf /root/.cache/pip

RUN set -eo pipefail \
      && chmod +x /usr/local/bin/print-github-tags \
      && print-github-tags --release --latest samtools/samtools \
        | xargs -i curl -SL \
          https://github.com/samtools/samtools/releases/download/{}/samtools-{}.tar.bz2 \
          -o /tmp/samtools.tar.bz2 \
      && tar xvf /tmp/samtools.tar.bz2 -C /usr/local/src --remove-files \
      && mv /usr/local/src/samtools-* /usr/local/src/samtools \
      && cd /usr/local/src/samtools \
      && autoheader \
      && autoconf \
      && ./configure \
      && make \
      && make install

RUN set -eo pipefail \
      && print-github-tags --release --latest samtools/bcftools \
        | xargs -i curl -SL \
          https://github.com/samtools/bcftools/releases/download/{}/bcftools-{}.tar.bz2 \
          -o /tmp/bcftools.tar.bz2 \
      && tar xvf /tmp/bcftools.tar.bz2 -C /usr/local/src --remove-files \
      && mv /usr/local/src/bcftools-* /usr/local/src/bcftools \
      && cd /usr/local/src/bcftools \
      && autoheader \
      && autoconf \
      && ./configure --enable-libgsl --enable-perl-filters \
      && make \
      && make install

RUN set -eo pipefail \
      && print-github-tags --release --latest --tar ebiggers/libdeflate \
        | xargs -i curl -SL {} -o /tmp/libdeflate.tar.gz \
      && tar xvf /tmp/libdeflate.tar.gz -C /usr/local/src --remove-files \
      && mv /usr/local/src/libdeflate-* /usr/local/src/libdeflate \
      && cd /usr/local/src/libdeflate \
      && make CFLAGS='-fPIC -O3' libdeflate.a \
      && cp libdeflate.a /usr/local/lib \
      && cp libdeflate.h /usr/local/include

RUN set -eo pipefail \
      && print-github-tags --release --latest root-project/root \
        | sed -e 's/-/\./g' \
        | xargs -i curl -SL \
          https://root.cern/download/root_{}.Linux-ubuntu18-x86_64-gcc7.4.tar.gz \
          -o /tmp/root.tar.gz \
      && tar xvf /tmp/root.tar.gz -C /opt --remove-files

ENV BCFTOOLS_PLUGINS /usr/local/src/bcftools/plugins
ENV ROOTSYS /opt/root
ENV PYTHONPATH ${ROOTSYS}/lib:${PYTHONPATH}

RUN set -eo pipefail \
      && print-github-tags --release --latest abyzovlab/CNVnator \
        | xargs -i curl -SL \
          https://github.com/abyzovlab/CNVnator/releases/download/{}/CNVnator_{}.zip \
          -o /tmp/cnvnator.zip \
      && unzip -d /usr/local/src /tmp/cnvnator.zip \
      && mv /usr/local/src/CNVnator_* /usr/local/src/cnvnator \
      && tar xvf /tmp/yeppp-1.0.0.tar.bz2 -C /usr/local/src/cnvnator --remove-files \
      && cd /usr/local/src/cnvnator/src \
      && ln -s /usr/local/src/samtools . \
      && source /opt/root/bin/thisroot.sh \
      && make LIBS='-lcrypto' \
        YEPPPLIBDIR='/usr/local/src/cnvnator/yeppp-1.0.0/binaries/linux/x86_64' \
        YEPPPINCLUDEDIR='/usr/local/src/cnvnator/yeppp-1.0.0/library/headers' \
      && find /usr/local/src/cnvnator/src -maxdepth 1 -type f -executable \
        -exec ln -s {} /usr/local/bin \; \
      && rm -f /tmp/cnvnator.zip

ENV LD_LIBRARY_PATH ${ROOTSYS}/lib:/usr/local/src/cnvnator/yeppp-1.0.0/binaries/linux/x86_64:${LD_LIBRARY_PATH}

RUN set -eo pipefail \
      && print-github-tags --release --latest arq5x/lumpy-sv \
        | tr -d v \
        | xargs -i curl -SL \
          https://github.com/arq5x/lumpy-sv/releases/download/{}/lumpy-sv.tar.gz \
          -o /tmp/lumpy-sv.tar.gz \
      && tar xvf /tmp/lumpy-sv.tar.gz -C /usr/local/src --remove-files \
      && cd /usr/local/src/lumpy-sv/lib/htslib \
      && autoheader \
      && autoconf \
      && make \
      && make install \
      && cd /usr/local/src/lumpy-sv \
      && make \
      && find /usr/local/src/lumpy-sv/bin -maxdepth 1 -type f -executable \
        -exec ln -s {} /usr/local/bin \;

RUN set -eo pipefail \
      && print-github-tags --release --latest base2genomics/batchit \
        | xargs -i curl -SL \
          https://github.com/base2genomics/batchit/releases/download/{}/batchit \
          -o /usr/local/bin/batchit \
      && print-github-tags --release --latest brentp/mosdepth \
        | xargs -i curl -SL \
          https://github.com/brentp/mosdepth/releases/download/{}/mosdepth \
          -o /usr/local/bin/mosdepth \
      && print-github-tags --release --latest brentp/duphold \
        | xargs -i curl -SL \
          https://github.com/brentp/duphold/releases/download/{}/duphold \
          -o /usr/local/bin/duphold \
      && print-github-tags --release --latest brentp/gsort \
        | xargs -i curl -SL \
          https://github.com/brentp/gsort/releases/download/{}/gsort_linux_amd64 \
          -o /usr/local/bin/gsort \
      && print-github-tags --release --latest brentp/bpbio \
        | xargs -i curl -SL \
          https://github.com/brentp/bpbio/releases/download/{}/bpbio_static \
          -o /usr/local/bin/bpbio \
      && print-github-tags --release --latest brentp/gargs \
        | xargs -i curl -SL \
          https://github.com/brentp/gargs/releases/download/{}/gargs_linux \
          -o /usr/local/bin/gargs \
      && print-github-tags --release --latest brentp/goleft \
        | xargs -i curl -SL \
          https://github.com/brentp/goleft/releases/download/{}/goleft_linux64 \
          -o /usr/local/bin/goleft \
      && print-github-tags --release --latest brentp/smoove \
        | xargs -i curl -SL \
          https://github.com/brentp/smoove/releases/download/{}/smoove \
          -o /usr/local/bin/smoove \
      && chmod +x \
        /usr/local/bin/batchit /usr/local/bin/mosdepth /usr/local/bin/duphold \
        /usr/local/bin/gsort /usr/local/bin/bpbio /usr/local/bin/gargs \
        /usr/local/bin/goleft /usr/local/bin/smoove

ENTRYPOINT ["/usr/local/bin/smoove"]


text:
        {!! config('admin.name') !!}
        {!! config('admin.name_mini') !!}

            Toggle navigation

                        user()->image->url('crop')) ? : '/assets/img/avatar.png' }}"
                             class="user-image" alt="{{ auth()->user()->name }}"/>
                        {{ auth()->user()->name }}

                            user()->image->url('crop')) ? : '/assets/img/avatar.png' }}"
                                 class="img-circle" alt="{{ auth()->user()->name }}"/>

                                {{ auth()->user()->name }}
                                {{ auth()->user()->email }}

                                Perfil

                                Sair


text:
package com.wenshao.dal.bean;

/**
 * Created by wenshao on 2018/3/23.
 * zookeeper node节点的data对象
 */
public class ZkNodeDataBean {
    private String host;

    public String getHost() {
        return host;
    }

    public void setHost(String host) {
        this.host = host;
    }
}


text:
<%= I18n.t('session_title') %>

    <input id="session-name" type="text" class="session-name" placeholder="<%= I18n.t('session_placeholder') %>" />

<%= I18n.t('set_session') %>


text: <!DOCTYPE html>


text:
      Toggle navigation

            10

You have 10 notifications

                     5 new members joined today

View all

             {{user.username}}

                {{user.username}}
                 Token valid: {{getTokenExpirationDate() | date: 'dd/MM/yyyy'}}

                Profile

                Sign out


text:
from setuptools import setup, find_packages

long_desc = '''
This package contains the feed Sphinx extension.

It creates an RSS feed of recently updated sphinx pages.
'''

requires = ['Sphinx>=0.6', 'python-dateutil<2', 'html5lib']
tests_require = ['BeautifulSoup>=3.2.0', 'feedparser']

setup(
    name='feed',
    version='0.3alpha',
    url='http://bitbucket.org/birkenfeld/sphinx-contrib',
    # download_url='http://pypi.python.org/pypi/feed',
    license='BSD',
    author='dan mackinlay',
    author_email='bitbucket@email.possumpalace.org',
    description='Sphinx extension feed',
    long_description=long_desc,
    zip_safe=False,
    classifiers=[
        'Development Status :: 4 - Beta',
        'Environment :: Console',
        'Environment :: Web Environment',
        'Intended Audience :: Developers',
        'License :: OSI Approved :: BSD License',
        'Operating System :: OS Independent',
        'Programming Language :: Python',
        'Topic :: Documentation',
        'Topic :: Utilities',
    ],
    platforms='any',
    packages=find_packages(),
    include_package_data=True,
    install_requires=requires,
    tests_require=tests_require,
    namespace_packages=['sphinxcontrib'],
)


text: GLOG_logtostderr=1 ../build/examples/train_net.bin lenet_solver.prototxt


text:
module HelpAnywhereHelper
  def can_edit_help?
    HelpAnywhere.config.has_edition_role? self
  end
end


text:
import React from 'react';
import { Provider } from 'react-redux';
import renderer from 'react-test-renderer';

import Main from 'containers/main';
import store from 'redux/store';

describe('Main container', () => {
  it('renders correctly', () => {
    const tree = renderer.create(
      <Provider store={store}>
        <Main />
      </Provider>
    ).toJSON();
    expect(tree).toMatchSnapshot();
  });
});