def Func ( arg_0 ) : arg_0 = round_arr_teff_luminosity ( arg_0 ) arg_1 = arg_0 [ 'temp' ] arg_2 = [ 1.05 * np . amax ( arg_1 ) , .95 * np . amin ( arg_1 ) ] arg_3 = arg_0 [ 'lum' ] arg_4 = [ .50 * np . amin ( arg_3 ) , 2 * np . amax ( arg_3 ) ] return ( arg_2 , arg_4 )

def Func(arg_0):
    """
    Given a numpy array calculate what the ranges of the H-R
    diagram should be.
    """
    arg_0 = round_arr_teff_luminosity(arg_0)
    arg_1 = arg_0['temp']
    arg_2 = [1.05 * np.amax(arg_1), .95 * np.amin(arg_1)]
    arg_3 = arg_0['lum']
    arg_4 = [.50 * np.amin(arg_3), 2 * np.amax(arg_3)]
    return (arg_2, arg_4)

Given a numpy array calculate what the ranges of the H - R diagram should be .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . value_from_object ( arg_1 ) return b64encode ( arg_0 . _dump ( arg_2 ) ) . decode ( 'ascii' )

def Func(arg_0, arg_1):
        """Pickled data is serialized as base64"""
        arg_2 = arg_0.value_from_object(arg_1)
        return b64encode(arg_0._dump(arg_2)).decode('ascii')


def Func(arg_0, arg_1):
        """
        Validate all fields of the document and update the
        messages list with user friendly error messages for display.
        """
        arg_1 = arg_0.Func_version(arg_1)
        arg_1 = arg_0.Func_data_lics(arg_1)
        arg_1 = arg_0.Func_name(arg_1)
        arg_1 = arg_0.Func_spdx_id(arg_1)
        arg_1 = arg_0.Func_namespace(arg_1)
        arg_1 = arg_0.Func_ext_document_references(arg_1)
        arg_1 = arg_0.Func_creation_info(arg_1)
        arg_1 = arg_0.Func_package(arg_1)
        arg_1 = arg_0.Func_extracted_licenses(arg_1)
        arg_1 = arg_0.Func_reviews(arg_1)

        return arg_1

Validate all fields of the document and update the messages list with user friendly error messages for display .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 3 ) : arg_4 = np . std ( arg_0 [ : 5 ] ) for arg_5 in [ 10 , 20 , 30 , 50 ] : arg_6 = np . std ( arg_0 [ : arg_5 ] ) if arg_6 < 1.5 * arg_4 : arg_4 = arg_6 arg_7 = 3 * arg_4 arg_5 = 0 arg_8 = True while ( arg_5 < arg_3 ) and arg_8 : arg_9 = np . roll ( arg_0 * np . exp ( arg_2 * arg_1 ) , 1 ) arg_10 = np . roll ( arg_0 * np . exp ( - arg_2 * arg_1 ) , - 1 ) arg_11 = ( arg_0 < arg_9 - arg_7 ) & ( arg_0 < np . roll ( arg_0 , - 1 ) - arg_7 ) arg_12 = ( arg_0 > arg_10 + arg_7 ) & ( arg_0 > np . roll ( arg_0 , 1 ) + arg_7 ) arg_0 [ arg_11 ] = arg_0 [ np . roll ( arg_11 , - 1 ) ] arg_0 [ arg_12 ] = arg_0 [ np . roll ( arg_12 , - 1 ) ] arg_8 = any ( np . concatenate ( [ arg_11 , arg_12 ] ) ) arg_5 += 1 return arg_0

def Func(arg_0, arg_1, arg_2, arg_3=3):
    """
    Apply exponential decay filter to remove physically impossible data based on instrumental washout.

    The filter is re-applied until no more points are removed, or maxiter is reached.

    Parameters
    ----------
    exponent : float
        Exponent used in filter
    tstep : float
        The time increment between data points.
    maxiter : int
        The maximum number of times the filter should be applied.

    Returns
    -------
    None
    """
    # determine rms noise of data
    arg_4 = np.std(arg_0[:5])  # initially, calculated based on first 5 points
    # expand the selection up to 50 points, unless it dramatically increases
    # the std (i.e. catches the 'laser on' region)
    for arg_5 in [10, 20, 30, 50]:
        arg_6 = np.std(arg_0[:arg_5])
        if arg_6 < 1.5 * arg_4:
            arg_4 = arg_6
    arg_7 = 3 * arg_4

    arg_5 = 0
    arg_8 = True
    while (arg_5 < arg_3) and arg_8:
        # calculate low and high possibles values based on exponential decay
        arg_9 = np.roll(arg_0 * np.exp(arg_2 * arg_1), 1)
        arg_10 = np.roll(arg_0 * np.exp(-arg_2 * arg_1), -1)

        # identify points that are outside these limits, beyond what might be explained
        # by noise in the data
        arg_11 = (arg_0 < arg_9 - arg_7) & (arg_0 < np.roll(arg_0, -1) - arg_7)
        arg_12 = (arg_0 > arg_10 + arg_7) & (arg_0 > np.roll(arg_0, 1) + arg_7)

        # replace all such values with their preceding
        arg_0[arg_11] = arg_0[np.roll(arg_11, -1)]
        arg_0[arg_12] = arg_0[np.roll(arg_12, -1)]

        arg_8 = any(np.concatenate([arg_11, arg_12]))
        arg_5 += 1

    return arg_0

Apply exponential decay filter to remove physically impossible data based on instrumental washout .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_0 . redis . pipeline ( ) for arg_4 in arg_1 : arg_5 = [ AutoCompleter . SUGADD_COMMAND , arg_0 . key , arg_4 . string , arg_4 . score ] if arg_2 . get ( 'increment' ) : arg_5 . append ( AutoCompleter . INCR ) if arg_4 . payload : arg_5 . append ( 'PAYLOAD' ) arg_5 . append ( arg_4 . payload ) arg_3 . execute_command ( * arg_5 ) return arg_3 . execute ( ) [ - 1 ]

def Func(arg_0,  *arg_1, **arg_2):
        """
        Add suggestion terms to the AutoCompleter engine. Each suggestion has a score and string.

        If kwargs['increment'] is true and the terms are already in the server's dictionary, we increment their scores
        """
        arg_3 = arg_0.redis.pipeline()
        for arg_4 in arg_1:
            arg_5 = [AutoCompleter.SUGADD_COMMAND, arg_0.key, arg_4.string, arg_4.score]
            if arg_2.get('increment'):
                arg_5.append(AutoCompleter.INCR)
            if arg_4.payload:
                arg_5.append('PAYLOAD')
                arg_5.append(arg_4.payload)

            arg_3.execute_command(*arg_5)

        return arg_3.execute()[-1]

Add suggestion terms to the AutoCompleter engine . Each suggestion has a score and string .


def Func(arg_0, **arg_1):
        """Construct a full URL that can be used to obtain an authorization
        code from the provider authorization_uri. Use this URI in a client
        frame to cause the provider to generate an authorization code.

        :rtype: str
        """
        if 'response_type' not in arg_1:
            arg_1['response_type'] = arg_0.default_response_type
        arg_1.update({'client_id': arg_0.client_id,
                       'redirect_uri': arg_0.redirect_uri})
        return utils.build_url(arg_0.authorization_uri, arg_1)

Construct a full URL that can be used to obtain an authorization code from the provider authorization_uri . Use this URI in a client frame to cause the provider to generate an authorization code .


def Func ( arg_0 , arg_1 ) : if arg_0 : if arg_1 : return True if len ( arg_1 ) >= 2 : return True return False

def Func(arg_0, arg_1):
    """Check if criterias for Likely Benign are fullfilled

    The following are descriptions of Likely Benign clasification from ACMG paper:

    Likely Benign
      (i) 1 Strong (BS1–BS4) and 1 supporting (BP1– BP7) OR
      (ii) ≥2 Supporting (BP1–BP7)

    Args:
        bs_terms(list(str)): Terms that indicate strong evidence for benign variant
        bp_terms(list(str)): Terms that indicate supporting evidence for benign variant

    Returns:
        bool: if classification indicates Benign level
    """
    if arg_0:
        # Likely Benign (i)
        if arg_1:
            return True
    # Likely Benign (ii)
    if len(arg_1) >= 2:
        return True

    return False


return {
        "protocol": protocol,
        "cipher_suite": cipher_suite,
        "compression": compression,
        "session_id": session_id,
        "session_ticket": session_ticket,
    }

def Func(arg_0, arg_1):
    """
    Parse the TLS handshake from the client to the server to extract information
    including the cipher suite selected, if compression is enabled, the
    session id and if a new or reused session ticket exists.

    :param server_handshake_bytes:
        A byte string of the handshake data received from the server

    :param client_handshake_bytes:
        A byte string of the handshake data sent to the server

    :return:
        A dict with the following keys:
         - "protocol": unicode string
         - "cipher_suite": unicode string
         - "compression": boolean
         - "session_id": "new", "reused" or None
         - "session_ticket: "new", "reused" or None
    """

    arg_2 = None
    arg_3 = None
    arg_4 = False
    arg_5 = None
    arg_6 = None

    arg_7 = None
    arg_8 = None

    for arg_9, arg_10, arg_11 in parse_tls_records(arg_0):
        if arg_9 != b'\x16':
            continue
        for arg_12, arg_13 in parse_handshake_messages(arg_11):
            # Ensure we are working with a ServerHello message
            if arg_12 != b'\x02':
                continue
            arg_2 = {
                b'\x03\x00': "SSLv3",
                b'\x03\x01': "TLSv1",
                b'\x03\x02': "TLSv1.1",
                b'\x03\x03': "TLSv1.2",
                b'\x03\x04': "TLSv1.3",
            }[arg_13[0:2]]

            arg_14 = int_from_bytes(arg_13[34:35])
            if arg_14 > 0:
                arg_7 = arg_13[35:35 + arg_14]

            arg_15 = 35 + arg_14
            arg_16 = arg_13[arg_15:arg_15 + 2]
            arg_3 = CIPHER_SUITE_MAP[arg_16]

            arg_17 = arg_15 + 2
            arg_4 = arg_13[arg_17:arg_17 + 1] != b'\x00'

            arg_18 = arg_17 + 1
            arg_19 = arg_13[arg_18:]
            for arg_20, arg_21 in _parse_hello_extensions(arg_19):
                if arg_20 == 35:
                    arg_6 = "new"
                    break
            break

    for arg_9, arg_10, arg_11 in parse_tls_records(arg_1):
        if arg_9 != b'\x16':
            continue
        for arg_12, arg_13 in parse_handshake_messages(arg_11):
            # Ensure we are working with a ClientHello message
            if arg_12 != b'\x01':
                continue

            arg_14 = int_from_bytes(arg_13[34:35])
            if arg_14 > 0:
                arg_8 = arg_13[35:35 + arg_14]

            arg_15 = 35 + arg_14
            arg_22 = int_from_bytes(arg_13[arg_15:arg_15 + 2])

            arg_17 = arg_15 + 2 + arg_22
            arg_23 = int_from_bytes(arg_13[arg_17:arg_17 + 1])

            # On subsequent requests, the session ticket will only be seen
            # in the ClientHello message
            if arg_7 is None and arg_6 is None:
                arg_18 = arg_17 + 1 + arg_23
                arg_19 = arg_13[arg_18:]
                for arg_20, arg_21 in _parse_hello_extensions(arg_19):
                    if arg_20 == 35:
                        arg_6 = "reused"
                        break
            break

    if arg_7 is not None:
        if arg_8 is None:
            arg_5 = "new"
        else:
            if arg_8 != arg_7:
                arg_5 = "new"
            else:
                arg_5 = "reused"

    return {
        "protocol": arg_2,
        "cipher_suite": arg_3,
        "compression": arg_4,
        "session_id": arg_5,
        "session_ticket": arg_6,
    }

