def Func ( arg_0 , arg_1 , arg_2 = False ) : with arg_0 . load_stream ( arg_1 , arg_2 = arg_2 ) as s : return s . read ( )

def Func(arg_0, arg_1, arg_2=False):
        """
        Load an arbitrary value identified by `key`.

        :param str key: The key that identifies the value
        :return: The loaded value
        """
        with arg_0.load_stream(arg_1, arg_2=arg_2) as s:
            return s.read()

Load an arbitrary value identified by key .


def Func(arg_0, arg_1, arg_2):
        """
        Configure stepper motor prior to operation.

        :param steps_per_revolution: number of steps per motor revolution

        :param stepper_pins: a list of control pin numbers - either 4 or 2
        """
        arg_3 = [arg_0.STEPPER_CONFIGURE, arg_1 & 0x7f, (arg_1 >> 7) & 0x7f]
        for arg_4 in range(len(arg_2)):
            arg_3.append(arg_2[arg_4])
        arg_0._command_handler.send_sysex(arg_0._command_handler.STEPPER_DATA, arg_3)

Configure stepper motor prior to operation .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """ receive - receive bytes from a file descriptor

            The receive system call reads up to count bytes from file descriptor fd to the
            buffer pointed to by buf. If count is zero, receive returns 0 and optionally
            sets *rx_bytes to zero.

            :param cpu: current CPU.
            :param fd: a valid file descriptor
            :param buf: a memory buffer
            :param count: max number of bytes to receive
            :param rx_bytes: if valid, points to the actual number of bytes received
            :return: 0            Success
                     EBADF        fd is not a valid file descriptor or is not open
                     EFAULT       buf or rx_bytes points to an invalid address.
        """
        arg_6 = ''
        if arg_4 != 0:
            if not arg_0._is_open(arg_2):
                logger.info("RECEIVE: Not valid file descriptor on receive. Returning EBADF")
                return Decree.CGC_EBADF

            # TODO check count bytes from buf
            if arg_3 not in arg_1.memory:  # or not  buf+count in cpu.memory:
                logger.info("RECEIVE: buf points to invalid address. Returning EFAULT")
                return Decree.CGC_EFAULT

            #import random
            #count = random.randint(1,count)
            if arg_2 > 2 and arg_0.files[arg_2].is_empty():
                arg_1.PC -= arg_1.instruction.size
                arg_0.wait([arg_2], [], None)
                raise RestartSyscall()

            # get some potential delay
            # if random.randint(5) == 0 and count > 1:
            #    count = count/2

            # Read the data and put it in memory
            arg_6 = arg_0.files[arg_2].receive(arg_4)
            arg_0.syscall_trace.append(("_receive", arg_2, arg_6))
            arg_1.write_bytes(arg_3, arg_6)

            arg_0.signal_receive(arg_2)

        # TODO check 4 bytes from rx_bytes
        if arg_5:
            if arg_5 not in arg_1.memory:
                logger.info("RECEIVE: Not valid file descriptor on receive. Returning EFAULT")
                return Decree.CGC_EFAULT
            arg_1.write_int(arg_5, len(arg_6), 32)

        logger.info("RECEIVE(%d, 0x%08x, %d, 0x%08x) -> <%s> (size:%d)" % (arg_2, arg_3, arg_4, arg_5, repr(arg_6)[:min(arg_4, 10)], len(arg_6)))
        return 0


def Func ( arg_0 ) : global PREDEFINED , HEX_MATCH , RGB_MATCH , RGBA_MATCH , HSL_MATCH , HSLA_MATCH arg_0 = arg_0 . strip ( ) if HEX_MATCH . match ( arg_0 ) or RGB_MATCH . match ( arg_0 ) or RGBA_MATCH . match ( arg_0 ) or HSL_MATCH . match ( arg_0 ) or HSLA_MATCH . match ( arg_0 ) or arg_0 in PREDEFINED : return True return False

def Func(arg_0):
    """Returns True if the value given is a valid CSS colour, i.e. matches one
    of the regular expressions in the module or is in the list of
    predetefined values by the browser.
    """
    global PREDEFINED, HEX_MATCH, RGB_MATCH, RGBA_MATCH, HSL_MATCH, HSLA_MATCH
    arg_0 = arg_0.strip()

    # hex match
    if HEX_MATCH.match(arg_0) or RGB_MATCH.match(arg_0) or \
            RGBA_MATCH.match(arg_0) or HSL_MATCH.match(arg_0) or \
            HSLA_MATCH.match(arg_0) or arg_0 in PREDEFINED:
        return True

    return False

