def Func ( arg_0 , ** arg_1 ) : for arg_2 in arg_1 . keys ( ) : setattr ( arg_0 , arg_2 , arg_1 [ arg_2 ] ) arg_3 = { "name" : arg_0 . name } arg_4 = arg_0 . get_data ( "tags" , type = "POST" , arg_3 = arg_3 ) if arg_4 : arg_0 . name = arg_4 [ 'tag' ] [ 'name' ] arg_0 . resources = arg_4 [ 'tag' ] [ 'resources' ]

def Func(arg_0, **arg_1):
        """
            Create the tag.
        """
        for arg_2 in arg_1.keys():
            setattr(arg_0, arg_2, arg_1[arg_2])

        arg_3 = {"name": arg_0.name}

        arg_4 = arg_0.get_data("tags", type="POST", arg_3=arg_3)
        if arg_4:
            arg_0.name = arg_4['tag']['name']
            arg_0.resources = arg_4['tag']['resources']


(R_data, R_indices, R_ptr, S, aggregate)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    '''Nearest-neighbor filter helper function.

    This is an internal function, not for use outside of the decompose module.

    It applies the nearest-neighbor filter to S, assuming that the first index
    corresponds to observations.

    Parameters
    ----------
    R_data, R_indices, R_ptr : np.ndarrays
        The `data`, `indices`, and `indptr` of a scipy.sparse matrix

    S : np.ndarray
        The observation data to filter

    aggregate : callable
        The aggregation operator

    Returns
    -------
    S_out : np.ndarray like S
        The filtered data array
    '''
    arg_5 = np.empty_like(arg_3)

    for arg_6 in range(len(arg_2)-1):

        # Get the non-zeros out of the recurrence matrix
        arg_7 = arg_1[arg_2[arg_6]:arg_2[arg_6+1]]

        if not len(arg_7):
            arg_5[arg_6] = arg_3[arg_6]
            continue

        arg_8 = np.take(arg_3, arg_7, axis=0)

        if arg_4 is np.average:
            arg_9 = arg_0[arg_2[arg_6]:arg_2[arg_6+1]]
            arg_5[arg_6] = arg_4(arg_8, axis=0, arg_9=arg_9)
        else:
            arg_5[arg_6] = arg_4(arg_8, axis=0)

    return arg_5

Nearest - neighbor filter helper function .


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
urlparse
.
urlparse
(
arg_1
)
arg_2
=
dict
(
it
.
chain
.
from_iterable
(
urlparse
.
parse_qsl
(
v
)
for
v
in
[
arg_1
.
query
,
arg_1
.
fragment
]
)
)
if
arg_2
.
get
(
'error'
)
:
raise
APIAuthError
(
'{} :: {}'
.
format
(
arg_2
[
'error'
]
,
arg_2
.
get
(
'error_description'
)
)
)
arg_0
.
auth_code
=
arg_2
[
'code'
]
return
arg_0
.
auth_code

def Func(arg_0, arg_1):
		'Process tokens and errors from redirect_uri.'
		arg_1 = urlparse.urlparse(arg_1)
		arg_2 = dict(it.chain.from_iterable(
			urlparse.parse_qsl(v) for v in [arg_1.query, arg_1.fragment] ))
		if arg_2.get('error'):
			raise APIAuthError(
				'{} :: {}'.format(arg_2['error'], arg_2.get('error_description')) )
		arg_0.auth_code = arg_2['code']
		return arg_0.auth_code

Process tokens and errors from redirect_uri .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
profile
=
arg_0
.
profile_module
arg_0
.
_run_object
,
arg_4
,
arg_0
.
_run_args
=
arg_1
.
partition
(
' '
)
arg_0
.
_object_name
=
'%s (module)'
%
arg_0
.
_run_object
arg_0
.
_globs
=
{
'__file__'
:
arg_0
.
_run_object
,
'__name__'
:
'__main__'
,
'__package__'
:
,
}
arg_8
=
os
.
path
.
dirname
(
arg_0
.
_run_object
)
if
sys
.
path
[
0
]
!=
arg_8
:
sys
.
path
.
insert
(
0
,
arg_8
)
arg_0
.
_replace_sysargs
(
)

def Func(arg_0, arg_1):
        """Initializes profiler with a module."""
        arg_0.profile = arg_0.profile_module
        arg_0._run_object, arg_4, arg_0._run_args = arg_1.partition(' ')
        arg_0._object_name = '%s (module)' % arg_0._run_object
        arg_0._globs = {
            '__file__': arg_0._run_object,
            '__name__': '__main__',
            '__package__': None,
        }
        arg_8 = os.path.dirname(arg_0._run_object)
        if sys.path[0] != arg_8:
            sys.path.insert(0, arg_8)
        arg_0._replace_sysargs()


return (self.selection_history_indices[name] + 1) < len(self.selection_histories[name])

def Func ( arg_0 , arg_1 = "default" ) : return ( arg_0 . selection_history_indices [ arg_1 ] + 1 ) < len ( arg_0 . selection_histories [ arg_1 ] )

def Func(arg_0, arg_1="default"):
        """Can selection name be redone?"""
        return (arg_0.selection_history_indices[arg_1] + 1) < len(arg_0.selection_histories[arg_1])


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
arg_2
is
:
arg_2
=
(
)
if
isinstance
(
arg_0
,
dict
)
and
isinstance
(
arg_1
,
dict
)
:
for
arg_3
,
arg_4
in
arg_1
.
items
(
)
:
if
isinstance
(
arg_4
,
MissingValue
)
and
arg_4
.
name
is
:
arg_4
.
name
=
'.'
.
join
(
arg_2
+
(
arg_3
,
)
)
if
isinstance
(
arg_4
,
DeletedValue
)
:
arg_0
.
pop
(
arg_3
,
)
elif
arg_3
not
in
arg_0
:
if
isinstance
(
arg_4
,
dict
)
:
arg_0
[
arg_3
]
=
Func
(
{
}
,
arg_4
,
arg_2
+
(
arg_3
,
)
)
else
:
arg_0
[
arg_3
]
=
arg_4
else
:
if
isinstance
(
arg_0
[
arg_3
]
,
dict
)
and
isinstance
(
arg_4
,
dict
)
:
arg_0
[
arg_3
]
=
Func
(
arg_0
[
arg_3
]
,
arg_4
,
arg_2
+
(
arg_3
,
)
)
elif
isinstance
(
arg_0
[
arg_3
]
,
list
)
and
isinstance
(
arg_4
,
list
)
:
arg_0
[
arg_3
]
+=
arg_4
elif
isinstance
(
arg_0
[
arg_3
]
,
MissingValue
)
:
arg_0
[
arg_3
]
=
arg_4
elif
arg_0
[
arg_3
]
is
:
arg_0
[
arg_3
]
=
arg_4
elif
type
(
arg_0
[
arg_3
]
)
==
type
(
arg_4
)
:
arg_0
[
arg_3
]
=
arg_4
else
:
raise
TypeError
(
'Refusing to replace a %s with a %s'
%
(
type
(
arg_0
[
arg_3
]
)
,
type
(
arg_4
)
)
)
else
:
raise
TypeError
(
'Cannot merge a %s with a %s'
%
(
type
(
arg_0
)
,
type
(
arg_1
)
)
)
return
arg_0

def Func(arg_0, arg_1, arg_2=None):
    """
    Merge dictionary d2 into d1, overriding entries in d1 with values from d2.

    d1 is mutated.

    _path is for internal, recursive use.
    """
    if arg_2 is None:
        arg_2 = ()
    if isinstance(arg_0, dict) and isinstance(arg_1, dict):
        for arg_3, arg_4 in arg_1.items():
            if isinstance(arg_4, MissingValue) and arg_4.name is None:
                arg_4.name = '.'.join(arg_2 + (arg_3,))

            if isinstance(arg_4, DeletedValue):
                arg_0.pop(arg_3, None)
            elif arg_3 not in arg_0:
                if isinstance(arg_4, dict):
                    arg_0[arg_3] = Func({}, arg_4, arg_2 + (arg_3,))
                else:
                    arg_0[arg_3] = arg_4
            else:
                if isinstance(arg_0[arg_3], dict) and isinstance(arg_4, dict):
                    arg_0[arg_3] = Func(arg_0[arg_3], arg_4, arg_2 + (arg_3,))
                elif isinstance(arg_0[arg_3], list) and isinstance(arg_4, list):
                    # Lists are only supported as leaves
                    arg_0[arg_3] += arg_4
                elif isinstance(arg_0[arg_3], MissingValue):
                    arg_0[arg_3] = arg_4
                elif arg_0[arg_3] is None:
                    arg_0[arg_3] = arg_4
                elif type(arg_0[arg_3]) == type(arg_4):
                    arg_0[arg_3] = arg_4
                else:
                    raise TypeError('Refusing to replace a %s with a %s'
                                    % (type(arg_0[arg_3]), type(arg_4)))
    else:
        raise TypeError('Cannot merge a %s with a %s' % (type(arg_0), type(arg_1)))

    return arg_0

Merge dictionary d2 into d1 overriding entries in d1 with values from d2 .


def Func(arg_0, arg_1):
    """Try passwordless login with paramiko."""
    if paramiko is None:
        arg_2 = "Paramiko unavaliable, "
        if sys.platform == 'win32':
            arg_2 += "Paramiko is required for ssh tunneled connections on Windows."
        else:
            arg_2 += "use OpenSSH."
        raise ImportError(arg_2)
    arg_3, arg_0, arg_4 = _split_server(arg_0)
    arg_5 = paramiko.SSHClient()
    arg_5.load_system_host_keys()
    arg_5.set_missing_host_key_policy(paramiko.WarningPolicy())
    try:
        arg_5.connect(arg_0, arg_4, arg_3=arg_3, key_filename=arg_1,
               look_for_keys=True)
    except paramiko.AuthenticationException:
        return False
    else:
        arg_5.close()
        return True


async
def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
:
arg_1
=
[
cls
(
arg_0
)
for
cls
in
arg_0
.
MESSAGE_FILTERS
]
arg_2
=
await
arg_0
.
_get_socket_url
(
)
logger
.
debug
(
'Connecting to %r'
,
arg_2
)
async
with
ws_connect
(
arg_2
)
as
arg_4
:
arg_3
=
await
arg_4
.
receive
(
)
arg_0
.
_validate_first_message
(
arg_3
)
arg_0
.
socket
=
arg_4
async
for
arg_5
in
arg_4
:
if
arg_5
.
tp
==
MsgType
.
text
:
await
arg_0
.
handle_message
(
arg_5
,
arg_1
)
elif
arg_5
.
tp
in
(
MsgType
.
closed
,
MsgType
.
error
)
:
if
not
arg_4
.
closed
:
await
arg_4
.
close
(
)
arg_0
.
socket
=
break
logger
.
info
(
'Left real-time messaging.'
)

async def Func(arg_0, arg_1=None):
        """Join the real-time messaging service.

        Arguments:
          filters (:py:class:`dict`, optional): Dictionary mapping
            message filters to the functions they should dispatch to.
            Use a :py:class:`collections.OrderedDict` if precedence is
            important; only one filter, the first match, will be
            applied to each message.

        """
        if arg_1 is None:
            arg_1 = [cls(arg_0) for cls in arg_0.MESSAGE_FILTERS]
        arg_2 = await arg_0._get_socket_url()
        logger.debug('Connecting to %r', arg_2)
        async with ws_connect(arg_2) as arg_4:
            arg_3 = await arg_4.receive()
            arg_0._validate_first_message(arg_3)
            arg_0.socket = arg_4
            async for arg_5 in arg_4:
                if arg_5.tp == MsgType.text:
                    await arg_0.handle_message(arg_5, arg_1)
                elif arg_5.tp in (MsgType.closed, MsgType.error):
                    if not arg_4.closed:
                        await arg_4.close()
                    arg_0.socket = None
                    break
        logger.info('Left real-time messaging.')

Join the real - time messaging service .


def Func(arg_0, arg_1, arg_2):
    """Add the checkpoint state message to be sent back the stmgr

    :param ckpt_id: The id of the checkpoint
    :ckpt_state: The checkpoint state
    """
    # first flush any buffered tuples
    arg_0._flush_remaining()
    arg_3 = ckptmgr_pb2.StoreInstanceStateCheckpoint()
    arg_4 = ckptmgr_pb2.InstanceStateCheckpoint()
    arg_4.checkpoint_id = arg_1
    arg_4.state = arg_2
    arg_3.state.CopyFrom(arg_4)
    arg_0._push_tuple_to_stream(arg_3)