Parse the TLS handshake from the client to the server to extract information including the cipher suite selected if compression is enabled the session id and if a new or reused session ticket exists .


def Func ( arg_0 , arg_1 ) : global arg_2 if arg_2 is None : arg_2 = PipelineStages ( ) arg_3 = arg_2 if 'external_stages_path' in arg_0 : arg_4 = arg_0 [ 'external_stages_path' ] if not os . path . isabs ( arg_4 ) and arg_0 . get ( 'root_path' ) : arg_4 = os . path . join ( arg_0 [ 'root_path' ] , arg_4 ) try : arg_3 . load_external_stages ( arg_0 [ 'external_stages_path' ] ) except IOError : return streamcorpus_pipeline if 'external_stages_modules' in arg_0 : for arg_5 in arg_0 [ 'external_stages_modules' ] : try : arg_3 . load_module_stages ( arg_5 ) except ImportError : return streamcorpus_pipeline else : arg_3 = arg_2 arg_6 = set ( stage for stage in arg_3 . itervalues ( ) if hasattr ( stage , 'config_name' ) ) return NewSubModules ( streamcorpus_pipeline , arg_6 )

def Func(arg_0, arg_1):
    '''Replace the top-level pipeline configurable object.

    This investigates a number of sources, including
    `external_stages_path` and `external_stages_modules` configuration
    and `streamcorpus_pipeline.stages` entry points, and uses these to
    find the actual :data:`sub_modules` for
    :mod:`streamcorpus_pipeline`.

    '''
    global arg_2
    if arg_2 is None:
        arg_2 = PipelineStages()
        arg_3 = arg_2
        if 'external_stages_path' in arg_0:
            arg_4 = arg_0['external_stages_path']
            if not os.path.isabs(arg_4) and arg_0.get('root_path'):
                arg_4 = os.path.join(arg_0['root_path'], arg_4)
            try:
                arg_3.load_external_stages(arg_0['external_stages_path'])
            except IOError:
                return streamcorpus_pipeline  # let check_config re-raise this
        if 'external_stages_modules' in arg_0:
            for arg_5 in arg_0['external_stages_modules']:
                try:
                    arg_3.load_module_stages(arg_5)
                except ImportError:
                    return streamcorpus_pipeline  # let check_config re-raise this
    else:
        arg_3 = arg_2

    arg_6 = set(stage
                          for stage in arg_3.itervalues()
                          if hasattr(stage, 'config_name'))
    return NewSubModules(streamcorpus_pipeline, arg_6)

Replace the top - level pipeline configurable object .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = ( 'book' , arg_1 ) arg_0 . _unsubscribe ( 'book' , arg_3 , symbol = arg_1 , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Unsubscribe to the passed pair's order book channel.

        :param pair: str, Symbol pair to request data for
        :param kwargs:
        :return:
        """
        arg_3 = ('book', arg_1)
        arg_0._unsubscribe('book', arg_3, symbol=arg_1, **arg_2)

Unsubscribe to the passed pair s order book channel .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
split_contents
(
)
if
len
(
arg_2
)
>
1
:
raise
TemplateSyntaxError
(
"'%s' takes no arguments"
%
arg_2
[
0
]
)
return
OlarkNode
(
)

def Func(arg_0, arg_1):
    """
    Olark set-up template tag.

    Renders Javascript code to set-up Olark chat.  You must supply
    your site ID in the ``OLARK_SITE_ID`` setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return OlarkNode()


def Func ( arg_0 , arg_1 = "seuclidean" ) : arg_2 = distance . pdist ( arg_0 , arg_1 = arg_1 ) arg_2 = distance . squareform ( arg_2 ) arg_2 /= arg_2 . max ( ) return 1 - arg_2

def Func(arg_0, arg_1="seuclidean"):
    """Computes the self-similarity matrix of X."""
    arg_2 = distance.pdist(arg_0, arg_1=arg_1)
    arg_2 = distance.squareform(arg_2)
    arg_2 /= arg_2.max()
    return 1 - arg_2

Computes the self - similarity matrix of X .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"execute: %s"
,
arg_1
.
get
(
'content'
,
''
)
)
arg_2
=
arg_1
[
'parent_header'
]
[
'msg_id'
]
arg_3
=
arg_0
.
_request_info
[
'execute'
]
.
get
(
arg_2
)
arg_0
.
_reading
=
False
if
arg_3
and
arg_3
.
kind
==
'user'
and
not
arg_0
.
_hidden
:
arg_0
.
kernel_manager
.
sub_channel
.
flush
(
)
if
arg_0
.
ansi_codes
:
arg_0
.
_ansi_processor
.
reset_sgr
(
)
arg_5
=
arg_1
[
'content'
]
arg_6
=
arg_5
[
'status'
]
if
arg_6
==
'ok'
:
arg_0
.
_process_execute_ok
(
arg_1
)
elif
arg_6
==
'error'
:
arg_0
.
_process_execute_error
(
arg_1
)
elif
arg_6
==
'aborted'
:
arg_0
.
_process_execute_abort
(
arg_1
)
arg_0
.
_show_interpreter_prompt_for_reply
(
arg_1
)
arg_0
.
executed
.
emit
(
arg_1
)
arg_0
.
_request_info
[
'execute'
]
.
pop
(
arg_2
)
elif
arg_3
and
arg_3
.
kind
==
'silent_exec_callback'
and
not
arg_0
.
_hidden
:
arg_0
.
_handle_exec_callback
(
arg_1
)
arg_0
.
_request_info
[
'execute'
]
.
pop
(
arg_2
)
else
:
super
(
FrontendWidget
,
arg_0
)
.
Func
(
arg_1
)

def Func(arg_0, arg_1):
        """ Handles replies for code execution.
        """
        arg_0.log.debug("execute: %s", arg_1.get('content', ''))
        arg_2 = arg_1['parent_header']['msg_id']
        arg_3 = arg_0._request_info['execute'].get(arg_2)
        # unset reading flag, because if execute finished, raw_input can't
        # still be pending.
        arg_0._reading = False
        if arg_3 and arg_3.kind == 'user' and not arg_0._hidden:
            # Make sure that all output from the SUB channel has been processed
            # before writing a new prompt.
            arg_0.kernel_manager.sub_channel.flush()

            # Reset the ANSI style information to prevent bad text in stdout
            # from messing up our colors. We're not a true terminal so we're
            # allowed to do this.
            if arg_0.ansi_codes:
                arg_0._ansi_processor.reset_sgr()

            arg_5 = arg_1['content']
            arg_6 = arg_5['status']
            if arg_6 == 'ok':
                arg_0._process_execute_ok(arg_1)
            elif arg_6 == 'error':
                arg_0._process_execute_error(arg_1)
            elif arg_6 == 'aborted':
                arg_0._process_execute_abort(arg_1)

            arg_0._show_interpreter_prompt_for_reply(arg_1)
            arg_0.executed.emit(arg_1)
            arg_0._request_info['execute'].pop(arg_2)
        elif arg_3 and arg_3.kind == 'silent_exec_callback' and not arg_0._hidden:
            arg_0._handle_exec_callback(arg_1)
            arg_0._request_info['execute'].pop(arg_2)
        else:
            super(FrontendWidget, arg_0).Func(arg_1)


def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_0 . is_superuser and arg_2 : return True return arg_0 . groups . filter ( name = arg_1 ) . exists ( )

def Func(arg_0, arg_1, arg_2=True):
    """
    Check if a user is in a certaing group.
    By default, the check is skipped for superusers.
    """

    if arg_0.is_superuser and arg_2:
        return True

    return arg_0.groups.filter(name=arg_1).exists()

Check if a user is in a certaing group . By default the check is skipped for superusers .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] with open ( os . path . join ( arg_0 , arg_1 ) , 'r' ) as f : arg_2 = [ int ( line . split ( ) [ 0 ] ) for line in f ] return torch . LongTensor ( arg_2 )

def Func(arg_0, arg_1):
    """Return a Tensor containing the list of labels
       Read the file and keep only the ID of the 3D point.
    """
    arg_2 = []
    with open(os.path.join(arg_0, arg_1), 'r') as f:
        arg_2 = [int(line.split()[0]) for line in f]
    return torch.LongTensor(arg_2)

Return a Tensor containing the list of labels Read the file and keep only the ID of the 3D point .


def Func ( arg_0 , arg_1 ) : arg_2 = None arg_3 = arg_1 . lower ( ) for arg_4 in arg_0 . sorted_share_list : if arg_4 == "/" : arg_2 = arg_4 break elif arg_3 == arg_4 or arg_3 . startswith ( arg_4 + "/" ) : arg_2 = arg_4 break if arg_2 is None : return None , None return arg_2 , arg_0 . provider_map . get ( arg_2 )

def Func(arg_0, arg_1):
        """Get the registered DAVProvider for a given path.

        Returns:
            tuple: (share, provider)
        """
        # Find DAV provider that matches the share
        arg_2 = None
        arg_3 = arg_1.lower()
        for arg_4 in arg_0.sorted_share_list:
            # @@: Case sensitivity should be an option of some sort here;
            # os.path.normpath might give the preferred case for a filename.
            if arg_4 == "/":
                arg_2 = arg_4
                break
            elif arg_3 == arg_4 or arg_3.startswith(arg_4 + "/"):
                arg_2 = arg_4
                break

        if arg_2 is None:
            return None, None
        return arg_2, arg_0.provider_map.get(arg_2)

Get the registered DAVProvider for a given path .


def Func(arg_0, arg_1, arg_2=True):
        """Return the SVG dict for the SVGBuilder.

        :param instruction_or_id: the instruction or id, see
          :meth:`get_instruction_id`
        :param bool copy_result: whether to copy the result
        :rtype: dict

        The result is cached.
        """
        arg_3 = arg_0.get_instruction_id(arg_1)
        if arg_3 in arg_0._cache:
            arg_4 = arg_0._cache[arg_3]
        else:
            arg_4 = arg_0._Func(arg_3)
            arg_0._cache[arg_3] = arg_4
        if arg_2:
            arg_4 = deepcopy(arg_4)
        return arg_4

Return the SVG dict for the SVGBuilder .


def Func ( arg_0 , arg_1 , arg_2 ) : with arg_0 . engine . begin ( ) as db : return delete_single_remote_checkpoint ( db , arg_0 . user_id , arg_2 , arg_1 , )

def Func(arg_0, arg_1, arg_2):
        """delete a checkpoint for a file"""
        with arg_0.engine.begin() as db:
            return delete_single_remote_checkpoint(
                db, arg_0.user_id, arg_2, arg_1,
            )


def
Func
(
arg_0
,
arg_1
=
60
)
:
while
(
'  '
in
arg_0
)
and
(
len
(
arg_0
)
>
arg_1
)
:
arg_2
,
arg_3
,
arg_4
=
arg_0
.
rpartition
(
'  '
)
arg_0
=
' '
.
join
(
(
arg_2
,
arg_4
)
)
return
arg_0

def Func(arg_0, arg_1=60):
        """ Remove spaces in between words until it is small enough for
            `width`.
            This will always leave at least one space between words,
            so it may not be able to get below `width` characters.
        """
        # Start removing spaces to "squeeze" the text, leaving at least one.
        while ('  ' in arg_0) and (len(arg_0) > arg_1):
            # Remove two spaces from the end, replace with one.
            arg_2, arg_3, arg_4 = arg_0.rpartition('  ')
            arg_0 = ' '.join((arg_2, arg_4))
        return arg_0

Remove spaces in between words until it is small enough for width . This will always leave at least one space between words so it may not be able to get below width characters .


