text:
/**
 * DO NOT EDIT
 *
 * This file was automatically generated by
 *   https://github.com/Polymer/tools/tree/master/packages/gen-typescript-declarations
 *
 * To modify these typings, edit the source file(s):
 *   lib/elements/dom-repeat.js
 */

// tslint:disable:variable-name Describing an API that's defined elsewhere.
// tslint:disable:no-any describes the API as best we are able today

import {PolymerElement} from '../../polymer-element.js';

import {TemplateInstanceBase, templatize, modelForElement as modelForElement$0} from '../utils/templatize.js';

import {Debouncer} from '../utils/debounce.js';

import {enqueueDebouncer, flush} from '../utils/flush.js';

import {OptionalMutableData} from '../mixins/mutable-data.js';

import {matches, translate} from '../utils/path.js';

import {timeOut, microTask} from '../utils/async.js';

export {DomRepeat};

/**
 * The `<dom-repeat>` element will automatically stamp and binds one instance
 * of template content to each object in a user-provided array.
 * `dom-repeat` accepts an `items` property, and one instance of the template
 * is stamped for each item into the DOM at the location of the `dom-repeat`
 * element.  The `item` property will be set on each instance's binding
 * scope, thus templates should bind to sub-properties of `item`.
 *
 * Example:
 *
 * ```html
 * <dom-module id="employee-list">
 *
 *   <template>
 *
 *     <div> Employee list: </div>
 *     <dom-repeat items="{{employees}}">
 *       <template>
 *         <div>First name: <span>{{item.first}}</span></div>
 *         <div>Last name: <span>{{item.last}}</span></div>
 *       </template>
 *     </dom-repeat>
 *
 *   </template>
 *
 * </dom-module>
 * ```
 *
 * With the following custom element definition:
 *
 * ```js
 * class EmployeeList extends PolymerElement {
 *   static get is() { return 'employee-list'; }
 *   static get properties() {
 *     return {
 *       employees: {
 *         value() {
 *           return [
 *             {first: 'Bob', last: 'Smith'},
 *             {first: 'Sally', last: 'Johnson'},
 *             ...
 *           ];
 *         }
 *       }
 *     };
 *   }
 * }
 * ```
 *
 * Notifications for changes to items sub-properties will be forwarded to template
 * instances, which will update via the normal structured data notification system.
 *
 * Mutations to the `items` array itself should be made using the Array
 * mutation API's on the PropertyEffects mixin (`push`, `pop`, `splice`,
 * `shift`, `unshift`), and template instances will be kept in sync with the
 * data in the array.
 *
 * Events caught by event handlers within the `dom-repeat` template will be
 * decorated with a `model` property, which represents the binding scope for
 * each template instance.  The model should be used to manipulate data on the
 * instance, for example `event.model.set('item.checked', true);`.
 *
 * Alternatively, the model for a template instance for an element stamped by
 * a `dom-repeat` can be obtained using the `modelForElement` API on the
 * `dom-repeat` that stamped it, for example
 * `this.$.domRepeat.modelForElement(event.target).set('item.checked', true);`.
 * This may be useful for manipulating instance data of event targets obtained
 * by event handlers on parents of the `dom-repeat` (event delegation).
 *
 * A view-specific filter/sort may be applied to each `dom-repeat` by supplying a
 * `filter` and/or `sort` property.  This may be a string that names a function on
 * the host, or a function may be assigned to the property directly.  The functions
 * should implemented following the standard `Array` filter/sort API.
 *
 * In order to re-run the filter or sort functions based on changes to sub-fields
 * of `items`, the `observe` property may be set as a space-separated list of
 * `item` sub-fields that should cause a re-filter/sort when modified.  If
 * the filter or sort function depends on properties not contained in `items`,
 * the user should observe changes to those properties and call `render` to update
 * the view based on the dependency change.
 *
 * For example, for an `dom-repeat` with a filter of the following:
 *
 * ```js
 * isEngineer(item) {
 *   return item.type == 'engineer' || item.manager.type == 'engineer';
 * }
 * ```
 *
 * Then the `observe` property should be configured as follows:
 *
 * ```html
 * <dom-repeat items="{{employees}}" filter="isEngineer" observe="type manager.type">
 * ```
 */