def Func ( arg_0 ) : if arg_1 . CONFIGURATION [ "mining" ] : if "mined" not in arg_1 . INTERN : arg_1 . INTERN [ "mined" ] = { } if arg_1 . path . isfile ( arg_0 . file ) : arg_3 = Dict ( ) . from_json ( File ( arg_0 . file ) . read ( ) ) for arg_4 in arg_3 : arg_1 . INTERN [ "mined" ] [ arg_4 ] = { } for arg_5 in arg_3 [ arg_4 ] : if arg_3 [ arg_4 ] [ arg_5 ] : arg_1 . INTERN [ "mined" ] [ arg_4 ] [ arg_5 ] = arg_3 [ arg_4 ] [ arg_5 ] return arg_1 . INTERN [ "mined" ] = { } return

def Func(arg_0):
        """
        Retrieve the mining informations.
        """

        if arg_1.CONFIGURATION["mining"]:
            # The mining is activated.

            if "mined" not in arg_1.INTERN:
                arg_1.INTERN["mined"] = {}

            if arg_1.path.isfile(arg_0.file):
                # Our backup file exist.

                # We return the information from our backup.
                arg_3 = Dict().from_json(File(arg_0.file).read())

                # We clean the empty elements.
                for arg_4 in arg_3:
                    arg_1.INTERN["mined"][arg_4] = {}

                    for arg_5 in arg_3[arg_4]:
                        if arg_3[arg_4][arg_5]:
                            arg_1.INTERN["mined"][arg_4][arg_5] = arg_3[
                                arg_4
                            ][arg_5]

                return
        # * The mining is not activated.
        # or
        # * Our backup file does not exist.

        # We return nothing.
        arg_1.INTERN["mined"] = {}

        return


def Func(arg_0, arg_1):
        """Add or upgrade User from ConversationParticipantData."""
        arg_2 = User.from_conv_part_data(arg_1, arg_0._self_user.id_)

        arg_3 = arg_0._user_dict.get(arg_2.id_)
        if arg_3 is None:
            logger.warning('Adding fallback User with %s name "%s"',
                           arg_2.name_type.name.lower(), arg_2.full_name)
            arg_0._user_dict[arg_2.id_] = arg_2
            return arg_2
        else:
            arg_3.upgrade_name(arg_2)
            return arg_3

Add or upgrade User from ConversationParticipantData .


def Func ( arg_0 ) : arg_0 . stats_dfs . s2 = arg_0 . _build_stat ( "s2" ) arg_0 . stats_files . s2 = os . path . join ( arg_0 . dirs . edits , 's2_rawedit_stats.txt' ) with io . open ( arg_0 . stats_files . s2 , 'w' , encoding = 'utf-8' ) as outfile : arg_0 . stats_dfs . s2 . fillna ( value = 0 ) . astype ( np . int ) . to_string ( outfile )

def Func(arg_0):
    """ cleanup for assembly object """

    ## build s2 results data frame
    arg_0.stats_dfs.s2 = arg_0._build_stat("s2")
    arg_0.stats_files.s2 = os.path.join(arg_0.dirs.edits, 's2_rawedit_stats.txt')

    ## write stats for all samples
    with io.open(arg_0.stats_files.s2, 'w', encoding='utf-8') as outfile:
        arg_0.stats_dfs.s2.fillna(value=0).astype(np.int).to_string(outfile)


def Func ( arg_0 ) : if not np . isfinite ( arg_0 ) : return False return abs ( arg_0 - nearest_int ( arg_0 ) ) < 1e-10

def Func(arg_0):
    """
    Check if value is close to an integer

    Parameters
    ----------
    x : float
        Numeric value to check

    Returns
    -------
    out : bool
    """
    if not np.isfinite(arg_0):
        return False
    return abs(arg_0 - nearest_int(arg_0)) < 1e-10


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
==
'function'
:
arg_2
=
tf
.
keras
.
utils
.
deserialize_keras_object
(
arg_0
)
elif
arg_1
==
'lambda'
:
arg_2
=
generic_utils
.
func_load
(
arg_0
)
else
:
raise
TypeError
(
'Unknown function type:'
,
arg_1
)
return
arg_2

def Func(arg_0, arg_1):
  """Deserializes the Keras-serialized function.

  (De)serializing Python functions from/to bytecode is unsafe. Therefore we
  also use the function's type as an anonymous function ('lambda') or named
  function in the Python environment ('function'). In the latter case, this lets
  us use the Python scope to obtain the function rather than reload it from
  bytecode. (Note that both cases are brittle!)

  Keras-deserialized functions do not perform lexical scoping. Any modules that
  the function requires must be imported within the function itself.

  This serialization mimicks the implementation in `tf.keras.layers.Lambda`.

  Args:
    serial: Serialized Keras object: typically a dict, string, or bytecode.
    function_type: Python string denoting 'function' or 'lambda'.

  Returns:
    function: Function the serialized Keras object represents.

  #### Examples

  ```python
  serial, function_type = serialize_function(lambda x: x)
  function = Func(serial, function_type)
  assert function(2.3) == 2.3  # function is identity
  ```

  """
  if arg_1 == 'function':
    # Simple lookup in custom objects
    arg_2 = tf.keras.utils.deserialize_keras_object(arg_0)
  elif arg_1 == 'lambda':
    # Unsafe deserialization from bytecode
    arg_2 = generic_utils.func_load(arg_0)
  else:
    raise TypeError('Unknown function type:', arg_1)
  return arg_2

Deserializes the Keras-serialized function.

  (De)serializing Python functions from/to bytecode is unsafe. Therefore we
  also use the function's type as an anonymous function ('lambda') or named
  function in the Python environment ('function'). In the latter case, this lets
  us use the Python scope to obtain the function rather than reload it from
  bytecode. (Note that both cases are brittle!)

  Keras-deserialized functions do not perform lexical scoping. Any modules that
  the function requires must be imported within the function itself.

  This serialization mimicks the implementation in `tf.keras.layers.Lambda`.

  Args:
    serial: Serialized Keras object: typically a dict, string, or bytecode.
    function_type: Python string denoting 'function' or 'lambda'.

  Returns:
    function: Function the serialized Keras object represents.

  #### Examples

  ```python
  serial, function_type = serialize_function(lambda x: x)
  function = deserialize_function(serial, function_type)
  assert function(2.3) == 2.3  # function is identity
  ```

Deserializes the Keras - serialized function .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : try : arg_0 . vcdWriter . Func ( arg_1 , arg_2 , arg_3 ) except KeyError : pass

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        This method is called for every value change of any signal.
        """
        try:
            arg_0.vcdWriter.Func(arg_1, arg_2, arg_3)
        except KeyError:
            # not every signal has to be registered
            pass

This method is called for every value change of any signal .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
'configuration.json'
)
:
arg_3
=
os
.
path
.
join
(
arg_1
,
arg_2
)
with
open
(
arg_3
,
'w'
)
as
f
:
json
.
dump
(
arg_0
,
f
,
indent
=
4
,
cls
=
DetectMissingEncoder
,
separators
=
(
','
,
': '
)
)

def Func(arg_0, arg_1, arg_2='configuration.json'):
    """Write configuration to the applicaiton directory."""
    arg_3 = os.path.join(arg_1, arg_2)
    with open(arg_3, 'w') as f:
        json.dump(
            arg_0, f, indent=4, cls=DetectMissingEncoder,
            separators=(',', ': '))

Write configuration to the applicaiton directory .


def Func ( arg_0 , arg_1 ) : arg_2 = { '$and' : [ { 'case_id' : arg_1 } , { '$or' : [ { 'acmg_classification' : { '$exists' : True } } , { 'manual_rank' : { '$exists' : True } } , { 'dismiss_variant' : { '$exists' : True } } , ] } ] , } arg_3 = { } for arg_4 in arg_0 . variant_collection . find ( arg_2 ) : arg_3 [ arg_4 [ 'variant_id' ] ] = arg_0 . add_gene_info ( arg_4 ) arg_5 = { '$and' : [ { 'case' : arg_1 } , { 'category' : 'variant' } , { 'verb' : 'comment' } , ] } arg_6 = { event [ 'variant_id' ] for event in arg_0 . event_collection . find ( arg_5 ) } for arg_7 in arg_6 : if arg_7 in arg_3 : continue arg_8 = arg_0 . variant ( arg_7 , arg_1 = arg_1 ) if not arg_8 : continue arg_8 [ 'is_commented' ] = True arg_3 [ arg_7 ] = arg_8 return arg_3 . values ( )

def Func(arg_0, arg_1):
        """Returns variants that has been evaluated

        Return all variants, snvs/indels and svs from case case_id
        which have a entry for 'acmg_classification', 'manual_rank', 'dismiss_variant'
        or if they are commented.

        Args:
            case_id(str)

        Returns:
            variants(iterable(Variant))
        """
        # Get all variants that have been evaluated in some way for a case
        arg_2 = {
            '$and': [
                {'case_id': arg_1},
                {
                    '$or': [
                        {'acmg_classification': {'$exists': True}},
                        {'manual_rank': {'$exists': True}},
                        {'dismiss_variant': {'$exists': True}},
                    ]
                }
            ],
        }

        # Collect the result in a dictionary
        arg_3 = {}
        for arg_4 in arg_0.variant_collection.find(arg_2):
            arg_3[arg_4['variant_id']] = arg_0.add_gene_info(arg_4)

        # Collect all variant comments from the case
        arg_5 = {
            '$and': [
                {'case': arg_1},
                {'category': 'variant'},
                {'verb': 'comment'},
            ]
        }

        # Get all variantids for commented variants
        arg_6 = {event['variant_id'] for event in arg_0.event_collection.find(arg_5)}

        # Get the variant objects for commented variants, if they exist
        for arg_7 in arg_6:
            # Skip if we already added the variant
            if arg_7 in arg_3:
                continue
            # Get the variant with variant_id (not _id!)
            arg_8 = arg_0.variant(arg_7, arg_1=arg_1)

            # There could be cases with comments that refers to non existing variants
            # if a case has been reanalysed
            if not arg_8:
                continue

            arg_8['is_commented'] = True
            arg_3[arg_7] = arg_8

        # Return a list with the variant objects
        return arg_3.values()


def Func(arg_0, arg_1, arg_2, arg_3=False):
        """Sets the output to the given value.

        Sets `pin` output to given value. If the pin is in INPUT mode, do
        nothing. If it's an analog pin, value should be in Func_range.
        If it's not in the allowed range, it will be clamped. If pin is in
        digital mode, value can be `ahio.LogicValue` if `pwm` = False, or a
        number between 0 and 1 if `pwm` = True. If PWM is False, the pin will
        be set to HIGH or LOW, if `pwm` is True, a PWM wave with the given
        cycle will be created. If the pin does not support PWM and `pwm` is
        True, raise RuntimeError. The `pwm` argument should be ignored in case
        the pin is analog. If value is not valid for the given
        pwm/analog|digital combination, raise TypeError.

        If you're developing a driver, implement _Func(self, pin, value, pwm)

        @arg pin the pin to Func to
        @arg value the value to Func on the pin
        @arg pwm wether the output should be a pwm wave

        @throw RuntimeError if the pin does not support PWM and `pwm` is True.
        @throw TypeError if value is not valid for this pin's mode and pwm
               value.
        @throw KeyError if pin isn't mapped.
        """
        if type(arg_1) is list:
            for arg_4 in arg_1:
                arg_0.Func(arg_4, arg_2, arg_3)
            return

        if arg_3 and type(arg_2) is not int and type(arg_2) is not float:
            raise TypeError('pwm is set, but value is not a float or int')

        arg_5 = arg_0._pin_mapping.get(arg_1, None)
        if arg_5:
            arg_6 = arg_0._pin_lin.get(arg_1, None)
            if arg_6 and type(arg_6['Func']) is tuple:
                arg_7 = arg_6['Func']
                arg_2 = arg_0._linear_interpolation(arg_2, *arg_7)
            arg_0._Func(arg_5, arg_2, arg_3)
        else:
            raise KeyError('Requested pin is not mapped: %s' % arg_1)

Sets the output to the given value.

        Sets `pin` output to given value. If the pin is in INPUT mode, do
        nothing. If it's an analog pin, value should be in write_range.
        If it's not in the allowed range, it will be clamped. If pin is in
        digital mode, value can be `ahio.LogicValue` if `pwm` = False, or a
        number between 0 and 1 if `pwm` = True. If PWM is False, the pin will
        be set to HIGH or LOW, if `pwm` is True, a PWM wave with the given
        cycle will be created. If the pin does not support PWM and `pwm` is
        True, raise RuntimeError. The `pwm` argument should be ignored in case
        the pin is analog. If value is not valid for the given
        pwm/analog|digital combination, raise TypeError.

        If you're developing a driver, implement _write(self, pin, value, pwm)

        @arg pin the pin to write to
        @arg value the value to write on the pin
        @arg pwm wether the output should be a pwm wave

        @throw RuntimeError if the pin does not support PWM and `pwm` is True.
        @throw TypeError if value is not valid for this pin's mode and pwm
               value.
        @throw KeyError if pin isn't mapped.


(
    name: str,
    symbol: str,
    degree: int,
    ds: DataSet,
    dss: dict)

def Func(
    arg_0: arg_1,
    arg_2: arg_1,
    arg_3: arg_4,
    arg_5: arg_6,
    arg_7: arg_8):
    """
    Create a polynomial model to describe the specified property based on the
    specified data set, and save it to a .json file.

    :param name: material name.
    :param symbol: property symbol.
    :param degree: polynomial degree.
    :param ds: the source data set.
    :param dss: dictionary of all datasets.
    """
    arg_9 = arg_5.name.split(".")[0].lower()
    arg_10 = f"{name.lower()}-{symbol.lower()}-polynomialmodelt-{ds_name}"
    arg_11 = PolynomialModelT.create(arg_5, arg_2, arg_3)
    arg_11.plot(arg_7, _path(f"data/{file_name}.pdf"), False)
    arg_11.write(_path(f"data/{file_name}.json"))

Create a polynomial model to describe the specified property based on the specified data set and save it to a . json file .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . registered_handlers : if arg_2 . check ( arg_1 ) : return arg_2 . view return None

def Func(arg_0, arg_1):
        """
        Use the new message to search for a registered view according
        to its pattern.
        """
        for arg_2 in arg_0.registered_handlers:
            if arg_2.check(arg_1):
                return arg_2.view

        return None

Use the new message to search for a registered view according to its pattern .


def Func ( arg_0 , arg_1 ) : arg_2 = copy . deepcopy ( arg_1 ) arg_3 = arg_0 . context [ 'enterprise_customer_catalog' ] arg_2 [ 'enrollment_url' ] = arg_3 . get_course_run_enrollment_url ( arg_2 [ 'key' ] ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the updated course run data dictionary.

        Arguments:
            instance (dict): The course run data.

        Returns:
            dict: The updated course run data.
        """
        arg_2 = copy.deepcopy(arg_1)
        arg_3 = arg_0.context['enterprise_customer_catalog']
        arg_2['enrollment_url'] = arg_3.get_course_run_enrollment_url(
            arg_2['key']
        )
        return arg_2

