text:
<?xml version="1.0" encoding="utf-8"?>
<!--Generated by crowdin.com-->
<!-- Copyright (C) 2007 The Android Open Source Project

     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.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
  <string name="app_label">Reló</string>
  <string name="alarm_list_title">Alarmes</string>
  <string name="add_alarm">Amestar alarma</string>
  <string name="menu_desk_clock">Reló d\'escritoriu</string>
  <string name="menu_edit_alarm">Editar alarma</string>
  <string name="delete_alarm">Desaniciar alarma</string>
  <string name="enable_alarm">Activar alarma</string>
  <string name="disable_alarm">Desactivar alarma</string>
  <string name="delete_alarm_confirm">¿Desaniciar esta alarma?</string>
  <string name="show_clock">Amosar reló</string>
  <string name="hide_clock">Anubrir reló</string>
  <string name="label">Nome l\'alarma</string>
  <string name="default_label">Alarma</string>
  <string name="set_alarm">Afitar alarma</string>
  <string name="alarm_vibrate">Vibración</string>
  <string name="alarm_repeat">Repetir</string>
  <string name="alert">Tonu d\'alarma</string>
  <string name="ringtone">Tonu de llamada</string>
  <string name="time">Hora</string>
  <string name="alarm_tomorrow">Mañana</string>
  <string name="alarm_today">Güei</string>
  <string name="alarm_alert_wake_up">Espertar\u0021</string>
  <string name="alarm_alert_off_action_text">Non</string>
  <string name="alarm_alert_dismiss_text">Descartar</string>
  <string name="alarm_alert_dismiss_now_text">Inorar agora</string>
  <string name="alarm_missed_title">Alarma perdida</string>
  <string name="alarm_missed_text"><xliff:g id="ALARM_TIME">%s</xliff:g> - <xliff:g id="ALARM_LABEL">%s</xliff:g></string>
  <string name="alarm_alert_snoozed_text">Snoozed</string>
  <plurals name="alarm_alert_snooze_duration">
    <item quantity="one">1 min</item>
    <item quantity="other"><xliff:g id="number" example="7">%d</xliff:g> mins</item>
  </plurals>
  <string name="alarm_alert_off_text">Alarma apagada</string>
  <string name="alarm_alert_snooze_text">Posponer</string>
  <plurals name="alarm_alert_snooze_set">
    <item quantity="one">Pospuesta 1 minutu.</item>
    <item quantity="other">Pospuesta <xliff:g id="MINUTES">%d</xliff:g> minutos.</item>
  </plurals>
  <string name="alarm_alert_snooze_until">Repetir a les <xliff:g id="TIME">%s</xliff:g></string>
  <string name="alarm_alert_predismiss_title">Próxima alarma</string>
  <string name="missed_alarm_has_been_deleted">Desaniciáronse les alarmes perdíes</string>
  <string-array name="timer_notifications">
    <item>Queda menos de 1 minutu</item>
    <item>Queden <xliff:g id="HOURS">%1$s</xliff:g></item>
    <item>Queden <xliff:g id="MINUTES">%2$s</xliff:g></item>
    <item>Queden <xliff:g id="HOURS">%1$s</xliff:g> y <xliff:g id="MINUTES">%2$s</xliff:g></item>
  </string-array>
  <string-array name="alarm_set">
    <item>L\'alarma va sonar en menos d\'un minutu.</item>
    <item>L\'alarma va sonar en <xliff:g id="DAYS">%1$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="HOURS">%2$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="DAYS">%1$s</xliff:g> y <xliff:g id="HOURS">%2$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="MINUTES">%3$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="DAYS">%1$s</xliff:g> y <xliff:g id="MINUTES">%3$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="HOURS">%2$s</xliff:g> y <xliff:g id="MINUTES">%3$s</xliff:g>.</item>
    <item>L\'alarma va sonar en <xliff:g id="DAYS">%1$s</xliff:g>, <xliff:g id="HOURS">%2$s</xliff:g> y <xliff:g id="MINUTES">%3$s</xliff:g>.</item>
  </string-array>
  <string name="day">"1 día"</string>
  <string name="days">"<xliff:g id="DAYS">%s</xliff:g> díes"</string>
  <string name="hour">1 hora</string>
  <string name="hours"><xliff:g id="HOURS">%s</xliff:g> hores</string>
  <string name="minute">"1 minutu"</string>
  <string name="minutes">"<xliff:g id="MINUTES">%s</xliff:g> minutos"</string>
  <string name="every_day">Tolos díes</string>
  <string name="never">Enxamás</string>
  <string name="day_concat">", "</string>
  <string name="clock_instructions">Esbillar un reló</string>
  <string name="analog_gadget">Reló analóxicu</string>
  <string name="help">ayuda</string>
  <string name="settings">Axustes</string>
  <string name="snooze_duration_title">Repetir alarma dempués de</string>
  <plurals name="snooze_duration">
    <item quantity="one">1 minutu</item>
    <item quantity="other"><xliff:g id="NUMBER">%d</xliff:g> minutos</item>
  </plurals>
  <plurals name="snooze_picker_label">
    <item quantity="one">minutu</item>
    <item quantity="other">minutos</item>
  </plurals>
  <string name="auto_silence_title">Silenciar dempués de</string>
  <string name="auto_silence_summary"><xliff:g id="MINUTES">%d</xliff:g> minutos</string>
  <string name="auto_silence_never">Enxamás</string>
  <string-array name="auto_silence_entries">
    <item>5 minutos</item>
    <item>10 minutos</item>
    <item>15 minutos</item>
    <item>20 minutos</item>
    <item>25 minutos</item>
    <item>30 minutos</item>
    <item>Nunca</item>
  </string-array>
  <string name="done">Fecho</string>
  <string name="revert">Revertir</string>
  <string name="delete">Desaniciar</string>
  <string name="alarm_volume_title">Volume de l\'alarma</string>
  <string name="silent_alarm_summary">Silenciu</string>
  <string name="alarm_notify_text">Posponer o inorar alarma</string>
  <string name="alarm_notify_snooze_label"><xliff:g id="LABEL">%s</xliff:g> (pospuesta)</string>
  <string name="alarm_notify_snooze_text">L\'alarma va sonar a les <xliff:g id="TIME">%s</xliff:g>. Toca pa encaboxar.</string>
  <string name="volume_button_setting_title">Botones de volume</string>
  <string name="volume_button_dialog_title">Aición de los botones</string>
  <string-array name="volume_button_setting_entries">
    <item>Posponer l\'alarma</item>
    <item>Descartar l\'alarma</item>
    <item>Nun facer un res</item>
  </string-array>
  <string name="default_ringtone_setting_title">Afitar tonu predetermináu</string>
  <string name="alarm_button_description">Alarmes</string>
  <string name="gallery_button_description">Galería</string>
  <string name="music_button_description">Música</string>
  <string name="nightmode_button_description">Atenuar</string>
  <string name="home_button_description">Llanzador</string>
  <string name="desk_clock_button_description">Reló</string>
  <string name="label_description">Nome</string>
  <string name="ringtone_description">Tonu de llamada</string>
  <string name="battery_charging_level"><xliff:g id="NUMBER">%d</xliff:g><xliff:g id="PERCENT">%%</xliff:g></string>
  <string name="weather_fetch_failure">La información meteorolóxica nun ta disponible nesti momentu.</string>
  <string name="alarm_klaxon_service_desc">Reproducción d\'alarmes definíes en Reló</string>
  <string name="loading_ringtone">Cargando tonu…</string>
  <string name="timer_ring_service_desc">Reproducción de temporizadores definíos nel reló</string>
  <string name="control_set_alarm">Afitar alarma</string>
  <string name="control_set_alarm_with_existing"><xliff:g id="time">%s</xliff:g></string>
  <string name="menu_alarm">Alarma</string>
  <string name="menu_timer">Temporizador</string>
  <string name="menu_clock">Reló</string>
  <string name="menu_stopwatch">Cronómetru</string>
  <string name="button_alarms">Amestar alarma</string>
  <string name="button_cities">Ciudaes</string>
  <string name="button_menu">Más opciones</string>
  <string name="menu_item_settings">Axustes</string>
  <string name="menu_item_help">Ayuda</string>
  <string name="menu_item_night_mode">Mou nocherniegu</string>
  <string name="menu_item_sort_by_gmt_offset">Ordenar por hora</string>
  <string name="menu_item_sort_by_name">Ordenar por nome</string>
  <string name="selected_cities_label">Ciudaes esbillaes</string>
  <string name="sw_resume_button">Reanudar</string>
  <string name="sw_start_button">Aniciar</string>
  <string name="sw_stop_button">Detener</string>
  <string name="sw_lap_button">Amestar vuelta</string>
  <string name="sw_reset_button">Llimpiar</string>
  <string name="sw_share_button">Compartir</string>
  <string name="hours_label">h</string>
  <string name="minutes_label">m</string>
  <string name="seconds_label">s</string>
  <string name="hours_label_description">hores</string>
  <string name="minutes_label_description">minutos</string>
  <string name="seconds_label_description">segundos</string>
  <string name="zero">0</string>
  <string name="sw_share_main">Hora: <xliff:g id="TIME">%s</xliff:g></string>
  <string name="sw_share_laps">Duración de les vueltes:</string>
  <string name="sw_notification_lap_number">Fase <xliff:g id="NUMBER">%d</xliff:g></string>
  <plurals name="Nhours_description">
    <item quantity="one">1 hora</item>
    <item quantity="other"><xliff:g id="NUMBER">%d</xliff:g> hores</item>
  </plurals>
  <plurals name="Nminutes_description">
    <item quantity="one">1 minutu</item>
    <item quantity="other"><xliff:g id="NUMBER">%d</xliff:g> minutos</item>
  </plurals>
  <plurals name="Nseconds_description">
    <item quantity="one">1 segundu</item>
    <item quantity="other"><xliff:g id="NUMBER">%d</xliff:g> segundos</item>
  </plurals>
  <string name="timer_add_timer">Amestar temporizador</string>
  <string name="timer_start">Aniciar</string>
  <string name="timer_delete">Desaniciar</string>
  <string name="timer_plus_one">Amestar 1 minutu</string>
  <string name="timer_plus_1_min">Añadir 1 min</string>
  <string name="timer_stop">Detener</string>
  <string name="timer_done">Fecho</string>
  <string name="timer_reset">Llimpiar</string>
  <string name="timer_cancel">Encaboxar</string>
  <string name="timer_times_up">Tiempu agotáu</string>
  <string name="timer_notification_label">Temporizador</string>
  <string name="timers_max_count_reached">4 vegaes máximo</string>
  <string-array name="sw_share_strings" translatable="true">
    <item>Yes el rei de la velocidá.</item>
    <item>Esfruta de los frutos del to trabayu.</item>
    <item>Los androides son conocíos por ser rápidos, pero non tanto como tu.</item>
    <item>¡Uf!</item>
    <item>L33t vegaes</item>
    <item>Una velocidá ablucante</item>
    <item>Vamos a saltar nel tiempu otra vegada.</item>
    <item>Namái un saltu a la esquierda</item>
    <item>Tienes munches coses que facer en pocu tiempu.</item>
    <item>Velocidá fotónica</item>
  </string-array>
  <plurals name="timers_num">
    <item quantity="one">Un minutu</item>
    <item quantity="other"><xliff:g id="NUMBER">%d</xliff:g> temporizadores</item>
  </plurals>
  <string name="home_label">Casa</string>
  <string name="cities_activity_title">Ciudaes</string>
  <string name="clock_settings">Reló</string>
  <string name="clock_style">Estilu</string>
  <string-array name="clock_style_entries">
    <item>Analóxicu</item>
    <item>Dixital</item>
  </string-array>
  <string name="automatic_home_clock">Reló de la to ciudá automáticu</string>
  <string name="automatic_home_clock_summary">Cuando viaxes a una zona con una hora diferente, amiesta un reló pa la hora de la to ciudá</string>
  <string name="home_time_zone">Estaya horaria llocal</string>
  <string name="home_time_zone_title">Estaya horaria llocal</string>
  <string name="time_picker_cancel">Encaboxar</string>
  <string name="time_picker_set">Aceutar</string>
  <string name="time_picker_time_seperator">:</string>
  <string name="time_picker_ampm_label">--</string>
  <string name="time_picker_00_label">:00</string>
  <string name="time_picker_30_label">:30</string>
  <string-array name="timezone_labels">
    <item>"Islles Marshall"</item>
    <item>"Islles Midway"</item>
    <item>"Hawái"</item>
    <item>"Alaska"</item>
    <item>"Hora del Pacíficu"</item>
    <item>"Tijuana"</item>
    <item>"Arizona"</item>
    <item>"Chihuahua"</item>
    <item>"Hora de les Montañes Rocoses"</item>
    <item>"Centroamérica"</item>
    <item>"Hora central"</item>
    <item>"Ciudá de Méxicu"</item>
    <item>"Saskatchewan"</item>
    <item>"Bogotá"</item>
    <item>"Hora del Este"</item>
    <item>"Venezuela"</item>
    <item>"Hora del Atlánticu (Barbados)"</item>
    <item>"Hora del Atlánticu (Canadá)"</item>
    <item>"Manaos"</item>
    <item>"Santiago"</item>
    <item>"Terranova"</item>
    <item>"Brasilia"</item>
    <item>"Buenos Aires"</item>
    <item>"Groenlandia"</item>
    <item>"Montevidéu"</item>
    <item>"Atlánticu Mediu"</item>
    <item>"Azores"</item>
    <item>"Islles de Cabu Verde"</item>
    <item>"Casablanca"</item>
    <item>"Londres, Dublín"</item>
    <item>"Ámsterdam, Berlín"</item>
    <item>"Belgráu"</item>
    <item>"Bruxeles"</item>
    <item>"Sarayevu"</item>
    <item>"Windhoek"</item>
    <item>"Hora África Occidental"</item>
    <item>"Amán, Xordania"</item>
    <item>"Atenes, Estambul"</item>
    <item>"Beirut, Líbanu"</item>
    <item>"El Cairu"</item>
    <item>"Helsinki"</item>
    <item>"Xerusalén"</item>
    <item>"Minsk"</item>
    <item>"Harare"</item>
    <item>"Bagdad"</item>
    <item>"Moscú"</item>
    <item>"Kuwait"</item>
    <item>"Nairobi"</item>
    <item>"Teḥrán"</item>
    <item>"Bakú"</item>
    <item>"Tiflis"</item>
    <item>"Ereván"</item>
    <item>"Dubái"</item>
    <item>"Kabul"</item>
    <item>"Islamabad, Karachi"</item>
    <item>"Oral"</item>
    <item>"Ekaterimburgu"</item>
    <item>"Calcuta"</item>
    <item>"Sri Lanka"</item>
    <item>"Katmandú"</item>
    <item>"Astaná"</item>
    <item>"Rangún"</item>
    <item>"Krasnoyarsk"</item>
    <item>"Bangkok"</item>
    <item>"Pequín"</item>
    <item>"Hong Kong"</item>
    <item>"Irkutsk"</item>
    <item>"Kuala Lumpur"</item>
    <item>"Perth"</item>
    <item>"Taipei"</item>
    <item>"Seúl"</item>
    <item>"Tokiu, Osaka"</item>
    <item>"Yakutsk"</item>
    <item>"Adelaida"</item>
    <item>"Darwin"</item>
    <item>"Brisbane"</item>
    <item>"Hobart"</item>
    <item>"Sidney, Canberra"</item>
    <item>"Vladivostok"</item>
    <item>"Guam"</item>
    <item>"Magadán"</item>
    <item>"Auckland"</item>
    <item>"Fixi"</item>
    <item>"Tonga"</item>
    <item>"Xakarta"</item>
  </string-array>
  <string name="alarm_settings">Alarmes</string>
  <string name="stopwatch_service_desc">Serviciu de cronómetru pa executar la notificación</string>
  <string name="swn_stopped">Deteníu</string>
  <string name="description_direction_right">Eslizar el deu hacia mandrecha pa descartar</string>
  <string name="description_direction_left">Eslizar el deu hacia manzorga pa posponer</string>
  <string name="timer_stopped">Temporizador deteníu</string>
  <string name="timers_stopped"><xliff:g id="NUMBER">%d</xliff:g> temporizadores deteníos</string>
  <string name="all_timers_stopped_notif">Toca pa ver los tos temporizadores</string>
  <string name="timers_in_use"><xliff:g id="NUMBER">%d</xliff:g> temporizadores</string>
  <string name="next_timer_notif">Próximu temporizador: <xliff:g id="TIME_REMAINING">%s</xliff:g></string>
  <string name="screensaver_settings">Axustes del curiapantalles</string>
  <string name="night_mode_title">Mou nocherniegu</string>
  <string name="night_mode_summary">Pantalla amatagada (pa espacios escuros)</string>
  <string name="expand_alarm">Espander alarma</string>
  <string name="collapse_alarm">Contrayer alarma</string>
  <string name="alarm_undo">desfacer</string>
  <string name="alarm_deleted">Alarma desaniciada</string>
  <string name="slash"> / </string>
  <string name="world_day_of_week_label">/ <xliff:g id="LABEL">%s</xliff:g></string>
  <string name="next_alarm_description">Próxima alarma: <xliff:g id="ALARM_TIME">%s</xliff:g></string>
  <string name="alarms_selected">Seleicionaes: <xliff:g id="ALARMS">%d</xliff:g></string>
  <string name="deleted_message">Desaniciáu</string>
  <plurals name="alarm_delete_confirmation">
    <item quantity="one">¿Desaniciar alarma seleicionada?</item>
    <item quantity="other">¿Desaniciar alarmes seleicionaes?</item>
  </plurals>
  <string name="timer_delete_confirmation">¿Desaniciar esti temporizador?</string>
  <string name="city_delete_confirmation">¿Desaniciar esta ciudá?</string>
  <string name="digital_gadget">Reló dixital</string>
  <string name="no_alarms">Nun hai alarmes</string>
  <string name="no_alarms_set">Nun s\'afitaron alarmes</string>
  <string name="no_upcoming_alarms">NUN HAI ALARMES VINIENTES</string>