declare class DomRepeat extends
  OptionalMutableData(
  PolymerElement) {

  /**
   * An array containing items determining how many instances of the template
   * to stamp and that that each template instance should bind to.
   */
  items: any[]|null|undefined;

  /**
   * The name of the variable to add to the binding scope for the array
   * element associated with a given template instance.
   */
  as: string|null|undefined;

  /**
   * The name of the variable to add to the binding scope with the index
   * of the instance in the sorted and filtered list of rendered items.
   * Note, for the index in the `this.items` array, use the value of the
   * `itemsIndexAs` property.
   */
  indexAs: string|null|undefined;

  /**
   * The name of the variable to add to the binding scope with the index
   * of the instance in the `this.items` array. Note, for the index of
   * this instance in the sorted and filtered list of rendered items,
   * use the value of the `indexAs` property.
   */
  itemsIndexAs: string|null|undefined;

  /**
   * A function that should determine the sort order of the items.  This
   * property should either be provided as a string, indicating a method
   * name on the element's host, or else be an actual function.  The
   * function should match the sort function passed to `Array.sort`.
   * Using a sort function has no effect on the underlying `items` array.
   */
  sort: Function|null|undefined;

  /**
   * A function that can be used to filter items out of the view.  This
   * property should either be provided as a string, indicating a method
   * name on the element's host, or else be an actual function.  The
   * function should match the sort function passed to `Array.filter`.
   * Using a filter function has no effect on the underlying `items` array.
   */
  filter: Function|null|undefined;

  /**
   * When using a `filter` or `sort` function, the `observe` property
   * should be set to a space-separated list of the names of item
   * sub-fields that should trigger a re-sort or re-filter when changed.
   * These should generally be fields of `item` that the sort or filter
   * function depends on.
   */
  observe: string|null|undefined;

  /**
   * When using a `filter` or `sort` function, the `delay` property
   * determines a debounce time in ms after a change to observed item
   * properties that must pass before the filter or sort is re-run.
   * This is useful in rate-limiting shuffling of the view when
   * item changes may be frequent.
   */
  delay: number|null|undefined;

  /**
   * Count of currently rendered items after `filter` (if any) has been applied.
   * If "chunking mode" is enabled, `renderedItemCount` is updated each time a
   * set of template instances is rendered.
   */
  readonly renderedItemCount: number|null|undefined;

  /**
   * Defines an initial count of template instances to render after setting
   * the `items` array, before the next paint, and puts the `dom-repeat`
   * into "chunking mode".  The remaining items will be created and rendered
   * incrementally at each animation frame therof until all instances have
   * been rendered.
   */
  initialCount: number|null|undefined;

  /**
   * When `initialCount` is used, this property defines a frame rate (in
   * fps) to target by throttling the number of instances rendered each
   * frame to not exceed the budget for the target frame rate.  The
   * framerate is effectively the number of `requestAnimationFrame`s that
   * it tries to allow to actually fire in a given second. It does this
   * by measuring the time between `rAF`s and continuously adjusting the
   * number of items created each `rAF` to maintain the target framerate.
   * Setting this to a higher number allows lower latency and higher
   * throughput for event handlers and other tasks, but results in a
   * longer time for the remaining items to complete rendering.
   */
  targetFramerate: number|null|undefined;
  readonly _targetFrameTime: number|null|undefined;
  connectedCallback(): void;
  disconnectedCallback(): void;

  /**
   * Forces the element to render its content. Normally rendering is
   * asynchronous to a provoking change. This is done for efficiency so
   * that multiple changes trigger only a single render. The render method
   * should be called if, for example, template rendering is required to
   * validate application state.
   */
  render(): void;

  /**
   * Shows or hides the template instance top level child elements. For
   * text nodes, `textContent` is removed while "hidden" and replaced when
   * "shown."
   *
   * @param hidden Set to true to hide the children;
   * set to false to show them.
   */
  _showHideChildren(hidden: boolean): void;

  /**
   * Returns the item associated with a given element stamped by
   * this `dom-repeat`.
   *
   * Note, to modify sub-properties of the item,
   * `modelForElement(el).set('item.<sub-prop>', value)`
   * should be used.
   *
   * @param el Element for which to return the item.
   * @returns Item associated with the element.
   */
  itemForElement(el: HTMLElement): any;

  /**
   * Returns the inst index for a given element stamped by this `dom-repeat`.
   * If `sort` is provided, the index will reflect the sorted order (rather
   * than the original array order).
   *
   * @param el Element for which to return the index.
   * @returns Row index associated with the element (note this may
   *   not correspond to the array index if a user `sort` is applied).
   */
  indexForElement(el: HTMLElement): number|null;

  /**
   * Returns the template "model" associated with a given element, which
   * serves as the binding scope for the template instance the element is
   * contained in. A template model
   * should be used to manipulate data associated with this template instance.
   *
   * Example:
   *
   *   let model = modelForElement(el);
   *   if (model.index < 10) {
   *     model.set('item.checked', true);
   *   }
   *
   * @param el Element for which to return a template model.
   * @returns Model representing the binding scope for
   *   the element.
   */
  modelForElement(el: HTMLElement): TemplateInstanceBase|null;
}

