(self, event, listener, *args, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : try : arg_5 = arg_2 ( * arg_3 , ** arg_4 ) except Exception as exc : if arg_1 == arg_0 . LISTENER_ERROR_EVENT : raise return arg_0 . emit ( arg_0 . LISTENER_ERROR_EVENT , arg_1 , arg_2 , exc ) asyncio . ensure_future ( _try_catch_coro ( arg_0 , arg_1 , arg_2 , arg_5 ) , loop = arg_0 . _loop , )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Schedule a coroutine for execution.

        Args:
            event (str): The name of the event that triggered this call.
            listener (async def): The async def that needs to be executed.
            *args: Any number of positional arguments.
            **kwargs: Any number of keyword arguments.

        The values of *args and **kwargs are passed, unaltered, to the async
        def when generating the coro. If there is an exception generating the
        coro, such as the wrong number of arguments, the emitter's error event
        is triggered. If the triggering event _is_ the emitter's error event
        then the exception is reraised. The reraised exception may show in
        debug mode for the event loop but is otherwise silently dropped.
        """
        try:

            arg_5 = arg_2(*arg_3, **arg_4)

        except Exception as exc:

            if arg_1 == arg_0.LISTENER_ERROR_EVENT:

                raise

            return arg_0.emit(arg_0.LISTENER_ERROR_EVENT, arg_1, arg_2, exc)

        asyncio.ensure_future(
            _try_catch_coro(arg_0, arg_1, arg_2, arg_5),
            loop=arg_0._loop,
        )


def
Func
(
arg_0
)
:
arg_0
.
dict
=
{
}
arg_0
.
unixfrom
=
''
arg_0
.
headers
=
lst
=
[
]
arg_0
.
status
=
''
arg_5
=
""
arg_6
=
1
arg_7
=
arg_8
=
arg_9
=
if
hasattr
(
arg_0
.
fp
,
'unread'
)
:
arg_8
=
arg_0
.
fp
.
unread
elif
arg_0
.
seekable
:
arg_9
=
arg_0
.
fp
.
tell
while
1
:
if
arg_9
:
try
:
arg_7
=
arg_9
(
)
except
IOError
:
arg_7
=
arg_9
=
arg_0
.
seekable
=
0
arg_11
=
arg_0
.
fp
.
readline
(
)
if
not
arg_11
:
arg_0
.
status
=
'EOF in headers'
break
if
arg_6
and
arg_11
.
startswith
(
'From '
)
:
arg_0
.
unixfrom
=
arg_0
.
unixfrom
+
arg_11
continue
arg_6
=
0
if
arg_5
and
arg_11
[
0
]
in
' \t'
:
lst
.
append
(
arg_11
)
arg_12
=
(
arg_0
.
dict
[
arg_5
]
+
"\n "
+
arg_11
.
strip
(
)
)
arg_0
.
dict
[
arg_5
]
=
arg_12
.
strip
(
)
continue
elif
arg_0
.
iscomment
(
arg_11
)
:
continue
elif
arg_0
.
islast
(
arg_11
)
:
break
arg_5
=
arg_0
.
isheader
(
arg_11
)
if
arg_5
:
lst
.
append
(
arg_11
)
arg_0
.
dict
[
arg_5
]
=
arg_11
[
len
(
arg_5
)
+
1
:
]
.
strip
(
)
continue
elif
arg_5
is
not
:
continue
else
:
if
not
arg_0
.
dict
:
arg_0
.
status
=
'No headers'
else
:
arg_0
.
status
=
'Non-header line where header expected'
if
arg_8
:
arg_8
(
arg_11
)
elif
arg_9
:
arg_0
.
fp
.
seek
(
arg_7
)
else
:
arg_0
.
status
=
arg_0
.
status
+
'; bad seek'
break

def Func(arg_0):
        """Read header lines.

        Read header lines up to the entirely blank line that terminates them.
        The (normally blank) line that ends the headers is skipped, but not
        included in the returned list.  If a non-header line ends the headers,
        (which is an error), an attempt is made to backspace over it; it is
        never included in the returned list.

        The variable self.status is set to the empty string if all went well,
        otherwise it is an error message.  The variable self.headers is a
        completely uninterpreted list of lines contained in the header (so
        printing them will reproduce the header exactly as it appears in the
        file).
        """
        arg_0.dict = {}
        arg_0.unixfrom = ''
        arg_0.headers = lst = []
        arg_0.status = ''
        arg_5 = ""
        arg_6 = 1
        arg_7 = arg_8 = arg_9 = None
        if hasattr(arg_0.fp, 'unread'):
            arg_8 = arg_0.fp.unread
        elif arg_0.seekable:
            arg_9 = arg_0.fp.tell
        while 1:
            if arg_9:
                try:
                    arg_7 = arg_9()
                except IOError:
                    arg_7 = arg_9 = None
                    arg_0.seekable = 0
            arg_11 = arg_0.fp.readline()
            if not arg_11:
                arg_0.status = 'EOF in headers'
                break
            # Skip unix From name time lines
            if arg_6 and arg_11.startswith('From '):
                arg_0.unixfrom = arg_0.unixfrom + arg_11
                continue
            arg_6 = 0
            if arg_5 and arg_11[0] in ' \t':
                # It's a continuation line.
                lst.append(arg_11)
                arg_12 = (arg_0.dict[arg_5] + "\n " + arg_11.strip())
                arg_0.dict[arg_5] = arg_12.strip()
                continue
            elif arg_0.iscomment(arg_11):
                # It's a comment.  Ignore it.
                continue
            elif arg_0.islast(arg_11):
                # Note! No pushback here!  The delimiter line gets eaten.
                break
            arg_5 = arg_0.isheader(arg_11)
            if arg_5:
                # It's a legal header line, save it.
                lst.append(arg_11)
                arg_0.dict[arg_5] = arg_11[len(arg_5)+1:].strip()
                continue
            elif arg_5 is not None:
                # An empty header name. These aren't allowed in HTTP, but it's
                # probably a benign mistake. Don't add the header, just keep
                # going.
                continue
            else:
                # It's not a header line; throw it back and stop here.
                if not arg_0.dict:
                    arg_0.status = 'No headers'
                else:
                    arg_0.status = 'Non-header line where header expected'
                # Try to undo the read.
                if arg_8:
                    arg_8(arg_11)
                elif arg_9:
                    arg_0.fp.seek(arg_7)
                else:
                    arg_0.status = arg_0.status + '; bad seek'
                break


return timezone.tz_convert(f'{cur_dt} {mkt_time}', to_tz=tz, from_tz=exch.tz)

def Func(arg_0, arg_1, arg_2='EOD', arg_3='local') -> str:
    """
    Market close time for ticker

    Args:
        ticker: ticker name
        dt: date
        timing: [EOD (default), BOD]
        tz: conversion to timezone

    Returns:
        str: date & time

    Examples:
        >>> Func('7267 JT Equity', dt='2018-09-10')
        '2018-09-10 14:58'
        >>> Func('7267 JT Equity', dt='2018-09-10', tz=timezone.TimeZone.NY)
        '2018-09-10 01:58:00-04:00'
        >>> Func('7267 JT Equity', dt='2018-01-10', tz='NY')
        '2018-01-10 00:58:00-05:00'
        >>> Func('7267 JT Equity', dt='2018-09-10', tz='SPX Index')
        '2018-09-10 01:58:00-04:00'
        >>> Func('8035 JT Equity', dt='2018-09-10', timing='BOD')
        '2018-09-10 09:01'
        >>> Func('Z 1 Index', dt='2018-09-10', timing='FINISHED')
        '2018-09-10 21:00'
        >>> Func('TESTTICKER Corp', dt='2018-09-10')
        ''
    """
    arg_4 = logs.get_logger(Func)
    arg_5 = pd.Series(exch_info(arg_0=arg_0))
    if any(arg_6 not in arg_5.index for arg_6 in ['tz', 'allday', 'day']):
        arg_4.error(f'required exchange info cannot be found in {ticker} ...')
        return ''

    arg_7 = {
        'BOD': arg_5.day[0], 'FINISHED': arg_5.allday[-1]
    }.get(arg_2, arg_5.day[-1])

    arg_8 = pd.Timestamp(str(arg_1)).strftime('%Y-%m-%d')
    if arg_3 == 'local':
        return f'{cur_dt} {mkt_time}'

    return timezone.tz_convert(f'{cur_dt} {mkt_time}', to_tz=arg_3, from_tz=arg_5.tz)


def Func ( arg_0 ) : arg_0 . tokens [ "skype" ] , arg_0 . tokenExpiry [ "skype" ] = SkypeRefreshAuthProvider ( arg_0 ) . auth ( arg_0 . tokens [ "skype" ] ) arg_0 . getRegToken ( )

def Func(arg_0):
        """
        Take the existing Skype token and refresh it, to extend the expiry time without other credentials.

        Raises:
            .SkypeAuthException: if the login request is rejected
            .SkypeApiException: if the login form can't be processed
        """
        arg_0.tokens["skype"], arg_0.tokenExpiry["skype"] = SkypeRefreshAuthProvider(arg_0).auth(arg_0.tokens["skype"])
        arg_0.getRegToken()

Take the existing Skype token and refresh it to extend the expiry time without other credentials .


def Func(arg_0):
        '''
        Hook point for overriding how the CounterPool determines the schema
        to be used when creating a missing table.
        '''
        if not arg_0.schema:
            raise NotImplementedError(
                'You must provide a schema value or override the Func method'
            )

        return arg_0.conn.create_schema(**arg_0.schema)

Hook point for overriding how the CounterPool determines the schema to be used when creating a missing table .


def Func ( arg_0 ) : for arg_1 in range ( 3 ) : arg_2 = arg_0 . _ioctl_GWINSZ ( arg_1 ) if arg_2 : break if not arg_2 : try : arg_1 = os . open ( os . ctermid ( ) , os . O_RDONLY ) arg_2 = arg_0 . _ioctl_GWINSZ ( arg_1 ) os . close ( arg_1 ) except Exception : pass if not arg_2 : arg_3 = os . environ arg_2 = ( arg_3 . get ( 'LINES' , 25 ) , arg_3 . get ( 'COLUMNS' , 80 ) ) return int ( arg_2 [ 1 ] ) , int ( arg_2 [ 0 ] )

def Func(arg_0):
        """Get the current terminal Func."""
        for arg_1 in range(3):
            arg_2 = arg_0._ioctl_GWINSZ(arg_1)
            if arg_2:
                break
        if not arg_2:
            try:
                arg_1 = os.open(os.ctermid(), os.O_RDONLY)
                arg_2 = arg_0._ioctl_GWINSZ(arg_1)
                os.close(arg_1)
            except Exception:
                pass

        if not arg_2:
            arg_3 = os.environ
            arg_2 = (arg_3.get('LINES', 25), arg_3.get('COLUMNS', 80))

        return int(arg_2[1]), int(arg_2[0])


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] if arg_1 is None : arg_1 = [ 0 , '' ] arg_3 = True else : arg_3 = False arg_4 = arg_1 [ 1 ] if arg_0 . names is None : for arg_5 in numpy . ndindex ( arg_0 . shape ) : if arg_0 . base == arg_0 : arg_2 . append ( ( '%s%s' % ( arg_4 , simplerepr ( arg_5 ) ) , arg_0 ) ) arg_1 [ 0 ] += 1 else : arg_1 [ 1 ] = '%s%s' % ( arg_4 , simplerepr ( arg_5 ) ) arg_2 . extend ( Func ( arg_0 . base , arg_1 ) ) else : for arg_6 in arg_0 . names : arg_7 = arg_0 . fields [ arg_6 ] if len ( arg_4 ) > 0 : arg_1 [ 1 ] = arg_4 + '.' + arg_6 else : arg_1 [ 1 ] = '' + arg_6 arg_8 = Func ( arg_7 [ 0 ] , arg_1 ) arg_2 . extend ( arg_8 ) arg_1 [ 1 ] = arg_4 if arg_3 : return numpy . dtype ( arg_2 ) else : return arg_2

def Func(arg_0, arg_1=None):
    """ Unpack a structured data-type.  """
    arg_2 = []
    if arg_1 is None:
        arg_1 = [0, '']
        arg_3 = True
    else:
        arg_3 = False

    arg_4 = arg_1[1]

    if arg_0.names is None:
        for arg_5 in numpy.ndindex(arg_0.shape):
            if arg_0.base == arg_0:
                arg_2.append(('%s%s' % (arg_4, simplerepr(arg_5)), arg_0))
                arg_1[0] += 1
            else:
                arg_1[1] = '%s%s' % (arg_4, simplerepr(arg_5))
                arg_2.extend(Func(arg_0.base, arg_1))
    else:
        for arg_6 in arg_0.names:
            arg_7 = arg_0.fields[arg_6]
            if len(arg_4) > 0:
                arg_1[1] = arg_4 + '.' + arg_6
            else:
                arg_1[1] = '' + arg_6
            arg_8 = Func(arg_7[0], arg_1)
            arg_2.extend(arg_8)

    arg_1[1] = arg_4
    if arg_3:
        return numpy.dtype(arg_2)
    else:
        return arg_2


return ['/etc/xdg/%s/%s' % (self.group_name, self.app_name)]

def
Func
(
arg_0
)
:
arg_1
=
getenv
(
'XDG_CONFIG_DIRS'
,
''
)
if
arg_1
:
arg_0
.
_log
.
debug
(
'XDG_CONFIG_DIRS is set to %r'
,
arg_1
)
arg_2
=
[
]
for
arg_3
in
reversed
(
arg_1
.
split
(
':'
)
)
:
arg_2
.
append
(
join
(
arg_3
,
arg_0
.
group_name
,
arg_0
.
app_name
)
)
return
arg_2
return
[
'/etc/xdg/%s/%s'
%
(
arg_0
.
group_name
,
arg_0
.
app_name
)
]

def Func(arg_0):
        # type: () -> List[str]
        """
        Returns a list of paths specified by the XDG_CONFIG_DIRS environment
        variable or the appropriate default.

        The list is sorted by precedence, with the most important item coming
        *last* (required by the existing config_resolver logic).
        """
        arg_1 = getenv('XDG_CONFIG_DIRS', '')
        if arg_1:
            arg_0._log.debug('XDG_CONFIG_DIRS is set to %r', arg_1)
            arg_2 = []
            for arg_3 in reversed(arg_1.split(':')):
                arg_2.append(join(arg_3, arg_0.group_name, arg_0.app_name))
            return arg_2
        return ['/etc/xdg/%s/%s' % (arg_0.group_name, arg_0.app_name)]

Returns a list of paths specified by the XDG_CONFIG_DIRS environment variable or the appropriate default .


(
        self, elevation, interval=100, field='elev', base=0
    )

return commons_contours.extract_contours(
            elevation, self.tile, interval=interval, field=field, base=base)

def Func(
        arg_0, arg_1, arg_2=100, arg_3='elev', arg_4=0
    ):
        """
        Extract contour lines from elevation data.

        Parameters
        ----------
        elevation : array
            input elevation data
        interval : integer
            elevation value interval when drawing contour lines
        field : string
            output field name containing elevation value
        base : integer
            elevation base value the intervals are computed from

        Returns
        -------
        Func : iterable
            Func as GeoJSON-like pairs of properties and geometry
        """
        return commons_Func.extract_Func(
            arg_1, arg_0.tile, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Extract contour lines from elevation data.

        Parameters
        ----------
        elevation : array
            input elevation data
        interval : integer
            elevation value interval when drawing contour lines
        field : string
            output field name containing elevation value
        base : integer
            elevation base value the intervals are computed from

        Returns
        -------
        contours : iterable
            contours as GeoJSON-like pairs of properties and geometry

Extract contour lines from elevation data .


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : if arg_2 == "bar" : return Chart ( arg_1 ) . mark_bar ( ** arg_3 ) elif arg_2 == "circle" : return Chart ( arg_1 ) . mark_circle ( ** arg_3 ) elif arg_2 == "line" : return Chart ( arg_1 ) . mark_line ( ** arg_3 ) elif arg_2 == "point" : return Chart ( arg_1 ) . mark_point ( ** arg_3 ) elif arg_2 == "area" : return Chart ( arg_1 ) . mark_area ( ** arg_3 ) elif arg_2 == "tick" : return Chart ( arg_1 ) . mark_tick ( ** arg_3 ) elif arg_2 == "text" : return Chart ( arg_1 ) . mark_text ( ** arg_3 ) elif arg_2 == "square" : return Chart ( arg_1 ) . mark_square ( ** arg_3 ) elif arg_2 == "rule" : return Chart ( arg_1 ) . mark_rule ( ** arg_3 ) return None

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Get the right chart class from a string
        """
        if arg_2 == "bar":
            return Chart(arg_1).mark_bar(**arg_3)
        elif arg_2 == "circle":
            return Chart(arg_1).mark_circle(**arg_3)
        elif arg_2 == "line":
            return Chart(arg_1).mark_line(**arg_3)
        elif arg_2 == "point":
            return Chart(arg_1).mark_point(**arg_3)
        elif arg_2 == "area":
            return Chart(arg_1).mark_area(**arg_3)
        elif arg_2 == "tick":
            return Chart(arg_1).mark_tick(**arg_3)
        elif arg_2 == "text":
            return Chart(arg_1).mark_text(**arg_3)
        elif arg_2 == "square":
            return Chart(arg_1).mark_square(**arg_3)
        elif arg_2 == "rule":
            return Chart(arg_1).mark_rule(**arg_3)
        return None


return tfd.MultivariateNormalDiag(loc=loc, scale_diag=scale_diag), state

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 . shape if len ( arg_3 ) < 2 : arg_1 = tf . reshape ( arg_1 , [ 1 , - 1 ] ) arg_4 , arg_2 = arg_0 . lstm_cell ( arg_1 , arg_2 ) arg_4 = arg_0 . output_layer ( arg_4 ) arg_5 = tf . concat ( ( arg_3 [ : - 1 ] , tf . shape ( input = arg_4 ) [ - 1 : ] ) , 0 ) arg_4 = tf . reshape ( arg_4 , arg_5 ) arg_6 = arg_4 [ ... , : arg_0 . dimensions ] arg_7 = tf . nn . softplus ( arg_4 [ ... , arg_0 . dimensions : ] ) + 1e-5 return tfd . MultivariateNormalDiag ( arg_6 = arg_6 , arg_7 = arg_7 ) , arg_2

def Func(arg_0, arg_1, arg_2):
    """Runs the model to generate a distribution for a single timestep.

    This generates a batched MultivariateNormalDiag distribution using
    the output of the recurrent model at the current timestep to
    parameterize the distribution.

    Args:
      inputs: The sampled value of `z` at the previous timestep, i.e.,
        `z_{t-1}`, of shape [..., dimensions].
        `z_0` should be set to the empty matrix.
      state: A tuple containing the (hidden, cell) state.

    Returns:
      A tuple of a MultivariateNormalDiag distribution, and the state of
      the recurrent function at the end of the current timestep. The
      distribution will have event shape [dimensions], batch shape
      [...], and sample shape [sample_shape, ..., dimensions].
    """
    # In order to allow the user to pass in a single example without a batch
    # dimension, we always expand the input to at least two dimensions, then
    # fix the output shape to remove the batch dimension if necessary.
    arg_3 = arg_1.shape
    if len(arg_3) < 2:
      arg_1 = tf.reshape(arg_1, [1, -1])
    arg_4, arg_2 = arg_0.lstm_cell(arg_1, arg_2)
    arg_4 = arg_0.output_layer(arg_4)
    arg_5 = tf.concat((arg_3[:-1], tf.shape(input=arg_4)[-1:]),
                              0)
    arg_4 = tf.reshape(arg_4, arg_5)
    arg_6 = arg_4[..., :arg_0.dimensions]
    arg_7 = tf.nn.softplus(arg_4[..., arg_0.dimensions:]) + 1e-5  # keep > 0
    return tfd.MultivariateNormalDiag(arg_6=arg_6, arg_7=arg_7), arg_2

Runs the model to generate a distribution for a single timestep .


return [x.strip() for x in self.info_gen(code, message)]

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_1 arg_3 , arg_4 = arg_0 . command ( "CAPABILITIES" , arg_2 ) if arg_3 != 101 : raise NNTPReplyError ( arg_3 , arg_4 ) return [ arg_5 . strip ( ) for arg_5 in arg_0 . info_gen ( arg_3 , arg_4 ) ]

def Func(arg_0, arg_1=None):
        """CAPABILITIES command.

        Determines the Func of the server.

        Although RFC3977 states that this is a required command for servers to
        implement not all servers do, so expect that NNTPPermanentError may be
        raised when this command is issued.

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

        Args:
            keyword: Passed directly to the server, however, this is unused by
                the server according to RFC3977.

        Returns:
            A list of Func supported by the server. The VERSION
            capability is the first capability in the list.
        """
        arg_2 = arg_1

        arg_3, arg_4 = arg_0.command("CAPABILITIES", arg_2)
        if arg_3 != 101:
            raise NNTPReplyError(arg_3, arg_4)

        return [arg_5.strip() for arg_5 in arg_0.info_gen(arg_3, arg_4)]

CAPABILITIES command.

        Determines the capabilities of the server.

        Although RFC3977 states that this is a required command for servers to
        implement not all servers do, so expect that NNTPPermanentError may be
        raised when this command is issued.

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

        Args:
            keyword: Passed directly to the server, however, this is unused by
                the server according to RFC3977.

        Returns:
            A list of capabilities supported by the server. The VERSION
            capability is the first capability in the list.


def Func ( arg_0 ) : arg_1 = os . getcwd ( ) os . chdir ( str ( arg_0 ) ) try : yield finally : os . chdir ( arg_1 )

def Func(arg_0):
    """Change working directory and restore the previous on exit"""
    arg_1 = os.getcwd()
    os.chdir(str(arg_0))
    try:
        yield
    finally:
        os.chdir(arg_1)


(user, enrolled_in, enterprise_customer, email_connection=None)

return mail.send_mail(
        subject_line,
        plain_msg,
        from_email_address,
        [user_email],
        html_message=html_msg,
        connection=email_connection
    )

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Send an email notifying a user about their enrollment in a course.

    Arguments:
        user: Either a User object or a PendingEnterpriseCustomerUser that we can use
            to get details for the email
        enrolled_in (dict): The dictionary contains details of the enrollable object
            (either course or program) that the user enrolled in. This MUST contain
            a `name` key, and MAY contain the other following keys:
                - url: A human-friendly link to the enrollable's home page
                - type: Either `course` or `program` at present
                - branding: A special name for what the enrollable "is"; for example,
                    "MicroMasters" would be the branding for a "MicroMasters Program"
                - start: A datetime object indicating when the enrollable will be available.
        enterprise_customer: The EnterpriseCustomer that the enrollment was created using.
        email_connection: An existing Django email connection that can be used without
            creating a new connection for each individual message

    """
    if hasattr(arg_0, 'first_name') and hasattr(arg_0, 'username'):
        # PendingEnterpriseCustomerUsers don't have usernames or real names. We should
        # template slightly differently to make sure weird stuff doesn't happen.
        arg_4 = arg_0.first_name
        if not arg_4:
            arg_4 = arg_0.username
    else:
        arg_4 = None

    # Users have an `email` attribute; PendingEnterpriseCustomerUsers have `user_email`.
    if hasattr(arg_0, 'email'):
        arg_5 = arg_0.email
    elif hasattr(arg_0, 'user_email'):
        arg_5 = arg_0.user_email
    else:
        raise TypeError(_('`user` must have one of either `email` or `user_email`.'))

    arg_6 = {
        'user_name': arg_4,
        'enrolled_in': arg_1,
        'organization_name': arg_2.name,
    }
    try:
        arg_7 = arg_2.enterprise_enrollment_template
    except (ObjectDoesNotExist, AttributeError):
        arg_7 = None

    arg_8, arg_9 = build_notification_message(arg_6, arg_7)

    arg_10 = get_notification_subject_line(arg_1['name'], arg_7)

    arg_11 = get_configuration_value_for_site(
        arg_2.site,
        'DEFAULT_FROM_EMAIL',
        default=settings.DEFAULT_FROM_EMAIL
    )

    return mail.send_mail(
        arg_10,
        arg_8,
        arg_11,
        [arg_5],
        html_message=arg_9,
        connection=arg_3
    )

Send an email notifying a user about their enrollment in a course .


async def Func ( arg_0 , arg_1 ) : if arg_0 . sub_manager is not None : return arg_0 . sub_manager = SubscriptionManager ( arg_1 , "token={}" . format ( arg_0 . _access_token ) , SUB_ENDPOINT ) arg_0 . sub_manager . start ( )

async def Func(arg_0, arg_1):
        """Start subscription manager for real time data."""
        if arg_0.sub_manager is not None:
            return
        arg_0.sub_manager = SubscriptionManager(
            arg_1, "token={}".format(arg_0._access_token), SUB_ENDPOINT
        )
        arg_0.sub_manager.start()

Start subscription manager for real time data .


def Func ( arg_0 ) : arg_1 = arg_0 . widget arg_2 = arg_0 . declaration arg_3 = arg_2 . ref arg_4 [ arg_3 ] = atomref ( arg_0 ) arg_1 . set ( 'ref' , arg_3 ) if arg_2 . text : arg_0 . set_text ( arg_2 . text ) if arg_2 . tail : arg_0 . set_tail ( arg_2 . tail ) if arg_2 . style : arg_0 . set_style ( arg_2 . style ) if arg_2 . cls : arg_0 . set_cls ( arg_2 . cls ) if arg_2 . attrs : arg_0 . set_attrs ( arg_2 . attrs ) if arg_2 . id : arg_1 . set ( 'id' , arg_2 . id ) if arg_2 . draggable : arg_0 . set_draggable ( arg_2 . draggable ) for arg_5 , arg_6 in arg_2 . members ( ) . items ( ) : if not arg_6 . metadata : continue arg_7 = arg_6 . metadata if not ( arg_7 . get ( 'd_member' ) and arg_7 . get ( 'd_final' ) ) : continue elif not arg_7 . get ( 'attr' , True ) : continue elif isinstance ( arg_6 , Event ) : continue arg_8 = getattr ( arg_2 , arg_5 ) if arg_8 : arg_0 . set_attribute ( arg_5 , arg_8 )

def Func(arg_0):
        """ Initialize the state of the toolkit widget.

        This method is called during the top-down pass, just after the
        'create_widget()' method is called. This method should init the
        state of the widget. The child widgets will not yet be created.

        """
        arg_1 = arg_0.widget
        arg_2 = arg_0.declaration

        #: Save ref id
        arg_3 = arg_2.ref
        arg_4[arg_3] = atomref(arg_0)
        arg_1.set('ref', arg_3)

        if arg_2.text:
            arg_0.set_text(arg_2.text)
        if arg_2.tail:
            arg_0.set_tail(arg_2.tail)
        if arg_2.style:
            arg_0.set_style(arg_2.style)
        if arg_2.cls:
            arg_0.set_cls(arg_2.cls)
        if arg_2.attrs:
            arg_0.set_attrs(arg_2.attrs)
        if arg_2.id:
            arg_1.set('id', arg_2.id)
        if arg_2.draggable:
            arg_0.set_draggable(arg_2.draggable)

        # Set any attributes that may be defined
        for arg_5, arg_6 in arg_2.members().items():
            if not arg_6.metadata:
                continue
            arg_7 = arg_6.metadata

            # Exclude any attr tags
            if not (arg_7.get('d_member') and arg_7.get('d_final')):
                continue

            # Skip any items with attr=false
            elif not arg_7.get('attr', True):
                continue

            elif isinstance(arg_6, Event):
                continue
            arg_8 = getattr(arg_2, arg_5)
            if arg_8:
                arg_0.set_attribute(arg_5, arg_8)

Initialize the state of the toolkit widget .


return tf.reduce_logsumexp(input_tensor=vs[..., tf.newaxis] + ms, axis=-2)

def Func ( arg_0 , arg_1 ) : return tf . reduce_logsumexp ( input_tensor = arg_0 [ ... , tf . newaxis ] + arg_1 , axis = - 2 )

def Func(arg_0, arg_1):
  """Multiply tensor of vectors by matrices assuming values stored are logs."""

  return tf.reduce_logsumexp(input_tensor=arg_0[..., tf.newaxis] + arg_1, axis=-2)

Multiply tensor of vectors by matrices assuming values stored are logs .


def Func(arg_0, arg_1, **arg_2):
        """
        Get details about an individual conversation.

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

Get details about an individual conversation .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = super ( CountVectorizer , arg_0 ) . Func ( arg_1 = arg_1 , arg_2 = arg_2 ) arg_0 . n = len ( arg_1 ) arg_5 = ( arg_0 . transform ( arg_1 ) > 0 ) . astype ( int ) arg_5 = arg_5 . sum ( axis = 0 ) . A1 arg_0 . period_ = arg_5 arg_0 . df_ = arg_5 / arg_0 . n return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """ Learn the vocabulary dictionary and return term-document matrix.
        This is equivalent to fit followed by transform, but more efficiently
        implemented.

        Parameters
        ----------
        raw_documents : iterable
            An iterable which yields either str, unicode or file objects.

        Returns
        -------
        X : array, [n_samples, n_features]
            Document-term matrix.
        """
        arg_3 = super(CountVectorizer, arg_0).Func(
            arg_1=arg_1, arg_2=arg_2)
        arg_0.n = len(arg_1)
        arg_5 = (arg_0.transform(arg_1) > 0).astype(int)
        arg_5 = arg_5.sum(axis=0).A1
        arg_0.period_ = arg_5
        arg_0.df_ = arg_5 / arg_0.n
        return arg_3

Learn the vocabulary dictionary and return term - document matrix . This is equivalent to fit followed by transform but more efficiently implemented .


def Func(arg_0, arg_1):
        r"""Attempt to parse a single token on the first line of this source.

        This method is used for parsing whitespace-delimited arguments, like
        ``\input file``. The source should ideally contain `` file`` along
        with a newline character.

        >>> source = 'Line 1\n' r'\input test.tex' '\nLine 2'
        >>> LatexCommand.Func(source, 'input')
        'test.tex'

        Bracket delimited arguments (``\input{test.tex}``) are handled in
        the normal logic of `_parse_command`.
        """
        # First match the command name itself so that we find the argument
        # *after* the command
        arg_2 = r'\\(' + arg_1 + r')(?:[\s{[%])'
        arg_3 = re.search(arg_2, arg_0)
        if arg_3 is not None:
            # Trim `source` so we only look after the command
            arg_0 = arg_0[arg_3.end(1):]

        # Find the whitespace-delimited argument itself.
        arg_4 = r'(?P<content>\S+)(?:[ %\t\n]+)'
        arg_5 = re.search(arg_4, arg_0)
        if arg_5 is None:
            arg_6 = (
                'When parsing {}, did not find whitespace-delimited command '
                'argument'
            )
            raise CommandParserError(arg_6.format(arg_1))
        arg_7 = arg_5.group('content')
        arg_7.strip()
        return arg_7

r"""Attempt to parse a single token on the first line of this source.

        This method is used for parsing whitespace-delimited arguments, like
        ``\input file``. The source should ideally contain `` file`` along
        with a newline character.

        >>> source = 'Line 1\n' r'\input test.tex' '\nLine 2'
        >>> LatexCommand._parse_whitespace_argument(source, 'input')
        'test.tex'

        Bracket delimited arguments (``\input{test.tex}``) are handled in
        the normal logic of `_parse_command`.

r Attempt to parse a single token on the first line of this source .


(Hc=None, atoms={}, CASRN='', AvailableMethods=False, Method=None)

def
Func
(
arg_0
=
,
arg_1
=
{
}
,
arg_2
=
''
,
arg_3
=
False
,
arg_4
=
)
:
def
list_methods
(
)
:
arg_5
=
[
]
if
arg_2
in
IEC_2010
.
index
and
not
np
.
isnan
(
IEC_2010
.
at
[
arg_2
,
'Func'
]
)
:
arg_5
.
append
(
IEC
)
if
arg_2
in
NFPA_2008
.
index
and
not
np
.
isnan
(
NFPA_2008
.
at
[
arg_2
,
'Func'
]
)
:
arg_5
.
append
(
NFPA
)
if
arg_0
:
arg_5
.
append
(
SUZUKI
)
if
arg_1
:
arg_5
.
append
(
CROWLLOUVAR
)
arg_5
.
append
(
)
return
arg_5
if
arg_3
:
return
list_methods
(
)
if
not
arg_4
:
arg_4
=
list_methods
(
)
[
0
]
if
arg_4
==
IEC
:
return
float
(
IEC_2010
.
at
[
arg_2
,
'Func'
]
)
elif
arg_4
==
NFPA
:
return
float
(
NFPA_2008
.
at
[
arg_2
,
'Func'
]
)
elif
arg_4
==
SUZUKI
:
return
Suzuki_Func
(
arg_0
=
arg_0
)
elif
arg_4
==
CROWLLOUVAR
:
return
Crowl_Louvar_Func
(
arg_1
=
arg_1
)
elif
arg_4
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)

def Func(arg_0=None, arg_1={}, arg_2='', arg_3=False, arg_4=None):
    r'''This function handles the retrieval or calculation of a chemical's
    Upper Flammability Limit. Lookup is based on CASRNs. Two predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. If the heat of combustion
    is provided, the estimation method `Suzuki_Func` can be used. If the atoms
    of the molecule are available, the method `Crowl_Louvar_Func` can be used.

    Examples
    --------
    >>> Func(CASRN='71-43-2')
    0.086

    Parameters
    ----------
    Hc : float, optional
        Heat of combustion of gas [J/mol]
    atoms : dict, optional
        Dictionary of atoms and atom counts
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    Func : float
        Upper flammability limit of the gas in an atmosphere at STP, [mole fraction]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the Upper Flammability Limit for the desired chemical, and will return
        methods instead of Upper Flammability Limit.

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.
    '''
    def list_methods():
        arg_5 = []
        if arg_2 in IEC_2010.index and not np.isnan(IEC_2010.at[arg_2, 'Func']):
            arg_5.append(IEC)
        if arg_2 in NFPA_2008.index and not np.isnan(NFPA_2008.at[arg_2, 'Func']):
            arg_5.append(NFPA)
        if arg_0:
            arg_5.append(SUZUKI)
        if arg_1:
            arg_5.append(CROWLLOUVAR)
        arg_5.append(NONE)
        return arg_5
    if arg_3:
        return list_methods()
    if not arg_4:
        arg_4 = list_methods()[0]

    if arg_4 == IEC:
        return float(IEC_2010.at[arg_2, 'Func'])
    elif arg_4 == NFPA:
        return float(NFPA_2008.at[arg_2, 'Func'])
    elif arg_4 == SUZUKI:
        return Suzuki_Func(arg_0=arg_0)
    elif arg_4 == CROWLLOUVAR:
        return Crowl_Louvar_Func(arg_1=arg_1)
    elif arg_4 == NONE:
        return None
    else:
        raise Exception('Failure in in function')

r'''This function handles the retrieval or calculation of a chemical's
    Upper Flammability Limit. Lookup is based on CASRNs. Two predictive methods
    are currently implemented. Will automatically select a data source to use
    if no Method is provided; returns None if the data is not available.

    Prefered source is 'IEC 60079-20-1 (2010)' [1]_, with the secondary source
    'NFPA 497 (2008)' [2]_ having very similar data. If the heat of combustion
    is provided, the estimation method `Suzuki_UFL` can be used. If the atoms
    of the molecule are available, the method `Crowl_Louvar_UFL` can be used.

    Examples
    --------
    >>> UFL(CASRN='71-43-2')
    0.086

    Parameters
    ----------
    Hc : float, optional
        Heat of combustion of gas [J/mol]
    atoms : dict, optional
        Dictionary of atoms and atom counts
    CASRN : string, optional
        CASRN [-]

    Returns
    -------
    UFL : float
        Upper flammability limit of the gas in an atmosphere at STP, [mole fraction]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain UFL with the
        given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        UFL_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        the Upper Flammability Limit for the desired chemical, and will return
        methods instead of Upper Flammability Limit.

    Notes
    -----

    References
    ----------
    .. [1] IEC. “IEC 60079-20-1:2010 Explosive atmospheres - Part 20-1:
       Material characteristics for gas and vapour classification - Test
       methods and data.” https://webstore.iec.ch/publication/635. See also
       https://law.resource.org/pub/in/bis/S05/is.iec.60079.20.1.2010.pdf
    .. [2] National Fire Protection Association. NFPA 497: Recommended
       Practice for the Classification of Flammable Liquids, Gases, or Vapors
       and of Hazardous. NFPA, 2008.

r This function handles the retrieval or calculation of a chemical s Upper Flammability Limit . Lookup is based on CASRNs . Two predictive methods are currently implemented . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func(arg_0=None):
    """return an "FTP" object after logging in."""
    arg_1=os.path.realpath(__file__)
    for arg_2 in range(3):
        arg_1=os.path.dirname(arg_1)
    arg_3 = os.path.join(arg_1,"passwd.txt")
    print(" -- looking for login information in:\n   [%s]"%arg_3)
    try:
        with open(arg_3) as f:
            arg_4=f.readlines()
        arg_5=arg_4[0].strip()
        arg_6=arg_4[1].strip()
        print(" -- found a valid username/password")
    except:
        print(" -- password lookup FAILED.")
        arg_5=TK_askPassword("FTP LOGIN","enter FTP username")
        arg_6=TK_askPassword("FTP LOGIN","enter password for %s"%arg_5)
        if not arg_5 or not arg_6:
            print(" !! failed getting login info. aborting FTP effort.")
            return
    print("      username:",arg_5)
    print("      password:","*"*(len(arg_6)))
    print(" -- logging in to FTP ...")
    try:
        arg_7 = ftplib.FTP("swharden.com")
        arg_7.login(arg_5, arg_6)
        if arg_0:
            arg_7.cwd(arg_0)
        return arg_7
    except:
        print(" !! login failure !!")
        return False


return column.ColumnStringArrow(sl.bytes, sl.indices, sl.length, sl.offset, string_sequence=sl)

def Func ( arg_0 ) : arg_1 = _to_string_sequence ( arg_0 ) . upper ( ) return column . ColumnStringArrow ( arg_1 . bytes , arg_1 . indices , arg_1 . length , arg_1 . offset , string_sequence = arg_1 )

def Func(arg_0):
    """Converts all strings in a column to uppercase.

    :returns: an expression containing the converted strings.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.upper()
    Expression = Func(text)
    Length: 5 dtype: str (expression)
    ---------------------------------
    0    SOMETHING
    1  VERY PRETTY
    2    IS COMING
    3          OUR
    4         WAY.

    """
    arg_1 = _to_string_sequence(arg_0).upper()
    return column.ColumnStringArrow(arg_1.bytes, arg_1.indices, arg_1.length, arg_1.offset, string_sequence=arg_1)

Converts all strings in a column to uppercase.

    :returns: an expression containing the converted strings.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.upper()
    Expression = str_upper(text)
    Length: 5 dtype: str (expression)
    ---------------------------------
    0    SOMETHING
    1  VERY PRETTY
    2    IS COMING
    3          OUR
    4         WAY.

Converts all strings in a column to uppercase .


def Func(arg_0, arg_1=False, arg_2=None):
    """Debug a single doctest docstring, in argument `src`'"""
    arg_3 = script_from_examples(arg_0)
    debug_script(arg_3, arg_1, arg_2)

Debug a single doctest docstring in argument src


def Func(arg_0, arg_1=arg_2):
    """Command to check configuration file. Raises InvalidConfig on error

    :param str file: path to config file
    :param printfn: print function for success message
    :return: None
    """
    Config(arg_0).read()
    arg_1('The configuration file "{}" is correct'.format(arg_0))

Command to check configuration file . Raises InvalidConfig on error


(host, enable_long_host=False, encode_with_idna=None,
                    scheme=None)

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
arg_3
=
)
:
if
arg_2
is
not
:
arg_4
=
arg_2
else
:
arg_4
=
arg_3
.
lower
(
)
in
IDNA_SCHEMES
if
arg_3
else
False
if
arg_4
:
try
:
arg_0
=
'.'
.
join
(
segment
.
encode
(
'idna'
)
.
decode
(
)
for
segment
in
arg_0
.
split
(
'.'
)
)
except
UnicodeError
as
exc
:
raise
ValueError
(
'host is invalid - {0}'
.
format
(
exc
)
)
else
:
arg_0
=
parse
.
quote
(
arg_0
.
encode
(
'utf-8'
)
,
safe
=
HOST_SAFE_CHARS
)
if
len
(
arg_0
)
>
255
and
not
arg_1
:
raise
ValueError
(
'host too long'
)
return
arg_0