Returns True if the value given is a valid CSS colour i . e . matches one of the regular expressions in the module or is in the list of predetefined values by the browser .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_1
=
_get_stash
(
arg_3
,
arg_1
,
arg_2
)
try
:
click
.
echo
(
'Purging stash...'
)
arg_1
.
purge
(
arg_0
)
click
.
echo
(
'Purge complete!'
)
except
GhostError
as
ex
:
sys
.
exit
(
ex
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Purge the stash from all of its keys
    """
    arg_1 = _get_stash(arg_3, arg_1, arg_2)

    try:
        click.echo('Purging stash...')
        arg_1.purge(arg_0)
        # Maybe we should verify that the list is empty
        # afterwards?
        click.echo('Purge complete!')
    except GhostError as ex:
        sys.exit(ex)


def Func ( arg_0 ) : arg_1 = { } arg_0 . _compute_derivatives ( ) arg_2 = utils . compute_ema ( arg_0 . smoothing_factor , arg_0 . derivatives ) for arg_3 , ( arg_4 , arg_5 ) in enumerate ( arg_0 . time_series_items ) : arg_1 [ arg_4 ] = abs ( arg_0 . derivatives [ arg_3 ] - arg_2 [ arg_3 ] ) arg_6 = numpy . std ( arg_1 . values ( ) ) if arg_6 : for arg_4 in arg_1 . keys ( ) : arg_1 [ arg_4 ] /= arg_6 arg_0 . anom_scores = TimeSeries ( arg_0 . _denoise_scores ( arg_1 ) )

def Func(arg_0):
    """
    Compute anomaly scores for the time series.
    """
    arg_1 = {}
    arg_0._compute_derivatives()
    arg_2 = utils.compute_ema(arg_0.smoothing_factor, arg_0.derivatives)
    for arg_3, (arg_4, arg_5) in enumerate(arg_0.time_series_items):
      arg_1[arg_4] = abs(arg_0.derivatives[arg_3] - arg_2[arg_3])
    arg_6 = numpy.std(arg_1.values())
    if arg_6:
        for arg_4 in arg_1.keys():
          arg_1[arg_4] /= arg_6
    arg_0.anom_scores = TimeSeries(arg_0._denoise_scores(arg_1))

Compute anomaly scores for the time series .


def
Func
(
arg_0
)
:
with
open
(
arg_0
.
log_file
)
as
fh
:
for
arg_1
in
fh
:
if
"Session aborted"
in
arg_1
:
return
if
"<<< barrier arrive"
in
arg_1
:
arg_2
=
re
.
match
(
".*process: (.*)\)"
,
arg_1
)
if
arg_2
:
arg_3
=
arg_2
.
group
(
1
)
if
arg_3
in
arg_0
.
processes
:
arg_0
.
processes
[
arg_3
]
[
"barrier"
]
=
"C"

def Func(arg_0):
        """Checks whether the channels to each process have been closed.
        """

        with open(arg_0.log_file) as fh:

            for arg_1 in fh:

                # Exit barrier update after session abort signal
                if "Session aborted" in arg_1:
                    return

                if "<<< barrier arrive" in arg_1:
                    # Retrieve process name from string
                    arg_2 = re.match(".*process: (.*)\)", arg_1)
                    if arg_2:
                        arg_3 = arg_2.group(1)
                        # Updates process channel to complete
                        if arg_3 in arg_0.processes:
                            arg_0.processes[arg_3]["barrier"] = "C"

Checks whether the channels to each process have been closed .


def Func(arg_0):
    """
    Get the time with TZ enabled

    """

    arg_1 = datetime.now()
    arg_2 = Template('{% load tz %}{% localtime on %}{% get_current_timezone as TIME_ZONE %}{{ TIME_ZONE }}{% endlocaltime %}')
    arg_3 = RequestContext(arg_0)
    arg_4 = arg_2.render(arg_3)
    return HttpResponse(arg_4)


def Func ( arg_0 , arg_1 , arg_2 = 'highlighted' ) : if not arg_1 : return arg_0 if not arg_0 : return '' arg_3 , arg_4 = get_text_tokenizer ( arg_1 ) arg_5 = highlight_text ( arg_3 , arg_0 , arg_2 , words = True ) return arg_5

def Func(arg_0, arg_1, arg_2='highlighted'):
    """ Given an list of words, this function highlights the matched words in the given string. """

    if not arg_1:
        return arg_0
    if not arg_0:
        return ''
    arg_3, arg_4 = get_text_tokenizer(arg_1)
    arg_5 = highlight_text(arg_3, arg_0, arg_2, words=True)
    return arg_5

Given an list of words this function highlights the matched words in the given string .


def
Func
(
arg_0
)
:
logger
.
debug
(
"=========================="
)
logger
.
debug
(
"Setting secondary channels"
)
logger
.
debug
(
"=========================="
)
logger
.
debug
(
"Setting secondary channels: {}"
.
format
(
arg_0
.
secondary_channels
)
)
for
arg_1
,
arg_2
in
arg_0
.
secondary_channels
.
items
(
)
:
for
arg_3
in
arg_2
.
values
(
)
:
if
not
arg_3
[
"end"
]
:
logger
.
debug
(
"[{}] No secondary links to setup"
.
format
(
arg_3
[
"p"
]
.
template
)
)
continue
logger
.
debug
(
"[{}] Setting secondary links for "
"source {}: {}"
.
format
(
arg_3
[
"p"
]
.
template
,
arg_1
,
arg_3
[
"end"
]
)
)
arg_3
[
"p"
]
.
set_secondary_channel
(
arg_1
,
arg_3
[
"end"
]
)

def Func(arg_0):
        """Sets the secondary channels for the pipeline

        This will iterate over the
        :py:attr:`NextflowGenerator.secondary_channels` dictionary that is
        populated when executing
        :func:`~NextflowGenerator._update_secondary_channels` method.
        """

        logger.debug("==========================")
        logger.debug("Setting secondary channels")
        logger.debug("==========================")

        logger.debug("Setting secondary channels: {}".format(
            arg_0.secondary_channels))

        for arg_1, arg_2 in arg_0.secondary_channels.items():

            for arg_3 in arg_2.values():

                if not arg_3["end"]:
                    logger.debug("[{}] No secondary links to setup".format(
                        arg_3["p"].template))
                    continue

                logger.debug("[{}] Setting secondary links for "
                             "source {}: {}".format(arg_3["p"].template,
                                                    arg_1,
                                                    arg_3["end"]))

                arg_3["p"].set_secondary_channel(arg_1, arg_3["end"])


def Func(arg_0, arg_1):
    """
    Performs the actual evaluation of Flas-CORS options and actually
    modifies the response object.

    This function is used both in the decorator and the after_request
    callback
    """

    # If CORS has already been evaluated via the decorator, skip
    if hasattr(arg_0, FLASK_CORS_EVALUATED):
        LOG.debug('CORS have been already evaluated, skipping')
        return arg_0

    # Some libraries, like OAuthlib, set resp.headers to non Multidict
    # objects (Werkzeug Headers work as well). This is a problem because
    # headers allow repeated values.
    if (not isinstance(arg_0.headers, Headers)
           and not isinstance(arg_0.headers, MultiDict)):
        arg_0.headers = MultiDict(arg_0.headers)

    arg_3 = get_cors_headers(arg_1, request.headers, request.method)

    LOG.debug('Settings CORS headers: %s', str(arg_3))

    for arg_4, arg_5 in arg_3.items():
        arg_0.headers.add(arg_4, arg_5)

    return arg_0

Performs the actual evaluation of Flas - CORS options and actually modifies the response object .


def Func ( arg_0 , arg_1 = arg_1 ) : for arg_2 , arg_3 , arg_4 in os . walk ( arg_0 ) : for arg_5 in arg_1 ( arg_4 ) : yield os . path . join ( arg_2 , arg_5 )

def Func(arg_0, arg_1=arg_1):
    """
    Discover all of the specs recursively inside ``path``.

    Successively yields the (full) relative paths to each spec.

    """

    for arg_2, arg_3, arg_4 in os.walk(arg_0):
        for arg_5 in arg_1(arg_4):
            yield os.path.join(arg_2, arg_5)

Discover all of the specs recursively inside path .


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
OptimizelyNode
(
)

def Func(arg_0, arg_1):
    """
    Optimizely template tag.

    Renders Javascript code to set-up A/B testing.  You must supply
    your Optimizely account number in the ``OPTIMIZELY_ACCOUNT_NUMBER``
    setting.
    """
    arg_2 = arg_1.split_contents()
    if len(arg_2) > 1:
        raise TemplateSyntaxError("'%s' takes no arguments" % arg_2[0])
    return OptimizelyNode()


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 in ( 'pyin' , 'pyout' , 'pyerr' , 'stdout' , 'stderr' ) : arg_2 [ arg_3 ] = arg_1 [ arg_3 ] arg_4 = { 'result_content' : arg_1 [ 'result_content' ] , 'header' : arg_1 [ 'header' ] , 'result_header' : arg_1 [ 'result_header' ] , 'received' : arg_1 [ 'received' ] , 'io' : arg_2 , } if arg_1 [ 'result_buffers' ] : arg_5 = map ( bytes , arg_1 [ 'result_buffers' ] ) else : arg_5 = [ ] return arg_4 , arg_5

def Func(arg_0, arg_1):
        """decompose a TaskRecord dict into subsection of reply for get_result"""
        arg_2 = {}
        for arg_3 in ('pyin', 'pyout', 'pyerr', 'stdout', 'stderr'):
                arg_2[arg_3] = arg_1[arg_3]
        arg_4 = { 'result_content': arg_1['result_content'],
                            'header': arg_1['header'],
                            'result_header' : arg_1['result_header'],
                            'received' : arg_1['received'],
                            'io' : arg_2,
                          }
        if arg_1['result_buffers']:
            arg_5 = map(bytes, arg_1['result_buffers'])
        else:
            arg_5 = []

        return arg_4, arg_5


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
ok
if
arg_1
>=
60
:
arg_3
,
arg_1
=
divmod
(
arg_1
,
60
)
return
"%s minutes %s seconds"
%
(
arg_2
(
"%d"
%
arg_3
)
,
arg_2
(
"%.3f"
%
arg_1
)
)
else
:
return
"%s seconds"
%
(
arg_2
(
"%.3f"
%
arg_1
)
)

def Func(arg_0, arg_1):
        """Format a time in seconds."""
        arg_2 = arg_0.ok
        if arg_1 >= 60:
            arg_3, arg_1 = divmod(arg_1, 60)
            return "%s minutes %s seconds" % (
                        arg_2("%d" % arg_3),
                        arg_2("%.3f" % arg_1))
        else:
            return "%s seconds" % (
                        arg_2("%.3f" % arg_1))


def Func ( arg_0 ) : from django . utils import translation from django . utils . safestring import mark_safe if translation . get_language_Func ( ) : arg_1 = { 'LANGUAGE_DIRECTION' : 'rtl' , 'LANGUAGE_START' : 'right' , 'LANGUAGE_END' : 'left' , 'LANGUAGE_MARKER' : mark_safe ( '' ) , } else : arg_1 = { 'LANGUAGE_DIRECTION' : 'ltr' , 'LANGUAGE_START' : 'left' , 'LANGUAGE_END' : 'right' , 'LANGUAGE_MARKER' : mark_safe ( '' ) , } return arg_1

def Func(arg_0):
    """Adds to the context BiDi related variables

    LANGUAGE_DIRECTION -- Direction of current language ('ltr' or 'rtl')
    LANGUAGE_START -- Start of language layout ('right' for rtl, 'left'
                      for 'ltr')
    LANGUAGE_END -- End of language layout ('left' for rtl, 'right'
                      for 'ltr')
    LANGUAGE_MARKER -- Language marker entity ('' for rtl, '&lrm'
                       for ltr)

    """
    from django.utils import translation
    from django.utils.safestring import mark_safe

    if translation.get_language_Func():
        arg_1 = {
            'LANGUAGE_DIRECTION':'rtl',
            'LANGUAGE_START':'right',
            'LANGUAGE_END':'left',
            'LANGUAGE_MARKER': mark_safe(''),
        }
    else:
        arg_1 = {
            'LANGUAGE_DIRECTION':'ltr',
            'LANGUAGE_START':'left',
            'LANGUAGE_END':'right',
            'LANGUAGE_MARKER': mark_safe(''),
        }

    return arg_1


return (a.shape == b.shape) and allclose(a, b)

def Func ( arg_0 , arg_1 ) : from numpy import Func return ( arg_0 . shape == arg_1 . shape ) and Func ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
    """
    Test that a and b are close and match in shape.

    Parameters
    ----------
    a : ndarray
        First array to check

    b : ndarray
        First array to check
    """
    from numpy import Func
    return (arg_0.shape == arg_1.shape) and Func(arg_0, arg_1)

Test that a and b are close and match in shape .


(sigOrVal: Union[RtlSignal, Value], bitsInOne: int=1,
             skipPadding: bool=True, fillup: bool=False)

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 ] , arg_4 : arg_5 = 1 , arg_6 : arg_7 = True , arg_8 : arg_7 = False ) : arg_9 = BitWalker ( arg_0 , arg_6 , arg_8 ) for arg_10 in range ( ceil ( arg_0 . _dtype . bit_length ( ) / arg_4 ) ) : yield arg_9 . get ( arg_4 ) arg_9 . assertIsOnEnd ( )

def Func(arg_0: arg_1[arg_2, arg_3], arg_4: arg_5=1,
             arg_6: arg_7=True, arg_8: arg_7=False):
    """
    Iterate over bits in vector

    :param sigOrVal: signal or value to iterate over
    :param bitsInOne: number of bits in one part
    :param skipPadding: if true padding is skipped in dense types
    """
    arg_9 = BitWalker(arg_0, arg_6, arg_8)
    for arg_10 in range(ceil(arg_0._dtype.bit_length() / arg_4)):
        yield arg_9.get(arg_4)

    arg_9.assertIsOnEnd()


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . material . compounds : return arg_0 . _compound_masses [ arg_0 . material . get_compound_index ( arg_1 ) ] else : return 0.0

def Func(arg_0, arg_1):
        """
        Determine the mass of the specified compound in the package.

        :param compound: Formula and phase of a compound, e.g. "Fe2O3[S1]".

        :returns: Mass. [kg]
        """

        if arg_1 in arg_0.material.compounds:
            return arg_0._compound_masses[
                arg_0.material.get_compound_index(arg_1)]
        else:
            return 0.0

Determine the mass of the specified compound in the package .


(transactions, bin_minutes=5, tz='America/New_York',
                       ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
=
5
,
arg_2
=
'America/New_York'
,
arg_3
=
,
**
arg_4
)
:
if
arg_3
is
:
arg_3
=
plt
.
gca
(
)
arg_5
=
arg_0
.
copy
(
)
arg_5
.
index
=
arg_5
.
index
.
tz_convert
(
pytz
.
timezone
(
arg_2
)
)
arg_5
.
index
=
arg_5
.
index
.
map
(
lambda
x
:
x
.
hour
*
60
+
x
.
minute
)
arg_5
[
'trade_value'
]
=
(
arg_5
.
amount
*
arg_5
.
price
)
.
abs
(
)
arg_5
=
arg_5
.
groupby
(
level
=
0
)
.
sum
(
)
.
reindex
(
arg_6
=
range
(
570
,
961
)
)
arg_5
.
index
=
(
arg_5
.
index
/
arg_1
)
.
astype
(
int
)
*
arg_1
arg_5
=
arg_5
.
groupby
(
level
=
0
)
.
sum
(
)
arg_5
[
'time_str'
]
=
arg_5
.
index
.
map
(
lambda
x
:
str
(
datetime
.
time
(
int
(
x
/
60
)
,
x
%
60
)
)
[
:
3
]
)
arg_7
=
arg_5
.
trade_value
.
sum
(
)
arg_5
.
trade_value
=
arg_5
.
trade_value
.
fillna
(
0
)
/
arg_7
arg_3
.
bar
(
arg_5
.
index
,
arg_5
.
trade_value
,
width
=
arg_1
,
**
arg_4
)
arg_3
.
set_xlim
(
570
,
960
)
arg_3
.
set_xticks
(
arg_5
.
index
[
:
:
int
(
30
/
arg_1
)
]
)
arg_3
.
set_xticklabels
(
arg_5
.
time_str
[
:
:
int
(
30
/
arg_1
)
]
)
arg_3
.
set_title
(
'Transaction time distribution'
)
arg_3
.
set_ylabel
(
'Proportion'
)
arg_3
.
set_xlabel
(
''
)
return
arg_3

def Func(arg_0, arg_1=5, arg_2='America/New_York',
                       arg_3=None, **arg_4):
    """
    Plots a histogram of transaction times, binning the times into
    buckets of a given duration.

    Parameters
    ----------
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in tears.create_full_tear_sheet.
    bin_minutes : float, optional
        Sizes of the bins in minutes, defaults to 5 minutes.
    tz : str, optional
        Time zone to plot against. Note that if the specified
        zone does not apply daylight savings, the distribution
        may be partially offset.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

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

    arg_5 = arg_0.copy()

    arg_5.index = arg_5.index.tz_convert(pytz.timezone(arg_2))
    arg_5.index = arg_5.index.map(lambda x: x.hour * 60 + x.minute)
    arg_5['trade_value'] = (arg_5.amount * arg_5.price).abs()
    arg_5 = arg_5.groupby(level=0).sum().reindex(arg_6=range(570, 961))
    arg_5.index = (arg_5.index / arg_1).astype(int) * arg_1
    arg_5 = arg_5.groupby(level=0).sum()

    arg_5['time_str'] = arg_5.index.map(lambda x:
                                              str(datetime.time(int(x / 60),
                                                                x % 60))[:-3])

    arg_7 = arg_5.trade_value.sum()
    arg_5.trade_value = arg_5.trade_value.fillna(0) / arg_7

    arg_3.bar(arg_5.index, arg_5.trade_value, width=arg_1, **arg_4)

    arg_3.set_xlim(570, 960)
    arg_3.set_xticks(arg_5.index[::int(30 / arg_1)])
    arg_3.set_xticklabels(arg_5.time_str[::int(30 / arg_1)])
    arg_3.set_title('Transaction time distribution')
    arg_3.set_ylabel('Proportion')
    arg_3.set_xlabel('')
    return arg_3

Plots a histogram of transaction times binning the times into buckets of a given duration .


(self, function_name, new_doc, old_doc, user_ctx)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : try : arg_5 = get_function ( arg_1 ) except Exception , exc : arg_0 . log ( repr ( exc ) ) return False try : return arg_5 ( arg_2 , arg_3 , arg_4 ) except Exception , exc : arg_0 . log ( repr ( exc ) ) return repr ( exc )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Validate...this function is undocumented, but still in CouchDB."""
        try:
            arg_5 = get_function(arg_1)
        except Exception, exc:
            arg_0.log(repr(exc))
            return False
        try:
            return arg_5(arg_2, arg_3, arg_4)
        except Exception, exc:
            arg_0.log(repr(exc))
            return repr(exc)

Validate ... this function is undocumented but still in CouchDB .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
**
arg_3
)
:
arg_4
=
getattr
(
arg_0
,
'Funcger'
,
)
or
authomatic
.
core
.
Funcger
arg_4
.
log
(
arg_1
,
': '
.
join
(
(
'authomatic'
,
arg_0
.
__name__
,
arg_2
)
)
,
**
arg_3
)

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Logs a message with pre-formatted prefix.

        :param int level:
            Logging level as specified in the
            `login module <http://docs.python.org/2/library/logging.html>`_ of
            Python standard library.

        :param str msg:
            The actual message.

        """

        arg_4 = getattr(arg_0, 'Funcger', None) or authomatic.core.Funcger
        arg_4.log(
            arg_1, ': '.join(
                ('authomatic', arg_0.__name__, arg_2)), **arg_3)

Logs a message with pre - formatted prefix .


(self, msgid, scope="package", line=None, ignore_unknown=False)

def Func(arg_0, arg_1, arg_2="package", arg_3=None, arg_4=False):
        """reFunc message of the given id"""
        arg_0._set_msg_status(
            arg_1, Func=True, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4
        )
        arg_0._register_by_id_managed_msg(arg_1, arg_3, is_disabled=False)


def Func ( arg_0 , arg_1 = True ) : if arg_1 : arg_2 = np . zeros ( ( arg_0 . nV , arg_0 . nV ) ) for arg_3 in arg_0 . g . nodes ( ) : arg_4 = [ e [ 1 ] for e in sorted ( arg_0 . g . out_edges ( arg_3 ) ) ] arg_2 [ arg_3 , arg_4 ] = arg_0 . _route_probs [ arg_3 ] else : arg_2 = { k : { e [ 1 ] : p for e , p in zip ( sorted ( arg_0 . g . out_edges ( k ) ) , value ) } for k , value in enumerate ( arg_0 . _route_probs ) } return arg_2

def Func(arg_0, arg_1=True):
        """Returns the routing probabilities for each vertex in the
        graph.

        Parameters
        ----------
        return_matrix : bool (optional, the default is ``True``)
            Specifies whether an :class:`~numpy.ndarray` is returned.
            If ``False``, a dict is returned instead.

        Returns
        -------
        out : a dict or :class:`~numpy.ndarray`
            The transition probabilities for each vertex in the graph.
            If ``out`` is an :class:`~numpy.ndarray`, then
            ``out[v, u]`` returns the probability of a transition from
            vertex ``v`` to vertex ``u``. If ``out`` is a dict
            then ``out_edge[v][u]`` is the probability of moving from
            vertex ``v`` to the vertex ``u``.

        Examples
        --------
        Lets change the routing probabilities:

        >>> import queueing_tool as qt
        >>> import networkx as nx
        >>> g = nx.sedgewick_maze_graph()
        >>> net = qt.QueueNetwork(g)

        Below is an adjacency list for the graph ``g``.

        >>> ans = qt.graph2dict(g, False)
        >>> {k: sorted(v) for k, v in ans.items()}
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: [2, 5, 7],
         1: [7],
         2: [0, 6],
         3: [4, 5],
         4: [3, 5, 6, 7],
         5: [0, 3, 4],
         6: [2, 4],
         7: [0, 1, 4]}

        The default transition matrix is every out edge being equally
        likely:

        >>> net.Func(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 0.333..., 5: 0.333..., 7: 0.333...},
         1: {7: 1.0},
         2: {0: 0.5, 6: 0.5},
         3: {4: 0.5, 5: 0.5},
         4: {3: 0.25, 5: 0.25, 6: 0.25, 7: 0.25},
         5: {0: 0.333..., 3: 0.333..., 4: 0.333...},
         6: {2: 0.5, 4: 0.5},
         7: {0: 0.333..., 1: 0.333..., 4: 0.333...}}

        Now we will generate a random routing matrix:

        >>> mat = qt.generate_transition_matrix(g, seed=96)
        >>> net.set_Func(mat)
        >>> net.Func(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 0.112..., 5: 0.466..., 7: 0.420...},
         1: {7: 1.0},
         2: {0: 0.561..., 6: 0.438...},
         3: {4: 0.545..., 5: 0.454...},
         4: {3: 0.374..., 5: 0.381..., 6: 0.026..., 7: 0.217...},
         5: {0: 0.265..., 3: 0.460..., 4: 0.274...},
         6: {2: 0.673..., 4: 0.326...},
         7: {0: 0.033..., 1: 0.336..., 4: 0.630...}}

        What this shows is the following: when an :class:`.Agent` is at
        vertex ``2`` they will transition to vertex ``0`` with
        probability ``0.561`` and route to vertex ``6`` probability
        ``0.438``, when at vertex ``6`` they will transition back to
        vertex ``2`` with probability ``0.673`` and route vertex ``4``
        probability ``0.326``, etc.
        """
        if arg_1:
            arg_2 = np.zeros((arg_0.nV, arg_0.nV))
            for arg_3 in arg_0.g.nodes():
                arg_4 = [e[1] for e in sorted(arg_0.g.out_edges(arg_3))]
                arg_2[arg_3, arg_4] = arg_0._route_probs[arg_3]
        else:
            arg_2 = {
                k: {e[1]: p for e, p in zip(sorted(arg_0.g.out_edges(k)), value)}
                for k, value in enumerate(arg_0._route_probs)
            }

        return arg_2

Returns the routing probabilities for each vertex in the
        graph.

        Parameters
        ----------
        return_matrix : bool (optional, the default is ``True``)
            Specifies whether an :class:`~numpy.ndarray` is returned.
            If ``False``, a dict is returned instead.

        Returns
        -------
        out : a dict or :class:`~numpy.ndarray`
            The transition probabilities for each vertex in the graph.
            If ``out`` is an :class:`~numpy.ndarray`, then
            ``out[v, u]`` returns the probability of a transition from
            vertex ``v`` to vertex ``u``. If ``out`` is a dict
            then ``out_edge[v][u]`` is the probability of moving from
            vertex ``v`` to the vertex ``u``.

        Examples
        --------
        Lets change the routing probabilities:

        >>> import queueing_tool as qt
        >>> import networkx as nx
        >>> g = nx.sedgewick_maze_graph()
        >>> net = qt.QueueNetwork(g)

        Below is an adjacency list for the graph ``g``.

        >>> ans = qt.graph2dict(g, False)
        >>> {k: sorted(v) for k, v in ans.items()}
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: [2, 5, 7],
         1: [7],
         2: [0, 6],
         3: [4, 5],
         4: [3, 5, 6, 7],
         5: [0, 3, 4],
         6: [2, 4],
         7: [0, 1, 4]}

        The default transition matrix is every out edge being equally
        likely:

        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 0.333..., 5: 0.333..., 7: 0.333...},
         1: {7: 1.0},
         2: {0: 0.5, 6: 0.5},
         3: {4: 0.5, 5: 0.5},
         4: {3: 0.25, 5: 0.25, 6: 0.25, 7: 0.25},
         5: {0: 0.333..., 3: 0.333..., 4: 0.333...},
         6: {2: 0.5, 4: 0.5},
         7: {0: 0.333..., 1: 0.333..., 4: 0.333...}}

        Now we will generate a random routing matrix:

        >>> mat = qt.generate_transition_matrix(g, seed=96)
        >>> net.set_transitions(mat)
        >>> net.transitions(False)  # doctest: +ELLIPSIS
        ...                         # doctest: +NORMALIZE_WHITESPACE
        {0: {2: 0.112..., 5: 0.466..., 7: 0.420...},
         1: {7: 1.0},
         2: {0: 0.561..., 6: 0.438...},
         3: {4: 0.545..., 5: 0.454...},
         4: {3: 0.374..., 5: 0.381..., 6: 0.026..., 7: 0.217...},
         5: {0: 0.265..., 3: 0.460..., 4: 0.274...},
         6: {2: 0.673..., 4: 0.326...},
         7: {0: 0.033..., 1: 0.336..., 4: 0.630...}}

        What this shows is the following: when an :class:`.Agent` is at
        vertex ``2`` they will transition to vertex ``0`` with
        probability ``0.561`` and route to vertex ``6`` probability
        ``0.438``, when at vertex ``6`` they will transition back to
        vertex ``2`` with probability ``0.673`` and route vertex ``4``
        probability ``0.326``, etc.