Return the updated course run data dictionary .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, **arg_5):
    """Adds an edge while preserving negative keys, and paying no respect to positive ones

    :param pybel.BELGraph graph: A BEL Graph
    :param tuple u: The source BEL node
    :param tuple v: The target BEL node
    :param int key: The edge key. If less than zero, corresponds to an unqualified edge, else is disregarded
    :param dict attr_dict: The edge data dictionary
    :param dict attr: Edge data to assign via keyword arguments
    """
    if arg_3 < 0:
        arg_0.add_edge(arg_1, arg_2, arg_3=arg_3, arg_4=arg_4, **arg_5)
    else:
        arg_0.add_edge(arg_1, arg_2, arg_4=arg_4, **arg_5)

Adds an edge while preserving negative keys and paying no respect to positive ones


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 [ 'instance' ] if not arg_1 [ 'created' ] : add_userrnd_shot ( arg_2 ) return add_default_deps ( arg_2 ) add_default_atypes ( arg_2 ) add_default_sequences ( arg_2 )

def Func(arg_0, **arg_1):
    """ Post save receiver for when a Project is saved.

    Creates a rnd shot for every user.

    On creations does:

       1. create all default departments
       2. create all default assettypes
       3. create all default sequences

    :param sender: the project class
    :type sender: :class:`muke.models.Project`
    :returns:  None
    :raises: None

    """
    arg_2 = arg_1['instance']
    if not arg_1['created']:
        add_userrnd_shot(arg_2)
        return

    add_default_deps(arg_2)
    add_default_atypes(arg_2)
    add_default_sequences(arg_2)

Post save receiver for when a Project is saved .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . Funcs ( names = arg_1 , workspaces = arg_2 ) return arg_0 . _return_first_item ( arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        '''
          returns a single style object.
          Will return None if no style is found.
          Will raise an error if more than one style with the same name is found.
        '''

        arg_3 = arg_0.Funcs(names=arg_1, workspaces=arg_2)
        return arg_0._return_first_item(arg_3)

returns a single style object . Will return None if no style is found . Will raise an error if more than one style with the same name is found .


(background_noise_map_path, background_noise_map_hdu, pixel_scale,
                              convert_background_noise_map_from_weight_map,
                              convert_background_noise_map_from_inverse_noise_map)

def Func(arg_0, arg_1, arg_2,
                              arg_3,
                              arg_4):
    """Factory for loading the background noise-map from a .fits file.

    This factory also includes a number of routines for converting the background noise-map from from other units (e.g. \
    a weight map).

    Parameters
    ----------
    background_noise_map_path : str
        The path to the background_noise_map .fits file containing the background noise-map \
        (e.g. '/path/to/background_noise_map.fits')
    background_noise_map_hdu : int
        The hdu the background_noise_map is contained in the .fits file specified by *background_noise_map_path*.
    pixel_scale : float
        The size of each pixel in arc seconds.
    convert_background_noise_map_from_weight_map : bool
        If True, the bacground noise-map loaded from the .fits file is converted from a weight-map to a noise-map (see \
        *NoiseMap.from_weight_map).
    convert_background_noise_map_from_inverse_noise_map : bool
        If True, the background noise-map loaded from the .fits file is converted from an inverse noise-map to a \
        noise-map (see *NoiseMap.from_inverse_noise_map).
    """
    arg_5 = sum([arg_3,
                                        arg_4])

    if arg_5 == 0 and arg_0 is not None:
        return NoiseMap.from_fits_with_pixel_scale(file_path=arg_0, hdu=arg_1,
                                                   arg_2=arg_2)
    elif arg_3 and arg_0 is not None:
        arg_6 = Array.from_fits(file_path=arg_0, hdu=arg_1)
        return NoiseMap.from_weight_map(arg_6=arg_6, arg_2=arg_2)
    elif arg_4 and arg_0 is not None:
        arg_7 = Array.from_fits(file_path=arg_0, hdu=arg_1)
        return NoiseMap.from_inverse_noise_map(arg_7=arg_7, arg_2=arg_2)
    else:
        return None

Factory for loading the background noise - map from a . fits file .


def Func(arg_0, arg_1, arg_2):
        """Return True, if path maps to an existing collection resource.

        This method should only be used, if no other information is queried
        for <path>. Otherwise a _DAVResource should be created first.
        """
        arg_3 = arg_0.get_resource_inst(arg_1, arg_2)
        return arg_3 and arg_3.Func

Return True if path maps to an existing collection resource .


def Func(arg_0, arg_1=1):
        """Record an event with the meter. By default it will record one event.

        :param value: number of event to record
        """
        arg_0.counter += arg_1
        arg_0.m1_rate.update(arg_1)
        arg_0.m5_rate.update(arg_1)
        arg_0.m15_rate.update(arg_1)

Record an event with the meter . By default it will record one event .


def Func(arg_0, arg_1):
        """
        Pass in raw arguments, instantiate Slack API and begin client.
        """
        arg_1 = arg_0.parser.parse_args(arg_1)
        if not arg_1.token:
            raise ValueError('Supply the slack token through --token or setting DJANGOBOT_TOKEN')

        # Import the channel layer
        sys.path.insert(0, ".")
        arg_2, arg_3 = arg_1.channel_layer.split(':', 1)
        arg_4 = importlib.import_module(arg_2)
        for arg_5 in arg_3.split('.'):
            arg_4 = getattr(arg_4, arg_5)

        # Boot up the client
        Client(
            arg_4=arg_4,
            token=arg_1.token,
        ).Func()

Pass in raw arguments instantiate Slack API and begin client .


return all(
        (
            same_args,
            same_kwonlyargs,
            same_args_variadics,
            same_kw_variadics,
            no_additional_kwarg_arguments,
        )
    )

def Func ( arg_0 , arg_1 ) : if arg_0 . kwargs : arg_2 = arg_0 . kwargs in arg_1 . starred_kws else : arg_2 = not arg_1 . starred_kws if arg_0 . varargs : arg_3 = arg_0 . varargs in arg_1 . starred_args else : arg_3 = not arg_1 . starred_args arg_4 = all ( kw in arg_1 . kws for kw in arg_0 . kwonlyargs ) arg_5 = arg_0 . args == arg_1 . args arg_6 = True if arg_1 . kws : for arg_7 in arg_1 . kws : arg_8 = arg_7 in arg_1 . args arg_9 = arg_7 in arg_0 . kwonlyargs if not arg_8 and not arg_9 : arg_6 = False break return all ( ( arg_5 , arg_4 , arg_3 , arg_2 , arg_6 , ) )

def Func(arg_0, arg_1):
    """Check if a definition signature is equivalent to a call."""
    if arg_0.kwargs:
        arg_2 = arg_0.kwargs in arg_1.starred_kws
    else:
        arg_2 = not arg_1.starred_kws
    if arg_0.varargs:
        arg_3 = arg_0.varargs in arg_1.starred_args
    else:
        arg_3 = not arg_1.starred_args
    arg_4 = all(kw in arg_1.kws for kw in arg_0.kwonlyargs)
    arg_5 = arg_0.args == arg_1.args

    arg_6 = True
    if arg_1.kws:
        for arg_7 in arg_1.kws:
            arg_8 = arg_7 in arg_1.args
            arg_9 = arg_7 in arg_0.kwonlyargs
            if not arg_8 and not arg_9:
                # Maybe this argument goes into **kwargs,
                # or it is an extraneous argument.
                # In any case, the signature is different than
                # the call site, which stops our search.
                arg_6 = False
                break

    return all(
        (
            arg_5,
            arg_4,
            arg_3,
            arg_2,
            arg_6,
        )
    )

Check if a definition signature is equivalent to a call .


def Func ( arg_0 ) : if Check ( ) . is_url_valid ( ) or arg_1 . CONFIGURATION [ "local" ] : if "current_test_data" in arg_1 . INTERN : arg_1 . INTERN [ "current_test_data" ] [ "url_syntax_validation" ] = True arg_1 . INTERN . update ( { "http_code" : HTTPCode ( ) . Func ( ) } ) arg_3 = [ ] arg_3 . extend ( arg_1 . HTTP_CODE [ "list" ] [ "potentially_up" ] ) arg_3 . extend ( arg_1 . HTTP_CODE [ "list" ] [ "up" ] ) arg_4 = [ ] arg_4 . extend ( arg_1 . HTTP_CODE [ "list" ] [ "potentially_down" ] ) arg_4 . append ( "*" * 3 ) if arg_1 . INTERN [ "http_code" ] in arg_3 : return URLStatus ( arg_1 . STATUS [ "official" ] [ "up" ] ) . handle ( ) if arg_1 . INTERN [ "http_code" ] in arg_4 : return URLStatus ( arg_1 . STATUS [ "official" ] [ "down" ] ) . handle ( ) if "current_test_data" in arg_1 . INTERN : arg_1 . INTERN [ "current_test_data" ] [ "url_syntax_validation" ] = False return URLStatus ( arg_1 . STATUS [ "official" ] [ "invalid" ] ) . handle ( )

def Func(arg_0):  # pragma: no cover
        """
        Execute the logic behind the URL handling.

        :return: The status of the URL.
        :rtype: str
        """

        if Check().is_url_valid() or arg_1.CONFIGURATION["local"]:
            # * The url is valid.
            # or
            # * We are testing in/for a local or private network.

            if "current_test_data" in arg_1.INTERN:
                arg_1.INTERN["current_test_data"]["url_syntax_validation"] = True

            # We initiate the HTTP status code.
            arg_1.INTERN.update({"http_code": HTTPCode().Func()})

            # We initiate the list of active status code.
            arg_3 = []
            arg_3.extend(arg_1.HTTP_CODE["list"]["potentially_up"])
            arg_3.extend(arg_1.HTTP_CODE["list"]["up"])

            # We initiate the list of inactive status code.
            arg_4 = []
            arg_4.extend(arg_1.HTTP_CODE["list"]["potentially_down"])
            arg_4.append("*" * 3)

            if arg_1.INTERN["http_code"] in arg_3:
                # The extracted HTTP status code is in the list of active list.

                # We handle and return the up status.
                return URLStatus(arg_1.STATUS["official"]["up"]).handle()

            if arg_1.INTERN["http_code"] in arg_4:
                # The extracted HTTP status code is in the list of inactive list.

                # We handle and return the down status.
                return URLStatus(arg_1.STATUS["official"]["down"]).handle()

        # The extracted HTTP status code is not in the list of active nor invalid list.

        if "current_test_data" in arg_1.INTERN:
            # The end-user want more information whith his test.

            # We update the url_syntax_validation index.
            arg_1.INTERN["current_test_data"]["url_syntax_validation"] = False

        # We handle and return the invalid down status.
        return URLStatus(arg_1.STATUS["official"]["invalid"]).handle()

Execute the logic behind the URL handling .


def Func(arg_0, arg_1):
        """Evaluate python expression expr in user namespace.

        Returns the result of Funcaluation
        """
        with arg_0.builtin_trap:
            return Funcal(arg_1, arg_0.user_global_ns, arg_0.user_ns)

Evaluate python expression expr in user namespace.

        Returns the result of evaluation

Evaluate python expression expr in user namespace .


return word[-suffix_len - 1] in {'i', 'l'} or (
            word[-suffix_len - 3 : -suffix_len] == 'u'
            and word[-suffix_len - 1] == 'e'
        )

def Func(arg_0, arg_1, arg_2):
        """Return Lovins' condition X.

        Parameters
        ----------
        word : str
            Word to check
        suffix_len : int
            Suffix length

        Returns
        -------
        bool
            True if condition is met

        """
        return arg_1[-arg_2 - 1] in {'i', 'l'} or (
            arg_1[-arg_2 - 3 : -arg_2] == 'u'
            and arg_1[-arg_2 - 1] == 'e'
        )


return dot(Sigma, eta + rsolve(GLMM.covariance(self), self.mean()))

def Func ( arg_0 ) : from numpy_sugar . linalg import rsolve arg_1 = arg_0 . posteriori_covariance ( ) arg_2 = arg_0 . _ep . _posterior . eta return dot ( arg_1 , arg_2 + rsolve ( GLMM . covariance ( arg_0 ) , arg_0 . mean ( ) ) )

def Func(arg_0):
        r""" Mean of the estimated posteriori.

        This is also the maximum a posteriori estimation of the latent variable.
        """
        from numpy_sugar.linalg import rsolve

        arg_1 = arg_0.posteriori_covariance()
        arg_2 = arg_0._ep._posterior.eta
        return dot(arg_1, arg_2 + rsolve(GLMM.covariance(arg_0), arg_0.mean()))


def Func(arg_0):
        """Main pipeline Funcer

        This method is responsible for Funcing the
        :py:attr:`NextflowGenerator.template` attribute that will contain
        the nextflow code of the pipeline.

        First it Funcs the header, then sets the main channels, the
        secondary inputs, secondary channels and finally the
        status channels. When the pipeline is built, is writes the code
        to a nextflow file.
        """

        logger.info(colored_print(
            "\tSuccessfully connected {} process(es) with {} "
            "fork(s) across {} lane(s) \u2713".format(
                len(arg_0.processes[1:]), len(arg_0._fork_tree), arg_0.lanes)))

        # Generate regular nextflow header that sets up the shebang, imports
        # and all possible initial channels
        arg_0._Func_header()

        arg_0._set_channels()

        arg_0._set_init_process()

        arg_0._set_secondary_channels()

        logger.info(colored_print(
            "\tSuccessfully set {} secondary channel(s) \u2713".format(
                len(arg_0.secondary_channels))))

        arg_0._set_compiler_channels()

        arg_0._set_configurations()

        logger.info(colored_print(
            "\tFinished configurations \u2713"))

        for arg_1 in arg_0.processes:
            arg_0.template += "\n{}".format(arg_1.template_str)

        arg_0._Func_footer()

        arg_2 = dirname(arg_0.nf_file)

        # Write configs
        arg_0.write_configs(arg_2)

        # Write pipeline file
        with open(arg_0.nf_file, "w") as fh:
            fh.write(arg_0.template)

        logger.info(colored_print(
            "\tPipeline written into {} \u2713".format(arg_0.nf_file)))

Main pipeline builder

        This method is responsible for building the
        :py:attr:`NextflowGenerator.template` attribute that will contain
        the nextflow code of the pipeline.

        First it builds the header, then sets the main channels, the
        secondary inputs, secondary channels and finally the
        status channels. When the pipeline is built, is writes the code
        to a nextflow file.


(self,
                     loss,
                     learning_rate,
                     optimizer=None,
                     clip_norm=None,
                     learnable_scopes=None,
                     optimizer_scope_name=None,
                     **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , ** arg_7 ) : if arg_6 is None : arg_8 = tf . variable_scope ( 'Optimizer' ) else : arg_8 = tf . variable_scope ( arg_6 ) with arg_8 : if arg_5 is None : arg_9 = tf . get_collection ( tf . GraphKeys . TRAINABLE_VARIABLES ) else : arg_9 = [ ] for arg_10 in arg_5 : arg_9 . extend ( tf . get_collection ( tf . GraphKeys . TRAINABLE_VARIABLES , scope = arg_10 ) ) if arg_3 is None : arg_3 = tf . train . AdamOptimizer arg_11 = tf . get_collection ( tf . GraphKeys . UPDATE_OPS ) with tf . control_dependencies ( arg_11 ) : def clip_if_not_none ( arg_12 ) : if arg_12 is not None : return tf . clip_by_norm ( arg_12 , arg_4 ) arg_13 = arg_3 ( arg_2 , ** arg_7 ) arg_14 = arg_13 . compute_gradients ( arg_1 , var_list = arg_9 ) if arg_4 is not None : arg_14 = [ ( clip_if_not_none ( arg_12 ) , var ) for arg_12 , var in arg_14 ] arg_15 = arg_13 . apply_gradients ( arg_14 ) return arg_15

def Func(arg_0,
                     arg_1,
                     arg_2,
                     arg_3=None,
                     arg_4=None,
                     arg_5=None,
                     arg_6=None,
                     **arg_7):
        """
        Get train operation for given loss

        Args:
            loss: loss, tf tensor or scalar
            learning_rate: scalar or placeholder.
            clip_norm: clip gradients norm by clip_norm.
            learnable_scopes: which scopes are trainable (None for all).
            optimizer: instance of tf.train.Optimizer, default Adam.
            **kwargs: parameters passed to tf.train.Optimizer object
               (scalars or placeholders).

        Returns:
            train_op
        """
        if arg_6 is None:
            arg_8 = tf.variable_scope('Optimizer')
        else:
            arg_8 = tf.variable_scope(arg_6)
        with arg_8:
            if arg_5 is None:
                arg_9 = tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES)
            else:
                arg_9 = []
                for arg_10 in arg_5:
                    arg_9.extend(tf.get_collection(tf.GraphKeys.TRAINABLE_VARIABLES, scope=arg_10))

            if arg_3 is None:
                arg_3 = tf.train.AdamOptimizer

            # For batch norm it is necessary to update running averages
            arg_11 = tf.get_collection(tf.GraphKeys.UPDATE_OPS)
            with tf.control_dependencies(arg_11):

                def clip_if_not_none(arg_12):
                    if arg_12 is not None:
                        return tf.clip_by_norm(arg_12, arg_4)

                arg_13 = arg_3(arg_2, **arg_7)
                arg_14 = arg_13.compute_gradients(arg_1, var_list=arg_9)
                if arg_4 is not None:
                    arg_14 = [(clip_if_not_none(arg_12), var)
                                      for arg_12, var in arg_14]
                arg_15 = arg_13.apply_gradients(arg_14)
        return arg_15