def Func(arg_0, arg_1=False, arg_2=None,
                    arg_3=None):
    """
    Normalize a host for a URL.

    :param str host: the host name to normalize

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

    :return: the normalized and encoded string ready for inclusion
        into a URL

    """
    if arg_2 is not None:
        arg_4 = arg_2
    else:
        arg_4 = arg_3.lower() in IDNA_SCHEMES if arg_3 else False
    if arg_4:
        try:
            arg_0 = '.'.join(segment.encode('idna').decode()
                            for segment in arg_0.split('.'))
        except UnicodeError as exc:
            raise ValueError('host is invalid - {0}'.format(exc))
    else:
        arg_0 = parse.quote(arg_0.encode('utf-8'), safe=HOST_SAFE_CHARS)

    if len(arg_0) > 255 and not arg_1:
        raise ValueError('host too long')

    return arg_0


def Func ( arg_0 ) : arg_1 = [ ] while True : try : arg_1 . append ( arg_0 . get_msg ( block = False ) ) except Empty : break return arg_1

def Func(arg_0):
        """Get all messages that are currently ready."""
        arg_1 = []
        while True:
            try:
                arg_1.append(arg_0.get_msg(block=False))
            except Empty:
                break
        return arg_1

Get all messages that are currently ready .


(self, pk, start_line=None, end_line=None, outfile=sys.stdout, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = arg_5 . stdout , ** arg_7 ) : if arg_0 . unified_job_type != arg_0 . endpoint : arg_8 = arg_0 . last_job_data ( arg_1 , ** arg_7 ) arg_1 = arg_8 [ 'id' ] elif not arg_1 : arg_8 = arg_0 . get ( ** arg_7 ) arg_1 = arg_8 [ 'id' ] arg_9 = arg_0 . lookup_stdout ( arg_1 , arg_2 , arg_3 ) arg_10 = False if isinstance ( arg_4 , six . string_types ) : arg_4 = open ( arg_4 , 'w' ) arg_10 = True if len ( arg_9 ) > 0 : click . echo ( arg_9 , nl = 1 , file = arg_4 ) if arg_10 : arg_4 . close ( ) return { "changed" : False }

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=arg_5.stdout, **arg_7):
        """
        Print out the standard out of a unified job to the command line or output file.
        For Projects, print the standard out of most recent update.
        For Inventory Sources, print standard out of most recent sync.
        For Jobs, print the job's standard out.
        For Workflow Jobs, print a status table of its jobs.

        =====API DOCS=====
        Print out the standard out of a unified job to the command line or output file.
        For Projects, print the standard out of most recent update.
        For Inventory Sources, print standard out of most recent sync.
        For Jobs, print the job's standard out.
        For Workflow Jobs, print a status table of its jobs.

        :param pk: Primary key of the job resource object to be monitored.
        :type pk: int
        :param start_line: Line at which to start printing job output
        :param end_line: Line at which to end printing job output
        :param outfile: Alternative file than stdout to write job stdout to.
        :type outfile: file
        :param `**kwargs`: Keyword arguments used to look up job resource object to monitor if ``pk`` is
                           not provided.
        :returns: A dictionary containing changed=False
        :rtype: dict

        =====API DOCS=====
        """

        # resource is Unified Job Template
        if arg_0.unified_job_type != arg_0.endpoint:
            arg_8 = arg_0.last_job_data(arg_1, **arg_7)
            arg_1 = arg_8['id']
        # resource is Unified Job, but pk not given
        elif not arg_1:
            arg_8 = arg_0.get(**arg_7)
            arg_1 = arg_8['id']

        arg_9 = arg_0.lookup_stdout(arg_1, arg_2, arg_3)
        arg_10 = False
        if isinstance(arg_4, six.string_types):
            arg_4 = open(arg_4, 'w')
            arg_10 = True
        if len(arg_9) > 0:
            click.echo(arg_9, nl=1, file=arg_4)
        if arg_10:
            arg_4.close()

        return {"changed": False}