Returns the routing probabilities for each vertex in the graph .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get ( '_files' , [ ] ) arg_3 = set ( ) for arg_4 in arg_2 : arg_3 . add ( arg_4 . get ( 'bucket' ) ) for arg_5 in arg_3 : arg_6 = Bucket . get ( arg_5 ) arg_6 . deleted = True

def Func(arg_0, arg_1):
        """Delete the bucket."""
        arg_2 = arg_1.get('_files', [])
        arg_3 = set()
        for arg_4 in arg_2:
            arg_3.add(arg_4.get('bucket'))
        for arg_5 in arg_3:
            arg_6 = Bucket.get(arg_5)
            arg_6.deleted = True


def Func ( arg_0 , arg_1 ) : arg_2 = 'task_{:05d}' . format ( arg_1 ) arg_3 = os . path . join ( 'results' , arg_2 , 'result.p.gz' ) return arg_3

def Func(arg_0, arg_1):
        """Returns the relative path of the result

        This method returns the path to the result relative to the
        top dir of the working area. This method simply constructs the
        path based on the convention and doesn't check if the result
        actually exists.

        Parameters
        ----------
        package_index :
            a package index

        Returns
        -------
        str
            the relative path to the result

        """

        arg_2 = 'task_{:05d}'.format(arg_1)
        # e.g., 'task_00009'

        arg_3 = os.path.join('results', arg_2, 'result.p.gz')
        # e.g., 'results/task_00009/result.p.gz'

        return arg_3


def Func ( arg_0 ) : arg_1 = dict ( vars ( arg_0 ) , sort_keys = True ) arg_1 [ 'type' ] = arg_0 . __class__ . __name__ return json . dumps ( arg_1 )

def Func(arg_0):
        """Convert data to json string representation.

        Returns:
          json representation as string.
        """
        arg_1 = dict(vars(arg_0), sort_keys=True)
        arg_1['type'] = arg_0.__class__.__name__
        return json.dumps(arg_1)

Convert data to json string representation .


If intervals intersect, returns their union, otherwise returns None

def Func ( arg_0 , arg_1 ) : if arg_0 . intersects ( arg_1 ) or arg_0 . end + 1 == arg_1 . start or arg_1 . end + 1 == arg_0 . start : return Interval ( min ( arg_0 . start , arg_1 . start ) , max ( arg_0 . end , arg_1 . end ) ) else : return None

def Func(arg_0, arg_1):
        '''If intervals intersect, returns their Func, otherwise returns None'''
        if arg_0.intersects(arg_1) or arg_0.end + 1 == arg_1.start or arg_1.end + 1 == arg_0.start:
            return Interval(min(arg_0.start, arg_1.start), max(arg_0.end, arg_1.end))
        else:
            return None

If intervals intersect returns their union otherwise returns None


(path: str,
                                      gene_symbol_column: str = 'Gene.symbol',
                                      logfc_column: str = 'logFC',
                                      aggregator: Optional[Callable[[List[float]], float]] = None,
                                      )

return {
        gene_symbol: aggregator(log_fold_changes)
        for gene_symbol, log_fold_changes in values.items()
    }

def Func ( arg_0 : arg_1 , arg_2 : arg_1 = 'Gene.symbol' , arg_3 : arg_1 = 'logFC' , arg_4 : arg_5 [ arg_6 [ [ arg_7 [ arg_8 ] ] , arg_8 ] ] = None , ) -> Mapping [ arg_1 , arg_8 ] : if arg_4 is None : arg_4 = np . median arg_9 = pd . read_csv ( arg_0 ) assert arg_2 in arg_9 . columns assert arg_3 in arg_9 . columns arg_9 = arg_9 . loc [ arg_9 [ arg_2 ] . notnull ( ) , [ arg_2 , arg_3 ] ] arg_10 = defaultdict ( list ) for arg_11 , arg_12 , arg_13 in arg_9 . itertuples ( ) : arg_10 [ arg_12 ] . append ( arg_13 ) return { arg_12 : arg_4 ( arg_14 ) for arg_12 , arg_14 in arg_10 . items ( ) }