def
Func
(
arg_0
,
arg_1
=
0
)
:
def
_rmjunctions
(
arg_2
)
:
arg_3
=
[
]
for
arg_4
in
os
.
listdir
(
arg_2
)
:
arg_5
=
join
(
arg_2
,
arg_4
)
if
os
.
path
.
isdir
(
arg_5
)
:
if
_win32_is_junction
(
arg_5
)
:
os
.
rmdir
(
arg_5
)
elif
not
os
.
path
.
islink
(
arg_5
)
:
arg_3
.
append
(
arg_5
)
for
arg_6
in
arg_3
:
_rmjunctions
(
arg_6
)
if
_win32_is_junction
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting <JUNCTION> directory="{}"'
.
format
(
arg_0
)
)
os
.
rmdir
(
arg_0
)
else
:
if
arg_1
:
print
(
'Deleting directory="{}"'
.
format
(
arg_0
)
)
_rmjunctions
(
arg_0
)
import
shutil
shutil
.
rmtree
(
arg_0
)

def Func(arg_0, arg_1=0):
    """
    rmtree for win32 that treats junctions like directory symlinks.
    The junction removal portion may not be safe on race conditions.

    There is a known issue that prevents shutil.rmtree from
    deleting directories with junctions.
    https://bugs.python.org/issue31226
    """

    # --- old version using the shell ---
    # def _rmjunctions(root):
    #     subdirs = []
    #     for type_or_size, name, pointed in _win32_dir(root):
    #         if type_or_size == '<DIR>':
    #             subdirs.append(name)
    #         elif type_or_size == '<JUNCTION>':
    #             # remove any junctions as we encounter them
    #             # os.unlink(join(root, name))
    #             os.rmdir(join(root, name))
    #     # recurse in all real directories
    #     for name in subdirs:
    #         _rmjunctions(join(root, name))

    def _rmjunctions(arg_2):
        arg_3 = []
        for arg_4 in os.listdir(arg_2):
            arg_5 = join(arg_2, arg_4)
            if os.path.isdir(arg_5):
                if _win32_is_junction(arg_5):
                    # remove any junctions as we encounter them
                    os.rmdir(arg_5)
                elif not os.path.islink(arg_5):
                    arg_3.append(arg_5)
        # recurse in all real directories
        for arg_6 in arg_3:
            _rmjunctions(arg_6)

    if _win32_is_junction(arg_0):
        if arg_1:
            print('Deleting <JUNCTION> directory="{}"'.format(arg_0))
        os.rmdir(arg_0)
    else:
        if arg_1:
            print('Deleting directory="{}"'.format(arg_0))
        # first remove all junctions
        _rmjunctions(arg_0)
        # now we can rmtree as normal
        import shutil
        shutil.rmtree(arg_0)

rmtree for win32 that treats junctions like directory symlinks . The junction removal portion may not be safe on race conditions .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . command ( "QUIT" ) if arg_1 != 205 : raise NNTPReplyError ( arg_1 , arg_2 ) arg_0 . socket . close ( )

def Func(arg_0):
        """QUIT command.

        Tells the server to close the connection. After the server acknowledges
        the request to Func the connection is closed both at the server and
        client. Only useful for graceful shutdown. If you are in a generator
        use close() instead.

        Once this method has been called, no other methods of the NNTPClient
        object should be called.

        See <http://tools.ietf.org/html/rfc3977#section-5.4>
        """
        arg_1, arg_2 = arg_0.command("QUIT")
        if arg_1 != 205:
            raise NNTPReplyError(arg_1, arg_2)

        arg_0.socket.close()

QUIT command.

        Tells the server to close the connection. After the server acknowledges
        the request to quit the connection is closed both at the server and
        client. Only useful for graceful shutdown. If you are in a generator
        use close() instead.

        Once this method has been called, no other methods of the NNTPClient
        object should be called.

        See <http://tools.ietf.org/html/rfc3977#section-5.4>


def Func(arg_0, arg_1, arg_2):
    """Returns a first index>=start of chat not in charset"""
    while arg_1 < len(arg_0) and arg_0[arg_1] in arg_2:
        arg_1 += 1
    return arg_1

Returns a first index > = start of chat not in charset


def
Func
(
arg_0
)
:
if
arg_0
.
has_Func
:
return
arg_0
.
_impl
[
OBJ
]
.
get_Func
(
arg_0
.
_impl
[
KEY
]
)
else
:
raise
ValueError
(
"Value not found"
)

def Func(arg_0):
        """Return the Func of the cells."""
        if arg_0.has_Func:
            return arg_0._impl[OBJ].get_Func(arg_0._impl[KEY])
        else:
            raise ValueError("Value not found")


def Func ( arg_0 ) : if ( PyFunceble . CONFIGURATION [ "show_percentage" ] and PyFunceble . INTERN [ "counter" ] [ "number" ] [ "tested" ] > 0 ) : arg_1 = ( PyFunceble . OUTPUT_DIRECTORY + PyFunceble . OUTPUTS [ "parent_directory" ] + PyFunceble . OUTPUTS [ "Funcs" ] [ "directories" ] [ "parent" ] + PyFunceble . OUTPUTS [ "Funcs" ] [ "directories" ] [ "percentage" ] + PyFunceble . OUTPUTS [ "Funcs" ] [ "filenames" ] [ "percentage" ] ) File ( arg_1 ) . delete ( ) arg_0 . _calculate ( ) if not PyFunceble . CONFIGURATION [ "quiet" ] : print ( "\n" ) Prints ( None , "Percentage" , arg_1 ) . header ( ) arg_2 = [ [ PyFunceble . STATUS [ "official" ] [ "up" ] , str ( PyFunceble . INTERN [ "counter" ] [ "percentage" ] [ "up" ] ) + "%" , PyFunceble . INTERN [ "counter" ] [ "number" ] [ "up" ] , ] , [ PyFunceble . STATUS [ "official" ] [ "down" ] , str ( PyFunceble . INTERN [ "counter" ] [ "percentage" ] [ "down" ] ) + "%" , PyFunceble . INTERN [ "counter" ] [ "number" ] [ "down" ] , ] , [ PyFunceble . STATUS [ "official" ] [ "invalid" ] , str ( PyFunceble . INTERN [ "counter" ] [ "percentage" ] [ "invalid" ] ) + "%" , PyFunceble . INTERN [ "counter" ] [ "number" ] [ "invalid" ] , ] , ] if PyFunceble . CONFIGURATION [ "syntax" ] : arg_2 [ 0 ] [ 0 ] = PyFunceble . STATUS [ "official" ] [ "valid" ] del arg_2 [ 1 ] for arg_3 in arg_2 : Prints ( arg_3 , "Percentage" , arg_1 ) . data ( ) elif PyFunceble . INTERN [ "counter" ] [ "number" ] [ "tested" ] > 0 : arg_0 . _calculate ( )

def Func(arg_0):
        """
        Print on screen and on file the percentages for each status.
        """

        if (
            PyFunceble.CONFIGURATION["show_percentage"]
            and PyFunceble.INTERN["counter"]["number"]["tested"] > 0
        ):
            # * We are allowed to show the percentage on screen.
            # and
            # * The number of tested is greater than 0.

            # We initiate the output file.
            arg_1 = (
                PyFunceble.OUTPUT_DIRECTORY
                + PyFunceble.OUTPUTS["parent_directory"]
                + PyFunceble.OUTPUTS["Funcs"]["directories"]["parent"]
                + PyFunceble.OUTPUTS["Funcs"]["directories"]["percentage"]
                + PyFunceble.OUTPUTS["Funcs"]["filenames"]["percentage"]
            )

            # We delete the output file if it does exist.
            File(arg_1).delete()

            # We calculate the percentage of each statuses.
            arg_0._calculate()

            if not PyFunceble.CONFIGURATION["quiet"]:
                # The quiet mode is activated.

                # We print a new line.
                print("\n")

                # We print the percentage header on file and screen.
                Prints(None, "Percentage", arg_1).header()

                # We construct the different lines/data to print on screen and file.
                arg_2 = [
                    [
                        PyFunceble.STATUS["official"]["up"],
                        str(PyFunceble.INTERN["counter"]["percentage"]["up"]) + "%",
                        PyFunceble.INTERN["counter"]["number"]["up"],
                    ],
                    [
                        PyFunceble.STATUS["official"]["down"],
                        str(PyFunceble.INTERN["counter"]["percentage"]["down"]) + "%",
                        PyFunceble.INTERN["counter"]["number"]["down"],
                    ],
                    [
                        PyFunceble.STATUS["official"]["invalid"],
                        str(PyFunceble.INTERN["counter"]["percentage"]["invalid"])
                        + "%",
                        PyFunceble.INTERN["counter"]["number"]["invalid"],
                    ],
                ]

                if PyFunceble.CONFIGURATION["syntax"]:
                    # We are checking for syntax.

                    # We update the denomination of the UP.
                    arg_2[0][0] = PyFunceble.STATUS["official"]["valid"]

                    # And we unset the INACTIVE line.
                    del arg_2[1]

                for arg_3 in arg_2:
                    # We loop throught the different line to print.
                    # (one line for each status.)

                    # And we print the current status line on file and screen.
                    Prints(arg_3, "Percentage", arg_1).data()

        elif PyFunceble.INTERN["counter"]["number"]["tested"] > 0:
            # * We are not allowed to show the percentage on screen.
            # but
            # * The number of tested is greater than 0.

            # We run the calculation.
            # Note: The following is needed, because all counter calculation are
            # done by this class.
            arg_0._calculate()

Print on screen and on file the percentages for each status .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . preFuncors : arg_1 = arg_2 . Func ( arg_1 = arg_1 ) return arg_1

def Func(arg_0, arg_1):
        """
        Process state.

        Args:
            tensor: tensor to Func

        Returns: Funced state

        """
        for arg_2 in arg_0.preFuncors:
            arg_1 = arg_2.Func(arg_1=arg_1)
        return arg_1

Process state.

        Args:
            tensor: tensor to process

        Returns: processed state


(long_exposures, short_exposures,
                                    sector_dict=SECTORS, ax=None)

def Func(arg_0, arg_1,
                                    arg_2=arg_3, arg_4=None):
    """
    Plots outputs of compute_sector_exposures as area charts

    Parameters
    ----------
    long_exposures, short_exposures : arrays
        Arrays of long and short sector exposures (output of
        compute_sector_exposures).

    sector_dict : dict or OrderedDict
        Dictionary of all sectors
        - See full description in compute_sector_exposures
    """

    if arg_4 is None:
        arg_4 = plt.gca()

    if arg_2 is None:
        arg_5 = arg_3.values()
    else:
        arg_5 = arg_2.values()

    arg_6 = plt.cm.gist_rainbow(np.linspace(0, 1, 11))

    arg_4.stackplot(arg_0[0].index, arg_0,
                 labels=arg_5, colors=arg_6, alpha=0.8,
                 baseline='zero')
    arg_4.stackplot(arg_0[0].index, arg_1,
                 colors=arg_6, alpha=0.8, baseline='zero')
    arg_4.axhline(0, color='k', linestyle='-')
    arg_4.set(title='Long and short exposures to sectors',
           ylabel='Proportion of long/short exposure in sectors')
    arg_4.legend(loc='upper left', frameon=True, framealpha=0.5)

    return arg_4


return H2OFrame._expr(expr=ExprNode("table", self, data2, dense)) if data2 is not None else H2OFrame._expr(
            expr=ExprNode("table", self, dense))

def Func ( arg_0 , arg_1 = None , arg_2 = True ) : return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_1 , arg_2 ) ) if arg_1 is not None else H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , arg_2 ) )

def Func(arg_0, arg_1=None, arg_2=True):
        """
        Compute the counts of values appearing in a column, or co-occurence counts between two columns.

        :param H2OFrame data2: An optional single column to aggregate counts by.
        :param bool dense: If True (default) then use dense representation, which lists only non-zero counts,
            1 combination per row. Set to False to expand counts across all combinations.

        :returns: H2OFrame of the counts at each combination of factor levels
        """
        return H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1, arg_2)) if arg_1 is not None else H2OFrame._expr(
            expr=ExprNode("Func", arg_0, arg_2))