Print out the standard out of a unified job to the command line or output file . For Projects print the standard out of most recent update . For Inventory Sources print standard out of most recent sync . For Jobs print the job s standard out . For Workflow Jobs print a status table of its jobs .


def Func(arg_0, arg_1, arg_2):
        """Execute the given line magic.

        Parameters
        ----------
        magic_name : str
          Name of the desired magic function, without '%' prefix.

        line : str
          The rest of the input line as a single string.
        """
        arg_3 = arg_0.find_line_magic(arg_1)
        if arg_3 is None:
            arg_4 = arg_0.find_cell_magic(arg_1)
            arg_5 = "Line magic function `%%%s` not found%s."
            arg_6 = '' if arg_4 is None else (' (But cell magic `%%%%%s` exists, '
                                    'did you mean that instead?)' % arg_1 )
            error(arg_5 % (arg_1, arg_6))
        else:
            # Note: this is the distance in the stack to the user's frame.
            # This will need to be updated if the internal calling logic gets
            # refactored, or else we'll be expanding the wrong variables.
            arg_7 = 2
            arg_8 = arg_0.var_expand(arg_2, arg_7)
            # Put magic args in a list so we can call with f(*a) syntax
            arg_9 = [arg_8]
            # Grab local namespace if we need it:
            if getattr(arg_3, "needs_local_scope", False):
                arg_9.append(sys._getframe(arg_7).f_locals)
            with arg_0.builtin_trap:
                arg_10 = arg_3(*arg_9)
            return arg_10