</resources>


text:
"""

<DefineSource>
@Date : Fri Nov 14 13:20:38 2014 \n
@Author : Erwan Ledoux \n\n
</DefineSource>

A Mapper instance maps an apply and so "grinds" a MappingArgDictsList
to a method.

"""

#<DefineAugmentation>
import ShareYourSystem as SYS
BaseModuleStr="ShareYourSystem.Itemizers.Applyier"
DecorationModuleStr="ShareYourSystem.Classors.Classer"
SYS.setSubModule(globals())
#</DefineAugmentation>

#<ImportSpecificModules>
import copy
#</ImportSpecificModules>

#<DefineClass>
@DecorationClass()
class MapperClass(BaseClass):

	#Definition
	RepresentingKeyStrsList=[
							'MappingApplyMethodStr',
							'MappingArgDictsList',
							'MappedVariablesList'
						]

	def default_init(self,
				_MappingApplyMethodStr="",
				_MappingArgDictsList=None,
				_MappedVariablesList=None,
				**_KwargVariablesDict
				):

		#Call the parent __init__ method
		BaseClass.__init__(self,**_KwargVariablesDict)

	def do_map(self):
		""" """

		#debug
		'''
		self.debug(
					('self.',self,[
									'MappingMethodStr',
									'MappingArgDictsList'
								])
			)
		'''

		"""
		map(
				lambda
				self.Mapp
				self.MappingVariablesList
			)
		"""

#</DefineClass>

redpajama_set_name: RedPajamaGithub


text:
<?php
/**
 * Created by PhpStorm.
 * User: pluetzner
 * Date: 14.06.2016
 * Time: 10:34
 */

namespace Pluetzner\BlockBundle\Form;

use Pluetzner\BlockBundle\Entity\ImageBlock;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\Extension\Core\Type\SubmitType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolver;
use Symfony\Component\Validator\Constraints\File;
use Symfony\Component\Validator\Constraints\NotBlank;

/**
 * Class ImageBlockFormType
 *
 * @package Pluetzner\BlockBundle/Form
 */