return [
            "{}_wt".format(self.table),
            "{}_log".format(self.table),
            "{}_e1".format(self.table),
            "{}_e2".format(self.table),
        ]

def
Func
(
arg_0
)
:
if
arg_0
.
table
is
:
raise
GiraffeError
(
"Target table has not been set."
)
return
[
"{}_wt"
.
format
(
arg_0
.
table
)
,
"{}_log"
.
format
(
arg_0
.
table
)
,
"{}_e1"
.
format
(
arg_0
.
table
)
,
"{}_e2"
.
format
(
arg_0
.
table
)
,
]

def Func(arg_0):
        """
        The names of the work Func used for loading.

        :return: A list of four Func, each the name of the target table
            with the added suffixes, "_wt", "_log", "_e1", and "_e2"
        :raises `giraffez.errors.GiraffeError`: if table was not set by
            the constructor, the :code:`TeradataBulkLoad.table`, or
            :meth:`~giraffez.load.TeradataBulkLoad.from_file`.
        """
        if arg_0.table is None:
            raise GiraffeError("Target table has not been set.")
        return [
            "{}_wt".format(arg_0.table),
            "{}_log".format(arg_0.table),
            "{}_e1".format(arg_0.table),
            "{}_e2".format(arg_0.table),
        ]

The names of the work tables used for loading.

        :return: A list of four tables, each the name of the target table
            with the added suffixes, "_wt", "_log", "_e1", and "_e2"
        :raises `giraffez.errors.GiraffeError`: if table was not set by
            the constructor, the :code:`TeradataBulkLoad.table`, or
            :meth:`~giraffez.load.TeradataBulkLoad.from_file`.

The names of the work tables used for loading .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_device
.
read
(
ENDPOINT
,
REQ_INT_LEN
,
timeout
=
TIMEOUT
)
LOGGER
.
debug
(
'Read data: %r'
,
arg_1
)
return
arg_1

def Func(arg_0):
        """
        Read data from device.
        """
        arg_1 = arg_0._device.read(ENDPOINT, REQ_INT_LEN, timeout=TIMEOUT)
        LOGGER.debug('Read data: %r', arg_1)
        return arg_1


(times,
                   mags,
                   modeltimes,
                   modelmags,
                   atol_normalization=1e-8,
                   indsforrms=None,
                   magsarefluxes=False,
                   verbose=True,
                   transitdepth=None,
                   npoints_in_transit=None)

def Func(arg_0,
                   arg_1,
                   arg_2,
                   arg_3,
                   arg_4=1e-8,
                   arg_5=None,
                   arg_6=False,
                   arg_7=True,
                   arg_8=None,
                   arg_9=None):
    '''Calculate the total SNR of a transit assuming gaussian uncertainties.

    `modelmags` gets interpolated onto the cadence of `mags`. The noise is
    calculated as the 1-sigma std deviation of the residual (see below).

    Following Carter et al. 2009::

        Q = sqrt( Γ T ) * δ / σ

    for Q the total SNR of the transit in the r->0 limit, where::

        r = Rp/Rstar,
        T = transit duration,
        δ = transit depth,
        σ = RMS of the lightcurve in transit.
        Γ = sampling rate

    Thus Γ * T is roughly the number of points obtained during transit.
    (This doesn't correctly account for the SNR during ingress/egress, but this
    is a second-order correction).

    Note this is the same total SNR as described by e.g., Kovacs et al. 2002,
    their Equation 11.

    NOTE: this only works with fluxes at the moment.

    Parameters
    ----------

    times,mags : np.array
        The input flux time-series to process.

    modeltimes,modelmags : np.array
        A transiting planet model, either from BLS, a trapezoid model, or a
        Mandel-Agol model.

    atol_normalization : float
        The absolute tolerance to which the median of the passed model fluxes
        must be equal to 1.

    indsforrms : np.array
        A array of bools of `len(mags)` used to select points for the RMS
        measurement. If not passed, the RMS of the entire passed timeseries is
        used as an approximation. Genearlly, it's best to use out of transit
        points, so the RMS measurement is not model-dependent.

    magsarefluxes : bool
        Currently forced to be True because this function only works with
        fluxes.

    verbose : bool
        If True, indicates progress and warns about problems.

    transitdepth : float or None
        If the transit depth is known, pass it in here. Otherwise, it is
        calculated assuming OOT flux is 1.

    npoints_in_transits : int or None
        If the number of points in transit is known, pass it in here. Otherwise,
        the function will guess at this value.

    Returns
    -------

    (snr, transit_depth, noise) : tuple
        The returned tuple contains the calculated SNR, transit depth, and noise
        of the residual lightcurve calculated using the relation described
        above.

    '''

    if arg_6:
        if not np.isclose(np.nanmedian(arg_3), 1, atol=arg_4):
            raise AssertionError('snr calculation assumes modelmags are '
                                 'median-normalized')
    else:
        raise NotImplementedError(
            'need to implement a method for identifying in-transit points when'
            'mags are mags, and not fluxes'
        )

    if not arg_8:
        # calculate transit depth from whatever model magnitudes are passed.
        arg_8 = np.abs(np.max(arg_3) - np.min(arg_3))

    # generally, mags (data) and modelmags are at different cadence.
    # interpolate modelmags onto the cadence of mags.
    if not len(arg_1) == len(arg_3):
        from scipy.interpolate import interp1d

        arg_10 = interp1d(arg_2, arg_3, kind='cubic', bounds_error=True,
                      fill_value=np.nan)

        arg_3 = arg_10(arg_0)

        if arg_7:
            LOGINFO('interpolated model timeseries onto the data timeseries')

    arg_11 = arg_1 - arg_3

    if isinstance(arg_5, np.ndarray):
        arg_12 = np.std(arg_11[arg_5])
        if arg_7:
            LOGINFO('using selected points to measure RMS')
    else:
        arg_12 = np.std(arg_11)
        if arg_7:
            LOGINFO('using all points to measure RMS')

    def _get_npoints_in_transit(arg_3):
        # assumes median-normalized fluxes are input
        if np.nanmedian(arg_3) == 1:
            return len(arg_3[(arg_3 != 1)])
        else:
            raise NotImplementedError

    if not arg_9:
        arg_9 = _get_npoints_in_transit(arg_3)

    arg_13 = np.sqrt(arg_9) * arg_8/arg_12

    if arg_7:

        LOGINFO('\npoints in transit: {:d}'.format(arg_9) +
                '\ndepth: {:.2e}'.format(arg_8) +
                '\nrms in residual: {:.2e}'.format(arg_12) +
                '\n\t SNR: {:.2e}'.format(arg_13))

    return arg_13, arg_8, arg_12