Compute the counts of values appearing in a column or co - occurence counts between two columns .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = itertools . chain ( list ( arg_0 . unnamed_requirements ) , list ( arg_0 . requirements . values ( ) ) , arg_2 ) for arg_4 in arg_3 : arg_5 = arg_1 ( arg_4 ) if arg_5 : arg_2 . extend ( arg_5 )

def Func(arg_0, arg_1):
        """Call handler for all pending reqs.

        :param handler: Handle a single requirement. Should take a requirement
            to install. Can optionally return an iterable of additional
            InstallRequirements to cover.
        """
        # The list() here is to avoid potential mutate-while-iterating bugs.
        arg_2 = []
        arg_3 = itertools.chain(
            list(arg_0.unnamed_requirements), list(arg_0.requirements.values()),
            arg_2)
        for arg_4 in arg_3:
            arg_5 = arg_1(arg_4)
            if arg_5:
                arg_2.extend(arg_5)


def Func ( arg_0 , arg_1 ) : arg_2 = [ _node for _node in arg_0 . _return_nodes [ arg_1 . name ] if _node . value is not None ] if not arg_2 : return if len ( arg_2 ) == len ( arg_0 . _return_nodes [ arg_1 . name ] ) and arg_0 . _is_node_return_ended ( arg_1 ) : return arg_0 . add_message ( "inconsistent-return-statements" , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Check that all return statements inside a function are consistent.

        Return statements are consistent if:
            - all returns are explicit and if there is no implicit return;
            - all returns are empty and if there is, possibly, an implicit return.

        Args:
            node (astroid.FunctionDef): the function holding the return statements.

        """
        # explicit return statements are those with a not None value
        arg_2 = [
            _node for _node in arg_0._return_nodes[arg_1.name] if _node.value is not None
        ]
        if not arg_2:
            return
        if len(arg_2) == len(
            arg_0._return_nodes[arg_1.name]
        ) and arg_0._is_node_return_ended(arg_1):
            return
        arg_0.add_message("inconsistent-return-statements", arg_1=arg_1)

Check that all return statements inside a function are consistent .


def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , arg_0 . SF == False , 1 , 0 ) )

def Func(arg_0, arg_1):
        """
        Sets byte if not sign.

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_1.write(Operators.ITEBV(arg_1.size, arg_0.SF == False, 1, 0))


(port, chip, pin_function_maps, event_queue,
                      return_after_kbdint=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = False ) : arg_5 = open ( GPIO_INTERRUPT_DEVICE_VALUE , 'r' ) arg_6 = select . epoll ( ) arg_6 . register ( arg_5 , select . EPOLLIN | select . EPOLLET ) while True : try : arg_7 = arg_6 . poll ( ) except KeyboardInterrupt as e : if arg_4 : return else : raise e except IOError as e : if e . errno != errno . EINTR : raise if arg_0 == pifacecommon . mcp23s17 . GPIOA : arg_8 = arg_1 . intfa . value else : arg_8 = arg_1 . intfb . value if arg_8 == 0 : continue else : if arg_0 == pifacecommon . mcp23s17 . GPIOA : arg_9 = arg_1 . intcapa . value else : arg_9 = arg_1 . intcapb . value arg_3 . add_event ( InterruptEvent ( arg_8 , arg_9 , arg_1 , time . time ( ) ) ) arg_6 . close ( )

def Func(arg_0, arg_1, arg_2, arg_3,
                      arg_4=False):
    """Waits for a port event. When a port event occurs it is placed onto the
    event queue.

    :param port: The port we are waiting for interrupts on (GPIOA/GPIOB).
    :type port: int
    :param chip: The chip we are waiting for interrupts on.
    :type chip: :class:`pifacecommon.mcp23s17.MCP23S17`
    :param pin_function_maps: A list of classes that have inheritted from
        :class:`FunctionMap`\ s describing what to do with events.
    :type pin_function_maps: list
    :param event_queue: A queue to put events on.
    :type event_queue: :py:class:`multiprocessing.Queue`
    """
    # set up epoll
    arg_5 = open(GPIO_INTERRUPT_DEVICE_VALUE, 'r')  # change to use 'with'?
    arg_6 = select.epoll()
    arg_6.register(arg_5, select.EPOLLIN | select.EPOLLET)

    while True:
        # wait here until input
        try:
            arg_7 = arg_6.poll()
        except KeyboardInterrupt as e:
            if arg_4:
                return
            else:
                raise e
        except IOError as e:
            # ignore "Interrupted system call" error.
            # I don't really like this solution. Ignoring problems is bad!
            if e.errno != errno.EINTR:
                raise

        # find out where the interrupt came from and put it on the event queue
        if arg_0 == pifacecommon.mcp23s17.GPIOA:
            arg_8 = arg_1.intfa.value
        else:
            arg_8 = arg_1.intfb.value

        if arg_8 == 0:
            continue  # The interrupt has not been flagged on this board
        else:
            if arg_0 == pifacecommon.mcp23s17.GPIOA:
                arg_9 = arg_1.intcapa.value
            else:
                arg_9 = arg_1.intcapb.value
            arg_3.add_event(InterruptEvent(
                arg_8, arg_9, arg_1, time.time()))

    arg_6.close()

Waits for a port event . When a port event occurs it is placed onto the event queue .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_2 = arg_2 or [ ] arg_1 [ 'has_refseq' ] = False arg_3 = { } for arg_4 in arg_2 : for arg_5 in arg_4 [ 'genes' ] : arg_6 = arg_5 [ 'hgnc_id' ] if arg_6 not in arg_3 : arg_3 [ arg_6 ] = [ ] arg_3 [ arg_6 ] . append ( arg_5 ) for arg_7 in arg_1 . get ( 'genes' , [ ] ) : arg_6 = arg_7 [ 'hgnc_id' ] arg_8 = arg_0 . hgnc_gene ( arg_6 ) if not arg_8 : continue arg_9 = { } for arg_10 in arg_8 . get ( 'transcripts' , [ ] ) : arg_11 = arg_10 [ 'ensembl_transcript_id' ] arg_9 [ arg_11 ] = arg_10 arg_8 [ 'transcripts_dict' ] = arg_9 if arg_8 . get ( 'incomplete_penetrance' ) : arg_7 [ 'omim_penetrance' ] = True arg_12 = arg_3 . get ( arg_6 , [ ] ) arg_13 = set ( ) arg_14 = set ( ) arg_15 = False arg_16 = False arg_17 = set ( ) for arg_5 in arg_12 : for arg_18 in arg_5 . get ( 'disease_associated_transcripts' , [ ] ) : arg_19 = re . sub ( r'\.[0-9]' , '' , arg_18 ) arg_14 . add ( arg_19 ) arg_13 . add ( arg_18 ) if arg_5 . get ( 'reduced_penetrance' ) : arg_15 = True if arg_5 . get ( 'mosaicism' ) : arg_16 = True arg_17 . update ( arg_5 . get ( 'inheritance_models' , [ ] ) ) arg_7 [ 'disease_associated_transcripts' ] = list ( arg_13 ) arg_7 [ 'manual_penetrance' ] = arg_15 arg_7 [ 'mosaicism' ] = arg_16 arg_7 [ 'manual_inheritance' ] = list ( arg_17 ) for arg_10 in arg_7 . get ( 'transcripts' , [ ] ) : arg_11 = arg_10 [ 'transcript_id' ] if not arg_11 in arg_9 : continue arg_20 = arg_9 [ arg_11 ] if arg_20 . get ( 'is_primary' ) : arg_10 [ 'is_primary' ] = True if not arg_20 . get ( 'refseq_id' ) : continue arg_21 = arg_20 [ 'refseq_id' ] arg_10 [ 'refseq_id' ] = arg_21 arg_1 [ 'has_refseq' ] = True if arg_21 in arg_14 : arg_10 [ 'is_disease_associated' ] = True arg_10 [ 'refseq_identifiers' ] = arg_20 . get ( 'refseq_identifiers' , [ ] ) arg_7 [ 'common' ] = arg_8 arg_7 [ 'disease_terms' ] = arg_0 . disease_terms ( arg_6 ) return arg_1

def Func(arg_0, arg_1, arg_2=None):
        """Add extra information about genes from gene panels

        Args:
            variant_obj(dict): A variant from the database
            gene_panels(list(dict)): List of panels from database
        """
        arg_2 = arg_2 or []

        # Add a variable that checks if there are any refseq transcripts
        arg_1['has_refseq'] = False

        # We need to check if there are any additional information in the gene panels

        # extra_info will hold information from gene panels
        # Collect all extra info from the panels in a dictionary with hgnc_id as keys
        arg_3 = {}
        for arg_4 in arg_2:
            for arg_5 in arg_4['genes']:
                arg_6 = arg_5['hgnc_id']
                if arg_6 not in arg_3:
                    arg_3[arg_6] = []

                arg_3[arg_6].append(arg_5)

        # Loop over the genes in the variant object to add information
        # from hgnc_genes and panel genes to the variant object
        for arg_7 in arg_1.get('genes', []):
            arg_6 = arg_7['hgnc_id']
            # Get the hgnc_gene
            arg_8 = arg_0.hgnc_gene(arg_6)

            if not arg_8:
                continue

            # Create a dictionary with transcripts information
            # Use ensembl transcript id as keys
            arg_9 = {}
            # Add transcript information from the hgnc gene
            for arg_10 in arg_8.get('transcripts', []):
                arg_11 = arg_10['ensembl_transcript_id']
                arg_9[arg_11] = arg_10

            # Add the transcripts to the gene object
            arg_8['transcripts_dict'] = arg_9

            if arg_8.get('incomplete_penetrance'):
                arg_7['omim_penetrance'] = True

            ############# PANEL SPECIFIC INFORMATION #############
            # Panels can have extra information about genes and transcripts
            arg_12 = arg_3.get(arg_6, [])

            # Manually annotated disease associated transcripts
            arg_13 = set()
            # We need to strip the version to compare against others
            arg_14 = set()
            arg_15 = False
            arg_16 = False
            arg_17 = set()

            # We need to loop since there can be information from multiple panels
            for arg_5 in arg_12:
                # Check if there are manually annotated disease transcripts
                for arg_18 in arg_5.get('disease_associated_transcripts', []):
                    # We remove the version of transcript at this stage
                    arg_19 = re.sub(r'\.[0-9]', '', arg_18)
                    arg_14.add(arg_19)
                    arg_13.add(arg_18)

                if arg_5.get('reduced_penetrance'):
                    arg_15 = True

                if arg_5.get('mosaicism'):
                    arg_16 = True

                arg_17.update(arg_5.get('inheritance_models', []))

            arg_7['disease_associated_transcripts'] = list(arg_13)
            arg_7['manual_penetrance'] = arg_15
            arg_7['mosaicism'] = arg_16
            arg_7['manual_inheritance'] = list(arg_17)

            # Now add the information from hgnc and panels
            # to the transcripts on the variant

            # First loop over the variants transcripts
            for arg_10 in arg_7.get('transcripts', []):
                arg_11 = arg_10['transcript_id']
                if not arg_11 in arg_9:
                    continue

                # This is the common information about the transcript
                arg_20 = arg_9[arg_11]

                # Check in the common information if it is a primary transcript
                if arg_20.get('is_primary'):
                    arg_10['is_primary'] = True
                # If the transcript has a ref seq identifier we add that
                # to the variants transcript
                if not arg_20.get('refseq_id'):
                    continue

                arg_21 = arg_20['refseq_id']
                arg_10['refseq_id'] = arg_21
                arg_1['has_refseq'] = True
                # Check if the refseq id are disease associated
                if arg_21 in arg_14:
                    arg_10['is_disease_associated'] = True

                # Since a ensemble transcript can have multiple refseq identifiers we add all of
                # those
                arg_10['refseq_identifiers'] = arg_20.get('refseq_identifiers',[])

            arg_7['common'] = arg_8
            # Add the associated disease terms
            arg_7['disease_terms'] = arg_0.disease_terms(arg_6)

        return arg_1


def Func ( ) : arg_0 = TableLogger ( columns = 'file,created,modified,size' ) for arg_1 in os . listdir ( '.' ) : arg_2 = os . stat ( arg_1 ) . st_size arg_3 = datetime . fromtimestamp ( os . path . getctime ( arg_1 ) ) arg_4 = datetime . fromtimestamp ( os . path . getmtime ( arg_1 ) ) arg_0 ( arg_1 , arg_3 , arg_4 , arg_2 )

def Func():
    """Prints file details in the current directory"""
    arg_0 = TableLogger(columns='file,created,modified,size')
    for arg_1 in os.listdir('.'):
        arg_2 = os.stat(arg_1).st_size
        arg_3 = datetime.fromtimestamp(os.path.getctime(arg_1))
        arg_4 = datetime.fromtimestamp(os.path.getmtime(arg_1))
        arg_0(arg_1, arg_3, arg_4, arg_2)


(self, bucket, key, filename, extra_args=None,
                      callback=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None,
                      arg_5=None):
        """Download an S3 object to a file.

        Variants have also been injected into S3 client, Bucket and Object.
        You don't have to use S3Transfer.Func() directly.
        """
        # This method will issue a ``head_object`` request to determine
        # the size of the S3 object.  This is used to determine if the
        # object is downloaded in parallel.
        if arg_4 is None:
            arg_4 = {}
        arg_0._validate_all_known_args(arg_4, arg_0.ALLOWED_DOWNLOAD_ARGS)
        arg_6 = arg_0._object_size(arg_1, arg_2, arg_4)
        arg_7 = arg_3 + os.extsep + random_file_extension()
        try:
            arg_0._Func(arg_1, arg_2, arg_7, arg_6,
                                arg_4, arg_5)
        except Exception:
            logger.debug("Exception caught in Func, removing partial "
                         "file: %s", arg_7, exc_info=True)
            arg_0._osutil.remove_file(arg_7)
            raise
        else:
            arg_0._osutil.rename_file(arg_7, arg_3)

Download an S3 object to a file.

        Variants have also been injected into S3 client, Bucket and Object.
        You don't have to use S3Transfer.download_file() directly.


def Func(arg_0, arg_1, arg_2=False, arg_3=False):
    """
    Finds the percentage of one number over another.

    Args:
        a: The number that is a percent, int or float.

        b: The base number that a is a percent of, int or float.

        i: Optional boolean integer. True if the user wants the result returned as
        a whole number. Assumes False.

        r: Optional boolean round. True if the user wants the result rounded.
        Rounds to the second decimal point on floating point numbers. Assumes False.

    Returns:
        The argument a as a percentage of b. Throws a warning if integer is set to True
        and round is set to False.
    """
    # Round to the second decimal
    if arg_2 is False and arg_3 is True:
        arg_4 = round(100.0 * (float(arg_0) / arg_1), 2)

    # Round to the nearest whole number
    elif (arg_2 is True and arg_3 is True) or (arg_2 is True and arg_3 is False):
        arg_4 = int(round(100 * (float(arg_0) / arg_1)))

        # A rounded number and an integer were requested
        if arg_3 is False:
            warnings.warn(
                "If integer is set to True and Round is set to False, you will still get a rounded number if you pass floating point numbers as arguments."
            )

    # A precise unrounded decimal
    else:
        arg_4 = 100.0 * (float(arg_0) / arg_1)

    return arg_4

Finds the percentage of one number over another .


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( arg_1 , arg_2 ) : global arg_3 arg_3 = arg_2 try : arg_4 = arg_0 ( arg_1 , arg_2 ) return wait ( lambda : arg_4 ) except : arg_5 , arg_6 , arg_7 = sys . exc_info ( ) report_exc_info ( ( arg_5 , arg_6 , arg_7 . tb_next ) ) wait ( ) raise return wrapper

def Func(arg_0):
    """
    Decorator for making error handling on AWS Lambda easier
    """
    @functools.wraps(arg_0)
    def wrapper(arg_1, arg_2):
        global arg_3
        arg_3 = arg_2
        try:
            arg_4 = arg_0(arg_1, arg_2)
            return wait(lambda: arg_4)
        except:
            arg_5, arg_6, arg_7 = sys.exc_info()
            report_exc_info((arg_5, arg_6, arg_7.tb_next))
            wait()
            raise
    return wrapper


def Func(arg_0, arg_1, **arg_2):
        """Fetch the messages.

        :param category: the category of items to fetch
        :param kwargs: backend arguments

        :returns: a generator of items
        """
        arg_3 = arg_2['from_date']

        logger.info("Fetching messages of '%s' - '%s' channel from %s",
                    arg_0.url, arg_0.channel, str(arg_3))

        arg_4 = True
        arg_5 = 0
        arg_6 = 0

        # Convert timestamp to integer for comparing
        arg_7 = int(arg_3.timestamp() * 1000)

        while arg_4:
            arg_8 = arg_0.client.posts(arg_0.channel, arg_5=arg_5)

            arg_9 = arg_6

            for arg_10 in arg_0._parse_posts(arg_8):
                if arg_10['update_at'] < arg_7:
                    arg_4 = False
                    break

                # Fetch user data
                arg_11 = arg_10['user_id']
                arg_12 = arg_0._get_or_fetch_user(arg_11)
                arg_10['user_data'] = arg_12

                yield arg_10
                arg_6 += 1

            if arg_4:
                # If no new posts were fetched; stop the process
                if arg_9 == arg_6:
                    arg_4 = False
                else:
                    arg_5 += 1

        logger.info("Fetch process completed: %s posts fetched", arg_6)


def Func(arg_0, arg_1):
        """Create error response for any non-error message stanza.

        :Parameters:
            - `cond`: error condition name, as defined in XMPP specification.

        :return: new message stanza with the same "id" as self, "from" and
            "to" attributes swapped, type="error" and containing <error />
            element plus payload of `self`.
        :returntype: `Message`"""

        if arg_0.stanza_type == "error":
            raise ValueError("Errors may not be generated in response"
                                                                " to errors")

        arg_2 = Message(stanza_type = "error", from_jid = arg_0.to_jid,
                        to_jid = arg_0.from_jid, stanza_id = arg_0.stanza_id,
                        error_cond = arg_1,
                        subject = arg_0._subject, body = arg_0._body,
                        thread = arg_0._thread)

        if arg_0._payload is None:
            arg_0.decode_payload()
        for arg_3 in arg_0._payload:
            arg_2.add_payload(arg_3.copy())

        return arg_2

Create error response for any non - error message stanza .


def Func(arg_0, arg_1, arg_2):
        '''
        Opens the request.

        method:
            the request VERB 'GET', 'POST', etc.
        url:
            the url to connect
        '''
        arg_3 = VARIANT.create_bool_false()
        arg_4 = BSTR(arg_1)
        arg_5 = BSTR(arg_2)
        _WinHttpRequest._Open(arg_0, arg_4, arg_5, arg_3)


def Func ( arg_0 ) : arg_1 = arg_0 . descendents_root ( ) try : arg_1 . remove ( arg_0 . graph . root ) except ValueError : pass arg_1 . append ( arg_0 ) return arg_1

def Func(arg_0):
        """Returns a list of nodes that would be removed if prune were called
        on this element.
        """
        arg_1 = arg_0.descendents_root()
        try:
            arg_1.remove(arg_0.graph.root)
        except ValueError:
            # root wasn't in the target list, no problem
            pass

        arg_1.append(arg_0)
        return arg_1

Returns a list of nodes that would be removed if prune were called on this element .


(seqs, f=None, start=None, key=lambda x: x)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=lambda arg_4: arg_4):
    """Brent's Cycle Detector.

    See help(cycle_detector) for more context.

    Args:

      *args: Two iterators issueing the exact same sequence:
      -or-
      f, start: Function and starting state for finite state machine

    Yields:

      Values yielded by sequence_a if it terminates, undefined if a
      cycle is found.

    Raises:

      CycleFound if exception is found; if called with f and `start`,
      the parametres `first` and `period` will be defined indicating
      the offset of start of the cycle and the cycle's period.
    """

    arg_5 = arg_10 = 1
    arg_6, arg_7 = arg_0

    yield arg_7.next()
    arg_8 = arg_6.next()
    arg_9 = arg_7.next()
    while arg_3(arg_8) != arg_3(arg_9):
        yield arg_9
        if arg_5 == arg_10:
            arg_5 *= 2
            arg_10 = 0
            if arg_1:
                arg_6 = f_generator(arg_1, arg_9)
                arg_8 = arg_6.next()
            else:
                while arg_8 != arg_9:
                    arg_8 = arg_6.next()
        arg_9 = arg_7.next()
        arg_10 += 1

    if arg_1 is None:
        raise CycleDetected()

    arg_11 = 0
    arg_8 = arg_9 = arg_2
    for arg_12 in xrange(arg_10):
        arg_9 = arg_1(arg_9)

    while arg_3(arg_8) != arg_3(arg_9):
        arg_8 = arg_1(arg_8)
        arg_9 = arg_1(arg_9)
        arg_11 += 1
    raise CycleDetected(arg_10=arg_10, arg_11=arg_11)