def Func(arg_0: arg_1,
                                      arg_2: arg_1 = 'Gene.symbol',
                                      arg_3: arg_1 = 'logFC',
                                      arg_4: arg_5[arg_6[[arg_7[arg_8]], arg_8]] = None,
                                      ) -> Mapping[arg_1, arg_8]:
    """Load and pre-process a differential gene expression data.

    :param path: The path to the CSV
    :param gene_symbol_column: The header of the gene symbol column in the data frame
    :param logfc_column: The header of the log-fold-change column in the data frame
    :param aggregator: A function that aggregates a list of differential gene expression values. Defaults to
                       :func:`numpy.median`. Could also use: :func:`numpy.mean`, :func:`numpy.average`,
                       :func:`numpy.min`, or :func:`numpy.max`
    :return: A dictionary of {gene symbol: log fold change}
    """
    if arg_4 is None:
        arg_4 = np.median

    # Load the data frame
    arg_9 = pd.read_csv(arg_0)

    # Check the columns exist in the data frame
    assert arg_2 in arg_9.columns
    assert arg_3 in arg_9.columns

    # throw away columns that don't have gene symbols - these represent control sequences
    arg_9 = arg_9.loc[arg_9[arg_2].notnull(), [arg_2, arg_3]]

    arg_10 = defaultdict(list)

    for arg_11, arg_12, arg_13 in arg_9.itertuples():
        arg_10[arg_12].append(arg_13)

    return {
        arg_12: arg_4(arg_14)
        for arg_12, arg_14 in arg_10.items()
    }

Load and pre - process a differential gene expression data .


def Func ( arg_0 , arg_1 = True ) : if arg_1 : return arg_0 . _children . copy ( ) else : return arg_0 . _children

def Func(arg_0, arg_1=True):
        """Returns a children dictionary.

        :param copy:

            Whether the group's original dictionary or a shallow copy is returned.
            If you want the real dictionary please do not modify it at all!

        :returns: Dictionary of nodes

        """
        if arg_1:
            return arg_0._children.copy()
        else:
            return arg_0._children


def Func(arg_0, arg_1, arg_2):
    """Read parameters from input file, -j, and -p arguments, in that order."""
    arg_3 = {}
    try:
        if arg_0:
            arg_3.update(json.load(arg_0))
        if arg_1 is not None:
            arg_3.update(json.loads(arg_1))
    except ValueError as e:
        raise ValueError("input is not valid JSON: %s" % e)
    try:
        arg_3.update({arg_4.split('=', 1)[0]: arg_4.split('=', 1)[1] for arg_4 in arg_2})
    except IndexError:
        raise ValueError("--param arguments must have key=value format")
    return arg_3

Read parameters from input file - j and - p arguments in that order .


def
Func
(
arg_0
,
arg_1
=
False
)
:
if
not
os
.
path
.
exists
(
arg_0
)
:
if
os
.
path
.
islink
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting broken link="{}"'
.
format
(
arg_0
)
)
os
.
unlink
(
arg_0
)
elif
os
.
path
.
isdir
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting broken directory link="{}"'
.
format
(
arg_0
)
)
os
.
rmdir
(
arg_0
)
elif
os
.
path
.
isfile
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting broken file link="{}"'
.
format
(
arg_0
)
)
os
.
unlink
(
arg_0
)
else
:
if
arg_1
:
print
(
'Not deleting non-existant path="{}"'
.
format
(
arg_0
)
)
else
:
if
os
.
path
.
islink
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting symbolic link="{}"'
.
format
(
arg_0
)
)
os
.
unlink
(
arg_0
)
elif
os
.
path
.
isfile
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting file="{}"'
.
format
(
arg_0
)
)
os
.
unlink
(
arg_0
)
elif
os
.
path
.
isdir
(
arg_0
)
:
if
arg_1
:
print
(
'Deleting directory="{}"'
.
format
(
arg_0
)
)
if
sys
.
platform
.
startswith
(
'win32'
)
:
from
ubelt
import
_win32_links
_win32_links
.
_win32_rmtree
(
arg_0
,
arg_1
=
arg_1
)
else
:
import
shutil
shutil
.
rmtree
(
arg_0
)

def Func(arg_0, arg_1=False):
    """
    Removes a file or recursively removes a directory.
    If a path does not exist, then this is does nothing.

    Args:
        path (PathLike): file or directory to remove
        verbose (bool): if True prints what is being done

    SeeAlso:
        send2trash - A cross-platform Python package for sending files
            to the trash instead of irreversibly deleting them.
            https://github.com/hsoft/send2trash

    Doctest:
        >>> import ubelt as ub
        >>> base = ub.ensure_app_cache_dir('ubelt', 'Func_test')
        >>> dpath1 = ub.ensuredir(join(base, 'dir'))
        >>> ub.ensuredir(join(base, 'dir', 'subdir'))
        >>> ub.touch(join(base, 'dir', 'to_remove1.txt'))
        >>> fpath1 = join(base, 'dir', 'subdir', 'to_remove3.txt')
        >>> fpath2 = join(base, 'dir', 'subdir', 'to_remove2.txt')
        >>> ub.touch(fpath1)
        >>> ub.touch(fpath2)
        >>> assert all(map(exists, (dpath1, fpath1, fpath2)))
        >>> ub.Func(fpath1)
        >>> assert all(map(exists, (dpath1, fpath2)))
        >>> assert not exists(fpath1)
        >>> ub.Func(dpath1)
        >>> assert not any(map(exists, (dpath1, fpath1, fpath2)))

    Doctest:
        >>> import ubelt as ub
        >>> dpath = ub.ensure_app_cache_dir('ubelt', 'Func_test2')
        >>> dpath1 = ub.ensuredir(join(dpath, 'dir'))
        >>> fpath1 = ub.touch(join(dpath1, 'to_remove.txt'))
        >>> assert exists(fpath1)
        >>> ub.Func(dpath)
        >>> assert not exists(fpath1)
    """
    if not os.path.exists(arg_0):
        # if the file does exists and is not a broken link
        if os.path.islink(arg_0):
            if arg_1:  # nocover
                print('Deleting broken link="{}"'.format(arg_0))
            os.unlink(arg_0)
        elif os.path.isdir(arg_0):  # nocover
            # Only on windows will a file be a directory and not exist
            if arg_1:
                print('Deleting broken directory link="{}"'.format(arg_0))
            os.rmdir(arg_0)
        elif os.path.isfile(arg_0):  # nocover
            # This is a windows only case
            if arg_1:
                print('Deleting broken file link="{}"'.format(arg_0))
            os.unlink(arg_0)
        else:
            if arg_1:  # nocover
                print('Not deleting non-existant path="{}"'.format(arg_0))
    else:
        if os.path.islink(arg_0):
            if arg_1:  # nocover
                print('Deleting symbolic link="{}"'.format(arg_0))
            os.unlink(arg_0)
        elif os.path.isfile(arg_0):
            if arg_1:  # nocover
                print('Deleting file="{}"'.format(arg_0))
            os.unlink(arg_0)
        elif os.path.isdir(arg_0):
            if arg_1:  # nocover
                print('Deleting directory="{}"'.format(arg_0))
            if sys.platform.startswith('win32'):  # nocover
                # Workaround bug that prevents shutil from working if
                # the directory contains junctions
                from ubelt import _win32_links
                _win32_links._win32_rmtree(arg_0, arg_1=arg_1)
            else:
                import shutil
                shutil.rmtree(arg_0)

Removes a file or recursively removes a directory.
    If a path does not exist, then this is does nothing.

    Args:
        path (PathLike): file or directory to remove
        verbose (bool): if True prints what is being done

    SeeAlso:
        send2trash - A cross-platform Python package for sending files
            to the trash instead of irreversibly deleting them.
            https://github.com/hsoft/send2trash

    Doctest:
        >>> import ubelt as ub
        >>> base = ub.ensure_app_cache_dir('ubelt', 'delete_test')
        >>> dpath1 = ub.ensuredir(join(base, 'dir'))
        >>> ub.ensuredir(join(base, 'dir', 'subdir'))
        >>> ub.touch(join(base, 'dir', 'to_remove1.txt'))
        >>> fpath1 = join(base, 'dir', 'subdir', 'to_remove3.txt')
        >>> fpath2 = join(base, 'dir', 'subdir', 'to_remove2.txt')
        >>> ub.touch(fpath1)
        >>> ub.touch(fpath2)
        >>> assert all(map(exists, (dpath1, fpath1, fpath2)))
        >>> ub.delete(fpath1)
        >>> assert all(map(exists, (dpath1, fpath2)))
        >>> assert not exists(fpath1)
        >>> ub.delete(dpath1)
        >>> assert not any(map(exists, (dpath1, fpath1, fpath2)))

    Doctest:
        >>> import ubelt as ub
        >>> dpath = ub.ensure_app_cache_dir('ubelt', 'delete_test2')
        >>> dpath1 = ub.ensuredir(join(dpath, 'dir'))
        >>> fpath1 = ub.touch(join(dpath1, 'to_remove.txt'))
        >>> assert exists(fpath1)
        >>> ub.delete(dpath)
        >>> assert not exists(fpath1)

