text:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.dumu.housego"
    android:versionCode="13"
    android:versionName="1.5">

    <uses-sdk
        android:minSdkVersion="17"
        android:targetSdkVersion="23" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
    <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
    <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>

    <!-- 访问网络,网络定位需要上网 -->
    <!-- SD卡读取权限,用户写入离线定位数据 -->
    <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
    <uses-permission android:name="android.permission.CAMERA" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
    <uses-permission android:name="com.android.launcher.permission.READ_SETTINGS" />
    <uses-permission android:name="android.permission.WAKE_LOCK" />
    <uses-permission android:name="android.permission.GET_TASKS" />
    <uses-permission android:name="android.permission.CALL_PHONE" />
    <uses-permission android:name="android.permission.WRITE_SETTINGS" />

    <application
        android:name=".app.HouseGoApp"
        android:allowBackup="true"
        android:icon="@drawable/appicon_512"
        android:label="@string/app_name"
        android:largeHeap="true"
        android:theme="@style/AppTheme"
        tools:replace="android:label">
        <meta-data
            android:name="com.baidu.lbsapi.API_KEY"
            android:value="gaZhYGfkm5cAGetBtV4it8GZ73IWpTXX" />

        <service
            android:name="com.baidu.location.f"
            android:enabled="true"
            android:process=":remote"></service>
        <!-- 这个权限用于进行网络定位-->
        <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>
        <!-- 这个权限用于访问GPS定位-->
        <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
        <!-- 用于访问wifi网络信息,wifi信息会用于进行网络定位-->
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"></uses-permission>
        <!-- 获取运营商信息,用于支持提供运营商信息相关的接口-->
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"></uses-permission>
        <!-- 这个权限用于获取wifi的获取权限,wifi信息会用来进行网络定位-->
        <uses-permission android:name="android.permission.CHANGE_WIFI_STATE"></uses-permission>
        <!-- 用于读取手机当前的状态-->
        <uses-permission android:name="android.permission.READ_PHONE_STATE"></uses-permission>
        <!-- 写入扩展存储,向扩展卡写入数据,用于写入离线定位数据-->
        <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"></uses-permission>
        <!-- 访问网络,网络定位需要上网-->
        <uses-permission android:name="android.permission.INTERNET" />
        <!-- SD卡读取权限,用户写入离线定位数据-->
        <uses-permission android:name="android.permission.MOUNT_UNMOUNT_FILESYSTEMS"></uses-permission>
        <activity
            android:name="com.alipay.sdk.app.H5PayActivity"
            android:configChanges="orientation|keyboardHidden|navigation"
            android:exported="false"
            android:screenOrientation="behind"></activity>
        <activity
            android:name="com.alipay.sdk.auth.AuthActivity"
            android:configChanges="orientation|keyboardHidden|navigation"
            android:exported="false"
            android:screenOrientation="behind"></activity>
        <activity
            android:name=".activity.MainActivity"
            android:label="@string/app_name"
            android:launchMode="singleTop"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize|adjustNothing"></activity>
        <activity
            android:name=".activity.LoginActivity"
            android:label="@string/title_activity_login"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".activity.RegistActivity"
            android:label="@string/title_activity_regist"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ErShouFangMainActivity"
            android:label="@string/title_activity_er_shou_fang_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".NewHouseMainActivity"
            android:label="@string/title_activity_new_house_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".RentingMainActivity"
            android:label="@string/title_activity_renting_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".AgentMainActivity"
            android:label="@string/title_activity_agent_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ProprietorMainActivity"
            android:label="@string/title_activity_proprietor_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".BlockTradeMainActivity"
            android:label="@string/title_activity_block_trade_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".MapHouseMainActivity"
            android:label="@string/title_activity_map_house_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".HousePuchaseMainActivity"
            android:label="@string/title_activity_house_puchase_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".WelcomeMainActivity"
            android:label="@string/title_activity_welcome_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity
            android:name=".WapRecommedMainActivity"
            android:label="@string/title_activity_web_recommed_news_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".MySettingMainActivity"
            android:label="@string/title_activity_my_setting_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".PersonalMainActivity"
            android:label="@string/title_activity_personal_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".FindPasswordMainActivity"
            android:label="@string/title_activity_find_password_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".RentingProprietorActivity"
            android:label="@string/title_activity_renting_proprietor"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ErshouFangProprietorActivity"
            android:label="@string/title_activity_ershou_fang_proprietor"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".BlockTradeDetailActivity"
            android:label="@string/title_activity_web_er_sshou_fang_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".AgentChangeUserInfoActivity"
            android:label="@string/title_activity_change_user_info"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".MyRentingHouseAgentActivity"
            android:label="@string/title_activity_my_renting_house"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".WebHousePriceDetailActivity"
            android:label="@string/title_activity_web_house_price_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ErShouFangDetailsActivity"
            android:exported="true"
            android:label="@string/title_activity_er_shou_fang_details"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ErShouDaikanActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".ErShouChengjiaoActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".RentingChengjiaoActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".NewHouseListActivity"
            android:label="@string/title_activity_new_house_list"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".NewHouseDetailActivity"
            android:label="@string/title_activity_new_house_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize|adjustNothing"></activity>
        <activity
            android:name=".RentingDetailActivity"
            android:label="@string/title_activity_renting_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".AgentDetailActivity"
            android:label="@string/title_activity_agent_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".PuTongMyGuanZhuActivity"
            android:label="@string/title_activity_pu_tong_my_guan_zhu"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".BaiduMapActivity"
            android:label="@string/title_activity_baidu_map"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".GetLocationActivity"
            android:label="@string/title_activity_get_location"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".AgentPersonalActivity"
            android:label="@string/title_activity_agent_personal"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"
            android:windowSoftInputMode="stateHidden|adjustResize"></activity>
        <activity
            android:name=".SubmitEdittextActivity"
            android:label="@string/title_activity_submit_edittext"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".SearchActivity"
            android:label="@string/title_activity_search"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".ShowAgentDataActivity"
            android:label="@string/title_activity_show_agent_data"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="activity.AlbumActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="activity.GalleryActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="activity.ImageFile"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="activity.ShowAllPhoto"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".activity.ImageGrallyMain"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".activity.ImageGrallyMain2"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".HouseAllDetailsActivity"
            android:label="@string/title_activity_house_all_details"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".SearchMainActivity"
            android:label="@string/title_activity_search_main"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".ErShouAllDetailActivity"
            android:label="@string/title_activity_er_shou_all_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".RentingAllDetailActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="util.BigPicActivity"
            android:label="@string/title_activity_er_shou_all_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".LiuYanDetailActivity"
            android:label="@string/title_activity_liu_yan_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".utils.SelectionActivity"
            android:label="@string/title_activity_liu_yan_detail"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".utils.SelectionActivity2"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="com.example.testpic.BitmapCache"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="com.example.testpic.ImageGridActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="com.example.testpic.PhotoActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="com.example.testpic.PublishedActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name="com.example.testpic.TestPicActivity"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
        <activity
            android:name=".NewMoreActivity"
            android:label="@string/title_activity_new_more"
            android:theme="@android:style/Theme.Holo.Light.NoActionBar"></activity>
    </application>

</manifest>


text:
package twilightforest.entity.ai;

import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLiving;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.ai.EntityLookHelper;
import net.minecraft.pathfinding.PathNavigate;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import twilightforest.entity.EntityTFRedcap;

public class EntityAITFAvoidFrontalAttack extends net.minecraft.entity.ai.EntityAIBase
{
  EntityLivingBase entityTarget;
  EntityLiving me;
  float speed;
  boolean lefty;
  double xPosition;
  double yPosition;
  double zPosition;
  double minDistance = 3.0D;
  double maxDistance = 6.0D;

  public EntityAITFAvoidFrontalAttack(EntityTFRedcap entityTFRedcap, float moveSpeed) {
    me = entityTFRedcap;
    speed = moveSpeed;
    lefty = me.field_70170_p.field_73012_v.nextBoolean();
    func_75248_a(1);
  }

  public boolean func_75250_a()
  {
    EntityLivingBase attackTarget = me.func_70638_az();

    if ((attackTarget == null) || (attackTarget.func_70032_d(me) > maxDistance) || (attackTarget.func_70032_d(me) < minDistance) || (!isTargetLookingAtMe(attackTarget))) {
      return false;
    }

    entityTarget = attackTarget;
    Vec3 avoidPos = findCirclePoint(me, entityTarget, 5.0D, lefty ? 1.0D : -1.0D);

    if (avoidPos == null)
    {
      return false;
    }

    xPosition = field_72450_a;
    yPosition = field_72448_b;
    zPosition = field_72449_c;
    return true;
  }

  public void func_75249_e()
  {
    me.func_70661_as().func_75492_a(xPosition, yPosition, zPosition, speed);
  }

  public boolean func_75253_b()
  {
    EntityLivingBase attackTarget = me.func_70638_az();

    if (attackTarget == null) {
      return false;
    }
    if (!entityTarget.func_70089_S()) {
      return false;
    }
    if (me.func_70661_as().func_75500_f()) {
      return false;
    }

    boolean shouldContinue = (attackTarget.func_70032_d(me) < maxDistance) && (attackTarget.func_70032_d(me) > minDistance) && (isTargetLookingAtMe(attackTarget));

    return shouldContinue;
  }

  public void func_75246_d()
  {
    me.func_70671_ap().func_75651_a(entityTarget, 30.0F, 30.0F);
  }

  public void func_75251_c()
  {
    entityTarget = null;
    me.func_70661_as().func_75499_g();
  }

  protected Vec3 findCirclePoint(Entity circler, Entity toCircle, double radius, double rotation)
  {
    double vecx = field_70165_t - field_70165_t;
    double vecz = field_70161_v - field_70161_v;
    float rangle = (float)Math.atan2(vecz, vecx);

    rangle = (float)(rangle + rotation);

    double dx = MathHelper.func_76134_b(rangle) * radius;
    double dz = MathHelper.func_76126_a(rangle) * radius;

    return Vec3.func_72443_a(field_70165_t + dx, field_70121_D.field_72338_b, field_70161_v + dz);
  }

  public boolean isTargetLookingAtMe(EntityLivingBase attackTarget)
  {
    double dx = me.field_70165_t - field_70165_t;
    double dz = me.field_70161_v - field_70161_v;
    float angle = (float)(Math.atan2(dz, dx) * 180.0D / 3.1415927410125732D) - 90.0F;

    float difference = MathHelper.func_76135_e((field_70177_z - angle) % 360.0F);

    return (difference < 60.0F) || (difference > 300.0F);
  }
}

redpajama_set_name: RedPajamaGithub


text:
<?php

namespace Tarampampam\LaravelDatabaseQueriesProfiler\Tests;

use Tarampampam\LaravelDatabaseQueriesProfiler\DatabaseQueriesProfiler;
use Tarampampam\LaravelDatabaseQueriesProfiler\DatabaseQueriesProfilerFacade;
use Tarampampam\LaravelDatabaseQueriesProfiler\DatabaseQueriesProfilerServiceProvider;