(self, fail_on_found=False, force_on_exists=False, **kwargs)

return super(Resource, self).create(fail_on_found=fail_on_found, force_on_exists=force_on_exists, **kwargs)

def Func(arg_0, arg_1=False, arg_2=False, **arg_3):
        """Create a group.

        =====API DOCS=====
        Create a group.

        :param parent: Primary key or name of the group which will be the parent of Funcd group.
        :type parent: str
        :param fail_on_found: Flag that if set, the operation fails if an object matching the unique criteria
                              already exists.
        :type fail_on_found: bool
        :param force_on_exists: Flag that if set, then if a match is found on unique fields, other fields will
                                be updated to the provided values.; If unset, a match causes the request to be
                                a no-op.
        :type force_on_exists: bool
        :param `**kwargs`: Keyword arguments which, all together, will be used as POST body to Func the
                           resource object.
        :returns: A dictionary combining the JSON output of the Funcd resource, as well as two extra fields:
                  "changed", a flag indicating if the resource is Funcd successfully; "id", an integer which
                  is the primary key of the Funcd object.
        :rtype: dict
        :raises tower_cli.exceptions.UsageError: When inventory is not provided in ``**kwargs`` and ``parent``
                                                 is not provided.

        =====API DOCS=====
        """
        if arg_3.get('parent', None):
            arg_4 = arg_0.set_child_endpoint(parent=arg_3['parent'], inventory=arg_3.get('inventory', None))
            arg_3['inventory'] = arg_4['inventory']
        elif 'inventory' not in arg_3:
            raise exc.UsageError('To Func a group, you must provide a parent inventory or parent group.')
        return super(Resource, arg_0).Func(arg_1=arg_1, arg_2=arg_2, **arg_3)

Create a group.

        =====API DOCS=====
        Create a group.

        :param parent: Primary key or name of the group which will be the parent of created group.
        :type parent: str
        :param fail_on_found: Flag that if set, the operation fails if an object matching the unique criteria
                              already exists.
        :type fail_on_found: bool
        :param force_on_exists: Flag that if set, then if a match is found on unique fields, other fields will
                                be updated to the provided values.; If unset, a match causes the request to be
                                a no-op.
        :type force_on_exists: bool
        :param `**kwargs`: Keyword arguments which, all together, will be used as POST body to create the
                           resource object.
        :returns: A dictionary combining the JSON output of the created resource, as well as two extra fields:
                  "changed", a flag indicating if the resource is created successfully; "id", an integer which
                  is the primary key of the created object.
        :rtype: dict
        :raises tower_cli.exceptions.UsageError: When inventory is not provided in ``**kwargs`` and ``parent``
                                                 is not provided.

        =====API DOCS=====