declare global {

  interface HTMLElementTagNameMap {
    "dom-repeat": DomRepeat;
  }
}


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<title>All Classes (ParseTwitterUtils 1.10.3 API)</title>
<meta name="date" content="2015-10-09">
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">

All Classes

AsyncCallback

ParseTwitterUtils

Twitter

redpajama_set_name: RedPajamaGithub


text:
class AutocompleteLightException(Exception):
    """ Base Exception for all exceptions of this module. """
    pass

class AutocompleteNotRegistered(AutocompleteLightException):
    """ Attemps to drive the user to debug his registry. """
    def __init__(self, name, registry):
        if registry.keys():
            msg = '%s not registered, you have registered: %s' % (name,
                    list(registry.keys()))
        else:
            msg = '%s not registered (registry is empty)' % name

        super(AutocompleteNotRegistered, self).__init__(msg)

class AutocompleteArgNotUnderstood(AutocompleteLightException):
    """
    Raised by AutocompleteRegistry.get_autocomplete_from_arg when it cannot
    understand the argument.
    """
    def __init__(self, arg, registry):
        msg = '%s not understod by get_autocomplete_from_arg()' % arg
        super(AutocompleteArgNotUnderstood, self).__init__(msg)


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<TITLE>
Uses of Class org.apache.wicket.extensions.markup.html.tree.table.ColumnLocation.Alignment (Wicket Parent 1.5.7 API)
</TITLE>

<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../../../../../../stylesheet.css" TITLE="Style">

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Uses of Class
org.apache.wicket.extensions.markup.html.tree.table.ColumnLocation.Alignment

Packages that use ColumnLocation.Alignment

org.apache.wicket.extensions.markup.html.tree.table

Uses of ColumnLocation.Alignment in org.apache.wicket.extensions.markup.html.tree.table

Fields in org.apache.wicket.extensions.markup.html.tree.table declared as ColumnLocation.Alignment

static ColumnLocation.Alignment
ColumnLocation.Alignment.LEFT

          Align left.

static ColumnLocation.Alignment
ColumnLocation.Alignment.MIDDLE

          Align middle.

static ColumnLocation.Alignment
ColumnLocation.Alignment.RIGHT

          Align right.

Methods in org.apache.wicket.extensions.markup.html.tree.table that return ColumnLocation.Alignment

 ColumnLocation.Alignment
ColumnLocation.getAlignment()

          Returns the alignment of this column.

Constructors in org.apache.wicket.extensions.markup.html.tree.table with parameters of type ColumnLocation.Alignment

ColumnLocation(ColumnLocation.Alignment alignment,
               int size,
               ColumnLocation.Unit unit)

          Constructs the ColumnLocation object.

      Overview
      Package
      Class
    Use
      Tree
      Deprecated
      Index
      Help

 PREV
 NEXT

  FRAMES
 NO FRAMES

  All Classes

Copyright © 2006-2012 Apache Software Foundation. All Rights Reserved.


text:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<meta http-equiv="Content-Type" content="text/html" charset="utf-8">
<title>org.gradle.tooling (Gradle API 2.3)</title>
<meta name="date" content="2015-02-16">
<link rel="stylesheet" type="text/css" href="../../../javadoc.css" title="Style">

JavaScript is disabled on your browser.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes

Package org.gradle.tooling

The main interfaces and classes of the Gradle tooling API.

See: Description

Interface Summary

Interface
Description

BuildAction<T>

An action that executes against a Gradle build and produces a result of type T.

BuildActionExecuter<T>

Used to execute a BuildAction in the build process.

BuildController

Provides a BuildAction various ways to control a Gradle build and access information about the build.

BuildLauncher