def Func ( arg_0 , arg_1 = 5 ) : arg_2 = arg_0 . _connect_args [ 'host' ] arg_3 = arg_0 . _connect_args [ 'port' ] try : arg_4 = socket . create_connection ( ( arg_2 , arg_3 ) , arg_1 = arg_1 ) arg_4 . close ( ) return True except socket . error : pass return False

def Func(arg_0, arg_1=5):
        """Returns True if database server is running, False otherwise."""
        arg_2 = arg_0._connect_args['host']
        arg_3 = arg_0._connect_args['port']
        try:
            arg_4 = socket.create_connection((arg_2, arg_3), arg_1=arg_1)
            arg_4.close()
            return True
        except socket.error:
            pass
        return False

Returns True if database server is running False otherwise .


return index_points if index_points is not None else self._index_points

def Func(arg_0, arg_1=None):
    """Return `index_points` if not None, else `self._index_points`.

    Args:
      index_points: if given, this is what is returned; else,
      `self._index_points`

    Returns:
      index_points: the given arg, if not None, else the class member
      `self._index_points`.

    Rases:
      ValueError: if `index_points` and `self._index_points` are both `None`.
    """
    if arg_0._index_points is None and arg_1 is None:
      raise ValueError(
          'This GaussianProcess instance was not instantiated with a value for '
          'index_points. One must therefore be provided when calling sample, '
          'log_prob, and other such methods. In particular, one can\'t compute '
          'KL divergences to/from an instance of `GaussianProccess` with '
          'unspecified `index_points` directly. Instead, use the '
          '`get_marginal_distribution` function, which takes `index_points` as '
          'an argument and returns a `Normal` or '
          '`MultivariateNormalLinearOperator` instance, whose KL can be '
          'computed.')
    return arg_1 if arg_1 is not None else arg_0._index_points