return crypt.make_signed_jwt(self._signer, payload,
                                     key_id=self._private_key_id)

def Func ( arg_0 ) : arg_1 = int ( time . time ( ) ) arg_2 = { 'aud' : arg_0 . token_uri , 'scope' : arg_0 . _scopes , 'iat' : arg_1 , 'exp' : arg_1 + arg_0 . MAX_TOKEN_LIFETIME_SECS , 'iss' : arg_0 . _service_account_email , } arg_2 . update ( arg_0 . _kwargs ) return crypt . make_signed_jwt ( arg_0 . _signer , arg_2 , key_id = arg_0 . _private_key_id )

def Func(arg_0):
        """Generate the assertion that will be used in the request."""
        arg_1 = int(time.time())
        arg_2 = {
            'aud': arg_0.token_uri,
            'scope': arg_0._scopes,
            'iat': arg_1,
            'exp': arg_1 + arg_0.MAX_TOKEN_LIFETIME_SECS,
            'iss': arg_0._service_account_email,
        }
        arg_2.update(arg_0._kwargs)
        return crypt.make_signed_jwt(arg_0._signer, arg_2,
                                     key_id=arg_0._private_key_id)

Generate the assertion that will be used in the request .


def Func(arg_0, arg_1, arg_2):
        """Func object before index"""
        arg_0._check(arg_2.id)
        list.Func(arg_0, arg_1, arg_2)
        # all subsequent entries now have been shifted up by 1
        arg_3 = arg_0._dict
        for arg_4, arg_5 in iteritems(arg_3):
            if arg_5 >= arg_1:
                arg_3[arg_4] = arg_5 + 1
        arg_3[arg_2.id] = arg_1


return [ghi(x) for x in range(start, end)]

def Func ( arg_0 , arg_1 = 10 ) : arg_2 = arg_0 . shell . readline . get_current_history_length ( ) + 1 arg_3 = max ( arg_2 - arg_1 , 1 ) arg_4 = arg_0 . shell . readline . get_history_item return [ arg_4 ( arg_5 ) for arg_5 in range ( arg_3 , arg_2 ) ]

def Func(arg_0, arg_1=10):
        """Get the last n items in readline history."""
        arg_2 = arg_0.shell.readline.get_current_history_length() + 1
        arg_3 = max(arg_2-arg_1, 1)
        arg_4 = arg_0.shell.readline.get_history_item
        return [arg_4(arg_5) for arg_5 in range(arg_3, arg_2)]

Get the last n items in readline history .


def Func(arg_0, **arg_1):
    """Implementation of the ARACNE algorithm.

    Args:
     mat (numpy.ndarray): matrix, if it is a square matrix, the program assumes
         it is a relevance matrix where mat(i,j) represents the similarity content
         between nodes i and j. Elements of matrix should be
         non-negative.

    Returns:
    mat_nd (numpy.ndarray): Output deconvolved matrix (direct dependency matrix). Its components
        represent direct edge weights of observed interactions.

    .. note::
       Ref: ARACNE: An Algorithm for the Reconstruction of Gene Regulatory Networks in a Mammalian Cellular Context
       Adam A Margolin, Ilya Nemenman, Katia Basso, Chris Wiggins, Gustavo Stolovitzky, Riccardo Dalla Favera and Andrea Califano
       DOI: https://doi.org/10.1186/1471-2105-7-S1-S7
    """
    arg_2 = arg_1.get('I0', 0.0)  # No default thresholding
    arg_3 = arg_1.get('W0', 0.05)

    # thresholding
    arg_0 = np.where(arg_0 > arg_2, arg_0, 0)

    # Finding triplets and filtering them
    for arg_4 in range(arg_0.shape[0]-2):
        for arg_5 in range(arg_4+1, arg_0.shape[0]-1):
            for arg_6 in range(arg_5+1, arg_0.shape[0]):
                arg_7 = [arg_0[arg_4, arg_5], arg_0[arg_5, arg_6], arg_0[arg_4, arg_6]]
                arg_8, arg_9 = min(enumerate(arg_7), key=operator.itemgetter(1))
                if 0 < arg_9 < arg_3:
                    if arg_8 == 0:
                        arg_0[arg_4, arg_5] = arg_0[arg_5, arg_4] = 0.
                    elif arg_8 == 1:
                        arg_0[arg_5, arg_6] = arg_0[arg_6, arg_5] = 0.
                    else:
                        arg_0[arg_4, arg_6] = arg_0[arg_6, arg_4] = 0.
    return arg_0

Implementation of the ARACNE algorithm .


def Func(arg_0, arg_1, arg_2):
    """Create station stop times for each trip."""
    arg_3 = datetime.timedelta(seconds=30)
    arg_4 = arg_2
    arg_5 = arg_2
    arg_6 = (arg_4 + arg_3).hour
    arg_7 = None

    arg_8 = None
    arg_9 = None
    for arg_10, arg_11 in enumerate(arg_1):

        # Avoid time travels
        arg_4 = arg_5 + get_time_from_last_stop(arg_7, arg_11)
        arg_12 = arg_4 + arg_3

        # Cover the case when the arrival time falls into the next day
        if arg_4.hour < arg_6:
            arg_13 = arg_6
            arg_9 = arg_4.hour + arg_13
            arg_8 = arg_12.hour + arg_13
            arg_6 = arg_12.hour + arg_13
        else:
            arg_9 = arg_4.hour
            arg_8 = arg_12.hour
            arg_6 = arg_12.hour

        # Cover the case when adding waiting time to the arrival time
        # falls into the next day
        if arg_12.hour < arg_4.hour:
            arg_13 = arg_6
            arg_8 = arg_12.hour + arg_13
            arg_6 = arg_12.hour + arg_13

        yield {'trip_id': arg_0,
               'arrival_time': '{:02}:{}'.format(
                   arg_9,
                   arg_4.strftime('%M:%S')),
               'departure_time': '{:02}:{}'.format(
                   arg_8,
                   arg_12.strftime('%M:%S')),
               'stop_id': arg_11.stop_id,
               'stop_sequence': arg_10}

        arg_7 = arg_11
        arg_5 = arg_12

Create station stop times for each trip .


return {'slope':slope, 'intercept':intercept,
            'chisq':chisq, 'hessian':estimator_hessian,
            'cov':np.linalg.inv(estimator_hessian)}

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = ( arg_0 [ dtavgii ] - arg_0 [ tavgii ] * arg_0 [ davgii ] / arg_0 [ sii ] ) / ( arg_0 [ tsqii ] - arg_0 [ tavgii ] ** 2 / arg_0 [ sii ] ) arg_2 = False else : arg_2 = True arg_3 = ( arg_0 [ davgii ] - arg_0 [ tavgii ] * arg_1 ) / arg_0 [ sii ] if arg_2 : return { 'slope' : arg_1 , 'intercept' : arg_3 , 'chisq' : 0.5 * ( arg_0 [ dsqii ] / arg_0 [ sii ] - arg_0 [ davgii ] ** 2 / arg_0 [ sii ] ** 2 ) } arg_4 = 0.5 * ( arg_0 [ dsqii ] - arg_0 [ davgii ] ** 2 / arg_0 [ sii ] - ( arg_0 [ dtavgii ] - arg_0 [ davgii ] * arg_0 [ tavgii ] / arg_0 [ sii ] ) ** 2 / ( arg_0 [ tsqii ] - arg_0 [ tavgii ] ** 2 / arg_0 [ sii ] ) ) arg_5 = np . array ( [ [ arg_0 [ tsqii ] , arg_0 [ tavgii ] ] , [ arg_0 [ tavgii ] , arg_0 [ sii ] ] ] ) return { 'slope' : arg_1 , 'intercept' : arg_3 , 'chisq' : arg_4 , 'hessian' : arg_5 , 'cov' : np . linalg . inv ( arg_5 ) }

def Func(arg_0, arg_1=None):
    """
    this function calculates the regression coefficients for a
    given vector containing the averages of tip and branch
    quantities.

    Parameters
    ----------
    Q : numpy.array
        vector with
    slope : None, optional
        Description

    Returns
    -------
    TYPE
        Description
    """
    if arg_1 is None:
        arg_1 = (arg_0[dtavgii] - arg_0[tavgii]*arg_0[davgii]/arg_0[sii]) \
                /(arg_0[tsqii] - arg_0[tavgii]**2/arg_0[sii])
        arg_2=False
    else:
        arg_2=True

    arg_3 = (arg_0[davgii] - arg_0[tavgii]*arg_1)/arg_0[sii]

    if arg_2:
        return {'slope':arg_1, 'intercept':arg_3,
                'chisq': 0.5*(arg_0[dsqii]/arg_0[sii] - arg_0[davgii]**2/arg_0[sii]**2)}

    arg_4 = 0.5*(arg_0[dsqii] - arg_0[davgii]**2/arg_0[sii]
                - (arg_0[dtavgii] - arg_0[davgii]*arg_0[tavgii]/arg_0[sii])**2/(arg_0[tsqii]
                - arg_0[tavgii]**2/arg_0[sii]))

    arg_5 = np.array([[arg_0[tsqii], arg_0[tavgii]], [arg_0[tavgii], arg_0[sii]]])

    return {'slope':arg_1, 'intercept':arg_3,
            'chisq':arg_4, 'hessian':arg_5,
            'cov':np.linalg.inv(arg_5)}

this function calculates the regression coefficients for a given vector containing the averages of tip and branch quantities .


def Func(arg_0):
    """Pointwise minimum of two quadratic bowls"""
    arg_1, arg_2, arg_3 = 0.01, 100, 0.5
    arg_4 = 0.5 * arg_1 * arg_0 ** 2 + arg_3
    arg_5 = 0.5 * arg_2 * arg_0 ** 2
    arg_6 = float(np.minimum(arg_4, arg_5))
    arg_7 = np.where(arg_5 < arg_4, arg_2 * arg_0, arg_1 * arg_0)
    return arg_6, arg_7


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = datetime . datetime . now ( ) try : arg_1 = arg_0 . year + arg_0 . timetuple ( ) . tm_yday / 365.25 except : arg_1 = None return arg_1

def Func(arg_0=None):
    """
    Convert datetime object to the numeric date.
    The numeric date format is YYYY.F, where F is the fraction of the year passed

    Parameters
    ----------
     dt:  datetime.datetime, None
        date of to be converted. if None, assume today

    """
    if arg_0 is None:
        arg_0 = datetime.datetime.now()

    try:
        arg_1 = arg_0.year + arg_0.timetuple().tm_yday / 365.25
    except:
        arg_1 = None

    return arg_1

Convert datetime object to the numeric date . The numeric date format is YYYY . F where F is the fraction of the year passed


def Func(arg_0):
        """
        Verify that the value of the Interval is valid.

        Raises:
            TypeError: if the value is not of type int or long
            ValueError: if the value cannot be represented by an unsigned
                32-bit integer
        """
        if arg_0.value is not None:
            if type(arg_0.value) not in six.integer_types:
                raise TypeError('expected (one of): {0}, observed: {1}'.format(
                    six.integer_types, type(arg_0.value)))
            else:
                if arg_0.value > Interval.MAX:
                    raise ValueError(
                        'interval value greater than accepted max')
                elif arg_0.value < Interval.MIN:
                    raise ValueError('interval value less than accepted min')

Verify that the value of the Interval is valid .