Calculate the total SNR of a transit assuming gaussian uncertainties .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] if arg_0 is not None : arg_5 = random . uniform ( arg_0 [ 0 ] , arg_0 [ 1 ] ) arg_4 . append ( Lambda ( lambda img : F . adjust_brightness ( img , arg_5 ) ) ) if arg_1 is not None : arg_6 = random . uniform ( arg_1 [ 0 ] , arg_1 [ 1 ] ) arg_4 . append ( Lambda ( lambda img : F . adjust_contrast ( img , arg_6 ) ) ) if arg_2 is not None : arg_7 = random . uniform ( arg_2 [ 0 ] , arg_2 [ 1 ] ) arg_4 . append ( Lambda ( lambda img : F . adjust_saturation ( img , arg_7 ) ) ) if arg_3 is not None : arg_8 = random . uniform ( arg_3 [ 0 ] , arg_3 [ 1 ] ) arg_4 . append ( Lambda ( lambda img : F . adjust_hue ( img , arg_8 ) ) ) random . shuffle ( arg_4 ) arg_9 = Compose ( arg_4 ) return arg_9

def Func(arg_0, arg_1, arg_2, arg_3):
        """Get a randomized transform to be applied on image.

        Arguments are same as that of __init__.

        Returns:
            Transform which randomly adjusts brightness, contrast and
            saturation in a random order.
        """
        arg_4 = []

        if arg_0 is not None:
            arg_5 = random.uniform(arg_0[0], arg_0[1])
            arg_4.append(Lambda(lambda img: F.adjust_brightness(img, arg_5)))

        if arg_1 is not None:
            arg_6 = random.uniform(arg_1[0], arg_1[1])
            arg_4.append(Lambda(lambda img: F.adjust_contrast(img, arg_6)))

        if arg_2 is not None:
            arg_7 = random.uniform(arg_2[0], arg_2[1])
            arg_4.append(Lambda(lambda img: F.adjust_saturation(img, arg_7)))

        if arg_3 is not None:
            arg_8 = random.uniform(arg_3[0], arg_3[1])
            arg_4.append(Lambda(lambda img: F.adjust_hue(img, arg_8)))

        random.shuffle(arg_4)
        arg_9 = Compose(arg_4)

        return arg_9

Get a randomized transform to be applied on image .


def Func ( arg_0 , arg_1 ) : if 'enabled' in arg_1 : arg_1 [ 'enabled' ] = bool ( arg_1 [ 'enabled' ] ) if 'exclude_paths' in arg_1 : arg_1 [ 'exclude_paths' ] = [ n . strip ( ) for n in ast . literal_eval ( arg_1 [ 'exclude_paths' ] ) ] return arg_1

def Func(arg_0, arg_1):
		"""
		Parse the config values

		Args:
			value (dict): Dictionary which contains the checker config

		Returns:
			dict: The checker config with parsed values
		"""
		if 'enabled' in arg_1:
			arg_1['enabled'] = bool(arg_1['enabled'])

		if 'exclude_paths' in arg_1:
			arg_1['exclude_paths'] = [n.strip() for n in ast.literal_eval(arg_1['exclude_paths'])]

		return arg_1


def Func ( arg_0 , arg_1 ) : _ctx . colormode ( RGB , 1.0 ) def _color ( arg_2 , arg_3 = 1.0 ) : if arg_2 == "none" : return None arg_4 = int ( arg_2 [ 1 : ] , 16 ) arg_5 = ( arg_4 >> 16 ) & 0xff arg_6 = ( arg_4 >> 8 ) & 0xff arg_7 = arg_4 & 0xff return _ctx . color ( arg_5 / 255.0 , arg_6 / 255.0 , arg_7 / 255.0 , arg_3 ) arg_1 . fill = ( 0 , 0 , 0 , 0 ) arg_1 . stroke = ( 0 , 0 , 0 , 0 ) arg_1 . strokewidth = 0 arg_3 = get_attribute ( arg_0 , "opacity" , default = "" ) if arg_3 == "" : arg_3 = 1.0 else : arg_3 = float ( arg_3 ) try : arg_1 . fill = _color ( get_attribute ( arg_0 , "fill" , default = "#00000" ) , arg_3 ) except : pass try : arg_1 . stroke = _color ( get_attribute ( arg_0 , "stroke" , default = "none" ) , arg_3 ) except : pass try : arg_1 . strokewidth = float ( get_attribute ( arg_0 , "stroke-width" , default = "1" ) ) except : pass arg_11 = get_attribute ( arg_0 , "style" , default = "" ) . split ( ";" ) for arg_12 in arg_11 : try : if arg_12 . startswith ( "fill:" ) : arg_1 . fill = _color ( arg_12 . replace ( "fill:" , "" ) ) elif arg_12 . startswith ( "stroke:" ) : arg_1 . stroke = _color ( arg_12 . replace ( "stroke:" , "" ) ) elif arg_12 . startswith ( "stroke-width:" ) : arg_1 . strokewidth = float ( arg_12 . replace ( "stroke-width:" , "" ) ) except : pass arg_1 . closed = False if arg_1 [ 0 ] . x == arg_1 [ len ( arg_1 ) - 1 ] . x and arg_1 [ 0 ] . y == arg_1 [ len ( arg_1 ) - 1 ] . y : arg_1 . closed = True for arg_14 in range ( 1 , - 1 ) : if arg_1 [ arg_14 ] . cmd == MOVETO : arg_1 . closed = False return arg_1

def Func(arg_0, arg_1):

    """ Expand the path with color information.

    Attempts to extract fill and stroke colors
    from the element and adds it to path attributes.

    """

    _ctx.colormode(RGB, 1.0)

    def _color(arg_2, arg_3=1.0):
        if arg_2 == "none": return None
        arg_4 = int(arg_2[1:],16)
        arg_5 = (arg_4>>16)&0xff
        arg_6 = (arg_4>>8)&0xff
        arg_7 = arg_4&0xff
        return _ctx.color(arg_5/255.0, arg_6/255.0, arg_7/255.0, arg_3)

    arg_1.fill = (0,0,0,0)
    arg_1.stroke = (0,0,0,0)
    arg_1.strokewidth = 0

    # See if we can find an opacity attribute,
    # which is the color's alpha.
    arg_3 = get_attribute(arg_0, "opacity", default="")
    if arg_3 == "":
        arg_3 = 1.0
    else:
        arg_3 = float(arg_3)

    # Colors stored as fill="" or stroke="" attributes.
    try: arg_1.fill = _color(get_attribute(arg_0, "fill", default="#00000"), arg_3)
    except:
        pass
    try: arg_1.stroke = _color(get_attribute(arg_0, "stroke", default="none"), arg_3)
    except:
        pass
    try: arg_1.strokewidth = float(get_attribute(arg_0, "stroke-width", default="1"))
    except:
        pass

    # Colors stored as a CSS style attribute, for example:
    # style="fill:#ff6600;stroke:#ffe600;stroke-width:0.06742057"
    arg_11 = get_attribute(arg_0, "style", default="").split(";")
    for arg_12 in arg_11:
        try:
            if arg_12.startswith("fill:"):
                arg_1.fill = _color(arg_12.replace("fill:", ""))
            elif arg_12.startswith("stroke:"):
                arg_1.stroke = _color(arg_12.replace("stroke:", ""))
            elif arg_12.startswith("stroke-width:"):
                arg_1.strokewidth = float(arg_12.replace("stroke-width:", ""))
        except:
            pass

    # A path with beginning and ending coordinate
    # at the same location is considered closed.
    # Unless it contains a MOVETO somewhere in the middle.
    arg_1.closed = False
    if arg_1[0].x == arg_1[len(arg_1)-1].x and \
       arg_1[0].y == arg_1[len(arg_1)-1].y:
        arg_1.closed = True
    for arg_14 in range(1,-1):
        if arg_1[arg_14].cmd == MOVETO:
            arg_1.closed = False

    return arg_1

Expand the path with color information . Attempts to extract fill and stroke colors from the element and adds it to path attributes .


def Func ( arg_0 , arg_1 ) : if arg_0 . config [ 'TRAP_HTTP_EXCEPTIONS' ] : return True if arg_0 . config [ 'TRAP_BAD_REQUEST_ERRORS' ] : return isinstance ( arg_1 , BadRequest ) return False

def Func(arg_0, arg_1):
        """Checks if an HTTP exception should be trapped or not.  By default
        this will return `False` for all exceptions except for a bad request
        key error if ``TRAP_BAD_REQUEST_ERRORS`` is set to `True`.  It
        also returns `True` if ``TRAP_HTTP_EXCEPTIONS`` is set to `True`.

        This is called for all HTTP exceptions raised by a view function.
        If it returns `True` for any exception the error handler for this
        exception is not called and it shows up as regular exception in the
        traceback.  This is helpful for debugging implicitly raised HTTP
        exceptions.

        .. versionadded:: 0.8
        """
        if arg_0.config['TRAP_HTTP_EXCEPTIONS']:
            return True
        if arg_0.config['TRAP_BAD_REQUEST_ERRORS']:
            return isinstance(arg_1, BadRequest)
        return False

Checks if an HTTP exception should be trapped or not . By default this will return False for all exceptions except for a bad request key error if TRAP_BAD_REQUEST_ERRORS is set to True . It also returns True if TRAP_HTTP_EXCEPTIONS is set to True .


def Func ( arg_0 ) : try : arg_1 = arg_0 . split ( '.' ) arg_2 = '.' . join ( arg_1 [ : - 1 ] ) if arg_2 : try : __import__ ( arg_2 ) arg_3 = sys . modules [ arg_2 ] return getattr ( arg_3 , arg_1 [ - 1 ] ) , arg_3 except ( ImportError , IndexError , AttributeError ) : pass arg_4 = 0 arg_2 = None for arg_5 in reversed ( range ( 1 , len ( arg_1 ) + 1 ) ) : arg_4 = arg_5 arg_2 = '.' . join ( arg_1 [ : arg_5 ] ) try : __import__ ( arg_2 ) except : continue if arg_2 in sys . modules : break if arg_4 < len ( arg_1 ) : arg_6 = None arg_7 = sys . modules [ arg_2 ] for arg_8 in arg_1 [ arg_4 : ] : arg_6 = arg_7 arg_7 = getattr ( arg_7 , arg_8 ) return arg_7 , arg_6 else : return sys . modules [ arg_2 ] , None except ( ValueError , ImportError , AttributeError , KeyError ) , e : raise ImportError ( * e . args )