Return index_points if not None else self . _index_points .


def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        '''
        Sets up for divergence estimation "from" new data "to" X.
        Builds FLANN indices for each bag, and maybe gets within-bag distances.

        Parameters
        ----------
        X : list of arrays or :class:`skl_groups.features.Features`
            The bags to search "to".

        get_rhos : boolean, optional, default False
            Compute within-bag distances :attr:`rhos_`. These are only needed
            for some divergence functions or if do_sym is passed, and they'll
            be computed (and saved) during :meth:`transform` if they're not
            computed here.

            If you're using Jensen-Shannon divergence, a higher max_K may
            be needed once it sees the number of points in the transformed bags,
            so the computation here might be wasted.
        '''
        arg_0.features_ = arg_1 = as_features(arg_1, stack=True, bare=True)

        # if we're using a function that needs to pick its K vals itself,
        # then we need to set max_K here. when we transform(), might have to
        # re-do this :|
        arg_5 = arg_0._get_Ks()
        arg_6, arg_6, arg_6, arg_7, arg_8, arg_6 = _choose_funcs(
            arg_0.div_funcs, arg_5, arg_1.dim, arg_1.n_pts, None, arg_0.version)

        if arg_7 >= arg_1.n_pts.min():
            arg_9 = "asked for K = {}, but there's a bag with only {} points"
            raise ValueError(arg_9.format(arg_7, arg_1.n_pts.min()))

        arg_10 = arg_0.memory
        if isinstance(arg_10, string_types):
            arg_10 = Memory(cachedir=arg_10, verbose=0)

        arg_0.indices_ = id = arg_10.cache(_build_indices)(arg_1, arg_0._flann_args())
        if arg_3:
            arg_0.rhos_ = _get_rhos(arg_1, id, arg_5, arg_7, arg_8, arg_0.min_dist)
        elif hasattr(arg_0, 'rhos_'):
            del arg_0.rhos_
        return arg_0

Sets up for divergence estimation from new data to X . Builds FLANN indices for each bag and maybe gets within - bag distances .


def Func ( arg_0 , arg_1 ) : arg_0 . server = arg_1 . authorized_jid . bare ( ) if "versioning" in arg_0 . server_features : if arg_0 . roster is not None and arg_0 . roster . version is not None : arg_3 = arg_0 . roster . version else : arg_3 = u"" else : arg_3 = None arg_0 . request_roster ( arg_3 )

def Func(arg_0, arg_1):
        """Request roster upon login."""
        arg_0.server = arg_1.authorized_jid.bare()
        if "versioning" in arg_0.server_features:
            if arg_0.roster is not None and arg_0.roster.version is not None:
                arg_3 = arg_0.roster.version
            else:
                arg_3 = u""
        else:
            arg_3 = None
        arg_0.request_roster(arg_3)


def Func ( arg_0 , * arg_1 ) : for arg_2 in arg_1 : arg_0 . interceptors . append ( arg_2 ( arg_0 . engine ) )

def Func(arg_0, *arg_1):
        """
        Adds one or multiple HTTP traffic interceptors to the current
        mocking engine.

        Interceptors are typically HTTP client specific wrapper classes that
        implements the pook interceptor interface.

        Arguments:
            interceptors (pook.interceptors.BaseInterceptor)
        """
        for arg_2 in arg_1:
            arg_0.interceptors.append(arg_2(arg_0.engine))

Adds one or multiple HTTP traffic interceptors to the current mocking engine .


return [conv for conv in self._conv_dict.values()
                if not conv.is_archived or include_archived]

def Func ( arg_0 , arg_1 = False ) : return [ arg_2 for arg_2 in arg_0 . _conv_dict . values ( ) if not arg_2 . is_archived or arg_1 ]

def Func(arg_0, arg_1=False):
        """Get all the conversations.

        Args:
            include_archived (bool): (optional) Whether to include archived
                conversations. Defaults to ``False``.

        Returns:
            List of all :class:`.Conversation` objects.
        """
        return [arg_2 for arg_2 in arg_0._conv_dict.values()
                if not arg_2.is_archived or arg_1]


def Func ( arg_0 ) : if not arg_0 . active : return None arg_0 . mock_engine . Func ( ) arg_0 . active = False

def Func(arg_0):
        """
        Disables interceptors and stops intercepting any outgoing HTTP traffic.
        """
        if not arg_0.active:
            return None

        # Disable current mock engine
        arg_0.mock_engine.Func()
        # Disable engine state
        arg_0.active = False

Disables interceptors and stops intercepting any outgoing HTTP traffic .


def Func(arg_0,arg_1):
        """Return a function `fun` that will execute `magic` on active frontend.

        Parameters
        ----------
        magic : string
            string that will be executed as is when the returned function is called

        Returns
        -------
        fun : function
            function with no parameters, when called will execute `magic` on the
            current active frontend at call time

        See Also
        --------
        populate_all_magic_menu : generate the "All Magics..." menu

        Notes
        -----
        `fun` executes `magic` in active frontend at the moment it is triggered,
        not the active frontend at the moment it was created.

        This function is mostly used to create the "All Magics..." Menu at run time.
        """
        # need two level nested function to be sure to pass magic
        # to active frontend **at run time**.
        def arg_2():
            arg_0.active_frontend.execute(arg_1)
        arg_2.__name__ = "dynamics_magic_s"
        return arg_2

Return a function fun that will execute magic on active frontend .


def Func ( arg_0 , arg_1 = '$' ) : if int ( arg_0 ) == arg_0 : return '{}{}' . format ( arg_1 , int ( arg_0 ) ) return '{}{:0.2f}' . format ( arg_1 , arg_0 )

def Func(arg_0, arg_1='$'):
    """
    Format the price to have the appropriate currency and digits..

    :param price: The price amount.
    :param currency: The currency for the price.
    :return: A formatted price string, i.e. '$10', '$10.52'.
    """
    if int(arg_0) == arg_0:
        return '{}{}'.format(arg_1, int(arg_0))
    return '{}{:0.2f}'.format(arg_1, arg_0)

Format the price to have the appropriate currency and digits ..


return super(SystemFinder, self).find(path, all=all)

def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_1 . split ( '/' ) arg_4 = [ 'jspm_packages' , settings . SYSTEMJS_OUTPUT_DIR ] if not arg_3 or arg_3 [ 0 ] not in arg_4 : return [ ] return super ( SystemFinder , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=False):
        """
        Only allow lookups for jspm_packages.

        # TODO: figure out the 'jspm_packages' dir from packag.json.
        """
        arg_3 = arg_1.split('/')
        arg_4 = ['jspm_packages', settings.SYSTEMJS_OUTPUT_DIR]
        if not arg_3 or arg_3[0] not in arg_4:
            return []
        return super(SystemFinder, arg_0).Func(arg_1, arg_2=arg_2)


def Func ( arg_0 ) : arg_1 = { } if 'ports' in arg_0 : arg_1 [ 'ports' ] = [ arg_0 [ 'ports' ] ] if 'up' in arg_0 : arg_1 [ 'up' ] = bool ( arg_0 [ 'up' ] ) if 'search' in arg_0 : arg_1 [ 'search' ] = [ arg_0 [ 'search' ] ] if 'tags' in arg_0 : arg_1 [ 'tags' ] = [ arg_0 [ 'tags' ] ] if 'groups' in arg_0 : arg_1 [ 'groups' ] = [ arg_0 [ 'groups' ] ] return arg_1

def Func(arg_0):
    """
        Creates a search query based on the section of the config file.
    """
    arg_1 = {}

    if 'ports' in arg_0:
        arg_1['ports'] = [arg_0['ports']]
    if 'up' in arg_0:
        arg_1['up'] = bool(arg_0['up'])
    if 'search' in arg_0:
        arg_1['search'] = [arg_0['search']]
    if 'tags' in arg_0:
        arg_1['tags'] = [arg_0['tags']]
    if 'groups' in arg_0:
        arg_1['groups'] = [arg_0['groups']]

    return arg_1

Creates a search query based on the section of the config file .


def Func ( arg_0 ) : arg_1 = os . path . join ( arg_0 , PIP_DELETE_MARKER_FILENAME ) with open ( arg_1 , 'w' ) as marker_fp : marker_fp . write ( DELETE_MARKER_MESSAGE )

def Func(arg_0):
    """
    Write the pip delete marker file into this directory.
    """
    arg_1 = os.path.join(arg_0, PIP_DELETE_MARKER_FILENAME)
    with open(arg_1, 'w') as marker_fp:
        marker_fp.write(DELETE_MARKER_MESSAGE)

Write the pip delete marker file into this directory .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_0 . x += arg_0 . dx else : arg_0 . x = arg_0 . x + arg_1

def Func(arg_0, arg_1=None):
        """ Mutable x addition. Defaults to set delta value. """
        if arg_1 is None:
            arg_0.x += arg_0.dx
        else:
            arg_0.x = arg_0.x + arg_1

Mutable x addition . Defaults to set delta value .