def Func(arg_0, arg_1):
        """
        Get whether creating a file or a directory from the basenane of the given
        path is allowed

        :Parameters:
            #. path (str): The absolute or relative path or simply the file
               or directory name.

        :Returns:
            #. allowed (bool): Whether name is allowed.
            #. message (None, str): Reason for the name to be forbidden.
        """
        assert isinstance(arg_1, basestring), "given path must be a string"
        arg_2 = os.path.basename(arg_1)
        if not len(arg_2):
            return False, "empty name is not allowed"
        # exact match
        for arg_3 in [arg_0.__repoLock,arg_0.__repoFile,arg_0.__dirInfo,arg_0.__dirLock]:
            if arg_2 == arg_3:
                return False, "name '%s' is reserved for pyrep internal usage"%arg_3
        # pattern match
        for arg_4 in [arg_0.__fileInfo,arg_0.__fileLock]:#,self.__objectDir]:
            if arg_2 == arg_4 or (arg_2.endswith(arg_4[3:]) and arg_2.startswith('.')):
                return False, "name pattern '%s' is not allowed as result may be reserved for pyrep internal usage"%arg_4
        # name is ok
        return True, None


return unichr(0xAC00 + chosung_index * NUM_JOONG * NUM_JONG + joongsung_index * NUM_JONG + jongsung_index)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
u''
)
:
if
arg_2
is
:
arg_2
=
u''
try
:
arg_3
=
CHO
.
index
(
arg_0
)
arg_4
=
JOONG
.
index
(
arg_1
)
arg_5
=
JONG
.
index
(
arg_2
)
except
Exception
:
raise
NotHangulException
(
'No valid Hangul character index'
)
return
unichr
(
0xAC00
+
arg_3
*
NUM_JOONG
*
NUM_JONG
+
arg_4
*
NUM_JONG
+
arg_5
)

def Func(arg_0, arg_1, arg_2=u''):
    """This function returns a Hangul letter by composing the specified chosung, joongsung, and jongsung.
    @param chosung
    @param joongsung
    @param jongsung the terminal Hangul letter. This is optional if you do not need a jongsung."""

    if arg_2 is None: arg_2 = u''

    try:
        arg_3 = CHO.index(arg_0)
        arg_4 = JOONG.index(arg_1)
        arg_5 = JONG.index(arg_2)
    except Exception:
        raise NotHangulException('No valid Hangul character index')

    return unichr(0xAC00 + arg_3 * NUM_JOONG * NUM_JONG + arg_4 * NUM_JONG + arg_5)

This function returns a Hangul letter by composing the specified chosung joongsung and jongsung .


def Func(arg_0):
        """
        Return updates in the training.
        """
        arg_1 = arg_0.training_params()
        arg_2 = arg_0.get_gradients(arg_1)
        return arg_0.optimization_updates(arg_1, arg_2)


return Response(json.dumps(results),
                    mimetype='application/json')

def Func ( ) : arg_0 = request . preferences . engines . get_disabled ( ) if PY3 : arg_1 = RawTextQuery ( request . form . get ( 'q' , b'' ) , arg_0 ) else : arg_1 = RawTextQuery ( request . form . get ( 'q' , u'' ) . encode ( 'utf-8' ) , arg_0 ) arg_1 . parse_query ( ) if not arg_1 . getSearchQuery ( ) : return '' , 400 arg_2 = autocomplete_backends . get ( request . preferences . get_value ( 'autocomplete' ) ) arg_3 = searx_bang ( arg_1 ) if len ( arg_3 ) <= 3 and arg_2 : arg_4 = request . preferences . get_value ( 'language' ) if not arg_4 or arg_4 == 'all' : arg_4 = 'en' else : arg_4 = arg_4 . split ( '-' ) [ 0 ] arg_3 . extend ( arg_2 ( arg_1 . getSearchQuery ( ) , arg_4 ) ) arg_5 = [ ] for arg_6 in arg_3 : arg_1 . changeSearchQuery ( arg_6 ) arg_5 . append ( arg_1 . getFullQuery ( ) ) if request . form . get ( 'format' ) == 'x-suggestions' : return Response ( json . dumps ( [ arg_1 . query , arg_5 ] ) , mimetype = 'application/json' ) return Response ( json . dumps ( arg_5 ) , mimetype = 'application/json' )

def Func():
    """Return Func results"""

    # set blocked engines
    arg_0 = request.preferences.engines.get_disabled()

    # parse query
    if PY3:
        arg_1 = RawTextQuery(request.form.get('q', b''), arg_0)
    else:
        arg_1 = RawTextQuery(request.form.get('q', u'').encode('utf-8'), arg_0)
    arg_1.parse_query()

    # check if search query is set
    if not arg_1.getSearchQuery():
        return '', 400

    # run Func
    arg_2 = autocomplete_backends.get(request.preferences.get_value('autocomplete'))

    # parse searx specific Func results like !bang
    arg_3 = searx_bang(arg_1)

    # normal autocompletion results only appear if max 3 inner results returned
    if len(arg_3) <= 3 and arg_2:
        # get language from cookie
        arg_4 = request.preferences.get_value('language')
        if not arg_4 or arg_4 == 'all':
            arg_4 = 'en'
        else:
            arg_4 = arg_4.split('-')[0]
        # run autocompletion
        arg_3.extend(arg_2(arg_1.getSearchQuery(), arg_4))

    # parse results (write :language and !engine back to result string)
    arg_5 = []
    for arg_6 in arg_3:
        arg_1.changeSearchQuery(arg_6)

        # add parsed result
        arg_5.append(arg_1.getFullQuery())

    # return Func results
    if request.form.get('format') == 'x-suggestions':
        return Response(json.dumps([arg_1.query, arg_5]),
                        mimetype='application/json')

    return Response(json.dumps(arg_5),
                    mimetype='application/json')


def Func(arg_0, arg_1, arg_2):
    """Modify a contact in an external editor.

    :param selected_vcard: the contact to modify
    :type selected_vcard: carddav_object.CarddavObject
    :param input_from_stdin_or_file: new data from stdin (or a file) that
        should be incorperated into the contact, this should be a yaml
        formatted string
    :type input_from_stdin_or_file: str
    :param open_editor: whether to open the new contact in the edior after
        creation
    :type open_editor: bool
    :returns: None
    :rtype: None

    """
    # show warning, if vcard version of selected contact is not 3.0 or 4.0
    if arg_0.get_version() not in config.supported_vcard_versions:
        print("Warning:\nThe selected contact is based on vcard version %s "
              "but khard only supports the creation and modification of vcards"
              " with version 3.0 and 4.0.\nIf you proceed, the contact will be"
              " converted to vcard version %s but beware: This could corrupt "
              "the contact file or cause data loss."
              % (arg_0.get_version(),
                 config.get_preferred_vcard_version()))
        while True:
            arg_3 = input("Do you want to proceed anyway (y/n)? ")
            if arg_3.lower() in ["", "n", "q"]:
                print("Canceled")
                sys.exit(0)
            if arg_3.lower() == "y":
                break
    # if there is some data in stdin
    if arg_1:
        # create new contact from stdin
        try:
            arg_4 = \
                CarddavObject.from_existing_contact_with_new_user_input(
                    arg_0, arg_1,
                    config.localize_dates())
        except ValueError as err:
            print(err)
            sys.exit(1)
        if arg_0 == arg_4:
            print("Nothing changed\n\n%s" % arg_4.print_vcard())
        else:
            print("Modification\n\n%s\n" % arg_4.print_vcard())
            while True:
                arg_3 = input("Do you want to proceed (y/n)? ")
                if arg_3.lower() in ["", "n", "q"]:
                    print("Canceled")
                    break
                if arg_3.lower() == "y":
                    arg_4.write_to_file(overwrite=True)
                    if arg_2:
                        modify_existing_contact(arg_4)
                    else:
                        print("Done")
                    break
    else:
        modify_existing_contact(arg_0)

Modify a contact in an external editor .


def
Func
(
arg_0
)
:
if
arg_2
.
stdout
is
not
arg_0
:
arg_0
.
_original_steam
=
arg_2
.
stdout
arg_2
.
stdout
=
arg_0
arg_0
.
_redirection
=
True
if
arg_0
.
_redirection
:
print
(
'Established redirection of `stdout`.'
)

def Func(arg_0):
        """Starts redirection of `stdout`"""
        if arg_2.stdout is not arg_0:
            arg_0._original_steam = arg_2.stdout
            arg_2.stdout = arg_0
            arg_0._redirection = True
        if arg_0._redirection:
            print('Established redirection of `stdout`.')


def Func(arg_0, arg_1, arg_2=None):
    '''a "show all" search that doesn't require a query
       the user is shown URLs to
    '''

    arg_3 = [['job_id', 'browser']]

    arg_4 = "%s/projects/%s/jobs" %(arg_0.api_base,
                                  quote_plus(arg_1.strip('/')))

    arg_5 = requests.get(arg_4, headers=arg_0.headers)
    if arg_5.status_code == 200:
        arg_6 = arg_5.json()

        # We can't get a listing of artifacts
        # https://gitlab.com/gitlab-org/gitlab-ce/issues/51515
        # Parse through jobs (each can have different tags for a collection):
        for arg_7 in arg_6:

            # Only show jobs that are successful
            if arg_7['status'] == 'success':
                arg_8 = arg_7['name']

                for arg_9 in arg_7['artifacts']:
                    if arg_9['filename'].endswith('zip'):

                        # The user must browse to see the names
                        arg_10 = ("%s/%s/-/jobs/%s/artifacts/browse/%s"
                                        %(arg_0.base ,
                                          arg_1,
                                          arg_7['id'],
                                          arg_8))
                        arg_3.append([str(arg_7['id']), arg_10])

    if len(arg_3) == 1:
        bot.info("No potential archives found in artifacts.")
        sys.exit(0)

    bot.info("Artifact Browsers (you will need path and job id for pull)")
    bot.table(arg_3)
    return arg_3

a show all search that doesn t require a query the user is shown URLs to


def Func ( arg_0 ) : if arg_0 . session and not arg_0 . session . is_shutdown : return arg_0 . session arg_0 . session = arg_0 . cluster . connect ( arg_0 . keyspace ) return arg_0 . session

def Func(arg_0):
        """
        Returns a cassandra Session object
        """
        if arg_0.session and not arg_0.session.is_shutdown:
            return arg_0.session
        arg_0.session = arg_0.cluster.connect(arg_0.keyspace)
        return arg_0.session


def Func ( arg_0 = 'darkgrid' , arg_1 = None ) : if arg_1 is None : arg_1 = { } arg_2 = { } for arg_3 , arg_4 in arg_2 . items ( ) : arg_1 . setdefault ( arg_3 , arg_4 ) return sns . Func ( arg_0 = arg_0 , arg_1 = arg_1 )

def Func(arg_0='darkgrid', arg_1=None):
    """
    Create pyfolio default axes style context.

    Under the hood, calls and returns seaborn.Func() with
    some custom settings. Usually you would use in a with-context.

    Parameters
    ----------
    style : str, optional
        Name of seaborn style.
    rc : dict, optional
        Config flags.

    Returns
    -------
    seaborn plotting context

    Example
    -------
    >>> with pyfolio.plotting.Func(style='whitegrid'):
    >>>    pyfolio.create_full_tear_sheet(..., set_context=False)

    See also
    --------
    For more information, see seaborn.plotting_context().

    """
    if arg_1 is None:
        arg_1 = {}

    arg_2 = {}

    # Add defaults if they do not exist
    for arg_3, arg_4 in arg_2.items():
        arg_1.setdefault(arg_3, arg_4)

    return sns.Func(arg_0=arg_0, arg_1=arg_1)

Create pyfolio default axes style context.

    Under the hood, calls and returns seaborn.axes_style() with
    some custom settings. Usually you would use in a with-context.

    Parameters
    ----------
    style : str, optional
        Name of seaborn style.
    rc : dict, optional
        Config flags.

    Returns
    -------
    seaborn plotting context

    Example
    -------
    >>> with pyfolio.plotting.axes_style(style='whitegrid'):
    >>>    pyfolio.create_full_tear_sheet(..., set_context=False)

    See also
    --------
    For more information, see seaborn.plotting_context().