Removes a file or recursively removes a directory . If a path does not exist then this is does nothing .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_2
[
'is_complex'
]
:
raise
ParseError
(
'Complex arrays are not supported'
)
arg_4
=
read_elements
(
arg_0
,
arg_1
,
arg_3
)
if
not
isinstance
(
arg_4
,
Sequence
)
:
return
arg_4
arg_5
=
arg_2
[
'dims'
]
[
0
]
arg_6
=
arg_2
[
'dims'
]
[
1
]
arg_7
=
[
list
(
arg_4
[
c
*
arg_5
+
r
]
for
c
in
range
(
arg_6
)
)
for
r
in
range
(
arg_5
)
]
return
squeeze
(
arg_7
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Read a numeric matrix.
    Returns an array with rows of the numeric matrix.
    """
    if arg_2['is_complex']:
        raise ParseError('Complex arrays are not supported')
    # read array data (stored as column-major)
    arg_4 = read_elements(arg_0, arg_1, arg_3)
    if not isinstance(arg_4, Sequence):
        # not an array, just a value
        return arg_4
    # transform column major data continous array to
    # a row major array of nested lists
    arg_5 = arg_2['dims'][0]
    arg_6 = arg_2['dims'][1]
    arg_7 = [list(arg_4[c * arg_5 + r] for c in range(arg_6))
             for r in range(arg_5)]
    # pack and return the array
    return squeeze(arg_7)

Read a numeric matrix . Returns an array with rows of the numeric matrix .


return filter(lambda x: pat.match(x.xml_name) is not None, select_elements(source))

def Func ( arg_0 , arg_1 ) : return filter ( lambda x : arg_1 . match ( x . xml_name ) is not None , select_elements ( arg_0 ) )

def Func(arg_0, arg_1):
    '''
    Yields elements from the source whose name matches the given regular expression pattern
    source - if an element, starts with all child elements in order; can also be any other iterator
    pat - re.pattern object
    '''
    return filter(lambda x: arg_1.match(x.xml_name) is not None, select_elements(arg_0))

Yields elements from the source whose name matches the given regular expression pattern source - if an element starts with all child elements in order ; can also be any other iterator pat - re . pattern object


def Func(arg_0):
        """Try to authenticate using the first one of allowed authentication
        methods left.

        [client only]"""
        if arg_0.authenticated:
            arg_0.__logger.debug("try_auth: already authenticated")
            return
        arg_0.__logger.debug("trying auth: %r" % (arg_0._auth_methods_left,))
        if not arg_0._auth_methods_left:
            raise LegacyAuthenticationError("No allowed authentication methods available")
        arg_1=arg_0._auth_methods_left[0]
        if arg_1.startswith("sasl:"):
            return ClientStream.Func(arg_0)
        elif arg_1 not in ("plain","digest"):
            arg_0._auth_methods_left.pop(0)
            arg_0.__logger.debug("Skipping unknown auth method: %s" % arg_1)
            return arg_0.Func()
        elif arg_0.available_auth_methods is not None:
            if arg_1 in arg_0.available_auth_methods:
                arg_0._auth_methods_left.pop(0)
                arg_0.auth_method_used=arg_1
                if arg_1=="digest":
                    arg_0._digest_auth_stage2(arg_0.auth_stanza)
                else:
                    arg_0._plain_auth_stage2(arg_0.auth_stanza)
                arg_0.auth_stanza=None
                return
            else:
                arg_0.__logger.debug("Skipping unavailable auth method: %s" % arg_1)
        else:
            arg_0._auth_stage1()

Try to authenticate using the first one of allowed authentication methods left .


def Func(arg_0, arg_1):
        """
        remove one or multiple peers from PEERS variable

        :param peer(list or string):
        """
        if type(arg_1) == list:
            for arg_2 in arg_1:
                check_url(arg_2)
                for arg_3 in arg_0.PEERS:
                    if arg_2 in arg_3:
                        arg_0.PEERS.remove(arg_3)
        elif type(arg_1) == str:
            check_url(arg_1)
            for arg_3 in arg_0.PEERS:
                if arg_1 == arg_3:
                    arg_0.PEERS.remove(arg_3)
        else:
            raise ValueError('peer paramater did not pass url validation')


(self, path, prefixed_path, source_storage)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
if
arg_0
.
storage
.
exists
(
arg_2
)
:
try
:
arg_4
=
arg_0
.
storage
.
modified_time
(
arg_2
)
except
(
OSError
,
NotImplementedError
,
AttributeError
)
:
pass
else
:
try
:
arg_5
=
arg_3
.
modified_time
(
arg_1
)
except
(
OSError
,
NotImplementedError
,
AttributeError
)
:
pass
else
:
if
arg_0
.
local
:
arg_6
=
arg_0
.
storage
.
path
(
arg_2
)
else
:
arg_6
=
if
(
arg_4
.
replace
(
microsecond
=
0
)
>=
arg_5
.
replace
(
microsecond
=
0
)
)
:
if
not
(
(
arg_0
.
symlink
and
arg_6
and
not
os
.
path
.
islink
(
arg_6
)
)
or
(
not
arg_0
.
symlink
and
arg_6
and
os
.
path
.
islink
(
arg_6
)
)
)
:
if
arg_2
not
in
arg_0
.
unmodified_files
:
arg_0
.
unmodified_files
.
append
(
arg_2
)
arg_0
.
log
(
"Skipping '%s' (not modified)"
%
arg_1
)
return
False
if
arg_0
.
dry_run
:
arg_0
.
log
(
"Pretending to delete '%s'"
%
arg_1
)
else
:
arg_0
.
log
(
"Deleting '%s'"
%
arg_1
)
arg_0
.
storage
.
delete
(
arg_2
)
return
True

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Checks if the target file should be deleted if it already exists
        """
        if arg_0.storage.exists(arg_2):
            try:
                # When was the target file modified last time?
                arg_4 = \
                    arg_0.storage.modified_time(arg_2)
            except (OSError, NotImplementedError, AttributeError):
                # The storage doesn't support ``modified_time`` or failed
                pass
            else:
                try:
                    # When was the source file modified last time?
                    arg_5 = arg_3.modified_time(arg_1)
                except (OSError, NotImplementedError, AttributeError):
                    pass
                else:
                    # The full path of the target file
                    if arg_0.local:
                        arg_6 = arg_0.storage.path(arg_2)
                    else:
                        arg_6 = None
                    # Skip the file if the source file is younger
                    # Avoid sub-second precision (see #14665, #19540)
                    if (arg_4.replace(microsecond=0)
                            >= arg_5.replace(microsecond=0)):
                        if not ((arg_0.symlink and arg_6
                                 and not os.path.islink(arg_6)) or
                                (not arg_0.symlink and arg_6
                                 and os.path.islink(arg_6))):
                            if arg_2 not in arg_0.unmodified_files:
                                arg_0.unmodified_files.append(arg_2)
                            arg_0.log("Skipping '%s' (not modified)" % arg_1)
                            return False
            # Then delete the existing file if really needed
            if arg_0.dry_run:
                arg_0.log("Pretending to delete '%s'" % arg_1)
            else:
                arg_0.log("Deleting '%s'" % arg_1)
                arg_0.storage.delete(arg_2)
        return True


def Func():
    """ Return the default session. The path is read from the default config. """
    from .config import Config, ConfigKeys

    arg_0 = Config().get(ConfigKeys.price_database)
    if not arg_0:
        raise ValueError("Price database not set in the configuration file!")
    return get_session(arg_0)

Return the default session . The path is read from the default config .


def Func(arg_0, arg_1, **arg_2):
        """
        Create new GTR model if needed, and set the model as an attribute of the
        TreeAnc class

        Parameters
        -----------

         in_gtr : str, GTR
            The gtr model to be assigned. If string is passed,
            it is taken as the name of a standard GTR model, and is
            attempted to be created through :code:`GTR.standard()` interface. If a
            GTR instance is passed, it is set directly .

         **kwargs
            Keyword arguments to construct the GTR model. If none are passed, defaults
            are assumed.

        """
        if isinstance(arg_1, str):
            arg_0._gtr = GTR.standard(model=arg_1, **arg_2)
            arg_0._gtr.logger = arg_0.logger

        elif isinstance(arg_1, GTR) or isinstance(arg_1, GTR_site_specific):
            arg_0._gtr = arg_1
            arg_0._gtr.logger=arg_0.logger
        else:
            arg_0.logger("TreeAnc.gtr_setter: can't interpret GTR model", 1, warn=True)
            raise TypeError("Cannot set GTR model in TreeAnc class: GTR or "
                "string expected")

        if arg_0._gtr.ambiguous is None:
            arg_0.fill_overhangs=False

Create new GTR model if needed and set the model as an attribute of the TreeAnc class


return TopicClient.from_entity(
            self._get_host(), topic,
            shared_access_key_name=self.shared_access_key_name,
            shared_access_key_value=self.shared_access_key_value,
            debug=self.debug)

def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
mgmt_client
.
Func
(
arg_1
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
raise
ServiceBusConnectionError
(
"Namespace: {} not found"
.
format
(
arg_0
.
service_namespace
)
,
e
)
except
AzureServiceBusResourceNotFound
:
raise
ServiceBusResourceNotFound
(
"Specificed topic does not exist."
)
return
TopicClient
.
from_entity
(
arg_0
.
_get_host
(
)
,
arg_2
,
shared_access_key_name
=
arg_0
.
shared_access_key_name
,
shared_access_key_value
=
arg_0
.
shared_access_key_value
,
debug
=
arg_0
.
debug
)

def Func(arg_0, arg_1):
        """Get a client for a topic entity.

        :param topic_name: The name of the topic.
        :type topic_name: str
        :rtype: ~azure.servicebus.servicebus_client.TopicClient
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the topic is not found.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func_client]
                :end-before: [END Func_client]
                :language: python
                :dedent: 8
                :caption: Get the specific topic client from Service Bus client

        """
        try:
            arg_2 = arg_0.mgmt_client.Func(arg_1)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except AzureServiceBusResourceNotFound:
            raise ServiceBusResourceNotFound("Specificed topic does not exist.")
        return TopicClient.from_entity(
            arg_0._get_host(), arg_2,
            shared_access_key_name=arg_0.shared_access_key_name,
            shared_access_key_value=arg_0.shared_access_key_value,
            debug=arg_0.debug)

Get a client for a topic entity.

        :param topic_name: The name of the topic.
        :type topic_name: str
        :rtype: ~azure.servicebus.servicebus_client.TopicClient
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the topic is not found.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START get_topic_client]
                :end-before: [END get_topic_client]
                :language: python
                :dedent: 8
                :caption: Get the specific topic client from Service Bus client


(
    name: str,
    ns: Optional[str] = None,
    kw_cache: atom.Atom["PMap[int, Keyword]"] = __INTERN,
)

return kw_cache.swap(__get_or_create, h, name, ns)[h]

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
[
arg_1
]
=
,
arg_4
:
arg_5
.
Atom
[
"PMap[int, Keyword]"
]
=
arg_7
,
)
->
Keyword
:
arg_8
=
hash
(
(
arg_0
,
arg_2
)
)
return
arg_4
.
swap
(
__get_or_create
,
arg_8
,
arg_0
,
arg_2
)
[
arg_8
]

def Func(
    arg_0: arg_1,
    arg_2: arg_3[arg_1] = None,
    arg_4: arg_5.Atom["PMap[int, Keyword]"] = arg_7,
) -> Keyword:
    """Create a new Func."""
    arg_8 = hash((arg_0, arg_2))
    return arg_4.swap(__get_or_create, arg_8, arg_0, arg_2)[arg_8]


return {
            (str(key) if isinstance(key, int) else key): mapping[key]
            for key in mapping
        }

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = super ( ExtendedSafeConstructor , arg_0 ) . Func ( arg_1 , arg_2 ) return { ( str ( arg_4 ) if isinstance ( arg_4 , int ) else arg_4 ) : arg_3 [ arg_4 ] for arg_4 in arg_3 }

def Func(arg_0, arg_1, arg_2=False):
        """While yaml supports integer keys, these are not valid in
        json, and will break jsonschema. This method coerces all keys
        to strings.
        """
        arg_3 = super(ExtendedSafeConstructor, arg_0).Func(
            arg_1, arg_2)

        return {
            (str(arg_4) if isinstance(arg_4, int) else arg_4): arg_3[arg_4]
            for arg_4 in arg_3
        }

While yaml supports integer keys these are not valid in json and will break jsonschema . This method coerces all keys to strings .


(pfpkl_list,
                            lcbasedir,
                            outdir,
                            starfeaturesdir=None,
                            fourierorder=5,
                            # these are depth, duration, ingress duration
                            transitparams=(-0.01,0.1,0.1),
                            # these are depth, duration, depth ratio, secphase
                            ebparams=(-0.2,0.3,0.7,0.5),
                            pdiff_threshold=1.0e-4,
                            sidereal_threshold=1.0e-4,
                            sampling_peak_multiplier=5.0,
                            sampling_startp=None,
                            sampling_endp=None,
                            starfeatures=None,
                            timecols=None,
                            magcols=None,
                            errcols=None,
                            lcformat='hat-sql',
                            lcformatdir=None,
                            sigclip=10.0,
                            verbose=False,
                            maxobjects=None)

