text:
#ifndef TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_
#define TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_

#include <functional>

#include "tensorflow/core/lib/core/threadpool.h"
#include "tensorflow/core/public/session_options.h"

// TODO(vrv, mrry): Remove this library: its interface circumvents the
// callers' Env and calls Env::Default() directly.

namespace tensorflow {

// Returns a process-wide ThreadPool for scheduling compute operations
// using 'options'.  Caller does not take ownership over threadpool.
thread::ThreadPool* ComputePool(const SessionOptions& options);

// Returns the TF_NUM_INTEROP_THREADS environment value, or 0 if not specified.
int32 NumInterOpThreadsFromEnvironment();

// Returns the TF_NUM_INTRAOP_THREADS environment value, or 0 if not specified.
int32 NumIntraOpThreadsFromEnvironment();

// Returns the number of inter op threads specified in `options` or a default.
// If no value is specified in the provided options, then the function returns
// the value defined in the TF_NUM_INTEROP_THREADS environment variable.
// If neither a value is specified in the options or in the environment,
// this function will return a reasonable default value based on the number
// of schedulable CPUs, and any MKL and OpenMP configurations.
int32 NumInterOpThreadsFromSessionOptions(const SessionOptions& options);

// Creates a thread pool with number of inter op threads.
thread::ThreadPool* NewThreadPoolFromSessionOptions(
    const SessionOptions& options);

// Schedule "closure" in the default thread queue.
void SchedClosure(std::function<void()> closure);

// Schedule "closure" after the given number of microseconds in the
// fixed-size ThreadPool used for non-blocking compute tasks.
void SchedNonBlockingClosureAfter(int64 micros, std::function<void()> closure);

}  // namespace tensorflow

#endif  // TENSORFLOW_CORE_COMMON_RUNTIME_PROCESS_UTIL_H_


text:
package org.saiku.web.rest.objects;

import org.saiku.datasources.datasource.SaikuDatasource;

import java.util.Properties;
import java.util.UUID;

/**
 * Map from SaikuDatasources to JSON variants.
 */
public class DataSourceMapper {

    private String connectionname;
    private String jdbcurl;
    private String schema;
    private String driver;
    private String username;
    private String password;
    private String connectiontype;
    private String id;
    private String path;
    private String advanced;
    private String security_type;
    private String propertyKey;

    public DataSourceMapper() {

    }

    public DataSourceMapper(SaikuDatasource ds) {
        if (!ds.getProperties().containsKey("advanced") || ds.getProperties().getProperty("advanced").equals("false")) {
            String location = ds.getProperties().getProperty("location");

            String[] loc = location.split(";");

            String[] url = loc[0].split("=");
            if (ds.getProperties().getProperty("driver").equals("mondrian.olap4j.MondrianOlap4jDriver")) {
                String[] cat = loc[1].split("=");
                String[] drv = loc[2].split("=");
                if(cat.length>1) {
                    this.schema = cat[1];
                }
                if(drv.length>1) {
                    this.driver = drv[1];
                }
                this.connectiontype = "MONDRIAN";
            } else {
                this.connectiontype = "XMLA";
            }
            this.connectionname = ds.getName();
            if(url.length>1) {
                this.jdbcurl = url[1];
            }
            this.username = ds.getProperties().getProperty("username");
            this.password = ds.getProperties().getProperty("password");
            this.path = ds.getProperties().getProperty("path");
            this.id = ds.getProperties().getProperty("id");
            if(ds.getProperties().containsKey("schema")){
                this.schema = ds.getProperties().getProperty("schema");
            }

            if(ds.getProperties().containsKey("security.type")){
                this.security_type = ds.getProperties().getProperty("security.type");
            }

            if(ds.getProperties().containsKey("propertykey")){
                this.propertyKey = ds.getProperties().getProperty("propertykey");
            }

        } else {
            this.advanced = "type=" + ds.getType().toString() + "\n";
            this.advanced += "name=" + ds.getName() + "\n";
            this.advanced += "driver=" + ds.getProperties().getProperty("driver") + "\n";
            this.advanced += "location=" + ds.getProperties().getProperty("location") + "\n";
            if (ds.getProperties().containsKey("username")) {
                this.advanced += "username=" + ds.getProperties().get("username") + "\n";
            }
            if (ds.getProperties().containsKey("password")) {
                this.advanced += "password=" + ds.getProperties().get("password") + "\n";
            }
            if (ds.getProperties().containsKey("security.enabled")) {
                this.advanced += "security.enabled=" + ds.getProperties().get("security.enabled") + "\n";
            }
            if (ds.getProperties().containsKey("security.type")) {
                this.advanced += "security.type=" + ds.getProperties().get("security.type") + "\n";
            }
            if (ds.getProperties().containsKey("security.mapping")) {
                this.advanced += "security.mapping=" + ds.getProperties().get("security.mapping") + "\n";
            }
            if (ds.getProperties().contains("encrypt.password")) {
                this.advanced += "encrypt.password=" + ds.getProperties().get("encrypt.password") + "\n";
            }
            this.connectionname = ds.getName();
            this.id = ds.getProperties().getProperty("id");
        }
    }

    public SaikuDatasource toSaikuDataSource() {
        Properties props = new Properties();
        if (advanced == null) {
            String location;
            if (connectiontype.equals("MONDRIAN")) {
                props.setProperty("driver", "mondrian.olap4j.MondrianOlap4jDriver");
                location = "jdbc:mondrian:Jdbc=" + jdbcurl + ";Catalog=mondrian://" + schema + ";JdbcDrivers=" + driver;
            } else {
                props.setProperty("driver", "org.olap4j.driver.xmla.XmlaOlap4jDriver");
                location = "jdbc:xmla:Server=" + jdbcurl;
            }

            props.setProperty("location", location);
            props.setProperty("username", this.username);
            props.setProperty("password", this.password);
            if(this.security_type!=null){
                props.setProperty("security.type", this.security_type);
            }
            if(this.schema!=null){
                props.setProperty("schema", this.schema);
            }
            if (this.path != null) {
                props.setProperty("path", this.path);
            }
            if (this.id != null) {
                props.setProperty("id", this.id);
            } else {
                props.setProperty("id", UUID.randomUUID().toString());
            }
            props.setProperty("advanced", "false");

            if(this.propertyKey != null){
                props.setProperty("propertyKey", this.propertyKey);
            }

            return new SaikuDatasource(this.getConnectionname(), SaikuDatasource.Type.OLAP, props);
        } else {
            String name = null;

            String[] lines = advanced.split("\\r?\\n");

            for (String row : lines) {
                if (row.startsWith("name=")) {
                    name = row.substring(5, row.length());
                }
                if (row.startsWith("driver=")) {
                    props.setProperty("driver", row.substring(7, row.length()));
                }
                if (row.startsWith("location=")) {
                    props.setProperty("location", row.substring(9, row.length()));
                }
                if (row.startsWith("username=")) {
                    if (row.length() > 9) {
                        props.setProperty("username", row.substring(9, row.length()));
                    } else {
                        props.setProperty("username", "");
                    }
                }
                if (row.startsWith("password=")) {
                    if (row.length() > 9) {
                        props.setProperty("password", row.substring(9, row.length()));
                    } else {
                        props.setProperty("password", "");
                    }
                }

                if (row.startsWith("security.type=")) {
                    props.setProperty("security.type", row.substring(14, row.length()));
                }
                if (row.startsWith("security.mapping=")) {
                    props.setProperty("security.mapping", row.substring(17, row.length()));
                }
                if (row.startsWith("security.enabled=")) {
                    props.setProperty("security.enabled", row.substring(17, row.length()));
                }
                if (row.startsWith("encrypt.password=")) {
                    props.setProperty("encrypt.password", row.substring(17, row.length()));
                }
                if (this.id != null) {
                    props.setProperty("id", this.id);
                } else {
                    props.setProperty("id", UUID.randomUUID().toString());
                }
                if(row.startsWith("propertyKey=")){
                    props.setProperty("propertyKey", row.substring(12, row.length()));
                }
            }

            props.setProperty("advanced", "true");

            return new SaikuDatasource(name, SaikuDatasource.Type.OLAP, props);
        }

    }