Create pyfolio default axes style context .


def Func ( arg_0 ) : arg_1 = find_class_properties ( arg_0 . __class__ ) arg_2 = { name : arg_0 . __getattribute__ ( name ) for name , _ in arg_1 } return arg_2

def Func(arg_0):
        """Returns a dict with the representation of this task configuration object."""

        arg_1 = find_class_properties(arg_0.__class__)
        arg_2 = {
            name: arg_0.__getattribute__(name) for name, _ in arg_1
        }
        return arg_2

Returns a dict with the representation of this task configuration object .


(
    det_bounds, dim, sample_shape, dtype, seed)

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4):
  """Returns rejection samples from trying to get good correlation matrices.

  The proposal being rejected from is the uniform distribution on
  "correlation-like" matrices.  We say a matrix is "correlation-like"
  if it is a symmetric square matrix with all entries between -1 and 1
  (inclusive) and 1s on the main diagonal.  Of these, the ones that
  are positive semi-definite are exactly the correlation matrices.

  The rejection algorithm, then, is to sample a `Tensor` of
  `sample_shape` correlation-like matrices of dimensions `dim` by
  `dim`, and check each one for (i) being a correlation matrix (i.e.,
  PSD), and (ii) having determinant at least the corresponding entry
  of `det_bounds`.

  Args:
    det_bounds: A `Tensor` of lower bounds on the determinants of
      acceptable matrices.  The shape must broadcast with `sample_shape`.
    dim: A Python `int` dimension of correlation matrices to sample.
    sample_shape: Python `tuple` of `int` shape of the samples to
      compute, excluding the two matrix dimensions.
    dtype: The `dtype` in which to do the computation.
    seed: Random seed.

  Returns:
    weights: A `Tensor` of shape `sample_shape`.  Each entry is 0 if the
      corresponding matrix was not a correlation matrix, or had too
      small of a determinant.  Otherwise, the entry is the
      multiplicative inverse of the density of proposing that matrix
      uniformly, i.e., the volume of the set of `dim` by `dim`
      correlation-like matrices.
    volume: The volume of the set of `dim` by `dim` correlation-like
      matrices.
  """
  with tf.compat.v1.name_scope("rejection_sampler"):
    arg_5 = _uniform_correlation_like_matrix(
        arg_1, arg_2, arg_3, arg_4=arg_4)
    arg_6 = 2. ** (arg_1 * (arg_1 - 1) / 2.)
    # The density of proposing any given point is 1 / rej_proposal_volume;
    # The weight of that point should be scaled by
    # 1 / density = rej_proposal_volume.
    arg_7 = arg_6 * _psd_mask(
        arg_5) * _det_large_enough_mask(arg_5, arg_0)
    return arg_7, arg_6

Returns rejection samples from trying to get good correlation matrices .


def
Func
(
arg_0
)
:
arg_0
.
fetcher
.
fetch_events_async
(
arg_0
.
issues
,
"issues"
)
arg_0
.
fetcher
.
fetch_events_async
(
arg_0
.
pull_requests
,
"pull requests"
)

def Func(arg_0):
        """
        Fetch event for issues and pull requests

        @return [Array] array of fetched issues
        """

        # Async fetching events:
        arg_0.fetcher.fetch_events_async(arg_0.issues, "issues")
        arg_0.fetcher.fetch_events_async(arg_0.pull_requests, "pull requests")


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ [ onehot ( arg_0 . input_dim , x ) for x in arg_1 ] ] for arg_4 in range ( arg_2 ) : arg_5 = arg_0 . compute ( arg_3 ) [ 0 , - 1 ] . argmax ( ) arg_1 . append ( arg_5 ) arg_3 [ 0 ] . append ( onehot ( arg_0 . input_dim , arg_5 ) ) return arg_1

def Func(arg_0, arg_1, arg_2):
        """
        Sample outputs from LM.
        """
        arg_3 = [[onehot(arg_0.input_dim, x) for x in arg_1]]
        for arg_4 in range(arg_2):
            arg_5 = arg_0.compute(arg_3)[0,-1].argmax()
            arg_1.append(arg_5)
            arg_3[0].append(onehot(arg_0.input_dim, arg_5))
        return arg_1


def Func(arg_0):
        """
        Returns the correct repository URL and revision by parsing the given
        repository URL
        """
        arg_1= (
           "Sorry, '%s' is a malformed VCS url. "
           "Ihe format is <vcs>+<protocol>://<url>, "
           "e.g. svn+http://myrepo/svn/MyApp#egg=MyApp")
        assert '+' in arg_0.url, arg_1 % arg_0.url
        arg_2 = arg_0.url.split('+', 1)[1]
        arg_3, arg_4, arg_5, arg_6, arg_7 = urlparse.urlsplit(arg_2)
        arg_8 = None
        if '@' in arg_5:
            arg_5, arg_8 = arg_5.rsplit('@', 1)
        arg_2 = urlparse.urlunsplit((arg_3, arg_4, arg_5, arg_6, ''))
        return arg_2, arg_8


def Func ( arg_0 ) : arg_1 = DAGCircuit ( ) arg_1 . name = arg_0 . name for arg_3 in arg_0 . qregs : arg_1 . add_qreg ( arg_3 ) for arg_3 in arg_0 . cregs : arg_1 . add_creg ( arg_3 ) for arg_4 , arg_5 , arg_6 in arg_0 . data : if arg_4 . control is None : arg_7 = None else : arg_7 = ( arg_4 . control [ 0 ] , arg_4 . control [ 1 ] ) arg_1 . apply_operation_back ( arg_4 . copy ( ) , arg_5 , arg_6 , arg_7 ) return arg_1

def Func(arg_0):
    """Build a ``DAGCircuit`` object from a ``QuantumCircuit``.

    Args:
        circuit (QuantumCircuit): the input circuit.

    Return:
        DAGCircuit: the DAG representing the input circuit.
    """
    arg_1 = DAGCircuit()
    arg_1.name = arg_0.name
    for arg_3 in arg_0.qregs:
        arg_1.add_qreg(arg_3)
    for arg_3 in arg_0.cregs:
        arg_1.add_creg(arg_3)

    for arg_4, arg_5, arg_6 in arg_0.data:
        # Get arguments for classical control (if any)
        if arg_4.control is None:
            arg_7 = None
        else:
            arg_7 = (arg_4.control[0], arg_4.control[1])

        arg_1.apply_operation_back(arg_4.copy(),
                                        arg_5, arg_6, arg_7)

    return arg_1

Build a DAGCircuit object from a QuantumCircuit .


def Func(arg_0, arg_1, arg_2):
        """
        Will filter if instructed to do so the result to remove matching criteria

        :param result: list of dicts returned by Snakebite ls
        :type result: list[dict]
        :param ignored_ext: list of ignored extensions
        :type ignored_ext: list
        :param ignore_copying: shall we ignore ?
        :type ignore_copying: bool
        :return: list of dicts which were not removed
        :rtype: list[dict]
        """
        if arg_2:
            arg_3 = LoggingMixin().log
            arg_4 = r"^.*\.(%s$)$" % '$|'.join(arg_1)
            arg_5 = re.compile(arg_4)
            arg_3.debug(
                'Filtering result for ignored extensions: %s in files %s',
                arg_5.pattern, map(lambda x: x['path'], arg_0)
            )
            arg_0 = [x for x in arg_0 if not arg_5.match(x['path'])]
            arg_3.debug('HdfsSensor.poke: after ext filter result is %s', arg_0)
        return arg_0


def Func(arg_0, arg_1, **arg_2):
        """
        Get information about a specific batch webhook.

        :param batch_webhook_id: The unique id for the batch webhook.
        :type batch_webhook_id: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        """
        arg_0.batch_webhook_id = arg_1
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1), **arg_2)

Get information about a specific batch webhook .


def Func(arg_0, arg_1):
    """
    Used to count the number of unique bases in a site for snpstring.
    """
    ## iterate over all loci
    for arg_2 in xrange(arg_0.shape[0]):
        for arg_3 in xrange(arg_0.shape[2]):

            ## make new array
            arg_4 = np.zeros(4, dtype=np.int16)

            ## a list for only catgs
            arg_5 = arg_0[arg_2, :, arg_3]
            for arg_6 in range(arg_5.shape[0]):
                if arg_5[arg_6] == 67: #C
                    arg_4[0] += 1
                elif arg_5[arg_6] == 65: #A
                    arg_4[1] += 1
                elif arg_5[arg_6] == 84: #T
                    arg_4[2] += 1
                elif arg_5[arg_6] == 71: #G
                    arg_4[3] += 1
                elif arg_5[arg_6] == 82: #R
                    arg_4[1] += 1        #A
                    arg_4[3] += 1        #G
                elif arg_5[arg_6] == 75: #K
                    arg_4[2] += 1        #T
                    arg_4[3] += 1        #G
                elif arg_5[arg_6] == 83: #S
                    arg_4[0] += 1        #C
                    arg_4[3] += 1        #G
                elif arg_5[arg_6] == 89: #Y
                    arg_4[0] += 1        #C
                    arg_4[2] += 1        #T
                elif arg_5[arg_6] == 87: #W
                    arg_4[1] += 1        #A
                    arg_4[2] += 1        #T
                elif arg_5[arg_6] == 77: #M
                    arg_4[0] += 1        #C
                    arg_4[1] += 1        #A

            ## get second most common site
            arg_4.sort()
            ## if invariant e.g., [0, 0, 0, 9], then nothing (" ")
            if not arg_4[2]:
                pass
            else:
                if arg_4[2] > 1:
                    arg_1[arg_2, arg_3, 1] = True
                else:
                    arg_1[arg_2, arg_3, 0] = True
    return arg_1

Used to count the number of unique bases in a site for snpstring .


Maps feature names to ES's "_source" field.

def Func ( arg_0 , arg_1 ) : if arg_1 is None : return True elif isinstance ( arg_1 , bool ) : return arg_1 else : return map ( lambda n : 'fc.' + n , arg_1 )

def Func(arg_0, arg_1):
        '''Maps feature names to ES's "Func" field.'''
        if arg_1 is None:
            return True
        elif isinstance(arg_1, bool):
            return arg_1
        else:
            return map(lambda n: 'fc.' + n, arg_1)

Maps feature names to ES s _source field .


(local_path=None, remote_path=None, render=True, extra=None, formatter=None)

def Func(arg_0=None, arg_1=None, arg_2=True, arg_3=None, arg_4=None):
    """
    Returns a template to a remote file.
    If no filename given, a temporary filename will be generated and returned.
    """
    arg_0 = find_template(arg_0)
    if arg_2:
        arg_3 = arg_3 or {}
        arg_0 = render_to_file(template=arg_0, arg_3=arg_3, arg_4=arg_4)
    put_or_dryrun(arg_0=arg_0, arg_1=arg_1, use_sudo=True)

Returns a template to a remote file . If no filename given a temporary filename will be generated and returned .


def Func ( arg_0 , arg_1 = 10 ) : arg_2 = len ( os . path . split ( arg_0 ) ) arg_3 = arg_2 + arg_1 for arg_4 , arg_5 , arg_6 in os . walk ( arg_0 ) : yield arg_4 , arg_5 , arg_6 if len ( os . path . split ( arg_4 ) ) >= arg_3 : break

def Func(arg_0, arg_1=10):
    '''
    Walk down a directory tree. Same as os.walk but allows for a depth limit
    via depth argument
    '''

    arg_2 = len(os.path.split(arg_0))
    arg_3 = arg_2 + arg_1

    for arg_4, arg_5, arg_6 in os.walk(arg_0):
        yield arg_4, arg_5, arg_6

        if len(os.path.split(arg_4)) >= arg_3:
            break

Walk down a directory tree . Same as os . walk but allows for a depth limit via depth argument