class ImageBlockFormType extends AbstractType
{
    /**
     * @param FormBuilderInterface $builder
     * @param array                $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        if (true === $options['save_button']) {
            $builder
                ->add("slug", TextType::class, [
                    "label" => "Abkürzung:",
                    "required" => true
                ]);
        }

        $builder->add("uploadedFile", FileType::class, [
            "label" => "Bild",
            "constraints" => [
                new File([
                    "mimeTypes" => [
                        "image/gif",
                        "image/png",
                        "image/jpeg",
                        "image/svg+xml",
                    ],
                    "mimeTypesMessage" => "Bitte laden sie eine Bilddatei hoch.",
                    "maxSize" => "2M",
                ]),
            ],
        ]);
        if (true === $options['save_button']) {
            $builder->add('Speichern', SubmitType::class);
        }
    }

    public function configureOptions(OptionsResolver $resolver)
    {
        $resolver->setDefaults([
            'data_class' => ImageBlock::class,
            'save_button' => false,
        ]);
    }

}


text:
RSpec.describe Dory::Proxy do
  after :all do
    Dory::Proxy.delete
  end

  it "has the docker client" do
    expect(Dory::Proxy.docker_installed?).to be_truthy
  end

  it "starts up the container" do
    Dory::Proxy.delete
    expect(Dory::Proxy).not_to be_running
    expect{Dory::Proxy.start}.to change{Dory::Proxy.running?}.from(false).to(true)
    expect(Dory::Proxy).to be_container_exists
  end

  it "doesn't fail when starting the container twice" do
    2.times{ expect{Dory::Proxy.start}.not_to raise_error }
    expect(Dory::Proxy).to be_running
  end

  it "deletes the container" do
    expect(Dory::Proxy.start).to be_truthy
    expect(Dory::Proxy).to be_running
    expect(Dory::Proxy).to be_container_exists
    expect{Dory::Proxy.delete}.to change{Dory::Proxy.container_exists?}.from(true).to(false)
    expect(Dory::Proxy).not_to be_running
  end

  it "stops the container" do
    expect(Dory::Proxy.start).to be_truthy
    expect(Dory::Proxy).to be_running
    expect(Dory::Proxy.stop).to be_truthy
    expect(Dory::Proxy).to be_container_exists
    expect(Dory::Proxy).not_to be_running
  end

  it "starts the container when it already exists" do
    expect(Dory::Proxy.start).to be_truthy
    expect(Dory::Proxy).to be_running
    expect(Dory::Proxy.stop).to be_truthy
    expect(Dory::Proxy).to be_container_exists
    expect{Dory::Proxy.start}.to change{Dory::Proxy.running?}.from(false).to(true)
    expect(Dory::Proxy).to be_container_exists
    expect(Dory::Proxy).to be_running
  end

  context "ssl" do
    let(:filename) { '/tmp/dory-test-config-yml' }

    let(:expect_proxy_to_start) do
      ->() do
        Dory::Proxy.delete
        expect(Dory::Proxy).not_to be_running
        expect{Dory::Proxy.start}.to change{Dory::Proxy.running?}.from(false).to(true)
        expect(Dory::Proxy).to be_container_exists
      end
    end

    let(:patch_ssl_enabled) do
      ->(enabled) do
        new_config = YAML.load(Dory::Config.default_yaml)
        new_config['dory']['nginx_proxy']['https_enabled'] = enabled
        expect(new_config['dory']['nginx_proxy']['https_enabled']).to eq(enabled)
        allow(Dory::Config).to receive(:default_yaml) { new_config.to_yaml }
        expect(Dory::Config.settings['dory']['nginx_proxy']['https_enabled']).to eq(enabled)
      end
    end

    let(:expect_port) do
      ->(in_cmd:) do
        if in_cmd
          expect(Dory::Proxy.run_command).to match(/-p\s+443:443/)
        else
          expect(Dory::Proxy.run_command).not_to match(/-p\s+443:443/)
        end
      end
    end

    before :each do
      allow(Dory::Config).to receive(:filename) { filename }
    end

    context "enabled" do
      it "enables" do
        patch_ssl_enabled.call(true)
        expect_port.call(in_cmd: true)
        expect_proxy_to_start.call()
      end

      it "disables" do
        patch_ssl_enabled.call(false)
        expect_port.call(in_cmd: false)
        expect_proxy_to_start.call()
      end
    end

    context "port" do
      let(:new_port) { 1234 }
      let(:new_tls_port) { 4567 }

      let(:patch_ports) do
        ->(port:, tls_port:) do
          new_config = YAML.load(Dory::Config.default_yaml)
          new_config['dory']['nginx_proxy']['port'] = port
          new_config['dory']['nginx_proxy']['tls_port'] = tls_port
          expect(new_config['dory']['nginx_proxy']['port']).to eq(port)
          expect(new_config['dory']['nginx_proxy']['tls_port']).to eq(tls_port)
          allow(Dory::Config).to receive(:default_yaml) { new_config.to_yaml }
          expect(Dory::Config.settings['dory']['nginx_proxy']['port']).to eq(port)
          expect(Dory::Config.settings['dory']['nginx_proxy']['tls_port']).to eq(tls_port)
        end
      end

      it "defaults to 80 for http" do
        dy = YAML.load(Dory::Config.default_yaml)
        expect(dy['dory']['nginx_proxy']['port']).to eq(80)
        expect(dy['dory']['nginx_proxy']['tls_port']).to eq(443)
        expect(Dory::Proxy.run_command).to match(/-p\s+80:80/)
        expect(Dory::Proxy.run_command).to match(/-p\s+443:443/)
      end

      it "allows changing the ports" do
        dy = YAML.load(Dory::Config.default_yaml)
        expect(dy['dory']['nginx_proxy']['port']).to eq(80)
        expect(dy['dory']['nginx_proxy']['tls_port']).to eq(443)
        expect(Dory::Proxy.run_command).to match(/-p\s+80:80/)
        expect(Dory::Proxy.run_command).to match(/-p\s+443:443/)

        patch_ports.call(port: new_port, tls_port: new_tls_port)
        dy = YAML.load(Dory::Config.default_yaml)
        expect(dy['dory']['nginx_proxy']['port']).to eq(new_port)
        expect(dy['dory']['nginx_proxy']['tls_port']).to eq(new_tls_port)
        require 'byebug'; debugger
        patch_ssl_enabled.call(true)
        expect(Dory::Proxy.run_command).to match(/-p\s+#{new_port}:80/)
        expect(Dory::Proxy.run_command).to match(/-p\s+#{new_tls_port}:443/)
      end
    end

    context "certs" do
      let(:patch_config_ssl_certs_dir) do
        ->(ssl_certs_dir) do
          new_config = YAML.load(Dory::Config.default_yaml)
          new_config['dory']['nginx_proxy']['ssl_certs_dir'] = ssl_certs_dir
          expect(new_config['dory']['nginx_proxy']['ssl_certs_dir']).to eq(ssl_certs_dir)
          allow(Dory::Config).to receive(:default_yaml) { new_config.to_yaml }
          expect(Dory::Config.settings[:dory][:nginx_proxy][:ssl_certs_dir]).to eq(ssl_certs_dir)
        end
      end

      let(:expect_not_in_cmd) do
        ->(ssl_certs_dir) do
          patch_config_ssl_certs_dir.call(ssl_certs_dir)
          expect(Dory::Proxy.run_command).not_to match(/-v\s.*..etc.nginx.certs/)
          expect_proxy_to_start.call()
        end
      end

      it "mounts the ssl certs dir when it's set" do
        ssl_certs_dir = '/usr/bin'
        patch_config_ssl_certs_dir.call(ssl_certs_dir)
        expect(Dory::Proxy.run_command).to match(/-v\s#{Regexp.escape(ssl_certs_dir)}..etc.nginx.certs/)
        expect_port.call(in_cmd: true)
        expect_proxy_to_start.call()
      end

      it "does not mount anything when ssl certs is empty string" do
        expect_not_in_cmd.call('')
        expect_proxy_to_start.call()
      end

      it "does not mount anything when ssl certs is nil" do
        expect_not_in_cmd.call(nil)
        expect_proxy_to_start.call()
      end

      it "uses the freedomben proxy image when no ssl certs are being mounted" do
        patch_config_ssl_certs_dir.call('')
        expect(Dory::Proxy.dory_http_proxy_image_name).to match(/^freedomben/)
        patch_config_ssl_certs_dir.call(nil)
        expect(Dory::Proxy.dory_http_proxy_image_name).to match(/^freedomben/)
      end

      it "uses the codekitchen proxy image when ssl certs are being mounted" do
        patch_config_ssl_certs_dir.call('/usr/bin')
        expect(Dory::Proxy.dory_http_proxy_image_name).to match(/^codekitchen/)
      end
    end
  end
end


text:
package me.superhb.mobdrops.content;

import me.superhb.mobdrops.*;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.init.Items;
import net.minecraft.init.MobEffects;
import net.minecraft.inventory.EntityEquipmentSlot;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor.ArmorMaterial;
import net.minecraft.item.ItemFood;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraftforge.fml.common.registry.GameRegistry;

public class MDItems {
	// Creative Tab
	static CreativeTabs tab = MobDrops.mdTab;

	// Items
	public static Item
	creeperSkin,
	wolfSkin,
	redLeather,
	batFur, batEar, batEye, batWing, batSuit,
	enderScale, enderTear,
	goo, magmaGoo,
	ocelotFur, // used to make fur stole (fur around neck with head and legs)
	zombieBrain,
	blazeShard;

	// Tools
	public static Item
	spiderLeg,
	zombieArm,
	gooSword,
	magmaGooSword,
	blazeBow, blazeSword;

	// Food
	public static Item
	ham, bacon,
	squidTentacle, calamari,
	chickenLeg, cookedChickenLeg,
	pigmanMeat, cookedPigmanMeat,
	ribs, cookedRibs,
	creeperEye;

	// Armor
	public static Item
	creeperHelmet, creeperViewHelmet, creeperChestplate, creeperLeggings, creeperBoots,
	wolfHelmet, wolfChestplate, furStole, wolfLeggings, wolfBoots,
	ocelotHelmet, ocelotChestplate, ocelotLeggings, ocelotBoots,
	enderHelmet, enderChestplate, enderLeggings, enderBoots,
	blazeHelmet, blazeChestplate, blazeLeggings, blazeBoots;

	public static void init () {
		// Items
		creeperSkin = new Item().setUnlocalizedName("creeper_skin").setCreativeTab(tab);
		wolfSkin = new Item().setUnlocalizedName("wolf_skin").setCreativeTab(tab);
		redLeather = new Item().setUnlocalizedName("red_leather").setCreativeTab(tab);
		batFur = new Item().setUnlocalizedName("bat_fur").setCreativeTab(tab);
		batEar = new Item().setUnlocalizedName("bat_ear").setCreativeTab(tab);
		batEye = new Item().setUnlocalizedName("bat_eye").setCreativeTab(tab);
		batWing = new Item().setUnlocalizedName("bat_wing").setCreativeTab(tab);
		enderScale = new Item().setUnlocalizedName("ender_scale").setCreativeTab(tab);
		enderTear = new Item().setUnlocalizedName("ender_tear").setCreativeTab(tab);
		goo = new Item().setUnlocalizedName("goo").setCreativeTab(tab);
		magmaGoo = new Item().setUnlocalizedName("magma_goo").setCreativeTab(tab);
		ocelotFur = new Item().setUnlocalizedName("ocelot_fur").setCreativeTab(tab);
		zombieBrain = new Item().setUnlocalizedName("zombie_brain").setCreativeTab(tab);
		blazeShard = new Item().setUnlocalizedName("blaze_shard").setCreativeTab(tab);
		batSuit = new MDBatSuit(MDMaterial.WOLF, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("bat_suit").setCreativeTab(tab);

		// Tools
		spiderLeg = new MDSword(MDMaterial.SPIDER).setUnlocalizedName("spider_leg").setCreativeTab(tab);
		zombieArm = new MDSword(MDMaterial.ZOMBIE).setUnlocalizedName("zombie_arm").setCreativeTab(tab);
		gooSword = new MDSword(MDMaterial.GOO).setUnlocalizedName("goo_sword").setCreativeTab(tab);
		magmaGooSword = new MDSword(MDMaterial.MAGMA).setUnlocalizedName("magmagoo_sword").setCreativeTab(tab);
		blazeSword = new MDSword(MDMaterial.TBLAZE).setUnlocalizedName("blaze_sword").setCreativeTab(tab);
		blazeBow = new MDBow().setUnlocalizedName("blaze_bow").setCreativeTab(tab);

		//.setPotionEffect(new PotionEffect(MobEffects.POISON, 100, 0), 0.6F)
		// Food
		ham = new ItemFood(1, 1, true).setPotionEffect(new PotionEffect(MobEffects.POISON, 50, 0), 0.6F).setUnlocalizedName("ham").setCreativeTab(tab);
		bacon = new ItemFood(1, 1, true).setUnlocalizedName("bacon").setCreativeTab(tab);
		squidTentacle = new ItemFood(1, 1, false).setPotionEffect(new PotionEffect(MobEffects.POISON, 50, 0), 0.6F).setUnlocalizedName("squid_tentacle").setCreativeTab(tab);
		calamari = new ItemFood(1, 1, false).setUnlocalizedName("calamari").setCreativeTab(tab);
		chickenLeg = new ItemFood(1, 1, true).setPotionEffect(new PotionEffect(MobEffects.POISON, 50, 0), 0.6F).setUnlocalizedName("chicken_leg").setCreativeTab(tab);
		cookedChickenLeg = new ItemFood(1, 1, true).setUnlocalizedName("cooked_chicken_leg").setCreativeTab(tab);
		pigmanMeat = new ItemFood(1, 1, true).setPotionEffect(new PotionEffect(MobEffects.POISON, 50, 0), 0.6F).setUnlocalizedName("pigman_meat").setCreativeTab(tab);
		cookedPigmanMeat = new ItemFood(1, 1, true).setUnlocalizedName("cooked_pigman_meat").setCreativeTab(tab);
		ribs = new ItemFood(1, 1, true).setPotionEffect(new PotionEffect(MobEffects.POISON, 50, 0), 0.6F).setUnlocalizedName("ribs").setCreativeTab(tab);
		cookedRibs = new ItemFood(1, 1, true).setUnlocalizedName("cooked_ribs").setCreativeTab(tab);
		creeperEye = new ItemFood(1, 1, false).setUnlocalizedName("creeper_eye").setCreativeTab(tab);

		// Armor
		creeperViewHelmet = new MDArmor(MDMaterial.CREEPER, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("creeper_view_helmet").setCreativeTab(tab);
		creeperHelmet = new MDArmor(MDMaterial.CREEPER, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("creeper_helmet").setCreativeTab(tab);
		creeperChestplate = new MDArmor(MDMaterial.CREEPER, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("creeper_chestplate").setCreativeTab(tab);
		creeperLeggings = new MDArmor(MDMaterial.CREEPER, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("creeper_leggings").setCreativeTab(tab);
		creeperBoots = new MDArmor(MDMaterial.CREEPER, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("creeper_boots").setCreativeTab(tab);
		wolfHelmet = new MDArmor(MDMaterial.WOLF, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("wolf_helmet").setCreativeTab(tab);
		wolfChestplate = new MDArmor(MDMaterial.WOLF, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("wolf_chestplate").setCreativeTab(tab);
		furStole = new MDArmor(MDMaterial.WOLF, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("fur_stole").setCreativeTab(tab); // new material?
		wolfLeggings = new MDArmor(MDMaterial.WOLF, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("wolf_leggings").setCreativeTab(tab);
		wolfBoots = new MDArmor(MDMaterial.WOLF, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("wolf_boots").setCreativeTab(tab);
		ocelotHelmet = new MDArmor(MDMaterial.OCELOT, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("ocelot_helmet").setCreativeTab(tab);
		ocelotChestplate = new MDArmor(MDMaterial.OCELOT, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("ocelot_chestplate").setCreativeTab(tab);
		ocelotLeggings = new MDArmor(MDMaterial.OCELOT, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("ocelot_leggings").setCreativeTab(tab);
		ocelotBoots = new MDArmor(MDMaterial.OCELOT, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("ocelot_boots").setCreativeTab(tab);
		enderHelmet = new MDArmor(MDMaterial.ENDER, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("ender_helmet").setCreativeTab(tab);
		enderChestplate = new MDArmor(MDMaterial.ENDER, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("ender_chestplate").setCreativeTab(tab);
		enderLeggings = new MDArmor(MDMaterial.ENDER, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("ender_leggings").setCreativeTab(tab);
		enderBoots = new MDArmor(MDMaterial.ENDER, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("ender_boots").setCreativeTab(tab);
		blazeHelmet = new MDArmor(MDMaterial.BLAZE, 0, EntityEquipmentSlot.HEAD).setUnlocalizedName("blaze_helmet").setCreativeTab(tab);
		blazeChestplate = new MDArmor(MDMaterial.BLAZE, 0, EntityEquipmentSlot.CHEST).setUnlocalizedName("blaze_chestplate").setCreativeTab(tab);
		blazeLeggings = new MDArmor(MDMaterial.BLAZE, 0, EntityEquipmentSlot.LEGS).setUnlocalizedName("blaze_leggings").setCreativeTab(tab);
		blazeBoots = new MDArmor(MDMaterial.BLAZE, 0, EntityEquipmentSlot.FEET).setUnlocalizedName("blaze_boots").setCreativeTab(tab);

		// Armor Repair Material
		MDMaterial.CREEPER.repairMaterial = new ItemStack(creeperSkin);
		MDMaterial.WOLF.repairMaterial = new ItemStack(wolfSkin);
		MDMaterial.OCELOT.repairMaterial = new ItemStack(ocelotFur);
		MDMaterial.ENDER.repairMaterial = new ItemStack(enderScale);
		MDMaterial.BLAZE.repairMaterial = new ItemStack(blazeShard);

		// TODO Use red leather when leather armor is dyed red
		//ArmorMaterial.LEATHER.customCraftingMaterial = redLeather;

		/*
		fur stole item and model needed
		*/
	}

	public static void register () {
		// Items
		registerItem(creeperSkin, "creeper_skin");
		registerItem(wolfSkin, "wolf_skin");
		registerItem(redLeather, "red_leather");
		/*
		GameRegistry.register(batFur.setRegistryName(batFur.getUnlocalizedName().substring(5)));
		GameRegistry.register(batEar.setRegistryName(batEar.getUnlocalizedName().substring(5)));
		GameRegistry.register(batEye.setRegistryName(batEye.getUnlocalizedName().substring(5)));
		GameRegistry.register(batWing.setRegistryName(batWing.getUnlocalizedName().substring(5)));
		*/
		registerItem(enderScale, "ender_scale");
		//GameRegistry.register(enderTear.setRegistryName(enderTear.getUnlocalizedName().substring(5)));
		registerItem(goo, "goo");
		registerItem(magmaGoo, "magma_goo");
		registerItem(ocelotFur, "ocelot_fur");
		registerItem(zombieBrain, "zombie_brain");
		registerItem(blazeShard, "blaze_shard");
		//GameRegistry.register(batSuit.setRegistryName(batSuit.getUnlocalizedName().substring(5)));

		// Tools
		registerItem(spiderLeg, "spider_leg");
		registerItem(zombieArm, "zombie_arm");
		registerItem(gooSword, "goo_sword");
		registerItem(magmaGooSword, "magmagoo_sword");
		registerItem(blazeSword, "blaze_sword");
		registerItem(blazeBow, "blaze_bow");

		// Foods
		registerItem(ham, "ham");
		registerItem(bacon, "bacon");
		registerItem(squidTentacle, "squid_tentacle");
		registerItem(calamari, "calamari");
		registerItem(chickenLeg, "chicken_leg");
		registerItem(cookedChickenLeg, "cooked_chicken_leg");
		registerItem(pigmanMeat, "pigman_meat");
		registerItem(cookedPigmanMeat, "cooked_pigman_meat");
		registerItem(ribs, "ribs");
		registerItem(cookedRibs, "cooked_ribs");
		registerItem(creeperEye, "creeper_eye");

		// Armor
		registerItem(creeperViewHelmet, "creeper_view_helmet");
		registerItem(creeperHelmet, "creeper_helmet");
		registerItem(creeperChestplate, "creeper_chestplate");
		registerItem(creeperLeggings, "creeper_leggings");
		registerItem(creeperBoots, "creeper_boots");

		registerItem(wolfHelmet, "wolf_helmet");
		registerItem(wolfChestplate, "wolf_chestplate");
		//GameRegistry.register(furStole.setRegistryName(furStole.getUnlocalizedName().substring(5)));
		registerItem(wolfLeggings, "wolf_leggings");
		registerItem(wolfBoots, "wolf_boots");

		registerItem(ocelotHelmet, "ocelot_helmet");
		registerItem(ocelotChestplate, "ocelot_chestplate");
		registerItem(ocelotLeggings, "ocelot_leggings");
		registerItem(ocelotBoots, "ocelot_boots");

		registerItem(enderHelmet, "ender_helmet");
		registerItem(enderChestplate, "ender_chestplate");
		registerItem(enderLeggings, "ender_leggings");
		registerItem(enderBoots, "ender_boots");

		registerItem(blazeHelmet, "blaze_helmet");
		registerItem(blazeChestplate, "blaze_chestplate");
		registerItem(blazeLeggings, "blaze_leggings");
		registerItem(blazeBoots, "blaze_boots");
	}

	public static void registerItem (Item item, String name) {
		GameRegistry.register(item.setRegistryName(name));
	}

	public static void registerRenders () {
		// Items
		registerRender(creeperSkin);
		registerRender(wolfSkin);
		registerRender(redLeather);
		/*
		registerRender(batFur);
		registerRender(batEar);
		registerRender(batEye);
		registerRender(batWing);
		*/
		registerRender(enderScale);
		//registerRender(enderTear);
		registerRender(goo);
		registerRender(magmaGoo);
		registerRender(ocelotFur);
		registerRender(zombieBrain);
		registerRender(blazeShard);
		//registerRender(batSuit);

		// Tools
		registerRender(spiderLeg);
		registerRender(zombieArm);
		registerRender(gooSword);
		registerRender(magmaGooSword);
		registerRender(blazeSword);
		registerRender(blazeBow);

		// Foods
		registerRender(ham);
		registerRender(bacon);
		registerRender(squidTentacle);
		registerRender(calamari);
		registerRender(chickenLeg);
		registerRender(cookedChickenLeg);
		registerRender(pigmanMeat);
		registerRender(cookedPigmanMeat);
		registerRender(ribs);
		registerRender(cookedRibs);
		registerRender(creeperEye);

		// Armor
		registerRender(creeperViewHelmet);
		registerRender(creeperHelmet);
		registerRender(creeperChestplate);
		registerRender(creeperLeggings);
		registerRender(creeperBoots);
		registerRender(wolfHelmet);
		registerRender(wolfChestplate);
		//registerRender(furStole);
		registerRender(wolfLeggings);
		registerRender(wolfBoots);
		registerRender(ocelotHelmet);
		registerRender(ocelotChestplate);
		registerRender(ocelotLeggings);
		registerRender(ocelotBoots);
		registerRender(enderHelmet);
		registerRender(enderChestplate);
		registerRender(enderLeggings);
		registerRender(enderBoots);
		registerRender(blazeHelmet);
		registerRender(blazeChestplate);
		registerRender(blazeLeggings);
		registerRender(blazeBoots);
	}

	public static void registerRender (Item item) {
		Minecraft.getMinecraft().getRenderItem().getItemModelMesher().register(item, 0, new ModelResourceLocation(item.getRegistryName(), "inventory"));
	}
}