def Func(arg_0, arg_1, arg_2='GET', **arg_3):
        '''Make request and convert JSON response to python objects'''
        arg_4 = requests.post if arg_2 == 'POST' else requests.get
        try:
            arg_5 = arg_4(
                arg_1,
                headers=arg_0._token_header(),
                timeout=arg_0.settings['timeout'],
                **arg_3)
        except requests.exceptions.Timeout:
            raise ApiError('Request timed out (%s seconds)' % arg_0.settings['timeout'])
        try:
            arg_6 = arg_5.json()
        except ValueError:
            raise ApiError('Received not JSON response from API')
        if arg_6.get('status') != 'ok':
            raise ApiError('API error: received unexpected json from API: %s' % arg_6)
        return arg_6


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_2
.
contents
.
value
=
arg_0
.
IllegalStateError
raise
NotImplementedError
(
"You must override this method."
)
return
''

def Func(arg_0, arg_1, arg_2):
        """Must be overridden. Must return a string with the loaded data."""
        arg_2.contents.value = arg_0.IllegalStateError
        raise NotImplementedError("You must override this method.")
        return ''

Must be overridden . Must return a string with the loaded data .


return render_template(
        "invenio_groups/new.html",
        form=form,
    )

def
Func
(
)
:
arg_0
=
GroupForm
(
request
.
form
)
if
arg_0
.
validate_on_submit
(
)
:
try
:
arg_1
=
Group
.
create
(
admins
=
[
current_user
]
,
**
arg_0
.
data
)
flash
(
_
(
'Group "%(name)s" created'
,
name
=
arg_1
.
name
)
,
'success'
)
return
redirect
(
url_for
(
".index"
)
)
except
IntegrityError
:
flash
(
_
(
'Group creation failure'
)
,
'error'
)
return
render_template
(
"invenio_groups/Func.html"
,
arg_0
=
arg_0
,
)

def Func():
    """Create Func group."""
    arg_0 = GroupForm(request.form)

    if arg_0.validate_on_submit():
        try:
            arg_1 = Group.create(admins=[current_user], **arg_0.data)

            flash(_('Group "%(name)s" created', name=arg_1.name), 'success')
            return redirect(url_for(".index"))
        except IntegrityError:
            flash(_('Group creation failure'), 'error')

    return render_template(
        "invenio_groups/Func.html",
        arg_0=arg_0,
    )


def Func(arg_0, *arg_1, **arg_2):
        """
        Send xAPI statements.
        """
        if not CourseEnrollment:
            raise NotConnectedToOpenEdX("This package must be installed in an OpenEdX environment.")

        arg_3, arg_4 = arg_0.parse_arguments(*arg_1, **arg_2)

        if arg_4:
            try:
                arg_5 = XAPILRSConfiguration.objects.get(
                    active=True,
                    arg_4=arg_4
                )
            except XAPILRSConfiguration.DoesNotExist:
                raise CommandError('No xAPI Configuration found for "{enterprise_customer}"'.format(
                    arg_4=arg_4.name
                ))

            # Send xAPI analytics data to the configured LRS
            arg_0.send_xapi_statements(arg_5, arg_3)
        else:
            for arg_5 in XAPILRSConfiguration.objects.filter(active=True):
                arg_0.send_xapi_statements(arg_5, arg_3)


(self, coordinates, num_results=1, objects=False)

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = False ) : if arg_3 : return arg_0 . _Func_obj ( arg_1 , arg_2 , arg_3 ) arg_4 , arg_5 = arg_0 . get_coordinate_pointers ( arg_1 ) arg_6 = ctypes . pointer ( ctypes . c_uint64 ( arg_2 ) ) arg_7 = ctypes . pointer ( ctypes . c_int64 ( ) ) core . rt . Index_NearestNeighbors_id ( arg_0 . handle , arg_4 , arg_5 , arg_0 . properties . dimension , ctypes . byref ( arg_7 ) , arg_6 ) return arg_0 . _get_ids ( arg_7 , arg_6 . contents . value )

def Func(arg_0, arg_1, arg_2=1, arg_3=False):
        """Returns the ``k``-Func objects to the given coordinates.

        :param coordinates: sequence or array
            This may be an object that satisfies the numpy array
            protocol, providing the index's dimension * 2 coordinate
            pairs representing the `mink` and `maxk` coordinates in
            each dimension defining the bounds of the query window.

        :param num_results: integer
            The number of results to return Func to the given coordinates.
            If two index entries are equidistant, *both* are returned.
            This property means that :attr:`num_results` may return more
            items than specified

        :param objects: True / False / 'raw'
            If True, the Func method will return index objects that
            were pickled when they were stored with each index entry, as
            well as the id and bounds of the index entries.
            If 'raw', it will return the object as entered into the database
            without the :class:`rtree.index.Item` wrapper.

        Example of finding the three items Func to this one::

            >>> from rtree import index
            >>> idx = index.Index()
            >>> idx.insert(4321, (34.37, 26.73, 49.37, 41.73), obj=42)
            >>> hits = idx.Func((0, 0, 10, 10), 3, objects=True)
        """
        if arg_3:
            return arg_0._Func_obj(arg_1, arg_2, arg_3)
        arg_4, arg_5 = arg_0.get_coordinate_pointers(arg_1)

        arg_6 = ctypes.pointer(ctypes.c_uint64(arg_2))

        arg_7 = ctypes.pointer(ctypes.c_int64())

        core.rt.Index_NearestNeighbors_id(arg_0.handle,
                                          arg_4,
                                          arg_5,
                                          arg_0.properties.dimension,
                                          ctypes.byref(arg_7),
                                          arg_6)

        return arg_0._get_ids(arg_7, arg_6.contents.value)

Returns the ``k``-nearest objects to the given coordinates.

        :param coordinates: sequence or array
            This may be an object that satisfies the numpy array
            protocol, providing the index's dimension * 2 coordinate
            pairs representing the `mink` and `maxk` coordinates in
            each dimension defining the bounds of the query window.

        :param num_results: integer
            The number of results to return nearest to the given coordinates.
            If two index entries are equidistant, *both* are returned.
            This property means that :attr:`num_results` may return more
            items than specified

        :param objects: True / False / 'raw'
            If True, the nearest method will return index objects that
            were pickled when they were stored with each index entry, as
            well as the id and bounds of the index entries.
            If 'raw', it will return the object as entered into the database
            without the :class:`rtree.index.Item` wrapper.

        Example of finding the three items nearest to this one::

            >>> from rtree import index
            >>> idx = index.Index()
            >>> idx.insert(4321, (34.37, 26.73, 49.37, 41.73), obj=42)
            >>> hits = idx.nearest((0, 0, 10, 10), 3, objects=True)

Returns the k - nearest objects to the given coordinates .


(self, alpharangemults=(0.9,1.1), n_alpha=201,
                            approximate=True, verbose=True, finite=True)

def Func(arg_0, arg_1=(0.9,1.1), arg_2=201,
                            arg_3=True, arg_4=True, arg_5=True):
        """
        Use the maximum likelihood to determine the most likely value of alpha

        *alpharangemults* [ 2-tuple ]
            Pair of values indicating multiplicative factors above and below the
            approximate alpha from the MLE alpha to use when determining the
            "exact" alpha (by directly maximizing the likelihood function)
        *n_alpha* [ int ]
            Number of alpha values to use when measuring.  Larger number is more accurate.
        *approximate* [ bool ]
            If False, try to "zoom-in" around the MLE alpha and get the exact
            best alpha value within some range around the approximate best
        *vebose* [ bool ]
        *finite* [ bool ]
            Correction for finite data?
        """

        arg_6 = arg_0.data
        arg_0._xmins = xmins = arg_14.unique(arg_6)
        if arg_3:
            arg_8 = [ discrete_alpha_mle(arg_6,xmin) for xmin in xmins ]
        else:
            arg_9 = [ discrete_alpha_mle(arg_6,xmin) for xmin in xmins ]
            arg_10 = [(0.9*a,1.1*a) for a in arg_9]
            arg_8 = [ most_likely_alpha(arg_6,xmin,alpharange=ar,arg_2=arg_2)
                             for xmin,ar in zip(xmins,arg_10) ]
        arg_11 = arg_14.array([discrete_ksD(arg_6, xmin, alpha)
                                for xmin,alpha in zip(xmins,arg_8)
                               ])
        arg_0._alpha_values = arg_14.array(arg_8)
        arg_0._xmin_kstest = arg_11

        arg_11[arg_14.isnan(arg_11)] = arg_14.inf

        arg_16 = argmin(arg_11)
        arg_0._alpha = best_alpha = arg_8[arg_16]
        arg_0._xmin = best_xmin = xmins[arg_16]
        arg_0._ks = best_ks = arg_11[arg_16]
        arg_0._likelihood = best_likelihood = discrete_likelihood(arg_6, best_xmin, best_alpha)

        if arg_5:
            arg_0._alpha = arg_0._alpha*(n-1.)/n+1./n

        if arg_4:
            print("alpha = %f   xmin = %f   ksD = %f   L = %f   (n<x) = %i  (n>=x) = %i" % (
                    best_alpha, best_xmin, best_ks, best_likelihood,
                    (arg_6<best_xmin).sum(), (arg_6>=best_xmin).sum()))

        arg_0._ngtx = n = (arg_0.data>=arg_0._xmin).sum()
        arg_0._alphaerr = (arg_0._alpha-1.0)/arg_14.sqrt(n)
        if scipyOK:
            arg_0._ks_prob = scipy.stats.ksone.sf(arg_0._ks, n)

        return best_alpha,best_xmin,best_ks,best_likelihood


def Func(arg_0, arg_1):
    """Register a handler for some file extensions.

    Args:
        handler (:obj:`BaseFileHandler`): Handler to be registered.
        file_formats (str or list[str]): File formats to be handled by this
            handler.
    """
    if not isinstance(arg_0, BaseFileHandler):
        raise TypeError(
            'handler must be a child of BaseFileHandler, not {}'.format(
                type(arg_0)))
    if isinstance(arg_1, str):
        arg_1 = [arg_1]
    if not is_list_of(arg_1, str):
        raise TypeError('file_formats must be a str or a list of str')
    for arg_2 in arg_1:
        arg_3[arg_2] = arg_0

Register a handler for some file extensions .