A BuildLauncher allows you to configure and execute a Gradle build.

CancellationToken

Token that propagates notification that an operation should be cancelled.

CancellationTokenSource

A CancellationTokenSource allows you to issue cancellation requests to one or more LongRunningOperation
 instances.

LongRunningOperation

Offers ways to communicate both ways with a Gradle operation, be it building a model or running tasks.

ModelBuilder<T>

A ModelBuilder allows you to fetch a snapshot of some model for a project or a build.

ProgressEvent

Some information about a piece of work of a long running operation.

ProgressListener

A listener which is notified as some long running operation makes progress.

ProjectConnection

Represents a long-lived connection to a Gradle project.

ResultHandler<T>

A handler for an asynchronous operation which returns an object of type T.

Class Summary

Class
Description

GradleConnector

A GradleConnector is the main entry point to the Gradle tooling API.

Exception Summary

Exception
Description

BuildActionFailureException

Thrown when a BuildAction fails.

BuildCancelledException

Thrown when a LongRunningOperation is cancelled before the operation completes.

BuildException

Thrown when a Gradle build fails or when a model cannot be built.

GradleConnectionException

Thrown when there is some problem using a Gradle connection.

UnknownModelException

Thrown when the client is trying to acquire a model that is unknown to the Tooling API.

UnsupportedVersionException

Thrown when the target Gradle version does not support a particular feature.

Package org.gradle.tooling Description

The main interfaces and classes of the Gradle tooling API.

Overview

Package

Class

Tree

Deprecated

Index

Help

Prev Package

Next Package

Frames

No Frames

All Classes


text:
@interface DDModel : NSObject<NSCoding>

- (id)initWithDataDic:(NSDictionary*)data;
- (NSDictionary*)attributeMapDictionary;
- (void)setAttributes:(NSDictionary*)dataDic;
- (NSString *)customDescription;
- (NSString *)description;
- (NSData*)getArchivedData;
- (NSString *)cleanString:(NSString *)str;    //清除\n和\r的字符串

@end


text:
package info.izumin.android.bletia.action;

import android.bluetooth.BluetoothDevice;

import org.jdeferred.Promise;

import info.izumin.android.bletia.DeferredStrategy;
import info.izumin.android.bletia.core.BletiaException;
import info.izumin.android.bletia.core.StateContainer;
import info.izumin.android.bletia.core.action.AbstractConnectAction;
import info.izumin.android.bletia.core.wrapper.BluetoothDeviceWrapper;

/**
 * Created by izumin on 11/14/15.
 */
public class ConnectAction extends AbstractConnectAction<Promise<Void, BletiaException, Void>> {
    public static final String TAG = ConnectAction.class.getSimpleName();

    public ConnectAction(BluetoothDevice device, StateContainer container) {
        super(new DeferredStrategy<Void, BletiaException>(), new BluetoothDeviceWrapper(device), container);
    }
}


text:
package org.jenkinsci.plugins.spoontrigger;

import com.google.common.base.Function;
import com.google.common.base.Predicates;
import com.google.common.base.Strings;
import com.google.common.collect.FluentIterable;
import hudson.Extension;
import hudson.Util;
import hudson.model.AbstractProject;
import hudson.model.RootAction;
import hudson.model.UnprotectedRootAction;
import jenkins.model.Jenkins;
import net.sf.json.JSONException;
import net.sf.json.JSONObject;
import org.jenkinsci.main.modules.instance_identity.InstanceIdentity;
import org.jenkinsci.plugins.spoontrigger.git.PushCause;
import org.jenkinsci.plugins.spoontrigger.git.Repository;
import org.jenkinsci.plugins.spoontrigger.utils.Identity;
import org.kohsuke.stapler.StaplerRequest;
import org.kohsuke.stapler.StaplerResponse;
import org.kohsuke.stapler.interceptor.RequirePOST;

import javax.annotation.Nullable;
import javax.inject.Inject;
import java.util.Locale;

import static com.google.common.base.Preconditions.checkState;

@Extension
public class SpoonWebHook implements UnprotectedRootAction {

    public static final int HTTP_OK = 200;

    private static final String URL_NAME = "spoon-webhook";
    private static final Function<AbstractProject, SpoonTrigger> GET_SPOON_TRIGGER = new GetSpoonTrigger();