text:
namespace {

const int kBufferSize = 16 * 1024;
const char kOkayResponse[] = "OKAY";
const char kHostTransportCommand[] = "host:transport:%s";
const char kLocalhost[] = "127.0.0.1";

std::string EncodeMessage(const std::string& message) {
  static const char kHexChars[] = "0123456789ABCDEF";

  size_t length = message.length();
  std::string result(4, '\0');
  char b = reinterpret_cast<const char*>(&length)[1];
  result[0] = kHexChars[(b >> 4) & 0xf];
  result[1] = kHexChars[b & 0xf];
  b = reinterpret_cast<const char*>(&length)[0];
  result[2] = kHexChars[(b >> 4) & 0xf];
  result[3] = kHexChars[b & 0xf];
  return result + message;
}

class AdbTransportSocket : public AdbClientSocket {
 public:
  AdbTransportSocket(int port,
                     const std::string& serial,
                     const std::string& socket_name,
                     const SocketCallback& callback)
    : AdbClientSocket(port),
      serial_(serial),
      socket_name_(socket_name),
      callback_(callback) {
    Connect(base::Bind(&AdbTransportSocket::OnConnected,
                       base::Unretained(this)));
  }

 private:
  ~AdbTransportSocket() {}

  void OnConnected(int result) {
    if (!CheckNetResultOrDie(result))
      return;
    SendCommand(base::StringPrintf(kHostTransportCommand, serial_.c_str()),
        true, base::Bind(&AdbTransportSocket::SendLocalAbstract,
                         base::Unretained(this)));
  }

  void SendLocalAbstract(int result, const std::string& response) {
    if (!CheckNetResultOrDie(result))
      return;
    SendCommand(socket_name_, true,
                base::Bind(&AdbTransportSocket::OnSocketAvailable,
                           base::Unretained(this)));
  }

  void OnSocketAvailable(int result, const std::string& response) {
    if (!CheckNetResultOrDie(result))
      return;
    callback_.Run(net::OK, std::move(socket_));
    delete this;
  }

  bool CheckNetResultOrDie(int result) {
    if (result >= 0)
      return true;
    callback_.Run(result, make_scoped_ptr<net::StreamSocket>(NULL));
    delete this;
    return false;
  }

  std::string serial_;
  std::string socket_name_;
  SocketCallback callback_;
};

class AdbQuerySocket : AdbClientSocket {
 public:
  AdbQuerySocket(int port,
                 const std::string& query,
                 const CommandCallback& callback)
      : AdbClientSocket(port),
        current_query_(0),
        callback_(callback) {
    queries_ = base::SplitString(query, "|", base::KEEP_WHITESPACE,
                                 base::SPLIT_WANT_NONEMPTY);
    if (queries_.empty()) {
      CheckNetResultOrDie(net::ERR_INVALID_ARGUMENT);
      return;
    }
    Connect(base::Bind(&AdbQuerySocket::SendNextQuery,
                       base::Unretained(this)));
  }

 private:
  ~AdbQuerySocket() {
  }

  void SendNextQuery(int result) {
    if (!CheckNetResultOrDie(result))
      return;
    std::string query = queries_[current_query_];
    if (query.length() > 0xFFFF) {
      CheckNetResultOrDie(net::ERR_MSG_TOO_BIG);
      return;
    }
    bool is_void = current_query_ < queries_.size() - 1;
    SendCommand(query, is_void,
        base::Bind(&AdbQuerySocket::OnResponse, base::Unretained(this)));
  }

  void OnResponse(int result, const std::string& response) {
    if (++current_query_ < queries_.size()) {
      SendNextQuery(net::OK);
    } else {
      callback_.Run(result, response);
      delete this;
    }
  }

  bool CheckNetResultOrDie(int result) {
    if (result >= 0)
      return true;
    callback_.Run(result, std::string());
    delete this;
    return false;
  }

  std::vector<std::string> queries_;
  size_t current_query_;
  CommandCallback callback_;
};

}  // namespace

// static
void AdbClientSocket::AdbQuery(int port,
                               const std::string& query,
                               const CommandCallback& callback) {
  new AdbQuerySocket(port, query, callback);
}

// static
void AdbClientSocket::TransportQuery(int port,
                                     const std::string& serial,
                                     const std::string& socket_name,
                                     const SocketCallback& callback) {
  new AdbTransportSocket(port, serial, socket_name, callback);
}

AdbClientSocket::AdbClientSocket(int port)
    : host_(kLocalhost), port_(port) {
}

AdbClientSocket::~AdbClientSocket() {
}

void AdbClientSocket::Connect(const net::CompletionCallback& callback) {
  net::IPAddress ip_address;
  if (!ip_address.AssignFromIPLiteral(host_)) {
    callback.Run(net::ERR_FAILED);
    return;
  }

  net::AddressList address_list =
      net::AddressList::CreateFromIPAddress(ip_address, port_);
  socket_.reset(new net::TCPClientSocket(address_list, NULL,
                                         net::NetLog::Source()));
  int result = socket_->Connect(callback);
  if (result != net::ERR_IO_PENDING)
    callback.Run(result);
}

void AdbClientSocket::SendCommand(const std::string& command,
                                  bool is_void,
                                  const CommandCallback& callback) {
  scoped_refptr<net::StringIOBuffer> request_buffer =
      new net::StringIOBuffer(EncodeMessage(command));
  int result = socket_->Write(request_buffer.get(),
                              request_buffer->size(),
                              base::Bind(&AdbClientSocket::ReadResponse,
                                         base::Unretained(this),
                                         callback,
                                         is_void));
  if (result != net::ERR_IO_PENDING)
    ReadResponse(callback, is_void, result);
}

void AdbClientSocket::ReadResponse(const CommandCallback& callback,
                                   bool is_void,
                                   int result) {
  if (result < 0) {
    callback.Run(result, "IO error");
    return;
  }
  scoped_refptr<net::IOBuffer> response_buffer =
      new net::IOBuffer(kBufferSize);
  result = socket_->Read(response_buffer.get(),
                         kBufferSize,
                         base::Bind(&AdbClientSocket::OnResponseHeader,
                                    base::Unretained(this),
                                    callback,
                                    is_void,
                                    response_buffer));
  if (result != net::ERR_IO_PENDING)
    OnResponseHeader(callback, is_void, response_buffer, result);
}