/**
 * Class ServiceProviderTest.
 */
class ServiceProviderTest extends AbstractUnitTestCase
{
    /**
     * Tests service-provider loading.
     */
    public function testServiceProviderLoading()
    {
        $this->assertInstanceOf(DatabaseQueriesProfiler::class, $this->app['DatabaseQueriesProfiler']);
        $this->assertInstanceOf(DatabaseQueriesProfiler::class, $this->app[DatabaseQueriesProfiler::class]);
        $this->assertInstanceOf(DatabaseQueriesProfiler::class, app('DatabaseQueriesProfiler'));
        $this->assertInstanceOf(DatabaseQueriesProfiler::class, app(DatabaseQueriesProfiler::class));
    }

    /**
     * Test accessible from facade.
     */
    public function testAccessibleFromFacade()
    {
        $this->assertInstanceOf(DatabaseQueriesProfiler::class, DatabaseQueriesProfilerFacade::instance());
    }

    /**
     * Test default configs values.
     */
    public function testDefaultConfigValues()
    {
        $config = config(DatabaseQueriesProfilerServiceProvider::getConfigRootKeyName());

        $this->assertTrue(is_bool($config['enabled']));
        $this->assertTrue(is_string($config['storage']['use']));

        $this->assertTrue(is_bool($config['top']['enabled']));
        $this->assertTrue(is_int($config['top']['size']));
        $this->assertTrue(is_int($config['top']['lifetime']));
        $this->assertTrue(is_bool($config['top']['exclude']['enabled']));
        $this->assertTrue(is_array($config['top']['exclude']['list']));

        $this->assertTrue(is_bool($config['counters']['enabled']));

        $this->assertTrue(is_bool($config['logging']['queries']['all']['enabled']));
        $this->assertTrue(is_string($config['logging']['queries']['all']['level']));
    }
}


text:
<?php
$options = (array)get_option('jcg_about_options');
$bio = !empty($options['bio']) ? $options['bio'] : '';

$settings = array(
	'media_buttons' => false,
	'textarea_name' => 'jcg_about_options[bio]'
);
wp_editor($bio, 'jcg_about_options_bio', $settings);


text:
package blackberry.invoke.mapsArguments;

import blackberry.core.ScriptField;
import blackberry.core.ScriptableObjectBase;
import blackberry.pim.address.AddressObject;

/**
 * This class represents the MapsArgumentsObject
 *
 * @author sgolod
 *
 */
public class MapsArgumentsObject extends ScriptableObjectBase {

    private final double _latitude;
    private final double _longitude;
    private final AddressObject _addessObject;
    private final String _xml;
    private final boolean _default;

    /**
     * Default constructor, constructs a new MapsArgumentsObject object.
     */
    public MapsArgumentsObject() {
        _default = true;
        _latitude = 0;
        _longitude = 0;
        _addessObject = null;
        _xml = null;
    }

    /**
     * Constructs a new MapsArgumentsObject object.
     *
     * @param latitude
     *            Specifies the latitude for display.
     * @param longitude
     *            Specifies the longitude for display.
     */
    public MapsArgumentsObject( final double latitude, final double longitude ) {
        _default = false;
        _latitude = latitude;
        _longitude = longitude;
        _addessObject = null;
        _xml = null;
    }

    /**
     * Constructs a new MapsArgumentsObject object.
     *
     * @param a
     *            Address for display in Map application.
     */
    public MapsArgumentsObject( final AddressObject a ) {
        _default = false;
        _latitude = 0;
        _longitude = 0;
        _addessObject = a;
        _xml = null;
    }

    /**
     * Constructs a new MapsArgumentsObject object.
     *
     * @param x
     *            XML document contains map information.
     */
    public MapsArgumentsObject( final String x ) {
        _default = false;
        _latitude = 0;
        _longitude = 0;
        _addessObject = null;
        _xml = x;
    }