    static final String URL_VALIDATION_HEADER = "X-Jenkins-Validation";
    static final String X_INSTANCE_IDENTITY = "X-Instance-Identity";

    @Inject
    private InstanceIdentity identity;

    @Override
    public String getIconFileName() {
        return null;
    }

    @Override
    public String getDisplayName() {
        return null;
    }

    @Override
    public String getUrlName() {
        return URL_NAME;
    }

    public static SpoonWebHook getInstance() {
        return Jenkins.getInstance().getExtensionList(RootAction.class).get(SpoonWebHook.class);
    }

    @RequirePOST
    public void doIndex(StaplerRequest request, StaplerResponse response) {
        if (isJenkinsValidation(request)) {
            response.setHeader(X_INSTANCE_IDENTITY, Identity.getValueOrDefault(this.identity));
            response.setStatus(HTTP_OK);
            return;
        }

        String payload = getPayload(request);

        checkState(payload != null, "Not intended to be browsed interactively (must specify payload parameter)."
                + " Ensure that the web hook Content-Type header is application/x-www-form-urlencoded");

        String eventName = getEventType(request);
        GitHubEvent event = GitHubEvent.from(eventName);
        switch (event) {
            case PING:
            case SUPPORT:
                response.setStatus(HTTP_OK);
                break;
            case PUSH:
                PushCause cause = createCause(payload);
                this.triggerBuilds(Jenkins.getInstance(), cause);
                break;
            case UNKNOWN:
                String msg = String.format("Spoon WebHook event type (%s) is not supported. Only push and support events are supported", eventName);
                throw new IllegalArgumentException(msg);
        }
    }

    void triggerBuilds(Jenkins server, PushCause cause) {
        for (SpoonTrigger trigger : getAllTriggers(server)) {
            if(shouldRun(trigger, cause)) {
                trigger.run(cause);
            }
        }
    }

    private static Iterable<SpoonTrigger> getAllTriggers(Jenkins server) {
        return FluentIterable.from(server.getAllItems(AbstractProject.class))
                .transform(GET_SPOON_TRIGGER)
                .filter(Predicates.notNull());
    }

    private static PushCause createCause(String payload) throws IllegalStateException {
        try {
            JSONObject json = JSONObject.fromObject(payload);
            String repository = json.getJSONObject("repository").getString("url");
            String pusher = json.getJSONObject("pusher").getString("name");
            String newHeadId = json.getString("after");
            String branch = json.getString("ref");
            return new PushCause(repository, pusher, branch, newHeadId);
        } catch (JSONException ex) {
            throw new IllegalStateException("Failed parsing web hook payload", ex);
        }
    }

    private static boolean shouldRun(SpoonTrigger trigger, PushCause cause) {
        String triggerRepo = Util.fixNull(trigger.getRepositoryUrl());
        Repository causeRepo = cause.getRepository();
        return triggerRepo.equalsIgnoreCase(causeRepo.getUrl());
    }

    private static boolean isJenkinsValidation(StaplerRequest request) {
        return request.getHeader(URL_VALIDATION_HEADER) != null;
    }

    private static String getEventType(StaplerRequest request) {
        return request.getHeader("X-GitHub-Event");
    }

    private static String getPayload(StaplerRequest request) {
        return request.getParameter("payload");
    }

    private static enum GitHubEvent {
        UNKNOWN,
        PING,
        SUPPORT,
        PUSH;

        public static GitHubEvent from(@Nullable String name) {
            if(Strings.isNullOrEmpty(name)) {
                return SUPPORT;
            }

            try {
                return GitHubEvent.valueOf(name.toUpperCase(Locale.ROOT));
            }catch (IllegalArgumentException ex) {
                return UNKNOWN;
            }
        }
    }

    private static final class GetSpoonTrigger implements Function<AbstractProject, SpoonTrigger> {
        @Nullable
        @Override
        public SpoonTrigger apply(@Nullable AbstractProject project) {
            if(project == null) {
                return null;
            }
            return (SpoonTrigger) project.getTrigger(SpoonTrigger.class);
        }
    }
}


text:
package pkg

import (
	"crypto/tls"
	"crypto/x509"
	"encoding/pem"
	"io/ioutil"
)

type keypairFunc func(certPEMBlock, keyPEMBlock []byte) (cert tls.Certificate, err error)