void AdbClientSocket::OnResponseHeader(
    const CommandCallback& callback,
    bool is_void,
    scoped_refptr<net::IOBuffer> response_buffer,
    int result) {
  if (result <= 0) {
    callback.Run(result == 0 ? net::ERR_CONNECTION_CLOSED : result,
                 "IO error");
    return;
  }

  std::string data = std::string(response_buffer->data(), result);
  if (result < 4) {
    callback.Run(net::ERR_FAILED, "Response is too short: " + data);
    return;
  }

  std::string status = data.substr(0, 4);
  if (status != kOkayResponse) {
    callback.Run(net::ERR_FAILED, data);
    return;
  }

  // Trim OKAY.
  data = data.substr(4);
  if (!is_void)
    OnResponseData(callback, data, response_buffer, -1, 0);
  else
    callback.Run(net::OK, data);
}

void AdbClientSocket::OnResponseData(
    const CommandCallback& callback,
    const std::string& response,
    scoped_refptr<net::IOBuffer> response_buffer,
    int bytes_left,
    int result) {
  if (result < 0) {
    callback.Run(result, "IO error");
    return;
  }

  std::string new_response = response +
      std::string(response_buffer->data(), result);

  if (bytes_left == -1) {
    // First read the response header.
    int payload_length = 0;
    if (new_response.length() >= 4 &&
        base::HexStringToInt(new_response.substr(0, 4), &payload_length)) {
      new_response = new_response.substr(4);
      bytes_left = payload_length - new_response.size();
    }
  } else {
    bytes_left -= result;
  }

  if (bytes_left == 0) {
    callback.Run(net::OK, new_response);
    return;
  }

  // Read tail
  result = socket_->Read(response_buffer.get(),
                         kBufferSize,
                         base::Bind(&AdbClientSocket::OnResponseData,
                                    base::Unretained(this),
                                    callback,
                                    new_response,
                                    response_buffer,
                                    bytes_left));
  if (result > 0)
    OnResponseData(callback, new_response, response_buffer, bytes_left, result);
  else if (result != net::ERR_IO_PENDING)
    callback.Run(net::OK, new_response);
}


text:
// Generated by CoffeeScript 1.6.3
(function() {
  module.exports = function(tintan) {
    var Tintan, build_deps;
    Tintan = tintan.constructor;
    build_deps = [];
    namespace('build', function() {
      if (Tintan.$.os === 'osx' && Tintan.appXML().targets('iphone')) {
        build_deps.push('build:iphone');
        desc('Build for iPhone');
        task('iphone', ['compile'], {
          async: true
        }, function() {
          return Tintan.$.tipy(['iphone', 'builder.py'], 'build', Tintan.$.ios_version(), process.cwd(), Tintan.appXML().id(), Tintan.appXML().name(), complete);
        });
      }
      if (Tintan.appXML().targets('android')) {
        build_deps.push('build:android');
        desc('Build for Android');
        return task('android', ['compile'], {
          async: true
        }, function() {
          return Tintan.$.tipy(['android', 'builder.py'], 'build', Tintan.appXML().name(), Tintan.$.android_home(), process.cwd(), Tintan.appXML().id(), complete);
        });
      }
    });
    desc('Build sources');
    return task('build', build_deps);
  };

}).call(this);

/*
//@ sourceMappingURL=build.map
*/


text:
require 'test_helper'

class ArgCfgTest < Test::Unit::TestCase

  include ActionArgs

  def setup
    @cfg = ArgCfg.new(:foo)
    @opt_cfg = OptArgCfg.new(:foo)
  end

  # Munge is meant to be used to normalize the input.
  # For example, to downcase strings.
  # But it should maintain type.

  #
  # array
  #
  def test_int_array
    cfg = OptArgCfg.new(:foo).as(:int_array).
      munge {|ary| ary.map {|i| i+1 } }.
      default([1,2,3]).
      validate {|ary| ary.all? {|i| i>0 } }
    assert cfg.valid?
  end

  def test_positive_int_array
    # OK
    cfg = OptArgCfg.new(:foo).as(:positive_int_array).default([1,2,3])
    assert cfg.valid?

    # 1.1 is a float (not int)
    cfg = OptArgCfg.new(:foo).as(:positive_int_array).default([1.1, 2, 3])
    assert !cfg.valid?

    # 0 is not positive
    cfg = OptArgCfg.new(:foo).as(:positive_int_array).default([0, 2, 3])
    assert !cfg.valid?
  end

  def test_unsigned_int_array
    # OK
    cfg = OptArgCfg.new(:foo).as(:unsigned_int_array).default([0,1,2])
    assert cfg.valid?

    # 0.1 is a float (not int)
    cfg = OptArgCfg.new(:foo).as(:unsigned_int_array).default([0.1, 1, 2])
    assert !cfg.valid?

    # -1 is negative
    cfg = OptArgCfg.new(:foo).as(:unsigned_int_array).default([-1, 0, 1])
    assert !cfg.valid?
  end

  def test_float_array
    # OK
    cfg = OptArgCfg.new(:foo).as(:float_array).default([0.0, 1.1, 2.2])
    assert cfg.valid?

    # 0 can be treated as a float, too
    cfg = OptArgCfg.new(:foo).as(:float_array).default([0, 1.1, 2.2])
    assert cfg.valid?
  end

=begin
  def test_string_array
    cfg = OptArgCfg.new(:foo).as(:string_array).
      munge {|ary| ary.map(:downcase) }.     # Downcase each one.
      default(['foo', 'bar', 'baz']).
      validate {|ary| ary.all? {|i| i>'a' } } # On WHOLE list -- '>(int)' doesn't work with strings.
    assert cfg.valid?
  end

  def test_validation_on_default_may_raise_exception
    cfg = OptArgCfg.new(:foo).as(:string_array).
      default(['foo', 'bar', 'baz']).
      validate {|ary| ary.all? {|i| i>0 } }     # '>(int)' doesn't work with strings.
    assert_raises ::ArgumentError do cfg.valid? end
  end

  def test_bool_array
    cfg = OptArgCfg.new(:foo).as(:bool_array).
      default([true, true, false])
    assert cfg.valid?
    assert_equal [true, true, false], cfg.default_value

    cfg = OptArgCfg.new(:foo).as(:bool_array).
      default(['t', true, false])  # 't' not a bool
    assert !cfg.valid?
  end

  def test_float_array
    cfg = OptArgCfg.new(:foo).as(:float_array).
      munge {|ary| ary.map {|i| i+1 } }.
      default([1.0, 2, 3.0]).
      validate {|ary| ary.all? {|i| i>0 } }
    assert cfg.valid?

    cfg = OptArgCfg.new(:foo).as(:float_array).
      default([1.0, '2.0', 3.0])  # String, not float.
    assert !cfg.valid?
  end

  def test_symbol_array
    cfg = OptArgCfg.new(:foo).as(:symbol_array).
      default([:books, :games]).
      validate do |ary|
        ary.all? {|i| [:books, :games, :videos, :music].include? i }
      end
    assert cfg.valid?

    cfg = OptArgCfg.new(:foo).as(:symbol_array).
      default([:books, 'games'])  # String, not float.
    assert !cfg.valid?
  end

  def test_default_for_array_must_be_proper_monomorphic_array
    cfg = OptArgCfg.new(:foo).as(:string_array).default(['foo', 'bar', 'baz'])
    assert cfg.valid?

    cfg = OptArgCfg.new(:foo).as(:string_array).default(['foo', 2, 'baz'])
    assert !cfg.valid?
  end

  def test_default_for_array_cannot_be_simple_list
    assert_raises ::ArgumentError do
      OptArgCfg.new(:foo).as(:string_array).default('foo', 'bar', 'baz')
    end
  end
=end

  # name
  def test_name_should_be_symbol
    assert_raises ConfigError do ArgCfg.new('foo') end
  end

  # type
  def test_default_type_is_string
    assert_equal ArgCfg,  @cfg.class
    assert_equal :string, @cfg.type_name
  end

  def test_good_type_names
    ArgCfg::TYPE_NAMES.each do |sym|
      assert @cfg.as(sym)
      assert_equal sym, @cfg.type_name
    end
  end

  def test_type_name_must_be_symbol
    assert_raises ConfigError do @cfg.as('string') end
  end

  def test_type_name_must_be_in_enum
    assert_raises ConfigError do @cfg.as(:bobo_type) end
  end

  def test_unsigned_int
    # default not ok.
    c = @opt_cfg.as(:unsigned_int).default(-1)
    assert c
    assert !c.valid?
    # default ok.  validate bobo.
    c = @opt_cfg.as(:unsigned_int).default(1).validate {|i| i < 0 }
    assert c
    assert !c.valid?
  end

  def test_positive_int
    # default not ok.
    c = @opt_cfg.as(:positive_int).default(0)
    assert c
    assert !c.valid?
    # default ok.  validate bobo.
    c = @opt_cfg.as(:positive_int).default(1).validate {|i| i < 1 }
    assert c
    assert !c.valid?
  end

  # munge
  def test_munge_can_be_block_or_proc_or_sym
    assert @cfg.munge {|i| i.abs }
    assert_equal Proc, @cfg.munger.class

    make_non_neg = lambda {|i| i.abs }
    assert @cfg.munge(make_non_neg)
    assert_equal Proc, @cfg.munger.class

    assert @cfg.munge(:abs)
    assert_equal Proc, @cfg.munger.class

    assert_raises ConfigError do @cfg.munge('odd?') end
  end

  def test_munge_should_have_arity_of_1
    assert @cfg.munge {|i| i.abs }
    assert_equal Proc, @cfg.munger.class
    assert_equal 1, @cfg.munger.arity

    # Block of wrong arity.
    assert_raises ConfigError do @cfg.munge {|a,b| a > b } end
    # Proc of wrong arity.
    is_bigger = lambda {|a,b| a > b }
    assert_raises ConfigError do @cfg.munge(is_bigger) end
  end

  def test_munge_cannot_provide_both_arg_and_block
    assert_raises ConfigError do @cfg.munge(:abs) {|i| i.abs } end
  end

  # must
  def test_must_can_be_block_or_proc_or_sym
    assert @cfg.validate {|i| i.odd? }
    is_odd = lambda {|i| i.odd? }
    assert @cfg.validate(is_odd)
    assert @cfg.validate(:odd?)

    assert_raises ConfigError do @cfg.validate('odd?') end
  end

  def test_that_validate_has_arity_of_1
    assert_raises ConfigError do @cfg.validate {|a,b| a > b } end
  end

  def test_that_validate_cannot_accept_both_arg_and_block
    assert_raises ConfigError do @cfg.validate(:odd) {|i| i.odd? } end
  end

  def test_that_validate_in_works
    assert @cfg.validate_in(1..3)
    assert @cfg.validate_in(['asc', 'desc'])
    assert_raises ::ArgumentError do @cfg.validate_in('asc', 'desc') end
  end

  # *no* default
  def test_required_may_not_have_default
    assert_raises NoMethodError do @cfg.default('bar') end
  end

  #-----------
  # optional

  def test_default_must_validate
    assert @opt_cfg.as(:int)
    assert @opt_cfg.default(0)
    assert @opt_cfg.validate {|i| i > 0 }
    assert !@opt_cfg.valid?

    assert @opt_cfg.default(1)
    assert @opt_cfg.valid?
  end

  def test_default_must_match_type
    assert @opt_cfg.as(:int)
    assert @opt_cfg.default('foo')
    assert !@opt_cfg.valid?

    assert @opt_cfg.default(0)
    assert @opt_cfg.valid?
  end

  def test_munge_does_not_impact_default
    assert @opt_cfg.as(:int)
    assert @opt_cfg.default(-2)
    assert @opt_cfg.munge(:abs)
    assert @opt_cfg.validate {|i| i >= 0 }
    assert !@opt_cfg.valid?

    assert @opt_cfg.default(+2)
    assert @opt_cfg.valid?
  end

end


text:
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Orchard.DisplayManagement;
using Orchard.DisplayManagement.Layout;
using Orchard.Environment.Navigation;

namespace Orchard.Admin
{
    public class AdminMenuFilter : IResultFilter
    {
        private readonly INavigationManager _navigationManager;
        private readonly ILayoutAccessor _layoutAccessor;
        private readonly IShapeFactory _shapeFactory;

        public AdminMenuFilter(INavigationManager navigationManager,
            ILayoutAccessor layoutAccessor,
            IShapeFactory shapeFactory)
        {

            _navigationManager = navigationManager;
            _layoutAccessor = layoutAccessor;
            _shapeFactory = shapeFactory;
        }