(self, request, pk, course_run_ids, program_uuids)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = arg_0 . get_object ( ) arg_3 = [ unquote ( quote_plus ( course_run_id ) ) for course_run_id in arg_3 ] Func = False for arg_7 in arg_5 . enterprise_customer_catalogs . all ( ) : arg_8 = not arg_3 or arg_7 . contains_courses ( arg_3 ) arg_9 = not arg_4 or arg_7 . contains_programs ( arg_4 ) if arg_8 and arg_9 : Func = True break return Response ( { 'contains_content_items' : Func } )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Return whether or not the specified content is available to the EnterpriseCustomer.

        Multiple course_run_ids and/or program_uuids query parameters can be sent to this view to check
        for their existence in the EnterpriseCustomerCatalogs associated with this EnterpriseCustomer.
        At least one course run key or program UUID value must be included in the request.
        """
        arg_5 = arg_0.get_object()

        # Maintain plus characters in course key.
        arg_3 = [unquote(quote_plus(course_run_id)) for course_run_id in arg_3]

        Func = False
        for arg_7 in arg_5.enterprise_customer_catalogs.all():
            arg_8 = not arg_3 or arg_7.contains_courses(arg_3)
            arg_9 = not arg_4 or arg_7.contains_programs(arg_4)
            if arg_8 and arg_9:
                Func = True
                break

        return Response({'contains_content_items': Func})

Return whether or not the specified content is available to the EnterpriseCustomer .


def Func ( arg_0 ) : try : remove ( join ( arg_0 . fs_path , u'message' ) ) remove ( join ( arg_0 . fs_path , 'dirty.zip.pgp' ) ) except OSError : pass shutil . rmtree ( join ( arg_0 . fs_path , u'clean' ) , ignore_errors = True ) shutil . rmtree ( join ( arg_0 . fs_path , u'attach' ) , ignore_errors = True )

def Func(arg_0):
        """ ensures that no data leaks from drop after processing by
        removing all data except the status file"""
        try:
            remove(join(arg_0.fs_path, u'message'))
            remove(join(arg_0.fs_path, 'dirty.zip.pgp'))
        except OSError:
            pass
        shutil.rmtree(join(arg_0.fs_path, u'clean'), ignore_errors=True)
        shutil.rmtree(join(arg_0.fs_path, u'attach'), ignore_errors=True)


def
Func
(
arg_0
,
arg_1
)
:
if
is_valid_name
(
arg_1
)
:
if
arg_1
not
in
arg_0
.
system
.
models
:
arg_0
.
name
=
arg_1
return
True
else
:
return
False
else
:
raise
ValueError
(
"Invalid name '%s'."
%
arg_1
)

def Func(arg_0, arg_1):
        """Rename self. Must be called only by its system."""
        if is_valid_name(arg_1):
            if arg_1 not in arg_0.system.models:
                arg_0.name = arg_1
                return True  # Rename success
            else:  # Model name already exists
                return False
        else:
            raise ValueError("Invalid name '%s'." % arg_1)

Rename self . Must be called only by its system .


def Func ( ) : global arg_0 try : arg_0 = os . stat ( 'RAM:' ) . st_ctime return time . time ( ) - arg_0 except ( NameError , OSError ) : return None

def Func():
    """Returns uptime in seconds or None, on AmigaOS."""
    global arg_0
    try:
        arg_0 = os.stat('RAM:').st_ctime
        return time.time() - arg_0
    except (NameError, OSError):
        return None

Returns uptime in seconds or None on AmigaOS .


return (super(MarathonLbClient, self).request(*args, **kwargs)
                .addCallback(raise_for_status))

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_3 [ 'url' ] = arg_1 return ( super ( MarathonLbClient , arg_0 ) . request ( * arg_2 , ** arg_3 ) . addCallback ( raise_for_status ) )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Perform a request to a specific endpoint. Raise an error if the status
        code indicates a client or server error.
        """
        arg_3['url'] = arg_1
        return (super(MarathonLbClient, arg_0).request(*arg_2, **arg_3)
                .addCallback(raise_for_status))

Perform a request to a specific endpoint . Raise an error if the status code indicates a client or server error .


return sorted(allowed, key=backend.by_priority, reverse=True)

def Func ( arg_0 ) : arg_1 = ( keyring for keyring in filter ( backend . _limit , backend . get_all_keyring ( ) ) if not isinstance ( keyring , ChainerBackend ) and keyring . priority > 0 ) return sorted ( arg_1 , key = backend . by_priority , reverse = True )

def Func(arg_0):
        """
        Discover all keyrings for chaining.
        """
        arg_1 = (
            keyring
            for keyring in filter(backend._limit, backend.get_all_keyring())
            if not isinstance(keyring, ChainerBackend)
            and keyring.priority > 0
        )
        return sorted(arg_1, key=backend.by_priority, reverse=True)


return self._list_endpoint(endpoint=args.endpoint,
                               query=query)

def Func(arg_0, arg_1=None, arg_2=None):
    '''query will show images determined by the extension of img
       or simg.

       Parameters
       ==========
       query: the container name (path) or uri to Func for
       args.endpoint: can be an endpoint id and optional path, e.g.:

             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e:.singularity'
             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e'

       if not defined, we show the user endpoints to choose from

       Usage
       =====
       If endpoint is defined with a query, then we Func the given endpoint
       for a container of interested (designated by ending in .img or .simg

       If no endpoint is provided but instead just a query, we use the query
       to Func endpoints.

    '''

    # No query is defined
    if arg_1 is None:

        # Option 1: No query or endpoints lists all shared and personal
        if arg_2.endpoint is None:
            bot.info('Listing shared endpoints. Add query to expand Func.')
            return arg_0._list_endpoints()

        # Option 2: An endpoint without query will just list containers there
        else:
            return arg_0._list_endpoint(arg_2.endpoint)

    # Option 3: A query without an endpoint will Func endpoints for it
    if arg_2.endpoint is None:
        bot.info('You must specify an endpoint id to query!')
        return arg_0._list_endpoints(arg_1)

    # Option 4: A query with an endpoint will Func the endpoint for pattern
    return arg_0._list_endpoint(endpoint=arg_2.endpoint,
                               arg_1=arg_1)

query will show images determined by the extension of img
       or simg.

       Parameters
       ==========
       query: the container name (path) or uri to search for
       args.endpoint: can be an endpoint id and optional path, e.g.:

             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e:.singularity'
             --endpoint  6881ae2e-db26-11e5-9772-22000b9da45e'

       if not defined, we show the user endpoints to choose from

       Usage
       =====
       If endpoint is defined with a query, then we search the given endpoint
       for a container of interested (designated by ending in .img or .simg

       If no endpoint is provided but instead just a query, we use the query
       to search endpoints.

query will show images determined by the extension of img or simg .


def
Func
(
arg_0
)
:
arg_1
=
[
]
for
arg_2
in
arg_0
.
_getTags
(
)
:
logger
.
debug
(
"available version tag: %s"
,
arg_2
)
if
not
len
(
arg_2
[
0
]
.
strip
(
)
)
:
continue
try
:
arg_1
.
append
(
GithubComponentVersion
(
arg_2
[
0
]
,
arg_2
[
0
]
,
url
=
arg_2
[
1
]
,
name
=
arg_0
.
name
,
cache_key
=
)
)
except
ValueError
:
logger
.
debug
(
'invalid version tag: %s'
,
arg_2
)
return
arg_1

def Func(arg_0):
        ''' return a list of Version objects, each with a tarball URL set '''
        arg_1 = []
        for arg_2 in arg_0._getTags():
            logger.debug("available version tag: %s", arg_2)
            # ignore empty tags:
            if not len(arg_2[0].strip()):
                continue
            try:
                arg_1.append(GithubComponentVersion(arg_2[0], arg_2[0], url=arg_2[1], name=arg_0.name, cache_key=None))
            except ValueError:
                logger.debug('invalid version tag: %s', arg_2)

        return arg_1

return a list of Version objects each with a tarball URL set


def Func(arg_0, arg_1, arg_2):
        """Attach a reducer function to a given type in the dispatch table."""
        if sys.version_info < (3,):
            # Python 2 pickler dispatching is not explicitly customizable.
            # Let us use a closure to workaround this limitation.
            def dispatcher(arg_0, arg_3):
                arg_4 = arg_2(arg_3)
                arg_0.save_reduce(arg_3=arg_3, *arg_4)
            arg_0.dispatch_table[arg_1] = dispatcher
        else:
            arg_0.dispatch_table[arg_1] = arg_2

Attach a reducer function to a given type in the dispatch table .


def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_1 . _has_state ( Task . COMPLETED ) : return True , None if arg_1 . _has_state ( Task . READY ) : return True , None if arg_0 . split_task is None : return arg_0 . _check_threshold_unstructured ( arg_1 , arg_2 ) return arg_0 . _check_threshold_structured ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2=False):
        """
        Checks whether the preconditions for going to READY state are met.
        Returns True if the threshold was reached, False otherwise.
        Also returns the list of tasks that yet need to be completed.
        """
        # If the threshold was already reached, there is nothing else to do.
        if arg_1._has_state(Task.COMPLETED):
            return True, None
        if arg_1._has_state(Task.READY):
            return True, None

        # Check whether we may fire.
        if arg_0.split_task is None:
            return arg_0._check_threshold_unstructured(arg_1, arg_2)
        return arg_0._check_threshold_structured(arg_1, arg_2)

Checks whether the preconditions for going to READY state are met . Returns True if the threshold was reached False otherwise . Also returns the list of tasks that yet need to be completed .


def
Func
(
arg_0
,
arg_1
=
'dense'
,
arg_2
=
)
:
if
arg_1
not
in
(
'DataFrame'
,
'dense'
)
and
not
dok_matrix
:
raise
ValueError
(
'Sparse matrices require scipy'
)
if
arg_2
is
:
arg_2
=
np
.
float64
arg_3
=
{
'dense'
:
np
.
zeros
,
'dok'
:
dok_matrix
,
'lil'
:
lil_matrix
,
'DataFrame'
:
np
.
zeros
,
}
arg_4
=
len
(
arg_0
.
metabolites
)
arg_5
=
len
(
arg_0
.
reactions
)
arg_6
=
arg_3
[
arg_1
]
(
(
arg_4
,
arg_5
)
,
arg_2
=
arg_2
)
arg_7
=
arg_0
.
metabolites
.
index
arg_8
=
arg_0
.
reactions
.
index
for
arg_9
in
arg_0
.
reactions
:
for
arg_10
,
arg_11
in
iteritems
(
arg_9
.
metabolites
)
:
arg_6
[
arg_7
(
arg_10
)
,
arg_8
(
arg_9
)
]
=
arg_11
if
arg_1
==
'DataFrame'
:
arg_12
=
[
met
.
id
for
met
in
arg_0
.
metabolites
]
arg_13
=
[
rxn
.
id
for
rxn
in
arg_0
.
reactions
]
return
pd
.
DataFrame
(
arg_6
,
index
=
arg_12
,
columns
=
arg_13
)
else
:
return
arg_6

def Func(arg_0, arg_1='dense', arg_2=None):
    """Return a stoichiometric array representation of the given model.

    The the columns represent the reactions and rows represent
    metabolites. S[i,j] therefore contains the quantity of metabolite `i`
    produced (negative for consumed) by reaction `j`.

    Parameters
    ----------
    model : cobra.Model
        The cobra model to construct the matrix for.
    array_type : string
        The type of array to construct. if 'dense', return a standard
        numpy.array, 'dok', or 'lil' will construct a sparse array using
        scipy of the corresponding type and 'DataFrame' will give a
        pandas `DataFrame` with metabolite indices and reaction columns
    dtype : data-type
        The desired data-type for the array. If not given, defaults to float.

    Returns
    -------
    matrix of class `dtype`
        The stoichiometric matrix for the given model.
    """
    if arg_1 not in ('DataFrame', 'dense') and not dok_matrix:
        raise ValueError('Sparse matrices require scipy')

    if arg_2 is None:
        arg_2 = np.float64

    arg_3 = {
        'dense': np.zeros, 'dok': dok_matrix, 'lil': lil_matrix,
        'DataFrame': np.zeros,
    }

    arg_4 = len(arg_0.metabolites)
    arg_5 = len(arg_0.reactions)
    arg_6 = arg_3[arg_1]((arg_4, arg_5),
                                          arg_2=arg_2)

    arg_7 = arg_0.metabolites.index
    arg_8 = arg_0.reactions.index

    for arg_9 in arg_0.reactions:
        for arg_10, arg_11 in iteritems(arg_9.metabolites):
            arg_6[arg_7(arg_10), arg_8(arg_9)] = arg_11

    if arg_1 == 'DataFrame':
        arg_12 = [met.id for met in arg_0.metabolites]
        arg_13 = [rxn.id for rxn in arg_0.reactions]
        return pd.DataFrame(arg_6, index=arg_12, columns=arg_13)

    else:
        return arg_6

Return a stoichiometric array representation of the given model .