func buildTLSClientConfig(ca, cert, key []byte, parseKeyPair keypairFunc) (*tls.Config, error) {
	if len(cert) == 0 && len(key) == 0 {
		return &tls.Config{InsecureSkipVerify: true}, nil
	}

	tlsCert, err := parseKeyPair(cert, key)
	if err != nil {
		return nil, err
	}

	cfg := tls.Config{
		Certificates: []tls.Certificate{tlsCert},
		MinVersion:   tls.VersionTLS10,
	}

	if len(ca) != 0 {
		cp, err := newCertPool(ca)
		if err != nil {
			return nil, err
		}
		cfg.RootCAs = cp
	}

	return &cfg, nil
}

func newCertPool(ca []byte) (*x509.CertPool, error) {
	certPool := x509.NewCertPool()
	for {
		var block *pem.Block
		block, ca = pem.Decode(ca)
		if block == nil {
			break
		}
		cert, err := x509.ParseCertificate(block.Bytes)
		if err != nil {
			return nil, err
		}
		certPool.AddCert(cert)
	}
	return certPool, nil
}

func ReadTLSConfigFiles(cafile, certfile, keyfile string) (cfg *tls.Config, err error) {
	var ca, cert, key []byte

	if certfile != "" {
		cert, err = ioutil.ReadFile(certfile)
		if err != nil {
			return
		}
	}

	if keyfile != "" {
		key, err = ioutil.ReadFile(keyfile)
		if err != nil {
			return
		}
	}

	if cafile != "" {
		ca, err = ioutil.ReadFile(cafile)
		if err != nil {
			return
		}
	}

	cfg, err = buildTLSClientConfig(ca, cert, key, tls.X509KeyPair)

	return
}


text:
<?php

namespace Del\Entity;

use DateTime;
use Del\Value\User\State;
use Del\Person\Entity\Person;
use Doctrine\ORM\Mapping as ORM;

/**
 * @ORM\MappedSuperclass()
 */
class BaseUser implements UserInterface
{
    /**
     * @ORM\Id
     * @ORM\Column(type="integer")
     * @ORM\GeneratedValue
     */
    private $id;

    /**
     * @ORM\Column(type="string",length=50)
     */
    private $email;

    /**
     * @ORM\OneToOne(targetEntity="Del\Person\Entity\Person",cascade={"persist"})
     */
    private $person;

    /** @ORM\Column(type="string",length=100) */
    private $password;

    /**
     * @ORM\Column(type="integer",length=1)
     * @var int
     */
    private $state;

    /**
     * @ORM\Column(type="datetime",nullable=true)
     * @var DateTime
     */
    private $registrationDate;

    /**
     * @ORM\Column(type="datetime",nullable=true)
     * @var DateTime
     */
    private $lastLoginDate;

    /**
     * BaseUser constructor.
     */
    public function __construct()
    {
        $this->state = 0;
    }

    /**
     * @return int|null
     */
    public function getId(): ?int
    {
        return $this->id;
    }

    /**
     * @return string
     */
    public function getEmail(): string
    {
        return $this->email;
    }

    /**
     * @return Person
     */
    public function getPerson(): Person
    {
        return $this->person;
    }

    /**
     * @return string
     */
    public function getPassword(): string
    {
        return $this->password;
    }

    /**
     * @return State
     */
    public function getState(): State
    {
        return new State($this->state);
    }

    /**
     * @return DateTime
     */
    public function getRegistrationDate(): DateTime
    {
        return $this->registrationDate;
    }

    /**
     * @return DateTime
     */
    public function getLastLoginDate(): ?DateTime
    {
        return $this->lastLoginDate;
    }

    /**
     * @param $id
     */
    public function setId(int $id): void
    {
        $this->id = $id;
    }

    /**
     * @param mixed $email
     */
    public function setEmail(string $email): void
    {
        $this->email = $email;
    }

    /**
     * @param Person $person
     */
    public function setPerson(Person $person): void
    {
        $this->person = $person;
    }

    /**
     * @param string $password
     */
    public function setPassword(string $password): void
    {
        $this->password = $password;
    }

    /**
     * @param State $state
     */
    public function setState(State $state): void
    {
        $this->state = $state->getValue();
    }

    /**
     * @param DateTime $registrationDate
     */
    public function setRegistrationDate(DateTime $registrationDate): void
    {
        $this->registrationDate = $registrationDate;
    }

    /**
     * @param DateTime $lastLogin
     */
    public function setLastLogin(DateTime $lastLogin): void
    {
        $this->lastLoginDate = $lastLogin;
    }
}


