function
stringlengths
11
56k
repo_name
stringlengths
5
60
features
list
def noun_chunks(doclike: Union[Doc, Span]) -> Iterator[Span]: """ Detect base noun phrases from a dependency parse. Works on both Doc and Span. """ # fmt: off labels = ["nsubj", "nsubj:pass", "obj", "iobj", "ROOT", "appos", "nmod", "nmod:poss"] # fmt: on doc = doclike.doc # Ensure works on ...
spacy-io/spaCy
[ 25459, 4045, 25459, 98, 1404400540 ]
def g(x): if x == 0: return 0 return 1
ktok07b6/polyphony
[ 90, 7, 90, 1, 1448846734 ]
def f(v, i, j, k): if i == 0: return v elif i == 1: return v elif i == 2: h(g(j) + g(k)) return v elif i == 3: for m in range(j): v += 2 return v else: for n in range(i): v += 1 return v
ktok07b6/polyphony
[ 90, 7, 90, 1, 1448846734 ]
def test(): assert 1 == if28(0, 1, 1, 0, 0) assert 2 == if28(0, 2, 0, 0, 0) assert 3 == if28(0, 3, 1, 0, 0) assert 4 == if28(0, 4, 2, 0, 0) assert 5 == if28(0, 5, 2, 1, 1) assert 6 == if28(0, 6, 2, 2, 2) assert 7 == if28(0, 7, 3, 0, 0) assert 10 == if28(0, 8, 3, 1, 1) assert 13 == if...
ktok07b6/polyphony
[ 90, 7, 90, 1, 1448846734 ]
def __init__(self, domain, *args, **kwargs): super(BaseWorkflowQuerySet, self).__init__(*args, **kwargs) Domain.check(domain) self.domain = domain
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def domain(self): if not hasattr(self, '_domain'): self._domain = None return self._domain
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def domain(self, value): # Avoiding circular import from swf.models.domain import Domain if not isinstance(value, Domain): err = "domain property has to be of"\ "swf.model.domain.Domain type, not %r"\ % type(value) raise TypeError(err)...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def _list_items(self, *args, **kwargs): response = {'nextPageToken': None} while 'nextPageToken' in response: response = self._list( *args, next_page_token=response['nextPageToken'], **kwargs ) for item in response[self...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def to_WorkflowType(self, domain, workflow_info, **kwargs): # Not using get_subkey in order for it to explictly # raise when workflowType name doesn't exist for example return WorkflowType( domain, workflow_info['workflowType']['name'], workflow_info['workflow...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def get_or_create(self, name, version, status=REGISTERED, creation_date=0.0, deprecation_date=0.0, task_list=None, child_policy=CHILD_POLICIES.TERMINATE, execution_timeout='300', ...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def filter(self, domain=None, registration_status=REGISTERED, name=None, *args, **kwargs): """Filters workflows based on the ``domain`` they belong to, their ``status``, and/or their ``name`` :param domain: domain the workflow type belongs to ...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def create(self, name, version, status=REGISTERED, creation_date=0.0, deprecation_date=0.0, task_list=None, child_policy=CHILD_POLICIES.TERMINATE, execution_timeout='300', decision_tasks_timeout='300', ...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def _is_valid_status_param(self, status, param): statuses = { WorkflowExecution.STATUS_OPEN: set([ 'oldest_date', 'latest_date'], ), WorkflowExecution.STATUS_CLOSED: set([ 'start_latest_date', 'start_oldest_date'...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def list_workflow_executions(self, status, *args, **kwargs): statuses = { WorkflowExecution.STATUS_OPEN: 'open', WorkflowExecution.STATUS_CLOSED: 'closed', } # boto.swf.list_closed_workflow_executions awaits a `start_oldest_date` # MANDATORY kwarg, when boto.swf....
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def to_WorkflowExecution(self, domain, execution_info, **kwargs): workflow_type = WorkflowType( self.domain, execution_info['workflowType']['name'], execution_info['workflowType']['version'] ) return WorkflowExecution( domain, get_subk...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def filter(self, status=WorkflowExecution.STATUS_OPEN, tag=None, workflow_id=None, workflow_type_name=None, workflow_type_version=None, *args, **kwargs): """Filters workflow executions based on kwargs provided criteras :param status: workflow...
botify-labs/python-simple-workflow
[ 18, 4, 18, 15, 1364383242 ]
def network_resnet(octree, flags, training=True, reuse=None): depth = flags.depth channels = [2048, 1024, 512, 256, 128, 64, 32, 16, 8] with tf.variable_scope("ocnn_resnet", reuse=reuse): data = octree_property(octree, property_name="feature", dtype=tf.float32, depth=depth, channel...
microsoft/O-CNN
[ 618, 170, 618, 2, 1497326634 ]
def network_ocnn(octree, flags, training=True, reuse=None): depth = flags.depth channels = [512, 256, 128, 64, 32, 16, 8, 4, 2] with tf.variable_scope("ocnn", reuse=reuse): data = octree_property(octree, property_name="feature", dtype=tf.float32, depth=depth, channel=flags.channel)...
microsoft/O-CNN
[ 618, 170, 618, 2, 1497326634 ]
def create(params, env=None, headers=None): return request.send('post', request.uri_path("plans"), params, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def update(id, params=None, env=None, headers=None): return request.send('post', request.uri_path("plans",id), params, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def list(params=None, env=None, headers=None): return request.send_list_request('get', request.uri_path("plans"), params, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def retrieve(id, env=None, headers=None): return request.send('get', request.uri_path("plans",id), None, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def delete(id, env=None, headers=None): return request.send('post', request.uri_path("plans",id,"delete"), None, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def copy(params, env=None, headers=None): return request.send('post', request.uri_path("plans","copy"), params, env, headers)
chargebee/chargebee-python
[ 34, 29, 34, 14, 1349501361 ]
def get_openstack_nova_client(config): return get_openstack_clients(config)[0]
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def get_openstack_cinder_client(config): return get_openstack_clients(config)[2]
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def _format_nics(nics): """ Create a networks data structure for python-novaclient. **Note** "auto" is the safest default to pass to novaclient :param nics: either None, one of strings "auto" or "none"or string with a comma-separated list of nic IDs from OpenStack. :return: A data structure that ...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server_id, config): logging.debug("getting server %s" % server_id) nc = get_openstack_nova_client(config) return nc.servers.get(server_id)
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, image_name, config): logging.debug("getting image %s" % image_name) nc = get_openstack_nova_client(config) return nc.glance.find_image(image_name)
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, image_name, config): logging.debug("getting images") nc = get_openstack_nova_client(config) return nc.glance.list()
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, flavor_name, config): logging.debug("getting flavor %s" % flavor_name) nc = get_openstack_nova_client(config) return nc.flavors.find(name=flavor_name)
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, flavor_name, config): logging.debug("getting flavors") nc = get_openstack_nova_client(config) return nc.flavors.list()
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, master_sg_name, config): logging.debug("create security group %s" % display_name) security_group_name = display_name nc = get_openstack_neutron_client(config) self.secgroup = nc.create_security_group({"security_group": { "name": security_group...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, image, root_volume_size, config): if root_volume_size: logging.debug("creating a root volume for instance %s from image %s" % (display_name, image)) nc = get_openstack_cinder_client(config) volume_name = '%s-root' % display_name vo...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, data_volume_size, data_volume_type, config): if data_volume_size: logging.debug("creating a data volume for instance %s, %d" % (display_name, data_volume_size)) nc = get_openstack_cinder_client(config) volume_name = '%s-data' % display_name ...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, image, flavor, security_group, extra_sec_groups, root_volume_id, nics, userdata, config): logging.debug("provisioning instance %s" % display_name) nc = get_openstack_nova_client(config) sgs = [security_group] if extra_sec_groups: ...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server_id, config): logging.debug("deprovisioning instance %s" % server_id) nc = get_openstack_nova_client(config) try: server = nc.servers.get(server_id) except NotFound: logging.warn("Server %s not found" % server_id) return ...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server_id, allocate_public_ip, config): logging.info("Allocate IP for server %s" % server_id) novaclient = get_openstack_nova_client(config) neutronclient = get_openstack_neutron_client(config) retries = 0 while novaclient.servers.get(server_id).status is "BUI...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server_id, config): nc = get_openstack_nova_client(config) return nc.volumes.get_server_volumes(server_id)
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server_id, data_volume_id, config): logging.debug("Attach data volume for server %s" % server_id) if data_volume_id: nc = get_openstack_nova_client(config) retries = 0 while nc.servers.get(server_id).status is "BUILDING" or not nc.servers.get(serve...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, public_key, config): logging.debug("adding user public key") nc = get_openstack_nova_client(config) self.keypair_added = False nc.keypairs.create(display_name, public_key) self.keypair_added = True
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, display_name, config): logging.debug("removing user public key") nc = get_openstack_nova_client(config) try: nc.keypairs.find(name=display_name).delete() except: pass
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server, config): logging.debug("delete security group") nc = get_openstack_neutron_client(config) security_group = nc.find_resource("security_group", server.name) try: if security_group: nc.delete_sec...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def execute(self, server, config): nova = get_openstack_nova_client(config) cinder = get_openstack_cinder_client(config) for volume in nova.volumes.get_server_volumes(server.id): retries = 0 while cinder.volumes.get(volume.id).status not in \ ('availab...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def get_provision_flow(): """ Provisioning flow consisting of three graph flows, each consisting of set of tasks that can execute in parallel. Returns tuple consisting of the whole flow and a dictionary including references to three graph flows for pre-execution customisations. """ pre_flow...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def get_upload_key_flow(): return lf.Flow('UploadKey').add( AddUserPublicKey('upload_key') )
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def __init__(self, config=None): self._config = config
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def deprovision_instance(self, server_id, display_name=None, delete_attached_volumes=False): flow, subflows = get_deprovision_flow() if delete_attached_volumes: subflows['main'].add(DeleteVolumes()) try: return taskflow.engines.run(flow, engine='parallel', store=dict( ...
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def get_instance_networks(self, instance_id): nc = get_openstack_nova_client(self._config) return nc.servers.get(instance_id).networks
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def list_flavors(self): nc = get_openstack_nova_client(self._config) return nc.flavors.list()
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def delete_key(self, key_name): logging.debug('Deleting key: %s' % key_name) nc = get_openstack_nova_client(self._config) try: key = nc.keypairs.find(name=key_name) key.delete() except: logging.warning('Key not found: %s' % key_name)
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def create_security_group(self, security_group_name, security_group_description): nc = get_openstack_neutron_client(self._config) nc.security_groups.create( security_group_name, "Security group generated by Pebbles")
CSC-IT-Center-for-Science/pouta-blueprints
[ 7, 6, 7, 71, 1418128274 ]
def __init__(self, machine) -> None: """Initialise OPP platform.""" super().__init__(machine) self.opp_connection = {} # type: Dict[str, OPPSerialCommunicator] self.serial_connections = set() # type: Set[OPPSerialCommunicator] self.opp_incands = dict() # ...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def stop(self): """Stop hardware and close connections.""" if self._light_system: self._light_system.stop() for task in self._poll_task.values(): task.cancel() self._poll_task = {} if self._incand_task: self._incand_task.cancel() ...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def process_received_message(self, chain_serial, msg): """Send an incoming message from the OPP hardware to the proper method for servicing. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ if len(msg) >=...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def _get_numbers(mask): number = 0 ref = 1 result = [] while mask > ref: if mask & ref: result.append(number) number += 1 ref = ref << 1 return result
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def register_processor_connection(self, serial_number, communicator): """Register the processors to the platform. Args: ---- serial_number: Serial number of chain. communicator: Instance of OPPSerialCommunicator """ self.opp_connection[serial_number] = co...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def update_incand(self): """Update all the incandescents connected to OPP hardware. This is done once per game loop if changes have been made. It is currently assumed that the UART oversampling will guarantee proper communication with the boards. If this does not end up being the case...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def get_coil_config_section(cls): """Return coil config section.""" return "opp_coils"
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def inv_resp(self, chain_serial, msg): """Parse inventory response. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ self.debug_log("Received Inventory Response: %s for %s", "".join(HEX_FORMAT % b for b i...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def eom_resp(chain_serial, msg): """Process an EOM. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ # An EOM command can be used to resynchronize communications if message synch is lost
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def _bad_crc(self, chain_serial, msg): """Show warning and increase counter.""" self.bad_crc[chain_serial] += 1 self.log.warning("Chain: %sMsg contains bad CRC: %s.", chain_serial, "".join(HEX_FORMAT % b for b in msg))
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def vers_resp(self, chain_serial, msg): """Process version response. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ # Multiple get version responses can be received at once self.debug_log("Recei...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def read_gen2_inp_resp(self, chain_serial, msg): """Read switch changes. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ # Single read gen2 input response. Receive function breaks them down # V...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def read_matrix_inp_resp(self, chain_serial, msg): """Read matrix switch changes. Args: ---- chain_serial: Serial of the chain which received the message. msg: Message to parse. """ # Single read gen2 input response. Receive function breaks them down ...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def configure_driver(self, config: DriverConfig, number: str, platform_settings: dict): """Configure a driver. Args: ---- config: Config dict. number: Number of this driver. platform_settings: Platform specific settings. """ if not self.opp_co...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def parse_light_number_to_channels(self, number: str, subtype: str): """Parse number and subtype to channel.""" if subtype in ("matrix", "incand"): return [ { "number": self._get_dict_index(number) } ] if not subtype or ...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def _verify_coil_and_switch_fit(self, switch, coil): chain_serial, card, solenoid = coil.hw_driver.number.split('-') sw_chain_serial, sw_card, sw_num = switch.hw_switch.number.split('-') if self.min_version[chain_serial] >= 0x20000: if chain_serial != sw_chain_serial or card != sw_ca...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def set_delayed_pulse_on_hit_rule(self, enable_switch: SwitchSettings, coil: DriverSettings, delay_ms: int): """Set pulse on hit and release rule to driver. When a switch is hit and a certain delay passed it pulses a driver. When the switch is released the pulse continues. Typically use...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def set_pulse_on_hit_and_enable_and_release_rule(self, enable_switch: SwitchSettings, coil: DriverSettings): """Set pulse on hit and enable and relase rule on driver. Pulses a driver when a switch is hit. Then enables the driver (may be with pwm). When the switch is released the pulse is cancel...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def set_pulse_on_hit_and_enable_and_release_and_disable_rule(self, enable_switch: SwitchSettings, eos_switch: SwitchSettings, coil: DriverSettings, repulse_settings: Optional[RepulseSettings...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def _write_hw_rule(self, switch_obj: SwitchSettings, driver_obj: DriverSettings, use_hold, can_cancel, delay_ms=None): if switch_obj.invert: raise AssertionError("Cannot handle inverted switches") if driver_obj.hold_settings and not use_hold: raise Asserti...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def _add_switch_coil_mapping(self, switch_num, driver: "OPPSolenoid"): """Add mapping between switch and coil.""" if self.min_version[driver.sol_card.chain_serial] < 0x20000: return _, _, coil_num = driver.number.split('-') # mirror switch matrix columns to handle the fact t...
missionpinball/mpf
[ 176, 127, 176, 108, 1403853986 ]
def lenient_json(v): if isinstance(v, (str, bytes)): try: return json.loads(v) except (ValueError, TypeError): pass return v
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def __init__(self, method, url, status, response_text): self.method = method self.url = url self.status = status self.body = response_text
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def __init__(self, root_url, settings: Settings): self.settings = settings self.root = root_url.rstrip('/') + '/'
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def _modify_request(self, method, url, data): return method, url, data
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def __init__(self, settings): super().__init__(settings.mandrill_url, settings)
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def __init__(self, settings): super().__init__(settings.messagebird_url, settings)
tutorcruncher/morpheus
[ 17, 3, 17, 7, 1495054960 ]
def setup_args(parser=None): if parser is None: parser = ParlaiParser(True, True, 'Check tasks for common errors') # Get command line arguments parser.add_argument('-ltim', '--log-every-n-secs', type=float, default=2) parser.add_argument('-d', '--display-examples', type='bool', default=False) ...
facebookresearch/ParlAI
[ 9846, 2003, 9846, 72, 1493053844 ]
def warn(txt, act, opt): if opt.get('display_examples'): print(txt + ":\n" + str(act)) else: warn_once(txt)
facebookresearch/ParlAI
[ 9846, 2003, 9846, 72, 1493053844 ]
def verify_data(opt): counts = verify(opt) print(counts) return counts
facebookresearch/ParlAI
[ 9846, 2003, 9846, 72, 1493053844 ]
def setup_args(cls): return setup_args()
facebookresearch/ParlAI
[ 9846, 2003, 9846, 72, 1493053844 ]
def __init__(self, integration_id=None, created=None, local_vars_configuration=None): # noqa: E501 """IntegrationEntity - a model defined in OpenAPI""" # noqa: E501 if local_vars_configuration is None: local_vars_configuration = Configuration() self.local_vars_configuration = local...
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def integration_id(self): """Gets the integration_id of this IntegrationEntity. # noqa: E501 The integration ID for this entity sent to and used in the Talon.One system. # noqa: E501 :return: The integration_id of this IntegrationEntity. # noqa: E501 :rtype: str """ ...
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def integration_id(self, integration_id): """Sets the integration_id of this IntegrationEntity. The integration ID for this entity sent to and used in the Talon.One system. # noqa: E501 :param integration_id: The integration_id of this IntegrationEntity. # noqa: E501 :type: str ...
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def created(self): """Gets the created of this IntegrationEntity. # noqa: E501 The exact moment this entity was created. # noqa: E501 :return: The created of this IntegrationEntity. # noqa: E501 :rtype: datetime """ return self._created
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def created(self, created): """Sets the created of this IntegrationEntity. The exact moment this entity was created. # noqa: E501 :param created: The created of this IntegrationEntity. # noqa: E501 :type: datetime """ if self.local_vars_configuration.client_side_valid...
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def to_str(self): """Returns the string representation of the model""" return pprint.pformat(self.to_dict())
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def __eq__(self, other): """Returns true if both objects are equal""" if not isinstance(other, IntegrationEntity): return False return self.to_dict() == other.to_dict()
talon-one/talon_one.py
[ 1, 3, 1, 1, 1484929786 ]
def _PUT(self, *param, **params): (host_id, guest_id) = self.chk_guestby1(param) if guest_id is None: return web.notfound() if is_param(self.input, 'id') is False \ or is_int(self.input.id) is False: return web.badrequest("Request data is invalid.") snapshot_id ...
karesansui/karesansui
[ 106, 29, 106, 6, 1333588008 ]
def setUp(self): super(_CommonSVNTestCase, self).setUp() self._old_backend_setting = settings.SVNTOOL_BACKENDS settings.SVNTOOL_BACKENDS = [self.backend] recompute_svn_backend() self.svn_repo_path = os.path.abspath( os.path.join(os.path.dirname(__file__), ...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def shortDescription(self): desc = super(_CommonSVNTestCase, self).shortDescription() desc = desc.replace('<backend>', self.backend_name) return desc
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_ssh(self): """Testing SVN (<backend>) with a SSH-backed Subversion repository""" self._test_ssh(self.svn_ssh_path, 'trunk/doc/misc-docs/Makefile')
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_get_file(self): """Testing SVN (<backend>) get_file""" tool = self.tool expected = (b'include ../tools/Makefile.base-vars\n' b'NAME = misc-docs\n' b'OUTNAME = svn-misc-docs\n' b'INSTALL_DIR = $(DESTDIR)/usr/share/doc/subversio...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_get_file_with_special_url_chars(self): """Testing SVN (<backend>) get_file with filename containing characters that are special in URLs and repository path as a URI """ value = self.tool.get_file('trunk/crazy& ?#.txt', Revision('12')) self.assertTrue(isinstance(value, by...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_normalize_path_with_special_chars_and_remote_url(self): """Testing SVN (<backend>) normalize_path with special characters and remote URL """ client = self.tool.client client.repopath = 'svn+ssh://example.com/svn' path = client.normalize_path(''.join( ...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_normalize_path_with_absolute_repo_path(self): """Testing SVN (<backend>) normalize_path with absolute path""" client = self.tool.client client.repopath = '/var/lib/svn' path = '/var/lib/svn/foo/bar' self.assertEqual(client.normalize_path(path), path) client.rep...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_revision_parsing(self): """Testing SVN (<backend>) revision number parsing""" self.assertEqual( self.tool.parse_diff_revision(filename=b'', revision=b'(working copy)'), (b'', HEAD)) self.assertEqual( self.tool...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]
def test_revision_parsing_with_nonexistent_and_branches(self): """Testing SVN (<backend>) revision parsing with relocation information and nonexistent revision specifier """ self.assertEqual( self.tool.parse_diff_revision( filename=b'', revisio...
reviewboard/reviewboard
[ 1464, 419, 1464, 1, 1250977189 ]