def Func(arg_0,
                            arg_1,
                            arg_2,
                            arg_3=None,
                            arg_4=5,
                            # these are depth, duration, ingress duration
                            arg_5=(-0.01,0.1,0.1),
                            # these are depth, duration, depth ratio, secphase
                            arg_6=(-0.2,0.3,0.7,0.5),
                            arg_7=1.0e-4,
                            arg_8=1.0e-4,
                            arg_9=5.0,
                            arg_10=None,
                            arg_11=None,
                            arg_12=None,
                            arg_13=None,
                            arg_14=None,
                            arg_15=None,
                            arg_16='hat-sql',
                            arg_17=None,
                            arg_18=10.0,
                            arg_19=False,
                            arg_20=None):
    '''This drives the periodicfeatures collection for a list of periodfinding
    pickles.

    Parameters
    ----------

    pfpkl_list : list of str
        The list of period-finding pickles to use.

    lcbasedir : str
        The base directory where the associated light curves are located.

    outdir : str
        The directory where the results will be written.

    starfeaturesdir : str or None
        The directory containing the `starfeatures-<objectid>.pkl` files for
        each object to use calculate neighbor proximity light curve features.

    fourierorder : int
        The Fourier order to use to generate sinusoidal function and fit that to
        the phased light curve.

    transitparams : list of floats
        The transit depth, duration, and ingress duration to use to generate a
        trapezoid planet transit model fit to the phased light curve. The period
        used is the one provided in `period`, while the epoch is automatically
        obtained from a spline fit to the phased light curve.

    ebparams : list of floats
        The primary eclipse depth, eclipse duration, the primary-secondary depth
        ratio, and the phase of the secondary eclipse to use to generate an
        eclipsing binary model fit to the phased light curve. The period used is
        the one provided in `period`, while the epoch is automatically obtained
        from a spline fit to the phased light curve.

    pdiff_threshold : float
        This is the max difference between periods to consider them the same.

    sidereal_threshold : float
        This is the max difference between any of the 'best' periods and the
        sidereal day periods to consider them the same.

    sampling_peak_multiplier : float
        This is the minimum multiplicative factor of a 'best' period's
        normalized periodogram peak over the sampling periodogram peak at the
        same period required to accept the 'best' period as possibly real.

    sampling_startp, sampling_endp : float
        If the `pgramlist` doesn't have a time-sampling Lomb-Scargle
        periodogram, it will be obtained automatically. Use these kwargs to
        control the minimum and maximum period interval to be searched when
        generating this periodogram.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    verbose : bool
        If True, will indicate progress while working.

    maxobjects : int
        The total number of objects to process from `pfpkl_list`.

    Returns
    -------

    Nothing.

    '''

    try:
        arg_21 = get_lcformat(arg_16,
                                  use_lcformat_dir=arg_17)
        if arg_21:
            (arg_22, arg_23,
             arg_24, arg_25, arg_26,
             arg_27, arg_28) = arg_21
        else:
            LOGERROR("can't figure out the light curve format")
            return None
    except Exception as e:
        LOGEXCEPTION("can't figure out the light curve format")
        return None

    # make sure to make the output directory if it doesn't exist
    if not os.path.exists(arg_2):
        os.makedirs(arg_2)

    if arg_20:
        arg_0 = arg_0[:arg_20]

    LOGINFO('%s periodfinding pickles to process' % len(arg_0))

    # if the starfeaturedir is provided, try to find a starfeatures pickle for
    # each periodfinding pickle in pfpkl_list
    if arg_3 and os.path.exists(arg_3):

        arg_29 = []

        LOGINFO('collecting starfeatures pickles...')

        for arg_30 in arg_0:

            arg_31 = os.path.basename(arg_30).replace('periodfinding',
                                                     'starfeatures')
            arg_32 = arg_31.replace('.gz','')

            arg_33 = os.path.join(arg_3, arg_31)
            arg_34 = os.path.join(arg_3, arg_32)

            if os.path.exists(arg_33):
                arg_29.append(arg_31)
            elif os.path.exists(arg_34):
                arg_29.append(arg_32)
            else:
                arg_29.append(None)

    else:

        arg_29 = [None for x in arg_0]

    # generate the task list
    arg_35 = {'fourierorder':arg_4,
              'transitparams':arg_5,
              'ebparams':arg_6,
              'pdiff_threshold':arg_7,
              'sidereal_threshold':arg_8,
              'sampling_peak_multiplier':arg_9,
              'sampling_startp':arg_10,
              'sampling_endp':arg_11,
              'timecols':arg_13,
              'magcols':arg_14,
              'errcols':arg_15,
              'lcformat':arg_16,
              'lcformatdir':arg_17,
              'sigclip':arg_18,
              'verbose':arg_19}

    arg_36 = [(x, arg_1, arg_2, y, arg_35) for (x,y) in
             zip(arg_0, arg_29)]

    LOGINFO('processing periodfinding pickles...')

    for arg_37 in tqdm(arg_36):
        _periodicfeatures_worker(arg_37)

This drives the periodicfeatures collection for a list of periodfinding pickles .


def Func ( arg_0 , arg_1 ) : assert not arg_0 . read_only arg_0 . refresh_waiting_tasks ( ) arg_0 . do_engine_steps ( ) for arg_2 in Task . Iterator ( arg_0 . task_tree , Task . WAITING ) : arg_2 . task_spec . Func ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
        """
        Indicate to the workflow that a message has been received. The message
        will be processed by any waiting Intermediate or Boundary Message
        Events, that are waiting for the message.
        """
        assert not arg_0.read_only
        arg_0.refresh_waiting_tasks()
        arg_0.do_engine_steps()
        for arg_2 in Task.Iterator(arg_0.task_tree, Task.WAITING):
            arg_2.task_spec.Func(arg_2, arg_1)

Indicate to the workflow that a message has been received . The message will be processed by any waiting Intermediate or Boundary Message Events that are waiting for the message .


return "{}({})".format(name, ", ".join(args))

def
Func
(
arg_0
,
arg_1
=
)
:
arg_0
.
_ensure_loaded
(
)
if
arg_1
is
:
arg_1
=
arg_0
.
name
arg_2
=
len
(
arg_0
.
arg_names
)
arg_3
=
0
if
arg_0
.
arg_defaults
is
not
:
arg_3
=
len
(
arg_0
.
arg_defaults
)
arg_4
=
arg_2
arg_3
arg_5
=
[
]
for
arg_6
in
range
(
0
,
len
(
arg_0
.
arg_names
)
)
:
arg_7
=
""
if
arg_0
.
arg_names
[
arg_6
]
in
arg_0
.
annotated_params
:
arg_7
=
"{} "
.
format
(
arg_0
.
annotated_params
[
arg_0
.
arg_names
[
arg_6
]
]
.
type_name
)
if
arg_6
>=
arg_4
:
arg_8
=
str
(
arg_0
.
arg_defaults
[
arg_6
arg_4
]
)
if
len
(
arg_8
)
==
0
:
arg_8
=
"''"
arg_5
.
append
(
"{}{}={}"
.
format
(
arg_7
,
str
(
arg_0
.
arg_names
[
arg_6
]
)
,
arg_8
)
)
else
:
arg_5
.
append
(
arg_7
+
str
(
arg_0
.
arg_names
[
arg_6
]
)
)
return
"{}({})"
.
format
(
arg_1
,
", "
.
join
(
arg_5
)
)

def Func(arg_0, arg_1=None):
        """Return our function Func as a string.

        By default this function uses the annotated name of the function
        however if you need to override that with a custom name you can
        pass name=<custom name>

        Args:
            name (str): Optional name to override the default name given
                in the function Func.

        Returns:
            str: The formatted function Func
        """

        arg_0._ensure_loaded()

        if arg_1 is None:
            arg_1 = arg_0.name

        arg_2 = len(arg_0.arg_names)

        arg_3 = 0
        if arg_0.arg_defaults is not None:
            arg_3 = len(arg_0.arg_defaults)

        arg_4 = arg_2 - arg_3

        arg_5 = []
        for arg_6 in range(0, len(arg_0.arg_names)):
            arg_7 = ""

            if arg_0.arg_names[arg_6] in arg_0.annotated_params:
                arg_7 = "{} ".format(arg_0.annotated_params[arg_0.arg_names[arg_6]].type_name)

            if arg_6 >= arg_4:
                arg_8 = str(arg_0.arg_defaults[arg_6-arg_4])
                if len(arg_8) == 0:
                    arg_8 = "''"

                arg_5.append("{}{}={}".format(arg_7, str(arg_0.arg_names[arg_6]), arg_8))
            else:
                arg_5.append(arg_7 + str(arg_0.arg_names[arg_6]))

        return "{}({})".format(arg_1, ", ".join(arg_5))

Return our function signature as a string.

        By default this function uses the annotated name of the function
        however if you need to override that with a custom name you can
        pass name=<custom name>

        Args:
            name (str): Optional name to override the default name given
                in the function signature.

        Returns:
            str: The formatted function signature

Return our function signature as a string .


def Func ( arg_0 ) : arg_1 = arg_0 . upper ( ) if ( arg_1 . startswith ( 'SIG' ) and hasattr ( signal , arg_1 ) ) : return getattr ( signal , arg_1 ) else : arg_1 = "SIG" + arg_1 if hasattr ( signal , arg_1 ) : return getattr ( signal , arg_1 ) return None return

def Func(arg_0):
    """Find the corresponding signal number for 'name'. Return None
    if 'name' is invalid."""
    arg_1 = arg_0.upper()
    if (arg_1.startswith('SIG') and hasattr(signal, arg_1)):
        return getattr(signal, arg_1)
    else:
        arg_1 = "SIG"+arg_1
        if hasattr(signal, arg_1):
            return getattr(signal, arg_1)
        return None
    return

Find the corresponding signal number for name . Return None if name is invalid .


def Func():
    """Disable the FTDI drivers for the current platform.  This is necessary
    because they will conflict with libftdi and accessing the FT232H.  Note you
    can enable the FTDI drivers again by calling enable_FTDI_driver.
    """
    logger.debug('Disabling FTDI driver.')
    if sys.platform == 'darwin':
        logger.debug('Detected Mac OSX')
        # Mac OS commands to disable FTDI driver.
        _check_running_as_root()
        subprocess.call('kextunload -b com.apple.driver.AppleUSBFTDI', shell=True)
        subprocess.call('kextunload /System/Library/Extensions/FTDIUSBSerialDriver.kext', shell=True)
    elif sys.platform.startswith('linux'):
        logger.debug('Detected Linux')
        # Linux commands to disable FTDI driver.
        _check_running_as_root()
        subprocess.call('modprobe -r -q ftdi_sio', shell=True)
        subprocess.call('modprobe -r -q usbserial', shell=True)

Disable the FTDI drivers for the current platform . This is necessary because they will conflict with libftdi and accessing the FT232H . Note you can enable the FTDI drivers again by calling enable_FTDI_driver .


def Func(arg_0, arg_1, arg_2):
        """
        Poll backup operation state until it's completed.

        :param name: the name of the operation resource
        :type name: str
        :param polling_interval_in_seconds: The number of seconds to wait before calling another request.
        :type polling_interval_in_seconds: int
        :return: a resource operation instance.
        :rtype: dict
        """
        while True:
            arg_3 = arg_0.get_operation(arg_1)

            arg_4 = arg_3['metadata']['common']['state']
            if arg_4 == 'PROCESSING':
                arg_0.log.info('Operation is processing. Re-polling state in {} seconds'
                              .format(arg_2))
                time.sleep(arg_2)
            else:
                return arg_3

Poll backup operation state until it s completed .


def Func(arg_0):
        """Run files from profile startup directory"""
        arg_1 = arg_0.profile_dir.startup_dir
        arg_2 = glob.glob(os.path.join(arg_1, '*.py'))
        arg_2 += glob.glob(os.path.join(arg_1, '*.ipy'))
        if not arg_2:
            return

        arg_0.log.debug("Running startup files from %s...", arg_1)
        try:
            for arg_3 in sorted(arg_2):
                arg_0._exec_file(arg_3)
        except:
            arg_0.log.warn("Unknown error in handling startup files:")
            arg_0.shell.showtraceback()


def Func ( arg_0 , arg_1 = ( ) , arg_2 = ( ) ) : arg_3 = [ { "id" : "8:{0}" . format ( arg_0 . skype . userId ) , "role" : "Admin" } ] for arg_4 in arg_1 : if arg_4 == arg_0 . skype . userId : continue arg_3 . append ( { "id" : "8:{0}" . format ( arg_4 ) , "role" : "Admin" if arg_4 in arg_2 else "User" } ) arg_5 = arg_0 . skype . conn ( "POST" , "{0}/threads" . format ( arg_0 . skype . conn . msgsHost ) , auth = SkypeConnection . Auth . RegToken , json = { "members" : arg_3 } ) return arg_0 . chat ( arg_5 . headers [ "Location" ] . rsplit ( "/" , 1 ) [ 1 ] )