text:
import logging
import SocketServer
import signal

from TinyIDS import database
from TinyIDS import config

logger = logging.getLogger()

class DataDecryptionError(Exception):
    pass

class InternalServerError(Exception):
    pass

class TerminationSignal(Exception):
    pass

class TinyIDSServer(SocketServer.ThreadingTCPServer):

    def __init__(self, server_address, RequestHandlerClass, pki):
        """Constructor of the TinyIDS Server.

        Extra instance attributes:

        cfg - the server ConfigParser instance
        db - database.HashDatabase instance
        pki - crypto.RSAModule instance

        Security Considerations

        If PKI module has been enabled, the server's private key should
        have been loaded before dropping privileges, so that the server
        process does not have read access to it while operating.

        """
        # Server Configuration
        self.cfg = config.get_server_configuration()

        # Debug protocol
        self.debug_protocol = self.cfg.getboolean('main', 'debug_protocol')

        # Hash Database
        db_path = self.cfg.get_or_default('main', 'db_path', config.DEFAULT_DATABASE_PATH)
        self.db = database.HashDatabase(db_path)

        # PKI Module
        self.pki = pki

        # Bind and activate
        try:
            SocketServer.ThreadingTCPServer.__init__(self, server_address, RequestHandlerClass)
        except InternalServerError:
            self.server_forced_shutdown()
            raise InternalServerError

        # Register signal handlers
        signal.signal(signal.SIGTERM, self.SIGTERM_handler)
        signal.signal(signal.SIGINT, self.SIGINT_handler)
        signal.signal(signal.SIGHUP, self.SIGHUP_handler)

    def database_activate(self):
        try:
            self.db.database_activate()
        except database.InitializationError, strerror:
            logger.error('Database initialization error: %s' % strerror)
            raise InternalServerError
        logger.info('Hash database activated')

    def database_close(self):
        if self.db is not None:
            self.db.database_close()
            logger.info('Hash database closed')

    def pki_activate(self):
        if self.pki is not None:
            logger.info('PKI module activated')

    def pki_close(self):
        if self.pki is not None:
            self.pki = None
            logger.info('PKI module deactivated')

    def server_activate(self):
        self.database_activate()
        self.pki_activate()
        SocketServer.ThreadingTCPServer.server_activate(self)
        logger.debug('Accepting connections on %s:%s' % self.server_address)

    def server_close(self):
        logger.info('TinyIDS Server preparing for shutdown...')
        self.database_close()
        self.pki_close()
        SocketServer.ThreadingTCPServer.server_close(self)

    def server_forced_shutdown(self):
        logger.warning('Forced shutdown')
        self.server_close()
        logger.info('Forced shutdown complete')

    def verify_request(self, request, client_address):
        """TODO: IP-based access control."""
        return True

    # Signal Handlers

    def SIGTERM_handler(self, signo, frame):
        logger.info('Caught TERM signal')
        raise TerminationSignal

    def SIGINT_handler(self, signo, frame):
        logger.info('Caught INT signal')
        raise TerminationSignal

    def SIGHUP_handler(self, signo, frame):
        """Server reloads its configuration.

        Not implemented

        """
        logger.info('Caught HUP signal. Not implemented. No action taken')