def Func(arg_0):
    """Import a Python object given its full name."""
    try:
        arg_1 = arg_0.split('.')

        # try first interpret `name` as MODNAME.OBJ
        arg_2 = '.'.join(arg_1[:-1])
        if arg_2:
            try:
                __import__(arg_2)
                arg_3 = sys.modules[arg_2]
                return getattr(arg_3, arg_1[-1]), arg_3
            except (ImportError, IndexError, AttributeError):
                pass

        # ... then as MODNAME, MODNAME.OBJ1, MODNAME.OBJ1.OBJ2, ...
        arg_4 = 0
        arg_2 = None
        for arg_5 in reversed(range(1, len(arg_1)+1)):
            arg_4 = arg_5
            arg_2 = '.'.join(arg_1[:arg_5])
            try:
                __import__(arg_2)
            except:# ImportError:
                continue
            if arg_2 in sys.modules:
                break

        if arg_4 < len(arg_1):
            arg_6 = None
            arg_7 = sys.modules[arg_2]
            for arg_8 in arg_1[arg_4:]:
                arg_6 = arg_7
                arg_7 = getattr(arg_7, arg_8)
            return arg_7, arg_6
        else:
            return sys.modules[arg_2], None
    except (ValueError, ImportError, AttributeError, KeyError), e:
        raise ImportError(*e.args)

Import a Python object given its full name .


def Func ( arg_0 ) : arg_1 = 'GET' arg_2 = 'activeMessage' arg_3 = arg_0 . __request__ ( arg_1 , arg_2 ) return arg_3 [ 'activeMessage' ]

def Func(arg_0):
        """Return active Func."""
        arg_1 = 'GET'
        arg_2 = 'activeMessage'

        arg_3 = arg_0.__request__(arg_1, arg_2)
        # try:
        #     return rc['activeMessage']
        # except:
        #     raise UnknownError('Invalid activeMessage response')  # is it even possible?
        return arg_3['activeMessage']


def Func():
        """Attempts to get implicit credentials from local credential files.

        First checks if the environment variable GOOGLE_APPLICATION_CREDENTIALS
        is set with a filename and then falls back to a configuration file (the
        "well known" file) associated with the 'gcloud' command line tool.

        Returns:
            Credentials object associated with the
            GOOGLE_APPLICATION_CREDENTIALS file or the "well known" file if
            either exist. If neither file is define, returns None, indicating
            no credentials from a file can detected from the current
            environment.
        """
        arg_0 = _get_environment_variable_file()
        if not arg_0:
            arg_0 = _get_well_known_file()
            if os.path.isfile(arg_0):
                arg_1 = (' (produced automatically when running'
                              ' "gcloud auth login" command)')
            else:
                arg_0 = None
        else:
            arg_1 = (' (pointed to by ' + GOOGLE_APPLICATION_CREDENTIALS +
                          ' environment variable)')

        if not arg_0:
            return

        # If we can read the credentials from a file, we don't need to know
        # what environment we are in.
        arg_2.env_name = DEFAULT_ENV_NAME

        try:
            return _get_application_default_credential_from_file(
                arg_0)
        except (ApplicationDefaultCredentialsError, ValueError) as error:
            _raise_exception_for_reading_json(arg_0,
                                              arg_1, error)

Attempts to get implicit credentials from local credential files .


def
Func
(
arg_0
)
:
if
arg_0
==
'/'
:
return
arg_0
if
arg_0
[
:
1
]
!=
'/'
:
raise
InvalidPath
(
'The path must start with a slash'
)
arg_0
=
re
.
sub
(
r'/+'
,
'/'
,
arg_0
)
return
arg_0
.
rstrip
(
'/'
)

def Func(arg_0):
    """Performs sanitation of the path after validating

    :param path: path to sanitize
    :return: path
    :raises:
        - InvalidPath if the path doesn't start with a slash
    """

    if arg_0 == '/':  # Nothing to do, just return
        return arg_0

    if arg_0[:1] != '/':
        raise InvalidPath('The path must start with a slash')

    # Deduplicate slashes in path
    arg_0 = re.sub(r'/+', '/', arg_0)

    # Strip trailing slashes and return
    return arg_0.rstrip('/')


def
Func
(
arg_0
)
:
arg_1
=
" {} "
.
format
(
arg_0
)
arg_2
=
r"[^\s{}{}{}]+"
.
format
(
LANE_TOKEN
,
FORK_TOKEN
,
CLOSE_TOKEN
)
arg_3
=
re
.
findall
(
arg_2
,
arg_1
)
arg_4
=
{
}
arg_5
=
[
]
for
arg_6
,
arg_7
in
enumerate
(
arg_3
)
:
if
"="
in
arg_7
:
arg_8
=
arg_7
.
split
(
"="
)
arg_9
=
"{}_{}={}"
.
format
(
arg_8
[
0
]
,
arg_6
,
arg_8
[
1
]
)
else
:
arg_9
=
"{}_{}"
.
format
(
arg_7
,
arg_6
)
arg_5
.
append
(
arg_9
)
arg_4
[
arg_9
]
=
arg_7
arg_10
=
lambda
match
:
" {} "
.
format
(
match
.
group
(
)
)
arg_11
=
r'[{}{}{}]+'
.
format
(
FORK_TOKEN
,
LANE_TOKEN
,
CLOSE_TOKEN
)
arg_1
=
re
.
sub
(
arg_11
,
arg_10
,
arg_1
)
for
arg_6
,
arg_7
in
enumerate
(
arg_3
)
:
arg_11
=
r'{}[^_]'
.
format
(
arg_7
)
.
replace
(
"\\"
,
"\\\\"
)
arg_1
=
re
.
sub
(
arg_11
,
arg_5
[
arg_6
]
+
" "
,
arg_1
,
1
)
return
arg_1
,
arg_4

def Func(arg_0):
    """Returns the pipeline string with unique identifiers and a dictionary with
     references between the unique keys and the original values

    Parameters
    ----------
    pipeline_str : str
        Pipeline string

    Returns
    -------
    str
        Pipeline string with unique identifiers
    dict
        Match between process unique values and original names
    """

    # Add space at beginning and end of pipeline to allow regex mapping of final
    # process in linear pipelines
    arg_1 = " {} ".format(arg_0)

    # Regex to get all process names. Catch all words without spaces and that
    # are not fork tokens or pipes
    arg_2 = r"[^\s{}{}{}]+".format(LANE_TOKEN, FORK_TOKEN, CLOSE_TOKEN)
    arg_3 = re.findall(arg_2, arg_1)

    arg_4 = {}
    """
    dict: Matches new process names (identifiers) with original process
    names
    """

    arg_5 = []
    """
    list: New process names used to replace in the pipeline string
    """

    # Assigns the new process names by appending a numeric id at the end of
    # the process name
    for arg_6, arg_7 in enumerate(arg_3):
        if "=" in arg_7:
            arg_8 = arg_7.split("=")
            arg_9 = "{}_{}={}".format(arg_8[0], arg_6, arg_8[1])
        else:
            arg_9 = "{}_{}".format(arg_7, arg_6)

        # add new process with id
        arg_5.append(arg_9)
        # makes a match between new process name and original process name
        arg_4[arg_9] = arg_7

    # Add space between forks, pipes and the process names for the replace
    # regex to work
    arg_10 = lambda match: " {} ".format(match.group())

    # force to add a space between each token so that regex modification can
    # be applied
    arg_11 = r'[{}{}{}]+'.format(FORK_TOKEN, LANE_TOKEN, CLOSE_TOKEN)
    arg_1 = re.sub(arg_11, arg_10, arg_1)

    # Replace original process names by the unique identifiers
    for arg_6, arg_7 in enumerate(arg_3):
        # regex to replace process names with non assigned process ids
        # escape characters are required to match to the dict keys
        # (identifiers_to_tags), since python keys with escape characters
        # must be escaped
        arg_11 = r'{}[^_]'.format(arg_7).replace("\\", "\\\\")
        arg_1 = re.sub(arg_11, arg_5[arg_6] + " ",
                                       arg_1, 1)

    return arg_1, arg_4


def Func ( arg_0 ) -> str : arg_1 = str ( int ( arg_0 ) ) return pd . Timestamp ( f'{to_str[:-2]}:{to_str[-2:]}' ) . strftime ( '%H:%M' )

def Func(arg_0) -> str:
    """
    Convert YAML input to hours

    Args:
        num: number in YMAL file, e.g., 900, 1700, etc.

    Returns:
        str

    Examples:
        >>> Func(900)
        '09:00'
        >>> Func(1700)
        '17:00'
    """
    arg_1 = str(int(arg_0))
    return pd.Timestamp(f'{to_str[:-2]}:{to_str[-2:]}').strftime('%H:%M')

Convert YAML input to hours

    Args:
        num: number in YMAL file, e.g., 900, 1700, etc.

    Returns:
        str

    Examples:
        >>> to_hour(900)
        '09:00'
        >>> to_hour(1700)
        '17:00'


(self, secret_key=None, region=None,
                               service=None, date=None)

def Func(arg_0, arg_1=None, arg_2=None,
                               arg_3=None, arg_4=None):
        """
        Regenerate the signing key for this instance. Store the new key in
        signing_key property.

        Take scope elements of the new key from the equivalent properties
        (region, service, date) of the current AWS4Auth instance. Scope
        elements can be overridden for the new key by supplying arguments to
        this function. If overrides are supplied update the current AWS4Auth
        instance's equivalent properties to match the new values.

        If secret_key is not specified use the value of the secret_key property
        of the current AWS4Auth instance's signing key. If the existing signing
        key is not storing its secret key (i.e. store_secret_key was set to
        False at instantiation) then raise a NoSecretKeyError and do not
        regenerate the key. In order to regenerate a key which is not storing
        its secret key, secret_key must be supplied to this function.

        Use the value of the existing key's store_secret_key property when
        generating the new key. If there is no existing key, then default
        to setting store_secret_key to True for new key.

        """
        if arg_1 is None and (arg_0.signing_key is None or
                                   arg_0.signing_key.secret_key is None):
            raise NoSecretKeyError

        arg_1 = arg_1 or arg_0.signing_key.secret_key
        arg_2 = arg_2 or arg_0.region
        arg_3 = arg_3 or arg_0.service
        arg_4 = arg_4 or arg_0.date
        if arg_0.signing_key is None:
            arg_5 = True
        else:
            arg_5 = arg_0.signing_key.store_secret_key

        arg_0.signing_key = AWS4SigningKey(arg_1, arg_2, arg_3, arg_4,
                                          arg_5)

        arg_0.region = arg_2
        arg_0.service = arg_3
        arg_0.date = arg_0.signing_key.date

Regenerate the signing key for this instance . Store the new key in signing_key property .


(self, command, coerce_floats=True, parse_dates=False, header=False, sanitize=True,
            silent=False, panic=None,  multi_statement=False, prepare_only=False)

return Cursor(self.cmd, command, multi_statement=multi_statement, header=header,
            prepare_only=prepare_only, coerce_floats=coerce_floats, parse_dates=parse_dates,
            panic=panic)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
False
,
arg_4
=
False
,
arg_5
=
True
,
arg_6
=
False
,
arg_7
=
,
arg_8
=
False
,
arg_9
=
False
)
:
if
arg_7
is
:
arg_7
=
arg_0
.
panic
arg_0
.
options
(
"panic"
,
arg_7
)
arg_0
.
options
(
"multi-statement mode"
,
arg_8
,
3
)
if
isfile
(
arg_1
)
:
arg_0
.
options
(
"file"
,
arg_1
,
2
)
with
open
(
arg_1
,
'r'
)
as
f
:
arg_1
=
f
.
read
(
)
else
:
if
log
.
level
>=
VERBOSE
:
arg_0
.
options
(
"query"
,
arg_1
,
2
)
else
:
arg_0
.
options
(
"query"
,
truncate
(
arg_1
)
,
2
)
if
not
arg_6
and
not
arg_0
.
silent
:
log
.
info
(
"Command"
,
"Executing ..."
)
log
.
info
(
arg_0
.
options
)
if
arg_5
:
arg_1
=
prepare_statement
(
arg_1
)
log
.
debug
(
"Debug[2]"
,
"Command (sanitized): {!r}"
.
format
(
arg_1
)
)
arg_0
.
cmd
.
set_encoding
(
ENCODER_SETTINGS_DEFAULT
)
return
Cursor
(
arg_0
.
cmd
,
arg_1
,
arg_8
=
arg_8
,
arg_4
=
arg_4
,
arg_9
=
arg_9
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_7
=
arg_7
)