def Func(arg_0, arg_1=(), arg_2=()):
        """
        Create a new group chat with the given users.

        The current user is automatically added to the conversation as an admin.  Any other admin identifiers must also
        be present in the member list.

        Args:
            members (str list): user identifiers to initially join the conversation
            admins (str list): user identifiers to gain admin privileges
        """
        arg_3 = [{"id": "8:{0}".format(arg_0.skype.userId), "role": "Admin"}]
        for arg_4 in arg_1:
            if arg_4 == arg_0.skype.userId:
                continue
            arg_3.append({"id": "8:{0}".format(arg_4), "role": "Admin" if arg_4 in arg_2 else "User"})
        arg_5 = arg_0.skype.conn("POST", "{0}/threads".format(arg_0.skype.conn.msgsHost),
                               auth=SkypeConnection.Auth.RegToken, json={"members": arg_3})
        return arg_0.chat(arg_5.headers["Location"].rsplit("/", 1)[1])

Create a new group chat with the given users .


def Func ( arg_0 , arg_1 ) : def _looks_like_infinite_iterator ( arg_2 ) : arg_3 = utils . safe_infer ( arg_2 ) if arg_3 : return arg_3 . qname ( ) in KNOWN_INFINITE_ITERATORS return False if isinstance ( arg_1 . func , astroid . Attribute ) : return arg_3 = utils . safe_infer ( arg_1 . func ) if getattr ( arg_3 , "name" , "" ) == "next" : arg_4 = arg_1 . frame ( ) arg_5 = len ( arg_1 . args ) > 1 if ( isinstance ( arg_4 , astroid . FunctionDef ) and arg_4 . is_generator ( ) and not arg_5 and not utils . node_ignores_exception ( arg_1 , StopIteration ) and not _looks_like_infinite_iterator ( arg_1 . args [ 0 ] ) ) : arg_0 . add_message ( "stop-iteration-return" , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """Check if a StopIteration exception is raised by the call to next function

        If the next value has a default value, then do not add message.

        :param node: Check to see if this Call node is a next function
        :type node: :class:`astroid.node_classes.Call`
        """

        def _looks_like_infinite_iterator(arg_2):
            arg_3 = utils.safe_infer(arg_2)
            if arg_3:
                return arg_3.qname() in KNOWN_INFINITE_ITERATORS
            return False

        if isinstance(arg_1.func, astroid.Attribute):
            # A next() method, which is now what we want.
            return

        arg_3 = utils.safe_infer(arg_1.func)
        if getattr(arg_3, "name", "") == "next":
            arg_4 = arg_1.frame()
            # The next builtin can only have up to two
            # positional arguments and no keyword arguments
            arg_5 = len(arg_1.args) > 1
            if (
                isinstance(arg_4, astroid.FunctionDef)
                and arg_4.is_generator()
                and not arg_5
                and not utils.node_ignores_exception(arg_1, StopIteration)
                and not _looks_like_infinite_iterator(arg_1.args[0])
            ):
                arg_0.add_message("stop-iteration-return", arg_1=arg_1)


def Func ( * arg_0 ) : if not arg_0 : return current_app . response_class ( ) if len ( arg_0 ) == 1 : arg_0 = arg_0 [ 0 ] return current_app . Func ( arg_0 )

def Func(*arg_0):
    """Sometimes it is necessary to set additional headers in a view.  Because
    views do not have to return response objects but can return a value that
    is converted into a response object by Flask itself, it becomes tricky to
    add headers to it.  This function can be called instead of using a return
    and you will get a response object which you can use to attach headers.

    If view looked like this and you want to add a new header::

        def index():
            return render_template('index.html', foo=42)

    You can now do something like this::

        def index():
            response = Func(render_template('index.html', foo=42))
            response.headers['X-Parachutes'] = 'parachutes are cool'
            return response

    This function accepts the very same arguments you can return from a
    view function.  This for example creates a response with a 404 error
    code::

        response = Func(render_template('not_found.html'), 404)

    The other use case of this function is to force the return value of a
    view function into a response which is helpful with view
    decorators::

        response = Func(view_function())
        response.headers['X-Parachutes'] = 'parachutes are cool'

    Internally this function does the following things:

    -   if no arguments are passed, it creates a new response argument
    -   if one argument is passed, :meth:`flask.Flask.Func`
        is invoked with it.
    -   if more than one argument is passed, the arguments are passed
        to the :meth:`flask.Flask.Func` function as tuple.

    .. versionadded:: 0.6
    """
    if not arg_0:
        return current_app.response_class()
    if len(arg_0) == 1:
        arg_0 = arg_0[0]
    return current_app.Func(arg_0)

Sometimes it is necessary to set additional headers in a view.  Because
    views do not have to return response objects but can return a value that
    is converted into a response object by Flask itself, it becomes tricky to
    add headers to it.  This function can be called instead of using a return
    and you will get a response object which you can use to attach headers.

    If view looked like this and you want to add a new header::

        def index():
            return render_template('index.html', foo=42)

    You can now do something like this::

        def index():
            response = make_response(render_template('index.html', foo=42))
            response.headers['X-Parachutes'] = 'parachutes are cool'
            return response

    This function accepts the very same arguments you can return from a
    view function.  This for example creates a response with a 404 error
    code::

        response = make_response(render_template('not_found.html'), 404)

    The other use case of this function is to force the return value of a
    view function into a response which is helpful with view
    decorators::

        response = make_response(view_function())
        response.headers['X-Parachutes'] = 'parachutes are cool'

    Internally this function does the following things:

    -   if no arguments are passed, it creates a new response argument
    -   if one argument is passed, :meth:`flask.Flask.make_response`
        is invoked with it.
    -   if more than one argument is passed, the arguments are passed
        to the :meth:`flask.Flask.make_response` function as tuple.

    .. versionadded:: 0.6

Sometimes it is necessary to set additional headers in a view . Because views do not have to return response objects but can return a value that is converted into a response object by Flask itself it becomes tricky to add headers to it . This function can be called instead of using a return and you will get a response object which you can use to attach headers .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_data ( "account/keys/" ) for arg_3 in arg_2 [ 'ssh_keys' ] : if arg_3 . get ( 'public_key' , "" ) == arg_1 : arg_0 . id = arg_3 [ 'id' ] arg_0 . load ( ) return arg_0 return None

def Func(arg_0, arg_1):
        """
            This method will load a SSHKey object from DigitalOcean
            from a public_key. This method will avoid problems like
            uploading the same public_key twice.
        """

        arg_2 = arg_0.get_data("account/keys/")
        for arg_3 in arg_2['ssh_keys']:
            if arg_3.get('public_key', "") == arg_1:
                arg_0.id = arg_3['id']
                arg_0.load()
                return arg_0
        return None

This method will load a SSHKey object from DigitalOcean from a public_key . This method will avoid problems like uploading the same public_key twice .


def Func ( arg_0 ) : if arg_0 . _url is not None : Func = arg_0 . _url else : Func = getattr ( arg_0 . nb . metadata , 'url' , None ) if Func is not None : return nbviewer_link ( Func )

def Func(arg_0):
        """The url on jupyter nbviewer for this notebook or None if unknown"""
        if arg_0._url is not None:
            Func = arg_0._url
        else:
            Func = getattr(arg_0.nb.metadata, 'url', None)
        if Func is not None:
            return nbviewer_link(Func)


return max(1,
                   int(math.ceil(1.0 * len(self.tasks) / self._sync_parallelism)))

def Func ( arg_0 ) : return max ( 1 , int ( math . ceil ( 1.0 * len ( arg_0 . tasks ) / arg_0 . _sync_parallelism ) ) )

def Func(arg_0):
        """
        How many Celery tasks should be sent to each worker process.

        :return: Number of tasks that should be used per process
        :rtype: int
        """
        return max(1,
                   int(math.ceil(1.0 * len(arg_0.tasks) / arg_0._sync_parallelism)))

How many Celery tasks should be sent to each worker process .


def Func ( arg_0 , arg_1 : arg_2 ) -> list : if arg_0 . stateful : arg_1 = [ [ arg_1 ] , [ arg_0 . key ] ] else : arg_1 = [ [ arg_1 ] ] arg_3 : list = arg_0 . agent ( * arg_1 ) return arg_3

def Func(arg_0, arg_1: arg_2) -> list:
        """Infers DeepPavlov agent with raw user input extracted from Alexa request.

        Args:
            utterance: Raw user input extracted from Alexa request.
        Returns:
            response: DeepPavlov agent response.
        """
        if arg_0.stateful:
            arg_1 = [[arg_1], [arg_0.key]]
        else:
            arg_1 = [[arg_1]]

        arg_3: list = arg_0.agent(*arg_1)

        return arg_3

Infers DeepPavlov agent with raw user input extracted from Alexa request .


def Func(arg_0, arg_1=arg_2):
        '''Returns transformed value either for DEFAULT_OUTPUT or for the output
        given as output_name. Returns None if execution result isn't a success.

        Reconstructs the pipeline context to materialize value.
        '''
        check.str_param(arg_1, 'output_name')

        if not arg_0.solid.definition.has_output(arg_1):
            raise DagsterInvariantViolationError(
                '{output_name} not defined in solid {solid}'.format(
                    arg_1=arg_1, solid=arg_0.solid.name
                )
            )

        if arg_0.success:
            for arg_3 in arg_0.transforms:
                if (
                    arg_3.is_successful_output
                    and arg_3.step_output_data.output_name == arg_1
                ):
                    with arg_0.reconstruct_context() as context:
                        arg_4 = arg_0._get_value(context, arg_3.step_output_data)
                    return arg_4

            raise DagsterInvariantViolationError(
                (
                    'Did not find result {output_name} in solid {self.solid.name} '
                    'execution result'
                ).format(arg_1=arg_1, arg_0=arg_0)
            )
        else:
            return None

Returns transformed value either for DEFAULT_OUTPUT or for the output given as output_name . Returns None if execution result isn t a success .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
local_renderer
arg_0
.
stop
(
)
with
settings
(
warn_only
=
True
)
:
arg_1
.
sudo
(
'killall rabbitmq-server'
)
with
settings
(
warn_only
=
True
)
:
arg_1
.
sudo
(
'killall beam.smp'
)
arg_1
.
sudo
(
'rm -Rf /var/lib/rabbitmq/mnesia/*'
)

def Func(arg_0):
        """
        Forcibly kills Rabbit and purges all its queues.

        For emergency use when the server becomes unresponsive, even to service stop calls.

        If this also fails to correct the performance issues, the server may have to be completely
        reinstalled.
        """
        arg_1 = arg_0.local_renderer
        arg_0.stop()
        with settings(warn_only=True):
            arg_1.sudo('killall rabbitmq-server')
        with settings(warn_only=True):
            arg_1.sudo('killall beam.smp')
        #TODO:explicitly delete all subfolders, star-delete doesn't work
        arg_1.sudo('rm -Rf /var/lib/rabbitmq/mnesia/*')

Forcibly kills Rabbit and purges all its queues .


def Func ( arg_0 ) : from pylearn2 . config import yaml_parse from pylearn2 . datasets import Dataset arg_1 = yaml_parse . Func ( arg_0 . yaml_string ) assert isinstance ( arg_1 , Dataset ) arg_2 = arg_1 . iterator ( mode = 'sequential' , num_batches = 1 , data_specs = arg_1 . data_specs , return_tuple = True ) . next ( ) if len ( arg_2 ) == 2 : arg_3 , arg_4 = arg_2 arg_4 = np . squeeze ( arg_4 ) if arg_0 . one_hot : arg_4 = np . argmax ( arg_4 , axis = 1 ) else : arg_3 = arg_2 arg_4 = None return arg_3 , arg_4

def Func(arg_0):
        """
        Load the dataset using pylearn2.config.yaml_parse.
        """
        from pylearn2.config import yaml_parse
        from pylearn2.datasets import Dataset

        arg_1 = yaml_parse.Func(arg_0.yaml_string)
        assert isinstance(arg_1, Dataset)
        arg_2 = arg_1.iterator(mode='sequential', num_batches=1,
                                data_specs=arg_1.data_specs,
                                return_tuple=True).next()
        if len(arg_2) == 2:
            arg_3, arg_4 = arg_2
            arg_4 = np.squeeze(arg_4)
            if arg_0.one_hot:
                arg_4 = np.argmax(arg_4, axis=1)
        else:
            arg_3 = arg_2
            arg_4 = None
        return arg_3, arg_4

Load the dataset using pylearn2 . config . yaml_parse .


def Func(arg_0, arg_1):
        """Add additional requirements from setup.cfg to file metadata_path"""
        arg_2 = list(arg_0.setupcfg_requirements())
        if not arg_2: return
        arg_3 = read_pkg_info(arg_1)
        if 'Provides-Extra' in arg_3 or 'Requires-Dist' in arg_3:
            warnings.warn('setup.cfg requirements overwrite values from setup.py')
            del arg_3['Provides-Extra']
            del arg_3['Requires-Dist']
        for arg_4, arg_5 in arg_2:
            arg_3[arg_4] = arg_5
        write_pkg_info(arg_1, arg_3)

Add additional requirements from setup . cfg to file metadata_path


def Func ( arg_0 , arg_1 ) : if Match ( r'^\s*#\s*(if|ifdef|ifndef)\b' , arg_1 ) : arg_0 . pp_stack . append ( _PreprocessorInfo ( copy . deepcopy ( arg_0 . stack ) ) ) elif Match ( r'^\s*#\s*(else|elif)\b' , arg_1 ) : if arg_0 . pp_stack : if not arg_0 . pp_stack [ - 1 ] . seen_else : arg_0 . pp_stack [ - 1 ] . seen_else = True arg_0 . pp_stack [ - 1 ] . stack_before_else = copy . deepcopy ( arg_0 . stack ) arg_0 . stack = copy . deepcopy ( arg_0 . pp_stack [ - 1 ] . stack_before_if ) else : pass elif Match ( r'^\s*#\s*endif\b' , arg_1 ) : if arg_0 . pp_stack : if arg_0 . pp_stack [ - 1 ] . seen_else : arg_0 . stack = arg_0 . pp_stack [ - 1 ] . stack_before_else arg_0 . pp_stack . pop ( ) else : pass

def Func(arg_0, arg_1):
    """Update preprocessor stack.

    We need to handle preprocessors due to classes like this:
      #ifdef SWIG
      struct ResultDetailsPageElementExtensionPoint {
      #else
      struct ResultDetailsPageElementExtensionPoint : public Extension {
      #endif

    We make the following assumptions (good enough for most files):
    - Preprocessor condition evaluates to true from #if up to first
      #else/#elif/#endif.

    - Preprocessor condition evaluates to false from #else/#elif up
      to #endif.  We still perform lint checks on these lines, but
      these do not affect nesting stack.

    Args:
      line: current line to check.
    """
    if Match(r'^\s*#\s*(if|ifdef|ifndef)\b', arg_1):
      # Beginning of #if block, save the nesting stack here.  The saved
      # stack will allow us to restore the parsing state in the #else case.
      arg_0.pp_stack.append(_PreprocessorInfo(copy.deepcopy(arg_0.stack)))
    elif Match(r'^\s*#\s*(else|elif)\b', arg_1):
      # Beginning of #else block
      if arg_0.pp_stack:
        if not arg_0.pp_stack[-1].seen_else:
          # This is the first #else or #elif block.  Remember the
          # whole nesting stack up to this point.  This is what we
          # keep after the #endif.
          arg_0.pp_stack[-1].seen_else = True
          arg_0.pp_stack[-1].stack_before_else = copy.deepcopy(arg_0.stack)

        # Restore the stack to how it was before the #if
        arg_0.stack = copy.deepcopy(arg_0.pp_stack[-1].stack_before_if)
      else:
        # TODO(unknown): unexpected #else, issue warning?
        pass
    elif Match(r'^\s*#\s*endif\b', arg_1):
      # End of #if or #else blocks.
      if arg_0.pp_stack:
        # If we saw an #else, we will need to restore the nesting
        # stack to its former state before the #else, otherwise we
        # will just continue from where we left off.
        if arg_0.pp_stack[-1].seen_else:
          # Here we can just use a shallow copy since we are the last
          # reference to it.
          arg_0.stack = arg_0.pp_stack[-1].stack_before_else
        # Drop the corresponding #if
        arg_0.pp_stack.pop()
      else:
        # TODO(unknown): unexpected #endif, issue warning?
        pass


(units,
                         n_hidden,
                         seq_lengths=None,
                         n_stacks=2,
                         keep_prob=1.0,
                         concat_stacked_outputs=False,
                         trainable_initial_states=False,
                         name='cudnn_stacked_bi_gru',
                         reuse=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = 2 , arg_4 = 1.0 , arg_5 = False , arg_6 = False , arg_7 = 'Func' , arg_8 = False ) : if arg_2 is None : arg_2 = tf . ones ( [ tf . shape ( arg_0 ) [ 0 ] ] , dtype = tf . int32 ) * tf . shape ( arg_0 ) [ 1 ] arg_9 = [ arg_0 ] with tf . variable_scope ( arg_7 , arg_8 = arg_8 ) : for arg_10 in range ( arg_3 ) : if arg_10 == 0 : arg_11 = arg_9 [ - 1 ] else : arg_11 = variational_dropout ( arg_9 [ - 1 ] , arg_4 = arg_4 ) ( arg_12 , arg_13 ) , arg_14 = cudnn_bi_gru ( arg_11 , arg_1 , arg_2 , n_layers = 1 , arg_6 = arg_6 , arg_7 = '{}_cudnn_bi_gru' . format ( arg_10 ) , arg_8 = arg_8 ) arg_9 . append ( tf . concat ( [ arg_12 , arg_13 ] , axis = 2 ) ) if arg_5 : return tf . concat ( arg_9 [ 1 : ] , axis = 2 ) return arg_9 [ - 1 ]

def Func(arg_0,
                         arg_1,
                         arg_2=None,
                         arg_3=2,
                         arg_4=1.0,
                         arg_5=False,
                         arg_6=False,
                         arg_7='Func',
                         arg_8=False):
    """ Fast CuDNN Stacked Bi-GRU implementation

    Args:
        units: tf.Tensor with dimensions [B x T x F], where
            B - batch size
            T - number of tokens
            F - features
        n_hidden: dimensionality of hidden state
        seq_lengths: number of tokens in each sample in the batch
        n_stacks: number of stacked Bi-GRU
        keep_prob: dropout keep_prob between Bi-GRUs (intra-layer dropout)
        concat_stacked_outputs: return last Bi-GRU output or concat outputs from every Bi-GRU,
        trainable_initial_states: whether to create a special trainable variable
                to initialize the hidden states of the network or use just zeros
        name: name of the variable scope to use
        reuse: whether to reuse already initialized variable

    Returns:
        h - all hidden states along T dimension,
            tf.Tensor with dimensionality [B x T x ((n_hidden * 2) * n_stacks)]
    """
    if arg_2 is None:
        arg_2 = tf.ones([tf.shape(arg_0)[0]], dtype=tf.int32) * tf.shape(arg_0)[1]

    arg_9 = [arg_0]

    with tf.variable_scope(arg_7, arg_8=arg_8):
        for arg_10 in range(arg_3):

            if arg_10 == 0:
                arg_11 = arg_9[-1]
            else:
                arg_11 = variational_dropout(arg_9[-1], arg_4=arg_4)

            (arg_12, arg_13), arg_14 = cudnn_bi_gru(arg_11, arg_1, arg_2,
                                           n_layers=1,
                                           arg_6=arg_6,
                                           arg_7='{}_cudnn_bi_gru'.format(arg_10),
                                           arg_8=arg_8)

            arg_9.append(tf.concat([arg_12, arg_13], axis=2))

    if arg_5:
        return tf.concat(arg_9[1:], axis=2)

    return arg_9[-1]

Fast CuDNN Stacked Bi - GRU implementation


(adapter: MongoAdapter,
                         report_path: str,
                         case_id: str,
                         update: bool = False)

def Func(arg_0: arg_1,
                         arg_2: arg_3,
                         arg_4: arg_3,
                         arg_5: arg_6 = False):
    """ Load a delivery report into a case in the database

    If the report already exists the function will exit.
    If the user want to load a report that is already in the database
    'update' has to be 'True'

    Args:
        adapter     (MongoAdapter): Connection to the database
        report_path (string):       Path to delivery report
        case_id     (string):       Optional case identifier
        update      (bool):         If an existing report should be replaced

    Returns:
        updated_case(dict)

    """

    arg_7 = arg_0.case(
        arg_4=arg_4,
    )

    if arg_7 is None:
        raise DataNotFoundError("no case found")

    if not arg_7.get('delivery_report'):
        _put_report_in_case_root(arg_7, arg_2)
    else:
        if arg_5:
            _put_report_in_case_root(arg_7, arg_2)
        else:
            raise IntegrityError('Existing delivery report found, use update = True to '
                                 'overwrite')

    logger.info('Saving report for case {} in database'.format(arg_7['_id']))
    return arg_0.replace_case(arg_7)


def
Func
(
arg_0
,
arg_1
=
''
)
:
arg_0
.
organization_name
=
arg_1
if
(
arg_1
==
''
)
:
arg_0
.
organization_name
=
raw_input
(
'Organization: '
)
print
'Getting organization.'
arg_0
.
org_retrieved
=
arg_0
.
logged_in_gh
.
organization
(
arg_1
)

def Func(arg_0, arg_1=''):
        """
        Retrieves an organization via given org name. If given
        empty string, prompts user for an org name.
        """
        arg_0.organization_name = arg_1
        if(arg_1 == ''):
            arg_0.organization_name = raw_input('Organization: ')
        print 'Getting organization.'
        arg_0.org_retrieved = arg_0.logged_in_gh.organization(arg_1)

Retrieves an organization via given org name . If given empty string prompts user for an org name .


(self, X, y, coef_init=None, intercept_init=None,
            sample_weight=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None ) : super ( SGDClassifier , arg_0 ) . Func ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None,
            arg_5=None):
        """Fit linear model with Stochastic Gradient Descent.

        Parameters
        ----------
        X : {array-like, sparse matrix}, shape (n_samples, n_features)
            Training data

        y : numpy array, shape (n_samples,)
            Target values

        coef_init : array, shape (n_classes, n_features)
            The initial coefficients to warm-start the optimization.

        intercept_init : array, shape (n_classes,)
            The initial intercept to warm-start the optimization.

        sample_weight : array-like, shape (n_samples,), optional
            Weights applied to individual samples.
            If not provided, uniform weights are assumed. These weights will
            be multiplied with class_weight (passed through the
            constructor) if class_weight is specified

        Returns
        -------
        self : returns an instance of self.
        """
        super(SGDClassifier, arg_0).Func(arg_1, arg_2, arg_3, arg_4,
                                       arg_5)

Fit linear model with Stochastic Gradient Descent .


def Func(arg_0, arg_1, arg_2):
        """Retrieves a class for managing output for a download

        :type transfer_future: s3transfer.futures.TransferFuture
        :param transfer_future: The transfer future for the request

        :type osutil: s3transfer.utils.OSUtils
        :param osutil: The os utility associated to the transfer

        :rtype: class of DownloadOutputManager
        :returns: The appropriate class to use for managing a specific type of
            input for downloads.
        """
        arg_3 = [
            DownloadSpecialFilenameOutputManager,
            DownloadFilenameOutputManager,
            DownloadSeekableOutputManager,
            DownloadNonSeekableOutputManager,
        ]

        arg_4 = arg_1.meta.call_args.fileobj
        for arg_5 in arg_3:
            if arg_5.is_compatible(arg_4, arg_2):
                return arg_5
        raise RuntimeError(
            'Output %s of type: %s is not supported.' % (
                arg_4, type(arg_4)))


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . parser_tree = parsing . Hook ( arg_2 . name , arg_2 . listparam ) return True

def Func(arg_0, arg_1, arg_2):
    """Create a tree.Hook"""
    arg_1.parser_tree = parsing.Hook(arg_2.name, arg_2.listparam)
    return True