def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . size arg_3 = { 64 : 'EAX' , 128 : 'RAX' } [ arg_2 ] arg_4 = { 64 : 'EDX' , 128 : 'RDX' } [ arg_2 ] arg_5 = { 64 : 'EBX' , 128 : 'RBX' } [ arg_2 ] arg_6 = { 64 : 'ECX' , 128 : 'RCX' } [ arg_2 ] arg_7 = arg_0 . read_register ( arg_4 ) arg_8 = arg_0 . read_register ( arg_3 ) arg_9 = arg_0 . read_register ( arg_6 ) arg_10 = arg_0 . read_register ( arg_5 ) arg_11 = Operators . CONCAT ( arg_2 , arg_7 , arg_8 ) arg_12 = Operators . CONCAT ( arg_2 , arg_9 , arg_10 ) arg_13 = arg_1 . read ( ) arg_0 . ZF = arg_13 == arg_11 arg_1 . write ( Operators . ITEBV ( arg_2 , arg_0 . ZF , Operators . CONCAT ( arg_2 , arg_9 , arg_10 ) , arg_13 ) ) arg_0 . write_register ( arg_3 , Operators . ITEBV ( arg_2 // 2 , arg_0 . ZF , arg_8 , Operators . EXTRACT ( arg_13 , 0 , arg_2 // 2 ) ) ) arg_0 . write_register ( arg_4 , Operators . ITEBV ( arg_2 // 2 , arg_0 . ZF , arg_7 , Operators . EXTRACT ( arg_13 , arg_2 // 2 , arg_2 // 2 ) ) )

def Func(arg_0, arg_1):
        """
        Compares and exchanges bytes.

        Compares the 64-bit value in EDX:EAX (or 128-bit value in RDX:RAX if
        operand size is 128 bits) with the operand (destination operand). If
        the values are equal, the 64-bit value in ECX:EBX (or 128-bit value in
        RCX:RBX) is stored in the destination operand.  Otherwise, the value in
        the destination operand is loaded into EDX:EAX (or RDX:RAX)::

                IF (64-Bit Mode and OperandSize = 64)
                THEN
                    IF (RDX:RAX = DEST)
                    THEN
                        ZF = 1;
                        DEST = RCX:RBX;
                    ELSE
                        ZF = 0;
                        RDX:RAX = DEST;
                    FI
                ELSE
                    IF (EDX:EAX = DEST)
                    THEN
                        ZF = 1;
                        DEST = ECX:EBX;
                    ELSE
                        ZF = 0;
                        EDX:EAX = DEST;
                    FI;
                FI;

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_2 = arg_1.size
        arg_3 = {64: 'EAX', 128: 'RAX'}[arg_2]
        arg_4 = {64: 'EDX', 128: 'RDX'}[arg_2]
        arg_5 = {64: 'EBX', 128: 'RBX'}[arg_2]
        arg_6 = {64: 'ECX', 128: 'RCX'}[arg_2]

        # EDX:EAX or RDX:RAX
        arg_7 = arg_0.read_register(arg_4)
        arg_8 = arg_0.read_register(arg_3)

        arg_9 = arg_0.read_register(arg_6)
        arg_10 = arg_0.read_register(arg_5)

        arg_11 = Operators.CONCAT(arg_2, arg_7, arg_8)
        arg_12 = Operators.CONCAT(arg_2, arg_9, arg_10)
        arg_13 = arg_1.read()
        arg_0.ZF = arg_13 == arg_11

        arg_1.write(
            Operators.ITEBV(arg_2, arg_0.ZF,
                            Operators.CONCAT(arg_2, arg_9, arg_10),
                            arg_13)
        )
        arg_0.write_register(arg_3, Operators.ITEBV(arg_2 // 2, arg_0.ZF, arg_8,
                                                           Operators.EXTRACT(arg_13, 0, arg_2 // 2)))
        arg_0.write_register(arg_4, Operators.ITEBV(arg_2 // 2, arg_0.ZF, arg_7,
                                                           Operators.EXTRACT(arg_13, arg_2 // 2, arg_2 // 2)))


def Func ( arg_0 , arg_1 = True , arg_2 = False ) : def _get_color ( arg_3 ) : if arg_1 is True : return get_color_hash ( arg_3 ) else : return DEFAULT_COLOR arg_4 = [ ] for arg_5 in arg_0 : arg_6 = arg_5 [ 'command' ] arg_7 = arg_5 . get ( 'description' ) arg_8 = _get_color ( arg_7 or '' ) arg_9 = arg_5 . get ( 'write_stdin' ) arg_7 = arg_8 ( arg_7 ) if arg_8 is not None else arg_7 arg_10 = _format_with_description ( arg_7 ) arg_4 . append ( { 'command' : arg_6 , 'formatter' : arg_10 , 'write_stdin' : arg_9 , 'ignore_empty' : True } ) stream_command_dicts ( arg_4 , arg_2 = arg_2 )

def Func(arg_0, arg_1=True, arg_2=False):
    """
    Runs multiple commands, optionally in parallel. Each command should be
    a dictionary with a 'command' key and optionally 'description' and
    'write_stdin' keys.
    """
    def _get_color(arg_3):
        if arg_1 is True:
            return get_color_hash(arg_3)
        else:
            return DEFAULT_COLOR
    arg_4 = []
    for arg_5 in arg_0:
        arg_6 = arg_5['command']
        arg_7 = arg_5.get('description')
        arg_8 = _get_color(arg_7 or '')
        arg_9 = arg_5.get('write_stdin')
        arg_7 = arg_8(arg_7) if arg_8 is not None else arg_7
        arg_10 = _format_with_description(arg_7)
        arg_4.append({
            'command': arg_6,
            'formatter': arg_10,
            'write_stdin': arg_9,
            'ignore_empty': True
        })
    stream_command_dicts(arg_4, arg_2=arg_2)

Runs multiple commands optionally in parallel . Each command should be a dictionary with a command key and optionally description and write_stdin keys .


def Func ( arg_0 , arg_1 , arg_2 = True ) : for arg_3 in arg_0 . tiers [ arg_1 ] [ 0 ] : del ( arg_0 . annotations [ arg_3 ] ) for arg_3 in arg_0 . tiers [ arg_1 ] [ 1 ] : del ( arg_0 . annotations [ arg_3 ] ) arg_0 . tiers [ arg_1 ] [ 0 ] . clear ( ) arg_0 . tiers [ arg_1 ] [ 1 ] . clear ( ) if arg_2 : arg_0 . clean_time_slots ( )

def Func(arg_0, arg_1, arg_2=True):
        """remove all annotations from a tier

        :param str id_tier: Name of the tier.
        :raises KeyError: If the tier is non existent.
        """
        for arg_3 in arg_0.tiers[arg_1][0]:
            del(arg_0.annotations[arg_3])
        for arg_3 in arg_0.tiers[arg_1][1]:
            del(arg_0.annotations[arg_3])

        arg_0.tiers[arg_1][0].clear()
        arg_0.tiers[arg_1][1].clear()
        if arg_2:
            arg_0.clean_time_slots()


return BoundingBox(
            x1=min(self.x1, other.x1),
            y1=min(self.y1, other.y1),
            x2=max(self.x2, other.x2),
            y2=max(self.y2, other.y2),
        )

def Func(arg_0, arg_1):
        """
        Compute the Func bounding box of this bounding box and another one.

        This is equivalent to drawing a bounding box around all corners points of both
        bounding boxes.

        Parameters
        ----------
        other : imgaug.BoundingBox
            Other bounding box with which to generate the Func.

        Returns
        -------
        imgaug.BoundingBox
            Union bounding box of the two bounding boxes.

        """
        return BoundingBox(
            x1=min(arg_0.x1, arg_1.x1),
            y1=min(arg_0.y1, arg_1.y1),
            x2=max(arg_0.x2, arg_1.x2),
            y2=max(arg_0.y2, arg_1.y2),
        )

Compute the union bounding box of this bounding box and another one.

        This is equivalent to drawing a bounding box around all corners points of both
        bounding boxes.

        Parameters
        ----------
        other : imgaug.BoundingBox
            Other bounding box with which to generate the union.

        Returns
        -------
        imgaug.BoundingBox
            Union bounding box of the two bounding boxes.

Compute the union bounding box of this bounding box and another one .


return NoticeSetting.for_user(user, notice_type, self.medium_id).send

def Func ( arg_0 , arg_1 , arg_2 ) : from notification . models import NoticeSetting return NoticeSetting . for_user ( arg_1 , arg_2 , arg_0 . medium_id ) . send

def Func(arg_0, arg_1, arg_2):
        """
        Determines whether this backend is allowed to send a notification to
        the given user and notice_type.
        """
        from notification.models import NoticeSetting
        return NoticeSetting.for_user(arg_1, arg_2, arg_0.medium_id).send

Determines whether this backend is allowed to send a notification to the given user and notice_type .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ ] for arg_4 in arg_1 . get ( 'compounds' , [ ] ) : arg_5 = True arg_6 = [ ] if arg_2 : arg_7 = arg_2 . get ( arg_4 [ 'variant' ] ) else : arg_7 = arg_0 . variant_collection . find_one ( { '_id' : arg_4 [ 'variant' ] } ) if arg_7 : arg_5 = False arg_4 [ 'rank_score' ] = arg_7 [ 'rank_score' ] for arg_8 in arg_7 . get ( 'genes' , [ ] ) : arg_9 = { 'hgnc_id' : arg_8 [ 'hgnc_id' ] , 'hgnc_symbol' : arg_8 . get ( 'hgnc_symbol' ) , 'region_annotation' : arg_8 . get ( 'region_annotation' ) , 'functional_annotation' : arg_8 . get ( 'functional_annotation' ) , } arg_6 . append ( arg_9 ) arg_4 [ 'genes' ] = arg_6 arg_4 [ 'not_loaded' ] = arg_5 arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2 = None):
        """Update compounds for a variant.

        This will add all the necessary information of a variant on a compound object.

        Args:
            variant(scout.models.Variant)
            variant_objs(dict): A dictionary with _ids as keys and variant objs as values.

        Returns:
            compound_objs(list(dict)): A dictionary with updated compound objects.

        """
        arg_3 = []
        for arg_4 in arg_1.get('compounds', []):
            arg_5 = True
            arg_6 = []
            # Check if the compound variant exists
            if arg_2:
                arg_7 = arg_2.get(arg_4['variant'])
            else:
                arg_7 = arg_0.variant_collection.find_one({'_id': arg_4['variant']})
            if arg_7:
                # If the variant exosts we try to collect as much info as possible
                arg_5 = False
                arg_4['rank_score'] = arg_7['rank_score']
                for arg_8 in arg_7.get('genes', []):
                    arg_9 = {
                        'hgnc_id': arg_8['hgnc_id'],
                        'hgnc_symbol': arg_8.get('hgnc_symbol'),
                        'region_annotation': arg_8.get('region_annotation'),
                        'functional_annotation': arg_8.get('functional_annotation'),
                    }
                    arg_6.append(arg_9)
                    arg_4['genes'] = arg_6

            arg_4['not_loaded'] = arg_5
            arg_3.append(arg_4)

        return arg_3


def Func(arg_0):
    """Dump output JSON and verify parameters if output metadata exist."""
    if "path" in arg_0:
        arg_1 = os.path.join(arg_0["path"], "metadata.json")
        logger.debug("check for output %s", arg_1)
        try:
            arg_2 = read_output_metadata(arg_1)
            logger.debug("%s exists", arg_1)
            logger.debug("existing output parameters: %s", pformat(arg_2))
            arg_3 = arg_2["pyramid"]
            arg_4 = params_to_dump(arg_0)
            logger.debug("current output parameters: %s", pformat(arg_4))
            arg_5 = BufferedTilePyramid(**arg_4["pyramid"])
            if arg_3 != arg_5:
                raise MapcheteConfigError(
                    "pyramid definitions between existing and new output do not match: "
                    "%s != %s" % (arg_3, arg_5)
                )
            arg_6 = arg_2["driver"]["format"]
            arg_7 = arg_4["driver"]["format"]
            if arg_6 != arg_7:
                raise MapcheteConfigError(
                    "existing output format does not match new output format: "
                    "%s != %s" % (
                        (arg_6, arg_7)
                    )
                )
        except FileNotFoundError:
            logger.debug("%s does not exist", arg_1)
            arg_8 = params_to_dump(arg_0)
            # dump output metadata
            write_json(arg_1, arg_8)
    else:
        logger.debug("no path parameter found")

Dump output JSON and verify parameters if output metadata exist .


def
Func
(
arg_0
)
:
if
not
arg_0
.
isopen
:
arg_1
=
logging
.
getLogger
(
__name__
)
arg_1
.
warning
(
'the drop box is not open'
)
return
return
arg_0
.
dropbox
.
Func
(
)

def Func(arg_0):
        """return a pair of an ID and a result of a task.

        This method waits for a task to finish.

        Returns
        -------
        An ID and a result of a task. `None` if no task is running.

        """
        if not arg_0.isopen:
            arg_1 = logging.getLogger(__name__)
            arg_1.warning('the drop box is not open')
            return
        return arg_0.dropbox.Func()

return a pair of an ID and a result of a task .


(cls, x_pos, weight=1., min_width=MIN_INTEGRATION_PEAK)

def Func(arg_0, arg_1, arg_2=1., arg_3=arg_4):
        """
        Create delta function distribution.
        """

        arg_5 = arg_0(arg_1,0.,is_log=True, arg_3=arg_3)
        arg_5.weight  = arg_2
        return arg_5


def Func ( ) : arg_0 = None if os . name == "nt" : import msvcrt arg_0 = msvcrt . getch ( ) else : import termios arg_1 = sys . stdin . fileno ( ) arg_2 = termios . tcgetattr ( arg_1 ) arg_3 = termios . tcgetattr ( arg_1 ) arg_3 [ 3 ] = arg_3 [ 3 ] & ~ termios . ICANON & ~ termios . ECHO termios . tcsetattr ( arg_1 , termios . TCSANOW , arg_3 ) try : arg_0 = sys . stdin . read ( 1 ) except IOError : pass finally : termios . tcsetattr ( arg_1 , termios . TCSAFLUSH , arg_2 ) return arg_0

def Func():
    """
    Wait for a key press on the console and return it.

    Borrowed from http://stackoverflow.com/questions/983354/how-do-i-make-python-to-wait-for-a-pressed-key
    """
    arg_0 = None
    if os.name == "nt":
        # noinspection PyUnresolvedReferences
        import msvcrt
        arg_0 = msvcrt.getch()
    else:
        import termios
        arg_1 = sys.stdin.fileno()

        arg_2 = termios.tcgetattr(arg_1)
        arg_3 = termios.tcgetattr(arg_1)
        arg_3[3] = arg_3[3] & ~termios.ICANON & ~termios.ECHO
        termios.tcsetattr(arg_1, termios.TCSANOW, arg_3)

        try:
            arg_0 = sys.stdin.read(1)
        except IOError:
            pass
        finally:
            termios.tcsetattr(arg_1, termios.TCSAFLUSH, arg_2)

    return arg_0

Wait for a key press on the console and return it .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_3):
        """
        Write the CapabilityInformation structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                CapabilityInformation structure data, supporting a Func
                method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the CapabilityInformation structure.
        """
        if arg_2 < arg_3.KMIPVersion.KMIP_1_3:
            raise exceptions.VersionNotSupported(
                "KMIP {} does not support the CapabilityInformation "
                "object.".format(
                    arg_2.value
                )
            )

        arg_6 = BytearrayStream()

        if arg_0._streaming_capability:
            arg_0._streaming_capability.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._asynchronous_capability:
            arg_0._asynchronous_capability.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._attestation_capability:
            arg_0._attestation_capability.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_2 >= arg_3.KMIPVersion.KMIP_1_4:
            if arg_0._batch_undo_capability:
                arg_0._batch_undo_capability.Func(
                    arg_6,
                    arg_2=arg_2
                )

            if arg_0._batch_continue_capability:
                arg_0._batch_continue_capability.Func(
                    arg_6,
                    arg_2=arg_2
                )

        if arg_0._unwrap_mode:
            arg_0._unwrap_mode.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._destroy_action:
            arg_0._destroy_action.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._shredding_algorithm:
            arg_0._shredding_algorithm.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0._rng_mode:
            arg_0._rng_mode.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0.length = arg_6.length()
        super(CapabilityInformation, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_1.Func(arg_6.buffer)

Write the CapabilityInformation structure encoding to the data stream.

        Args:
            output_buffer (stream): A data stream in which to encode
                CapabilityInformation structure data, supporting a write
                method.
            kmip_version (enum): A KMIPVersion enumeration defining the KMIP
                version with which the object will be encoded. Optional,
                defaults to KMIP 2.0.

        Raises:
            VersionNotSupported: Raised when a KMIP version is provided that
                does not support the CapabilityInformation structure.

Write the CapabilityInformation structure encoding to the data stream .


return render_template(template, context['request'], {'publications': publications})

def Func ( arg_0 , arg_1 = 'publications/publications.html' ) : arg_2 = Type . objects . filter ( hidden = False ) arg_3 = Publication . objects . select_related ( ) arg_3 = arg_3 . filter ( external = False , type__in = arg_2 ) arg_3 = arg_3 . order_by ( '-year' , '-month' , '-id' ) if not arg_3 : return '' populate ( arg_3 ) return render_template ( arg_1 , arg_0 [ 'request' ] , { 'publications' : arg_3 } )

def Func(arg_0, arg_1='publications/publications.html'):
	"""
	Get all publications.
	"""

	arg_2 = Type.objects.filter(hidden=False)
	arg_3 = Publication.objects.select_related()
	arg_3 = arg_3.filter(external=False, type__in=arg_2)
	arg_3 = arg_3.order_by('-year', '-month', '-id')

	if not arg_3:
		return ''

	# load custom links and files
	populate(arg_3)

	return render_template(arg_1, arg_0['request'], {'publications': arg_3})


def Func(arg_0, arg_1):
    """Returns a Pipeline objects for the job."""
    arg_2 = arg_1.job_metadata
    arg_3 = arg_1.job_params
    arg_4 = arg_1.job_resources
    arg_5 = arg_1.task_descriptors[0].task_metadata
    arg_6 = arg_1.task_descriptors[0].task_params
    arg_7 = arg_1.task_descriptors[0].task_resources

    arg_8 = arg_1.job_metadata['script']

    arg_9 = google_base.build_pipeline_labels(
        arg_2, arg_5, task_id_pattern='task-%d')

    # Build the ephemeralPipeline for this job.
    # The ephemeralPipeline definition changes for each job because file
    # parameters localCopy.path changes based on the remote_uri.
    arg_10 = _Pipelines.build_pipeline(
        project=arg_0._project,
        zones=arg_4.zones,
        min_cores=arg_4.min_cores,
        min_ram=arg_4.min_ram,
        disk_size=arg_4.disk_size,
        boot_disk_size=arg_4.boot_disk_size,
        preemptible=arg_4.preemptible,
        accelerator_type=arg_4.accelerator_type,
        accelerator_count=arg_4.accelerator_count,
        image=arg_4.image,
        script_name=arg_8.name,
        envs=arg_3['envs'] | arg_6['envs'],
        inputs=arg_3['inputs'] | arg_6['inputs'],
        outputs=arg_3['outputs'] | arg_6['outputs'],
        pipeline_name=arg_2['pipeline-name'])

    # Build the pipelineArgs for this job.
    arg_11 = arg_7.logging_path.uri
    arg_12 = arg_4.scopes or google_base.DEFAULT_SCOPES
    arg_10.update(
        _Pipelines.build_pipeline_args(arg_0._project, arg_8.value, arg_3,
                                       arg_6, arg_9,
                                       arg_4.preemptible, arg_11,
                                       arg_12, arg_4.keep_alive))

    return arg_10

Returns a Pipeline objects for the job .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if not isinstance ( arg_2 , list ) : arg_2 = [ arg_1 ] arg_3 = arg_0 . __extract_resources_from_droplets ( arg_2 ) if len ( arg_3 ) > 0 : return arg_0 . __remove_resources ( arg_3 ) return False

def Func(arg_0, arg_1):
        """
            Remove the Tag from the Droplet.

            Attributes accepted at creation time:
                droplet: array of string or array of int, or array of Droplets.
        """
        arg_2 = arg_1
        if not isinstance(arg_2, list):
            arg_2 = [arg_1]

        # Extracting data from the Droplet object
        arg_3 = arg_0.__extract_resources_from_droplets(arg_2)
        if len(arg_3) > 0:
            return arg_0.__remove_resources(arg_3)

        return False


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
unicode
)
:
arg_1
=
arg_1
.
encode
(
'utf8'
,
'replace'
)
try
:
arg_0
.
request
.
_cookies
=
Cookie
.
SimpleCookie
(
arg_1
)
except
:
logging
.
warn
(
"couldn't parse cookie string: %s"
,
arg_1
,
exc_info
=
True
)

def Func(arg_0, arg_1):
        """Inject the first message, which is the document cookie,
        for authentication."""
        if isinstance(arg_1, unicode):
            # Cookie can't constructor doesn't accept unicode strings for some reason
            arg_1 = arg_1.encode('utf8', 'replace')
        try:
            arg_0.request._cookies = Cookie.SimpleCookie(arg_1)
        except:
            logging.warn("couldn't parse cookie string: %s",arg_1, exc_info=True)

Inject the first message which is the document cookie for authentication .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 [ : - 10 ] , arg_0 [ - 10 : ] arg_3 = [ ] arg_4 = set ( ) for arg_5 in arg_1 : if arg_5 in arg_4 : continue arg_3 . append ( arg_5 ) arg_4 . add ( arg_5 ) return arg_3 + arg_2

def Func(arg_0):
    """Compress a directory history into a new one with at most 20 entries.

    Return a new list made from the first and last 10 elements of dhist after
    removal of duplicates.
    """
    arg_1, arg_2 = arg_0[:-10], arg_0[-10:]

    arg_3 = []
    arg_4 = set()
    for arg_5 in arg_1:
        if arg_5 in arg_4:
            continue
        arg_3.append(arg_5)
        arg_4.add(arg_5)

    return arg_3 + arg_2

Compress a directory history into a new one with at most 20 entries .


(session, product_urls, github_api_token,
                                   mongo_collection=None)

async def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : arg_4 = [ asyncio . ensure_future ( process_ltd_doc ( arg_0 , arg_2 , product_url , arg_3 = arg_3 ) ) for product_url in arg_1 ] await asyncio . gather ( * arg_4 )

async def Func(arg_0, arg_1, arg_2,
                                   arg_3=None):
    """Run a pipeline to process extract, transform, and load metadata for
    multiple LSST the Docs-hosted projects

    Parameters
    ----------
    session : `aiohttp.ClientSession`
        Your application's aiohttp client session.
        See http://aiohttp.readthedocs.io/en/stable/client.html.
    product_urls : `list` of `str`
        List of LSST the Docs product URLs.
    github_api_token : `str`
        A GitHub personal API token. See the `GitHub personal access token
        guide`_.
    mongo_collection : `motor.motor_asyncio.AsyncIOMotorCollection`, optional
        MongoDB collection. This should be the common MongoDB collection for
        LSST projectmeta JSON-LD records.
    """
    arg_4 = [asyncio.ensure_future(
             process_ltd_doc(arg_0, arg_2,
                             product_url,
                             arg_3=arg_3))
             for product_url in arg_1]
    await asyncio.gather(*arg_4)

Run a pipeline to process extract transform and load metadata for multiple LSST the Docs - hosted projects


Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the gif method.

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = False ) : return Giphy ( arg_1 = arg_1 , arg_3 = arg_3 ) . Func ( arg_0 )

def Func(arg_0, arg_1=arg_2, arg_3=False):
    """
    Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the Func method.
    """
    return Giphy(arg_1=arg_1, arg_3=arg_3).Func(arg_0)

Shorthand for creating a Giphy api wrapper with the given api key and then calling the gif method .


(uri: str, archive_uri: str, case_id: str, dry: bool, force: bool)

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_1
,
arg_3
:
arg_1
,
arg_4
:
arg_5
,
arg_6
:
arg_5
)
:
arg_7
=
MongoClient
(
arg_0
)
arg_8
=
arg_7
[
arg_0
.
rsplit
(
'/'
,
1
)
[
1
]
]
arg_9
=
MongoAdapter
(
database
=
arg_8
)
arg_10
=
arg_9
.
case
(
arg_3
)
if
not
arg_6
and
arg_10
.
get
(
'is_Funcd'
)
:
print
(
"case already Funcd"
)
return
arg_11
=
MongoClient
(
arg_2
)
arg_12
=
arg_11
[
arg_2
.
rsplit
(
'/'
,
1
)
[
1
]
]
arg_13
=
arg_12
.
case
.
find_one
(
{
'owner'
:
arg_10
[
'owner'
]
,
'display_name'
:
arg_10
[
'display_name'
]
}
)
arg_14
=
archive_info
(
arg_12
,
arg_13
)
if
arg_4
:
print
(
ruamel
.
yaml
.
safe_dump
(
arg_14
)
)
else
:
pass

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1, arg_4: arg_5, arg_6: arg_5):
    """Update all information that was manually annotated from a old instance."""
    arg_7 = MongoClient(arg_0)
    arg_8 = arg_7[arg_0.rsplit('/', 1)[-1]]
    arg_9 = MongoAdapter(database=arg_8)
    arg_10 = arg_9.case(arg_3)
    if not arg_6 and arg_10.get('is_Funcd'):
        print("case already Funcd")
        return

    arg_11 = MongoClient(arg_2)
    arg_12 = arg_11[arg_2.rsplit('/', 1)[-1]]
    arg_13 = arg_12.case.find_one({
        'owner': arg_10['owner'],
        'display_name': arg_10['display_name']
    })

    arg_14 = archive_info(arg_12, arg_13)

    if arg_4:
        print(ruamel.yaml.safe_dump(arg_14))
    else:
        #Func_case(scout_adapter, scout_case, archive_data)
        pass

Update all information that was manually annotated from a old instance .


def Func(arg_0, arg_1, arg_2):
  '''
  template heron tools
  '''
  arg_3 = "%s/standalone/templates/heron_tools.template.hcl" \
                             % arg_0["config_path"]
  arg_4 = "%s/standalone/resources/heron_tools.hcl" \
                             % arg_0["config_path"]

  arg_5 = arg_1[0]
  template_file(arg_3, arg_4,
                {
                    "<zookeeper_host:zookeeper_port>": ",".join(
                        ['%s' % arg_6 if ":" in arg_6 else '%s:2181' % arg_6 for arg_6 in arg_2]),
                    "<heron_tracker_executable>": '"%s/heron-tracker"' % config.get_heron_bin_dir(),
                    "<heron_tools_hostname>": '"%s"' % get_hostname(arg_5, arg_0),
                    "<heron_ui_executable>": '"%s/heron-ui"' % config.get_heron_bin_dir()
                })


def Func():
    """
    use ComplexDataInput with a reference to a document
    """

    print("\nFunc ...")

    arg_0 = WebProcessingService('http://localhost:8094/wps', verbose=verbose)

    arg_1 = 'wordcount'
    arg_2 = ComplexDataInput("http://www.gutenberg.org/files/28885/28885-h/28885-h.htm")   # alice in wonderland
    arg_3 = [("text", arg_2)]
    # list of tuple (output identifier, asReference attribute, mimeType attribute)
    # when asReference or mimeType is None - the wps service will use its default option
    arg_4 = [("output",True,'some/mime-type')]

    arg_5 = arg_0.execute(arg_1, arg_3, arg_6=arg_4)
    monitorExecution(arg_5)

    # show status
    print('percent complete', arg_5.percentCompleted)
    print('status message', arg_5.statusMessage)

    for arg_6 in arg_5.processOutputs:
        print('identifier=%s, dataType=%s, data=%s, reference=%s' % (arg_6.identifier, arg_6.dataType, arg_6.data, arg_6.reference))


Overrides the default get_attribute method to convert None values to False.

def Func ( arg_0 , arg_1 ) : arg_2 = super ( NullBooleanField , arg_0 ) . Func ( arg_1 ) return True if arg_2 else False

def Func(arg_0, arg_1):
        """Overrides the default Func method to convert None values to False."""

        arg_2 = super(NullBooleanField, arg_0).Func(arg_1)
        return True if arg_2 else False

Overrides the default get_attribute method to convert None values to False .


def Func(arg_0, arg_1="roc", arg_2=False):
        """
        Produce the desired metric Func.

        :param type: the type of metric Func (currently, only ROC supported).
        :param server: if True, generate Func inline using matFunclib's "Agg" backend.
        :returns: None
        """
        # TODO: add more types (i.e. cutoffs)
        assert_is_type(arg_1, "roc")
        # check for matFunclib. exit if absent.
        try:
            imp.find_module('matFunclib')
            import matFunclib
            if arg_2: matFunclib.use('Agg', warn=False)
            import matFunclib.pyFunc as plt
        except ImportError:
            print("matFunclib is required for this function!")
            return

        if arg_1 == "roc":
            plt.xlabel('False Positive Rate (FPR)')
            plt.ylabel('True Positive Rate (TPR)')
            plt.title('ROC Curve')
            plt.text(0.5, 0.5, r'AUC={0:.4f}'.format(arg_0._metric_json["AUC"]))
            plt.Func(arg_0.fprs, arg_0.tprs, 'b--')
            plt.axis([0, 1, 0, 1])
            if not arg_2: plt.show()

Produce the desired metric plot.

        :param type: the type of metric plot (currently, only ROC supported).
        :param server: if True, generate plot inline using matplotlib's "Agg" backend.
        :returns: None


(num_variables, num_clauses, vartype=dimod.BINARY, satisfiable=True)

def Func(arg_0, arg_1, arg_2=arg_3.BINARY, arg_5=True):
    """Random XOR constraint satisfaction problem.

    Args:
        num_variables (integer): Number of variables (at least three).
        num_clauses (integer): Number of constraints that together constitute the
            constraint satisfaction problem.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        satisfiable (bool, optional, default=True): True if the CSP can be satisfied.

    Returns:
        CSP (:obj:`.ConstraintSatisfactionProblem`): CSP that is satisfied when its variables
        are assigned values that satisfy a XOR satisfiability problem.

    Examples:
        This example creates a CSP with 5 variables and two random constraints and checks
        whether a particular assignment of variables satisifies it.

        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories as sat
        >>> csp = sat.Func(5, 2)
        >>> csp.constraints    # doctest: +SKIP
        [Constraint.from_configurations(frozenset({(1, 0, 0), (1, 1, 1), (0, 1, 0), (0, 0, 1)}), (4, 3, 0),
         Vartype.BINARY, name='XOR (0 flipped)'),
         Constraint.from_configurations(frozenset({(1, 1, 0), (0, 1, 1), (0, 0, 0), (1, 0, 1)}), (2, 0, 4),
         Vartype.BINARY, name='XOR (2 flipped) (0 flipped)')]
        >>> csp.check({0: 1, 1: 0, 2: 0, 3: 1, 4: 1})       # doctest: +SKIP
        True

    """
    if arg_0 < 3:
        raise ValueError("a xor problem needs at least 3 variables")
    if arg_1 > 8 * _nchoosek(arg_0, 3):  # 8 different negation patterns
        raise ValueError("too many clauses")

    # also checks the vartype argument
    arg_6 = ConstraintSatisfactionProblem(arg_2)

    arg_7 = list(range(arg_0))

    arg_8 = set()

    if arg_5:
        arg_9 = tuple(arg_2.value)
        arg_10 = {arg_18: choice(arg_9) for arg_18 in arg_7}

        arg_11 = [(0, 0, 0), (0, 1, 1), (1, 0, 1), (1, 1, 0)]

        while len(arg_8) < arg_1:
            # because constraints are hashed on configurations/variables, and because the inputs
            # to xor can be swapped without loss of generality, we can order them
            arg_12, arg_13, arg_14 = sample(arg_7, 3)
            if arg_13 > arg_12:
                arg_12, arg_13 = arg_13, arg_12

            # get the constraint
            arg_15 = xor_gate([arg_12, arg_13, arg_14], arg_2=arg_2)

            # pick (uniformly) a configuration and determine which variables we need to negate to
            # match the chosen configuration
            arg_16 = choice(arg_11)

            for arg_17, arg_18 in enumerate(arg_15.variables):
                if arg_16[arg_17] != (arg_10[arg_18] > 0):
                    arg_15.flip_variable(arg_18)

            assert arg_15.check(arg_10)

            arg_8.add(arg_15)
    else:
        while len(arg_8) < arg_1:
            # because constraints are hashed on configurations/variables, and because the inputs
            # to xor can be swapped without loss of generality, we can order them
            arg_12, arg_13, arg_14 = sample(arg_7, 3)
            if arg_13 > arg_12:
                arg_12, arg_13 = arg_13, arg_12

            # get the constraint
            arg_15 = xor_gate([arg_12, arg_13, arg_14], arg_2=arg_2)

            # randomly flip each variable in the constraint
            for arg_17, arg_18 in enumerate(arg_15.variables):
                if random() > .5:
                    arg_15.flip_variable(arg_18)

            assert arg_15.check(arg_10)

            arg_8.add(arg_15)

    for arg_15 in arg_8:
        arg_6.add_constraint(arg_15)

    # in case any variables didn't make it in
    for arg_18 in arg_7:
        arg_6.add_variable(arg_18)

    return arg_6

Random XOR constraint satisfaction problem.

    Args:
        num_variables (integer): Number of variables (at least three).
        num_clauses (integer): Number of constraints that together constitute the
            constraint satisfaction problem.
        vartype (Vartype, optional, default='BINARY'): Variable type. Accepted
            input values:

            * Vartype.SPIN, 'SPIN', {-1, 1}
            * Vartype.BINARY, 'BINARY', {0, 1}
        satisfiable (bool, optional, default=True): True if the CSP can be satisfied.

    Returns:
        CSP (:obj:`.ConstraintSatisfactionProblem`): CSP that is satisfied when its variables
        are assigned values that satisfy a XOR satisfiability problem.

    Examples:
        This example creates a CSP with 5 variables and two random constraints and checks
        whether a particular assignment of variables satisifies it.

        >>> import dwavebinarycsp
        >>> import dwavebinarycsp.factories as sat
        >>> csp = sat.random_xorsat(5, 2)
        >>> csp.constraints    # doctest: +SKIP
        [Constraint.from_configurations(frozenset({(1, 0, 0), (1, 1, 1), (0, 1, 0), (0, 0, 1)}), (4, 3, 0),
         Vartype.BINARY, name='XOR (0 flipped)'),
         Constraint.from_configurations(frozenset({(1, 1, 0), (0, 1, 1), (0, 0, 0), (1, 0, 1)}), (2, 0, 4),
         Vartype.BINARY, name='XOR (2 flipped) (0 flipped)')]
        >>> csp.check({0: 1, 1: 0, 2: 0, 3: 1, 4: 1})       # doctest: +SKIP
        True

Random XOR constraint satisfaction problem .


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = { "Email" : validate_email , "Twilio" : validate_twilio , "SlackWebhook" : validate_slackwebhook , "SlackPost" : validate_slackpost , "TelegramBot" : validate_telegrambot , "WhatsApp" : validate_whatsapp , } [ arg_0 ] ( arg_1 , arg_2 ) except KeyError : return 1 else : return 0

def Func(arg_0, arg_1, arg_2):
    """Base function to validate input, dispatched via message type."""
    try:
        arg_3 = {
            "Email": validate_email,
            "Twilio": validate_twilio,
            "SlackWebhook": validate_slackwebhook,
            "SlackPost": validate_slackpost,
            "TelegramBot": validate_telegrambot,
            "WhatsApp": validate_whatsapp,
        }[arg_0](arg_1, arg_2)
    except KeyError:
        return 1
    else:
        return 0

Base function to validate input dispatched via message type .


def Func ( arg_0 ) : arg_1 = arg_0 . config [ 'heartbeat_interval' ] while arg_0 . connected : gevent . sleep ( arg_1 ) arg_0 . put_client_msg ( "2::" )

def Func(arg_0):
        """Start the heartbeat Greenlet to check connection health."""
        arg_1 = arg_0.config['heartbeat_interval']
        while arg_0.connected:
            gevent.sleep(arg_1)
            # TODO: this process could use a timeout object like the disconnect
            #       timeout thing, and ONLY send packets when none are sent!
            #       We would do that by calling timeout.set() for a "sending"
            #       timeout.  If we're sending 100 messages a second, there is
            #       no need to push some heartbeats in there also.
            arg_0.put_client_msg("2::")

Start the heartbeat Greenlet to check connection health .


(self, tarball_url, env=None, app_name=None)

return self.api_request('POST', '/app-setups', data=data)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = { 'source_blob' : { 'url' : arg_1 } } if arg_2 : arg_4 [ 'overrides' ] = { 'env' : arg_2 } if arg_3 : arg_4 [ 'app' ] = { 'name' : arg_3 } return arg_0 . api_request ( 'POST' , '/app-setups' , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Creates an app-setups build. Returns response data as a dict.

        :param tarball_url: URL of a tarball containing an ``app.json``.
        :param env: Dict containing environment variable overrides.
        :param app_name: Name of the Heroku app to create.
        :returns: Response data as a ``dict``.
        """
        arg_4 = {
            'source_blob': {
                'url': arg_1
            }
        }

        if arg_2:
            arg_4['overrides'] = {'env': arg_2}

        if arg_3:
            arg_4['app'] = {'name': arg_3}

        return arg_0.api_request('POST', '/app-setups', arg_4=arg_4)

Creates an app - setups build . Returns response data as a dict .


def Func ( arg_0 ) : if arg_0 . empty : return [ ] arg_1 = list ( arg_0 . tbody ) arg_2 = [ ] for arg_3 , arg_4 in zip ( arg_1 [ : : 2 ] , arg_1 [ 1 : : 2 ] ) : arg_5 = { } arg_6 = OBSERVATION_XPATH ( arg_3 ) arg_5 [ 'name' ] = _clean_cell ( arg_6 [ 0 ] ) arg_5 [ 'date' ] = _clean_cell ( arg_6 [ 1 ] ) arg_5 [ 'magnitude' ] = _clean_cell ( arg_6 [ 3 ] ) arg_5 [ 'obscode' ] = _clean_cell ( arg_6 [ 6 ] ) arg_6 = DETAILS_XPATH ( arg_4 ) arg_5 [ 'comp1' ] = _clean_cell ( arg_6 [ 0 ] ) arg_5 [ 'chart' ] = _clean_cell ( arg_6 [ 3 ] ) . replace ( 'None' , '' ) arg_5 [ 'comment_code' ] = _clean_cell ( arg_6 [ 4 ] ) arg_5 [ 'notes' ] = _clean_cell ( arg_6 [ 5 ] ) arg_2 . append ( arg_5 ) return arg_2

def Func(arg_0):
        """
        Parses the HTML table into a list of dictionaries, each of which
        represents a single observation.
        """
        if arg_0.empty:
            return []
        arg_1 = list(arg_0.tbody)
        arg_2 = []
        for arg_3, arg_4 in zip(arg_1[::2], arg_1[1::2]):
            arg_5 = {}
            arg_6 = OBSERVATION_XPATH(arg_3)
            arg_5['name'] = _clean_cell(arg_6[0])
            arg_5['date'] = _clean_cell(arg_6[1])
            arg_5['magnitude'] = _clean_cell(arg_6[3])
            arg_5['obscode'] = _clean_cell(arg_6[6])
            arg_6 = DETAILS_XPATH(arg_4)
            arg_5['comp1'] = _clean_cell(arg_6[0])
            arg_5['chart'] = _clean_cell(arg_6[3]).replace('None', '')
            arg_5['comment_code'] = _clean_cell(arg_6[4])
            arg_5['notes'] = _clean_cell(arg_6[5])
            arg_2.append(arg_5)
        return arg_2

Parses the HTML table into a list of dictionaries each of which represents a single observation .


def Func ( arg_0 , arg_1 ) : set_config_value ( 'aad_token' , jsonpickle . encode ( arg_0 ) ) set_config_value ( 'aad_cache' , jsonpickle . encode ( arg_1 ) )

def Func(arg_0, arg_1):
    """Set AAD token cache."""
    set_config_value('aad_token', jsonpickle.encode(arg_0))
    set_config_value('aad_cache', jsonpickle.encode(arg_1))


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
arg_3
)
:
if
arg_1
:
if
not
op
.
exists
(
arg_0
)
:
raise
IOError
(
'File not found: '
+
arg_0
)
arg_4
,
arg_5
=
op
.
splitext
(
arg_0
)
if
arg_5
in
arg_2
:
arg_6
=
arg_2
[
arg_5
]
arg_7
,
arg_8
=
op
.
splitext
(
arg_4
)
if
arg_8
in
arg_6
:
arg_5
=
arg_8
+
arg_5
return
arg_5

def Func(arg_0, arg_1=False, arg_2=arg_3):
    """Return the extension of fpath.

    Parameters
    ----------
    fpath: string
    File name or path

    check_if_exists: bool

    allowed_exts: dict
    Dictionary of strings, where the key if the last part of a complex ('.' separated) extension
    and the value is the previous part.
    For example: for the '.nii.gz' extension I would have a dict as {'.gz': ['.nii',]}

    Returns
    -------
    str
    The extension of the file name or path
    """
    if arg_1:
        if not op.exists(arg_0):
            raise IOError('File not found: ' + arg_0)

    arg_4, arg_5 = op.splitext(arg_0)
    if arg_5 in arg_2:
        arg_6 = arg_2[arg_5]
        arg_7, arg_8 = op.splitext(arg_4)
        if arg_8 in arg_6:
            arg_5 = arg_8 + arg_5

    return arg_5


def Func ( arg_0 , arg_1 = 'log_normalization' ) : with tf . name_scope ( arg_1 or 'log_normalization_lkj' ) : arg_2 = np . log ( np . pi ) arg_3 = tf . zeros_like ( arg_0 . concentration ) for arg_4 in range ( 1 , arg_0 . dimension ) : arg_3 += arg_2 * ( arg_4 / 2. ) arg_3 += tf . math . lgamma ( arg_0 . concentration + ( arg_0 . dimension - 1 - arg_4 ) / 2. ) arg_3 -= tf . math . lgamma ( arg_0 . concentration + ( arg_0 . dimension - 1 ) / 2. ) return arg_3

def Func(arg_0, arg_1='log_normalization'):
    """Returns the log normalization of an LKJ distribution.

    Args:
      name: Python `str` name prefixed to Ops created by this function.

    Returns:
      log_z: A Tensor of the same shape and dtype as `concentration`, containing
        the corresponding log normalizers.
    """
    # The formula is from D. Lewandowski et al [1], p. 1999, from the
    # proof that eqs 16 and 17 are equivalent.
    with tf.name_scope(arg_1 or 'log_normalization_lkj'):
      arg_2 = np.log(np.pi)
      arg_3 = tf.zeros_like(arg_0.concentration)
      for arg_4 in range(1, arg_0.dimension):
        arg_3 += arg_2 * (arg_4 / 2.)
        arg_3 += tf.math.lgamma(arg_0.concentration +
                              (arg_0.dimension - 1 - arg_4) / 2.)
        arg_3 -= tf.math.lgamma(arg_0.concentration + (arg_0.dimension - 1) / 2.)
      return arg_3

Returns the log normalization of an LKJ distribution .


def Func ( arg_0 ) : arg_1 = arg_0 . sanitizer if not arg_1 : arg_2 = settings . CONFIG . get ( arg_0 . SANITIZER_KEY ) arg_3 = getattr ( arg_0 , 'field_settings' , None ) if isinstance ( arg_3 , six . string_types ) : arg_4 = settings . CONFIG . get ( arg_0 . SANITIZER_PROFILES_KEY , { } ) arg_1 = arg_4 . get ( arg_3 , arg_2 ) else : arg_1 = arg_2 if isinstance ( arg_1 , six . string_types ) : arg_1 = import_string ( arg_1 ) return arg_1 or noop

def Func(arg_0):
        """
        Get the field sanitizer.

        The priority is the first defined in the following order:
        - A sanitizer provided to the widget.
        - Profile (field settings) specific sanitizer, if defined in settings.
        - Global sanitizer defined in settings.
        - Simple no-op sanitizer which just returns the provided value.

        """
        arg_1 = arg_0.sanitizer

        if not arg_1:
            arg_2 = settings.CONFIG.get(arg_0.SANITIZER_KEY)
            arg_3 = getattr(arg_0, 'field_settings', None)
            if isinstance(arg_3, six.string_types):
                arg_4 = settings.CONFIG.get(arg_0.SANITIZER_PROFILES_KEY, {})
                arg_1 = arg_4.get(arg_3, arg_2)
            else:
                arg_1 = arg_2

        if isinstance(arg_1, six.string_types):
            arg_1 = import_string(arg_1)

        return arg_1 or noop


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = CHR_PATTERN . match ( arg_0 ) arg_4 = arg_3 . group ( 2 ) if arg_4 != arg_2 [ 'chrom' ] : return False if ( arg_1 >= arg_2 [ 'start' ] and arg_1 <= arg_2 [ 'end' ] ) : return True return False

def Func(arg_0, arg_1, arg_2):
    """Check if the variant is in the interval given by the coordinates

        Args:
            chromosome(str): Variant chromosome
            pos(int): Variant position
            coordinates(dict): Dictionary with the region of interest
    """
    arg_3 = CHR_PATTERN.match(arg_0)
    arg_4 = arg_3.group(2)

    if arg_4 != arg_2['chrom']:
        return False

    if (arg_1 >= arg_2['start'] and arg_1 <= arg_2['end']):
        return True

    return False


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = pd . read_csv ( arg_0 , delim_whitespace = True ) if arg_2 != None : arg_3 [ arg_2 ] = arg_3 . X del arg_3 [ "X" ] arg_3 [ "step" ] = 0 arg_4 = 0. for arg_5 in range ( len ( arg_1 ) ) : arg_6 = arg_1 [ arg_5 ] . duration arg_7 = arg_3 [ arg_3 . t == arg_4 ] . index if len ( arg_7 ) == 2 : arg_3 . loc [ arg_7 [ 1 ] : , "step" ] = arg_5 arg_4 += arg_6 return arg_3

def Func(arg_0, arg_1, arg_2 = None):
  """
  Reads an history output report.
  """
  arg_3 = pd.read_csv(arg_0, delim_whitespace = True)
  if arg_2 != None:
    arg_3[arg_2] = arg_3.X
    del arg_3["X"]

  arg_3["step"] = 0
  arg_4 = 0.
  for arg_5 in range(len(arg_1)):
    arg_6 = arg_1[arg_5].duration
    arg_7 = arg_3[arg_3.t == arg_4].index
    if len(arg_7) == 2:
      arg_3.loc[arg_7[1]:, "step"] = arg_5
    arg_4 += arg_6
  return arg_3


def Func(arg_0):
  """
  Make the plot with radial velocity performance predictions.

  :argument args: command line arguments
  """
  arg_1=np.linspace(5.7,16.1,101)

  arg_2=['B0V', 'B5V', 'A0V', 'A5V', 'F0V', 'G0V',
        'G5V', 'K0V', 'K1IIIMP', 'K4V', 'K1III']

  arg_3=plt.figure(figsize=(10,6.5))
  arg_4 = 240.0/(len(arg_2)-1)
  arg_5=np.zeros((1,1,3))
  arg_5[0,0,1]=1.0
  arg_5[0,0,2]=0.9
  arg_6=0
  for arg_7 in arg_2:
    arg_5[0,0,0]=(240-arg_6*arg_4)/360.0
    arg_8 = vminGrvsFromVmini(vminiFromSpt(arg_7)) + arg_1
    arg_9 = vradErrorSkyAvg(arg_8, arg_7)
    plt.plot(arg_8, arg_9, '-', label=arg_7, color=hsv_to_rgb(arg_5)[0,0,:])
    arg_6+=1
  plt.grid(which='both')
  plt.xlim(9,17.5)
  plt.ylim(0,20)
  plt.xticks(np.arange(9,18,1))
  plt.yticks(np.arange(0,20.5,5))
  plt.xlabel('$V$ [mag]')
  plt.ylabel('End-of-mission radial velocity error [km s$^{-1}$]')
  arg_10=plt.legend(loc=0,  handlelength=2.0, labelspacing=0.10)
  for arg_11 in arg_10.get_texts():
    arg_11.set_fontsize(12)

  if (arg_0['pdfOutput']):
    plt.savefig('RadialVelocityErrors.pdf')
  elif (arg_0['pngOutput']):
    plt.savefig('RadialVelocityErrors.png')
  else:
    plt.show()

Make the plot with radial velocity performance predictions .


def Func ( arg_0 , arg_1 = None ) : arg_2 = read_client_secrets ( ) if arg_1 is not None and arg_1 in arg_2 : return arg_2 [ arg_1 ] return arg_2

def Func(arg_0, arg_1=None):
    '''get all settings, either for a particular client if a name is provided,
       or across clients.

       Parameters
       ==========
       client_name: the client name to return settings for (optional)

    '''
    arg_2 = read_client_secrets()
    if arg_1 is not None and arg_1 in arg_2:
        return arg_2[arg_1]
    return arg_2

get all settings either for a particular client if a name is provided or across clients .


def Func ( arg_0 ) : arg_1 = { arg_0 . key_name : arg_0 . key_value } arg_0 . session . query ( arg_0 . model_class ) . filter_by ( ** arg_1 ) . delete ( )

def Func(arg_0):
        """Delete credentials from the SQLAlchemy datastore."""
        arg_1 = {arg_0.key_name: arg_0.key_value}
        arg_0.session.query(arg_0.model_class).filter_by(**arg_1).delete()

Delete credentials from the SQLAlchemy datastore .


(state, game, d=4, cutoff_test=None, eval_fn=None)

return argmax(game.actions(state),
                  lambda a: min_value(game.result(state, a),
                                      -infinity, infinity, 0))

def Func(arg_0, arg_1, arg_2=4, arg_3=None, arg_4=None):
    """Search game to determine best action; use alpha-beta pruning.
    This version cuts off search and uses an evaluation function."""

    arg_5 = arg_1.to_move(arg_0)

    def max_value(arg_0, arg_6, arg_7, arg_8):
        if arg_3(arg_0, arg_8):
            return arg_4(arg_0)
        arg_9 = -infinity
        for arg_10 in arg_1.actions(arg_0):
            arg_9 = max(arg_9, min_value(arg_1.result(arg_0, arg_10),
                                 arg_6, arg_7, arg_8+1))
            if arg_9 >= arg_7:
                return arg_9
            arg_6 = max(arg_6, arg_9)
        return arg_9

    def min_value(arg_0, arg_6, arg_7, arg_8):
        if arg_3(arg_0, arg_8):
            return arg_4(arg_0)
        arg_9 = infinity
        for arg_10 in arg_1.actions(arg_0):
            arg_9 = min(arg_9, max_value(arg_1.result(arg_0, arg_10),
                                 arg_6, arg_7, arg_8+1))
            if arg_9 <= arg_6:
                return arg_9
            arg_7 = min(arg_7, arg_9)
        return arg_9

    # Body of Func starts here:
    # The default test cuts off at depth d or at a terminal state
    arg_3 = (arg_3 or
                   (lambda arg_0,arg_8: arg_8>arg_2 or arg_1.terminal_test(arg_0)))
    arg_4 = arg_4 or (lambda arg_0: arg_1.utility(arg_0, arg_5))
    return argmax(arg_1.actions(arg_0),
                  lambda arg_10: min_value(arg_1.result(arg_0, arg_10),
                                      -infinity, infinity, 0))

Search game to determine best action ; use alpha - beta pruning . This version cuts off search and uses an evaluation function .


return isinstance(
        parent, (astroid.TryExcept, astroid.ExceptHandler, astroid.If, astroid.IfExp)
    )

def Func ( arg_0 ) : arg_1 = arg_0 . parent return isinstance ( arg_1 , ( astroid . TryExcept , astroid . ExceptHandler , astroid . If , astroid . IfExp ) )

def Func(arg_0):
    """Checks if an import node is in the context of a conditional.
    """
    arg_1 = arg_0.parent
    return isinstance(
        arg_1, (astroid.TryExcept, astroid.ExceptHandler, astroid.If, astroid.IfExp)
    )

Checks if an import node is in the context of a conditional .


def Func(arg_0=None):
    """Returns login and password stored in `secret.txt`."""
    while not check_secret():
        pass
    while True:
        try:
            with open(SECRET_FILE, "r") as f:
                arg_1 = [line.strip().split(":", 2) for line in f.readlines()]
        except ValueError:
            arg_2 = 'Problem with opening `{}`, will remove the file.'
            raise Exception(arg_2.format(SECRET_FILE))
        if arg_0 is not None:
            for arg_3, arg_4 in arg_1:
                if arg_3 == arg_0.strip():
                    return arg_3, arg_4
        print("Which account do you want to use? (Type number)")
        for arg_5, (arg_3, arg_4) in enumerate(arg_1):
            print("%d: %s" % (arg_5 + 1, arg_3))
        print("%d: %s" % (0, "add another account."))
        print("%d: %s" % (-1, "delete all accounts."))
        try:
            arg_5 = int(sys.stdin.readline())
            if arg_5 == 0:
                add_credentials()
                continue
            elif arg_5 == -1:
                delete_credentials()
                check_secret()
                continue
            elif 0 <= arg_5 - 1 < len(arg_1):
                return arg_1[arg_5 - 1]
        except Exception:
            print("Wrong input, enter the number of the account to use.")

Returns login and password stored in secret . txt .


(self, duration_s=1, threshold_percentage=1, console_output=False)

def Func(arg_0, arg_1=1, arg_2=1, arg_3=False):
        """
        Returns a copy of this AudioSegment, but whose silence has been removed.

        .. note:: This method requires that you have the program 'sox' installed.

        .. warning:: This method uses the program 'sox' to perform the task. While this is very fast for a single
                     function call, the IO may add up for large numbers of AudioSegment objects.

        :param duration_s: The number of seconds of "silence" that must be present in a row to
                           be stripped.
        :param threshold_percentage: Silence is defined as any samples whose absolute value is below
                                     `threshold_percentage * max(abs(samples in this segment))`.
        :param console_output: If True, will pipe all sox output to the console.
        :returns: A copy of this AudioSegment, but whose silence has been removed.
        """
        arg_4 = "sox {inputfile} -t wav {outputfile} silence -l 1 0.1 "\
            + str(arg_2) + "% -1 " + str(float(arg_1)) + " " + str(arg_2) + "%"
        try:
            arg_5 = arg_0._execute_sox_cmd(arg_4)
        except pydub.exceptions.CouldntDecodeError:
            warnings.warn("After silence filtering, the resultant WAV file is corrupted, and so its data cannot be retrieved. Perhaps try a smaller threshold value.", stacklevel=2)
            # Return a copy of us
            arg_5 = AudioSegment(arg_0.seg, arg_0.name)
        return arg_5

Returns a copy of this AudioSegment but whose silence has been removed .


def Func(arg_0, arg_1):
        """Initializes Grid from a CCP4 file."""
        arg_2 = CCP4.CCP4()
        arg_2.read(arg_1)
        arg_3, arg_4 = arg_2.histogramdd()
        arg_0.__init__(arg_3=arg_3, arg_4=arg_4, metadata=arg_0.metadata)


def Func ( arg_0 , arg_1 ) : if arg_0 . METADATA [ "data_type" ] == "raster" : return ( is_numpy_or_masked_array ( arg_1 ) or is_numpy_or_masked_array_with_tags ( arg_1 ) ) elif arg_0 . METADATA [ "data_type" ] == "vector" : return is_feature_list ( arg_1 )

def Func(arg_0, arg_1):
        """
        Check whether process output is allowed with output driver.

        Parameters
        ----------
        process_data : raw process output

        Returns
        -------
        True or False
        """
        if arg_0.METADATA["data_type"] == "raster":
            return (
                is_numpy_or_masked_array(arg_1) or
                is_numpy_or_masked_array_with_tags(arg_1)
            )
        elif arg_0.METADATA["data_type"] == "vector":
            return is_feature_list(arg_1)

Check whether process output is allowed with output driver .


return parse.urlunsplit((scheme, netloc, path, query, fragment))

def
Func
(
arg_0
,
**
arg_1
)
:
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
parse
.
urlsplit
(
arg_0
)
if
'scheme'
in
arg_1
:
arg_2
=
arg_1
[
'scheme'
]
arg_7
,
arg_8
=
parse
.
splituser
(
arg_3
)
arg_9
,
arg_10
=
parse
.
splitpasswd
(
arg_7
)
if
arg_7
else
(
,
)
if
'user'
in
arg_1
:
arg_9
=
arg_1
[
'user'
]
elif
arg_9
is
not
:
arg_9
=
parse
.
unquote_to_bytes
(
arg_9
)
.
decode
(
'utf-8'
)
if
'password'
in
arg_1
:
arg_10
=
arg_1
[
'password'
]
elif
arg_10
is
not
:
arg_10
=
parse
.
unquote_to_bytes
(
arg_10
)
.
decode
(
'utf-8'
)
arg_7
=
_create_url_identifier
(
arg_9
,
arg_10
)
arg_11
,
arg_12
=
parse
.
splitnport
(
arg_8
,
defport
=
)
if
'host'
in
arg_1
:
arg_11
=
arg_1
[
'host'
]
if
arg_11
is
not
:
arg_11
=
_normalize_host
(
arg_11
,
enable_long_host
=
arg_1
.
get
(
'enable_long_host'
,
False
)
,
encode_with_idna
=
arg_1
.
get
(
'encode_with_idna'
,
)
,
arg_2
=
arg_2
,
)
if
'port'
in
arg_1
:
arg_12
=
arg_1
[
'port'
]
if
arg_12
is
not
:
arg_12
=
int
(
arg_1
[
'port'
]
)
if
arg_12
<
0
:
raise
ValueError
(
'port is required to be non-negative'
)
if
arg_11
is
or
arg_11
==
''
:
arg_8
=
elif
arg_12
is
:
arg_8
=
arg_11
else
:
arg_8
=
'{0}:{1}'
.
format
(
arg_11
,
arg_12
)
if
'path'
in
arg_1
:
arg_4
=
arg_1
[
'path'
]
if
arg_4
is
:
arg_4
=
'/'
else
:
arg_4
=
parse
.
quote
(
arg_4
.
encode
(
'utf-8'
)
,
safe
=
PATH_SAFE_CHARS
)
arg_3
=
'{0}@{1}'
.
format
(
arg_7
,
arg_8
)
if
arg_7
else
arg_8
if
'query'
in
arg_1
:
arg_13
=
arg_1
[
'query'
]
if
arg_13
is
:
arg_5
=
else
:
arg_14
=
[
]
try
:
for
arg_15
in
sorted
(
arg_13
.
keys
(
)
)
:
arg_14
.
append
(
(
arg_15
,
arg_13
[
arg_15
]
)
)
except
AttributeError
:
pass
if
not
arg_14
:
try
:
arg_14
=
[
(
arg_15
,
value
)
for
arg_15
,
value
in
arg_13
]
except
ValueError
:
pass
if
arg_14
:
arg_5
=
parse
.
urlencode
(
arg_14
)
else
:
arg_5
=
arg_13
if
'fragment'
in
arg_1
:
arg_6
=
arg_1
[
'fragment'
]
if
arg_6
is
not
:
arg_6
=
parse
.
quote
(
arg_6
.
encode
(
'utf-8'
)
,
safe
=
FRAGMENT_SAFE_CHARS
)
if
arg_2
is
:
arg_2
=
''
return
parse
.
urlunsplit
(
(
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
)

def Func(arg_0, **arg_1):
    """
    Create a new URL from `input_url` with modifications applied.

    :param str input_url: the URL to modify

    :keyword str fragment: if specified, this keyword sets the
        fragment portion of the URL.  A value of :data:`None`
        will remove the fragment portion of the URL.
    :keyword str host: if specified, this keyword sets the host
        portion of the network location.  A value of :data:`None`
        will remove the network location portion of the URL.
    :keyword str password: if specified, this keyword sets the
        password portion of the URL.  A value of :data:`None` will
        remove the password from the URL.
    :keyword str path: if specified, this keyword sets the path
        portion of the URL.  A value of :data:`None` will remove
        the path from the URL.
    :keyword int port: if specified, this keyword sets the port
        portion of the network location.  A value of :data:`None`
        will remove the port from the URL.
    :keyword query: if specified, this keyword sets the query portion
        of the URL.  See the comments for a description of this
        parameter.
    :keyword str scheme: if specified, this keyword sets the scheme
        portion of the URL.  A value of :data:`None` will remove
        the scheme.  Note that this will make the URL relative and
        may have unintended consequences.
    :keyword str user: if specified, this keyword sets the user
        portion of the URL.  A value of :data:`None` will remove
        the user and password portions.

    :keyword bool enable_long_host: if this keyword is specified
        and it is :data:`True`, then the host name length restriction
        from :rfc:`3986#section-3.2.2` is relaxed.
    :keyword bool encode_with_idna: if this keyword is specified
        and it is :data:`True`, then the ``host`` parameter will be
        encoded using IDN.  If this value is provided as :data:`False`,
        then the percent-encoding scheme is used instead.  If this
        parameter is omitted or included with a different value, then
        the ``host`` parameter is processed using :data:`IDNA_SCHEMES`.

    :return: the modified URL
    :raises ValueError: when a keyword parameter is given an invalid
        value

    If the `host` parameter is specified and not :data:`None`, then
    it will be processed as an Internationalized Domain Name (IDN)
    if the scheme appears in :data:`IDNA_SCHEMES`.  Otherwise, it
    will be encoded as UTF-8 and percent encoded.

    The handling of the `query` parameter requires some additional
    explanation.  You can specify a query value in three different
    ways - as a *mapping*, as a *sequence* of pairs, or as a *string*.
    This flexibility makes it possible to meet the wide range of
    finicky use cases.

    *If the query parameter is a mapping*, then the key + value pairs
    are *sorted by the key* before they are encoded.  Use this method
    whenever possible.

    *If the query parameter is a sequence of pairs*, then each pair
    is encoded *in the given order*.  Use this method if you require
    that parameter order is controlled.

    *If the query parameter is a string*, then it is *used as-is*.
    This form SHOULD BE AVOIDED since it can easily result in broken
    URLs since *no URL escaping is performed*.  This is the obvious
    pass through case that is almost always present.

    """
    arg_2, arg_3, arg_4, arg_5, arg_6 = parse.urlsplit(arg_0)

    if 'scheme' in arg_1:
        arg_2 = arg_1['scheme']

    arg_7, arg_8 = parse.splituser(arg_3)

    arg_9, arg_10 = parse.splitpasswd(arg_7) if arg_7 else (None, None)
    if 'user' in arg_1:
        arg_9 = arg_1['user']
    elif arg_9 is not None:
        arg_9 = parse.unquote_to_bytes(arg_9).decode('utf-8')
    if 'password' in arg_1:
        arg_10 = arg_1['password']
    elif arg_10 is not None:
        arg_10 = parse.unquote_to_bytes(arg_10).decode('utf-8')
    arg_7 = _create_url_identifier(arg_9, arg_10)

    arg_11, arg_12 = parse.splitnport(arg_8, defport=None)
    if 'host' in arg_1:
        arg_11 = arg_1['host']
        if arg_11 is not None:
            arg_11 = _normalize_host(
                arg_11,
                enable_long_host=arg_1.get('enable_long_host', False),
                encode_with_idna=arg_1.get('encode_with_idna', None),
                arg_2=arg_2,
            )

    if 'port' in arg_1:
        arg_12 = arg_1['port']
        if arg_12 is not None:
            arg_12 = int(arg_1['port'])
            if arg_12 < 0:
                raise ValueError('port is required to be non-negative')

    if arg_11 is None or arg_11 == '':
        arg_8 = None
    elif arg_12 is None:
        arg_8 = arg_11
    else:
        arg_8 = '{0}:{1}'.format(arg_11, arg_12)

    if 'path' in arg_1:
        arg_4 = arg_1['path']
        if arg_4 is None:
            arg_4 = '/'
        else:
            arg_4 = parse.quote(arg_4.encode('utf-8'), safe=PATH_SAFE_CHARS)

    arg_3 = '{0}@{1}'.format(arg_7, arg_8) if arg_7 else arg_8

    if 'query' in arg_1:
        arg_13 = arg_1['query']
        if arg_13 is None:
            arg_5 = None
        else:
            arg_14 = []
            try:
                for arg_15 in sorted(arg_13.keys()):
                    arg_14.append((arg_15, arg_13[arg_15]))
            except AttributeError:  # arg is None or not a dict
                pass

            if not arg_14:  # maybe a sequence of tuples?
                try:
                    arg_14 = [(arg_15, value) for arg_15, value in arg_13]
                except ValueError:  # guess not...
                    pass

            if arg_14:
                arg_5 = parse.urlencode(arg_14)
            else:
                arg_5 = arg_13

    if 'fragment' in arg_1:
        arg_6 = arg_1['fragment']
        if arg_6 is not None:
            arg_6 = parse.quote(arg_6.encode('utf-8'),
                                   safe=FRAGMENT_SAFE_CHARS)

    # The following is necessary to get around some interesting special
    # case code in urllib.parse._coerce_args in Python 3.4.  Setting
    # scheme to None causes urlunsplit to assume that all non-``None``
    # parameters with be byte strings....
    if arg_2 is None:
        arg_2 = ''

    return parse.urlunsplit((arg_2, arg_3, arg_4, arg_5, arg_6))

Create a new URL from input_url with modifications applied .


def Func ( ** arg_0 ) : if "__table_editor__" in arg_0 : arg_1 = arg_0 [ "__table_editor__" ] arg_2 = arg_1 . object arg_3 = make_unique_name ( "node" , [ node . ID for node in arg_2 . nodes ] ) arg_4 = len ( arg_2 . nodes ) arg_5 = [ v . ID for v in arg_2 . nodes ] if arg_4 == 0 : arg_6 = godot . Node ( arg_3 = make_unique_name ( "n" , arg_5 ) ) arg_7 = godot . Node ( arg_3 = make_unique_name ( "n" , arg_5 ) ) elif arg_4 == 1 : arg_6 = arg_2 . nodes [ 0 ] arg_7 = godot . Node ( arg_3 = make_unique_name ( "n" , arg_5 ) ) else : arg_6 = arg_2 . nodes [ 0 ] arg_7 = arg_2 . nodes [ 1 ] return godot . edge . Edge ( arg_6 , arg_7 , _nodes = arg_2 . nodes ) else : return None

def Func(**arg_0):
    """ Give new edges a unique ID. """

    if "__table_editor__" in arg_0:
        arg_1 = arg_0["__table_editor__"]
        arg_2 = arg_1.object
        arg_3 = make_unique_name("node", [node.ID for node in arg_2.nodes])

        arg_4 = len(arg_2.nodes)
        arg_5 = [v.ID for v in arg_2.nodes]

        if arg_4 == 0:
            arg_6 = godot.Node(arg_3=make_unique_name("n", arg_5))
            arg_7 = godot.Node(arg_3=make_unique_name("n", arg_5))
        elif arg_4 == 1:
            arg_6 = arg_2.nodes[0]
            arg_7 = godot.Node(arg_3=make_unique_name("n", arg_5))
        else:
            arg_6 = arg_2.nodes[0]
            arg_7 = arg_2.nodes[1]

        return godot.edge.Edge(arg_6, arg_7, _nodes=arg_2.nodes)
    else:
        return None


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_0 = os . path . expanduser ( arg_0 ) arg_3 = list ( filter ( lambda p : os . path . isfile ( os . path . join ( arg_0 , p ) ) and p . endswith ( arg_1 ) , os . listdir ( arg_0 ) ) ) if arg_2 is True : arg_3 = [ os . path . join ( arg_0 , d ) for d in arg_3 ] return arg_3

def Func(arg_0, arg_1, arg_2=False):
    """List all files ending with a suffix at a given root

    Args:
        root (str): Path to directory whose folders need to be listed
        suffix (str or tuple): Suffix of the files to match, e.g. '.png' or ('.jpg', '.png').
            It uses the Python "str.endswith" method and is passed directly
        prefix (bool, optional): If true, prepends the path to each result, otherwise
            only returns the name of the files found
    """
    arg_0 = os.path.expanduser(arg_0)
    arg_3 = list(
        filter(
            lambda p: os.path.isfile(os.path.join(arg_0, p)) and p.endswith(arg_1),
            os.listdir(arg_0)
        )
    )

    if arg_2 is True:
        arg_3 = [os.path.join(arg_0, d) for d in arg_3]

    return arg_3


def Func ( arg_0 ) : arg_1 = [ ] if isinstance ( arg_0 , str ) : arg_0 = [ arg_0 ] for arg_2 in arg_0 : arg_3 = re_emails . findall ( arg_2 ) arg_1 . extend ( [ arg_4 [ 2 ] for arg_4 in arg_3 ] ) return arg_1

def Func(arg_0):
    '''
    Take a string or list of strings and try to extract all the emails
    '''
    arg_1 = []
    if isinstance(arg_0, str):
        arg_0 = [arg_0]
    # now we know we have a list of strings
    for arg_2 in arg_0:
        arg_3 = re_emails.findall(arg_2)
        arg_1.extend([arg_4[2] for arg_4 in arg_3])
    return arg_1


def Func(arg_0):
        """Timeout of selecting on SELECTING state.

        Not specifiyed in [:rfc:`7844`].
        See comments in :func:`dhcpcapfsm.DHCPCAPFSM.timeout_request`.

        """
        logger.debug('C2.1: T In %s, timeout receiving response to select.',
                     arg_0.current_state)

        if len(arg_0.offers) >= MAX_OFFERS_COLLECTED:
            logger.debug('C2.2: T Maximum number of offers reached, '
                         'raise REQUESTING.')
            raise arg_0.REQUESTING()

        if arg_0.discover_attempts >= MAX_ATTEMPTS_DISCOVER:
            logger.debug('C2.3: T Maximum number of discover retries is %s'
                         ' and already sent %s.',
                         MAX_ATTEMPTS_DISCOVER, arg_0.discover_attempts)
            if len(arg_0.offers) <= 0:
                logger.debug('C2.4: T. But no OFFERS where received, '
                             'raise ERROR.')
                raise arg_0.ERROR()
            logger.debug('C2.4: F. But there is some OFFERS, '
                         'raise REQUESTING.')
            raise arg_0.REQUESTING()

        logger.debug('C2.2: F. Still not received all OFFERS, but not '
                     'max # attemps reached, raise SELECTING.')
        raise arg_0.SELECTING()

Timeout of selecting on SELECTING state .


For each row or column in cuts, read a list of its colors,
        apply the function to that list of colors, then write it back
        to the layout.

def Func(arg_0, arg_1):
        """
        For each row or column in cuts, read a list of its colors,
        Func the function to that list of colors, then write it back
        to the layout.
        """
        for arg_2 in arg_0.cuts:
            arg_3 = arg_0.read(arg_2)
            arg_1(arg_3)
            arg_0.write(arg_2, arg_3)

For each row or column in cuts read a list of its colors apply the function to that list of colors then write it back to the layout .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_2 . status not in [ 200 , 203 , 300 , 301 ] : return arg_4 = CaseInsensitiveDict ( arg_2 . headers ) arg_5 = arg_0 . parse_cache_control ( arg_1 . headers ) arg_6 = arg_0 . parse_cache_control ( arg_4 ) arg_7 = arg_0 . cache_url ( arg_1 . url ) arg_8 = arg_6 . get ( 'no-store' ) or arg_5 . get ( 'no-store' ) if arg_8 and arg_0 . cache . get ( arg_7 ) : arg_0 . cache . delete ( arg_7 ) if arg_0 . cache_etags and 'etag' in arg_4 : arg_0 . cache . set ( arg_7 , arg_0 . serializer . dumps ( arg_1 , arg_2 , arg_3 = arg_3 ) , ) elif arg_2 . status == 301 : arg_0 . cache . set ( arg_7 , arg_0 . serializer . dumps ( arg_1 , arg_2 ) ) elif 'date' in arg_4 : if arg_6 and arg_6 . get ( 'max-age' ) : if int ( arg_6 [ 'max-age' ] ) > 0 : arg_0 . cache . set ( arg_7 , arg_0 . serializer . dumps ( arg_1 , arg_2 , arg_3 = arg_3 ) , ) elif 'expires' in arg_4 : if arg_4 [ 'expires' ] : arg_0 . cache . set ( arg_7 , arg_0 . serializer . dumps ( arg_1 , arg_2 , arg_3 = arg_3 ) , )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Algorithm for caching requests.

        This assumes a requests Response object.
        """
        # From httplib2: Don't cache 206's since we aren't going to
        #                handle byte range requests
        if arg_2.status not in [200, 203, 300, 301]:
            return

        arg_4 = CaseInsensitiveDict(arg_2.headers)

        arg_5 = arg_0.parse_cache_control(arg_1.headers)
        arg_6 = arg_0.parse_cache_control(arg_4)

        arg_7 = arg_0.cache_url(arg_1.url)

        # Delete it from the cache if we happen to have it stored there
        arg_8 = arg_6.get('no-store') or arg_5.get('no-store')
        if arg_8 and arg_0.cache.get(arg_7):
            arg_0.cache.delete(arg_7)

        # If we've been given an etag, then keep the response
        if arg_0.cache_etags and 'etag' in arg_4:
            arg_0.cache.set(
                arg_7,
                arg_0.serializer.dumps(arg_1, arg_2, arg_3=arg_3),
            )

        # Add to the cache any 301s. We do this before looking that
        # the Date headers.
        elif arg_2.status == 301:
            arg_0.cache.set(
                arg_7,
                arg_0.serializer.dumps(arg_1, arg_2)
            )

        # Add to the cache if the response headers demand it. If there
        # is no date header then we can't do anything about expiring
        # the cache.
        elif 'date' in arg_4:
            # cache when there is a max-age > 0
            if arg_6 and arg_6.get('max-age'):
                if int(arg_6['max-age']) > 0:
                    arg_0.cache.set(
                        arg_7,
                        arg_0.serializer.dumps(arg_1, arg_2, arg_3=arg_3),
                    )

            # If the request can expire, it means we should cache it
            # in the meantime.
            elif 'expires' in arg_4:
                if arg_4['expires']:
                    arg_0.cache.set(
                        arg_7,
                        arg_0.serializer.dumps(arg_1, arg_2, arg_3=arg_3),
                    )


def Func ( arg_0 , arg_1 ) : arg_2 = session . communicator . create_folder ( session . token , os . path . basename ( arg_0 ) , arg_1 ) return arg_2 [ 'folder_id' ]

def Func(arg_0, arg_1):
    """
    Function for creating a remote folder and returning the id. This should be
    a building block for user-level functions.

    :param local_folder: full path to a local folder
    :type local_folder: string
    :param parent_folder_id: id of parent folder on the Midas Server instance,
        where the new folder will be added
    :type parent_folder_id: int | long
    :returns: id of the remote folder that was created
    :rtype: int | long
    """
    arg_2 = session.communicator.create_folder(
        session.token, os.path.basename(arg_0), arg_1)
    return arg_2['folder_id']

Function for creating a remote folder and returning the id . This should be a building block for user - level functions .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
pending
[
arg_1
]
for
arg_3
in
arg_2
.
keys
(
)
:
if
arg_3
not
in
arg_0
.
pending
[
arg_1
]
:
continue
arg_4
=
arg_2
[
arg_3
]
.
raw_msg
arg_5
,
arg_6
=
arg_0
.
session
.
feed_identities
(
arg_4
,
copy
=
False
)
arg_7
=
arg_0
.
session
.
unpack
(
arg_6
[
1
]
.
bytes
)
arg_5
=
[
arg_1
,
arg_5
[
0
]
]
try
:
raise
error
.
EngineError
(
"Engine %r died while running task %r"
%
(
arg_1
,
arg_3
)
)
except
:
arg_8
=
error
.
wrap_exception
(
)
arg_9
=
dict
(
status
=
'error'
,
arg_1
=
arg_1
,
date
=
datetime
.
now
(
)
,
)
arg_6
=
arg_0
.
session
.
msg
(
'apply_reply'
,
arg_8
,
arg_7
=
arg_7
,
subheader
=
arg_9
)
arg_10
=
map
(
zmq
.
Message
,
arg_0
.
session
.
serialize
(
arg_6
,
ident
=
arg_5
)
)
arg_0
.
dispatch_result
(
arg_10
)
arg_0
.
completed
.
pop
(
arg_1
)
arg_0
.
failed
.
pop
(
arg_1
)

def Func(arg_0, arg_1):
        """Deal with jobs resident in an engine that died."""
        arg_2 = arg_0.pending[arg_1]
        for arg_3 in arg_2.keys():
            if arg_3 not in arg_0.pending[arg_1]:
                # prevent double-handling of messages
                continue

            arg_4 = arg_2[arg_3].raw_msg
            arg_5,arg_6 = arg_0.session.feed_identities(arg_4, copy=False)
            arg_7 = arg_0.session.unpack(arg_6[1].bytes)
            arg_5 = [arg_1, arg_5[0]]

            # build fake error reply
            try:
                raise error.EngineError("Engine %r died while running task %r"%(arg_1, arg_3))
            except:
                arg_8 = error.wrap_exception()
            # build fake header
            arg_9 = dict(
                status='error',
                arg_1=arg_1,
                date=datetime.now(),
            )
            arg_6 = arg_0.session.msg('apply_reply', arg_8, arg_7=arg_7, subheader=arg_9)
            arg_10 = map(zmq.Message, arg_0.session.serialize(arg_6, ident=arg_5))
            # and dispatch it
            arg_0.dispatch_result(arg_10)

        # finally scrub completed/failed lists
        arg_0.completed.pop(arg_1)
        arg_0.failed.pop(arg_1)

Deal with jobs resident in an engine that died .


def Func(arg_0, arg_1):
        """Receive ACK in REQUESTING state."""
        logger.debug("C3. Received ACK?, in REQUESTING state.")
        if arg_0.process_received_ack(arg_1):
            logger.debug("C3: T. Received ACK, in REQUESTING state, "
                         "raise BOUND.")
            raise arg_0.BOUND()


(self, stack=False, copy_meta=False, memo=None)

return Features(fs, n_pts, copy=False, **meta)

def Func ( arg_0 , arg_1 = False , arg_2 = False , arg_3 = None ) : if arg_0 . stacked : arg_4 = deepFunc ( arg_0 . stacked_features , arg_3 ) arg_5 = arg_0 . n_pts . Func ( ) elif arg_1 : arg_4 = np . vstack ( arg_0 . features ) arg_5 = arg_0 . n_pts . Func ( ) else : arg_4 = deepFunc ( arg_0 . features , arg_3 ) arg_5 = None arg_6 = deepFunc ( arg_0 . meta , arg_3 ) if arg_2 else arg_0 . meta return Features ( arg_4 , arg_5 , Func = False , ** arg_6 )

def Func(arg_0, arg_1=False, arg_2=False, arg_3=None):
        '''
        Copies the Feature object. Makes a Func of the features array.

        Parameters
        ----------
        stack : boolean, optional, default False
            Whether to stack the Func if this one is unstacked.

        Func_meta : boolean, optional, default False
            Also Func the metadata. If False, metadata in both points to the
            same object.
        '''
        if arg_0.stacked:
            arg_4 = deepFunc(arg_0.stacked_features, arg_3)
            arg_5 = arg_0.n_pts.Func()
        elif arg_1:
            arg_4 = np.vstack(arg_0.features)
            arg_5 = arg_0.n_pts.Func()
        else:
            arg_4 = deepFunc(arg_0.features, arg_3)
            arg_5 = None

        arg_6 = deepFunc(arg_0.meta, arg_3) if arg_2 else arg_0.meta
        return Features(arg_4, arg_5, Func=False, **arg_6)

Copies the Feature object. Makes a copy of the features array.

        Parameters
        ----------
        stack : boolean, optional, default False
            Whether to stack the copy if this one is unstacked.

        copy_meta : boolean, optional, default False
            Also copy the metadata. If False, metadata in both points to the
            same object.

Copies the Feature object . Makes a copy of the features array .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 . main_dictionnary , dict ) : if isinstance ( arg_1 , list ) : for arg_2 in arg_1 : del arg_0 . main_dictionnary [ arg_2 ] else : try : del arg_0 . main_dictionnary [ arg_1 ] except KeyError : pass return arg_0 . main_dictionnary return None

def Func(arg_0, arg_1):
        """
        Remove a given key from a given dictionary.

        :param key_to_remove: The key(s) to delete.
        :type key_to_remove: list|str

        :return: The dict without the given key(s).
        :rtype: dict|None
        """

        if isinstance(arg_0.main_dictionnary, dict):
            # The main dictionnary is a dictionnary

            if isinstance(arg_1, list):
                # The parsed key to remove is a list.

                for arg_2 in arg_1:
                    # We loop through the list of key to remove.

                    # We delete the key from the dictionnary.
                    del arg_0.main_dictionnary[arg_2]
            else:
                # The parsed key to remove is not a list.

                try:
                    # We delete the given key from the dictionnary.
                    del arg_0.main_dictionnary[arg_1]
                except KeyError:
                    pass

            # We return the final dictionnary.
            return arg_0.main_dictionnary

        # The main dictionnary is not a dictionnary.

        # We return None.
        return None

Remove a given key from a given dictionary .


(cls, project, script, job_params, task_params,
                          reserved_labels, preemptible, logging_uri, scopes,
                          keep_alive)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 ) : arg_10 = { } arg_10 . update ( { SCRIPT_VARNAME : arg_2 } ) arg_10 . update ( { arg_11 . name : arg_11 . value for arg_11 in arg_3 [ 'envs' ] | arg_4 [ 'envs' ] if arg_11 . value } ) arg_10 . update ( { arg_11 . name : arg_11 . uri for arg_11 in arg_3 [ 'inputs' ] | arg_4 [ 'inputs' ] if not arg_11 . recursive and arg_11 . value } ) arg_12 = { } for arg_11 in arg_3 [ 'outputs' ] | arg_4 [ 'outputs' ] : if arg_11 . recursive or not arg_11 . value : continue if '*' in arg_11 . uri . basename : arg_12 [ arg_11 . name ] = arg_11 . uri . path else : arg_12 [ arg_11 . name ] = arg_11 . uri arg_14 = { } arg_14 . update ( { arg_15 . name : arg_15 . value if arg_15 . value else '' for arg_15 in ( arg_5 | arg_3 [ 'labels' ] | arg_4 [ 'labels' ] ) } ) arg_16 = { 'pipelineArgs' : { 'projectId' : arg_1 , 'resources' : { 'preemptible' : arg_6 , } , 'inputs' : arg_10 , 'outputs' : arg_12 , 'labels' : arg_14 , 'serviceAccount' : { 'email' : 'default' , 'scopes' : arg_8 , } , 'logging' : { 'gcsPath' : arg_7 } , } } if arg_9 : arg_16 [ 'pipelineArgs' ] [ 'keep_vm_alive_on_failure_duration' ] = '%ss' % arg_9 return arg_16

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                          arg_5, arg_6, arg_7, arg_8,
                          arg_9):
    """Builds pipeline args for execution.

    Args:
      project: string name of project.
      script: Body of the script to execute.
      job_params: dictionary of values for labels, envs, inputs, and outputs
          for this job.
      task_params: dictionary of values for labels, envs, inputs, and outputs
          for this task.
      reserved_labels: dictionary of reserved labels (e.g. task-id,
          task-attempt)
      preemptible: use a preemptible VM for the job
      logging_uri: path for job logging output.
      scopes: list of scope.
      keep_alive: Seconds to keep VM alive on failure

    Returns:
      A nested dictionary with one entry under the key pipelineArgs containing
      the pipeline arguments.
    """
    # For the Pipelines API, envs and file inputs are all "inputs".
    arg_10 = {}
    arg_10.update({SCRIPT_VARNAME: arg_2})
    arg_10.update({
        arg_11.name: arg_11.value
        for arg_11 in arg_3['envs'] | arg_4['envs']
        if arg_11.value
    })
    arg_10.update({
        arg_11.name: arg_11.uri
        for arg_11 in arg_3['inputs'] | arg_4['inputs']
        if not arg_11.recursive and arg_11.value
    })

    # Remove wildcard references for non-recursive output. When the pipelines
    # controller generates a delocalize call, it must point to a bare directory
    # for patterns. The output param OUTFILE=gs://bucket/path/*.bam should
    # delocalize with a call similar to:
    #   gsutil cp /mnt/data/output/gs/bucket/path/*.bam gs://bucket/path/
    arg_12 = {}
    for arg_11 in arg_3['outputs'] | arg_4['outputs']:
      if arg_11.recursive or not arg_11.value:
        continue
      if '*' in arg_11.uri.basename:
        arg_12[arg_11.name] = arg_11.uri.path
      else:
        arg_12[arg_11.name] = arg_11.uri

    arg_14 = {}
    arg_14.update({
        arg_15.name: arg_15.value if arg_15.value else ''
        for arg_15 in (arg_5 | arg_3['labels']
                      | arg_4['labels'])
    })

    # pyformat: disable
    arg_16 = {
        'pipelineArgs': {
            'projectId': arg_1,
            'resources': {
                'preemptible': arg_6,
            },
            'inputs': arg_10,
            'outputs': arg_12,
            'labels': arg_14,
            'serviceAccount': {
                'email': 'default',
                'scopes': arg_8,
            },
            # Pass the user-specified GCS destination for pipeline logging.
            'logging': {
                'gcsPath': arg_7
            },
        }
    }
    # pyformat: enable

    if arg_9:
      arg_16['pipelineArgs'][
          'keep_vm_alive_on_failure_duration'] = '%ss' % arg_9

    return arg_16


def
Func
(
arg_0
)
:
lg
.
info
(
'Building all b and c from IOPs'
)
arg_0
.
build_a
(
)
arg_0
.
build_bb
(
)
arg_0
.
build_b
(
)
arg_0
.
build_c
(
)

def Func(arg_0):
        """Meta method that calls all of the build methods in the correct order

        self.build_a()
        self.build_bb()
        self.build_b()
        self.build_c()
        """
        lg.info('Building all b and c from IOPs')

        arg_0.build_a()
        arg_0.build_bb()
        arg_0.build_b()
        arg_0.build_c()


def Func(arg_0):
        """start the heart beating"""
        # heartbeat doesn't share context, because it mustn't be blocked
        # by the GIL, which is accessed by libzmq when freeing zero-copy messages
        arg_1 = zmq.Context()
        arg_0.heartbeat = Heartbeat(arg_1, (arg_0.ip, arg_0.hb_port))
        arg_0.hb_port = arg_0.heartbeat.port
        arg_0.log.debug("Heartbeat REP Channel on port: %i"%arg_0.hb_port)
        arg_0.heartbeat.start()

        # Helper to make it easier to connect to an existing kernel.
        # set log-level to critical, to make sure it is output
        arg_0.log.critical("To connect another client to this kernel, use:")


def Func ( arg_0 , arg_1 ) : if arg_1 . orelse and not _loop_exits_early ( arg_1 ) : arg_0 . add_message ( "useless-else-on-loop" , arg_1 = arg_1 , line = arg_1 . orelse [ 0 ] . lineno - 1 , )

def Func(arg_0, arg_1):
        """Check that any loop with an else clause has a break statement."""
        if arg_1.orelse and not _loop_exits_early(arg_1):
            arg_0.add_message(
                "useless-else-on-loop",
                arg_1=arg_1,
                # This is not optimal, but the line previous
                # to the first statement in the else clause
                # will usually be the one that contains the else:.
                line=arg_1.orelse[0].lineno - 1,
            )

Check that any loop with an else clause has a break statement .


def Func(arg_0):
    """Start the kernel, coordinating with the Cocoa CFRunLoop event loop
    via the matplotlib MacOSX backend.
    """
    import matplotlib
    if matplotlib.__version__ < '1.1.0':
        arg_0.log.warn(
        "MacOSX backend in matplotlib %s doesn't have a Timer, "
        "falling back on Tk for CFRunLoop integration.  Note that "
        "even this won't work if Tk is linked against X11 instead of "
        "Cocoa (e.g. EPD).  To use the MacOSX backend in the kernel, "
        "you must use matplotlib >= 1.1.0, or a native libtk."
        )
        return loop_tk(arg_0)

    from matplotlib.backends.backend_macosx import TimerMac, show

    # scale interval for sec->ms
    arg_1 = int(1000*arg_0._poll_interval)

    arg_2 = arg_6.excepthook
    def handle_int(arg_3, arg_4, arg_5):
        """don't let KeyboardInterrupts look like crashes"""
        if arg_3 is KeyboardInterrupt:
            io.raw_print("KeyboardInterrupt caught in CFRunLoop")
        else:
            arg_2(arg_3, arg_4, arg_5)

    # add doi() as a Timer to the CFRunLoop
    def doi():
        # restore excepthook during IPython code
        arg_6.excepthook = arg_2
        arg_0.do_one_iteration()
        # and back:
        arg_6.excepthook = handle_int

    arg_8 = TimerMac(arg_1)
    arg_8.add_callback(doi)
    arg_8.start()

    # but still need a Poller for when there are no active windows,
    # during which time mainloop() returns immediately
    arg_9 = zmq.Poller()
    if arg_0.control_stream:
        arg_9.register(arg_0.control_stream.socket, zmq.POLLIN)
    for arg_10 in arg_0.shell_streams:
        arg_9.register(arg_10.socket, zmq.POLLIN)

    while True:
        try:
            # double nested try/except, to properly catch KeyboardInterrupt
            # due to pyzmq Issue #130
            try:
                # don't let interrupts during mainloop invoke crash_handler:
                arg_6.excepthook = handle_int
                show.mainloop()
                arg_6.excepthook = arg_2
                # use poller if mainloop returned (no windows)
                # scale by extra factor of 10, since it's a real poll
                arg_9.poll(10*arg_1)
                arg_0.do_one_iteration()
            except:
                raise
        except KeyboardInterrupt:
            # Ctrl-C shouldn't crash the kernel
            io.raw_print("KeyboardInterrupt caught in kernel")
        finally:
            # ensure excepthook is restored
            arg_6.excepthook = arg_2

Start the kernel coordinating with the Cocoa CFRunLoop event loop via the matplotlib MacOSX backend .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    A callback used to walk the Python AST looking for classes, functions,
    methods and attributes. Generates chunks of markdown markup to replace
    the existing content.

    :param node:
        An _ast module node object

    :param code_lines:
        A list of unicode strings - the source lines of the Python file

    :param sections:
        A dict of markdown document sections that need to be updated. The key
        will be a two-element tuple of the section type ("class", "function",
        "method" or "attribute") and identifier. The values are a two-element
        tuple of the start and end line number in the markdown document of the
        section.

    :param md_chunks:
        A dict with keys from the sections param and the values being a unicode
        string containing a chunk of markdown markup.
    """

    if isinstance(arg_0, _ast.FunctionDef):
        arg_4 = ('function', arg_0.name)
        if arg_4 not in arg_2:
            return

        arg_5 = ast.get_docstring(arg_0)
        arg_6 = arg_0.lineno + len(arg_0.decorator_list)

        arg_7, arg_8 = _get_func_info(arg_5, arg_6, arg_1, '> ')

        arg_9 = textwrap.dedent("""
            ### `%s()` function

            > ```python
            > %s
            > ```
            >
            %s
        """).strip() % (
            arg_0.name,
            arg_7,
            arg_8
        ) + "\n"

        arg_3[arg_4] = arg_9.replace('>\n\n', '')

    elif isinstance(arg_0, _ast.ClassDef):
        if ('class', arg_0.name) not in arg_2:
            return

        for arg_10 in arg_0.body:
            if isinstance(arg_10, _ast.FunctionDef):
                arg_11 = arg_0.name + '.' + arg_10.name

                arg_12 = ('method', arg_11)
                arg_13 = arg_12 in arg_2

                arg_14 = ('attribute', arg_11)
                arg_15 = arg_14 in arg_2

                arg_16 = arg_10.name == '__init__'

                if not arg_16 and not arg_15 and not arg_13:
                    continue

                arg_5 = ast.get_docstring(arg_10)
                arg_6 = arg_10.lineno + len(arg_10.decorator_list)

                if not arg_5:
                    continue

                if arg_13 or arg_16:
                    arg_7, arg_8 = _get_func_info(arg_5, arg_6, arg_1, '> > ')

                    if arg_16:
                        arg_4 = ('class', arg_0.name)

                        arg_17 = ast.get_docstring(arg_0) or ''
                        arg_18 = textwrap.dedent(arg_17).strip()
                        if arg_18:
                            arg_19 = "> %s\n>" % (arg_18.replace("\n", "\n> "))
                        else:
                            arg_19 = ''

                        arg_9 = textwrap.dedent("""
                            ### `%s()` class

                            %s
                            > ##### constructor
                            >
                            > > ```python
                            > > %s
                            > > ```
                            > >
                            %s
                        """).strip() % (
                            arg_0.name,
                            arg_19,
                            arg_7,
                            arg_8
                        )

                        arg_9 = arg_9.replace('\n\n\n', '\n\n')

                    else:
                        arg_4 = arg_12

                        arg_9 = textwrap.dedent("""
                            >
                            > ##### `.%s()` method
                            >
                            > > ```python
                            > > %s
                            > > ```
                            > >
                            %s
                        """).strip() % (
                            arg_10.name,
                            arg_7,
                            arg_8
                        )

                    if arg_9[-5:] == '\n> >\n':
                        arg_9 = arg_9[0:-5]

                else:
                    arg_4 = arg_14

                    arg_20 = textwrap.dedent(arg_5).strip()
                    arg_8 = "> > %s" % (arg_20.replace("\n", "\n> > "))

                    arg_9 = textwrap.dedent("""
                        >
                        > ##### `.%s` attribute
                        >
                        %s
                    """).strip() % (
                        arg_10.name,
                        arg_8
                    )

                arg_3[arg_4] = re.sub('[ \\t]+\n', '\n', arg_9.rstrip())

    elif isinstance(arg_0, _ast.If):
        for arg_21 in arg_0.body:
            Func(arg_21, arg_1, arg_2, arg_3)
        for arg_21 in arg_0.orelse:
            Func(arg_21, arg_1, arg_2, arg_3)

A callback used to walk the Python AST looking for classes functions methods and attributes . Generates chunks of markdown markup to replace the existing content .


return any(map(lambda iType: isinstance(instance,iType), typeList))

def Func ( arg_0 , arg_1 ) : return any ( map ( lambda iType : isinstance ( arg_0 , iType ) , arg_1 ) )

def Func(arg_0, arg_1):
    """
        Return true if ``instance`` is an instance of any the Directive
        types in ``typeList``
    """
    return any(map(lambda iType: isinstance(arg_0,iType), arg_1))

Return true if instance is an instance of any the Directive types in typeList


def Func ( arg_0 ) : while arg_0 . _base . is_Funcning : if arg_0 . _worker : arg_0 . _worker ( ) time . sleep ( arg_0 . _sleep_duration )

def Func(arg_0):
        """
        Runs its worker method.

        This method will be terminated once its parent's is_Funcning
        property turns False.
        """
        while arg_0._base.is_Funcning:
            if arg_0._worker:
                arg_0._worker()
                time.sleep(arg_0._sleep_duration)

Runs its worker method.

        This method will be terminated once its parent's is_running
        property turns False.


def Func(arg_0, arg_1=None):
    """Coefficient for the reactions in a linear objective.

    Parameters
    ----------
    model : cobra model
        the model object that defined the objective
    reactions : list
        an optional list for the reactions to get the coefficients for. All
        reactions if left missing.

    Returns
    -------
    dict
        A dictionary where the key is the reaction object and the value is
        the corresponding coefficient. Empty dictionary if there are no
        linear terms in the objective.
    """
    arg_2 = {}
    arg_1 = arg_0.reactions if not arg_1 else arg_1
    try:
        arg_3 = arg_0.solver.objective.expression
        arg_4 = arg_3.as_coefficients_dict()
    except AttributeError:
        return arg_2
    for arg_5 in arg_1:
        arg_6 = arg_4.get(arg_5.forward_variable, 0)
        arg_7 = arg_4.get(arg_5.reverse_variable, 0)
        if arg_6 != 0:
            if arg_6 == -arg_7:
                arg_2[arg_5] = float(arg_6)
    return arg_2

Coefficient for the reactions in a linear objective .


def Func ( arg_0 , arg_1 ) : arg_2 = { } arg_0 = arg_0 . rstrip ( ) . split ( '\t' ) arg_3 = dict ( zip ( arg_1 , arg_0 ) ) if 'Withdrawn' in arg_3 [ 'status' ] : return arg_2 arg_4 = arg_3 [ 'symbol' ] arg_2 [ 'hgnc_symbol' ] = arg_4 arg_2 [ 'hgnc_id' ] = int ( arg_3 [ 'hgnc_id' ] . split ( ':' ) [ - 1 ] ) arg_2 [ 'description' ] = arg_3 [ 'name' ] arg_5 = set ( [ arg_4 , arg_4 . upper ( ) ] ) arg_6 = arg_3 [ 'prev_symbol' ] if arg_6 : for arg_7 in arg_6 . strip ( '"' ) . split ( '|' ) : arg_5 . add ( arg_7 ) arg_8 = arg_3 [ 'alias_symbol' ] if arg_8 : for arg_7 in arg_8 . strip ( '"' ) . split ( '|' ) : arg_5 . add ( arg_7 ) arg_2 [ 'previous_symbols' ] = list ( arg_5 ) arg_2 [ 'ensembl_gene_id' ] = arg_3 . get ( 'ensembl_gene_id' ) arg_9 = arg_3 . get ( 'omim_id' ) if arg_9 : arg_2 [ 'omim_id' ] = int ( arg_9 . strip ( '"' ) . split ( '|' ) [ 0 ] ) else : arg_2 [ 'omim_id' ] = None arg_10 = arg_2 [ 'entrez_id' ] = arg_3 . get ( 'entrez_id' ) if arg_10 : arg_2 [ 'entrez_id' ] = int ( arg_10 ) else : arg_2 [ 'entrez_id' ] = None arg_11 = arg_3 . get ( 'refseq_accession' ) if arg_11 : arg_2 [ 'ref_seq' ] = arg_11 . strip ( '"' ) . split ( '|' ) else : arg_2 [ 'ref_seq' ] = [ ] arg_12 = arg_3 . get ( 'uniprot_ids' ) if arg_12 : arg_2 [ 'uniprot_ids' ] = arg_12 . strip ( '""' ) . split ( '|' ) else : arg_2 [ 'uniprot_ids' ] = [ ] arg_13 = arg_3 . get ( 'ucsc_id' ) if arg_13 : arg_2 [ 'ucsc_id' ] = arg_13 else : arg_2 [ 'ucsc_id' ] = None arg_14 = arg_3 . get ( 'vega_id' ) if arg_14 : arg_2 [ 'vega_id' ] = arg_14 else : arg_2 [ 'vega_id' ] = None return arg_2

def Func(arg_0, arg_1):
    """Parse an hgnc formated line

        Args:
            line(list): A list with hgnc gene info
            header(list): A list with the header info

        Returns:
            hgnc_info(dict): A dictionary with the relevant info
    """
    arg_2 = {}
    arg_0 = arg_0.rstrip().split('\t')
    arg_3 = dict(zip(arg_1, arg_0))
    # Skip all genes that have status withdrawn
    if 'Withdrawn' in arg_3['status']:
        return arg_2

    arg_4 = arg_3['symbol']
    arg_2['hgnc_symbol'] = arg_4
    arg_2['hgnc_id'] = int(arg_3['hgnc_id'].split(':')[-1])
    arg_2['description'] = arg_3['name']

    # We want to have the current symbol as an alias
    arg_5 = set([arg_4, arg_4.upper()])
    # We then need to add both the previous symbols and
    # alias symbols
    arg_6 = arg_3['prev_symbol']
    if arg_6:
        for arg_7 in arg_6.strip('"').split('|'):
            arg_5.add(arg_7)

    arg_8 = arg_3['alias_symbol']
    if arg_8:
        for arg_7 in arg_8.strip('"').split('|'):
            arg_5.add(arg_7)

    arg_2['previous_symbols'] = list(arg_5)

    # We need the ensembl_gene_id to link the genes with ensembl
    arg_2['ensembl_gene_id'] = arg_3.get('ensembl_gene_id')

    arg_9 = arg_3.get('omim_id')
    if arg_9:
        arg_2['omim_id'] = int(arg_9.strip('"').split('|')[0])
    else:
        arg_2['omim_id'] = None

    arg_10 = arg_2['entrez_id'] = arg_3.get('entrez_id')
    if arg_10:
        arg_2['entrez_id'] = int(arg_10)
    else:
        arg_2['entrez_id'] = None

    # These are the primary transcripts according to HGNC
    arg_11 = arg_3.get('refseq_accession')
    if arg_11:
        arg_2['ref_seq'] = arg_11.strip('"').split('|')
    else:
        arg_2['ref_seq'] = []

    arg_12 = arg_3.get('uniprot_ids')
    if arg_12:
        arg_2['uniprot_ids'] = arg_12.strip('""').split('|')
    else:
        arg_2['uniprot_ids'] = []

    arg_13 = arg_3.get('ucsc_id')
    if arg_13:
        arg_2['ucsc_id'] = arg_13
    else:
        arg_2['ucsc_id'] = None

    arg_14 = arg_3.get('vega_id')
    if arg_14:
        arg_2['vega_id'] = arg_14
    else:
        arg_2['vega_id'] = None

    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . uuids ( ) while True : arg_3 = list ( islice ( arg_2 , 0 , arg_0 . chunk_size ) ) if not arg_3 : return rest_request ( arg_1 , arg_0 . storage_url , arg_3 )

def Func(arg_0, arg_1):
        """ Base method for storage operations.
        """
        arg_2 = arg_0.uuids()

        while True:
            arg_3 = list(islice(arg_2, 0, arg_0.chunk_size))

            if not arg_3:
                return

            rest_request(arg_1, arg_0.storage_url, arg_3)


(model: Action, session: Optional[Session] = None)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_4 ] = None ) -> None : if arg_2 is None : arg_2 = _make_session ( ) arg_2 . add ( arg_0 ) arg_2 . commit ( ) arg_2 . close ( )

def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> None:
    """Help store an action."""
    if arg_2 is None:
        arg_2 = _make_session()

    arg_2.add(arg_0)
    arg_2.commit()
    arg_2.close()


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
try
:
arg_4
=
Command
(
arg_3
,
arg_0
.
_messageCodecs
)
except
InvalidEventException
as
e
:
arg_0
.
logger
.
critical
(
str
(
e
)
)
else
:
arg_0
.
logger
.
debug
(
"Received device command '%s'"
%
(
arg_4
.
command
)
)
if
arg_0
.
commandCallback
:
arg_0
.
commandCallback
(
arg_4
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Internal callback for device command messages, parses source device from topic string and
        passes the information on to the registered device command callback
        """
        try:
            arg_4 = Command(arg_3, arg_0._messageCodecs)
        except InvalidEventException as e:
            arg_0.logger.critical(str(e))
        else:
            arg_0.logger.debug("Received device command '%s'" % (arg_4.command))
            if arg_0.commandCallback:
                arg_0.commandCallback(arg_4)

Internal callback for device command messages parses source device from topic string and passes the information on to the registered device command callback