        public void OnResultExecuting(ResultExecutingContext filterContext)
        {
            // Should only run on a full view rendering result
            if (!(filterContext.Result is ViewResult))
            {
                return;
            }

            // Should only run on the Admin
            if (!AdminAttribute.IsApplied(filterContext.HttpContext))
            {
                return;
            }

            // Populate main nav
            IShape menuShape = _shapeFactory.Create("Navigation",
                Arguments.From(new
                {
                    MenuName = "admin",
                    RouteData = filterContext.RouteData,
                }));

            // Enable shape caching
            menuShape.Metadata
                .Cache("menu-admin")
                .AddContext("user.roles")
                .AddDependency("features")
                .AddDependency("types") // This should go in a Displaying Shape event in the Contents module
                ;

            _layoutAccessor.GetLayout().Navigation.Add(menuShape);

        }

        public void OnResultExecuted(ResultExecutedContext filterContext)
        {
        }
    }
}


text:
using System;
using System.ComponentModel.DataAnnotations;

namespace payroll.Models
{
	public enum Relationship
	{
		[Display(Name = "daughter")]
		Daughter = 0,

		[Display(Name = "son")]
		Son = 1,

		[Display(Name = "spouse")]
		Spouse = 2
	}
}


text:
package io.rainfall.unit;

import io.rainfall.Unit;

/**
 * @author Aurelien Broszniowski
 */
public class To extends UnitMeasurement {

  public static To to(int nb, Unit unit) {
    return new To(nb, unit);
  }

  public To(final int nb, final Unit unit) {
    super(nb, unit);
  }

  @Override
  public String getDescription() {
    return "to " + super.getDescription();
  }
}


text:
A set of tools which will make Brackets your favourite backend IDE.

> *Please note that this project is still in alpha. Feel free to report an issue or add a pull request!*

### Features
  - Smart autocompletion
  - Go to definition/assignment
  - Inline Python documentation
  - Linter

### Some screenshots
![autocompletion](screenshots/autocompletion.png)
*Python Autocompletion*

![linting](screenshots/lint.png)
*Linting via Flake8*

![docs](screenshots/docs.png)
*Inline documentation*

![settings](screenshots/settings.png)
*Settings dialog*

### Installation
You can install Python Tools from official Brackets Extension Registry.
Additionally, you'll need:
  - Python up and running (Python 3 preferably)
  - `flake8` module (optional) for linting and style checking. You may install it via pip:
    ```bash
    ~$ pip install flake8
    ```
  - `docutils` module (optional) for documentation rendering. It can be installed with pip:
    ```bash
    ~$ pip install docutils
    ```

### Usage
This Extension uses Python 3 interpreter in your path by default. You can customize interpreter either in Preferences File or in Python Tools Settings tab.

### Settings
Settings are accessible through standart brackets settings interface or 'File' menu 🡒 Python Tools Settings.

Currently available settings:
  - `pathToPython`: String

    Full path to python executable. Default value is `python`.
  - `isCaseSensitive`: Boolean

    If code completion should be case sensitive. Default is `true`.
  - `maxLineLength`: Number

    Maximum line length in Python files. Default: `79`.
  - `ignoredErrors`: Array

    Array of errors which should be ignored by Python Linter. Default: `[]`