def Func(arg_0, arg_1, arg_2):
        """Return the best guess language ID for the word and language choices.

        Parameters
        ----------
        name : str
            The term to guess the language of
        name_mode : str
            The name mode of the algorithm: ``gen`` (default),
            ``ash`` (Ashkenazi), or ``sep`` (Sephardic)

        Returns
        -------
        int
            Language ID

        """
        arg_1 = arg_1.strip().lower()
        arg_3 = BMDATA[arg_2]['language_rules']
        arg_4 = (
            sum(_LANG_DICT[_] for _ in BMDATA[arg_2]['languages']) - 1
        )
        arg_5 = arg_4
        for arg_6 in arg_3:
            arg_7, arg_8, arg_9 = arg_6
            if search(arg_7, arg_1) is not None:
                if arg_9:
                    arg_5 &= arg_8
                else:
                    arg_5 &= (~arg_8) % (arg_4 + 1)
        if arg_5 == L_NONE:
            arg_5 = L_ANY
        return arg_5

Return the best guess language ID for the word and language choices .


def Func(arg_0):
        """
        Convert columns in the current frame to categoricals.

        :returns: new H2OFrame with columns of the "enum" type.
        """
        for arg_1 in arg_0.names:
            arg_2 = arg_0.types[arg_1]
            if arg_2 not in {"bool", "int", "string", "enum"}:
                raise H2OValueError("Only 'int' or 'string' are allowed for "
                                    "Func(), got %s:%s " % (arg_1, arg_2))
        arg_3 = H2OFrame._expr(expr=ExprNode("as.factor", arg_0), cache=arg_0._ex._cache)
        if arg_3._ex._cache.types_valid():
            arg_3._ex._cache.types = {name: "enum" for name in arg_0.types}
        else:
            raise H2OTypeError("Types are not available in result")

        return arg_3

Convert columns in the current frame to categoricals .


def
Func
(
arg_0
)
:
try
:
arg_1
=
request
.
get_json
(
)
[
'data'
]
[
0
]
if
arg_1
[
'type'
]
!=
'event'
or
arg_1
[
'id'
]
!=
arg_0
:
return
make_error_response
(
'Invalid data'
,
400
)
for
arg_2
in
arg_1
[
'attributes'
]
.
keys
(
)
:
if
arg_2
not
in
(
'status'
,
'start'
,
'end'
)
:
return
make_error_response
(
'Invalid data'
,
400
)
arg_3
=
arg_1
[
'attributes'
]
.
get
(
'status'
)
if
arg_3
:
arg_3
=
arg_3
.
upper
(
)
.
replace
(
' '
,
'_'
)
arg_1
[
'attributes'
]
[
'status'
]
=
int
(
getattr
(
Status
,
arg_3
)
)
except
Exception
:
return
make_error_response
(
'Invalid data'
,
400
)
arg_4
=
get_session
(
)
arg_5
=
arg_4
.
query
(
RecordedEvent
)
.
filter
(
RecordedEvent
.
uid
==
arg_0
)
.
first
(
)
if
not
arg_5
:
return
make_error_response
(
'No event with specified uid'
,
404
)
arg_5
.
start
=
arg_1
[
'attributes'
]
.
get
(
'start'
,
arg_5
.
start
)
arg_5
.
end
=
arg_1
[
'attributes'
]
.
get
(
'end'
,
arg_5
.
end
)
arg_5
.
status
=
arg_1
[
'attributes'
]
.
get
(
'status'
,
arg_5
.
status
)
logger
.
debug
(
'Updating event %s via api'
,
arg_0
)
arg_4
.
commit
(
)
return
make_data_response
(
arg_5
.
serialize
(
)
)

def Func(arg_0):
    '''Modify an event specified by its uid. The modifications for the event
    are expected as JSON with the content type correctly set in the request.

    Note that this method works for recorded events only. Upcoming events part
    of the scheduler cache cannot be modified.
    '''
    try:
        arg_1 = request.get_json()['data'][0]
        if arg_1['type'] != 'event' or arg_1['id'] != arg_0:
            return make_error_response('Invalid data', 400)
        # Check attributes
        for arg_2 in arg_1['attributes'].keys():
            if arg_2 not in ('status', 'start', 'end'):
                return make_error_response('Invalid data', 400)
        # Check new status
        arg_3 = arg_1['attributes'].get('status')
        if arg_3:
            arg_3 = arg_3.upper().replace(' ', '_')
            arg_1['attributes']['status'] = int(getattr(Status, arg_3))
    except Exception:
        return make_error_response('Invalid data', 400)

    arg_4 = get_session()
    arg_5 = arg_4.query(RecordedEvent).filter(RecordedEvent.uid == arg_0).first()
    if not arg_5:
        return make_error_response('No event with specified uid', 404)
    arg_5.start = arg_1['attributes'].get('start', arg_5.start)
    arg_5.end = arg_1['attributes'].get('end', arg_5.end)
    arg_5.status = arg_1['attributes'].get('status', arg_5.status)
    logger.debug('Updating event %s via api', arg_0)
    arg_4.commit()
    return make_data_response(arg_5.serialize())

Modify an event specified by its uid . The modifications for the event are expected as JSON with the content type correctly set in the request .


(self, pin_num, direction, callback,
                 settle_time=DEFAULT_SETTLE_TIME)

def Func(arg_0, arg_1, arg_2, arg_3,
                 arg_4=arg_5):
        """Registers a pin number and direction to a callback function.

        :param pin_num: The pin pin number.
        :type pin_num: int
        :param direction: The event direction
            (use: IODIR_ON/IODIR_OFF/IODIR_BOTH)
        :type direction: int
        :param callback: The function to run when event is detected.
        :type callback: function
        :param settle_time: Time within which subsequent events are ignored.
        :type settle_time: int
        """
        arg_0.pin_function_maps.append(
            PinFunctionMap(arg_1, arg_2, arg_3, arg_4))

Registers a pin number and direction to a callback function .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_0 . _print_header ( ) if arg_1 : arg_3 . INTERN [ "to_test" ] = arg_1 else : arg_3 . INTERN [ "to_test" ] = None if arg_3 . INTERN [ "to_test" ] : if arg_3 . CONFIGURATION [ "syntax" ] : arg_5 = arg_0 . syntax_status . get ( ) else : arg_5 = arg_0 . Func_status . get ( ) arg_0 . _file_decision ( arg_3 . INTERN [ "to_test" ] , arg_2 , arg_5 ) if arg_3 . CONFIGURATION [ "simple" ] : print ( arg_3 . INTERN [ "to_test" ] , arg_5 ) return arg_3 . INTERN [ "to_test" ] , arg_5 return None

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Manage the case that we want to test only a given Func.

        :param Func_to_test: The Func to test.
        :type Func_to_test: str

        :param last_Func:
            The last Func of the file we are testing
            (if exist)
        :type last_Func: str
        """

        # We print the header.
        arg_0._print_header()

        if arg_1:
            # An Func to test is given.

            # We set the Func we are going to test.
            arg_3.INTERN["to_test"] = arg_1
        else:
            # An URL to test is not given.

            # We set the Func we are going to test to None.
            arg_3.INTERN["to_test"] = None

        if arg_3.INTERN["to_test"]:
            # An URL to test is given.

            if arg_3.CONFIGURATION["syntax"]:
                # The syntax mode is activated.

                # We get the status from Syntax.
                arg_5 = arg_0.syntax_status.get()
            else:
                # The syntax mode is not activated.

                # We get the status from URL.
                arg_5 = arg_0.Func_status.get()

            # We run the file decision logic.
            arg_0._file_decision(arg_3.INTERN["to_test"], arg_2, arg_5)

            if arg_3.CONFIGURATION["simple"]:
                # The simple mode is activated.

                # We print the URL informations.
                print(arg_3.INTERN["to_test"], arg_5)

            # We return the URL we tested and its status.
            return arg_3.INTERN["to_test"], arg_5

        # We return None, there is nothing to test.
        return None

Manage the case that we want to test only a given url.

        :param url_to_test: The url to test.
        :type url_to_test: str

        :param last_url:
            The last url of the file we are testing
            (if exist)
        :type last_url: str

Manage the case that we want to test only a given url .


(total_event_size,
                   num_hidden_layers=2,
                   seed=None,
                   dtype=tf.float32)

def Func ( arg_0 , arg_1 = 2 , arg_2 = None , arg_3 = arg_4 . float32 ) : arg_2 = tfd . SeedStream ( arg_2 , 'Func' ) def make_iaf ( ) : arg_6 = arg_4 . compat . v2 . keras . initializers . VarianceScaling ( 2 * 0.01 , arg_2 = arg_2 ( ) % ( 2 ** 31 - 1 ) ) arg_7 = tfb . AutoregressiveLayer ( params = 2 , event_shape = [ arg_0 ] , hidden_units = [ arg_0 ] * arg_1 , activation = arg_4 . nn . elu , kernel_initializer = arg_6 , arg_3 = arg_3 ) def shift_and_scale ( arg_8 ) : arg_8 . set_shape ( arg_8 . shape . merge_with ( [ None ] * ( arg_8 . shape . ndims - 1 ) + [ arg_0 ] ) ) return arg_4 . unstack ( arg_7 ( arg_8 ) , num = 2 , axis = - 1 ) return tfb . Invert ( tfb . MaskedAutoregressiveFlow ( shift_and_scale ) ) def make_swap ( ) : arg_9 = list ( reversed ( range ( arg_0 ) ) ) return tfb . Permute ( arg_9 ) arg_10 = make_iaf ( ) arg_10 = make_swap ( ) ( arg_10 ) arg_10 = make_iaf ( ) ( arg_10 ) arg_10 = make_swap ( ) ( arg_10 ) arg_10 = make_iaf ( ) ( arg_10 ) arg_10 = make_swap ( ) ( arg_10 ) return arg_10

def Func(arg_0,
                   arg_1=2,
                   arg_2=None,
                   arg_3=arg_4.float32):
  """Creates an stacked IAF bijector.

  This bijector operates on vector-valued events.

  Args:
    total_event_size: Number of dimensions to operate over.
    num_hidden_layers: How many hidden layers to use in each IAF.
    seed: Random seed for the initializers.
    dtype: DType for the variables.

  Returns:
    bijector: The created bijector.
  """

  arg_2 = tfd.SeedStream(arg_2, 'Func')

  def make_iaf():
    """Create an IAF."""
    arg_6 = arg_4.compat.v2.keras.initializers.VarianceScaling(
        2 * 0.01, arg_2=arg_2() % (2**31 - 1))

    arg_7 = tfb.AutoregressiveLayer(
        params=2,
        event_shape=[arg_0],
        hidden_units=[arg_0] * arg_1,
        activation=arg_4.nn.elu,
        kernel_initializer=arg_6,
        arg_3=arg_3)

    def shift_and_scale(arg_8):
      # TODO(siege): Something is losing the static shape.
      arg_8.set_shape(
          arg_8.shape.merge_with([None] * (arg_8.shape.ndims - 1) + [arg_0]))
      return arg_4.unstack(arg_7(arg_8), num=2, axis=-1)

    return tfb.Invert(tfb.MaskedAutoregressiveFlow(shift_and_scale))

  def make_swap():
    """Create an swap."""
    arg_9 = list(reversed(range(arg_0)))
    return tfb.Permute(arg_9)

  arg_10 = make_iaf()
  arg_10 = make_swap()(arg_10)
  arg_10 = make_iaf()(arg_10)
  arg_10 = make_swap()(arg_10)
  arg_10 = make_iaf()(arg_10)
  arg_10 = make_swap()(arg_10)

  return arg_10