    /**
     * @see blackberry.core.ScriptableObjectBase#verify(blackberry.core.ScriptField, java.lang.Object)
     */
    protected boolean verify( final ScriptField field, final Object newValue ) throws Exception {
        return true;
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return the contained Document Object.
     */
    public String getXML() {
        return _xml;
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return latitude value.
     */
    public double getLatitude() {
        return _latitude;
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return longitude value.
     */
    public double getLongitude() {
        return _longitude;
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return the address of the location.
     */
    public String getAddress() {
        if( _addessObject == null ) {
            return null;
        }

        return _addessObject.toString();
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return the address object of the location.
     */
    public AddressObject getAddressObject() {
        return _addessObject;
    }

    /**
     * Internal helper method to get direct access to the MapsArgumentsObject's underlying content.
     *
     * @return whether there is no location specified
     */
    public boolean isDefault() {
        return _default;
    }
}


text:
package org.ovirt.engine.core.bll.storage;

import java.util.List;

import org.ovirt.engine.core.bll.Backend;
import org.ovirt.engine.core.bll.InternalCommandAttribute;
import org.ovirt.engine.core.common.action.StoragePoolParametersBase;
import org.ovirt.engine.core.common.businessentities.StoragePoolStatus;
import org.ovirt.engine.core.common.businessentities.StorageType;
import org.ovirt.engine.core.common.businessentities.storage_server_connections;
import org.ovirt.engine.core.common.vdscommands.ConnectStorageServerVDSCommandParameters;
import org.ovirt.engine.core.common.vdscommands.VDSCommandType;
import org.ovirt.engine.core.dal.VdcBllMessages;
import org.ovirt.engine.core.utils.log.Log;
import org.ovirt.engine.core.utils.log.LogFactory;

/**
 * Connect host to all Storage server connections in Storage pool. We
 * considering that connection failed only if data domains failed to connect. If
 * Iso/Export domains failed to connect - only log it.
 */
@InternalCommandAttribute
public class ConnectHostToStoragePoolServersCommand<T extends StoragePoolParametersBase> extends
        ConnectHostToStoragePooServerCommandBase<T> {

    private static Log log = LogFactory.getLog(ConnectHostToStoragePoolServersCommand.class);

    public ConnectHostToStoragePoolServersCommand(T parameters) {
        super(parameters);
        setVdsId(parameters.getVdsId());
    }

    @Override
    protected void executeCommand() {
        setSucceeded(ConnectStorageServer(getStoragePool().getstorage_pool_type(), getConnections()));

        if (getNeedToConnectIso()) {
            if (!ConnectStorageServer(getIsoType(), getIsoConnections())) {
                log.infoFormat("Failed to connect host {0} to StoragePool {1} Iso domain/s connections", getVds()
                        .getvds_name(), getStoragePool().getname());
            }
        }
        if (getNeedToConnectExport()) {
            if (!ConnectStorageServer(getExportType(), getExportConnections())) {
                log.infoFormat("Failed to connect host {0} to StoragePool {1} Export domain/s connections", getVds()
                        .getvds_name(), getStoragePool().getname());
            }
        }
    }

    @Override
    protected boolean canDoAction() {
        boolean returnValue = checkStoragePool()
                && CheckStoragePoolStatusNotEqual(StoragePoolStatus.Uninitialized,
                                                  VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_POOL_STATUS_ILLEGAL)
                && InitializeVds();
        if (returnValue) {
            InitConnectionList();
            if (!getParameters().getSuppressCheck()) {
                if (!ValidConnection(getStoragePool().getstorage_pool_type(), getConnections())) {
                    addCanDoActionMessage(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_CONNECTION);
                    returnValue = false;
                } else {
                    if (getIsoConnections() != null && getIsoConnections().size() != 0) {
                        setNeedToConnectIso(ValidConnection(getIsoType(), getIsoConnections()));
                        if (!getNeedToConnectIso()) {
                            log.infoFormat(
                                    "Failed to validated connections for host {0} to StoragePool {1} Iso domain/s connections",
                                    getVds().getvds_name(),
                                    getStoragePool().getname());
                        }
                    }
                    if (getExportConnections() != null && getExportConnections().size() != 0) {
                        setNeedToConnectExport(ValidConnection(getExportType(), getExportConnections()));
                        if (!getNeedToConnectExport()) {
                            log.infoFormat(
                                    "Failed to validated connections for host {0} to StoragePool {1} Export domain/s connections",
                                    getVds().getvds_name(),
                                    getStoragePool().getname());
                        }
                    }
                }
            }
        }
        return returnValue;
    }

    protected boolean ConnectStorageServer(StorageType type, List<storage_server_connections> connections) {
        boolean connectSucceeded = true;
        if (connections != null && connections.size() > 0) {
            java.util.HashMap<String, String> retValues = (java.util.HashMap<String, String>) Backend
                    .getInstance()
                    .getResourceManager()
                    .RunVdsCommand(
                            VDSCommandType.ConnectStorageServer,
                            new ConnectStorageServerVDSCommandParameters(getVds().getId(),
                                    getStoragePool().getId(), type, connections)).getReturnValue();
            connectSucceeded =
                    StorageHelperDirector.getInstance().getItem(type).IsConnectSucceeded(retValues, connections);
            log.infoFormat("Host {0} storage connection was {1} ", getVds().getvds_name(),
                    connectSucceeded ? "succeeded" : "failed");
        }
        return connectSucceeded;
    }

    protected boolean ValidConnection(StorageType type, List<storage_server_connections> connections) {
        return (connections != null && (connections.isEmpty() || StorageHelperDirector.getInstance().getItem(type)
                .ValidateStoragePoolConnectionsInHost(getVds(), connections, getStoragePool().getId())));
    }

}


text:
<?xml version="1.0" encoding="UTF-8"?>
<objecttypes>
 <objecttype name="brick" color="#d330b1">
  <property name="bodyType" type="string" default=""/>
  <property name="bounce" type="float"/>
  <property name="density" type="float" default="0"/>
  <property name="friction" type="float" default="0"/>
 </objecttype>
</objecttypes>


text:
namespace Kudu.Core.SSHKey
{
    public interface ISSHKeyManager
    {
        /// <summary>
        /// Sets a private key
        /// </summary>
        void SetPrivateKey(string key);

        /// <summary>
        /// Reads an existing public key or generates a new key pair.
        /// </summary>
        /// <param name="ensurePublicKey">Determines if a public key should be generated if it doesn't already exist</param>
        string GetPublicKey(bool ensurePublicKey);

        /// <summary>
        /// Deletes the key pair
        /// </summary>
        /// <returns></returns>
        void DeleteKeyPair();
    }
}


text:
.. README.rst
.. Copyright (c) 2013-2019 Pablo Acosta-Serafini
.. See LICENSE for details
.. [REMOVE START]
.. [[[cog
.. # Standard library imports
.. import os
.. import sys
.. import textwrap
.. # PyPI imports
.. import pmisc
.. import docs.support.requirements_to_rst
.. SDIR = os.path.dirname(os.path.dirname(os.path.abspath(cog.inFile)))
.. sys.path.append(SDIR)
.. import pypkg.functions
.. FILE_NAME = sys.modules['docs.support.requirements_to_rst'].__file__
.. MDIR = os.path.join(os.path.realpath(
..    os.path.dirname(os.path.dirname(os.path.dirname(FILE_NAME))))
.. )
.. PKG_NAME = pypkg.functions.get_pkg_name()
.. PKG_VER = pypkg.functions.get_pkg_version()
.. PKG_INTERPS = pypkg.functions.get_supported_interps()
.. PKG_LONG_DESC = pypkg.functions.get_pkg_long_desc()
.. PKG_PIPELINE_ID = str(pypkg.functions.get_pkg_pipeline_id())
.. LINE_LENGTH = 78
.. PKG_INTERPS_STR = str(PKG_INTERPS[0]) if len(PKG_INTERPS) == 1 else ", ".join(PKG_INTERPS[:-1])+ " and " + PKG_INTERPS[-1]
.. def wrap(text, hanging_indent=0):
..     for line in textwrap.wrap(text, width=LINE_LENGTH, subsequent_indent=' '*hanging_indent):
..         cog.outl(line)
.. def tox_targets(prefix):
..     interps = ["``py"+str(interp).replace(".", "")+"-"+prefix+"``" for interp in PKG_INTERPS]
..     return interps[0] if len(interps) == 1 else ", ".join(interps[:-1])+ " and " + interps[-1]
.. cog.outl(".. [REMOVE STOP]")
.. cog.outl("")
.. cog.outl(".. image:: https://badge.fury.io/py/"+PKG_NAME+".svg")
.. cog.outl("    :target: https://pypi.org/project/"+PKG_NAME+"")
.. cog.outl("    :alt: PyPI version")
.. cog.outl("")
.. cog.outl(".. image:: https://img.shields.io/pypi/l/"+PKG_NAME+".svg")
.. cog.outl("    :target: https://pypi.org/project/"+PKG_NAME+"")
.. cog.outl("    :alt: License")
.. cog.outl("")
.. cog.outl(".. image:: https://img.shields.io/pypi/pyversions/"+PKG_NAME+".svg")
.. cog.outl("    :target: https://pypi.org/project/"+PKG_NAME+"")
.. cog.outl("    :alt: Python versions supported")
.. cog.outl("")
.. cog.outl(".. image:: https://img.shields.io/pypi/format/"+PKG_NAME+".svg")
.. cog.outl("    :target: https://pypi.org/project/"+PKG_NAME+"")
.. cog.outl("    :alt: Format")
.. cog.outl("")
.. cog.outl("|")
.. cog.outl("")
.. cog.outl(".. image::")
.. cog.outl("    https://dev.azure.com/pmasdev/"+PKG_NAME+"/_apis/build/status/pmacosta."+PKG_NAME+"?branchName=master")
.. cog.outl("    :target: https://dev.azure.com/pmasdev/"+PKG_NAME+"/_build?definitionId="+PKG_PIPELINE_ID+"&_a=summary")
.. cog.outl("    :alt: Continuous integration test status")
.. cog.outl("")
.. cog.outl(".. image::")
.. cog.outl("    https://img.shields.io/azure-devops/coverage/pmasdev/"+PKG_NAME+"/"+PKG_PIPELINE_ID+".svg")
.. cog.outl("    :target: https://dev.azure.com/pmasdev/"+PKG_NAME+"/_build?definitionId="+PKG_PIPELINE_ID+"&_a=summary")
.. cog.outl("    :alt: Continuous integration test coverage")
.. cog.outl("")
.. cog.outl(".. image::")
.. cog.outl("    https://readthedocs.org/projects/pip/badge/?version=stable")
.. cog.outl("    :target: https://pip.readthedocs.io/en/stable/?badge=stable")
.. cog.outl("    :alt: Documentation status")
.. cog.outl("")
.. cog.outl("|")
.. cog.outl("")
.. cog.outl("Description")
.. cog.outl("===========")
.. cog.outl("")
.. cog.outl(".. role:: bash(code)")
.. cog.outl("	:language: bash")
.. cog.outl("")
.. docs.support.requirements_to_rst.def_links(cog)
.. cog.outl("")
.. cog.outl("")
.. for paragraph in PKG_LONG_DESC.split(os.linesep):
..     if paragraph.strip():
..         wrap(paragraph)
..     else:
..         cog.outl("")
.. cog.outl("Interpreter")
.. cog.outl("===========")
.. cog.outl("")
.. blurb = (
..     "The package has been developed and tested with Python {0} "
..     "under Linux (Debian, Ubuntu), Apple macOS and Microsoft Windows"
.. )
.. wrap(blurb.format(PKG_INTERPS_STR))
.. cog.outl("")
.. cog.outl("Installing")
.. cog.outl("==========")
.. cog.outl("")
.. cog.outl(".. code-block:: console")
.. cog.outl("")
.. cog.outl("	$ pip install "+PKG_NAME)
.. cog.outl("")
.. cog.outl("Documentation")
.. cog.outl("=============")
.. cog.outl("")
.. wrap("Available at `Read the Docs <https://"+PKG_NAME+".readthedocs.io>`_")
.. cog.outl("")
.. cog.outl("Contributing")
.. cog.outl("============")
.. cog.outl("")
.. cog.outl("1. Abide by the adopted `code of conduct")
.. cog.outl("   <https://www.contributor-covenant.org/version/1/4/code-of-conduct>`_")
.. cog.outl("")
.. blurb = (
..     "2. Fork the `repository <https://github.com/pmacosta/"+PKG_NAME+">`_ from "
..     "GitHub and then clone personal copy [#f1]_:"
.. )
.. wrap(blurb, 3)
.. cog.outl("")
.. cog.outl("    .. code-block:: console")
.. cog.outl("")
.. cog.outl("        $ github_user=myname")
.. cog.outl("        $ git clone --recurse-submodules \\")
.. cog.outl("              https://github.com/\"${github_user}\"/"+PKG_NAME+".git")
.. cog.outl("        Cloning into '"+PKG_NAME+"'...")
.. cog.outl("        ...")
.. cog.outl("        $ cd "+PKG_NAME+" || exit 1")
.. cog.outl("        $ export "+PKG_NAME.upper()+"_DIR=${PWD}")
.. cog.outl("        $")
.. cog.outl("")
.. cog.outl("3. The package uses two sub-modules: a set of custom Pylint plugins to help with")
.. cog.outl("   some areas of code quality and consistency (under the ``pylint_plugins``")
.. cog.outl("   directory), and a lightweight package management framework (under the")
.. cog.outl("   ``pypkg`` directory). Additionally, the `pre-commit framework")
.. cog.outl("   <https://pre-commit.com/>`_ is used to perform various pre-commit code")
.. cog.outl("   quality and consistency checks. To enable the pre-commit hooks:")
.. cog.outl("")
.. cog.outl("    .. code-block:: console")
.. cog.outl("")
.. cog.outl("        $ cd \"${"+PKG_NAME.upper()+"_DIR}\" || exit 1")
.. cog.outl("        $ pre-commit install")
.. cog.outl("        pre-commit installed at .../"+PKG_NAME+"/.git/hooks/pre-commit")
.. cog.outl("        $")
.. cog.outl("")
.. cog.outl("4. Ensure that the Python interpreter can find the package modules")
.. cog.outl("   (update the :bash:`$PYTHONPATH` environment variable, or use")
.. cog.outl("   `sys.paths() <https://docs.python.org/3/library/sys.html#sys.path>`_,")
.. cog.outl("   etc.)")
.. cog.outl("")
.. cog.outl("   .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ export PYTHONPATH=${PYTHONPATH}:${"+PKG_NAME.upper()+"_DIR}")
.. cog.outl("       $")
.. cog.outl("")
.. cog.outl("5. Install the dependencies (if needed, done automatically by pip):")
.. docs.support.requirements_to_rst.proc_requirements(cog)
.. cog.outl("6. Implement a new feature or fix a bug")
.. cog.outl("")
.. cog.outl("7. Write a unit test which shows that the contributed code works as expected.")
.. cog.outl("   Run the package tests to ensure that the bug fix or new feature does not")
.. cog.outl("   have adverse side effects. If possible achieve 100\% code and branch")
.. cog.outl("   coverage of the contribution. Thorough package validation")
.. cog.outl("   can be done via Tox and Pytest:")
.. cog.outl("")
.. cog.outl("   .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ PKG_NAME="+PKG_NAME+" tox")
.. cog.outl("       GLOB sdist-make: .../"+PKG_NAME+"/setup.py")
.. cog.outl("       py27-pkg create: .../"+PKG_NAME+"/.tox/py27")
.. cog.outl("       py27-pkg installdeps: -r.../"+PKG_NAME+"/requirements/tests_py27.pip, -r.../"+PKG_NAME+"/requirements/docs_py27.pip")
.. cog.outl("       ...")
.. for pyver in PKG_INTERPS:
..     cog.outl("         py{0}-pkg: commands succeeded".format(str(pyver).replace(".", "")))
.. cog.outl("         congratulations :)")
.. cog.outl("       $")
.. cog.outl("")
.. cog.outl("   `Setuptools <https://bitbucket.org/pypa/setuptools>`_ can also be used")
.. cog.outl("   (Tox is configured as its virtual environment manager):")
.. cog.outl("")
.. cog.outl("   .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ PKG_NAME="+PKG_NAME+" python setup.py tests")
.. cog.outl("       running tests")
.. cog.outl("       running egg_info")
.. cog.outl("       writing "+PKG_NAME+".egg-info/PKG-INFO")
.. cog.outl("       writing dependency_links to "+PKG_NAME+".egg-info/dependency_links.txt")
.. cog.outl("       writing requirements to "+PKG_NAME+".egg-info/requires.txt")
.. cog.outl("       ...")
.. for pyver in PKG_INTERPS:
..     cog.outl("         py{0}-pkg: commands succeeded".format(str(pyver).replace(".", "")))
.. cog.outl("         congratulations :)")
.. cog.outl("       $")
.. cog.outl("")
.. blurb = (
..     "Tox (or Setuptools via Tox) runs with the following default environments: "+
..     tox_targets("pkg")+" [#f3]_. These use "+
..     "the "+PKG_INTERPS_STR+" interpreters, respectively, to test all code in the "+
..     "documentation (both in Sphinx ``*.rst`` source files and in docstrings), run "+
..     "all unit tests, measure test coverage and re-build the exceptions "+
..     "documentation. To pass arguments to Pytest (the test runner) use a double "+
..     "dash (``--``) after all the Tox arguments, for example:"
.. )
.. wrap((" "*3)+blurb, hanging_indent=3)
.. cog.outl("")
.. cog.outl("   .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ PKG_NAME="+PKG_NAME+" tox -e py27-pkg -- -n 4")
.. cog.outl("       GLOB sdist-make: .../"+PKG_NAME+"/setup.py")
.. cog.outl("       py27-pkg inst-nodeps: .../"+PKG_NAME+"/.tox/.tmp/package/1/"+PKG_NAME+"-"+PKG_VER+".zip")
.. cog.outl("       ...")
.. cog.outl("         py27-pkg: commands succeeded")
.. cog.outl("         congratulations :)")
.. cog.outl("       $")
.. cog.outl("")
.. cog.outl("   Or use the :code:`-a` Setuptools optional argument followed by a quoted")
.. cog.outl("   string with the arguments for Pytest. For example:")
.. cog.outl("")
.. cog.outl("   .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ PKG_NAME="+PKG_NAME+" python setup.py tests -a \"-e py27-pkg -- -n 4\"")
.. cog.outl("       running tests")
.. cog.outl("       ...")
.. cog.outl("         py27-pkg: commands succeeded")
.. cog.outl("         congratulations :)")
.. cog.outl("       $")
.. cog.outl("")
.. cog.outl("   There are other convenience environments defined for Tox [#f3]_:")
.. cog.outl("")
.. blurb = (
..     "* "+tox_targets("repl")+" run the Python "+PKG_INTERPS_STR+" "+
..     "REPL, respectively, in the appropriate virtual "+
..     "environment. The ``"+PKG_NAME+"`` package is pip-installed by Tox when the "+
..     "environments are created.  Arguments to the interpreter can be passed in "+
..     "the command line after a double dash (``--``)."
.. )
.. wrap((" "*4)+blurb, hanging_indent=6)
.. cog.outl("")
.. blurb = (
..     "* "+tox_targets("test")+" run Pytest "+
..     "using the Python "+PKG_INTERPS_STR+" interpreter, "+
..     "respectively, in the appropriate virtual environment. Arguments to pytest "+
..     "can be passed in the command line after a double dash (``--``) , for "+
..     "example:"
.. )
.. wrap((" "*4)+blurb, hanging_indent=6)
.. cog.outl("")
.. cog.outl("      .. code-block:: console")
.. cog.outl("")
.. cog.outl("       $ PKG_NAME="+PKG_NAME+" tox -e py27-test -- -x test_"+PKG_NAME+".py")
.. cog.outl("       GLOB sdist-make: .../"+PKG_NAME+"/setup.py")
.. cog.outl("       py27-pkg inst-nodeps: .../"+PKG_NAME+"/.tox/.tmp/package/1/"+PKG_NAME+"-"+PKG_VER+".zip")
.. cog.outl("       ...")
.. cog.outl("         py27-pkg: commands succeeded")
.. cog.outl("         congratulations :)")
.. cog.outl("       $")
.. PY_LIST = "``"+str(PKG_INTERPS[0])+"``" if len(PKG_INTERPS) == 1 else ", ".join(["``"+str(item)+"``" for item in PKG_INTERPS[:-1]])+" or ``"+str(PKG_INTERPS[-1])+"``"
.. blurb = (
..     "* "+tox_targets("test")+" test code and "+
..     "branch coverage using the "+PKG_INTERPS_STR+" interpreter, respectively, "+
..     "in the appropriate virtual environment. Arguments to pytest can be passed "+
..     "in the command line after a double dash (``--``). The report can be found "+
..     "in "+
..     ":bash:`${"+PKG_NAME.upper()+"_DIR}/.tox/py[PV]/usr/share/"+PKG_NAME+"/tests/htmlcov/index.html` "+
..     "where ``[PV]`` stands for "+PY_LIST+" depending on "+
..     "the interpreter used."
.. )
.. wrap((" "*4)+blurb, hanging_indent=6)
.. cog.outl("")
.. cog.outl("8. Verify that continuous integration tests pass. The package has continuous")
.. cog.outl("   integration configured for Linux, Apple macOS and Microsoft Windows (all via")
.. cog.outl("   `Azure DevOps <https://dev.azure.com/pmasdev>`_).")
.. cog.outl("")
.. cog.outl("9. Document the new feature or bug fix (if needed). The script")
.. cog.outl("   :bash:`${"+PKG_NAME.upper()+"_DIR}/pypkg/build_docs.py` re-builds the whole package")
.. cog.outl("   documentation (re-generates images, cogs source files, etc.):")
.. cog.outl("")
.. pmisc.ste('"${'+PKG_NAME.upper()+'_DIR}"/pypkg/build_docs.py -h', 3, MDIR, cog.out, env={PKG_NAME.upper()+"_DIR":MDIR})
.. cog.outl(".. rubric:: Footnotes")
.. cog.outl("")
.. cog.outl(".. [#f1] All examples are for the `bash <https://www.gnu.org/software/bash/>`_")
.. cog.outl("   shell")
.. cog.outl("")
.. cog.outl(".. [#f2] It is assumed that all the Python interpreters are in the executables")
.. cog.outl("   path. Source code for the interpreters can be downloaded from Python's main")
.. cog.outl("   `site <https://www.python.org/downloads/>`_")
.. cog.outl("")
.. cog.outl(".. [#f3] Tox configuration largely inspired by")
.. cog.outl("   `Ionel's codelog <https://blog.ionelmc.ro/2015/04/14/")
.. cog.outl("   tox-tricks-and-patterns/>`_")
.. cog.outl("")
.. cog.outl(".. include:: ../CHANGELOG.rst")
.. cog.outl("")
.. cog.outl("License")
.. cog.outl("=======")
.. cog.outl("")
.. cog.outl(".. include:: ../LICENSE")
.. cog.outl("")
.. cog.outl(".. [REMOVE START]")
.. ]]]
.. [REMOVE STOP]

.. image:: https://badge.fury.io/py/pcsv.svg
    :target: https://pypi.org/project/pcsv
    :alt: PyPI version

.. image:: https://img.shields.io/pypi/l/pcsv.svg
    :target: https://pypi.org/project/pcsv
    :alt: License

.. image:: https://img.shields.io/pypi/pyversions/pcsv.svg
    :target: https://pypi.org/project/pcsv
    :alt: Python versions supported

.. image:: https://img.shields.io/pypi/format/pcsv.svg
    :target: https://pypi.org/project/pcsv
    :alt: Format

|

.. image::
    https://dev.azure.com/pmasdev/pcsv/_apis/build/status/pmacosta.pcsv?branchName=master
    :target: https://dev.azure.com/pmasdev/pcsv/_build?definitionId=7&_a=summary
    :alt: Continuous integration test status

.. image::
    https://img.shields.io/azure-devops/coverage/pmasdev/pcsv/7.svg
    :target: https://dev.azure.com/pmasdev/pcsv/_build?definitionId=7&_a=summary
    :alt: Continuous integration test coverage

.. image::
    https://readthedocs.org/projects/pip/badge/?version=stable
    :target: https://pip.readthedocs.io/en/stable/?badge=stable
    :alt: Documentation status

|

Description
===========

.. role:: bash(code)
	:language: bash

.. _Cog: https://nedbatchelder.com/code/cog
.. _Coverage: https://coverage.readthedocs.io
.. _Docutils: http://docutils.sourceforge.net/docs
.. _Mock: https://docs.python.org/3/library/unittest.mock.html
.. _Pexdoc: https://pexdoc.readthedocs.org
.. _Pmisc: https://pmisc.readthedocs.org
.. _PyContracts: https://andreacensi.github.io/contracts
.. _Pydocstyle: http://www.pydocstyle.org
.. _Pylint: https://www.pylint.org
.. _Py.test: http://pytest.org
.. _Pytest-coverage: https://pypi.org/project/pytest-cov
.. _Pytest-pmisc: https://pytest-pmisc.readthedocs.org
.. _Pytest-xdist: https://pypi.org/project/pytest-xdist
.. _Sphinx: http://sphinx-doc.org
.. _ReadTheDocs Sphinx theme: https://github.com/rtfd/sphinx_rtd_theme
.. _Inline Syntax Highlight Sphinx Extension:
   https://bitbucket.org/klorenz/sphinxcontrib-inlinesyntaxhighlight
.. _Shellcheck Linter Sphinx Extension:
   https://pypi.org/project/sphinxcontrib-shellcheck
.. _Tox: https://testrun.org/tox
.. _Virtualenv: https://docs.python-guide.org/dev/virtualenvs

This module can be used to handle comma-separated values (CSV) files and do
lightweight processing of their data with support for row and column
filtering. In addition to basic read, write and data replacement, files can be
concatenated, merged, and sorted

Examples
--------

Read/write
^^^^^^^^^^

.. literalinclude:: ./support/pcsv_example_1.py
    :language: python
    :tab-width: 4
    :lines: 1,6-

Replace data
^^^^^^^^^^^^

.. literalinclude:: ./support/pcsv_example_2.py
    :language: python
    :tab-width: 4
    :lines: 1,6-

Concatenate two files
^^^^^^^^^^^^^^^^^^^^^

.. literalinclude:: ./support/pcsv_example_3.py
    :language: python
    :tab-width: 4
    :lines: 1,6-

Merge two files
^^^^^^^^^^^^^^^

.. literalinclude:: ./support/pcsv_example_4.py
    :language: python
    :tab-width: 4
    :lines: 1,6-

Sort a file
^^^^^^^^^^^

.. literalinclude:: ./support/pcsv_example_5.py
    :language: python
    :tab-width: 4
    :lines: 1,6-

Interpreter
===========

The package has been developed and tested with Python 2.7, 3.5, 3.6 and 3.7
under Linux (Debian, Ubuntu), Apple macOS and Microsoft Windows

Installing
==========

.. code-block:: console

	$ pip install pcsv

Documentation
=============

Available at `Read the Docs <https://pcsv.readthedocs.io>`_

Contributing
============

1. Abide by the adopted `code of conduct
   <https://www.contributor-covenant.org/version/1/4/code-of-conduct>`_

2. Fork the `repository <https://github.com/pmacosta/pcsv>`_ from GitHub and
   then clone personal copy [#f1]_:

    .. code-block:: console

        $ github_user=myname
        $ git clone --recurse-submodules \
              https://github.com/"${github_user}"/pcsv.git
        Cloning into 'pcsv'...
        ...
        $ cd pcsv || exit 1
        $ export PCSV_DIR=${PWD}
        $

3. The package uses two sub-modules: a set of custom Pylint plugins to help with
   some areas of code quality and consistency (under the ``pylint_plugins``
   directory), and a lightweight package management framework (under the
   ``pypkg`` directory). Additionally, the `pre-commit framework
   <https://pre-commit.com/>`_ is used to perform various pre-commit code
   quality and consistency checks. To enable the pre-commit hooks:

    .. code-block:: console

        $ cd "${PCSV_DIR}" || exit 1
        $ pre-commit install
        pre-commit installed at .../pcsv/.git/hooks/pre-commit
        $

4. Ensure that the Python interpreter can find the package modules
   (update the :bash:`$PYTHONPATH` environment variable, or use
   `sys.paths() <https://docs.python.org/3/library/sys.html#sys.path>`_,
   etc.)

   .. code-block:: console

       $ export PYTHONPATH=${PYTHONPATH}:${PCSV_DIR}
       $

5. Install the dependencies (if needed, done automatically by pip):

    * `Cog`_ (2.5.1 or newer)

    * `Coverage`_ (4.5.3 or newer)

    * `Docutils`_ (0.14 or newer)

    * `Inline Syntax Highlight Sphinx Extension`_ (0.2 or newer)

    * `Mock`_ (Python 2.x only, 2.0.0 or newer)

    * `Pexdoc`_ (1.1.4 or newer)

    * `Pmisc`_ (1.5.8 or newer)

    * `Py.test`_ (4.3.1 or newer)

    * `PyContracts`_ (1.8.2 or newer)

    * `Pydocstyle`_ (3.0.0 or newer)

    * `Pylint`_ (Python 2.x: 1.9.4 or newer, Python 3.x: 2.3.1 or newer)

    * `Pytest-coverage`_ (2.6.1 or newer)

    * `Pytest-pmisc`_ (1.0.7 or newer)

    * `Pytest-xdist`_ (optional, 1.26.1 or newer)

    * `ReadTheDocs Sphinx theme`_ (0.4.3 or newer)

    * `Shellcheck Linter Sphinx Extension`_ (1.0.8 or newer)

    * `Sphinx`_ (1.8.5 or newer)

    * `Tox`_ (3.7.0 or newer)

    * `Virtualenv`_ (16.4.3 or newer)

6. Implement a new feature or fix a bug

7. Write a unit test which shows that the contributed code works as expected.
   Run the package tests to ensure that the bug fix or new feature does not
   have adverse side effects. If possible achieve 100\% code and branch
   coverage of the contribution. Thorough package validation
   can be done via Tox and Pytest:

   .. code-block:: console

       $ PKG_NAME=pcsv tox
       GLOB sdist-make: .../pcsv/setup.py
       py27-pkg create: .../pcsv/.tox/py27
       py27-pkg installdeps: -r.../pcsv/requirements/tests_py27.pip, -r.../pcsv/requirements/docs_py27.pip
       ...
         py27-pkg: commands succeeded
         py35-pkg: commands succeeded
         py36-pkg: commands succeeded
         py37-pkg: commands succeeded
         congratulations :)
       $

   `Setuptools <https://bitbucket.org/pypa/setuptools>`_ can also be used
   (Tox is configured as its virtual environment manager):

   .. code-block:: console

       $ PKG_NAME=pcsv python setup.py tests
       running tests
       running egg_info
       writing pcsv.egg-info/PKG-INFO
       writing dependency_links to pcsv.egg-info/dependency_links.txt
       writing requirements to pcsv.egg-info/requires.txt
       ...
         py27-pkg: commands succeeded
         py35-pkg: commands succeeded
         py36-pkg: commands succeeded
         py37-pkg: commands succeeded
         congratulations :)
       $

   Tox (or Setuptools via Tox) runs with the following default environments:
   ``py27-pkg``, ``py35-pkg``, ``py36-pkg`` and ``py37-pkg`` [#f3]_. These use
   the 2.7, 3.5, 3.6 and 3.7 interpreters, respectively, to test all code in
   the documentation (both in Sphinx ``*.rst`` source files and in
   docstrings), run all unit tests, measure test coverage and re-build the
   exceptions documentation. To pass arguments to Pytest (the test runner) use
   a double dash (``--``) after all the Tox arguments, for example:

   .. code-block:: console

       $ PKG_NAME=pcsv tox -e py27-pkg -- -n 4
       GLOB sdist-make: .../pcsv/setup.py
       py27-pkg inst-nodeps: .../pcsv/.tox/.tmp/package/1/pcsv-1.0.8.zip
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $

   Or use the :code:`-a` Setuptools optional argument followed by a quoted
   string with the arguments for Pytest. For example:

   .. code-block:: console

       $ PKG_NAME=pcsv python setup.py tests -a "-e py27-pkg -- -n 4"
       running tests
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $

   There are other convenience environments defined for Tox [#f3]_:

    * ``py27-repl``, ``py35-repl``, ``py36-repl`` and ``py37-repl`` run the
      Python 2.7, 3.5, 3.6 and 3.7 REPL, respectively, in the appropriate
      virtual environment. The ``pcsv`` package is pip-installed by Tox when
      the environments are created.  Arguments to the interpreter can be
      passed in the command line after a double dash (``--``).

    * ``py27-test``, ``py35-test``, ``py36-test`` and ``py37-test`` run Pytest
      using the Python 2.7, 3.5, 3.6 and 3.7 interpreter, respectively, in the
      appropriate virtual environment. Arguments to pytest can be passed in
      the command line after a double dash (``--``) , for example:

      .. code-block:: console

       $ PKG_NAME=pcsv tox -e py27-test -- -x test_pcsv.py
       GLOB sdist-make: .../pcsv/setup.py
       py27-pkg inst-nodeps: .../pcsv/.tox/.tmp/package/1/pcsv-1.0.8.zip
       ...
         py27-pkg: commands succeeded
         congratulations :)
       $
    * ``py27-test``, ``py35-test``, ``py36-test`` and ``py37-test`` test code
      and branch coverage using the 2.7, 3.5, 3.6 and 3.7 interpreter,
      respectively, in the appropriate virtual environment. Arguments to
      pytest can be passed in the command line after a double dash (``--``).
      The report can be found in
      :bash:`${PCSV_DIR}/.tox/py[PV]/usr/share/pcsv/tests/htmlcov/index.html`
      where ``[PV]`` stands for ``2.7``, ``3.5``, ``3.6`` or ``3.7`` depending
      on the interpreter used.

8. Verify that continuous integration tests pass. The package has continuous
   integration configured for Linux, Apple macOS and Microsoft Windows (all via
   `Azure DevOps <https://dev.azure.com/pmasdev>`_).

9. Document the new feature or bug fix (if needed). The script
   :bash:`${PCSV_DIR}/pypkg/build_docs.py` re-builds the whole package
   documentation (re-generates images, cogs source files, etc.):

   .. code-block:: console

       $ "${PCSV_DIR}"/pypkg/build_docs.py -h
       usage: build_docs.py [-h] [-d DIRECTORY] [-r]
                            [-n NUM_CPUS] [-t]

       Build pcsv package documentation

       optional arguments:
         -h, --help            show this help message and exit
         -d DIRECTORY, --directory DIRECTORY
                               specify source file directory
                               (default ../pcsv)
         -r, --rebuild         rebuild exceptions documentation.
                               If no module name is given all
                               modules with auto-generated
                               exceptions documentation are
                               rebuilt
         -n NUM_CPUS, --num-cpus NUM_CPUS
                               number of CPUs to use (default: 1)
         -t, --test            diff original and rebuilt file(s)
                               (exit code 0 indicates file(s) are
                               identical, exit code 1 indicates
                               file(s) are different)

.. rubric:: Footnotes

.. [#f1] All examples are for the `bash <https://www.gnu.org/software/bash/>`_
   shell

.. [#f2] It is assumed that all the Python interpreters are in the executables
   path. Source code for the interpreters can be downloaded from Python's main
   `site <https://www.python.org/downloads/>`_

.. [#f3] Tox configuration largely inspired by
   `Ionel's codelog <https://blog.ionelmc.ro/2015/04/14/
   tox-tricks-and-patterns/>`_

.. include:: ../CHANGELOG.rst

License
=======

.. include:: ../LICENSE

.. [REMOVE START]
.. [[[end]]]
.. [REMOVE STOP]


text:
So you have a SoapUI project setup and you have built out a nice a test suite, so what's next? Tests are no good if you aren't running them, and even better running them regularly.

You may want to add SoapUI to a nightly build  or possibly even include it in your continuous integration pipeline. The challenge can be that SoapUI will have to be installed and your project file available for test execution.

To solve that problem we can use Docker. The heavy liftings already been done thanks to a container created by [Daniel Davidson](http://ddavison.io/). In his words:

>By containerizing SoapUI and its runner, this allows you to have a portable SoapUI installation that lets you run your SoapUI projects anywhere!

Here's how to run your SoapUI tests anywhere using docker and executing a few shell commands.

### Installing Docker

For this How to, I have [Docker for Mac](https://docs.docker.com/docker-for-mac/) installed locally on my laptop, but any system that can run a linux docker container will do.

If you are a Windows user don't worry, Windows 10 supports running linux containers but best to check the [docs](https://docs.docker.com/docker-for-windows/install/#download-docker-for-windows)

#### Installing the Container

Run the following command and docker will reach out to the [Docker Hub]() to pull down the docker file. If you aren't familiar with Docker Hub, think of it as github for containers.

```
docker run --name soapie -d -p 3000:3000 ddavison/soapui
```

![Downloading Container](ContainerInstallProgress.png)

To create the container but not automatically start it
```
docker create --name soapie -p 3000:3000 ddavison/soapui
```

To see the containers you have running
```
docker container ls
```

### Executing Tests

The container uses two simple http requests for interaction.

- Get

We can drop that url into a browser and we'll see the following landing page:

![Container Status Page](DockerSoapUIInfoPage.png)

- Post
As you can see the status pag has instructions for sending the [cUrl](https://curl.haxx.se/) request for executing tests.

At this point we basically follow those instructions and using cUrl, or your favorite client to POST the project file and test suite name.

```
curl --form "project=@/path/to/soapui-project.xml" \           --form "suite=TestSuite" \           http://localhost:3000/
```

### Test Results

The http status code is your first indicator for of your tests results.
 - 200 All Tests Passed
 - 550 Test Failure(s)
 - 551 No Suite
 - 552 No Project
 - 500 Exception Running Tests

Test output is also returned in the http body of the response.

This infomation and more details can be found at this containers [Docker Hub Page](https://hub.docker.com/r/ddavison/soapui/)

### Cleaning Up
The following commands can be used to stop or remove the container once you are done using it.

```
docker stop soapie

docker stop {id}
```

```
docker rm soapie

docker rm {id}
```


text:
<?php
include('../../clases/redireccion.php');
include '../../../clases/conexion.php';
//session_start();

if ( (isset($_SESSION['idProdu']) == FALSE)&&(isset($_GET['IDPro'])==FALSE) )
{
	header('Location:../../index.php');
}
elseif (isset($_SESSION['idProdu']) == TRUE)
{
	$idproducto= $_SESSION['idProdu'];
}
elseif (isset($_GET['IDPro'])== TRUE)
{
	$idproducto = $_GET['IDPro'];
}
?>
<?php
// seleccion producto
$sqlProducto = "SELECT * FROM PRODUCTO WHERE idPRODUCTO = '$idproducto' ";
$respuesta= mysqli_query($conn,$sqlProducto);
$respuestaProdu= mysqli_fetch_assoc($respuesta);
//echo $sqlProducto;
?>

	<title>Informacion Producto</title>
	<link rel="stylesheet" type="text/css" href="../../../css/bootstrap.min.css">

Informacion del Producto

Clave: <?php echo $respuestaProdu['Clave']; ?>

Nombre: <?php echo $respuestaProdu['Nombre']; ?>

Tipo: <?php echo $respuestaProdu['Tipo']; ?>

Estatus: <?php echo $respuestaProdu['Estatus']; ?>

Descripción: <?php echo $respuestaProdu['Descripcion']; ?>

Medidas: <?php echo $respuestaProdu['Medida1'],"cm x ",$respuestaProdu['Medida2'],"cm x",$respuestaProdu['Medida3'],"cm"; ?>

Piezas

		Cantidad
		Nombre
		Medidas
		Material
					<?php
					$sqlConsulPro="SELECT Nombre FROM `PROCESO` WHERE AREAPROCESO_idAREAPROCESO='1'";
					$respuestaProceso=mysqli_query($conn,$sqlConsulPro);
					while ($filaProc=mysqli_fetch_array($respuestaProceso))
					{
						echo '';
						echo $filaProc['Nombre'];
						echo '	';
					}
					?>

				<?php
				$sqlproducPieza="SELECT `PIEZA_idPIEZA`, `Cantidad` FROM PRODUCTOPIEZA WHERE PRODUCTO_idPRODUCTO='$idproducto'";
				$sqlconsulta4 = mysqli_query($conn,$sqlproducPieza);
				while ($filaProduPieza=mysqli_fetch_array($sqlconsulta4))
				{
					echo '
';
					echo '';
					echo $filaProduPieza['Cantidad'];
					echo '	';
					$idPieza = $filaProduPieza['PIEZA_idPIEZA'];
					$sqlPieza="SELECT * FROM PIEZA WHERE idPIEZA = '$idPieza'";

					$sqlconsulta5=mysqli_query($conn,$sqlPieza);
					while ($filaPieza=mysqli_fetch_array($sqlconsulta5))
					{
						echo '';
						echo $filaPieza['Nombre'];
						echo '	';
						echo '';
						echo $filaPieza['Medida1'],'cm x ',$filaPieza['Medida2'],'cm x ',$filaPieza['Medida3'],'cm';
						echo '	';
						$idmaterial= $filaPieza['MATERIAL_idMATERIAL'];
						$sqlmaterial="SELECT Nombre FROM MATERIAL WHERE idMATERIAL='$idmaterial'";
						$sqlconsulta6=mysqli_query($conn,$sqlmaterial);
						$nombrematerial=mysqli_fetch_assoc($sqlconsulta6);
						echo '';
						echo $nombrematerial['Nombre'];
						echo '	';
						$sqlProcesoBu="SELECT idPROCESO FROM PROCESO WHERE AREAPROCESO_idAREAPROCESO='1'";
						$sqlconsulta7=mysqli_query($conn,$sqlProcesoBu);

						while ($filaProceso=mysqli_fetch_array($sqlconsulta7))
						{

							$idproceso=$filaProceso['idPROCESO'];
							$sqlbusqueda="SELECT * FROM PIEZAPROCESO WHERE PROCESO_idPROCESO='$idproceso' && PIEZA_idPIEZA='$idPieza'";
							$sqlconsulta8=mysqli_query($conn,$sqlbusqueda);

							if (mysqli_num_rows($sqlconsulta8)>0)
							{
								//tenemos coincidencias
								echo '';
								echo '';
								echo '	';
							}
							else
							{
								echo '';
								echo '';
								echo '	';

							}

						}

					}
					echo '
';
				}
				?>

Ensamble General

	<?php
	$ConsultaEnsamble="SELECT *FROM ENSAMBLE WHERE PRODUCTO_idPRODUCTO='$idproducto'";
	$queryEnsamble=mysqli_query($conn,$ConsultaEnsamble);
	$fila=mysqli_fetch_assoc($queryEnsamble);
	?>
	Nombre:<?php echo $fila['Nombre'];  ?>

Datos Subensamble

	<?php
	$idEnsamble=$fila['idENSAMBLE'];
	$ConsultaSubensamble="SELECT * FROM SUBENSAMBLE WHERE ENSAMBLE_idENSAMBLE='$idEnsamble' ";
	$querySubensamble=mysqli_query($conn,$ConsultaSubensamble);

	while ($resul=mysqli_fetch_array($querySubensamble))
	{
		echo '
Nombre: '.$resul['Nombre'].'
';
		echo '
';
		echo '
';
		echo '
Piezas
';
		$idSUBENSAMBLEPIEZA=$resul['idSubensamble'];
		$SElecionarPiezas="SELECT * FROM SUBENSAMBLEPIEZA INNER JOIN PIEZA ON SUBENSAMBLEPIEZA.PIEZA_idPIEZA=PIEZA.idPIEZA WHERE SUBENSAMBLE_idSubensamble='$idSUBENSAMBLEPIEZA'";
		echo $SElecionarPiezas;
		$querySubPiezas=mysqli_query($conn,$SElecionarPiezas);
		echo '

					Nombre Pieza
					Procesos Ensamble

';
		while ($sub=mysqli_fetch_array($querySubPiezas))
		{
			echo '
';
			echo ''.$sub['Nombre'].'	';
			echo '
';
		}
		echo '
';
		echo '

Continuar

<?php
mysqli_close($conn);
 ?>


text:
using System.Diagnostics;
using JetBrains.Annotations;

namespace IX.Observable.DebugAide
{
    /// <summary>
    ///     A debug view of a key-value pair in an observable dictionary.
    /// </summary>
    /// <typeparam name="TKey">The type of the key.</typeparam>
    /// <typeparam name="TValue">The type of the value.</typeparam>
    [DebuggerDisplay("[{Key}] = \"{Value}\"")]
    [UsedImplicitly]
    public sealed class Kvp<TKey, TValue>
    {
        /// <summary>
        ///     Gets the key.
        /// </summary>
        /// <value>
        ///     The key.
        /// </value>
        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        [UsedImplicitly]
        public TKey Key { get; internal set; }

        /// <summary>
        ///     Gets the value.
        /// </summary>
        /// <value>
        ///     The value.
        /// </value>
        [DebuggerBrowsable(DebuggerBrowsableState.Never)]
        [UsedImplicitly]
        public TValue Value { get; internal set; }
    }
}


text:
package pl.solr.dm.producers;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Map;
import java.util.Map.Entry;

import pl.solr.dm.DataType;
import pl.solr.dm.types.ArrayDataType;
import pl.solr.dm.types.ObjectDataType;

public class SolrDataModelProducer extends DataModelProducer {
	private final SimpleDateFormat FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss");

	@Override
	public String convert(ObjectDataType object) {
		StringBuilder builder = new StringBuilder();
		builder.append("<doc>\n");
		for (Entry<String, DataType<?>> entry : object.getNewValue().entrySet()) {
			processItem(builder, entry.getKey(), entry.getValue());
		}
		builder.append("</doc>\n");
		return builder.toString();
	}

	private void processItem(StringBuilder builder, String key, DataType<?> type) {
		if (type instanceof ArrayDataType) {
			processArray(builder, key , (ArrayDataType) type);
			return;
		}

		if (type instanceof ObjectDataType) {
			processObject(builder, key, (ObjectDataType) type);
			return;
		}

		appendField(builder, key, type.getNewValue());
	}

	private void processArray(StringBuilder builder, String key, ArrayDataType array) {
		for (DataType<?> item : array.getNewValue()) {
			processItem(builder, key, item);
		}

	}

	private void processObject(StringBuilder builder, String key, ObjectDataType object) {
		Map<String, DataType<?>> fields = object.getNewValue();
		if (fields == null) {
			return;
		}
		for (Entry<String, DataType<?>> entry : fields.entrySet()) {
			processItem(builder, key + "." + entry.getKey(), entry.getValue());
		}

	}

	private void appendField(StringBuilder builder, String key, Object value) {
		if (value == null) {
			return;
		}
		builder.append("\t<field name=\"");
		builder.append(key);
		builder.append("\">");
		builder.append(format(value));
		builder.append("</field>\n");
	}

	private String format(Object value) {
		if (value instanceof Date) {
			return FORMAT.format(value);
		}
		return value.toString();
	}

}


text:
package command.party;

public class Stereo {

	String location;

	public Stereo(String location) {
		this.location = location;
	}

	public void on() {
		System.out.println(location + " stereo is on");
	}

	public void off() {
		System.out.println(location + " stereo is off");
	}

	public void setCD() {
		System.out.println(location + " stereo is set for CD input");
	}

	public void setDVD() {
		System.out.println(location + " stereo is set for DVD input");
	}

	public void setRadio() {
		System.out.println(location + " stereo is set for Radio");
	}

	public void setVolume(int volume) {
		System.out.println(location + " Stereo volume set to " + volume);
	}
}


text:
import React, { Component } from 'react';
import { Link } from 'react-router-dom';
import { Button, Checkbox, Divider, Form, Header, Icon, Input, List, Message, Modal, Segment, Table } from 'semantic-ui-react';
import NumericLabel from '../../utils/NumericLabel'
import AccountName from '../global/AccountName';

export default class AccountsProxy extends Component {
  constructor(props) {
    super(props);
    this.state = {};
    this.props.actions.resetState = this.resetState.bind(this);
  }
  state = {
    editProxyFor: false
  }
  componentWillReceiveProps = (nextProps) => {
    if (nextProps.processing.account_set_voting_proxy_resolved) {
      nextProps.actions.setVotingProxyCompleted();
      this.resetState();
    }
  }
  resetState() {
    this.setState({
      editProxyFor: false
    });
  }
  handleCancel = () => {
    this.resetState();
  }
  handleCancelProxy = (e, props) => {
    const account = props.value;
    const permissions = this.props.keys.permissions;
    this.props.actions.useKey('setVotingProxy', { account, proxy: '' }, permissions[account])
  }
  handleEditProxy = (e, props) => {
    this.setState({
      editProxyFor: props.value
    });
  }
  handleEditProxyConfirm = (e, props) => {
    const account = props.value;
    const permissions = this.props.keys.permissions;
    const proxy = this.state[account];
    this.props.actions.useKey('setVotingProxy', { account, proxy }, permissions[account])
    e.preventDefault();
  }
  handleChangeProxy = (e, props) => {
    const editing = this.state.editProxyFor;
    const newState = {};
    newState[editing] = props.value.trim();
    this.setState(newState);
  }
  render() {
    const t = this;
    let editProxy = false;
    const {
      account_set_voting_proxy_error,
      account_set_voting_proxy_pending,
      account_set_voting_proxy_resolved
    } = this.props.processing;
    if (this.state.editProxyFor) {
      editProxy = (
        <Modal
          size="small"
          open
          header="Set Account Proxy - Witness Voting"
          content={
            <Form
              error={account_set_voting_proxy_error}
              loading={account_set_voting_proxy_pending}
            >
              <Segment
                padded
                basic
              >
                <p>
                  Please enter the name of the account you wish
                  to delegate witness voting power to.
                </p>
                <Input
                  name="proxy"
                  autoFocus
                  onChange={this.handleChangeProxy}
                />
                <Message
                  error
                  header="Operation Error"
                  content={account_set_voting_proxy_error}
                />
              </Segment>
            </Form>
          }
          actions={[
            {
              key: 'no',
              content: 'Cancel Operation',
              floated: 'left',
              color: 'red',
              onClick: this.handleCancel,
              disabled: account_set_voting_proxy_pending
            },
            {
              key: 'yes',
              type: 'submit',
              content: 'Set Proxy',
              color: 'blue',
              value: this.state.editProxyFor,
              onClick: this.handleEditProxyConfirm,
              disabled: account_set_voting_proxy_pending
            }
          ]}
        />
      );
    }
    const names = this.props.keys.names;
    const numberFormat = {
      shortFormat: true,
      shortFormatMinValue: 1000
    };
    const accounts = names.map((name) => {
      const proxy = this.props.account.accounts[name].proxy;
      const hasProxy = (proxy && proxy !== "");
      const shares = this.props.account.accounts[name].vesting_shares.split(" ")[0];
      return (
        <Table.Row key={name}>
          <Table.Cell>
            <AccountName name={name} />
          </Table.Cell>
          <Table.Cell textAlign="center">
            <NumericLabel params={numberFormat}>{shares}</NumericLabel>
          </Table.Cell>
          <Table.Cell textAlign="center">
            <Header size="small">
              {(hasProxy)
                ? <Icon size="large" color="green" name="checkmark" />
                : <Icon size="large" color="red" name="cancel" />
              }
            </Header>
          </Table.Cell>
          <Table.Cell textAlign="center">
            <AccountName name={proxy} />
          </Table.Cell>
          <Table.Cell>
            <Button
              icon="edit"
              color="blue"
              onClick={this.handleEditProxy}
              value={name}
            />
            <Button
              icon="cancel"
              color="red"
              disabled={!hasProxy || account_set_voting_proxy_pending}
              onClick={this.handleCancelProxy}
              value={name}
            />
          </Table.Cell>
        </Table.Row>
      );
    });
    return (
      <Segment basic padded>
        {editProxy}
        <Header>
          <Header.Subheader>
            Each account may proxy it's vested weight to a designated account for witness voting.
          </Header.Subheader>
        </Header>
        <Table celled>
          <Table.Header>
            <Table.Row>
              <Table.HeaderCell textAlign="center">
                Name
              </Table.HeaderCell>
              <Table.HeaderCell textAlign="center">
                VESTS
              </Table.HeaderCell>
              <Table.HeaderCell textAlign="center">
                Proxied
              </Table.HeaderCell>
              <Table.HeaderCell textAlign="center">
                Destination Account
              </Table.HeaderCell>
              <Table.HeaderCell>
                Controls
              </Table.HeaderCell>
            </Table.Row>
          </Table.Header>
          <Table.Body>
            {accounts}
          </Table.Body>
        </Table>
      </Segment>
    );
  }
}


text:
SYNONYM

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
null

#### Original name
Uredo petasitidis DC., 1805

### Remarks
null


text:
#if !SILVERLIGHT && !PocketPC
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Resources;
using System.Text;
using System.Threading;
using System.Globalization;

namespace Newtonsoft.Json4.Utilities
{
  internal class DynamicWrapperBase
  {
    internal protected object UnderlyingObject;
  }

  internal static class DynamicWrapper
  {
    private static readonly object _lock = new object();
    private static readonly WrapperDictionary _wrapperDictionary = new WrapperDictionary();

    private static ModuleBuilder _moduleBuilder;

    private static ModuleBuilder ModuleBuilder
    {
      get
      {
        Init();
        return _moduleBuilder;
      }
    }

    private static void Init()
    {
      if (_moduleBuilder == null)
      {
        lock (_lock)
        {
          if (_moduleBuilder == null)
          {
            AssemblyName assemblyName = new AssemblyName("Newtonsoft.Json4.Dynamic");
            assemblyName.KeyPair = new StrongNameKeyPair(GetStrongKey());

            AssemblyBuilder assembly = AppDomain.CurrentDomain.DefineDynamicAssembly(assemblyName, AssemblyBuilderAccess.Run);
            _moduleBuilder = assembly.DefineDynamicModule("Newtonsoft.Json4.DynamicModule", false);
          }
        }
      }
    }

    private static byte[] GetStrongKey()
    {
      const string name = "Newtonsoft.Json4.Dynamic.snk";

      using (Stream stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(name))
      {
        if (stream == null)
          throw new MissingManifestResourceException("Should have " + name + " as an embedded resource.");

        int length = (int)stream.Length;
        byte[] buffer = new byte[length];
        stream.Read(buffer, 0, length);

        return buffer;
      }
    }

    public static Type GetWrapper(Type interfaceType, Type realObjectType)
    {
      Type wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType);

      if (wrapperType == null)
      {
        lock (_lock)
        {
          wrapperType = _wrapperDictionary.GetType(interfaceType, realObjectType);

          if (wrapperType == null)
          {
            wrapperType = GenerateWrapperType(interfaceType, realObjectType);
            _wrapperDictionary.SetType(interfaceType, realObjectType, wrapperType);
          }
        }
      }

      return wrapperType;
    }

    public static object GetUnderlyingObject(object wrapper)
    {
      DynamicWrapperBase wrapperBase = wrapper as DynamicWrapperBase;
      if (wrapperBase == null)
        throw new ArgumentException("Object is not a wrapper.", "wrapper");

      return wrapperBase.UnderlyingObject;
    }

    private static Type GenerateWrapperType(Type interfaceType, Type underlyingType)
    {
      TypeBuilder wrapperBuilder = ModuleBuilder.DefineType(
          "{0}_{1}_Wrapper".FormatWith(CultureInfo.InvariantCulture, interfaceType.Name, underlyingType.Name),
          TypeAttributes.NotPublic | TypeAttributes.Sealed,
          typeof(DynamicWrapperBase),
          new[] { interfaceType });

      WrapperMethodBuilder wrapperMethod = new WrapperMethodBuilder(underlyingType, wrapperBuilder);

      foreach (MethodInfo method in interfaceType.AllMethods())
      {
        wrapperMethod.Generate(method);
      }

      return wrapperBuilder.CreateType();
    }

    public static T CreateWrapper<T>(object realObject) where T : class
    {
      var dynamicType = GetWrapper(typeof(T), realObject.GetType());
      var dynamicWrapper = (DynamicWrapperBase)Activator.CreateInstance(dynamicType);

      dynamicWrapper.UnderlyingObject = realObject;

      return dynamicWrapper as T;
    }
  }

  internal class WrapperMethodBuilder
  {
    private readonly Type _realObjectType;
    private readonly TypeBuilder _wrapperBuilder;

    public WrapperMethodBuilder(Type realObjectType, TypeBuilder proxyBuilder)
    {
      _realObjectType = realObjectType;
      _wrapperBuilder = proxyBuilder;
    }

    public void Generate(MethodInfo newMethod)
    {
      if (newMethod.IsGenericMethod)
        newMethod = newMethod.GetGenericMethodDefinition();

      FieldInfo srcField = typeof(DynamicWrapperBase).GetField("UnderlyingObject", BindingFlags.Instance | BindingFlags.NonPublic);

      var parameters = newMethod.GetParameters();
      var parameterTypes = parameters.Select(parameter => parameter.ParameterType).ToArray();

      MethodBuilder methodBuilder = _wrapperBuilder.DefineMethod(
          newMethod.Name,
          MethodAttributes.Public | MethodAttributes.Virtual,
          newMethod.ReturnType,
          parameterTypes);

      if (newMethod.IsGenericMethod)
      {
        methodBuilder.DefineGenericParameters(
            newMethod.GetGenericArguments().Select(arg => arg.Name).ToArray());
      }

      ILGenerator ilGenerator = methodBuilder.GetILGenerator();

      LoadUnderlyingObject(ilGenerator, srcField);
      PushParameters(parameters, ilGenerator);
      ExecuteMethod(newMethod, parameterTypes, ilGenerator);
      Return(ilGenerator);
    }

    private static void Return(ILGenerator ilGenerator)
    {
      ilGenerator.Emit(OpCodes.Ret);
    }

    private void ExecuteMethod(MethodBase newMethod, Type[] parameterTypes, ILGenerator ilGenerator)
    {
      MethodInfo srcMethod = GetMethod(newMethod, parameterTypes);

      if (srcMethod == null)
        throw new MissingMethodException("Unable to find method " + newMethod.Name + " on " + _realObjectType.FullName);

      ilGenerator.Emit(OpCodes.Call, srcMethod);
    }

    private MethodInfo GetMethod(MethodBase realMethod, Type[] parameterTypes)
    {
      if (realMethod.IsGenericMethod)
        return _realObjectType.GetGenericMethod(realMethod.Name, parameterTypes);

      return _realObjectType.GetMethod(realMethod.Name, parameterTypes);
    }

    private static void PushParameters(ICollection<ParameterInfo> parameters, ILGenerator ilGenerator)
    {
      for (int i = 1; i < parameters.Count + 1; i++)
        ilGenerator.Emit(OpCodes.Ldarg, i);
    }

    private static void LoadUnderlyingObject(ILGenerator ilGenerator, FieldInfo srcField)
    {
      ilGenerator.Emit(OpCodes.Ldarg_0);
      ilGenerator.Emit(OpCodes.Ldfld, srcField);
    }
  }

  internal class WrapperDictionary
  {
    private readonly Dictionary<string, Type> _wrapperTypes = new Dictionary<string, Type>();

    private static string GenerateKey(Type interfaceType, Type realObjectType)
    {
      return interfaceType.Name + "_" + realObjectType.Name;
    }

    public Type GetType(Type interfaceType, Type realObjectType)
    {
      string key = GenerateKey(interfaceType, realObjectType);

      if (_wrapperTypes.ContainsKey(key))
        return _wrapperTypes[key];

      return null;
    }

    public void SetType(Type interfaceType, Type realObjectType, Type wrapperType)
    {
      string key = GenerateKey(interfaceType, realObjectType);

      if (_wrapperTypes.ContainsKey(key))
        _wrapperTypes[key] = wrapperType;
      else
        _wrapperTypes.Add(key, wrapperType);
    }
  }

  internal static class TypeExtensions
  {
    public static MethodInfo GetGenericMethod(this Type type, string name, params Type[] parameterTypes)
    {
      var methods = type.GetMethods().Where(method => method.Name == name);

      foreach (var method in methods)
      {
        if (method.HasParameters(parameterTypes))
          return method;
      }

      return null;
    }

    public static bool HasParameters(this MethodInfo method, params Type[] parameterTypes)
    {
      var methodParameters = method.GetParameters().Select(parameter => parameter.ParameterType).ToArray();

      if (methodParameters.Length != parameterTypes.Length)
        return false;

      for (int i = 0; i < methodParameters.Length; i++)
        if (methodParameters[i].ToString() != parameterTypes[i].ToString())
          return false;

      return true;
    }

    public static IEnumerable<Type> AllInterfaces(this Type target)
    {
      foreach (var IF in target.GetInterfaces())
      {
        yield return IF;
        foreach (var childIF in IF.AllInterfaces())
        {
          yield return childIF;
        }
      }
    }

    public static IEnumerable<MethodInfo> AllMethods(this Type target)
    {
      var allTypes = target.AllInterfaces().ToList();
      allTypes.Add(target);

      return from type in allTypes
             from method in type.GetMethods()
             select method;
    }
  }
}
#endif


text:
class Test {
  String test(String s) {
    if (s != null) {
      String res = process(s);
      <caret>if (res != null) return res;
    }
    return null;
  }

  native String process(String s);
}


text:
Handsontable is a data grid component with an Excel-like appearance. Built in JavaScript, it integrates with any data source and comes with [features](http://docs.handsontable.com/0.17.0/tutorial-features.html) like data validation, sorting, grouping, data binding or column ordering. Actively supported by the Handsoncode team and the GitHub community.

Check out the demos at http://handsontable.com/examples.html or fork the example on
[JSFiddle](http://jsfiddle.net/js_ziggle/hU6Kz/3228/) to see Handsontable in action.

- - -

### Quick start

1. A recommended way to install Handsontable is through [Bower](http://bower.io/search/?q=handsontable) package manager using the following command:

  `bower install handsontable --save`

  Alternatively, you can [download it in a ZIP file](https://github.com/handsontable/handsontable/archive/master.zip).

2. After Handsontable is downloaded, embed the code into your project. All the files that you need are in the `dist\` directory:

  ```html
  <script src="dist/handsontable.full.js"></script>
  <link rel="stylesheet" media="screen" href="dist/handsontable.full.css">
  ```

3. Then, create a new `Handsontable` object, passing a reference to an empty div as a first argument. After that, load some data if you wish:

  ```html
  <div id="example"></div>

  <script>
    var data = [
      ["", "Kia", "Nissan", "Toyota", "Honda"],
      ["2008", 10, 11, 12, 13],
      ["2009", 20, 11, 14, 13],
      ["2010", 30, 15, 12, 13]
    ];

   var container = document.getElementById('example');
    var hot = new Handsontable(container,
     {
       data: data
      });
  </script>
  ```

### API Reference

- [Core methods](http://docs.handsontable.com/0.17.0/Core.html)
- [Options](http://docs.handsontable.com/0.17.0/Options.html)
- [Hooks](http://docs.handsontable.com/0.17.0/Hooks.html)

### Troubleshooting

Please follow this guidelines when reporting bugs and feature requests:

1. Use [GitHub Issues](https://github.com/handsontable/handsontable/issues) board to report bugs and feature requests (not our email address)
2. Please **always** write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.
3. If possible, please add a JSFiddle link that shows the problem (start by forking [this fiddle](http://jsfiddle.net/js_ziggle/hU6Kz/3228/)). It saves us much time.
4. If you can't reproduce it on JSFiddle, please add a screenshot that shows the problem. JSFiddle is much more appreciated because it lets us start fixing straight away.

Thanks for understanding!

### Compatibility

Handsontable is compatible with IE 9+, Firefox, Chrome, Safari and Opera.

### Want to help?

Please see [CONTRIBUTING.md](CONTRIBUTING.md)

### Changelog

To see the list of recent changes, see [Releases section](https://github.com/handsontable/handsontable/releases).

### License

The MIT License (see the [LICENSE](https://github.com/handsontable/handsontable/blob/master/LICENSE) file for the full text)

### Contact

You can contact us at hello@handsontable.com.


text:
<?php
include_once($_SERVER['DOCUMENT_ROOT'].'/include/autoprepend.php');
/**
 * HTML2PDF Librairy - example
 *
 * HTML => PDF convertor
 * distributed under the LGPL License
 *
 * @author      Laurent MINGUET <webmaster@html2pdf.fr>
 *
 * isset($_GET['vuehtml']) is not mandatory
 * it allow to display the result in the HTML format
 */

    // get the HTML
    ob_start();
    include(dirname(__FILE__).'/res/exemple07a.php');
    include(dirname(__FILE__).'/res/exemple07b.php');
    $content = ob_get_clean();

    // convert to PDF
    require_once(dirname(__FILE__).'/../html2pdf.class.php');
    try
    {
        $html2pdf = new HTML2PDF('P', 'A4', 'fr');
        $html2pdf->pdf->SetDisplayMode('fullpage');
//      $html2pdf->pdf->SetProtection(array('print'), 'spipu');
        $html2pdf->writeHTML($content, isset($_GET['vuehtml']));
        $html2pdf->Output('exemple07.pdf');
    }
    catch(HTML2PDF_exception $e) {
        echo $e;
        exit;
    }


text:
import os
import time
import paddle
import paddle.distributed.fleet as fleet
import paddle.fluid as fluid

def get_dataset(inputs, config, pipe_cmd, role="worker"):
    dataset = fluid.DatasetFactory().create_dataset()
    dataset.set_use_var(inputs)
    dataset.set_pipe_command(pipe_cmd)
    dataset.set_batch_size(config.get('runner.batch_size'))
    reader_thread_num = int(config.get('runner.reader_thread_num'))
    dataset.set_thread(reader_thread_num)
    train_files_path = config.get('runner.train_files_path')
    print('train_data_files:{}'.format(train_files_path))
    file_list = [
        os.path.join(train_files_path, x) for x in os.listdir(train_files_path)
    ]
    if role == "worker":
        file_list = fleet.util.get_file_shard(file_list)
        print("worker file list: {}".format(file_list))
    elif role == "heter_worker":
        file_list = fleet.util.get_heter_file_shard(file_list)
        print("heter worker file list: {}".format(file_list))

    return dataset, file_list

def fl_ps_train():
    # 0. get role
    import paddle.distributed.fleet.base.role_maker as role_maker

    role_maker = role_maker.PaddleCloudRoleMaker()
    role_maker._generate_role()
    fleet.util._set_role_maker(role_maker)

    # 1. load yaml-config to dict-config
    from ps_dnn_trainer import (
        YamlHelper,
        StaticModel,
        get_user_defined_strategy,
    )

    yaml_helper = YamlHelper()
    config_yaml_path = '../ps/fl_async_ps_config.yaml'
    config = yaml_helper.load_yaml(config_yaml_path)
    # yaml_helper.print_yaml(config)

    # 2. get static model
    paddle.enable_static()
    model = StaticModel(config)
    feeds_list = model.create_feeds()
    metrics = model.fl_net(feeds_list)
    loss = model._cost

    # 3. compile time - build program_desc
    user_defined_strategy = get_user_defined_strategy(config)
    a_sync_configs = user_defined_strategy.a_sync_configs
    a_sync_configs["launch_barrier"] = True
    user_defined_strategy.a_sync_configs = a_sync_configs
    print(
        "launch_barrier: ",
        user_defined_strategy.a_sync_configs["launch_barrier"],
    )
    learning_rate = config.get("hyper_parameters.optimizer.learning_rate")
    inner_optimizer = paddle.optimizer.Adam(learning_rate, lazy_mode=True)
    from paddle.distributed.fleet.meta_optimizers.ps_optimizer import (
        ParameterServerOptimizer,
    )

    ps_optimizer = ParameterServerOptimizer(inner_optimizer)
    ps_optimizer._set_basic_info(
        loss, role_maker, inner_optimizer, user_defined_strategy
    )
    ps_optimizer.minimize_impl(loss)

    # 4. runtime
    from paddle.distributed.ps.the_one_ps import TheOnePSRuntime

    _runtime_handle = TheOnePSRuntime()  # ps 目录下重构版的 TheOnePSRuntime
    _runtime_handle._set_basic_info(ps_optimizer.pass_ctx._attrs)
    epoch_num = int(config.get('runner.epoch_num'))
    # 4.1 run server - build fleet_desc
    if role_maker._is_server():
        _runtime_handle._init_server()
        _runtime_handle._run_server()
    # 4.2 run worker
    elif role_maker._is_worker():
        place = fluid.CPUPlace()
        exe = fluid.Executor(place)
        exe.run(fluid.default_startup_program())
        _runtime_handle._init_worker()
        print('trainer get dataset')
        inputs = feeds_list[1:-1]
        dataset, file_list = get_dataset(
            inputs, config, "python dataset_generator_A.py"
        )
        print(
            "fluid.default_main_program: {}".format(
                fluid.default_main_program()._heter_pipeline_opt
            )
        )
        for epoch in range(epoch_num):
            # A 方和 B 方如果要以文件粒度 shuffle 时,则需要固定同一个种子
            dataset.set_filelist(file_list)
            start_time = time.time()
            exe.train_from_dataset(
                program=fluid.default_main_program(),
                dataset=dataset,
                print_period=2,
                debug=False,
            )
            end_time = time.time()
            print(
                "trainer epoch %d finished, use time=%d\n"
                % ((epoch), end_time - start_time)
            )
        exe.close()
        _runtime_handle._stop_worker()
        print("Fl partyA Trainer Success!")
    else:
        exe = fluid.Executor()
        exe.run(fluid.default_startup_program())
        _runtime_handle._init_worker()
        inputs = [
            feeds_list[0],
            feeds_list[-1],
        ]  # 顺序务必要和 dataset_generator_B.py 中保持一致
        dataset, file_list = get_dataset(
            inputs, config, "python dataset_generator_B.py", "heter_worker"
        )
        print(
            "fluid.default_main_program: {}".format(
                fluid.default_main_program()._heter_pipeline_opt
            )
        )
        for epoch in range(epoch_num):
            dataset.set_filelist(file_list)
            exe.train_from_dataset(
                program=fluid.default_main_program(),
                dataset=dataset,
                print_period=2,
                debug=False,
            )
        exe.close()
        _runtime_handle._stop_worker()
        print("Fl partB Trainer Success!")

if __name__ == '__main__':
    fl_ps_train()


text:
package com.juankpro.ane.localnotif;

import android.app.Notification;
import android.app.RemoteInput;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;

import com.juankpro.ane.localnotif.factory.NotificationRequestIntentFactory;
import com.juankpro.ane.localnotif.util.PersistenceManager;

public class TextInputActionIntentService extends BroadcastReceiver {
    @SuppressWarnings("ConstantConditions")
    @Override
    public void onReceive(Context context, Intent intent) {
        String code = intent.getStringExtra(Constants.NOTIFICATION_CODE_KEY);

        PersistenceManager persistenceManager = new PersistenceManager(context);
        LocalNotification localNotification = persistenceManager.readNotification(code);

        Intent notificationIntent = new NotificationRequestIntentFactory(context)
                .createIntent(localNotification)
                .setClass(context, LocalNotificationIntentService.class)
                .putExtra(Constants.VIBRATE, false)
                .putExtra(Constants.PLAY_SOUND, false)
                .putExtra(Constants.PRIORITY, Notification.PRIORITY_DEFAULT)
                .putExtras(intent.getExtras());

        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
            Bundle bundle = RemoteInput.getResultsFromIntent(intent);
            String userResponse = bundle.getString(Constants.USER_RESPONSE_KEY);
            notificationIntent.putExtra(Constants.USER_RESPONSE_KEY, userResponse);
        }

        context.startService(notificationIntent);
    }
}