class TinyIDSCommandHandler(SocketServer.StreamRequestHandler):

    max_data_len = 8192
    cmd_end = '\r\n'

    def __init__(self, request, client_address, server):

        # Indicator of the command that is being processed
        self.doing_command = None

        # command : (<processing_method>, <number_of_args>)
        self.com2func = {
            'TEST':         (self._com_TEST, 1),          # TEST <protocol_revision>
            'CHECK':        (self._com_CHECK, 1),         # CHECK <hash>
            'UPDATE':       (self._com_UPDATE, 2),        # UPDATE <hash> <passphrase>
            'DELETE':       (self._com_DELETE, 1),        # DELETE <passphrase>
            'CHANGEPHRASE': (self._com_CHANGEPHRASE, 2),  # CHANGEPHRASE <old_passphrase> <new_passphrase>
        }

        # error_code : (<str_error>, <level>)
        self.errcodes = {
            20 : ('20 OK', 'info'),
            30 : ('30 MISMATCH', 'warning'),
            31 : ('31 NOT FOUND', 'warning'),
            40 : ('40 INVALID CLIENT', 'warning'),
            41 : ('41 INVALID COMMAND', 'warning'),
            42 : ('42 INVALID PASSPHRASE', 'warning'),
        }

        SocketServer.StreamRequestHandler.__init__(self, request, client_address, server)

    def _client(self):
        return self.client_address[0]

    def _get_data(self):
        data = self.rfile.readline(self.max_data_len).strip()
        data = data.rstrip(self.cmd_end)
        if self.server.pki is not None:
            # PKI is enabled
            data = self.server.pki.decrypt(data)
            logger.info('PKI: data decrypted')
        if self.server.debug_protocol:
            logger.debug('-> Received from %s: %s' % (self._client(), data))
        return data

    def _verify_grammar(self, data):
        cmd_parts = data.split()
        if not cmd_parts:
            return False
        command = cmd_parts[0].upper()
        if not self.com2func.has_key(command):
            return False
        args = cmd_parts[1:]
        if self.com2func[command][1] == len(args):
            return True
        return False

    def _process_command(self, data):
        cmd_parts = data.split()
        command = cmd_parts[0].upper()
        self.doing_command = command
        args = cmd_parts[1:]
        com_func = self.com2func[command][0]
        com_func(*args)

    def _finish_command(self):
        self.doing_command = None

    def _com_TEST(self, protocol_rev):
        if protocol_rev.isdigit():
            if int(protocol_rev) in config.COMPATIBLE_PROTOCOL_REVISIONS:
                self._send_response(20) # OK
                return
        self._send_response(40) # INVALID CLIENT

    def _com_CHECK(self, hash):
        try:
            hash_db = self.server.db.get(self._client())
        except database.HashDoesNotExistError:
            self._send_response(31) # NOT FOUND
        else:
            if hash == hash_db:
                self._send_response(20) # OK
            else:
                self._send_response(30) # MISMATCH

    def _com_UPDATE(self, hash, passphrase):
        try:
            self.server.db.put(self._client(), hash, passphrase)
        except database.InvalidPassphraseError:
            self._send_response(42) # INVALID PASSPHRASE
        else:
            self._send_response(20) # OK

    def _com_DELETE(self, passphrase):
        try:
            self.server.db.remove(self._client(), passphrase)
        except database.HashDoesNotExistError:
            self._send_response(31) # NOT FOUND
        except database.InvalidPassphraseError:
            self._send_response(42) # INVALID PASSPHRASE
        else:
            self._send_response(20) # OK

    def _com_CHANGEPHRASE(self, passphrase_old, passphrase_new):
        try:
            self.server.db.change_passphrase(self._client(), passphrase_old, passphrase_new)
        except database.HashDoesNotExistError:
            self._send_response(31) # NOT FOUND
        except database.InvalidPassphraseError:
            self._send_response(42) # INVALID PASSPHRASE
        else:
            self._send_response(20) # OK

    def _send_response(self, code, sign=True):
        msg, level = self.errcodes[code]

        if code == 20:
            logger.info('SUCCESS: %s ran %s successfully' % (self._client(), self.doing_command))
        else:
            logger.warning('FAILURE: %s failed with %s: %s' % (self._client(), self.doing_command, msg))

        if self.server.debug_protocol:
            logger.debug('-> Sending to %s: %s' % (self._client(), msg))

        if sign and self.server.pki is not None:
            # PKI is enabled
            msg = self.server.pki.sign(msg)
            logger.info('PKI: data signed')

        self.wfile.write(msg + self.cmd_end)
        logger.info('Sent response to %s' % self._client())

    def setup(self):
        logger.debug('%s client connected' % self._client())
        SocketServer.StreamRequestHandler.setup(self)

    def handle(self):
        try:
            data = self._get_data()
        except DataDecryptionError:
            self._send_response(40, sign=False) # INVALID CLIENT
        else:
            if self._verify_grammar(data):
                self._process_command(data)
                self._finish_command()
            else:
                self._send_response(41)

    def finish(self):
        SocketServer.StreamRequestHandler.finish(self)
        logger.debug('%s client disconnected' % self._client())

        #self.server.db.dbprint()


text:
valor = int(input("digite um valor : "))

if valor < 0:
    print (valor*-1)
elif valor > 10:
    valor2 = int(input("digite segundo valor de referência: "))
    print (valor - valor2)
else:
    print (valor/5)