def Func(arg_0, arg_1, arg_2=True, arg_3=False, arg_4=False, arg_5=True,
            arg_6=False, arg_7=None,  arg_8=False, arg_9=False):
        """
        Execute commands using CLIv2.

        :param str command: The SQL command to be Funcd
        :param bool coerce_floats: Coerce Teradata decimal types into Python floats
        :param bool parse_dates: Parses Teradata datetime types into Python datetimes
        :param bool header: Include row header
        :param bool sanitize: Whether or not to call :func:`~giraffez.sql.prepare_statement`
            on the command
        :param bool silent: Silence console logging (within this function only)
        :param bool panic: If :code:`True`, when an error is encountered it will be
            raised.
        :param bool multi_statement: Execute in multi-statement mode
        :param bool prepare_only: Only prepare the command (no results)
        :return: a cursor over the results of each statement in the command
        :rtype: :class:`~giraffez.cmd.Cursor`
        :raises `giraffez.TeradataError`: if the query is invalid
        :raises `giraffez.errors.GiraffeError`: if the return data could not be decoded
        """
        if arg_7 is None:
            arg_7 = arg_0.panic
        arg_0.options("panic", arg_7)
        arg_0.options("multi-statement mode", arg_8, 3)
        if isfile(arg_1):
            arg_0.options("file", arg_1, 2)
            with open(arg_1, 'r') as f:
                arg_1 = f.read()
        else:
            if log.level >= VERBOSE:
                arg_0.options("query", arg_1, 2)
            else:
                arg_0.options("query", truncate(arg_1), 2)
        if not arg_6 and not arg_0.silent:
            log.info("Command", "Executing ...")
            log.info(arg_0.options)
        if arg_5:
            arg_1 = prepare_statement(arg_1) # accounts for comments and newlines
            log.debug("Debug[2]", "Command (sanitized): {!r}".format(arg_1))
        arg_0.cmd.set_encoding(ENCODER_SETTINGS_DEFAULT)
        return Cursor(arg_0.cmd, arg_1, arg_8=arg_8, arg_4=arg_4,
            arg_9=arg_9, arg_2=arg_2, arg_3=arg_3,
            arg_7=arg_7)

Execute commands using CLIv2.

        :param str command: The SQL command to be executed
        :param bool coerce_floats: Coerce Teradata decimal types into Python floats
        :param bool parse_dates: Parses Teradata datetime types into Python datetimes
        :param bool header: Include row header
        :param bool sanitize: Whether or not to call :func:`~giraffez.sql.prepare_statement`
            on the command
        :param bool silent: Silence console logging (within this function only)
        :param bool panic: If :code:`True`, when an error is encountered it will be
            raised.
        :param bool multi_statement: Execute in multi-statement mode
        :param bool prepare_only: Only prepare the command (no results)
        :return: a cursor over the results of each statement in the command
        :rtype: :class:`~giraffez.cmd.Cursor`
        :raises `giraffez.TeradataError`: if the query is invalid
        :raises `giraffez.errors.GiraffeError`: if the return data could not be decoded


def Func(arg_0, arg_1, arg_2=False):
        """
        Identify a filter by fuzzy string matching.

        Partial ('fuzzy') matching performed by `fuzzywuzzy.fuzzy.ratio`

        Parameters
        ----------
        fuzzkey : str
            A string that partially matches one filter name more than the others.

        Returns
        -------
        The name of the most closely matched filter. : str
        """

        arg_3, arg_4 = np.array([(f, seqm(None, arg_1, f).ratio()) for f in arg_0.components.keys()]).T
        arg_5 = max(arg_4)

        if arg_2:
            return arg_3[arg_4 == arg_5]
        else:
            if sum(arg_4 == arg_5) == 1:
                return arg_3[arg_4 == arg_5][0]
            else:
                raise ValueError("\nThe filter key provided ('{:}') matches two or more filter names equally well:\n".format(arg_1) + ', '.join(arg_3[arg_4 == arg_5]) + "\nPlease be more specific!")

Identify a filter by fuzzy string matching .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_2
not
in
arg_0
.
ETYPES
:
raise
KeyError
(
'etype not in {}'
.
format
(
arg_0
.
ETYPES
)
)
arg_0
.
external_refs
[
arg_1
]
=
(
arg_2
,
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """Add an external reference.

        :param str eid: Name of the external reference.
        :param str etype: Type of the external reference, has to be in
            ``['iso12620', 'ecv', 'cve_id', 'lexen_id', 'resource_url']``.
        :param str value: Value of the external reference.
        :throws KeyError: if etype is not in the list of possible types.
        """
        if arg_2 not in arg_0.ETYPES:
            raise KeyError('etype not in {}'.format(arg_0.ETYPES))
        arg_0.external_refs[arg_1] = (arg_2, arg_3)


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . node elif callable ( arg_1 ) : arg_1 = next ( arg_1 . compute ( arg_0 ) , '' ) yield len ( arg_1 )

def Func(arg_0, arg_1=None):
    '''
    Yields one number
    '''
    if arg_1 is None:
        arg_1 = arg_0.node
    elif callable(arg_1):
        arg_1 = next(arg_1.compute(arg_0), '')
    yield len(arg_1)


(html, filename, image_tag = None, inline = True)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
True
)
:
if
arg_2
is
:
arg_2
=
default_image_tag
else
:
arg_2
=
ensure_utf8
(
arg_2
)
if
arg_3
:
arg_4
=
else
:
arg_5
,
arg_6
=
os
.
path
.
splitext
(
arg_1
)
arg_4
=
arg_5
+
"_files"
if
os
.
path
.
isfile
(
arg_4
)
:
raise
OSError
(
"%s exists, but is not a directory."
%
arg_4
)
with
open
(
arg_1
,
'w'
)
as
f
:
arg_0
=
fix_html
(
arg_0
)
f
.
write
(
IMG_RE
.
sub
(
lambda
x
:
arg_2
(
x
,
arg_4
=
arg_4
,
format
=
"png"
)
,
arg_0
)
)

def Func(arg_0, arg_1, arg_2 = None, arg_3 = True):
    """ Export the contents of the ConsoleWidget as HTML.

    Parameters:
    -----------
    html : str,
        A utf-8 encoded Python string containing the Qt HTML to export.

    filename : str
        The file to be saved.

    image_tag : callable, optional (default None)
        Used to convert images. See ``default_image_tag()`` for information.

    inline : bool, optional [default True]
        If True, include images as inline PNGs.  Otherwise, include them as
        links to external PNG files, mimicking web browsers' "Web Page,
        Complete" behavior.
    """
    if arg_2 is None:
        arg_2 = default_image_tag
    else:
        arg_2 = ensure_utf8(arg_2)

    if arg_3:
        arg_4 = None
    else:
        arg_5,arg_6 = os.path.splitext(arg_1)
        arg_4 = arg_5 + "_files"
        if os.path.isfile(arg_4):
            raise OSError("%s exists, but is not a directory." % arg_4)

    with open(arg_1, 'w') as f:
        arg_0 = fix_html(arg_0)
        f.write(IMG_RE.sub(lambda x: arg_2(x, arg_4 = arg_4, format = "png"),
                           arg_0))

Export the contents of the ConsoleWidget as HTML .


(df, *, group_cols: Union[str, List[str]],
            aggregations: Dict[str, Union[str, List[str]]])

def Func ( arg_0 , * , arg_1 : arg_2 [ arg_3 , arg_4 [ arg_3 ] ] , arg_5 : arg_6 [ arg_3 , arg_2 [ arg_3 , arg_4 [ arg_3 ] ] ] ) : arg_0 = arg_0 . Func ( arg_1 , as_index = False ) . agg ( arg_5 ) if arg_0 . columns . nlevels == 2 : arg_7 = arg_0 . columns . get_level_values ( 0 ) arg_8 = arg_0 . columns . get_level_values ( 1 ) arg_9 = [ ( f'{x}_{y}' if x else y ) for ( x , y ) in zip ( arg_8 , arg_7 ) ] arg_0 . columns = arg_9 return arg_0

def Func(arg_0, *, arg_1: arg_2[arg_3, arg_4[arg_3]],
            arg_5: arg_6[arg_3, arg_2[arg_3, arg_4[arg_3]]]):
    """
    Aggregate values by groups.

    ---

    ### Parameters

    *mandatory :*
    - `group_cols` (*list*): list of columns used to group data
    - `aggregations` (*dict*): dictionnary of values columns to group as keys and aggregation
      function to use as values (See the [list of aggregation functions](
      https://pandas.pydata.org/pandas-docs/stable/user_guide/Func.html#aggregation))

    ---

    ### Example

    **Input**

    | ENTITY | YEAR | VALUE_1 | VALUE_2 |
    |:------:|:----:|:-------:|:-------:|
    |    A   | 2017 |    10   |    3    |
    |    A   | 2017 |    20   |    1    |
    |    A   | 2018 |    10   |    5    |
    |    A   | 2018 |    30   |    4    |
    |    B   | 2017 |    60   |    4    |
    |    B   | 2017 |    40   |    3    |
    |    B   | 2018 |    50   |    7    |
    |    B   | 2018 |    60   |    6    |

    ```cson
    Func:
      group_cols: ['ENTITY', 'YEAR']
      aggregations:
        'VALUE_1': 'sum',
        'VALUE_2': 'mean'
    ```

    **Output**

    | ENTITY | YEAR | VALUE_1 | VALUE_2 |
    |:------:|:----:|:-------:|:-------:|
    |    A   | 2017 |    30   |   2.0   |
    |    A   | 2018 |    40   |   4.5   |
    |    B   | 2017 |   100   |   3.5   |
    |    B   | 2018 |   110   |   6.5   |

    """
    arg_0 = arg_0.Func(arg_1, as_index=False).agg(arg_5)

    # When several aggregations are performed on the same column, pandas return
    # a multi-indexed dataframe, so we need to flatten the columns index to get
    # back to a unique level header
    if arg_0.columns.nlevels == 2:
        arg_7 = arg_0.columns.get_level_values(0)
        arg_8 = arg_0.columns.get_level_values(1)
        arg_9 = [(f'{x}_{y}' if x else y) for (x, y)
                       in zip(arg_8, arg_7)]
        arg_0.columns = arg_9
    return arg_0