    public String getConnectionname() {
        return connectionname;
    }

    public void setConnectionname(String connectionname) {
        this.connectionname = connectionname;
    }

    public String getJdbcurl() {
        return jdbcurl;
    }

    public void setJdbcurl(String jdbcurl) {
        this.jdbcurl = jdbcurl;
    }

    public String getSchema() {
        return schema;
    }

    public void setSchema(String schema) {
        this.schema = schema;
    }

    public String getDriver() {
        return driver;
    }

    public void setDriver(String driver) {
        this.driver = driver;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getConnectiontype() {
        return connectiontype;
    }

    public void setConnectiontype(String connectiontype) {
        this.connectiontype = connectiontype;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getPath() {
        return path;
    }

    public void setPath(String path) {
        this.path = path;
    }

    public String getAdvanced() {
        return advanced;
    }

    public void setAdvanced(String advanced) {
        this.advanced = advanced;
    }

    public void setSecurity_type(String security_type) {
        this.security_type = security_type;
    }

    public void setPropertyKey(String propertyKey) {
        this.propertyKey = propertyKey;
    }

    public String getPropertyKey() {
        return propertyKey;
    }

    public String getSecurity_type() {
        return security_type;
    }
}

redpajama_set_name: RedPajamaGithub


text:
"""Test intercepting a full module with interceptor."""

from uuid import uuid4

from httplib2 import Http

from wsgi_intercept.interceptor import Httplib2Interceptor
from .wsgi_app import simple_app

def app():
    return simple_app

def setup_module(module):
    module.host = str(uuid4())
    module.intercept = Httplib2Interceptor(app, host=module.host)
    module.intercept.install_intercept()

def teardown_module(module):
    module.intercept.uninstall_intercept()

def test_simple_request():
    global host
    http = Http()
    response, content = http.request('http://%s/' % host)
    assert response.status == 200
    assert 'WSGI intercept successful!' in content.decode('utf-8')

def test_another_request():
    global host
    http = Http()
    response, content = http.request('http://%s/foobar' % host)
    assert response.status == 200
    assert 'WSGI intercept successful!' in content.decode('utf-8')


text:
package ublu.command;

import com.ibm.as400.access.AS400SecurityException;
import com.ibm.as400.access.ErrorCompletingRequestException;
import com.ibm.as400.access.ObjectDoesNotExistException;
import com.ibm.as400.access.RequestNotSupportedException;
import ublu.util.ArgArray;
// import ublu.util.DataSink;
import java.awt.Desktop;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.sql.SQLException;
import java.util.logging.Level;

/**
 * Perform desktop operations
 *
 * @author jwoehr
 */
public class CmdDesktop extends Command {

    {
        setNameAndDescription("desktop",
                "/0 [-browse ~@{uri} | -mail | -mailto ~@{uri} | -supported] : desktop browser or mail");
    }

    enum OPS {
        BROWSE,
        MAIL,
        MAILTO,
        SUPPORTED
    }

    /**
     * Cmd action to perform desktop operations
     *
     * @param argArray arguments in interpreter buffer
     * @return what's left of arguments
     */
    public ArgArray cmdDesktop(ArgArray argArray) {
        String uri = null;
        OPS op = OPS.SUPPORTED;
        while (argArray.hasDashCommand()) {
            String dashCommand = argArray.parseDashCommand();
            switch (dashCommand) {
//                case "-to":
//                    setDataDestfromArgArray(argArray);
//                    break;
//                case "-from":
//                    setDataSrcfromArgArray(argArray);
//                    break;
                case "-browse":
                    op = OPS.BROWSE;
                    uri = argArray.nextMaybeQuotationTuplePopString();
                    break;
                case "-mail":
                    op = OPS.MAIL;
                    break;
                case "-mailto":
                    op = OPS.MAILTO;
                    uri = argArray.nextMaybeQuotationTuplePopString();
                    break;
                case "-supported":
                    op = OPS.SUPPORTED;
                    break;
                default:
                    unknownDashCommand(dashCommand);
            }
        }
        if (havingUnknownDashCommand()) {
            setCommandResult(COMMANDRESULT.FAILURE);
        } else {
            boolean supported = Desktop.isDesktopSupported();
            if (op.equals(OPS.SUPPORTED)) {
                try {
                    put(supported);
                } catch (SQLException | IOException | AS400SecurityException | ErrorCompletingRequestException | InterruptedException | ObjectDoesNotExistException | RequestNotSupportedException ex) {
                    getLogger().log(Level.SEVERE, "Exception putting supported in " + getNameAndDescription(), ex);
                }
            } else if (!supported) {
                getLogger().log(Level.SEVERE, "Desktop not supported in {0}", getNameAndDescription());
            } else {
                switch (op) {
                    case BROWSE:
                        try {
                            Desktop.getDesktop().browse(new URI(uri));
                        } catch (URISyntaxException | IOException ex) {
                            getLogger().log(Level.SEVERE, "Exception launching browser on URI " + uri + inNameAndDescription(), ex);
                        }
                        break;
                    case MAIL:
                        try {
                            Desktop.getDesktop().mail();
                        } catch (IOException ex) {
                            getLogger().log(Level.SEVERE, "Exception launching mailer in " + getNameAndDescription(), ex);
                        }
                        break;
                    case MAILTO:
                        try {
                            Desktop.getDesktop().mail(new URI(uri));
                        } catch (URISyntaxException | IOException ex) {
                            getLogger().log(Level.SEVERE, "Exception launching mailer on URI " + uri + inNameAndDescription(), ex);
                        }
                        break;
                }
            }
        }
        return argArray;
    }

    @Override
    public ArgArray cmd(ArgArray args) {
        reinit();
        return cmdDesktop(args);
    }

    @Override
    public COMMANDRESULT getResult() {
        return getCommandResult();
    }
}


text:
module Trafaret
  class Any < Validator
  end

  class ADT < Validator
    attr_reader :validators

    def prepare(*args)
      @args = @args.first if @args.first.is_a? ::Array
      @validators = @args.map { |v| Trafaret.get_instantiated_validator(v) }
    end
  end

  class Or < ADT
    def validate(data)
      errors = []
      @validators.each do |v|
        res = v.call(data)
        if res.is_a? Trafaret::Error
          errors << res
        else
          return res
        end
      end
      return failure errors
    end

    def |(other)
      Trafaret::Or.new(*validators, other)
    end
  end

  class Chain < ADT
    def validate(data)
      @validators.each do |v|
        data = v.call(data)
        return data if data.is_a? Trafaret::Error
      end
      data
    end

    def &(other)
      Trafaret::Chain.new(*validators, other)
    end
  end

  class Forward < Validator
    attr_accessor :validator

    def provide(validator)
      @validator = validator
    end

    def validate(data)
      raise 'Validator is not provided' unless validator
      validator.validate(data)
    end
  end

  class Nil < Validator
    def validate(data)
      failure('Value must be nil') unless data.nil?
    end
  end

  class String < Validator
    def prepare
      @regex = ::Regexp.compile @options[:regex] if @options[:regex]
    end

    def validate(data)
      return failure('Not a String') unless data.is_a? ::String
      return failure('Should not be blank') if !@options[:allow_blank] && data.empty?
      return failure('Too short') if @options[:min_length] && data.size < @options[:min_length]
      return failure('Too long') if @options[:max_length] && data.size > @options[:max_length]
      if @regex
        match = @regex.match(data)
        return failure('Does not match') unless match
        return match
      end
      data
    end

    def convert(data)
      if data.is_a? MatchData
        data.string
      else
        data
      end
    end
  end

  class Symbol < Validator
    def prepare
      @sym = @args.first.to_sym
      @str = @args.first.to_s.freeze
    end

    def validate(data)
      case data
      when ::String
        @str == data ? @sym : failure('Not equal')
      when ::Symbol
        @sym == data ? @sym : failure('Not equal')
      else
        failure('Not a String or a Symbol')
      end
    end
  end

  class Array < Validator
    def prepare
      @cls = Trafaret.get_instantiated_validator(@options.delete(:validator), @options)
    end

    def self.[](validator, options = {})
      self.new(options.merge(validator: validator))
    end

    def validate(data)
      return failure('Not an Array') unless data.is_a? ::Array
      fails = {}
      res = data.map.with_index do |elem, index|
        val = @cls.call elem
        fails[index] = val if val.is_a? Trafaret::Error
        val
      end
      if fails.blank?
        return res
      else
        return failure(fails)
      end
    end
  end

  class Mapping < Validator
    def prepare
      @key_validator = @args.first
      @value_validator = @args[1]
    end

    def validate(data)
      return failure('Not a Hash') unless data.is_a? ::Hash
      fails = []
      pairs = []
      data.each do |k, v|
        kv = @key_validator.call(k)
        vv = @value_validator.call(v)
        if (kv.is_a? Trafaret::Error) || (vv.is_a? Trafaret::Error)
          fails << [k, [kv, vv]]
        else
          pairs << [kv, vv]
        end
      end
      if fails.blank?
        ::Hash[pairs]
      else
        failure(::Hash[fails])
      end
    end
  end

  class Proc < Validator
    def prepare
      raise 'Need to call with block' if @converters.blank?
      @blk = @converters.pop
    end

    def validate(data)
      @blk.call(data)
    end
  end

  class Case < Validator
    def prepare
      @whens = []
      @converters.shift.call(self)
    end

    def when(trafaret, &blk)
      @whens << [Trafaret::Constructor.construct_from(trafaret), blk]
    end

    def call(data)
      @whens.each do |trafaret, blk|
        val = trafaret.call(data)
        unless val.is_a?(Trafaret::Error)
          return blk.call(val)
        end
      end
      failure('Case does not match')
    end
  end

  class Tuple < Validator
    def prepare
      @validators = @args.map { |arg| Trafaret.get_instantiated_validator(arg) }
      @size = @validators.size
    end

    def call(data)
      return failure('Too many elements') if data.size > @size# && !@extra
      return failure('Not enough elements') if data.size < @size
      failures = {}
      result = []
      data[0..@size].each.with_index do |el, index|
        val = @validators[index].call(el)
        result << val
        failures[index] = val if val.is_a? Trafaret::Error
      end
      if failures.empty?
        result
      else
        failure(failures)
      end
    end
  end
end


text:
package uk.ivanc.archimvp.view;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.v7.app.ActionBar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.squareup.picasso.Picasso;

import uk.ivanc.archimvp.R;
import uk.ivanc.archimvp.model.Repository;
import uk.ivanc.archimvp.model.User;
import uk.ivanc.archimvp.presenter.RepositoryPresenter;

public class RepositoryActivity extends AppCompatActivity implements RepositoryMvpView {

    private static final String EXTRA_REPOSITORY = "EXTRA_REPOSITORY";

    private Toolbar toolbar;
    private TextView descriptionText;
    private TextView homepageText;
    private TextView languageText;
    private TextView forkText;
    private TextView ownerNameText;
    private TextView ownerEmailText;
    private TextView ownerLocationText;
    private ImageView ownerImage;
    private View ownerLayout;

    private RepositoryPresenter presenter;

    public static Intent newIntent(Context context, Repository repository) {
        Intent intent = new Intent(context, RepositoryActivity.class);
        intent.putExtra(EXTRA_REPOSITORY, repository);
        return intent;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        presenter = new RepositoryPresenter();
        presenter.attachView(this);

        setContentView(R.layout.activity_repository);
        toolbar = (Toolbar) findViewById(R.id.toolbar);
        descriptionText = (TextView) findViewById(R.id.text_repo_description);
        homepageText = (TextView) findViewById(R.id.text_homepage);
        languageText = (TextView) findViewById(R.id.text_language);
        forkText = (TextView) findViewById(R.id.text_fork);
        ownerNameText = (TextView) findViewById(R.id.text_owner_name);
        ownerEmailText = (TextView) findViewById(R.id.text_owner_email);
        ownerLocationText = (TextView) findViewById(R.id.text_owner_location);
        ownerImage = (ImageView) findViewById(R.id.image_owner);
        ownerLayout = findViewById(R.id.layout_owner);

        setSupportActionBar(toolbar);
        ActionBar actionBar = getSupportActionBar();
        if (actionBar != null) {
            actionBar.setDisplayHomeAsUpEnabled(true);
        }

        Repository repository = getIntent().getParcelableExtra(EXTRA_REPOSITORY);
        bindRepositoryData(repository);
        presenter.loadOwner(repository.owner.url);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        presenter.detachView();
    }

    @Override
    public Context getContext() {
        return this;
    }

    @Override
    public void showOwner(final User owner) {
        ownerNameText.setText(owner.name);
        ownerEmailText.setText(owner.email);
        ownerEmailText.setVisibility(owner.hasEmail() ? View.VISIBLE : View.GONE);
        ownerLocationText.setText(owner.location);
        ownerLocationText.setVisibility(owner.hasLocation() ? View.VISIBLE : View.GONE);
        ownerLayout.setVisibility(View.VISIBLE);
    }

    private void bindRepositoryData(final Repository repository) {
        setTitle(repository.name);
        descriptionText.setText(repository.description);
        homepageText.setText(repository.homepage);
        homepageText.setVisibility(repository.hasHomepage() ? View.VISIBLE : View.GONE);
        languageText.setText(getString(R.string.text_language, repository.language));
        languageText.setVisibility(repository.hasLanguage() ? View.VISIBLE : View.GONE);
        forkText.setVisibility(repository.isFork() ? View.VISIBLE : View.GONE);
        //Preload image for user because we already have it before loading the full user
        Picasso.with(this)
                .load(repository.owner.avatarUrl)
                .placeholder(R.drawable.placeholder)
                .into(ownerImage);
    }
}


text:
using InventoryExpress.Model;
using WebExpress.Attribute;
using WebExpress.Html;
using WebExpress.UI.Attribute;
using WebExpress.UI.Component;
using WebExpress.UI.WebControl;
using WebExpress.WebApp.Components;

namespace InventoryExpress.WebControl
{
    [Section(Section.FooterPrimary)]
    [Application("InventoryExpress")]
    public sealed class ControlFooterPrimary : ControlText, IComponent
    {
        /// <summary>
        /// Konstruktor
        /// </summary>
        public ControlFooterPrimary()
            : base()
        {
            Init();
        }

        /// <summary>
        /// Initialisierung
        /// </summary>
        private void Init()
        {
            Text = string.Format("{0}", ViewModel.Instance.Now);
            TextColor = new PropertyColorText(TypeColorText.Muted);
            Format = TypeFormatText.Center;
            Size = new PropertySizeText(TypeSizeText.Small);
        }

        /// <summary>
        /// In HTML konvertieren
        /// </summary>
        /// <param name="context">Der Kontext, indem das Steuerelement dargestellt wird</param>
        /// <returns>Das Control als HTML</returns>
        public override IHtmlNode Render(RenderContext context)
        {
            return base.Render(context);
        }
    }
}


text:
package com.all.tracker.model;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;

@Entity
@Deprecated
public class Notification {

	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	private Long id;
	private String header;
	private String description;
	private String link;
	private long date;

	public Notification(){}

	public Notification(String header, String description, String link, long date) {
		this.header = header;
		this.description = description;
		this.link = link;
		this.date = date;
	}

	public long getDate() {
		return date;
	}

	@Override
	public int hashCode() {
		return id.hashCode();
	}

	public String getHeader() {
		return header;
	}

	public String getDescription() {
		return description;
	}

	public String getLink() {
		return link;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}
}


text:
package com.facebook.buck.python;

import com.facebook.buck.file.WriteFile;
import com.facebook.buck.rules.BuildContext;
import com.facebook.buck.rules.BuildRule;
import com.facebook.buck.rules.BuildRuleParams;
import com.facebook.buck.rules.BuildTargetSourcePath;
import com.facebook.buck.rules.BuildableContext;
import com.facebook.buck.rules.CommandTool;
import com.facebook.buck.rules.HasRuntimeDeps;
import com.facebook.buck.rules.SourcePathResolver;
import com.facebook.buck.rules.SymlinkTree;
import com.facebook.buck.rules.Tool;
import com.facebook.buck.step.Step;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSortedSet;

import java.nio.file.Path;

import javax.annotation.Nullable;

public class PythonInPlaceBinary extends PythonBinary implements HasRuntimeDeps {

  private final WriteFile script;
  private final SymlinkTree linkTree;
  private final PythonPackageComponents components;

  public PythonInPlaceBinary(
      BuildRuleParams params,
      SourcePathResolver resolver,
      WriteFile script,
      SymlinkTree linkTree,
      String mainModule,
      PythonPackageComponents components) {
    super(params, resolver, mainModule, components);
    this.script = script;
    this.linkTree = linkTree;
    this.components = components;
  }

  @Override
  public ImmutableList<Step> getBuildSteps(
      BuildContext context,
      BuildableContext buildableContext) {
    return ImmutableList.of();
  }

  @Nullable
  @Override
  public Path getPathToOutput() {
    return null;
  }

  @Override
  public Tool getExecutableCommand() {
    return new CommandTool.Builder()
        .addArg(new BuildTargetSourcePath(script.getBuildTarget()))
        .addInput(new BuildTargetSourcePath(linkTree.getBuildTarget()))
        .addInputs(components.getModules().values())
        .addInputs(components.getResources().values())
        .addInputs(components.getNativeLibraries().values())
        .build();
  }

  @Override
  public ImmutableSortedSet<BuildRule> getRuntimeDeps() {
    return ImmutableSortedSet.<BuildRule>naturalOrder()
        .add(script)
        .add(linkTree)
        .addAll(getResolver().filterBuildRuleInputs(components.getModules().values()))
        .addAll(getResolver().filterBuildRuleInputs(components.getResources().values()))
        .addAll(getResolver().filterBuildRuleInputs(components.getNativeLibraries().values()))
        .build();
  }

}


text:
pygtrieVersion=1.1

pygtrieFilename=pygtrie-$pygtrieVersion
pygtrie=https://pypi.python.org/packages/8f/e0/d98fddba69045e049cb535a735c9dafbbd1812bb2d5bb4f0f4c96b34f99d/$pygtrieFilename.tar.gz
rm -rf lib
mkdir lib
cd lib
curl -o ./pygtrie.tar.gz $pygtrie
tar -xf pygtrie.tar.gz
mv -f $pygtrieFilename/* ./
rm -rf $pygtrieFilename
rm pygtrie.tar.gz

#mkdir digWorkflow
#cp ../digWorkflow/* ./digWorkflow/
#mkdir digEntityMerger
#cp $entity/digEntityMerger/*.py ./digEntityMerger/
zip -r python-lib.zip *
cd ..


text:
package javax.swing;

import java.awt.Color;
import java.awt.Graphics;

import java.text.Format;
import java.text.NumberFormat;

import java.io.Serializable;
import java.io.ObjectOutputStream;
import java.io.ObjectInputStream;
import java.io.IOException;

import javax.swing.event.*;
import javax.accessibility.*;
import javax.swing.plaf.ProgressBarUI;

/**
 * A component that visually displays the progress of some task.  As the task
 * progresses towards completion, the progress bar displays the
 * task's percentage of completion.
 * This percentage is typically represented visually by a rectangle which
 * starts out empty and gradually becomes filled in as the task progresses.
 * In addition, the progress bar can display a textual representation of this
 * percentage.
 *

 * {@code JProgressBar} uses a {@code BoundedRangeModel} as its data model,
 * with the {@code value} property representing the "current" state of the task,
 * and the {@code minimum} and {@code maximum} properties representing the
 * beginning and end points, respectively.
 *

 * To indicate that a task of unknown length is executing,
 * you can put a progress bar into indeterminate mode.
 * While the bar is in indeterminate mode,
 * it animates constantly to show that work is occurring.
 * As soon as you can determine the task's length and amount of progress,
 * you should update the progress bar's value
 * and switch it back to determinate mode.
 *
 *

 *
 * Here is an example of creating a progress bar,
 * where task is an object (representing some piece of work)
 * which returns information about the progress of the task:
 *
 *

 *progressBar = new JProgressBar(0, task.getLengthOfTask());
 *progressBar.setValue(0);
 *progressBar.setStringPainted(true);
 *

 *
 * Here is an example of querying the current state of the task, and using
 * the returned value to update the progress bar:
 *
 *

 *progressBar.setValue(task.getCurrent());
 *

 *
 * Here is an example of putting a progress bar into
 * indeterminate mode,
 * and then switching back to determinate mode
 * once the length of the task is known:
 *
 *

 *progressBar = new JProgressBar();
 *...//when the task of (initially) unknown length begins:
 *progressBar.setIndeterminate(true);
 *...//do some work; get length of task...
 *progressBar.setMaximum(newLength);
 *progressBar.setValue(newValue);
 *progressBar.setIndeterminate(false);
 *

 *
 *

 *
 * For complete examples and further documentation see
 * How to Monitor Progress,
 * a section in The Java Tutorial.
 *
 *

 * Warning: Swing is not thread safe. For more
 * information see Swing's Threading
 * Policy.
 *

 * Warning:
 * Serialized objects of this class will not be compatible with
 * future Swing releases. The current serialization support is
 * appropriate for short term storage or RMI between applications running
 * the same version of Swing.  As of 1.4, support for long term storage
 * of all JavaBeansTM
 * has been added to the java.beans package.
 * Please see {@link java.beans.XMLEncoder}.
 *
 * @see javax.swing.plaf.basic.BasicProgressBarUI
 * @see javax.swing.BoundedRangeModel
 * @see javax.swing.SwingWorker
 *
 * @beaninfo
 *      attribute: isContainer false
 *    description: A component that displays an integer value.
 *
 * @author Michael C. Albers
 * @author Kathy Walrath
 */
public class JProgressBar extends JComponent implements SwingConstants, Accessible
{
    /**
     * @see #getUIClassID
     */
    private static final String uiClassID = "ProgressBarUI";

    /**
     * Whether the progress bar is horizontal or vertical.
     * The default is HORIZONTAL.
     *
     * @see #setOrientation
     */
    protected int orientation;

    /**
     * Whether to display a border around the progress bar.
     * The default is true.
     *
     * @see #setBorderPainted
     */
    protected boolean paintBorder;

    /**
     * The object that holds the data for the progress bar.
     *
     * @see #setModel
     */
    protected BoundedRangeModel model;

    /**
     * An optional string that can be displayed on the progress bar.
     * The default is null. Setting this to a non-null
     * value does not imply that the string will be displayed.
     * To display the string, {@code paintString} must be {@code true}.
     *
     * @see #setString
     * @see #setStringPainted
     */
    protected String progressString;

    /**
     * Whether to display a string of text on the progress bar.
     * The default is false.
     * Setting this to true causes a textual
     * display of the progress to be rendered on the progress bar. If
     * the progressString is null,
     * the percentage of completion is displayed on the progress bar.
     * Otherwise, the progressString is
     * rendered on the progress bar.
     *
     * @see #setStringPainted
     * @see #setString
     */
    protected boolean paintString;

    /**
     * The default minimum for a progress bar is 0.
     */
    static final private int defaultMinimum = 0;
    /**
     * The default maximum for a progress bar is 100.
     */
    static final private int defaultMaximum = 100;
    /**
     * The default orientation for a progress bar is HORIZONTAL.
     */
    static final private int defaultOrientation = HORIZONTAL;

    /**
     * Only one ChangeEvent is needed per instance since the
     * event's only interesting property is the immutable source, which
     * is the progress bar.
     * The event is lazily created the first time that an
     * event notification is fired.
     *
     * @see #fireStateChanged
     */
    protected transient ChangeEvent changeEvent = null;

    /**
     * Listens for change events sent by the progress bar's model,
     * redispatching them
     * to change-event listeners registered upon
     * this progress bar.
     *
     * @see #createChangeListener
     */
    protected ChangeListener changeListener = null;

    /**
     * Format used when displaying percent complete.
     */
    private transient Format format;

    /**
     * Whether the progress bar is indeterminate (true) or
     * normal (false); the default is false.
     *
     * @see #setIndeterminate
     * @since 1.4
     */
    private boolean indeterminate;

   /**
     * Creates a horizontal progress bar
     * that displays a border but no progress string.
     * The initial and minimum values are 0,
     * and the maximum is 100.
     *
     * @see #setOrientation
     * @see #setBorderPainted
     * @see #setStringPainted
     * @see #setString
     * @see #setIndeterminate
     */
    public JProgressBar()
    {
        this(defaultOrientation);
    }

   /**
     * Creates a progress bar with the specified orientation,
     * which can be
     * either {@code SwingConstants.VERTICAL} or
     * {@code SwingConstants.HORIZONTAL}.
     * By default, a border is painted but a progress string is not.
     * The initial and minimum values are 0,
     * and the maximum is 100.
     *
     * @param orient  the desired orientation of the progress bar
     * @throws IllegalArgumentException if {@code orient} is an illegal value
     *
     * @see #setOrientation
     * @see #setBorderPainted
     * @see #setStringPainted
     * @see #setString
     * @see #setIndeterminate
     */
    public JProgressBar(int orient)
    {
        this(orient, defaultMinimum, defaultMaximum);
    }

    /**
     * Creates a horizontal progress bar
     * with the specified minimum and maximum.
     * Sets the initial value of the progress bar to the specified minimum.
     * By default, a border is painted but a progress string is not.
     *

     * The BoundedRangeModel that holds the progress bar's data
     * handles any issues that may arise from improperly setting the
     * minimum, initial, and maximum values on the progress bar.
     * See the {@code BoundedRangeModel} documentation for details.
     *
     * @param min  the minimum value of the progress bar
     * @param max  the maximum value of the progress bar
     *
     * @see BoundedRangeModel
     * @see #setOrientation
     * @see #setBorderPainted
     * @see #setStringPainted
     * @see #setString
     * @see #setIndeterminate
     */
    public JProgressBar(int min, int max)
    {
        this(defaultOrientation, min, max);
    }

    /**
     * Creates a progress bar using the specified orientation,
     * minimum, and maximum.
     * By default, a border is painted but a progress string is not.
     * Sets the initial value of the progress bar to the specified minimum.
     *

     * The BoundedRangeModel that holds the progress bar's data
     * handles any issues that may arise from improperly setting the
     * minimum, initial, and maximum values on the progress bar.
     * See the {@code BoundedRangeModel} documentation for details.
     *
     * @param orient  the desired orientation of the progress bar
     * @param min  the minimum value of the progress bar
     * @param max  the maximum value of the progress bar
     * @throws IllegalArgumentException if {@code orient} is an illegal value
     *
     * @see BoundedRangeModel
     * @see #setOrientation
     * @see #setBorderPainted
     * @see #setStringPainted
     * @see #setString
     * @see #setIndeterminate
     */
    public JProgressBar(int orient, int min, int max)
    {
        // Creating the model this way is a bit simplistic, but
        //  I believe that it is the the most common usage of this
        //  component - it's what people will expect.
        setModel(new DefaultBoundedRangeModel(min, 0, min, max));
        updateUI();

        setOrientation(orient);      // documented with set/getOrientation()
        setBorderPainted(true);      // documented with is/setBorderPainted()
        setStringPainted(false);     // see setStringPainted
        setString(null);             // see getString
        setIndeterminate(false);     // see setIndeterminate
    }

    /**
     * Creates a horizontal progress bar
     * that uses the specified model
     * to hold the progress bar's data.
     * By default, a border is painted but a progress string is not.
     *
     * @param newModel  the data model for the progress bar
     *
     * @see #setOrientation
     * @see #setBorderPainted
     * @see #setStringPainted
     * @see #setString
     * @see #setIndeterminate
     */
    public JProgressBar(BoundedRangeModel newModel)
    {
        setModel(newModel);
        updateUI();

        setOrientation(defaultOrientation);  // see setOrientation()
        setBorderPainted(true);              // see setBorderPainted()
        setStringPainted(false);             // see setStringPainted
        setString(null);                     // see getString
        setIndeterminate(false);             // see setIndeterminate
    }

    /**
     * Returns {@code SwingConstants.VERTICAL} or
     * {@code SwingConstants.HORIZONTAL}, depending on the orientation
     * of the progress bar. The default orientation is
     * {@code SwingConstants.HORIZONTAL}.
     *
     * @return HORIZONTAL or VERTICAL
     * @see #setOrientation
     */
    public int getOrientation() {
        return orientation;
    }

   /**
     * Sets the progress bar's orientation to newOrientation,
     * which must be {@code SwingConstants.VERTICAL} or
     * {@code SwingConstants.HORIZONTAL}. The default orientation
     * is {@code SwingConstants.HORIZONTAL}.
     *
     * @param  newOrientation  HORIZONTAL or VERTICAL
     * @exception      IllegalArgumentException    if newOrientation
     *                                              is an illegal value
     * @see #getOrientation
     *
     * @beaninfo
     *    preferred: true
     *        bound: true
     *    attribute: visualUpdate true
     *  description: Set the progress bar's orientation.
     */
    public void setOrientation(int newOrientation) {
        if (orientation != newOrientation) {
            switch (newOrientation) {
            case VERTICAL:
            case HORIZONTAL:
                int oldOrientation = orientation;
                orientation = newOrientation;
                firePropertyChange("orientation", oldOrientation, newOrientation);
                if (accessibleContext != null) {
                    accessibleContext.firePropertyChange(
                            AccessibleContext.ACCESSIBLE_STATE_PROPERTY,
                            ((oldOrientation == VERTICAL)
                             ? AccessibleState.VERTICAL
                             : AccessibleState.HORIZONTAL),
                            ((orientation == VERTICAL)
                             ? AccessibleState.VERTICAL
                             : AccessibleState.HORIZONTAL));
                }
                break;
            default:
                throw new IllegalArgumentException(newOrientation +
                                             " is not a legal orientation");
            }
            revalidate();
        }
    }

    /**
     * Returns the value of the stringPainted property.
     *
     * @return the value of the stringPainted property
     * @see    #setStringPainted
     * @see    #setString
     */
    public boolean isStringPainted() {
        return paintString;
    }

    /**
     * Sets the value of the stringPainted property,
     * which determines whether the progress bar
     * should render a progress string.
     * The default is false, meaning
     * no string is painted.
     * Some look and feels might not support progress strings
     * or might support them only when the progress bar is in determinate mode.
     *
     * @param   b       true if the progress bar should render a string
     * @see     #isStringPainted
     * @see     #setString
     * @beaninfo
     *        bound: true
     *    attribute: visualUpdate true
     *  description: Whether the progress bar should render a string.
     */
    public void setStringPainted(boolean b) {
        //PENDING: specify that string not painted when in indeterminate mode?
        //         or just leave that to the L&F?
        boolean oldValue = paintString;
        paintString = b;
        firePropertyChange("stringPainted", oldValue, paintString);
        if (paintString != oldValue) {
            revalidate();
            repaint();
        }
    }

    /**
     * Returns a {@code String} representation of the current progress.
     * By default, this returns a simple percentage {@code String} based on
     * the value returned from {@code getPercentComplete}.  An example
     * would be the "42%".  You can change this by calling {@code setString}.
     *
     * @return the value of the progress string, or a simple percentage string
     *         if the progress string is {@code null}
     * @see    #setString
     */
    public String getString(){
        if (progressString != null) {
            return progressString;
        } else {
            if (format == null) {
                format = NumberFormat.getPercentInstance();
            }
            return format.format(new Double(getPercentComplete()));
        }
    }

    /**
     * Sets the value of the progress string. By default,
     * this string is null, implying the built-in behavior of
     * using a simple percent string.
     * If you have provided a custom progress string and want to revert to
     * the built-in behavior, set the string back to null.
     *

     * The progress string is painted only if
     * the isStringPainted method returns true.
     *
     * @param  s       the value of the progress string
     * @see    #getString
     * @see    #setStringPainted
     * @see    #isStringPainted
     * @beaninfo
     *        bound: true
     *    attribute: visualUpdate true
     *  description: Specifies the progress string to paint
     */
    public void setString(String s){
        String oldValue = progressString;
        progressString = s;
        firePropertyChange("string", oldValue, progressString);
        if (progressString == null || oldValue == null || !progressString.equals(oldValue)) {
            repaint();
        }
    }

    /**
     * Returns the percent complete for the progress bar.
     * Note that this number is between 0.0 and 1.0.
     *
     * @return the percent complete for this progress bar
     */
    public double getPercentComplete() {
        long span = model.getMaximum() - model.getMinimum();
        double currentValue = model.getValue();
        double pc = (currentValue - model.getMinimum()) / span;
        return pc;
    }

    /**
     * Returns the borderPainted property.
     *
     * @return the value of the borderPainted property
     * @see    #setBorderPainted
     * @beaninfo
     *  description: Does the progress bar paint its border
     */
    public boolean isBorderPainted() {
        return paintBorder;
    }

    /**
     * Sets the borderPainted property, which is
     * true if the progress bar should paint its border.
     * The default value for this property is true.
     * Some look and feels might not implement painted borders;
     * they will ignore this property.
     *
     * @param   b       true if the progress bar
     *                  should paint its border;
     *                  otherwise, false
     * @see     #isBorderPainted
     * @beaninfo
     *        bound: true
     *    attribute: visualUpdate true
     *  description: Whether the progress bar should paint its border.
     */
    public void setBorderPainted(boolean b) {
        boolean oldValue = paintBorder;
        paintBorder = b;
        firePropertyChange("borderPainted", oldValue, paintBorder);
        if (paintBorder != oldValue) {
            repaint();
        }
    }

    /**
     * Paints the progress bar's border if the borderPainted
     * property is true.
     *
     * @param g  the Graphics context within which to paint the border
     * @see #paint
     * @see #setBorder
     * @see #isBorderPainted
     * @see #setBorderPainted
     */
    protected void paintBorder(Graphics g) {
        if (isBorderPainted()) {
            super.paintBorder(g);
        }
    }

    /**
     * Returns the look-and-feel object that renders this component.
     *
     * @return the ProgressBarUI object that renders this component
     */
    public ProgressBarUI getUI() {
        return (ProgressBarUI)ui;
    }

    /**
     * Sets the look-and-feel object that renders this component.
     *
     * @param ui  a ProgressBarUI object
     * @see UIDefaults#getUI
     * @beaninfo
     *        bound: true
     *       hidden: true
     *    attribute: visualUpdate true
     *  description: The UI object that implements the Component's LookAndFeel.
     */
    public void setUI(ProgressBarUI ui) {
        super.setUI(ui);
    }

    /**
     * Resets the UI property to a value from the current look and feel.
     *
     * @see JComponent#updateUI
     */
    public void updateUI() {
        setUI((ProgressBarUI)UIManager.getUI(this));
    }

    /**
     * Returns the name of the look-and-feel class that renders this component.
     *
     * @return the string "ProgressBarUI"
     * @see JComponent#getUIClassID
     * @see UIDefaults#getUI
     * @beaninfo
     *        expert: true
     *   description: A string that specifies the name of the look-and-feel class.
     */
    public String getUIClassID() {
        return uiClassID;
    }

    /* We pass each Change event to the listeners with the
     * the progress bar as the event source.
     *

     * Warning:
     * Serialized objects of this class will not be compatible with
     * future Swing releases. The current serialization support is
     * appropriate for short term storage or RMI between applications running
     * the same version of Swing.  As of 1.4, support for long term storage
     * of all JavaBeansTM
     * has been added to the java.beans package.
     * Please see {@link java.beans.XMLEncoder}.
     */
    private class ModelListener implements ChangeListener, Serializable {
        public void stateChanged(ChangeEvent e) {
            fireStateChanged();
        }
    }

    /**
     * Subclasses that want to handle change events
     * from the model differently
     * can override this to return
     * an instance of a custom ChangeListener implementation.
     * The default {@code ChangeListener} simply calls the
     * {@code fireStateChanged} method to forward {@code ChangeEvent}s
     * to the {@code ChangeListener}s that have been added directly to the
     * progress bar.
     *
     * @see #changeListener
     * @see #fireStateChanged
     * @see javax.swing.event.ChangeListener
     * @see javax.swing.BoundedRangeModel
     */
    protected ChangeListener createChangeListener() {
        return new ModelListener();
    }

    /**
     * Adds the specified ChangeListener to the progress bar.
     *
     * @param l the ChangeListener to add
     */
    public void addChangeListener(ChangeListener l) {
        listenerList.add(ChangeListener.class, l);
    }

    /**
     * Removes a ChangeListener from the progress bar.
     *
     * @param l the ChangeListener to remove
     */
    public void removeChangeListener(ChangeListener l) {
        listenerList.remove(ChangeListener.class, l);
    }

    /**
     * Returns an array of all the ChangeListeners added
     * to this progress bar with addChangeListener.
     *
     * @return all of the ChangeListeners added or an empty
     *         array if no listeners have been added
     * @since 1.4
     */
    public ChangeListener[] getChangeListeners() {
        return listenerList.getListeners(ChangeListener.class);
    }

    /**
     * Send a {@code ChangeEvent}, whose source is this {@code JProgressBar}, to
     * all {@code ChangeListener}s that have registered interest in
     * {@code ChangeEvent}s.
     * This method is called each time a {@code ChangeEvent} is received from
     * the model.
     *

     *
     * The event instance is created if necessary, and stored in
     * {@code changeEvent}.
     *
     * @see #addChangeListener
     * @see EventListenerList
     */
    protected void fireStateChanged() {
        // Guaranteed to return a non-null array
        Object[] listeners = listenerList.getListenerList();
        // Process the listeners last to first, notifying
        // those that are interested in this event
        for (int i = listeners.length-2; i>=0; i-=2) {
            if (listeners[i]==ChangeListener.class) {
                // Lazily create the event:
                if (changeEvent == null)
                    changeEvent = new ChangeEvent(this);
                ((ChangeListener)listeners[i+1]).stateChanged(changeEvent);
            }
        }
    }

    /**
     * Returns the data model used by this progress bar.
     *
     * @return the BoundedRangeModel currently in use
     * @see #setModel
     * @see    BoundedRangeModel
     */
    public BoundedRangeModel getModel() {
        return model;
    }

    /**
     * Sets the data model used by the JProgressBar.
     * Note that the {@code BoundedRangeModel}'s {@code extent} is not used,
     * and is set to {@code 0}.
     *
     * @param  newModel the BoundedRangeModel to use
     *
     * @beaninfo
     *    expert: true
     * description: The data model used by the JProgressBar.
     */
    public void setModel(BoundedRangeModel newModel) {
        // PENDING(???) setting the same model to multiple bars is broken; listeners
        BoundedRangeModel oldModel = getModel();

        if (newModel != oldModel) {
            if (oldModel != null) {
                oldModel.removeChangeListener(changeListener);
                changeListener = null;
            }

            model = newModel;

            if (newModel != null) {
                changeListener = createChangeListener();
                newModel.addChangeListener(changeListener);
            }

            if (accessibleContext != null) {
                accessibleContext.firePropertyChange(
                        AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
                        (oldModel== null
                         ? null : Integer.valueOf(oldModel.getValue())),
                        (newModel== null
                         ? null : Integer.valueOf(newModel.getValue())));
            }

            if (model != null) {
                model.setExtent(0);
            }
            repaint();
        }
    }

    /* All of the model methods are implemented by delegation. */

    /**
     * Returns the progress bar's current {@code value}
     * from the BoundedRangeModel.
     * The value is always between the
     * minimum and maximum values, inclusive.
     *
     * @return  the current value of the progress bar
     * @see     #setValue
     * @see     BoundedRangeModel#getValue
     */
    public int getValue() { return getModel().getValue(); }

    /**
     * Returns the progress bar's {@code minimum} value
     * from the BoundedRangeModel.
     *
     * @return  the progress bar's minimum value
     * @see     #setMinimum
     * @see     BoundedRangeModel#getMinimum
     */
    public int getMinimum() { return getModel().getMinimum(); }

    /**
     * Returns the progress bar's {@code maximum} value
     * from the BoundedRangeModel.
     *
     * @return  the progress bar's maximum value
     * @see     #setMaximum
     * @see     BoundedRangeModel#getMaximum
     */
    public int getMaximum() { return getModel().getMaximum(); }

    /**
     * Sets the progress bar's current value to {@code n}.  This method
     * forwards the new value to the model.
     *

     * The data model (an instance of {@code BoundedRangeModel})
     * handles any mathematical
     * issues arising from assigning faulty values.  See the
     * {@code BoundedRangeModel} documentation for details.
     *

     * If the new value is different from the previous value,
     * all change listeners are notified.
     *
     * @param   n       the new value
     * @see     #getValue
     * @see     #addChangeListener
     * @see     BoundedRangeModel#setValue
     * @beaninfo
     *    preferred: true
     *  description: The progress bar's current value.
     */
    public void setValue(int n) {
        BoundedRangeModel brm = getModel();
        int oldValue = brm.getValue();
        brm.setValue(n);

        if (accessibleContext != null) {
            accessibleContext.firePropertyChange(
                    AccessibleContext.ACCESSIBLE_VALUE_PROPERTY,
                    Integer.valueOf(oldValue),
                    Integer.valueOf(brm.getValue()));
        }
    }

    /**
     * Sets the progress bar's minimum value
     * (stored in the progress bar's data model) to n.
     *

     * The data model (a BoundedRangeModel instance)
     * handles any mathematical
     * issues arising from assigning faulty values.
     * See the {@code BoundedRangeModel} documentation for details.
     *

     * If the minimum value is different from the previous minimum,
     * all change listeners are notified.
     *
     * @param  n       the new minimum
     * @see    #getMinimum
     * @see    #addChangeListener
     * @see    BoundedRangeModel#setMinimum
     * @beaninfo
     *  preferred: true
     * description: The progress bar's minimum value.
     */
    public void setMinimum(int n) { getModel().setMinimum(n); }

    /**
     * Sets the progress bar's maximum value
     * (stored in the progress bar's data model) to n.
     *

     * The underlying BoundedRangeModel handles any mathematical
     * issues arising from assigning faulty values.
     * See the {@code BoundedRangeModel} documentation for details.
     *

     * If the maximum value is different from the previous maximum,
     * all change listeners are notified.
     *
     * @param  n       the new maximum
     * @see    #getMaximum
     * @see    #addChangeListener
     * @see    BoundedRangeModel#setMaximum
     * @beaninfo
     *    preferred: true
     *  description: The progress bar's maximum value.
     */
    public void setMaximum(int n) { getModel().setMaximum(n); }

    /**
     * Sets the indeterminate property of the progress bar,
     * which determines whether the progress bar is in determinate
     * or indeterminate mode.
     * An indeterminate progress bar continuously displays animation
     * indicating that an operation of unknown length is occurring.
     * By default, this property is false.
     * Some look and feels might not support indeterminate progress bars;
     * they will ignore this property.
     *
     *

     *
     * See
     * How to Monitor Progress
     * for examples of using indeterminate progress bars.
     *
     * @param newValue  true if the progress bar
     *                  should change to indeterminate mode;
     *                  false if it should revert to normal.
     *
     * @see #isIndeterminate
     * @see javax.swing.plaf.basic.BasicProgressBarUI
     *
     * @since 1.4
     *
     * @beaninfo
     *        bound: true
     *    attribute: visualUpdate true
     *  description: Set whether the progress bar is indeterminate (true)
     *               or normal (false).
     */
    public void setIndeterminate(boolean newValue) {
        boolean oldValue = indeterminate;
        indeterminate = newValue;
        firePropertyChange("indeterminate", oldValue, indeterminate);
    }

    /**
     * Returns the value of the indeterminate property.
     *
     * @return the value of the indeterminate property
     * @see    #setIndeterminate
     *
     * @since 1.4
     *
     * @beaninfo
     *  description: Is the progress bar indeterminate (true)
     *               or normal (false)?
     */
    public boolean isIndeterminate() {
        return indeterminate;
    }

    /**
     * See readObject() and writeObject() in JComponent for more
     * information about serialization in Swing.
     */
    private void writeObject(ObjectOutputStream s) throws IOException {
        s.defaultWriteObject();
        if (getUIClassID().equals(uiClassID)) {
            byte count = JComponent.getWriteObjCounter(this);
            JComponent.setWriteObjCounter(this, --count);
            if (count == 0 && ui != null) {
                ui.installUI(this);
            }
        }
    }

    /**
     * Returns a string representation of this JProgressBar.
     * This method is intended to be used only for debugging purposes. The
     * content and format of the returned string may vary between
     * implementations. The returned string may be empty but may not
     * be null.
     *
     * @return  a string representation of this JProgressBar
     */
    protected String paramString() {
        String orientationString = (orientation == HORIZONTAL ?
                                    "HORIZONTAL" : "VERTICAL");
        String paintBorderString = (paintBorder ?
                                    "true" : "false");
        String progressStringString = (progressString != null ?
                                       progressString : "");
        String paintStringString = (paintString ?
                                    "true" : "false");
        String indeterminateString = (indeterminate ?
                                    "true" : "false");

        return super.paramString() +
        ",orientation=" + orientationString +
        ",paintBorder=" + paintBorderString +
        ",paintString=" + paintStringString +
        ",progressString=" + progressStringString +
        ",indeterminateString=" + indeterminateString;
    }

/////////////////
// Accessibility support
////////////////

    /**
     * Gets the AccessibleContext associated with this
     * JProgressBar. For progress bars, the
     * AccessibleContext takes the form of an
     * AccessibleJProgressBar.
     * A new AccessibleJProgressBar instance is created if necessary.
     *
     * @return an AccessibleJProgressBar that serves as the
     *         AccessibleContext of this JProgressBar
     * @beaninfo
     *       expert: true
     *  description: The AccessibleContext associated with this ProgressBar.
     */
    public AccessibleContext getAccessibleContext() {
        if (accessibleContext == null) {
            accessibleContext = new AccessibleJProgressBar();
        }
        return accessibleContext;
    }

    /**
     * This class implements accessibility support for the
     * JProgressBar class.  It provides an implementation of the
     * Java Accessibility API appropriate to progress bar user-interface
     * elements.
     *

     * Warning:
     * Serialized objects of this class will not be compatible with
     * future Swing releases. The current serialization support is
     * appropriate for short term storage or RMI between applications running
     * the same version of Swing.  As of 1.4, support for long term storage
     * of all JavaBeansTM
     * has been added to the java.beans package.
     * Please see {@link java.beans.XMLEncoder}.
     */
    protected class AccessibleJProgressBar extends AccessibleJComponent
        implements AccessibleValue {

        /**
         * Gets the state set of this object.
         *
         * @return an instance of AccessibleState containing the current state
         * of the object
         * @see AccessibleState
         */
        public AccessibleStateSet getAccessibleStateSet() {
            AccessibleStateSet states = super.getAccessibleStateSet();
            if (getModel().getValueIsAdjusting()) {
                states.add(AccessibleState.BUSY);
            }
            if (getOrientation() == VERTICAL) {
                states.add(AccessibleState.VERTICAL);
            } else {
                states.add(AccessibleState.HORIZONTAL);
            }
            return states;
        }

        /**
         * Gets the role of this object.
         *
         * @return an instance of AccessibleRole describing the role of the
         * object
         */
        public AccessibleRole getAccessibleRole() {
            return AccessibleRole.PROGRESS_BAR;
        }

        /**
         * Gets the AccessibleValue associated with this object.  In the
         * implementation of the Java Accessibility API for this class,
         * returns this object, which is responsible for implementing the
         * AccessibleValue interface on behalf of itself.
         *
         * @return this object
         */
        public AccessibleValue getAccessibleValue() {
            return this;
        }

        /**
         * Gets the accessible value of this object.
         *
         * @return the current value of this object
         */
        public Number getCurrentAccessibleValue() {
            return Integer.valueOf(getValue());
        }

        /**
         * Sets the value of this object as a Number.
         *
         * @return true if the value was set
         */
        public boolean setCurrentAccessibleValue(Number n) {
            // TIGER- 4422535
            if (n == null) {
                return false;
            }
            setValue(n.intValue());
            return true;
        }

        /**
         * Gets the minimum accessible value of this object.
         *
         * @return the minimum value of this object
         */
        public Number getMinimumAccessibleValue() {
            return Integer.valueOf(getMinimum());
        }

        /**
         * Gets the maximum accessible value of this object.
         *
         * @return the maximum value of this object
         */
        public Number getMaximumAccessibleValue() {
            // TIGER - 4422362
            return Integer.valueOf(model.getMaximum() - model.getExtent());
        }

    } // AccessibleJProgressBar
}


text:
package fakes

import (
	"github.com/cloudfoundry/cli/cf/errors"
	"github.com/cloudfoundry/cli/cf/models"
)

type FakeDomainRepository struct {
	ListDomainsForOrgGuid        string
	ListDomainsForOrgDomains     []models.DomainFields
	ListDomainsForOrgApiResponse error

	FindByNameInOrgName        string
	FindByNameInOrgGuid        string
	FindByNameInOrgDomain      models.DomainFields
	FindByNameInOrgApiResponse error

	FindByNameName     string
	FindByNameDomain   models.DomainFields
	FindByNameNotFound bool
	FindByNameErr      bool

	CreateDomainName          string
	CreateDomainOwningOrgGuid string

	CreateSharedDomainName string

	DeleteDomainGuid  string
	DeleteApiResponse error

	DeleteSharedDomainGuid  string
	DeleteSharedApiResponse error
}

func (repo *FakeDomainRepository) ListDomainsForOrg(orgGuid string, cb func(models.DomainFields) bool) error {
	repo.ListDomainsForOrgGuid = orgGuid
	for _, d := range repo.ListDomainsForOrgDomains {
		cb(d)
	}
	return repo.ListDomainsForOrgApiResponse
}

func (repo *FakeDomainRepository) FindByName(name string) (domain models.DomainFields, apiErr error) {
	repo.FindByNameName = name
	domain = repo.FindByNameDomain

	if repo.FindByNameNotFound {
		apiErr = errors.NewModelNotFoundError("Domain", name)
	}
	if repo.FindByNameErr {
		apiErr = errors.New("Error finding domain")
	}

	return
}

func (repo *FakeDomainRepository) FindByNameInOrg(name string, owningOrgGuid string) (domain models.DomainFields, apiErr error) {
	repo.FindByNameInOrgName = name
	repo.FindByNameInOrgGuid = owningOrgGuid
	domain = repo.FindByNameInOrgDomain
	apiErr = repo.FindByNameInOrgApiResponse
	return
}

func (repo *FakeDomainRepository) Create(domainName string, owningOrgGuid string) (createdDomain models.DomainFields, apiErr error) {
	repo.CreateDomainName = domainName
	repo.CreateDomainOwningOrgGuid = owningOrgGuid
	return
}

func (repo *FakeDomainRepository) CreateSharedDomain(domainName string) (apiErr error) {
	repo.CreateSharedDomainName = domainName
	return
}

func (repo *FakeDomainRepository) Delete(domainGuid string) (apiErr error) {
	repo.DeleteDomainGuid = domainGuid
	apiErr = repo.DeleteApiResponse
	return
}

func (repo *FakeDomainRepository) DeleteSharedDomain(domainGuid string) (apiErr error) {
	repo.DeleteSharedDomainGuid = domainGuid
	apiErr = repo.DeleteSharedApiResponse
	return
}

func (repo *FakeDomainRepository) FirstOrDefault(orgGuid string, name *string) (domain models.DomainFields, error error) {
	if name == nil {
		domain, error = repo.defaultDomain(orgGuid)
	} else {
		domain, error = repo.FindByNameInOrg(*name, orgGuid)
	}
	return
}

func (repo *FakeDomainRepository) defaultDomain(orgGuid string) (models.DomainFields, error) {
	var foundDomain *models.DomainFields
	repo.ListDomainsForOrg(orgGuid, func(domain models.DomainFields) bool {
		foundDomain = &domain
		return !domain.Shared
	})

	if foundDomain == nil {
		return models.DomainFields{}, errors.New("Could not find a default domain")
	}

	return *foundDomain, nil
}


text:
from flask.ext.wtf import Form
from wtforms import (TextField, BooleanField,
                     TextAreaField, SelectField)
from wtforms_components import TimeField
from wtforms.validators import Required, Optional

class AddSession(Form):
    name = TextField(u'Nombre de la sesión:',
                     [Required(u'Ingrese el nombre de la sesión')])
    topic = TextField(u'Tópico de la sesión:',
                      [Required(u'Ingrese el nombre del tópico')])
    description = TextAreaField(u'Descripción de la sesión:')
    session_type = SelectField(u'Tipo de sesión', coerce=int,
                               choices=[])
    fas = SelectField(u'Ponente',
                      choices=[])
    room_id = SelectField(u'Sala', coerce=int,
                          choices=[])
    day = SelectField(u'Ingrese el día', coerce=int, choices=[
                      (23, '23'),
                      (24, '24'),
                      (25, '25')])
    time_start = TimeField(u'Hora de inicio', [Optional()])
    time_end = TimeField(u'Hora de fin', [Optional()])

    active = BooleanField(u'Activo?:')

class AddBarcamp(Form):
    session_id = SelectField(u'Elija su sesión preferida',
                             coerce=int,
                             choices=[])


text:
package software.amazon.awssdk.codegen.model.intermediate;

import software.amazon.awssdk.codegen.internal.TypeUtils;

public class ListModel {

    private String implType;

    private String memberType;

    private String interfaceType;

    private MemberModel listMemberModel;

    private String memberLocationName;

    private String memberAdditionalMarshallingPath;

    private String memberAdditionalUnmarshallingPath;

    public ListModel() {
    }

    public ListModel(String memberType,
                     String memberLocationName,
                     String implType,
                     String interfaceType,
                     MemberModel listMemberModel) {

        this.memberType = memberType;
        this.memberLocationName = memberLocationName;
        this.implType = implType;
        this.interfaceType = interfaceType;
        this.listMemberModel = listMemberModel;
    }

    public String getImplType() {
        return implType;
    }

    public void setImplType(String implType) {
        this.implType = implType;
    }

    public String getMemberType() {
        return memberType;
    }

    public void setMemberType(String memberType) {
        this.memberType = memberType;
    }

    public String getInterfaceType() {
        return interfaceType;
    }

    public void setInterfaceType(String interfaceType) {
        this.interfaceType = interfaceType;
    }

    public MemberModel getListMemberModel() {
        return listMemberModel;
    }

    public void setListMemberModel(MemberModel listMemberModel) {
        this.listMemberModel = listMemberModel;
    }

    public String getMemberLocationName() {
        return memberLocationName;
    }

    public void setMemberLocationName(String memberLocationName) {
        this.memberLocationName = memberLocationName;
    }

    public String getMemberAdditionalMarshallingPath() {
        return memberAdditionalMarshallingPath;
    }

    public void setMemberAdditionalMarshallingPath(
            String memberAdditionalMarshallingPath) {
        this.memberAdditionalMarshallingPath = memberAdditionalMarshallingPath;
    }

    public String getMemberAdditionalUnmarshallingPath() {
        return memberAdditionalUnmarshallingPath;
    }

    public void setMemberAdditionalUnmarshallingPath(
            String memberAdditionalUnmarshallingPath) {
        this.memberAdditionalUnmarshallingPath = memberAdditionalUnmarshallingPath;
    }

    public boolean isSimple() {
        return TypeUtils.isSimple(memberType);
    }

    public boolean isMap() {
        return memberType.startsWith(TypeUtils
                                             .getDataTypeMapping(TypeUtils.TypeKey.MAP_INTERFACE));
    }

    public String getTemplateType() {
        return interfaceType + "<" + memberType + ">";
    }

    public String getTemplateImplType() {
        return implType + "<" + memberType + ">";
    }

    public String getSimpleType() {
        int startIndex = memberType.lastIndexOf('.');
        return memberType.substring(startIndex + 1);
    }
}