### Credits
This project is based on the [Python Jedi Brackets](https://github.com/saravanan-k90/python-jedi-brackets) project.

### License
The source code is licensed MIT. See [LICENSE.md](LICENSE.md) for more.


text:
import { STRICT } from '../helpers/constants';

import join from 'core-js-pure/es/array/join';

QUnit.test('Array#join', assert => {
  assert.isFunction(join);
  assert.same(join([1, 2, 3], undefined), '1,2,3');
  assert.same(join('123'), '1,2,3');
  assert.same(join('123', '|'), '1|2|3');
  if (STRICT) {
    assert.throws(() => join(null), TypeError);
    assert.throws(() => join(undefined), TypeError);
  }
});


text:
namespace CodeGenerator;

public static class FeatureCollectionGenerator
{
    public static string GenerateFile(string namespaceName, string className, string[] allFeatures, string[] implementedFeatures, string extraUsings, string fallbackFeatures)
    {
        // NOTE: This list MUST always match the set of feature interfaces implemented by TransportConnection.
        // See also: src/Kestrel/Http/TransportConnection.FeatureCollection.cs
        var features = allFeatures.Select((type, index) => new KnownFeature
        {
            Name = type,
            Index = index
        });

        var s = $@"// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.

using System;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
{extraUsings}

#nullable enable

namespace {namespaceName}
{{
    internal partial class {className} : IFeatureCollection{Each(implementedFeatures, feature => $@",
                              {new string(' ', className.Length)}{feature}")}
    {{
        // Implemented features{Each(implementedFeatures, feature => $@"
        internal protected {feature}? _current{feature};")}{(allFeatures.Where(f => !implementedFeatures.Contains(f)).FirstOrDefault() is not null ? @"

        // Other reserved feature slots" : "")}{Each(allFeatures.Where(f => !implementedFeatures.Contains(f)), feature => $@"
        internal protected {feature}? _current{feature};")}

        private int _featureRevision;

        private List<KeyValuePair<Type, object>>? MaybeExtra;

        private void FastReset()
        {{{Each(implementedFeatures, feature => $@"
            _current{feature} = this;")}
{Each(allFeatures.Where(f => !implementedFeatures.Contains(f)), feature => $@"
            _current{feature} = null;")}
        }}

        // Internal for testing
        internal void ResetFeatureCollection()
        {{
            FastReset();
            MaybeExtra?.Clear();
            _featureRevision++;
        }}

        private object? ExtraFeatureGet(Type key)
        {{
            if (MaybeExtra == null)
            {{
                return null;
            }}
            for (var i = 0; i < MaybeExtra.Count; i++)
            {{
                var kv = MaybeExtra[i];
                if (kv.Key == key)
                {{
                    return kv.Value;
                }}
            }}
            return null;
        }}

        private void ExtraFeatureSet(Type key, object? value)
        {{
            if (value == null)
            {{
                if (MaybeExtra == null)
                {{
                    return;
                }}
                for (var i = 0; i < MaybeExtra.Count; i++)
                {{
                    if (MaybeExtra[i].Key == key)
                    {{
                        MaybeExtra.RemoveAt(i);
                        return;
                    }}
                }}
            }}
            else
            {{
                if (MaybeExtra == null)
                {{
                    MaybeExtra = new List<KeyValuePair<Type, object>>(2);
                }}
                for (var i = 0; i < MaybeExtra.Count; i++)
                {{
                    if (MaybeExtra[i].Key == key)
                    {{
                        MaybeExtra[i] = new KeyValuePair<Type, object>(key, value);
                        return;
                    }}
                }}
                MaybeExtra.Add(new KeyValuePair<Type, object>(key, value));
            }}
        }}

        bool IFeatureCollection.IsReadOnly => false;

        int IFeatureCollection.Revision => _featureRevision;

        object? IFeatureCollection.this[Type key]
        {{
            get
            {{
                object? feature = null;{Each(features, feature => $@"
                {(feature.Index != 0 ? "else " : "")}if (key == typeof({feature.Name}))
                {{
                    feature = _current{feature.Name};
                }}")}
                else if (MaybeExtra != null)
                {{
                    feature = ExtraFeatureGet(key);
                }}

                return feature{(string.IsNullOrEmpty(fallbackFeatures) ? "" : $" ?? {fallbackFeatures}?[key]")};
            }}

            set
            {{
                _featureRevision++;
{Each(features, feature => $@"
                {(feature.Index != 0 ? "else " : "")}if (key == typeof({feature.Name}))
                {{
                    _current{feature.Name} = ({feature.Name}?)value;
                }}")}
                else
                {{
                    ExtraFeatureSet(key, value);
                }}
            }}
        }}

        TFeature? IFeatureCollection.Get<TFeature>() where TFeature : default
        {{
            // Using Unsafe.As for the cast due to https://github.com/dotnet/runtime/issues/49614
            // The type of TFeature is confirmed by the typeof() check and the As cast only accepts
            // that type; however the Jit does not eliminate a regular cast in a shared generic.

            TFeature? feature = default;{Each(features, feature => $@"
            {(feature.Index != 0 ? "else " : "")}if (typeof(TFeature) == typeof({feature.Name}))
            {{
                feature = Unsafe.As<{feature.Name}?, TFeature?>(ref _current{feature.Name});
            }}")}
            else if (MaybeExtra != null)
            {{
                feature = (TFeature?)(ExtraFeatureGet(typeof(TFeature)));
            }}{(string.IsNullOrEmpty(fallbackFeatures) ? "" : $@"

            if (feature == null && {fallbackFeatures} != null)
            {{
                feature = {fallbackFeatures}.Get<TFeature>();
            }}")}

            return feature;
        }}

        void IFeatureCollection.Set<TFeature>(TFeature? feature) where TFeature : default
        {{
            // Using Unsafe.As for the cast due to https://github.com/dotnet/runtime/issues/49614
            // The type of TFeature is confirmed by the typeof() check and the As cast only accepts
            // that type; however the Jit does not eliminate a regular cast in a shared generic.

            _featureRevision++;{Each(features, feature => $@"
            {(feature.Index != 0 ? "else " : "")}if (typeof(TFeature) == typeof({feature.Name}))
            {{
                _current{feature.Name} = Unsafe.As<TFeature?, {feature.Name}?>(ref feature);
            }}")}
            else
            {{
                ExtraFeatureSet(typeof(TFeature), feature);
            }}
        }}

        private IEnumerable<KeyValuePair<Type, object>> FastEnumerable()
        {{{Each(features, feature => $@"
            if (_current{feature.Name} != null)
            {{
                yield return new KeyValuePair<Type, object>(typeof({feature.Name}), _current{feature.Name});
            }}")}

            if (MaybeExtra != null)
            {{
                foreach (var item in MaybeExtra)
                {{
                    yield return item;
                }}
            }}
        }}

        IEnumerator<KeyValuePair<Type, object>> IEnumerable<KeyValuePair<Type, object>>.GetEnumerator() => FastEnumerable().GetEnumerator();

        IEnumerator IEnumerable.GetEnumerator() => FastEnumerable().GetEnumerator();
    }}
}}
";

        return s;
    }

    static string Each<T>(IEnumerable<T> values, Func<T, string> formatter)
    {
        return values.Any() ? values.Select(formatter).Aggregate((a, b) => a + b) : "";
    }

    private sealed class KnownFeature
    {
        public string Name;
        public int Index;
    }
}


text:
from trajectory_web import get_app

app = get_app()


text:
Parses Prisma Cloud Compute vulnerability alerts. This is a default playbook.

## Dependencies
This playbook uses the following sub-playbooks, integrations, and scripts.

### Sub-playbooks
This playbook does not use any sub-playbooks.

### Integrations
This playbook does not use any integrations.

### Scripts
* PrismaCloudComputeParseVulnerabilityAlert

### Commands
This playbook does not use any commands.

## Playbook Inputs
---
There are no inputs for this playbook.

## Playbook Outputs
---
There are no outputs for this playbook.

## Playbook Image
---
![Prisma_Cloud_Compute_Vulnerability_Alert](https://raw.githubusercontent.com/demisto/content/1bdd5229392bd86f0cc58265a24df23ee3f7e662/docs/images/playbooks/Prisma_Cloud_Compute_Vulnerability_Alert.png)


text:
@interface TFCUser : PFUser <PFSubclassing>

@property (strong, nonatomic) NSString *name;
@property (strong, nonatomic) NSString *image_url;
@property (strong, nonatomic) NSString *uuidString;

@end


text:
#ifndef BOOST_HANA_FWD_ZIP_SHORTEST_HPP
#define BOOST_HANA_FWD_ZIP_SHORTEST_HPP

#include <hana/config.hpp>
#include <hana/core/when.hpp>

BOOST_HANA_NAMESPACE_BEGIN
    //! Zip one sequence or more.
    //! @ingroup group-Sequence
    //!
    //! Given `n` sequences `s1, ..., sn`, `zip_shortest` produces a sequence
    //! whose `i`-th element is a tuple of `(s1[i], ..., sn[i])`, where `sk[i]`
    //! denotes the `i`-th element of the `k`-th sequence. In other words,
    //! `zip_shortest` produces a sequence of the form
    //! @code
    //!     [
    //!         make_tuple(s1[0], ..., sn[0]),
    //!         make_tuple(s1[1], ..., sn[1]),
    //!         ...
    //!         make_tuple(s1[M], ..., sn[M])
    //!     ]
    //! @endcode
    //! where `M` is the length of the shortest sequence. Hence, the returned
    //! sequence stops when the shortest input sequence is exhausted. If you
    //! know that all the sequences you are about to zip have the same length,
    //! you should use `zip` instead, since it can be more optimized. Also
    //! note that it is an error to provide no sequence at all, i.e.
    //! `zip_shortest` expects at least one sequence.
    //!
    //!
    //! Example
    //! -------
    //! @include example/zip_shortest.cpp
#ifdef BOOST_HANA_DOXYGEN_INVOKED
    constexpr auto zip_shortest = [](auto&& x1, ..., auto&& xn) {
        return tag-dispatched;
    };
#else
    template <typename S, typename = void>
    struct zip_shortest_impl : zip_shortest_impl<S, when<true>> { };

    struct zip_shortest_t {
        template <typename Xs, typename ...Ys>
        constexpr auto operator()(Xs&& xs, Ys&& ...ys) const;
    };

    constexpr zip_shortest_t zip_shortest{};
#endif
BOOST_HANA_NAMESPACE_END

#endif // !BOOST_HANA_FWD_ZIP_SHORTEST_HPP


text:
require 'set'
require 'abstract_type'
require 'procto'
require 'concord'
require 'parser/all'
require 'parser/current'

# Library namespace
module Unparser

  EMPTY_STRING = ''.freeze

  EMPTY_ARRAY = [].freeze

  # Unparse an AST (and, optionally, comments) into a string
  #
  # @param [Parser::Node, nil] node
  # @param [Array] comment_array
  #
  # @return [String]
  #
  # @api private
  #
  def self.unparse(node, comment_array = [])
    node = Preprocessor.run(node)
    buffer = Buffer.new
    comments = Comments.new(comment_array)
    root = Emitter::Root.new(Parser::AST::Node.new(:root, [node]), buffer, comments)
    Emitter.emitter(node, root).write_to_buffer
    buffer.content
  end

end # Unparser

require 'unparser/buffer'
require 'unparser/node_helpers'
require 'unparser/preprocessor'
require 'unparser/comments'
require 'unparser/constants'
require 'unparser/dsl'
require 'unparser/ast'
require 'unparser/ast/local_variable_scope'
require 'unparser/emitter'
require 'unparser/emitter/literal'
require 'unparser/emitter/literal/primitive'
require 'unparser/emitter/literal/singleton'
require 'unparser/emitter/literal/dynamic'
require 'unparser/emitter/literal/regexp'
require 'unparser/emitter/literal/array'
require 'unparser/emitter/literal/hash'
require 'unparser/emitter/literal/range'
require 'unparser/emitter/literal/dynamic_body'
require 'unparser/emitter/literal/execute_string'
require 'unparser/emitter/send'
require 'unparser/emitter/send/unary'
require 'unparser/emitter/send/binary'
require 'unparser/emitter/send/index'
require 'unparser/emitter/send/regular'
require 'unparser/emitter/send/arguments'
require 'unparser/emitter/send/attribute_assignment'
require 'unparser/emitter/block'
require 'unparser/emitter/assignment'
require 'unparser/emitter/variable'
require 'unparser/emitter/splat'
require 'unparser/emitter/cbase'
require 'unparser/emitter/argument'
require 'unparser/emitter/begin'
require 'unparser/emitter/flow_modifier'
require 'unparser/emitter/undef'
require 'unparser/emitter/def'
require 'unparser/emitter/class'
require 'unparser/emitter/module'
require 'unparser/emitter/op_assign'
require 'unparser/emitter/defined'
require 'unparser/emitter/hookexe'
require 'unparser/emitter/super'
require 'unparser/emitter/retry'
require 'unparser/emitter/redo'
require 'unparser/emitter/if'
require 'unparser/emitter/alias'
require 'unparser/emitter/yield'
require 'unparser/emitter/binary'
require 'unparser/emitter/case'
require 'unparser/emitter/for'
require 'unparser/emitter/repetition'
require 'unparser/emitter/root'
require 'unparser/emitter/match'
require 'unparser/emitter/empty'
require 'unparser/emitter/flipflop'
require 'unparser/emitter/rescue'
require 'unparser/emitter/resbody'
require 'unparser/emitter/ensure'
# make it easy for zombie
require 'unparser/finalize'


text:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

  <modelVersion>4.0.0</modelVersion>

  <parent>
    <groupId>com.sap.mobile.platform.server.sample</groupId>
    <artifactId>com.sap.mobile.platform.server.sample.customization.persistence.jpa</artifactId>
    <version>130.8.0-SNAPSHOT</version>
  </parent>

  <groupId>com.sap.mobile.platform.server.sample</groupId>
  <artifactId>com.sap.mobile.platform.server.sample.customization.persistence.jpa.model</artifactId>
  <name>SAP Mobile Platform :: Server Samples :: Persistence - JPA - Model</name>
  <packaging>bundle</packaging>

  <properties>

    <eclipselink.version>2.4.2</eclipselink.version>
    <javax-persistence.version>2.0.4.v201112161009</javax-persistence.version>

  </properties>

  <build>
    <plugins>
      <!-- Create an OSGi Bundle Manifest -->
      <plugin>
        <groupId>org.apache.felix</groupId>
        <artifactId>maven-bundle-plugin</artifactId>
        <extensions>true</extensions>
        <configuration>
          <instructions>
            <manifestLocation>META-INF</manifestLocation>
            <Bundle-Category>persistence</Bundle-Category>
            <Bundle-Version>${project.version}</Bundle-Version>
            <Bundle-Name>${project.name}</Bundle-Name>
            <Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
            <Export-Package>
              com.sap.mobile.platform.server.sample.persistence.jpa.log,
              com.sap.mobile.platform.server.sample.persistence.jpa.model
            </Export-Package>
            <Private-Package>
            </Private-Package>
            <Import-Package>
              org.osgi.framework,
              javax.persistence;version="[2.0,3)",
              org.eclipse.persistence.logging,
              org.eclipse.persistence.indirection,
              org.slf4j,
              *
            </Import-Package>
            <Meta-Persistence>META-INF/persistence.xml</Meta-Persistence>
          </instructions>
        </configuration>
      </plugin>

      <plugin>
        <artifactId>maven-surefire-plugin</artifactId>
        <configuration>
          <includes>
            <include>**/**Test**</include>
          </includes>
          <excludes>
            <exclude>**/**Osgi**</exclude>
          </excludes>
        </configuration>
      </plugin>
    </plugins>
  </build>
  <dependencies>

    <dependency>
      <groupId>org.eclipse.persistence</groupId>
      <artifactId>javax.persistence</artifactId>
      <version>${javax-persistence.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.eclipse.persistence</groupId>
      <artifactId>eclipselink</artifactId>
      <version>${eclipselink.version}</version>
      <scope>provided</scope>
    </dependency>

    <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>com.springsource.slf4j.api</artifactId>
    </dependency>

  </dependencies>

</project>


text:
/** @file documentvaluelist.cc
 * @brief Iteration over values in a document.
 */
/* Copyright (C) 2008,2009,2011,2013 Olly Betts
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License as
 * published by the Free Software Foundation; either version 2 of the
 * License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 */

#include "config.h"

#include "xapian/api/documentvaluelist.h"

#include "xapian/backends/documentinternal.h"
#include "xapian/common/omassert.h"
#include "xapian/common/str.h"
#include "xapian/unicode/description_append.h"

#include "xapian/error.h"

using namespace std;

Xapian::docid
DocumentValueList::get_docid() const
{
    throw Xapian::InvalidOperationError("get_docid() isn't valid when iterating over values in a document");
}

Xapian::valueno
DocumentValueList::get_valueno() const
{
    Assert(!at_end());
    return it->first;
}

string
DocumentValueList::get_value() const
{
    Assert(!at_end());
    return it->second;
}

bool
DocumentValueList::at_end() const
{
    return it == doc->values->end();
}

void
DocumentValueList::next()
{
    if (it == doc->values->end()) {
	it = doc->values->begin();
    } else {
	++it;
    }
}

void
DocumentValueList::skip_to(Xapian::docid slot)
{
    it = doc->values->lower_bound(slot);
}

string
DocumentValueList::get_description() const
{
    string desc = "DocumentValueList(";
    if (!at_end()) {
	desc += "slot=";
	desc += str(get_valueno());
	desc += ", value=\"";
	description_append(desc, get_value());
	desc += "\")";
    } else {
	desc += "atend)";
    }
    return desc;
}


text:
<VerticalLayout captionMaArgin="0" width="90%" margin="true">
  <ValidationSettings withAttach="false" withApply="true" withPrint="false" />
  <Label value="Document Type" style="H2" />
  <HorizontalLayout captionMargin="0" spacing="true">
	  <GuiField name="NAME" caption="Name" editable="true" width="200px"/>
	  <GuiField name="CAPTION" caption="Caption" editable="true" width="400px"/>
  </HorizontalLayout>
  <!-- IncludeXML name="DOC_TYPE_ACCESS_TABLE" dataPath="DOC_TYPE_ACCESS_LIST" storage="DOC_TYPE_ACCESS" type="table" / -->

  <!-- <GuiTable name="DOC_TYPE_ACCESS_TABLE" dataPath="DOC_TYPE_ACCESS_LIST" caption="Document Access" captionMargin="0" width="100%" height="-1px" addEnabled="true" inLineEditable="true">
    <TableColumn name="DOC_RIGHTS_GROUP_NAME" dataPath="DOC_RIGHTS_GROUP" captionProperty="NAME" caption="Doc. Right Group Name" editable="true" />
    <TableColumn name="ACCESS_RIGHT" caption="Access Right" editable="true" />
  </GuiTable> -->

  <HorizontalLayout captionMargin="false" margin="0" spacing="true" height="100%" width="90%">

    <VerticalLayout captionMargin="0" spacing="true" width="450px">
	    <TableGrid title="Document Type Access" name="NOT_SELECTED_GROUPS_LIST_TABLE" dataPath="SOURCE_LIST" width="100%" height="100%" addEnabled="true" deleteEnabled="false" alignment="left" gridSelectionMode="Multi" refreshEnabled="false">
	      <TableColumn name="NAME" caption="Doc. Right Group Name" editable="true" />
	    </TableGrid>
    </VerticalLayout>

    <VerticalLayout width="100px" alignment="center" spacing="true">
      <Label value=" " width="100px" height="44px"/>
      <Button name="ADD_BUTTON" caption="Add >" width="100px"/>
      <Button name="REMOVE_BUTTON" caption="$P{LT} Remove" width="100px"/>
    </VerticalLayout>

    <VerticalLayout captionMargin="0" spacing="true" width="450px">
	    <TableGrid title="Document Type Access Rights" name="DOC_TYPE_ACCESS_TABLE" dataPath="DOC_TYPE_ACCESS_LIST" height="100%" width="100%" addEnabled="false" deleteEnabled="false" alignment="right" refreshEnabled="false" gridSelectionMode="Multi" >
	      <TableColumn name="DOC_RIGHTS_GROUP" captionProperty="NAME" caption="Doc. Right Group Name" editable="true" />
	      <TableColumn name="ACCESS_RIGHT" caption="Access Right" editable="true" />
	    </TableGrid>
    </VerticalLayout>

  </HorizontalLayout>

</VerticalLayout>


text:
<?php

namespace common\models;

/**
 * This is the ActiveQuery class for [[ServiceBooking]].
 *
 * @see ServiceBooking
 */
class ServiceBookingQuery extends \yii\db\ActiveQuery
{
    /**
     * @return ServiceBookingQuery
     */
    public function active()
    {
        return $this->andWhere('[[active]]=1');
    }

    /**
     * @inheritdoc
     * @return ServiceBooking[]|array
     */
    public function all($db = null)
    {
        return parent::all($db);
    }

    /**
     * @inheritdoc
     * @return ServiceBooking|array|null
     */
    public function one($db = null)
    {
        return parent::one($db);
    }
}


text:
package org.apache.helix.integration.task;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import com.google.common.collect.Sets;
import org.apache.helix.ExternalViewChangeListener;
import org.apache.helix.NotificationContext;
import org.apache.helix.PropertyKey;
import org.apache.helix.TestHelper;
import org.apache.helix.model.ExternalView;
import org.apache.helix.task.JobConfig;
import org.apache.helix.task.JobQueue;
import org.apache.helix.task.TaskState;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testng.Assert;
import org.testng.annotations.Test;

public class TestDisableJobExternalView extends TaskTestBase {
  private static final Logger LOG = LoggerFactory.getLogger(TestDisableJobExternalView.class);

  /**
   * This test is no longer valid since Helix no longer computes ExternalView for Task Framework
   * resources. Contexts effectively serve as ExternalView for task resources.
   * **This test has been modified to test that there are no job-related resources appearing in
   * ExternalView**
   * @throws Exception
   */
  @Test
  public void testJobsDisableExternalView() throws Exception {
    String queueName = TestHelper.getTestMethodName();

    ExternviewChecker externviewChecker = new ExternviewChecker();
    _manager.addExternalViewChangeListener(externviewChecker);

    // Create a queue
    LOG.info("Starting job-queue: " + queueName);
    JobQueue.Builder queueBuilder = TaskTestUtil.buildJobQueue(queueName);

    JobConfig.Builder job1 = new JobConfig.Builder().setCommand(MockTask.TASK_COMMAND)
        .setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB)
        .setTargetPartitionStates(Sets.newHashSet("SLAVE"));

    JobConfig.Builder job2 = new JobConfig.Builder().setCommand(MockTask.TASK_COMMAND)
        .setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB)
        .setTargetPartitionStates(Sets.newHashSet("SLAVE")).setDisableExternalView(true);

    JobConfig.Builder job3 = new JobConfig.Builder().setCommand(MockTask.TASK_COMMAND)
        .setTargetResource(WorkflowGenerator.DEFAULT_TGT_DB)
        .setTargetPartitionStates(Sets.newHashSet("MASTER")).setDisableExternalView(false);

    // enqueue jobs
    queueBuilder.enqueueJob("job1", job1);
    queueBuilder.enqueueJob("job2", job2);
    queueBuilder.enqueueJob("job3", job3);

    _driver.createQueue(queueBuilder.build());

    // ensure all jobs are completed
    String namedSpaceJob3 = String.format("%s_%s", queueName, "job3");
    _driver.pollForJobState(queueName, namedSpaceJob3, TaskState.COMPLETED);

    Set<String> seenExternalViews = externviewChecker.getSeenExternalViews();
    String namedSpaceJob1 = String.format("%s_%s", queueName, "job1");
    String namedSpaceJob2 = String.format("%s_%s", queueName, "job2");

    Assert.assertTrue(!seenExternalViews.contains(namedSpaceJob1),
        "ExternalView found for " + namedSpaceJob1 + ". Jobs shouldn't be in EV!");
    Assert.assertTrue(!seenExternalViews.contains(namedSpaceJob2),
        "External View for " + namedSpaceJob2 + " shoudld not exist!");
    Assert.assertTrue(!seenExternalViews.contains(namedSpaceJob3),
        "ExternalView found for " + namedSpaceJob3 + ". Jobs shouldn't be in EV!");

    _manager
        .removeListener(new PropertyKey.Builder(CLUSTER_NAME).externalViews(), externviewChecker);
  }

  private static class ExternviewChecker implements ExternalViewChangeListener {
    private Set<String> _seenExternalViews = new HashSet<String>();

    @Override public void onExternalViewChange(List<ExternalView> externalViewList,
        NotificationContext changeContext) {
      for (ExternalView view : externalViewList) {
        _seenExternalViews.add(view.getResourceName());
      }
    }

    public Set<String> getSeenExternalViews() {
      return _seenExternalViews;
    }
  }
}


text:
LibCNF (the Conjunctive Normal Form formula solving LIBrary)        {#mainpage}
============================================================

## Install ##

On linux, run the following command from the install directory:

    mkdir build
    cmake ..
    make
    sudo make install

## Usage ##

Simply include the header in your code and link the library during the compilation. **Warning!** This library uses the `std::initializer_list ` template so it requires the C++11 standard. Simply add `-lLibCNF -std=gnu++11` to your compilation line to take care of everything.

## Test ##

Compile the `test.cpp` in the `test` directory with `g++ test.cpp -o test -std=gnu++11 -lLibCNF` and then run the test with `./test`.

<!-- !CONTINUE! Write README. -->


text:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using unvell.ReoGrid.CellTypes;

namespace unvell.ReoGrid.Tests
{
	class TestCellBody : CellBody
	{
		public bool initialized = false;

		public override void OnSetup(Cell cell)
		{
			// set flag to specify that OnSetup method has been called actually
			this.initialized = true;
		}

		public override object OnSetData(object data)
		{
			// test for return an edited data
			return "(" + data + ")";
		}

		public bool editRequired = false;

		public override bool OnStartEdit()
		{
			// set flag to specify that editing operation has been called actually
			editRequired = true;

			// return false to stop editing operation
			return false;
		}
	}

	[TestSet]
	class CustomCellTest : ReoGridTestSet
	{
		[TestCase]
		void SetAndRemove()
		{
			SetUp();

			// create customize cell body for test
			var testCell = new TestCellBody();

			// apply this body to cell 1,1
			worksheet[1, 1] = testCell;

			// check the cell body whether it is inside the cell
			AssertEquals(worksheet.GetCell(1, 1).Body, testCell);

			// check flag to test whether OnSetup method has been called actually
			AssertEquals(testCell.initialized, true);

			// remove the cell body
			worksheet.RemoveCellBody(1, 1);

			// check body that must be not there
			AssertEquals(worksheet.GetCell(1, 1).Body, null);
		}

		[TestCase]
		void DataEdit()
		{
			var testCell = new TestCellBody();
			worksheet[1, 2] = testCell;

			// set data, this should triggers the OnSetData method of body
			worksheet[1, 2] = "abc";

			// check data that has been edited by cell body atucally
			AssertEquals(worksheet[1, 2], "(abc)");
		}

		[TestCase]
		void StopEdit()
		{
			var testCell = new TestCellBody();

			worksheet[1, 3] = testCell;
			worksheet.StartEdit(1, 3);

			// grid must be not in editing mode
			AssertEquals(worksheet.IsEditing, false);

			// edit-required flag must be set to true
			AssertEquals(testCell.editRequired, true);

		}
	}

}


text:
package com.dwolla.circe

import io.circe._
import io.circe.generic.extras.Configuration
import io.circe.{ DecodingFailure, Json }
import shapeless._
import shapeless.labelled.{ field, FieldType }

object EnumerationSnakeCodec extends EnumerationSnakeCodec

/** This is mainly copied from Circe's [[io.circe.generic.extras.encoding.EnumerationEncoder]] and
  * [[io.circe.generic.extras.decoding.EnumerationDecoder]], but since they're not configurable
  * to use snake_case for the named values, this version applies the
  * [[io.circe.generic.extras.Configuration.snakeCaseTransformation]] function to the names
  * during encoding and decoding.
  */
trait EnumerationSnakeCodec {
  abstract class EnumerationSnakeEncoder[A] extends Encoder[A]
  abstract class EnumerationSnakeDecoder[A] extends Decoder[A]

  implicit val encodeEnumerationCNil: EnumerationSnakeEncoder[CNil] = _ => sys.error("Cannot encode CNil")

  implicit def encodeEnumerationCCons[K <: Symbol, V, R <: Coproduct](implicit
                                                                      wit: Witness.Aux[K],
                                                                      gv: LabelledGeneric.Aux[V, HNil],
                                                                      dr: EnumerationSnakeEncoder[R]
                                                                     ): EnumerationSnakeEncoder[FieldType[K, V] :+: R] = x => {
    val _ = gv
    x match {
      case Inl(_) => Json.fromString(Configuration.snakeCaseTransformation(wit.value.name))
      case Inr(r) => dr(r)
    }
  }

  implicit def encodeEnumeration[A, Repr <: Coproduct](implicit
                                                       gen: LabelledGeneric.Aux[A, Repr],
                                                       rr: EnumerationSnakeEncoder[Repr]
                                                      ): EnumerationSnakeEncoder[A] =
    a => rr(gen.to(a))

  def deriveEnumerationSnakeEncoder[A](implicit encode: Lazy[EnumerationSnakeEncoder[A]]): Encoder[A] = encode.value

  implicit val decodeEnumerationCNil: EnumerationSnakeDecoder[CNil] =
    c => Left(DecodingFailure("Enumeration", c.history))

  implicit def decodeEnumerationCCons[K <: Symbol, V, R <: Coproduct](implicit
                                                                      wit: Witness.Aux[K],
                                                                      gv: LabelledGeneric.Aux[V, HNil],
                                                                      dr: EnumerationSnakeDecoder[R]
                                                                     ): EnumerationSnakeDecoder[FieldType[K, V] :+: R] =
    c => c.as[String] match {
      case Right(s) if s == Configuration.snakeCaseTransformation(wit.value.name) => Right(Inl(field[K](gv.from(HNil))))
      case Right(_) => dr.apply(c).map(Inr(_))
      case Left(_) => Left(DecodingFailure("Enumeration", c.history))
    }

  implicit def decodeEnumeration[A, Repr <: Coproduct](implicit
                                                       gen: LabelledGeneric.Aux[A, Repr],
                                                       rr: EnumerationSnakeDecoder[Repr]
                                                      ): EnumerationSnakeDecoder[A] =
    rr(_).map(gen.from)

  def deriveEnumerationSnakeDecoder[A](implicit decode: Lazy[EnumerationSnakeDecoder[A]]): Decoder[A] = decode.value
}


text:
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">

    <group android:checkableBehavior="single">
        <item
            android:id="@+id/nav_camera"
            android:icon="@drawable/ic_menu_camera"
            android:title="Import" />
        <item
            android:id="@+id/nav_gallery"
            android:icon="@drawable/ic_menu_gallery"
            android:title="Gallery" />
        <item
            android:id="@+id/nav_slideshow"
            android:icon="@drawable/ic_menu_slideshow"
            android:title="Slideshow" />
        <item
            android:id="@+id/nav_manage"
            android:icon="@drawable/ic_menu_manage"
            android:title="Tools" />
        <item
            android:id="@+id/action_settings"
            android:orderInCategory="100"
            android:icon="@drawable/ic_menu_send"
            android:title="@string/action_settings"
            app:showAsAction="never" />
    </group>

    <item android:title="Communicate">
        <menu>
            <item
                android:id="@+id/nav_share"
                android:icon="@drawable/ic_menu_share"
                android:title="Share" />
            <item
                android:id="@+id/nav_send"
                android:icon="@drawable/ic_menu_send"
                android:title="Connect" />
        </menu>
    </item>

</menu>


text:
<?php

namespace app\controllers;

use Yii;
use app\models\Message;
use yii\data\ActiveDataProvider;
use yii\web\Controller;
use yii\web\NotFoundHttpException;
use yii\filters\VerbFilter;
use yii\helpers\Url;

/**
 * MessageController implements the CRUD actions for Message model.
 */
class MessageController extends CommonController
{
    public $loyout = 'main';
    public $title;
    public function init() {
        parent::init();
        $this->title = '通知';
        //视图中使用 ·· $this->context->title;
    }
    /**
     * Lists all Message models.
     * @return mixed
     */
    public function actionIndex()
    {
       $model  = Message::find()->where(['user_id'=>Yii::$app->session['user_id'],'type'=>1])->OrderBy(['create_time'=>SORT_DESC,'type'=>SORT_ASC])->all();
        return $this->render('index',['model'=>$model]);
    }

      public function actionMessage()
    {
        $request = Yii::$app->request;
        //用户留言
        if($request->isPost){
            if(empty($request->post())) go_back('图片上传大小不能超过1M');
            $model = new Message();
             $user_id  =  $request->post('target_id');
             foreach($_FILES as $key=>$val){
             if($_FILES[$key]['name']){

                $res = uploads($key);
                $data[$key] = $res;
                }
            }
            if(isset($data)) $model->img = $data['url'];
            if($user_id  == 0){
                //为管理员留言
                $model->target_id = 0;
                $model->user_id =  yii::$app->session['user_id'];
            }else{
                //为用户留言
                $model->type = 1;
                $model->user_id   = $user_id;
                $model->target_id = yii::$app->session['user_id'];
            }
            $content  =  $request->post('content');
            $model->content = $content;
            $model->create_time = time();
            if($model->save()){
                 js_location(Url::toRoute('message/index'),'留言成功');
            }else{
                js_alert('留言失败');return;
            }
        }else{
           //留言详情
            if($request->isGet){
                $mess_id  = $request->get('mess_id');
                $model =  Message::findOne(['mess_id'=>$mess_id]);
                $model->error_type = '2';
                $model->save();
                $count  = Message::find()->where(['type'=>1,'user_id'=>yii::$app->session['user_id']])->andWhere(['!=','error_type','2'])->count();
                Yii::$app->session['count']  = $count;
                return $this->render('message',['model'=>$model]);
            }
        }
    }
}


text:
package com.github.kmizu.yapp.runtime;

/**
 * This class represents a location in a source file.
 * line and column are both 1 origin.
 * @author Kouta Mizushima
 *
 */
public class Location {
  private final int line;
  private final int column;

  /**
   * Creates an object which represents location in a source file.
   * @param line line number (>= 1)
   * @param column column number (>= 1)
   */
  public Location(int line, int column) {
    this.line = line;
    this.column = column;
  }

  /**
   * Gets line number.
   * @return line number
   */
  public int getLine() {
    return line;
  }

  /**
   * Gets column number.
   * @return column number
   */
  public int getColumn() {
    return column;
  }

  @Override
  public String toString() {
    return line + ":" + column;
  }
}