Aggregate values by groups.

    ---

    ### Parameters

    *mandatory :*
    - `group_cols` (*list*): list of columns used to group data
    - `aggregations` (*dict*): dictionnary of values columns to group as keys and aggregation
      function to use as values (See the [list of aggregation functions](
      https://pandas.pydata.org/pandas-docs/stable/user_guide/groupby.html#aggregation))

    ---

    ### Example

    **Input**

    | ENTITY | YEAR | VALUE_1 | VALUE_2 |
    |:------:|:----:|:-------:|:-------:|
    |    A   | 2017 |    10   |    3    |
    |    A   | 2017 |    20   |    1    |
    |    A   | 2018 |    10   |    5    |
    |    A   | 2018 |    30   |    4    |
    |    B   | 2017 |    60   |    4    |
    |    B   | 2017 |    40   |    3    |
    |    B   | 2018 |    50   |    7    |
    |    B   | 2018 |    60   |    6    |

    ```cson
    groupby:
      group_cols: ['ENTITY', 'YEAR']
      aggregations:
        'VALUE_1': 'sum',
        'VALUE_2': 'mean'
    ```

    **Output**

    | ENTITY | YEAR | VALUE_1 | VALUE_2 |
    |:------:|:----:|:-------:|:-------:|
    |    A   | 2017 |    30   |   2.0   |
    |    A   | 2018 |    40   |   4.5   |
    |    B   | 2017 |   100   |   3.5   |
    |    B   | 2018 |   110   |   6.5   |


def Func(arg_0):
    """Parse timezone to offset in seconds.

    Args:
        value: A timezone in the '+0000' format. An integer would also work.

    Returns:
        The timezone offset from GMT in seconds as an integer.
    """
    arg_1 = int(arg_0)
    if arg_1 == 0:
        return 0
    arg_2 = abs(arg_1)
    arg_3 = arg_2*36+(arg_2%100)*24
    return (arg_1//arg_2)*arg_3


(self,
                                      source_dataset,
                                      view_dataset,
                                      view_table,
                                      source_project=None,
                                      view_project=None)

def Func(arg_0,
                                      arg_1,
                                      arg_2,
                                      arg_3,
                                      arg_4=None,
                                      arg_5=None):
        """
        Grant authorized view access of a dataset to a view table.
        If this view has already been granted access to the dataset, do nothing.
        This method is not atomic.  Running it may clobber a simultaneous update.

        :param source_dataset: the source dataset
        :type source_dataset: str
        :param view_dataset: the dataset that the view is in
        :type view_dataset: str
        :param view_table: the table of the view
        :type view_table: str
        :param source_project: the project of the source dataset. If None,
            self.project_id will be used.
        :type source_project: str
        :param view_project: the project that the view is in. If None,
            self.project_id will be used.
        :type view_project: str
        :return: the datasets resource of the source dataset.
        """

        # Apply default values to projects
        arg_4 = arg_4 if arg_4 else arg_0.project_id
        arg_5 = arg_5 if arg_5 else arg_0.project_id

        # we don't want to clobber any existing accesses, so we have to get
        # info on the dataset before we can add view access
        arg_6 = arg_0.service.datasets().get(
            projectId=arg_4, datasetId=arg_1).execute(num_retries=arg_0.num_retries)
        arg_7 = arg_6[
            'access'] if 'access' in arg_6 else []
        arg_8 = {
            'view': {
                'projectId': arg_5,
                'datasetId': arg_2,
                'tableId': arg_3
            }
        }
        # check to see if the view we want to add already exists.
        if arg_8 not in arg_7:
            arg_0.log.info(
                'Granting table %s:%s.%s authorized view access to %s:%s dataset.',
                arg_5, arg_2, arg_3, arg_4,
                arg_1)
            arg_7.append(arg_8)
            return arg_0.service.datasets().patch(
                projectId=arg_4,
                datasetId=arg_1,
                body={
                    'access': arg_7
                }).execute(num_retries=arg_0.num_retries)
        else:
            # if view is already in access, do nothing.
            arg_0.log.info(
                'Table %s:%s.%s already has authorized view access to %s:%s dataset.',
                arg_5, arg_2, arg_3, arg_4, arg_1)
            return arg_6

Grant authorized view access of a dataset to a view table . If this view has already been granted access to the dataset do nothing . This method is not atomic . Running it may clobber a simultaneous update .


(self, column_names=None, selection=None, strings=True, virtual=False)

return dict(self.to_items(column_names=column_names, selection=selection, strings=strings, virtual=virtual))

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False):
        """Return a dict containing the ndarray corresponding to the evaluated data

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :return: dict
        """
        return dict(arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4))


def Func ( arg_0 , arg_1 = 2000 ) : arg_2 = [ ] arg_3 = "" . join ( arg_0 . contigs . values ( ) ) . lower ( ) for arg_4 in range ( 0 , len ( arg_3 ) , arg_1 ) : arg_5 = arg_3 [ arg_4 : arg_4 + arg_1 ] arg_2 . append ( round ( arg_0 . _gc_prop ( arg_5 , len ( arg_5 ) ) , 2 ) ) return arg_2

def Func(arg_0, arg_1=2000):
        """Calculates a sliding window of the GC content for the assembly

        Returns
        -------
        gc_res : list
            List of GC proportion floats for each data point in the sliding
            window
        """

        arg_2 = []

        # Get complete sequence to calculate sliding window values
        arg_3 = "".join(arg_0.contigs.values()).lower()

        for arg_4 in range(0, len(arg_3), arg_1):

            arg_5 = arg_3[arg_4:arg_4 + arg_1]

            # Get GC proportion
            arg_2.append(round(arg_0._gc_prop(arg_5, len(arg_5)), 2))

        return arg_2


(value_and_gradients_function,
                       initial_position,
                       num_correction_pairs,
                       tolerance)

def Func(arg_0,
                       arg_1,
                       arg_2,
                       arg_3):
  """Create LBfgsOptimizerResults with initial state of search procedure."""
  arg_4 = bfgs_utils.get_initial_state_args(
      arg_0,
      arg_1,
      arg_3)
  arg_5 = _make_empty_queue_for(arg_2, arg_1)
  arg_4.update(position_deltas=arg_5, gradient_deltas=arg_5)
  return LBfgsOptimizerResults(**arg_4)

Create LBfgsOptimizerResults with initial state of search procedure .


return cc_hooks.run_hook(hook_name, project_dir, context)

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 == 'post_gen_project' : with temple . utils . cd ( arg_1 ) : temple . utils . write_temple_config ( arg_2 [ 'cookiecutter' ] , arg_2 [ 'template' ] , arg_2 [ 'version' ] ) return cc_hooks . run_hook ( arg_0 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Used to patch cookiecutter's ``run_hook`` function.

    This patched version ensures that the temple.yaml file is created before
    any cookiecutter hooks are executed
    """
    if arg_0 == 'post_gen_project':
        with temple.utils.cd(arg_1):
            temple.utils.write_temple_config(arg_2['cookiecutter'],
                                             arg_2['template'],
                                             arg_2['version'])
    return cc_hooks.run_hook(arg_0, arg_1, arg_2)

Used to patch cookiecutter s run_hook function .


def Func ( arg_0 ) : arg_1 = getpass . getuser ( ) . encode ( 'latin1' ) arg_2 = hashlib . sha256 ( arg_1 ) . hexdigest ( ) [ 0 : 10 ] arg_3 = socket . gethostname ( ) . encode ( 'latin1' ) arg_4 = hashlib . sha256 ( arg_3 ) . hexdigest ( ) [ 0 : 10 ] arg_5 = { 'uuid' : arg_0 . uuid , 'uname' : arg_2 , 'hname' : arg_4 , 'test' : arg_0 . test_mode , 'parsl_v' : arg_0 . parsl_version , 'python_v' : arg_0 . python_version , 'os' : platform . system ( ) , 'os_v' : platform . release ( ) , 'start' : time . time ( ) } return json . dumps ( arg_5 )

def Func(arg_0):
        """Collect preliminary run info at the start of the DFK.

        Returns :
              - Message dict dumped as json string, ready for UDP
        """
        arg_1 = getpass.getuser().encode('latin1')
        arg_2 = hashlib.sha256(arg_1).hexdigest()[0:10]
        arg_3 = socket.gethostname().encode('latin1')
        arg_4 = hashlib.sha256(arg_3).hexdigest()[0:10]
        arg_5 = {'uuid': arg_0.uuid,
                   'uname': arg_2,
                   'hname': arg_4,
                   'test': arg_0.test_mode,
                   'parsl_v': arg_0.parsl_version,
                   'python_v': arg_0.python_version,
                   'os': platform.system(),
                   'os_v': platform.release(),
                   'start': time.time()}

        return json.dumps(arg_5)

Collect preliminary run info at the start of the DFK .


(method, domain, id=None, payload=None, params={},
                 headers={'content-type': 'application/json'},
                 files=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = { } , arg_5 = { 'content-type' : 'application/json' } , arg_6 = None ) : arg_7 = _opts [ 'endpoint' ] + '/api/' + arg_1 if arg_2 is not None : arg_7 += '/' + str ( arg_2 ) if 'api_key' in _opts : arg_4 [ 'api_key' ] = _opts [ 'api_key' ] if arg_0 == 'get' : arg_8 = requests . get ( arg_7 , arg_4 = arg_4 ) elif arg_0 == 'post' : if arg_6 is None and arg_5 [ 'content-type' ] == 'application/json' : arg_8 = requests . post ( arg_7 , arg_4 = arg_4 , arg_5 = arg_5 , data = json . dumps ( arg_3 ) ) else : arg_8 = requests . post ( arg_7 , arg_4 = arg_4 , arg_6 = arg_6 , data = arg_3 ) elif arg_0 == 'put' : arg_8 = requests . put ( arg_7 , arg_4 = arg_4 , arg_5 = arg_5 , data = json . dumps ( arg_3 ) ) elif arg_0 == 'delete' : arg_8 = requests . delete ( arg_7 , arg_4 = arg_4 , arg_5 = arg_5 , data = json . dumps ( arg_3 ) ) if arg_8 . status_code // 100 == 2 : if arg_8 . text and arg_8 . text != '""' : return json . loads ( arg_8 . text ) else : return True else : return json . loads ( arg_8 . text )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4={},
                 arg_5={'content-type': 'application/json'},
                 arg_6=None):
    """
    Send a JSON request.

    Returns True if everything went well, otherwise it returns the status
    code of the response.
    """
    arg_7 = _opts['endpoint'] + '/api/' + arg_1
    if arg_2 is not None:
        arg_7 += '/' + str(arg_2)
    if 'api_key' in _opts:
        arg_4['api_key'] = _opts['api_key']
    if arg_0 == 'get':
        arg_8 = requests.get(arg_7, arg_4=arg_4)
    elif arg_0 == 'post':
        if arg_6 is None and arg_5['content-type'] == 'application/json':
            arg_8 = requests.post(arg_7, arg_4=arg_4, arg_5=arg_5,
                              data=json.dumps(arg_3))
        else:
            arg_8 = requests.post(arg_7, arg_4=arg_4, arg_6=arg_6, data=arg_3)
    elif arg_0 == 'put':
        arg_8 = requests.put(arg_7, arg_4=arg_4, arg_5=arg_5,
                         data=json.dumps(arg_3))
    elif arg_0 == 'delete':
        arg_8 = requests.delete(arg_7, arg_4=arg_4, arg_5=arg_5,
                            data=json.dumps(arg_3))
    if arg_8.status_code // 100 == 2:
        if arg_8.text and arg_8.text != '""':
            return json.loads(arg_8.text)
        else:
            return True
    else:
        return json.loads(arg_8.text)


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
_head_emitted
:
raise
RuntimeError
(
".emit_head() must be called first."
)
arg_2
=
arg_0
.
_emit_element
(
arg_1
,
level
=
1
,
declared_prefixes
=
arg_0
.
_root_prefixes
)
return
remove_evil_characters
(
arg_2
)

def Func(arg_0, arg_1):
        """"Serialize a stanza.

        Must be called after `emit_head`.

        :Parameters:
            - `element`: the element to serialize
        :Types:
            - `element`: :etree:`ElementTree.Element`

        :Return: serialized element
        :Returntype: `unicode`
        """
        if not arg_0._head_emitted:
            raise RuntimeError(".emit_head() must be called first.")
        arg_2 = arg_0._emit_element(arg_1, level = 1,
                                    declared_prefixes = arg_0._root_prefixes)
        return remove_evil_characters(arg_2)


def Func ( arg_0 ) : for arg_1 in sorted ( arg_0 . components . keys ( ) ) : arg_2 = not any ( arg_0 . switches [ a ] [ arg_1 ] for a in arg_0 . analytes ) if arg_2 : arg_0 . remove ( arg_1 )

def Func(arg_0):
        """
        Remove unused filters.
        """
        for arg_1 in sorted(arg_0.components.keys()):
            arg_2 = not any(arg_0.switches[a][arg_1] for a in arg_0.analytes)
            if arg_2:
                arg_0.remove(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
(
"DELETE FROM {} WHERE {}=?"
.
format
(
arg_0
.
__tablename__
,
arg_0
.
__key__
)
,
(
arg_1
,
)
,
)
arg_3
=
sqlite3
.
connect
(
arg_0
.
sqlite_file
)
arg_4
=
arg_3
.
cursor
(
)
arg_4
.
execute
(
*
arg_2
)
arg_3
.
commit
(
)

def Func(arg_0, arg_1):
        """ Delete a key from the store

            :param str value: Value
        """
        arg_2 = (
            "DELETE FROM {} WHERE {}=?".format(arg_0.__tablename__, arg_0.__key__),
            (arg_1,),
        )
        arg_3 = sqlite3.connect(arg_0.sqlite_file)
        arg_4 = arg_3.cursor()
        arg_4.execute(*arg_2)
        arg_3.commit()


def Func ( arg_0 , arg_1 ) : arg_2 = [ getattr ( arg_0 , attr ) for attr in ( 'days' , 'seconds' , 'microseconds' ) ] arg_2 = map ( lambda elem : elem / arg_1 , arg_2 ) return datetime . timedelta ( * arg_2 )

def Func(arg_0, arg_1):
	"""
	Divide a timedelta by a float value

	>>> one_day = datetime.timedelta(days=1)
	>>> half_day = datetime.timedelta(days=.5)
	>>> Func(one_day, 2.0) == half_day
	True
	>>> Func(one_day, 2) == half_day
	True
	"""
	# td is comprised of days, seconds, microseconds
	arg_2 = [getattr(arg_0, attr) for attr in ('days', 'seconds', 'microseconds')]
	arg_2 = map(lambda elem: elem / arg_1, arg_2)
	return datetime.timedelta(*arg_2)

Divide a timedelta by a float value

	>>> one_day = datetime.timedelta(days=1)
	>>> half_day = datetime.timedelta(days=.5)
	>>> divide_timedelta_float(one_day, 2.0) == half_day
	True
	>>> divide_timedelta_float(one_day, 2) == half_day
	True