(self, job_name, non_terminal_states, failed_states,
                                       wait_for_completion, check_interval, max_ingestion_time)

def Func(arg_0, arg_1, arg_2, arg_3,
                                       arg_4, arg_5, arg_6):
        """
        Display the logs for a given training job, optionally tailing them until the
        job is complete.

        :param job_name: name of the training job to check status and display logs for
        :type job_name: str
        :param non_terminal_states: the set of non_terminal states
        :type non_terminal_states: set
        :param failed_states: the set of failed states
        :type failed_states: set
        :param wait_for_completion: Whether to keep looking for new log entries
            until the job completes
        :type wait_for_completion: bool
        :param check_interval: The interval in seconds between polling for new log entries and job completion
        :type check_interval: int
        :param max_ingestion_time: the maximum ingestion time in seconds. Any
            SageMaker jobs that run longer than this will fail. Setting this to
            None implies no timeout for any SageMaker job.
        :type max_ingestion_time: int
        :return: None
        """

        arg_7 = 0
        arg_8 = arg_0.describe_training_job(arg_1)
        arg_0.log.info(secondary_training_status_message(arg_8, None))
        arg_9 = arg_8['ResourceConfig']['InstanceCount']
        arg_10 = arg_8['TrainingJobStatus']

        arg_11 = []  # The list of log streams
        arg_12 = {}     # The current position in each stream, map of stream name -> position

        arg_13 = arg_10 not in arg_2

        arg_14 = LogState.TAILING if arg_4 and not arg_13 else LogState.COMPLETE

        # The loop below implements a state machine that alternates between checking the job status and
        # reading whatever is available in the logs at this point. Note, that if we were called with
        # wait_for_completion == False, we never check the job status.
        #
        # If wait_for_completion == TRUE and job is not completed, the initial state is TAILING
        # If wait_for_completion == FALSE, the initial state is COMPLETE
        # (doesn't matter if the job really is complete).
        #
        # The state table:
        #
        # STATE               ACTIONS                        CONDITION             NEW STATE
        # ----------------    ----------------               -----------------     ----------------
        # TAILING             Read logs, Pause, Get status   Job complete          JOB_COMPLETE
        #                                                    Else                  TAILING
        # JOB_COMPLETE        Read logs, Pause               Any                   COMPLETE
        # COMPLETE            Read logs, Exit                                      N/A
        #
        # Notes:
        # - The JOB_COMPLETE state forces us to do an extra pause and read any items that
        # got to Cloudwatch after the job was marked complete.
        arg_15 = time.time()
        arg_16 = arg_8

        while True:
            time.sleep(arg_5)
            arg_7 = arg_7 + arg_5

            arg_14, arg_16, arg_15 = \
                arg_0.describe_training_job_with_log(arg_1, arg_12, arg_11,
                                                    arg_9, arg_14, arg_16,
                                                    arg_15)
            if arg_14 == LogState.COMPLETE:
                break

            if arg_6 and arg_7 > arg_6:
                # ensure that the job gets killed if the max ingestion time is exceeded
                raise AirflowException('SageMaker job took more than %s seconds', arg_6)

        if arg_4:
            arg_10 = arg_16['TrainingJobStatus']
            if arg_10 in arg_3:
                arg_17 = arg_16.get('FailureReason', '(No reason provided)')
                raise AirflowException('Error training {}: {} Reason: {}'.format(arg_1, arg_10, arg_17))
            arg_18 = (arg_16['TrainingEndTime'] - arg_16['TrainingStartTime']) \
                * arg_9
            arg_0.log.info('Billable seconds:{}'.format(int(arg_18.total_seconds()) + 1))

Display the logs for a given training job optionally tailing them until the job is complete .


def Func(arg_0, arg_1, **arg_2):
    """
    Bloomberg block data

    Args:
        tickers: ticker(s)
        flds: field(s)
        **kwargs: other overrides for query
          -> raw: raw output from `pdbdp` library, default False

    Returns:
        pd.DataFrame: block data

    Examples:
        >>> import os
        >>>
        >>> pd.options.display.width = 120
        >>> s_dt, e_dt = '20180301', '20181031'
        >>> dvd = Func(
        ...     'NVDA US Equity', 'DVD_Hist_All',
        ...     DVD_Start_Dt=s_dt, DVD_End_Dt=e_dt, raw=True,
        ... )
        >>> dvd.loc[:, ['ticker', 'name', 'value']].head(8)
                   ticker                name         value
        0  NVDA US Equity       Declared Date    2018-08-16
        1  NVDA US Equity             Ex-Date    2018-08-29
        2  NVDA US Equity         Record Date    2018-08-30
        3  NVDA US Equity        Payable Date    2018-09-21
        4  NVDA US Equity     Dividend Amount          0.15
        5  NVDA US Equity  Dividend Frequency       Quarter
        6  NVDA US Equity       Dividend Type  Regular Cash
        7  NVDA US Equity       Declared Date    2018-05-10
        >>> dvd = Func(
        ...     'NVDA US Equity', 'DVD_Hist_All',
        ...     DVD_Start_Dt=s_dt, DVD_End_Dt=e_dt,
        ... )
        >>> dvd.reset_index().loc[:, ['ticker', 'ex_date', 'dividend_amount']]
                   ticker     ex_date  dividend_amount
        0  NVDA US Equity  2018-08-29             0.15
        1  NVDA US Equity  2018-05-23             0.15
        >>> if not os.environ.get('BBG_ROOT', ''):
        ...     os.environ['BBG_ROOT'] = f'{files.abspath(__file__, 1)}/tests/data'
        >>> idx_kw = dict(End_Dt='20181220', cache=True)
        >>> idx_wt = Func('DJI Index', 'Indx_MWeight_Hist', **idx_kw)
        >>> idx_wt.round(2).tail().reset_index(drop=True)
          index_member  percent_weight
        0         V UN            3.82
        1        VZ UN            1.63
        2       WBA UW            2.06
        3       WMT UN            2.59
        4       XOM UN            2.04
        >>> idx_wt = Func('DJI Index', 'Indx_MWeight_Hist', **idx_kw)
        >>> idx_wt.round(2).head().reset_index(drop=True)
          index_member  percent_weight
        0      AAPL UW            4.65
        1       AXP UN            2.84
        2        BA UN            9.29
        3       CAT UN            3.61
        4      CSCO UW            1.26
    """
    arg_3 = logs.get_logger(Func, level=arg_2.pop('log', logs.LOG_LEVEL))
    arg_4, arg_5 = create_connection()
    arg_6 = assist.proc_ovrds(**arg_2)

    arg_3.info(
        f'loading block data from Bloomberg:\n'
        f'{assist.info_qry(tickers=tickers, flds=flds)}'
    )
    arg_7 = arg_4.bulkref(arg_0=arg_0, arg_1=arg_1, arg_6=arg_6)
    if not arg_2.get('cache', False): return [arg_7]

    arg_8 = []
    for (arg_9, arg_10), arg_11 in arg_7.groupby(['ticker', 'field']):
        arg_12 = storage.ref_file(
            arg_9=arg_9, arg_10=arg_10, ext='pkl',
            has_date=arg_2.get('has_date', True), **arg_2
        )
        if arg_12:
            if not files.exists(arg_12): arg_8.append(arg_11)
            files.create_folder(arg_12, is_file=True)
            arg_11.reset_index(drop=True).to_pickle(arg_12)

    return arg_8

Bloomberg block data

    Args:
        tickers: ticker(s)
        flds: field(s)
        **kwargs: other overrides for query
          -> raw: raw output from `pdbdp` library, default False

    Returns:
        pd.DataFrame: block data

    Examples:
        >>> import os
        >>>
        >>> pd.options.display.width = 120
        >>> s_dt, e_dt = '20180301', '20181031'
        >>> dvd = bds(
        ...     'NVDA US Equity', 'DVD_Hist_All',
        ...     DVD_Start_Dt=s_dt, DVD_End_Dt=e_dt, raw=True,
        ... )
        >>> dvd.loc[:, ['ticker', 'name', 'value']].head(8)
                   ticker                name         value
        0  NVDA US Equity       Declared Date    2018-08-16
        1  NVDA US Equity             Ex-Date    2018-08-29
        2  NVDA US Equity         Record Date    2018-08-30
        3  NVDA US Equity        Payable Date    2018-09-21
        4  NVDA US Equity     Dividend Amount          0.15
        5  NVDA US Equity  Dividend Frequency       Quarter
        6  NVDA US Equity       Dividend Type  Regular Cash
        7  NVDA US Equity       Declared Date    2018-05-10
        >>> dvd = bds(
        ...     'NVDA US Equity', 'DVD_Hist_All',
        ...     DVD_Start_Dt=s_dt, DVD_End_Dt=e_dt,
        ... )
        >>> dvd.reset_index().loc[:, ['ticker', 'ex_date', 'dividend_amount']]
                   ticker     ex_date  dividend_amount
        0  NVDA US Equity  2018-08-29             0.15
        1  NVDA US Equity  2018-05-23             0.15
        >>> if not os.environ.get('BBG_ROOT', ''):
        ...     os.environ['BBG_ROOT'] = f'{files.abspath(__file__, 1)}/tests/data'
        >>> idx_kw = dict(End_Dt='20181220', cache=True)
        >>> idx_wt = bds('DJI Index', 'Indx_MWeight_Hist', **idx_kw)
        >>> idx_wt.round(2).tail().reset_index(drop=True)
          index_member  percent_weight
        0         V UN            3.82
        1        VZ UN            1.63
        2       WBA UW            2.06
        3       WMT UN            2.59
        4       XOM UN            2.04
        >>> idx_wt = bds('DJI Index', 'Indx_MWeight_Hist', **idx_kw)
        >>> idx_wt.round(2).head().reset_index(drop=True)
          index_member  percent_weight
        0      AAPL UW            4.65
        1       AXP UN            2.84
        2        BA UN            9.29
        3       CAT UN            3.61
        4      CSCO UW            1.26


def Func ( arg_0 , arg_1 , arg_2 = "Func" ) : with tf . name_scope ( arg_2 ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_2 = "n" ) arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_2 = "counts" ) arg_3 = tf . math . lgamma ( arg_0 + 1 ) arg_4 = tf . math . lgamma ( arg_1 + 1 ) arg_5 = tf . reduce_sum ( input_tensor = arg_4 , axis = [ - 1 ] ) return arg_3 - arg_5

def Func(arg_0, arg_1, arg_2="Func"):
  """Multinomial coefficient.

  Given `n` and `counts`, where `counts` has last dimension `k`, we compute
  the multinomial coefficient as:

  ```n! / sum_i n_i!```

  where `i` runs over all `k` classes.

  Args:
    n: Floating-point `Tensor` broadcastable with `counts`. This represents `n`
      outcomes.
    counts: Floating-point `Tensor` broadcastable with `n`. This represents
      counts in `k` classes, where `k` is the last dimension of the tensor.
    name: A name for this operation (optional).

  Returns:
    `Tensor` representing the multinomial coefficient between `n` and `counts`.
  """
  # First a bit about the number of ways counts could have come in:
  # E.g. if counts = [1, 2], then this is 3 choose 2.
  # In general, this is (sum counts)! / sum(counts!)
  # The sum should be along the last dimension of counts. This is the
  # "distribution" dimension. Here n a priori represents the sum of counts.
  with tf.name_scope(arg_2):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_2="n")
    arg_1 = tf.convert_to_tensor(value=arg_1, arg_2="counts")
    arg_3 = tf.math.lgamma(arg_0 + 1)
    arg_4 = tf.math.lgamma(arg_1 + 1)
    arg_5 = tf.reduce_sum(
        input_tensor=arg_4, axis=[-1])
    return arg_3 - arg_5


def Func(arg_0, arg_1):
        """Expand a given gate into its decomposition.

        Args:
            dag(DAGCircuit): input dag
        Returns:
            DAGCircuit: output dag where gate was expanded.
        """
        # Walk through the DAG and expand each non-basis node
        for arg_2 in arg_1.op_nodes(arg_0.gate):
            # opaque or built-in gates are not decomposable
            if not arg_2.op.definition:
                continue
            # TODO: allow choosing among multiple decomposition rules
            arg_3 = arg_2.op.definition
            # hacky way to build a dag on the same register as the rule is defined
            # TODO: need anonymous rules to address wires by index
            arg_4 = DAGCircuit()
            arg_4.add_qreg(arg_3[0][1][0][0])
            if arg_3[0][2]:
                arg_4.add_creg(arg_3[0][2][0][0])
            for arg_5 in arg_3:
                arg_4.apply_operation_back(*arg_5)
            arg_1.substitute_node_with_dag(arg_2, arg_4)
        return arg_1

Expand a given gate into its decomposition .


def Func(arg_0, arg_1, arg_2=None):
        """
        Register a Javascript function to initialize the Javascript resources.

        `js_func` is the name of a Javascript function defined by one of the
        Javascript resources.  As part of setting up the browser's runtime
        environment, the function will be invoked, passing a runtime object
        and a DOM element.
        """
        arg_0.js_init_fn = arg_1
        arg_0.js_init_version = JS_API_VERSION
        if arg_2:
            arg_0.json_init_args = arg_2

Register a Javascript function to initialize the Javascript resources .


def Func ( arg_0 ) : if arg_0 . has_kernel : if arg_0 . kernel . poll ( ) is None : return True else : return False elif arg_0 . _hb_channel is not None : return arg_0 . _hb_channel . is_beating ( ) else : return True

def Func(arg_0):
        """Is the kernel process still running?"""
        if arg_0.has_kernel:
            if arg_0.kernel.poll() is None:
                return True
            else:
                return False
        elif arg_0._hb_channel is not None:
            # We didn't start the kernel with this KernelManager so we
            # use the heartbeat.
            return arg_0._hb_channel.is_beating()
        else:
            # no heartbeat and not local, we can't tell if it's running,
            # so naively return True
            return True


def Func ( arg_0 , arg_1 , arg_2 = 2 , arg_3 = 1 ) : arg_4 = arg_0 . get_main_doc ( ) arg_5 = arg_4 ( 'span[itemprop="birthDate"]' ) . attr ( 'data-birth' ) arg_6 = r'(\d{4})\-(\d{2})\-(\d{2})' arg_7 = map ( int , re . match ( arg_6 , arg_5 ) . groups ( ) ) arg_8 = datetime . date ( * arg_7 ) arg_9 = datetime . date ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) arg_10 = arg_9 - arg_8 Func = arg_10 . days / 365. return Func

def Func(arg_0, arg_1, arg_2=2, arg_3=1):
        """Returns the age of the player on a given date.

        :year: int representing the year.
        :month: int representing the month (1-12).
        :day: int representing the day within the month (1-31).
        :returns: Age in years as a float.
        """
        arg_4 = arg_0.get_main_doc()
        arg_5 = arg_4('span[itemprop="birthDate"]').attr('data-birth')
        arg_6 = r'(\d{4})\-(\d{2})\-(\d{2})'
        arg_7 = map(int, re.match(arg_6, arg_5).groups())
        arg_8 = datetime.date(*arg_7)
        arg_9 = datetime.date(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)
        arg_10 = arg_9 - arg_8
        Func = arg_10.days / 365.
        return Func

Returns the age of the player on a given date .


(self, data, position=111, xlabel=None, ylabel=None)

def Func(arg_0, arg_1, arg_2=111, arg_3=None, arg_4=None):
    """ Adds a graph to the plot's figure.

    @param data See matplotlib.Axes.plot documentation.
    @param position A 3-digit number. The first two digits define a 2D grid
            where subplots may be added. The final digit specifies the nth grid
            location for the added subplot
    @param xlabel text to be displayed on the x-axis
    @param ylabel text to be displayed on the y-axis
    """
    arg_5 = arg_0._addBase(arg_2, arg_3=arg_3, arg_4=arg_4)
    arg_5.plot(arg_1)
    plt.draw()


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 : arg_1 . text ( 'Struct(...)' ) else : with arg_1 . group ( 7 , 'Struct(' , ')' ) : arg_1 . pretty ( arg_0 . _asdict ( ) )

def Func(arg_0, arg_1, arg_2):
        """method that defines ``Struct``'s pretty printing rules for iPython

        Args:
            p (IPython.lib.pretty.RepresentationPrinter): pretty printer object
            cycle (bool): is ``True`` if pretty detected a cycle
        """
        if arg_2:
            arg_1.text('Struct(...)')
        else:
            with arg_1.group(7, 'Struct(', ')'):
                arg_1.pretty(arg_0._asdict())

method that defines Struct s pretty printing rules for iPython


def Func(arg_0, arg_1=arg_2.maxsize):
    """Func pipe extracts nested item from previous pipe.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param depth: The deepest nested level to be extracted. 0 means no extraction.
    :type depth: integer
    :returns: generator
    """
    def inner_Func(arg_4, arg_5, arg_6):
        for arg_7 in arg_4:
            if hasattr(arg_7, '__iter__') and arg_5 < arg_6:
                for arg_8 in inner_Func(arg_7, arg_5 + 1, arg_6):
                    yield arg_8
            else:
                yield arg_7

    for arg_9 in arg_0:
        if hasattr(arg_9, '__iter__') and arg_1 > 0:
            for arg_10 in inner_Func(arg_9, 1, arg_1):
                yield arg_10
        else:
            yield arg_9

flatten pipe extracts nested item from previous pipe.

    :param prev: The previous iterator of pipe.
    :type prev: Pipe
    :param depth: The deepest nested level to be extracted. 0 means no extraction.
    :type depth: integer
    :returns: generator

flatten pipe extracts nested item from previous pipe .


def Func ( arg_0 , arg_1 ) : arg_2 = iter ( arg_1 ) arg_3 = arg_0 . properties . dimension arg_4 = ctypes . c_double * arg_3 arg_5 = arg_4 ( ) arg_6 = arg_4 ( ) arg_7 = ctypes . cast ( ctypes . pointer ( ctypes . c_ubyte ( 0 ) ) , ctypes . POINTER ( ctypes . c_ubyte ) ) def py_next_item ( arg_8 , arg_9 , arg_10 , arg_11 , arg_12 , arg_13 ) : try : arg_8 [ 0 ] , arg_14 , arg_15 = next ( arg_2 ) except StopIteration : return - 1 except Exception as exc : arg_0 . _exception = exc return - 1 if arg_0 . interleaved : arg_14 = Index . deinterleave ( arg_14 ) for arg_17 in range ( arg_3 ) : arg_5 [ arg_17 ] = arg_14 [ arg_17 * 2 ] arg_6 [ arg_17 ] = arg_14 [ ( arg_17 * 2 ) + 1 ] arg_9 [ 0 ] = ctypes . cast ( arg_5 , ctypes . POINTER ( ctypes . c_double ) ) arg_10 [ 0 ] = ctypes . cast ( arg_6 , ctypes . POINTER ( ctypes . c_double ) ) arg_11 [ 0 ] = arg_3 if arg_15 is None : arg_12 [ 0 ] = arg_7 arg_13 [ 0 ] = 0 else : arg_13 [ 0 ] , arg_18 , arg_19 = arg_0 . _serialize ( arg_15 ) arg_12 [ 0 ] = ctypes . cast ( arg_18 , ctypes . POINTER ( ctypes . c_ubyte ) ) return 0 arg_1 = core . NEXTFUNC ( py_next_item ) return IndexStreamHandle ( arg_0 . properties . handle , arg_1 )

def Func(arg_0, arg_1):
        """This function is used to instantiate the index given an
        iterable stream of data."""

        arg_2 = iter(arg_1)
        arg_3 = arg_0.properties.dimension
        arg_4 = ctypes.c_double * arg_3
        arg_5 = arg_4()
        arg_6 = arg_4()
        arg_7 = ctypes.cast(ctypes.pointer(ctypes.c_ubyte(0)),
                              ctypes.POINTER(ctypes.c_ubyte))

        def py_next_item(arg_8, arg_9, arg_10, arg_11, arg_12, arg_13):
            """This function must fill pointers to individual entries that will
            be added to the index.  The C API will actually call this function
            to fill out the pointers.  If this function returns anything other
            than 0, it is assumed that the stream of data is done."""

            try:
                arg_8[0], arg_14, arg_15 = next(arg_2)
            except StopIteration:
                # we're done
                return -1
            except Exception as exc:
                arg_0._exception = exc
                return -1

            if arg_0.interleaved:
                arg_14 = Index.deinterleave(arg_14)

            # this code assumes the coords are not interleaved.
            # xmin, xmax, ymin, ymax, zmin, zmax
            for arg_17 in range(arg_3):
                arg_5[arg_17] = arg_14[arg_17*2]
                arg_6[arg_17] = arg_14[(arg_17*2)+1]

            arg_9[0] = ctypes.cast(arg_5, ctypes.POINTER(ctypes.c_double))
            arg_10[0] = ctypes.cast(arg_6, ctypes.POINTER(ctypes.c_double))

            # set the dimension
            arg_11[0] = arg_3
            if arg_15 is None:
                arg_12[0] = arg_7
                arg_13[0] = 0
            else:
                arg_13[0], arg_18, arg_19 = arg_0._serialize(arg_15)
                arg_12[0] = ctypes.cast(arg_18, ctypes.POINTER(ctypes.c_ubyte))

            return 0

        arg_1 = core.NEXTFUNC(py_next_item)
        return IndexStreamHandle(arg_0.properties.handle, arg_1)

This function is used to instantiate the index given an iterable stream of data .


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
arg_0
.
session
.
recv
(
arg_0
.
_notification_socket
,
mode
=
zmq
.
NOBLOCK
)
while
arg_2
is
not
:
if
arg_0
.
debug
:
pprint
(
arg_2
)
arg_3
=
arg_2
[
'header'
]
[
'msg_type'
]
arg_4
=
arg_0
.
_notification_handlers
.
get
(
arg_3
,
)
if
arg_4
is
:
raise
Exception
(
"Unhandled message type: %s"
%
arg_2
.
msg_type
)
else
:
arg_4
(
arg_2
)
arg_1
,
arg_2
=
arg_0
.
session
.
recv
(
arg_0
.
_notification_socket
,
mode
=
zmq
.
NOBLOCK
)

def Func(arg_0):
        """Flush notifications of engine registrations waiting
        in ZMQ queue."""
        arg_1,arg_2 = arg_0.session.recv(arg_0._notification_socket, mode=zmq.NOBLOCK)
        while arg_2 is not None:
            if arg_0.debug:
                pprint(arg_2)
            arg_3 = arg_2['header']['msg_type']
            arg_4 = arg_0._notification_handlers.get(arg_3, None)
            if arg_4 is None:
                raise Exception("Unhandled message type: %s"%arg_2.msg_type)
            else:
                arg_4(arg_2)
            arg_1,arg_2 = arg_0.session.recv(arg_0._notification_socket, mode=zmq.NOBLOCK)

Flush notifications of engine registrations waiting in ZMQ queue .


(src, tar, qval=2, pval=1, alphabet=None)

return Minkowski().sim(src, tar, qval, pval, alphabet)

def Func ( arg_0 , arg_1 , arg_2 = 2 , arg_3 = 1 , arg_4 = None ) : return Minkowski ( ) . sim ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2=2, arg_3=1, arg_4=None):
    """Return normalized Minkowski similarity of two strings.

    This is a wrapper for :py:meth:`Minkowski.sim`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    pval : int or float
        The :math:`p`-value of the :math:`L^p`-space
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Minkowski similarity

    Examples
    --------
    >>> Func('cat', 'hat')
    0.5
    >>> round(Func('Niall', 'Neil'), 12)
    0.363636363636
    >>> round(Func('Colin', 'Cuilen'), 12)
    0.307692307692
    >>> Func('ATCG', 'TAGC')
    0.0

    """
    return Minkowski().sim(arg_0, arg_1, arg_2, arg_3, arg_4)

Return normalized Minkowski similarity of two strings.

    This is a wrapper for :py:meth:`Minkowski.sim`.

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    pval : int or float
        The :math:`p`-value of the :math:`L^p`-space
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Minkowski similarity

    Examples
    --------
    >>> sim_minkowski('cat', 'hat')
    0.5
    >>> round(sim_minkowski('Niall', 'Neil'), 12)
    0.363636363636
    >>> round(sim_minkowski('Colin', 'Cuilen'), 12)
    0.307692307692
    >>> sim_minkowski('ATCG', 'TAGC')
    0.0

Return normalized Minkowski similarity of two strings .


def Func(arg_0):
    """Given a string with source, return the lib2to3 Node."""
    arg_1 = pygram.python_grammar_no_print_statement
    arg_2 = driver.Driver(arg_1, pytree.convert)
    if arg_0[-1] != '\n':
        arg_3 = '\r\n' if '\r\n' in arg_0[:1024] else '\n'
        arg_0 += arg_3
    try:
        arg_4 = arg_2.parse_string(arg_0, True)
    except ParseError as pe:
        arg_5, arg_6 = pe.context[1]
        arg_7 = arg_0.splitlines()
        try:
            arg_8 = arg_7[arg_5 - 1]
        except IndexError:
            arg_8 = "<line number missing in source>"
        raise ValueError(f"Cannot parse: {lineno}:{column}: {faulty_line}") from None

    if isinstance(arg_4, Leaf):
        arg_4 = Node(syms.file_input, [arg_4])

    return arg_4

Given a string with source return the lib2to3 Node .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : for arg_3 , arg_4 in enumerate ( arg_2 ) : if arg_3 == 0 : arg_1 . append ( { 'char' : arg_4 , 'type' : CHAR_TYPE_FLATTEN . get ( arg_4 , 'o' ) , 'target' : True } ) else : arg_1 . append ( { 'char' : arg_4 , 'type' : CHAR_TYPE_FLATTEN . get ( arg_4 , 'o' ) , 'target' : False } ) return pd . DataFrame ( arg_1 )

def Func(arg_0):
    """
    Give list of input tokenized words,
    create dataframe of characters where first character of
    the word is tagged as 1, otherwise 0

    Example
    =======
    ['กิน', 'หมด'] to dataframe of
    [{'char': 'ก', 'type': ..., 'target': 1}, ...,
     {'char': 'ด', 'type': ..., 'target': 0}]
    """
    arg_1 = []
    for arg_2 in arg_0:
        for arg_3, arg_4 in enumerate(arg_2):
            if arg_3 == 0:
                arg_1.append({'char': arg_4,
                                  'type': CHAR_TYPE_FLATTEN.get(arg_4, 'o'),
                                  'target': True})
            else:
                arg_1.append({'char': arg_4,
                                  'type': CHAR_TYPE_FLATTEN.get(arg_4, 'o'),
                                  'target': False})
    return pd.DataFrame(arg_1)

Give list of input tokenized words create dataframe of characters where first character of the word is tagged as 1 otherwise 0


def Func ( arg_0 ) : arg_1 = arg_0 . _platform_impl . get_memory_info ( ) [ 0 ] try : return ( arg_1 / float ( TOTAL_PHYMEM ) ) * 100 except ZeroDivisionError : return 0.0

def Func(arg_0):
        """Compare physical system memory to process resident memory and
        calculate process memory utilization as a percentage.
        """
        arg_1 = arg_0._platform_impl.get_memory_info()[0]
        try:
            return (arg_1 / float(TOTAL_PHYMEM)) * 100
        except ZeroDivisionError:
            return 0.0

Compare physical system memory to process resident memory and calculate process memory utilization as a percentage .


def Func ( arg_0 , arg_1 = None , arg_2 = - 1 ) : if arg_1 is None : arg_1 = arg_0 . shape [ arg_2 ] arg_1 = int ( min ( arg_1 , arg_0 . shape [ arg_2 ] ) ) arg_3 = get_fftlib ( ) arg_4 = np . abs ( arg_3 . fft ( arg_0 , n = 2 * arg_0 . shape [ arg_2 ] + 1 , arg_2 = arg_2 ) ) ** 2 arg_5 = arg_3 . ifft ( arg_4 , arg_2 = arg_2 ) arg_6 = [ slice ( None ) ] * arg_5 . ndim arg_6 [ arg_2 ] = slice ( arg_1 ) arg_5 = arg_5 [ tuple ( arg_6 ) ] if not np . iscomplexobj ( arg_0 ) : arg_5 = arg_5 . real return arg_5

def Func(arg_0, arg_1=None, arg_2=-1):
    """Bounded auto-correlation

    Parameters
    ----------
    y : np.ndarray
        array to Func

    max_size  : int > 0 or None
        maximum correlation lag.
        If unspecified, defaults to `y.shape[axis]` (unbounded)

    axis : int
        The axis along which to Func.
        By default, the last axis (-1) is taken.

    Returns
    -------
    z : np.ndarray
        truncated autocorrelation `y*y` along the specified axis.
        If `max_size` is specified, then `z.shape[axis]` is bounded
        to `max_size`.

    Notes
    -----
    This function caches at level 20.

    Examples
    --------
    Compute full autocorrelation of y

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=20, duration=10)
    >>> librosa.Func(y)
    array([  3.226e+03,   3.217e+03, ...,   8.277e-04,   3.575e-04], dtype=float32)

    Compute onset strength auto-correlation up to 4 seconds

    >>> import matplotlib.pyplot as plt
    >>> odf = librosa.onset.onset_strength(y=y, sr=sr, hop_length=512)
    >>> ac = librosa.Func(odf, max_size=4* sr / 512)
    >>> plt.plot(ac)
    >>> plt.title('Auto-correlation')
    >>> plt.xlabel('Lag (frames)')

    """

    if arg_1 is None:
        arg_1 = arg_0.shape[arg_2]

    arg_1 = int(min(arg_1, arg_0.shape[arg_2]))

    # Compute the power spectrum along the chosen axis
    # Pad out the signal to support full-length auto-correlation.
    arg_3 = get_fftlib()
    arg_4 = np.abs(arg_3.fft(arg_0, n=2 * arg_0.shape[arg_2] + 1, arg_2=arg_2))**2

    # Convert back to time domain
    arg_5 = arg_3.ifft(arg_4, arg_2=arg_2)

    # Slice down to max_size
    arg_6 = [slice(None)] * arg_5.ndim
    arg_6[arg_2] = slice(arg_1)

    arg_5 = arg_5[tuple(arg_6)]

    if not np.iscomplexobj(arg_0):
        arg_5 = arg_5.real

    return arg_5

Bounded auto-correlation

    Parameters
    ----------
    y : np.ndarray
        array to autocorrelate

    max_size  : int > 0 or None
        maximum correlation lag.
        If unspecified, defaults to `y.shape[axis]` (unbounded)

    axis : int
        The axis along which to autocorrelate.
        By default, the last axis (-1) is taken.

    Returns
    -------
    z : np.ndarray
        truncated autocorrelation `y*y` along the specified axis.
        If `max_size` is specified, then `z.shape[axis]` is bounded
        to `max_size`.

    Notes
    -----
    This function caches at level 20.

    Examples
    --------
    Compute full autocorrelation of y

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), offset=20, duration=10)
    >>> librosa.autocorrelate(y)
    array([  3.226e+03,   3.217e+03, ...,   8.277e-04,   3.575e-04], dtype=float32)

    Compute onset strength auto-correlation up to 4 seconds

    >>> import matplotlib.pyplot as plt
    >>> odf = librosa.onset.onset_strength(y=y, sr=sr, hop_length=512)
    >>> ac = librosa.autocorrelate(odf, max_size=4* sr / 512)
    >>> plt.plot(ac)
    >>> plt.title('Auto-correlation')
    >>> plt.xlabel('Lag (frames)')


def Func ( arg_0 ) : arg_1 = os . stat ( arg_0 ) . st_mtime return datetime . datetime . utcfromtimestamp ( arg_1 )

def Func(arg_0):
	"""
	Get the modified time for a file as a datetime instance
	"""
	arg_1 = os.stat(arg_0).st_mtime
	return datetime.datetime.utcfromtimestamp(arg_1)


def Func ( arg_0 = 4 ) : arg_1 = [ cubes16 [ i % 16 ] for i in range ( arg_0 * arg_0 ) ] random . shuffle ( arg_1 ) return map ( random . choice , arg_1 )

def Func(arg_0=4):
    """Return a random Boggle board of size n x n.
    We represent a board as a linear list of letters."""
    arg_1 = [cubes16[i % 16] for i in range(arg_0*arg_0)]
    random.shuffle(arg_1)
    return map(random.choice, arg_1)

Return a random Boggle board of size n x n . We represent a board as a linear list of letters .


def Func ( arg_0 , arg_1 = '\t' , arg_2 = True ) : arg_3 = { } with open ( arg_0 , "r" ) as f : arg_4 = next ( f ) for arg_5 in f : arg_6 = arg_5 . rstrip ( ) . split ( arg_1 ) if not arg_2 : arg_6 = list ( reversed ( arg_6 ) ) arg_3 [ arg_6 [ 0 ] ] = arg_6 [ 1 ] return arg_3

def Func(arg_0, arg_1='\t', arg_2=True):
    """Returns map with entity or relations from plain text."""
    arg_3 = {}
    with open(arg_0, "r") as f:
        arg_4 = next(f) # pass the total entry number
        for arg_5 in f:
            arg_6 = arg_5.rstrip().split(arg_1)
            if not arg_2:
                arg_6 = list(reversed(arg_6))
            arg_3[arg_6[0]] = arg_6[1]

    return arg_3

Returns map with entity or relations from plain text .


(self, name, attrs, text, limit, generator, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , ** arg_6 ) : if isinstance ( arg_1 , SoupStrainer ) : arg_7 = arg_1 else : arg_7 = SoupStrainer ( arg_1 , arg_2 , arg_3 , ** arg_6 ) arg_8 = ResultSet ( arg_7 ) arg_9 = arg_5 ( ) while True : try : arg_10 = arg_9 . next ( ) except StopIteration : break if arg_10 : arg_11 = arg_7 . search ( arg_10 ) if arg_11 : arg_8 . append ( arg_11 ) if arg_4 and len ( arg_8 ) >= arg_4 : break return arg_8

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, **arg_6):
        "Iterates over a generator looking for things that match."

        if isinstance(arg_1, SoupStrainer):
            arg_7 = arg_1
        else:
            # Build a SoupStrainer
            arg_7 = SoupStrainer(arg_1, arg_2, arg_3, **arg_6)
        arg_8 = ResultSet(arg_7)
        arg_9 = arg_5()
        while True:
            try:
                arg_10 = arg_9.next()
            except StopIteration:
                break
            if arg_10:
                arg_11 = arg_7.search(arg_10)
                if arg_11:
                    arg_8.append(arg_11)
                    if arg_4 and len(arg_8) >= arg_4:
                        break
        return arg_8

Iterates over a generator looking for things that match .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . _rdd . mapValues ( lambda v : v . Func ( arg_1 = arg_1 , arg_2 = arg_2 ) ) return arg_0 . _constructor ( arg_3 ) . __finalize__ ( arg_0 )

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Clip values above and below.

        Parameters
        ----------
        min : scalar or array-like
            Minimum value. If array, will be broadcasted

        max : scalar or array-like
            Maximum value. If array, will be broadcasted.
        """
        arg_3 = arg_0._rdd.mapValues(lambda v: v.Func(arg_1=arg_1, arg_2=arg_2))
        return arg_0._constructor(arg_3).__finalize__(arg_0)


def Func(arg_0):
        """Generate the warmup points for the sampler.

        Generates warmup points by setting each flux as the sole objective
        and minimizing/maximizing it. Also caches the projection of the
        warmup points into the nullspace for non-homogeneous problems (only
        if necessary).

        """

        arg_0.n_warmup = 0
        arg_2 = arg_0.model.reactions
        arg_0.warmup = np.zeros((2 * len(arg_2), len(arg_0.model.variables)))
        arg_0.model.objective = Zero

        for arg_6 in ("min", "max"):
            arg_0.model.objective_direction = arg_6

            for arg_8, arg_9 in enumerate(arg_2):
                arg_10 = (arg_0.model.variables[arg_0.fwd_idx[arg_8]],
                             arg_0.model.variables[arg_0.rev_idx[arg_8]])

                # Omit fixed reactions if they are non-homogeneous
                if arg_9.upper_bound - arg_9.lower_bound < arg_0.bounds_tol:
                    LOGGER.info("skipping fixed reaction %s" % arg_9.id)
                    continue

                arg_0.model.objective.set_linear_coefficients(
                    {arg_10[0]: 1, arg_10[1]: -1})

                arg_0.model.slim_optimize()

                if not arg_0.model.solver.status == OPTIMAL:
                    LOGGER.info("can not maximize reaction %s, skipping it" %
                                arg_9.id)
                    continue

                arg_11 = arg_0.model.solver.primal_values
                arg_12 = [arg_11[v.name] for v in arg_0.model.variables]
                arg_0.warmup[arg_0.n_warmup, ] = arg_12
                arg_0.n_warmup += 1

                # Reset objective
                arg_0.model.objective.set_linear_coefficients(
                    {arg_10[0]: 0, arg_10[1]: 0})

        # Shrink to measure
        arg_0.warmup = arg_0.warmup[0:arg_0.n_warmup, :]

        # Remove redundant search directions
        arg_13 = np.logical_not(arg_0._is_redundant(arg_0.warmup))
        arg_0.warmup = arg_0.warmup[arg_13, :]
        arg_0.n_warmup = arg_0.warmup.shape[0]

        # Catch some special cases
        if len(arg_0.warmup.shape) == 1 or arg_0.warmup.shape[0] == 1:
            raise ValueError("Your flux cone consists only of a single point!")
        elif arg_0.n_warmup == 2:
            if not arg_0.problem.homogeneous:
                raise ValueError("Can not sample from an inhomogenous problem"
                                 " with only 2 search directions :(")
            LOGGER.info("All search directions on a line, adding another one.")
            arg_14 = arg_0.warmup.T.dot([0.25, 0.25])
            arg_0.warmup = np.vstack([arg_0.warmup, arg_14])
            arg_0.n_warmup += 1

        # Shrink warmup points to measure
        arg_0.warmup = shared_np_array(
            (arg_0.n_warmup, len(arg_0.model.variables)), arg_0.warmup)

Generate the warmup points for the sampler .


def Func(arg_0, arg_1=None, arg_2=None):
        """
        Dumps and loads a database snapshot simultaneously.
        Requires that the destination server has direct database access
        to the source server.

        This is better than a serial dump+load when:
        1. The network connection is reliable.
        2. You don't need to save the dump file.

        The benefits of this over a dump+load are:
        1. Usually runs faster, since the load and dump happen in parallel.
        2. Usually takes up less disk space since no separate dump file is
            downloaded.
        """
        arg_3 = arg_0.database_renderer(arg_1=arg_1, arg_2=arg_2)
        arg_3.run('pg_dump -c --host={host_string} --username={db_user} '
            '--blobs --format=c {db_name} -n public | '
            'pg_restore -U {db_postgresql_postgres_user} --create '
            '--dbname={db_name}')

Dumps and loads a database snapshot simultaneously . Requires that the destination server has direct database access to the source server .


(x, wrg, hrg, is_random=False, row_index=0, col_index=1)

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=0, arg_5=1):
    """Randomly or centrally crop multiple images.

    Parameters
    ----------
    x : list of numpy.array
        List of images with dimension of [n_images, row, col, channel] (default).
    others : args
        See ``tl.prepro.crop``.

    Returns
    -------
    numpy.array
        A list of processed images.

    """
    arg_6, arg_7 = arg_0[0].shape[arg_4], arg_0[0].shape[arg_5]

    if (arg_6 < arg_2) or (arg_7 < arg_1):
        raise AssertionError("The size of cropping should smaller than or equal to the original image")

    if arg_3:
        arg_8 = int(np.random.uniform(0, arg_6 - arg_2))
        arg_9 = int(np.random.uniform(0, arg_7 - arg_1))
        arg_10 = []
        for arg_11 in arg_0:
            arg_10.append(arg_11[arg_8:arg_2 + arg_8, arg_9:arg_1 + arg_9])
        return np.asarray(arg_10)
    else:
        # central crop
        arg_8 = (arg_6 - arg_2) / 2
        arg_9 = (arg_7 - arg_1) / 2
        arg_10 = []
        for arg_11 in arg_0:
            arg_10.append(arg_11[arg_8:arg_6 - arg_8, arg_9:arg_7 - arg_9])
        return np.asarray(arg_10)

Randomly or centrally crop multiple images .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_getRunningApps
(
)
for
arg_2
in
arg_1
:
arg_3
=
arg_2
.
processIdentifier
(
)
arg_4
=
arg_0
.
getAppRefByPid
(
arg_3
)
try
:
if
arg_4
.
AXFrontmost
:
return
arg_4
except
(
_a11y
.
ErrorUnsupported
,
_a11y
.
ErrorCannotComplete
,
_a11y
.
ErrorAPIDisabled
,
_a11y
.
ErrorNotImplemented
)
:
pass
raise
ValueError
(
'No GUI application found.'
)

def Func(arg_0):
        """Get the current frontmost application.

        Raise a ValueError exception if no GUI applications are found.
        """
        # Refresh the runningApplications list
        arg_1 = arg_0._getRunningApps()
        for arg_2 in arg_1:
            arg_3 = arg_2.processIdentifier()
            arg_4 = arg_0.getAppRefByPid(arg_3)
            try:
                if arg_4.AXFrontmost:
                    return arg_4
            except (_a11y.ErrorUnsupported,
                    _a11y.ErrorCannotComplete,
                    _a11y.ErrorAPIDisabled,
                    _a11y.ErrorNotImplemented):
                # Some applications do not have an explicit GUI
                # and so will not have an AXFrontmost attribute
                # Trying to read attributes from Google Chrome Helper returns
                # ErrorAPIDisabled for some reason - opened radar bug 12837995
                pass
        raise ValueError('No GUI application found.')


Export all transcripts to .bed like format

def Func(arg_0, arg_1):
    """Export all Func to .bed like format"""
    LOG.info("Running scout export Func")
    arg_2 = arg_0.obj['adapter']

    arg_3 = ["#Chrom\tStart\tEnd\tTranscript\tRefSeq\tHgncID"]

    for arg_4 in arg_3:
        click.echo(arg_4)

    arg_5 = ("{0}\t{1}\t{2}\t{3}\t{4}\t{5}")

    for arg_6 in export_Func(arg_2):
        click.echo(arg_5.format(
            arg_6['chrom'],
            arg_6['start'],
            arg_6['end'],
            arg_6['ensembl_transcript_id'],
            arg_6.get('refseq_id',''),
            arg_6['hgnc_id'],
            )
        )

Export all transcripts to . bed like format


(self, case, hgnc_symbols=None, hgnc_ids=None,
                                 phenotype_ids=None, build='37')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
'37'
)
:
arg_6
=
[
]
arg_7
=
[
]
if
arg_3
:
LOG
.
info
(
"Fetching genes by hgnc id"
)
arg_7
=
arg_0
.
hgnc_collection
.
find
(
{
'hgnc_id'
:
{
'$in'
:
arg_3
}
,
'build'
:
arg_5
}
)
elif
arg_2
:
LOG
.
info
(
"Fetching genes by hgnc symbols"
)
arg_7
=
[
]
for
arg_8
in
arg_2
:
for
arg_9
in
arg_0
.
gene_by_alias
(
arg_8
=
arg_8
,
arg_5
=
arg_5
)
:
arg_7
.
append
(
arg_9
)
for
arg_9
in
arg_7
:
arg_6
.
append
(
{
'hgnc_symbol'
:
arg_9
[
'hgnc_symbol'
]
,
'hgnc_id'
:
arg_9
[
'hgnc_id'
]
,
'description'
:
arg_9
[
'description'
]
,
}
)
LOG
.
info
(
"Update dynamic gene panel for: %s"
,
arg_1
[
'display_name'
]
)
arg_10
=
arg_0
.
case_collection
.
find_one_and_update
(
{
'_id'
:
arg_1
[
'_id'
]
}
,
{
'$set'
:
{
'dynamic_gene_list'
:
arg_6
,
'dynamic_panel_phenotypes'
:
arg_4
or
[
]
}
}
,
return_document
=
pymongo
.
ReturnDocument
.
AFTER
)
LOG
.
debug
(
"Case updated"
)
return
arg_10

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                                 arg_4=None, arg_5='37'):
        """Update the dynamic gene list for a case

        Adds a list of dictionaries to case['dynamic_gene_list'] that looks like

        {
            hgnc_symbol: str,
            hgnc_id: int,
            description: str
        }

        Arguments:
            case (dict): The case that should be updated
            hgnc_symbols (iterable): A list of hgnc_symbols
            hgnc_ids (iterable): A list of hgnc_ids

        Returns:
            updated_case(dict)
        """
        arg_6 = []
        arg_7 = []
        if arg_3:
            LOG.info("Fetching genes by hgnc id")
            arg_7 = arg_0.hgnc_collection.find({'hgnc_id': {'$in': arg_3}, 'build': arg_5})
        elif arg_2:
            LOG.info("Fetching genes by hgnc symbols")
            arg_7 = []
            for arg_8 in arg_2:
                for arg_9 in arg_0.gene_by_alias(arg_8=arg_8, arg_5=arg_5):
                    arg_7.append(arg_9)

        for arg_9 in arg_7:
            arg_6.append(
                {
                    'hgnc_symbol': arg_9['hgnc_symbol'],
                    'hgnc_id': arg_9['hgnc_id'],
                    'description': arg_9['description'],
                }
            )

        LOG.info("Update dynamic gene panel for: %s", arg_1['display_name'])
        arg_10 = arg_0.case_collection.find_one_and_update(
            {'_id': arg_1['_id']},
            {'$set': {'dynamic_gene_list': arg_6,
                      'dynamic_panel_phenotypes': arg_4 or []}},
            return_document=pymongo.ReturnDocument.AFTER
        )
        LOG.debug("Case updated")
        return arg_10


return tf.cast(tf.linalg.det(x) > det_bounds, dtype=x.dtype)

def Func ( arg_0 , arg_1 ) : return tf . cast ( tf . linalg . det ( arg_0 ) > arg_1 , dtype = arg_0 . dtype )

def Func(arg_0, arg_1):
  """Returns whether the input matches the given determinant limit.

  Args:
    x: A floating-point `Tensor` of shape `[B1, ..., Bn, M, M]`.
    det_bounds: A floating-point `Tensor` that must broadcast to shape
      `[B1, ..., Bn]`, giving the desired lower bound on the
      determinants in `x`.

  Returns:
    mask: A floating-point `Tensor` of shape [B1, ..., Bn].  Each
      scalar is 1 if the corresponding matrix had determinant above
      the corresponding bound, otherwise 0.
  """
  # For the curious: I wonder whether it is possible and desirable to
  # use a Cholesky decomposition-based algorithm for this, since the
  # only matrices whose determinant this code cares about will be PSD.
  # Didn't figure out how to code that in TensorFlow.
  #
  # Expert opinion is that it would be about twice as fast since
  # Cholesky is roughly half the cost of Gaussian Elimination with
  # Partial Pivoting. But this is less of an impact than the switch in
  # _psd_mask.
  return tf.cast(tf.linalg.det(arg_0) > arg_1, dtype=arg_0.dtype)

Returns whether the input matches the given determinant limit .


def Func(arg_0, arg_1, arg_2):
        """
        If the form or formsets are invalid, re-render the context data with the
        data-filled form and formsets and errors.
        """
        return arg_0.render_to_response(arg_0.get_context_data(arg_1=arg_1, arg_2=arg_2))

If the form or formsets are invalid re - render the context data with the data - filled form and formsets and errors .


def Func ( arg_0 ) : arg_0 . fetch_and_filter_tags ( ) arg_1 = arg_0 . sort_tags_by_date ( arg_0 . filtered_tags ) arg_0 . filtered_tags = arg_1 arg_0 . fetch_and_filter_issues_and_pr ( ) arg_3 = str ( arg_0 . options . frontmatter ) if arg_0 . options . frontmatter else u"" arg_3 += u"{0}\n\n" . format ( arg_0 . options . header ) if arg_0 . options . unreleased_only : arg_3 += arg_0 . generate_unreleased_section ( ) else : arg_3 += arg_0 . generate_log_for_all_tags ( ) try : with open ( arg_0 . options . base ) as fh : arg_3 += fh . read ( ) except ( TypeError , IOError ) : pass return arg_3

def Func(arg_0):
        """
        Main function to start change log generation

        :rtype: str
        :return: Generated change log file
        """

        arg_0.fetch_and_filter_tags()
        arg_1 = arg_0.sort_tags_by_date(arg_0.filtered_tags)
        arg_0.filtered_tags = arg_1
        arg_0.fetch_and_filter_issues_and_pr()

        arg_3 = str(arg_0.options.frontmatter) \
            if arg_0.options.frontmatter else u""
        arg_3 += u"{0}\n\n".format(arg_0.options.header)

        if arg_0.options.unreleased_only:
            arg_3 += arg_0.generate_unreleased_section()
        else:
            arg_3 += arg_0.generate_log_for_all_tags()

        try:
            with open(arg_0.options.base) as fh:
                arg_3 += fh.read()
        except (TypeError, IOError):
            pass
        return arg_3


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 . meta . call_args . subscribers : arg_4 = 'on_' + arg_1 if hasattr ( arg_3 , arg_4 ) : arg_2 . append ( functools . partial ( getattr ( arg_3 , arg_4 ) , future = arg_0 ) ) return arg_2

def Func(arg_0, arg_1):
    """Retrieves callbacks from a subscriber

    :type transfer_future: s3transfer.futures.TransferFuture
    :param transfer_future: The transfer future the subscriber is associated
        to.

    :type callback_type: str
    :param callback_type: The type of callback to retrieve from the subscriber.
        Valid types include:
            * 'queued'
            * 'progress'
            * 'done'

    :returns: A list of callbacks for the type specified. All callbacks are
        preinjected with the transfer future.
    """
    arg_2 = []
    for arg_3 in arg_0.meta.call_args.subscribers:
        arg_4 = 'on_' + arg_1
        if hasattr(arg_3, arg_4):
            arg_2.append(
                functools.partial(
                    getattr(arg_3, arg_4),
                    future=arg_0
                )
            )
    return arg_2


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : cache . set ( arg_0 . get_cache_item_name ( arg_1 , arg_2 ) , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """ set new mapped-items structure into cache """
        cache.set(arg_0.get_cache_item_name(arg_1, arg_2), arg_3)

set new mapped - items structure into cache


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 = next ( string_arg ( arg_0 , arg_1 ) , '' ) arg_2 = next ( string_arg ( arg_0 , arg_2 ) , '' ) yield arg_1 . startswith ( arg_2 )

def Func(arg_0, arg_1, arg_2):
    '''
    Yields one boolean, whether the first string starts with the second
    '''
    arg_1 = next(string_arg(arg_0, arg_1), '')
    arg_2 = next(string_arg(arg_0, arg_2), '')
    yield arg_1.startswith(arg_2)

Yields one boolean whether the first string starts with the second


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
logging
.
info
(
'%s: parsing skeleton configuration'
,
arg_1
)
if
hasattr
(
arg_1
,
'read'
)
:
arg_3
=
parser
.
parse
(
arg_1
,
arg_0
.
world
,
arg_0
.
jointgroup
,
**
arg_2
)
else
:
with
open
(
arg_1
)
as
handle
:
arg_3
=
parser
.
parse
(
handle
,
arg_0
.
world
,
arg_0
.
jointgroup
,
**
arg_2
)
arg_0
.
bodies
=
arg_3
.
bodies
arg_0
.
joints
=
arg_3
.
joints
arg_0
.
set_pid_params
(
kp
=
0.999
/
arg_0
.
world
.
dt
)

def Func(arg_0, arg_1, **arg_2):
        '''Load a skeleton definition from a text file.

        Parameters
        ----------
        source : str or file
            A filename or file-like object that contains text information
            describing a skeleton. See :class:`pagoda.parser.BodyParser` for
            more information about the format of the text file.
        '''
        logging.info('%s: parsing skeleton configuration', arg_1)
        if hasattr(arg_1, 'read'):
            arg_3 = parser.parse(arg_1, arg_0.world, arg_0.jointgroup, **arg_2)
        else:
            with open(arg_1) as handle:
                arg_3 = parser.parse(handle, arg_0.world, arg_0.jointgroup, **arg_2)
        arg_0.bodies = arg_3.bodies
        arg_0.joints = arg_3.joints
        arg_0.set_pid_params(kp=0.999 / arg_0.world.dt)

Load a skeleton definition from a text file .


def
Func
(
arg_0
)
:
assert_is_type
(
arg_0
,
str
)
arg_1
=
api
(
"GET /99/Grids/%s"
%
arg_0
)
arg_2
=
[
get_model
(
key
[
"name"
]
)
for
key
in
arg_1
[
"model_ids"
]
]
arg_3
=
api
(
"GET /3/Models/%s"
%
arg_1
[
"model_ids"
]
[
0
]
[
"name"
]
)
[
"models"
]
[
0
]
arg_4
=
H2OGridSearch
(
,
{
}
,
arg_0
)
arg_4
.
_resolve_grid
(
arg_0
,
arg_1
,
arg_3
)
arg_4
.
models
=
arg_2
arg_5
=
{
arg_6
:
set
(
)
for
arg_6
in
arg_4
.
hyper_names
}
for
arg_6
in
arg_4
.
hyper_names
:
for
arg_7
in
arg_2
:
if
isinstance
(
arg_7
.
full_parameters
[
arg_6
]
[
"actual_value"
]
,
list
)
:
arg_5
[
arg_6
]
.
add
(
arg_7
.
full_parameters
[
arg_6
]
[
"actual_value"
]
[
0
]
)
else
:
arg_5
[
arg_6
]
.
add
(
arg_7
.
full_parameters
[
arg_6
]
[
"actual_value"
]
)
arg_5
=
{
str
(
arg_6
)
:
list
(
vals
)
for
arg_6
,
vals
in
arg_5
.
items
(
)
}
arg_4
.
hyper_params
=
arg_5
arg_4
.
model
=
arg_7
.
__class__
(
)
return
arg_4

def Func(arg_0):
    """
    Return the specified grid.

    :param grid_id: The grid identification in h2o

    :returns: an :class:`H2OGridSearch` instance.
    """
    assert_is_type(arg_0, str)
    arg_1 = api("GET /99/Grids/%s" % arg_0)
    arg_2 = [get_model(key["name"]) for key in arg_1["model_ids"]]
    # get first model returned in list of models from grid search to get model class (binomial, multinomial, etc)
    arg_3 = api("GET /3/Models/%s" % arg_1["model_ids"][0]["name"])["models"][0]
    arg_4 = H2OGridSearch(None, {}, arg_0)
    arg_4._resolve_grid(arg_0, arg_1, arg_3)
    arg_4.models = arg_2
    arg_5 = {arg_6: set() for arg_6 in arg_4.hyper_names}
    for arg_6 in arg_4.hyper_names:
        for arg_7 in arg_2:
            if isinstance(arg_7.full_parameters[arg_6]["actual_value"], list):
                arg_5[arg_6].add(arg_7.full_parameters[arg_6]["actual_value"][0])
            else:
                arg_5[arg_6].add(arg_7.full_parameters[arg_6]["actual_value"])

    arg_5 = {str(arg_6): list(vals) for arg_6, vals in arg_5.items()}
    arg_4.hyper_params = arg_5
    arg_4.model = arg_7.__class__()
    return arg_4


def Func ( arg_0 ) : arg_1 = len ( arg_0 ) return np . concatenate ( ( arg_0 [ arg_1 // 2 + 1 : ] , arg_0 [ 0 : arg_1 // 2 ] ) )

def Func(arg_0):
    """todo is it really useful ?

    Swap  sides

    .. doctest::

        >>> from spectrum import swapsides
        >>> x = [-2, -1, 1, 2]
        >>> swapsides(x)
        array([ 2, -2, -1])

    """
    arg_1 = len(arg_0)
    return np.concatenate((arg_0[arg_1//2+1:], arg_0[0:arg_1//2]))


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tsuite:enter { name: %r }"
%
arg_1
[
"name"
]
)
arg_2
=
0
for
arg_3
in
arg_1
[
"hooks"
]
[
"enter"
]
:
arg_2
=
script_run
(
arg_0
,
arg_3
)
if
arg_2
:
break
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:tsuite:enter { rcode: %r } "
%
arg_2
,
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
    """Triggers when entering the given testsuite"""

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tsuite:enter { name: %r }" % arg_1["name"])

    arg_2 = 0
    for arg_3 in arg_1["hooks"]["enter"]:     # ENTER-hooks
        arg_2 = script_run(arg_0, arg_3)
        if arg_2:
            break

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:tsuite:enter { rcode: %r } " % arg_2, arg_2)

    return arg_2


(
    state,
    incorrect_msg="Have a look at the console: your code contains an error. Fix it and try again!",
)

def Func(
    arg_0,
    arg_1="Have a look at the console: your code contains an error. Fix it and try again!",
):
    """Check whether the submission did not generate a runtime error.

    If all SCTs for an exercise pass, before marking the submission as correct pythonwhat will automatically check whether
    the student submission generated an error. This means it is not needed to use ``Func()`` explicitly.

    However, in some cases, using ``Func()`` explicitly somewhere throughout your SCT execution can be helpful:

    - If you want to make sure people didn't write typos when writing a long function name.
    - If you want to first verify whether a function actually runs, before checking whether the arguments were specified correctly.
    - More generally, if, because of the content, it's instrumental that the script runs without
      errors before doing any other verifications.

    Args:
        incorrect_msg: if specified, this overrides the default message if the student code generated an error.

    :Example:

        Suppose you're verifying an exercise about model training and validation: ::

            # pre exercise code
            import numpy as np
            from sklearn.model_selection import train_test_split
            from sklearn import datasets
            from sklearn import svm

            iris = datasets.load_iris()
            iris.data.shape, iris.target.shape

            # solution
            X_train, X_test, y_train, y_test = train_test_split(
                iris.data, iris.target, test_size=0.4, random_state=0)

        If you want to make sure that ``train_test_split()`` ran without errors,
        which would check if the student typed the function without typos and used
        sensical arguments, you could use the following SCT: ::

            Ex().Func()
            Ex().check_function('sklearn.model_selection.train_test_split').multi(
                check_args(['arrays', 0]).has_equal_value(),
                check_args(['arrays', 0]).has_equal_value(),
                check_args(['options', 'test_size']).has_equal_value(),
                check_args(['options', 'random_state']).has_equal_value()
            )

        If, on the other hand, you want to fall back onto pythonwhat's built in behavior,
        that checks for an error before marking the exercise as correct, you can simply
        leave of the ``Func()`` step.

    """
    arg_0.assert_root("Func")

    if arg_0.reporter.errors:
        arg_2 = arg_0.build_message(
            arg_1, {"error": str(arg_0.reporter.errors[0])}
        )
        arg_0.report(Feedback(arg_2, arg_0))

    return arg_0

Check whether the submission did not generate a runtime error.

    If all SCTs for an exercise pass, before marking the submission as correct pythonwhat will automatically check whether
    the student submission generated an error. This means it is not needed to use ``has_no_error()`` explicitly.

    However, in some cases, using ``has_no_error()`` explicitly somewhere throughout your SCT execution can be helpful:

    - If you want to make sure people didn't write typos when writing a long function name.
    - If you want to first verify whether a function actually runs, before checking whether the arguments were specified correctly.
    - More generally, if, because of the content, it's instrumental that the script runs without
      errors before doing any other verifications.

    Args:
        incorrect_msg: if specified, this overrides the default message if the student code generated an error.

    :Example:

        Suppose you're verifying an exercise about model training and validation: ::

            # pre exercise code
            import numpy as np
            from sklearn.model_selection import train_test_split
            from sklearn import datasets
            from sklearn import svm

            iris = datasets.load_iris()
            iris.data.shape, iris.target.shape

            # solution
            X_train, X_test, y_train, y_test = train_test_split(
                iris.data, iris.target, test_size=0.4, random_state=0)

        If you want to make sure that ``train_test_split()`` ran without errors,
        which would check if the student typed the function without typos and used
        sensical arguments, you could use the following SCT: ::

            Ex().has_no_error()
            Ex().check_function('sklearn.model_selection.train_test_split').multi(
                check_args(['arrays', 0]).has_equal_value(),
                check_args(['arrays', 0]).has_equal_value(),
                check_args(['options', 'test_size']).has_equal_value(),
                check_args(['options', 'random_state']).has_equal_value()
            )

        If, on the other hand, you want to fall back onto pythonwhat's built in behavior,
        that checks for an error before marking the exercise as correct, you can simply
        leave of the ``has_no_error()`` step.

Check whether the submission did not generate a runtime error .


def Func ( arg_0 , arg_1 = None ) : super ( Random , arg_0 ) . Func ( arg_1 ) arg_0 . gauss_next = None

def Func(arg_0, arg_1=None):
        """Initialize internal state of the random number generator.

        None or no argument Funcs from current time or from an operating
        system specific randomness source if available.

        If a is not None or is an int or long, hash(a) is used instead.
        Hash values for some types are nondeterministic when the
        PYTHONHASHSEED environment variable is enabled.
        """

        super(Random, arg_0).Func(arg_1)
        arg_0.gauss_next = None

Initialize internal state of the random number generator.

        None or no argument seeds from current time or from an operating
        system specific randomness source if available.

        If a is not None or is an int or long, hash(a) is used instead.
        Hash values for some types are nondeterministic when the
        PYTHONHASHSEED environment variable is enabled.

Initialize internal state of the random number generator .


def Func ( arg_0 , arg_1 = 1 ) : Func = [ ] arg_3 = re . compile ( 'N+' , re . IGNORECASE ) for arg_4 in arg_3 . finditer ( arg_0 . seq ) : if arg_4 . span ( ) [ 1 ] - arg_4 . span ( ) [ 0 ] + 1 >= arg_1 : Func . append ( intervals . Interval ( arg_4 . span ( ) [ 0 ] , arg_4 . span ( ) [ 1 ] - 1 ) ) return Func

def Func(arg_0, arg_1 = 1):
        '''Finds the positions of all gaps in the sequence that are at least min_length long. Returns a list of Intervals. Coords are zero-based'''
        Func = []
        arg_3 = re.compile('N+', re.IGNORECASE)
        for arg_4 in arg_3.finditer(arg_0.seq):
             if arg_4.span()[1] - arg_4.span()[0] + 1 >= arg_1:
                 Func.append(intervals.Interval(arg_4.span()[0], arg_4.span()[1] - 1))
        return Func

Finds the positions of all gaps in the sequence that are at least min_length long . Returns a list of Intervals . Coords are zero - based


def Func(arg_0, arg_1, arg_2):
    """For lens data, compute the unmasked blurred image of every unmasked unblurred image of each plane. To do this, \
    this function iterates over all planes to extract their unmasked unblurred images.

    If a galaxy in a plane has a pixelization, the unmasked image is returned as None, as as the inversion's model \
    image cannot be mapped to an unmasked version.

    This relies on using the lens data's padded-grid, which is a grid of (y,x) coordinates which extends over the \
    entire image as opposed to just the masked region.

    This returns a list, where each list index corresponds to [plane_index].

    Parameters
    ----------
    planes : [plane.Plane]
        The list of planes the unmasked blurred images are computed using.
    padded_grid_stack : grids.GridStack
        A padded-grid_stack, whose padded grid is used for PSF convolution.
    psf : ccd.PSF
        The PSF of the image used for convolution.
    """
    arg_3 = []

    for arg_4 in arg_0:

        if arg_4.has_pixelization:
            arg_5 = None
        else:
            arg_5 = \
                arg_1.unmasked_blurred_image_from_psf_and_unmasked_image(

                    arg_2=arg_2, unmasked_image_1d=arg_4.image_plane_image_1d)

        arg_3.append(arg_5)

    return arg_3

For lens data compute the unmasked blurred image of every unmasked unblurred image of each plane . To do this \ this function iterates over all planes to extract their unmasked unblurred images .


(im, region_size=5, to_return='harris', scale=0.05)

def Func ( arg_0 , arg_1 = 5 , arg_2 = 'harris' , arg_3 = 0.05 ) : arg_4 = arg_0 . ndim arg_5 = [ nd . sobel ( arg_0 , axis = i ) for i in range ( arg_4 ) ] arg_6 = np . zeros ( ( arg_4 , arg_4 ) + arg_0 . shape ) for arg_7 in range ( arg_4 ) : for arg_8 in range ( arg_4 ) : arg_6 [ arg_7 , arg_8 ] = nd . filters . gaussian_filter ( arg_5 [ arg_7 ] * arg_5 [ arg_8 ] , arg_1 ) if arg_2 == 'matrix' : return arg_6 arg_9 = np . trace ( arg_6 , axis1 = 0 , axis2 = 1 ) arg_10 = np . linalg . det ( arg_6 . T ) . T if arg_2 == 'trace-determinant' : return arg_9 , arg_10 else : arg_11 = arg_10 - arg_3 * arg_9 * arg_9 return arg_11

def Func(arg_0, arg_1=5, arg_2='harris', arg_3=0.05):
    """
    Harris-motivated feature detection on a d-dimensional image.

    Parameters
    ---------
        im
        region_size
        to_return : {'harris','matrix','trace-determinant'}

    """
    arg_4 = arg_0.ndim
    #1. Gradient of image
    arg_5 = [nd.sobel(arg_0, axis=i) for i in range(arg_4)]
    #2. Corner response matrix
    arg_6 = np.zeros((arg_4, arg_4) + arg_0.shape)
    for arg_7 in range(arg_4):
        for arg_8 in range(arg_4):
            arg_6[arg_7,arg_8] = nd.filters.gaussian_filter(arg_5[arg_7]*arg_5[arg_8],
                    arg_1)
    if arg_2 == 'matrix':
        return arg_6
    #3. Trace, determinant
    arg_9 = np.trace(arg_6, axis1=0, axis2=1)
    arg_10 = np.linalg.det(arg_6.T).T
    if arg_2 == 'trace-determinant':
        return arg_9, arg_10
    else:
        #4. Harris detector:
        arg_11 = arg_10 - arg_3*arg_9*arg_9
        return arg_11

Harris - motivated feature detection on a d - dimensional image .


def Func(arg_0, arg_1=arg_2):
        """Update the API Root's information and list of Collections"""
        arg_0.Func_information(arg_1)
        arg_0.Func_collections(arg_1)

Update the API Root s information and list of Collections


def Func(arg_0, arg_1):
        """
        Calculate the portion of enthalpy of the compound phase covered by this
        Cp record.

        :param T: [K] temperature

        :returns: [J/mol] Enthalpy.
        """

        arg_2 = 0.0
        if arg_1 < arg_0.Tmax:
            arg_3 = arg_1
        else:
            arg_3 = arg_0.Tmax
        arg_4 = arg_0.Tmin

        for arg_5, arg_6 in zip(arg_0._coefficients, arg_0._exponents):
            # Analytically integrate Cp(T).
            if arg_6 == -1.0:
                arg_2 += arg_5 * math.log(arg_3/arg_4)
            else:
                arg_2 += arg_5 * (arg_3**(arg_6+1.0) - arg_4**(arg_6+1.0)) / (arg_6+1.0)
        return arg_2

Calculate the portion of enthalpy of the compound phase covered by this Cp record .


def Func(arg_0):
    """
    Load and validate the header of a pcap file.
    """
    try:
        arg_1 = arg_0.read(24)
    except UnicodeDecodeError:
        print("\nMake sure the input file is opened in read binary, 'rb'\n")
        raise InvalidEncoding("Could not read file; it might not be opened in binary mode.")

    # in case the capture file is not the same endianness as ours, we have to
    # use the correct byte order for the file header
    if arg_1[:4] in [struct.pack(">I", _MAGIC_NUMBER),
                                   struct.pack(">I", _MAGIC_NUMBER_NS)]:
        arg_2 = b'big'
        arg_3 = struct.unpack('>IhhIIII', arg_1)
    elif arg_1[:4] in [struct.pack("<I", _MAGIC_NUMBER),
                                     struct.pack("<I", _MAGIC_NUMBER_NS)]:
        arg_2 = b'little'
        arg_3 = struct.unpack('<IhhIIII', arg_1)
    else:
        raise UnknownMagicNumber("No supported Magic Number found")

    (arg_4, arg_5, arg_6, arg_7, arg_8, arg_9, arg_10) = arg_3
    arg_11 = __pcap_header__(arg_4, arg_5, arg_6, arg_7, arg_8, arg_9,
                             arg_10, ctypes.c_char_p(arg_2),
                             arg_4 == _MAGIC_NUMBER_NS)
    if not __validate_header__(arg_11):
        raise InvalidHeader("Invalid Header")
    else:
        return arg_11

Load and validate the header of a pcap file .


(dest_list, occ_bb, piece_bb, target_bb, pos,
                             domain)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                             arg_5):
    """ Find a slider attacker

    Parameters
    ----------
    dest_list : list
        To store the results.
    occ_bb : int, bitboard
        Occupancy bitboard.
    piece_bb : int, bitboard
        Bitboard with the position of the attacker piece.
    target_bb : int, bitboard
        Occupancy bitboard without any of the sliders in question.
    pos : int
        Target position.
    pos_map : function
        Mapping between a board position and its position in a single
        rotated/translated rank produced with domain_trans.
    domain_trans : function
        Transformation from a rank/file/diagonal/anti-diagonal containing pos
        to a single rank
    pos_inv_map : function
        Inverse of pos_map
    """
    arg_6, arg_7, arg_8 = arg_5
    arg_9 = reach[arg_6(arg_4)][arg_7(arg_3, arg_4)]
    arg_10 = arg_9 & arg_7(arg_2, arg_4)
    while arg_10:
        arg_9 = arg_10&-arg_10
        arg_11 = arg_9.bit_length()-1
        if not (ray[arg_11][arg_6(arg_4)] & arg_7(arg_1, arg_4)):
            arg_0.append(arg_8(arg_11, arg_4))
        arg_10 ^= arg_9


(params, w_name, scope_name, inputs, layers, weights, names)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert transposed convolution layer.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting transposed convolution ...')

    if arg_6 == 'short':
        arg_7 = 'C' + random_string(7)
    elif arg_6 == 'keep':
        arg_7 = arg_1
    else:
        arg_7 = arg_1 + str(random.random())

    arg_8 = '{0}.bias'.format(arg_1)
    arg_9 = '{0}.weight'.format(arg_1)

    if len(arg_5[arg_9].numpy().shape) == 4:
        arg_10 = arg_5[arg_9].numpy().transpose(2, 3, 1, 0)
        arg_11, arg_12, arg_13, arg_14 = arg_10.shape

        arg_15 = arg_0['group']
        if arg_15 > 1:
            raise AssertionError('Cannot convert conv1d with groups != 1')

        if arg_0['dilations'][0] > 1:
            raise AssertionError('Cannot convert conv1d with dilation_rate != 1')

        if arg_8 in arg_5:
            arg_16 = arg_5[arg_8].numpy()
            arg_17 = True
        else:
            arg_16 = None
            arg_17 = False

        arg_18 = arg_3[0]

        if arg_17:
            arg_5 = [arg_10, arg_16]
        else:
            arg_5 = [arg_10]

        arg_19 = keras.layers.Conv2DTranspose(
            filters=arg_13,
            kernel_size=(arg_11, arg_12),
            strides=(arg_0['strides'][0], arg_0['strides'][1]),
            padding='valid',
            output_padding=0,
            arg_5=arg_5,
            use_bias=arg_17,
            activation=None,
            dilation_rate=arg_0['dilations'][0],
            bias_initializer='zeros', kernel_initializer='zeros',
            name=arg_7
        )

        arg_4[arg_2] = arg_19(arg_4[arg_18])

        # Magic ad-hoc.
        # See the Keras issue: https://github.com/keras-team/keras/issues/6777
        arg_4[arg_2].set_shape(arg_4[arg_2]._keras_shape)

        arg_20 = arg_0['pads']
        if arg_20[0] > 0:
            assert(len(arg_20) == 2 or (arg_20[2] == arg_20[0] and arg_20[3] == arg_20[1]))

            arg_21 = keras.layers.Cropping2D(
                arg_20[:2],
                name=arg_7 + '_crop'
            )
            arg_4[arg_2] = arg_21(arg_4[arg_2])
    else:
        raise AssertionError('Layer is not supported for now')


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 [ 'event_type' ] arg_3 = nova_customer_process . get ( arg_2 ) if arg_3 is not None : arg_3 ( arg_0 , arg_1 ) else : arg_4 = False arg_5 = None for arg_6 in nova_customer_process_wildcard . keys ( ) : if arg_6 . match ( arg_2 ) : arg_5 = nova_customer_process_wildcard . get ( arg_6 ) arg_4 = True break if arg_4 : arg_5 ( arg_0 , arg_1 ) else : default_process ( arg_0 , arg_1 ) arg_1 . ack ( )

def Func(arg_0, arg_1):
    """
    This function deal with the nova notification.

    First, find process from customer_process that not include wildcard.
    if not find from customer_process, then find process from customer_process_wildcard.
    if not find from customer_process_wildcard, then use ternya default process.
    :param body: dict of openstack notification.
    :param message: kombu Message class
    :return:
    """
    arg_2 = arg_0['event_type']
    arg_3 = nova_customer_process.get(arg_2)
    if arg_3 is not None:
        arg_3(arg_0, arg_1)
    else:
        arg_4 = False
        arg_5 = None
        for arg_6 in nova_customer_process_wildcard.keys():
            if arg_6.match(arg_2):
                arg_5 = nova_customer_process_wildcard.get(arg_6)
                arg_4 = True
                break
        if arg_4:
            arg_5(arg_0, arg_1)
        else:
            default_process(arg_0, arg_1)
    arg_1.ack()

This function deal with the nova notification .


def Func ( arg_0 , arg_1 ) : if arg_1 in ( '.' , '/' ) : arg_1 = '' arg_2 = os . path . join ( arg_0 . _bucket_root , arg_1 ) arg_2 = arg_2 . rstrip ( '/' ) return arg_2

def Func(arg_0, arg_1):
        """Make an absolute directory path in the bucker for dirname,
        which is is assumed relative to the self._bucket_root prefix directory.
        """
        if arg_1 in ('.', '/'):
            arg_1 = ''
        # Strips trailing slash from dir prefix for comparisons
        # os.path.dirname() returns directory names without a trailing /
        arg_2 = os.path.join(arg_0._bucket_root, arg_1)
        arg_2 = arg_2.rstrip('/')
        return arg_2

Make an absolute directory path in the bucker for dirname which is is assumed relative to the self . _bucket_root prefix directory .


def Func(arg_0):
        '''The user is required to have an application secrets file in his
           or her environment. The client exists with error
           if the variable isn't found.
        '''
        arg_1 = 'SREGISTRY_GOOGLE_DRIVE_CREDENTIALS'
        arg_0._secrets = arg_0._get_and_update_setting(arg_1)
        arg_0._base = arg_0._get_and_update_setting('SREGISTRY_GOOGLE_DRIVE_ROOT')

        if arg_0._base is None:
            arg_0._base = 'sregistry'

        if arg_0._secrets is None:
            bot.error('You must export %s to use Google Drive client' %arg_1)
            bot.info("https://singularityhub.github.io/sregistry-cli/client-google-drive")
            sys.exit(1)

The user is required to have an application secrets file in his or her environment . The client exists with error if the variable isn t found .


(self, symbol: str, currency: str, agent: str)

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_2) -> PriceModel:
        """ Download and save price online """
        arg_5 = arg_0.__Func(arg_1, arg_3, arg_4)
        arg_0.save()
        return arg_5


def Func ( arg_0 ) : if isinstance ( arg_0 , bytes ) : try : arg_0 = arg_0 . decode ( "ascii" ) except UnicodeDecodeError : return None if arg_0 : arg_1 = ascii_punctuation_re . sub ( "" , arg_0 ) . lower ( ) return encodings . get ( arg_1 , None ) else : return None

def Func(arg_0):
    """Return the python codec name corresponding to an encoding or None if the
    string doesn't correspond to a valid encoding."""
    if isinstance(arg_0, bytes):
        try:
            arg_0 = arg_0.decode("ascii")
        except UnicodeDecodeError:
            return None
    if arg_0:
        arg_1 = ascii_punctuation_re.sub("", arg_0).lower()
        return encodings.get(arg_1, None)
    else:
        return None

Return the python codec name corresponding to an encoding or None if the string doesn t correspond to a valid encoding .


(self, breaks, labels=None, include_lowest=False, right=True, dig_lab=3)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
,
arg_4
=
True
,
arg_5
=
3
)
:
assert_is_type
(
arg_1
,
[
numeric
]
)
if
arg_0
.
ncols
!=
1
:
raise
H2OValueError
(
"Single-column frame is expected"
)
if
arg_0
.
types
[
arg_0
.
names
[
0
]
]
not
in
{
"int"
,
"real"
}
:
raise
H2OValueError
(
"A numeric column is expected"
)
arg_6
=
H2OFrame
.
_expr
(
expr
=
ExprNode
(
"Func"
,
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
,
cache
=
arg_0
.
_ex
.
_cache
)
arg_6
.
_ex
.
_cache
.
types
=
{
k
:
"enum"
for
k
in
arg_0
.
names
}
return
arg_6

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=True, arg_5=3):
        """
        Cut a numeric vector into categorical "buckets".

        This method is only applicable to a single-column numeric frame.

        :param List[float] breaks: The Func points in the numeric vector.
        :param List[str] labels: Labels for categorical levels produced. Defaults to set notation of
            intervals defined by the breaks.
        :param bool include_lowest: By default, Funcs are defined as intervals ``(lo, hi]``. If this parameter
            is True, then the interval becomes ``[lo, hi]``.
        :param bool right: Include the high value: ``(lo, hi]``. If False, get ``(lo, hi)``.
        :param int dig_lab: Number of digits following the decimal point to consider.

        :returns: Single-column H2OFrame of categorical data.
        """
        assert_is_type(arg_1, [numeric])
        if arg_0.ncols != 1: raise H2OValueError("Single-column frame is expected")
        if arg_0.types[arg_0.names[0]] not in {"int", "real"}: raise H2OValueError("A numeric column is expected")
        arg_6 = H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1, arg_2, arg_3, arg_4, arg_5),
                            cache=arg_0._ex._cache)
        arg_6._ex._cache.types = {k: "enum" for k in arg_0.names}
        return arg_6

Cut a numeric vector into categorical "buckets".

        This method is only applicable to a single-column numeric frame.

        :param List[float] breaks: The cut points in the numeric vector.
        :param List[str] labels: Labels for categorical levels produced. Defaults to set notation of
            intervals defined by the breaks.
        :param bool include_lowest: By default, cuts are defined as intervals ``(lo, hi]``. If this parameter
            is True, then the interval becomes ``[lo, hi]``.
        :param bool right: Include the high value: ``(lo, hi]``. If False, get ``(lo, hi)``.
        :param int dig_lab: Number of digits following the decimal point to consider.

        :returns: Single-column H2OFrame of categorical data.

Cut a numeric vector into categorical buckets .


def Func ( arg_0 , arg_1 = None , arg_2 = "=" , arg_3 = "\n" , arg_4 = True , arg_5 = None ) : arg_6 = "" if "record" in str ( type ( arg_0 ) ) : arg_7 = arg_0 . dtype . names else : arg_7 = arg_0 . keys ( ) if arg_4 : arg_7 = sorted ( arg_7 ) for arg_8 in arg_7 : if arg_8 [ 0 ] == "_" : continue if arg_1 : if not arg_8 in arg_1 : continue if arg_5 and arg_8 [ - len ( arg_5 ) ] == arg_5 : continue if 'float' in str ( type ( arg_0 [ arg_8 ] ) ) : arg_9 = "%.02f" % arg_0 [ arg_8 ] else : arg_9 = str ( arg_0 [ arg_8 ] ) if "object" in arg_9 : arg_9 = '<object>' arg_6 += arg_8 + arg_2 + arg_9 + arg_3 return arg_6 . strip ( )

def Func(arg_0,arg_1=None,arg_2="=",arg_3="\n",arg_4=True,arg_5=None):
    """convert a dictionary to a pretty formatted string."""
    arg_6=""
    if "record" in str(type(arg_0)):
        arg_7=arg_0.dtype.names
    else:
        arg_7=arg_0.keys()
    if arg_4:
        arg_7=sorted(arg_7)
    for arg_8 in arg_7:
        if arg_8[0]=="_":
            continue
        if arg_1:
            if not arg_8 in arg_1:
                continue
        if arg_5 and arg_8[-len(arg_5)]==arg_5:
            continue
        if 'float' in str(type(arg_0[arg_8])):
            arg_9="%.02f"%arg_0[arg_8]
        else:
            arg_9=str(arg_0[arg_8])
        if "object" in arg_9:
            arg_9='<object>'
        arg_6+=arg_8+arg_2+arg_9+arg_3
    return arg_6.strip()

convert a dictionary to a pretty formatted string .


def Func ( arg_0 ) : if arg_0 . _beating : arg_0 . _beating = False arg_0 . _hb_periodic_callback . stop ( ) if not arg_0 . hb_stream . closed ( ) : arg_0 . hb_stream . on_recv ( None )

def Func(arg_0):
        """Stop the heartbeating and cancel all related callbacks."""
        if arg_0._beating:
            arg_0._beating = False
            arg_0._hb_periodic_callback.stop()
            if not arg_0.hb_stream.closed():
                arg_0.hb_stream.on_recv(None)

Stop the heartbeating and cancel all related callbacks .


def Func ( arg_0 , arg_1 = None ) : assert_is_type ( arg_0 , str , [ str ] ) assert_is_type ( arg_1 , str , None ) arg_2 = [ arg_0 ] if is_type ( arg_0 , str ) else arg_0 return _import_multi ( arg_2 , arg_1 )

def Func(arg_0, arg_1=None):
    """
    Import a single file or collection of files.

    :param path: A path to a data file (remote or local).
    :param pattern: Character string containing a regular expression to match file(s) in the folder.
    :returns: either a :class:`H2OFrame` with the content of the provided file, or a list of such frames if
        importing multiple files.
    """
    assert_is_type(arg_0, str, [str])
    assert_is_type(arg_1, str, None)
    arg_2 = [arg_0] if is_type(arg_0, str) else arg_0
    return _import_multi(arg_2, arg_1)

Import a single file or collection of files .


'/*                         FIR Filter Coefficients                      */\n'

def Func(arg_0, arg_1):
    """
    Write FIR Fixed-Point Filter Header Files

    Mark Wickert February 2015
    """
    arg_2 = len(arg_1)
    arg_3 = int16(rint(arg_1 * 2 ** 15))
    arg_4 = 8  # Coefficients per line
    arg_5 = open(arg_0, 'wt')
    arg_5.write('//define a FIR coefficient Array\n\n')
    arg_5.write('#include <stdint.h>\n\n')
    arg_5.write('#ifndef M_FIR\n')
    arg_5.write('#define M_FIR %d\n' % arg_2)
    arg_5.write('#endif\n')
    arg_5.write('/************************************************************************/\n');
    arg_5.write('/*                         FIR Filter Coefficients                      */\n');
    arg_5.write('int16_t h_FIR[M_FIR] = {')
    arg_6 = 0;
    for arg_7 in range(arg_2):
        # k_mod = k % M
        if (arg_6 < arg_4 - 1) and (arg_7 < arg_2 - 1):
            arg_5.write('%5d,' % arg_3[arg_7])
            arg_6 += 1
        elif (arg_6 == arg_4 - 1) & (arg_7 < arg_2 - 1):
            arg_5.write('%5d,\n' % arg_3[arg_7])
            if arg_7 < arg_2:
                arg_5.write('                        ')
                arg_6 = 0
        else:
            arg_5.write('%5d' % arg_3[arg_7])
    arg_5.write('};\n')
    arg_5.write('/************************************************************************/\n')
    arg_5.close()

Write FIR Fixed - Point Filter Header Files Mark Wickert February 2015


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
traceback
.
print_exception
(
arg_0
,
arg_1
,
arg_2
)
from
IPython
.
core
.
interactiveshell
import
InteractiveShell
if
InteractiveShell
.
initialized
(
)
:
arg_3
=
"%config "
else
:
arg_3
=
"c."
print
>>
sys
.
stderr
,
_lite_message_template
.
format
(
email
=
author_email
,
arg_3
=
arg_3
)

def Func(arg_0, arg_1, arg_2):
    """a light excepthook, adding a small message to the usual traceback"""
    traceback.print_exception(arg_0, arg_1, arg_2)

    from IPython.core.interactiveshell import InteractiveShell
    if InteractiveShell.initialized():
        # we are in a Shell environment, give %magic example
        arg_3 = "%config "
    else:
        # we are not in a shell, show generic config
        arg_3 = "c."
    print >> sys.stderr, _lite_message_template.format(email=author_email, arg_3=arg_3)

a light excepthook adding a small message to the usual traceback


(self, document_id, database_name=None, collection_name=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
)
:
if
arg_1
is
:
raise
AirflowBadRequest
(
"Cannot get a document without an id"
)
try
:
return
arg_0
.
get_conn
(
)
.
ReadItem
(
Func_link
(
arg_0
.
__get_database_name
(
arg_2
)
,
arg_0
.
__get_collection_name
(
arg_3
)
,
arg_1
)
)
except
HTTPFailure
:
return

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Get a document from an existing collection in the CosmosDB database.
        """
        if arg_1 is None:
            raise AirflowBadRequest("Cannot get a document without an id")

        try:
            return arg_0.get_conn().ReadItem(
                Func_link(
                    arg_0.__get_database_name(arg_2),
                    arg_0.__get_collection_name(arg_3),
                    arg_1))
        except HTTPFailure:
            return None

Get a document from an existing collection in the CosmosDB database .


def Func ( arg_0 ) : try : arg_1 = arg_0 . astype ( 'float' ) if ( arg_1 < sys . maxsize ) . all ( ) and ( arg_1 % 1 ) . sum ( ) == 0 : return arg_1 . astype ( 'int' ) else : return arg_1 except ValueError : return arg_0

def Func(arg_0):
    """
    Attempts to return a numpy array converted to the most sensible dtype
    Value errors will be caught and simply return the original array
    Tries to make dtype int, then float, then no change
    """
    try:
        arg_1 = arg_0.astype('float')
        if (arg_1 < sys.maxsize).all() and (arg_1 % 1).sum() == 0:
            return arg_1.astype('int')
        else:
            return arg_1
    except ValueError:
        return arg_0

Attempts to return a numpy array converted to the most sensible dtype Value errors will be caught and simply return the original array Tries to make dtype int then float then no change


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( "AttributeError" , "Exception" , "BaseException" ) for arg_4 , arg_5 in arg_2 . items ( ) : try : arg_1 . local_attr ( arg_4 ) continue except astroid . NotFoundError : pass try : next ( arg_1 . instance_attr_ancestors ( arg_4 ) ) continue except StopIteration : pass try : arg_6 = arg_1 . instance_attr ( arg_4 ) except astroid . NotFoundError : pass else : arg_6 = [ stmt for stmt in arg_6 if stmt not in arg_5 ] if not arg_6 : continue arg_7 = arg_6 [ 0 ] . scope ( ) arg_6 = [ stmt for i , stmt in enumerate ( arg_6 ) if i == 0 or stmt . scope ( ) is not arg_7 ] if len ( arg_6 ) == 1 : arg_8 = arg_6 [ 0 ] arg_9 = arg_8 . frame ( ) arg_10 = arg_8 . fromlineno for arg_11 in arg_5 : if ( arg_11 . frame ( ) is arg_9 and arg_11 . fromlineno < arg_10 and not astroid . are_exclusive ( arg_11 . statement ( ) , arg_8 , arg_3 ) ) : arg_0 . add_message ( "access-member-before-definition" , arg_1 = arg_11 , args = ( arg_4 , arg_10 ) , )

def Func(arg_0, arg_1, arg_2):
        """check that accessed members are defined"""
        # XXX refactor, probably much simpler now that E0201 is in type checker
        arg_3 = ("AttributeError", "Exception", "BaseException")
        for arg_4, arg_5 in arg_2.items():
            try:
                # is it a class attribute ?
                arg_1.local_attr(arg_4)
                # yes, stop here
                continue
            except astroid.NotFoundError:
                pass
            # is it an instance attribute of a parent class ?
            try:
                next(arg_1.instance_attr_ancestors(arg_4))
                # yes, stop here
                continue
            except StopIteration:
                pass
            # is it an instance attribute ?
            try:
                arg_6 = arg_1.instance_attr(arg_4)
            except astroid.NotFoundError:
                pass
            else:
                # filter out augment assignment nodes
                arg_6 = [stmt for stmt in arg_6 if stmt not in arg_5]
                if not arg_6:
                    # only augment assignment for this node, no-member should be
                    # triggered by the typecheck checker
                    continue
                # filter defstmts to only pick the first one when there are
                # several assignments in the same scope
                arg_7 = arg_6[0].scope()
                arg_6 = [
                    stmt
                    for i, stmt in enumerate(arg_6)
                    if i == 0 or stmt.scope() is not arg_7
                ]
                # if there are still more than one, don't attempt to be smarter
                # than we can be
                if len(arg_6) == 1:
                    arg_8 = arg_6[0]
                    # check that if the node is accessed in the same method as
                    # it's defined, it's accessed after the initial assignment
                    arg_9 = arg_8.frame()
                    arg_10 = arg_8.fromlineno
                    for arg_11 in arg_5:
                        if (
                            arg_11.frame() is arg_9
                            and arg_11.fromlineno < arg_10
                            and not astroid.are_exclusive(
                                arg_11.statement(), arg_8, arg_3
                            )
                        ):
                            arg_0.add_message(
                                "access-member-before-definition",
                                arg_1=arg_11,
                                args=(arg_4, arg_10),
                            )


def Func ( arg_0 ) : arg_0 . _url = arg_0 . form_url ( ) if arg_0 . _headers is not None : logging . debug ( arg_0 . _headers ) if arg_0 . _data is not None : logging . debug ( arg_0 . _data ) if len ( arg_0 . _get_url_parameters ( ) ) > 0 : logging . debug ( arg_0 . _get_url_parameters ( ) ) arg_2 = arg_0 . _methods [ arg_0 . _method ] ( ) if not arg_0 . good_response ( arg_2 . status_code ) : logging . error ( arg_0 . _url ) logging . error ( arg_0 . _method ) if arg_0 . _data is not None : logging . error ( arg_0 . _data ) logging . error ( arg_2 ) arg_0 . _api_result = arg_2

def Func(arg_0):
        """
        Make an API call to get the metric definition
        """

        arg_0._url = arg_0.form_url()
        if arg_0._headers is not None:
            logging.debug(arg_0._headers)
        if arg_0._data is not None:
            logging.debug(arg_0._data)
        if len(arg_0._get_url_parameters()) > 0:
            logging.debug(arg_0._get_url_parameters())

        arg_2 = arg_0._methods[arg_0._method]()

        if not arg_0.good_response(arg_2.status_code):
            logging.error(arg_0._url)
            logging.error(arg_0._method)
            if arg_0._data is not None:
                logging.error(arg_0._data)
            logging.error(arg_2)
        arg_0._api_result = arg_2


return optdict.get("dest", opt.replace("-", "_"))

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 . get_option_def ( arg_1 ) return arg_2 . get ( "dest" , arg_1 . replace ( "-" , "_" ) )

def Func(arg_0, arg_1, arg_2=None):
        """get the config attribute corresponding to opt"""
        if arg_2 is None:
            arg_2 = arg_0.get_option_def(arg_1)
        return arg_2.get("dest", arg_1.replace("-", "_"))


def Func ( arg_0 , arg_1 ) : del arg_0 . variables [ arg_1 ] arg_0 . signal_variable_changed . emit ( arg_0 , arg_1 , "delete" )

def Func(arg_0, arg_1):
        """Deletes a variable from a DataFrame."""
        del arg_0.variables[arg_1]
        arg_0.signal_variable_changed.emit(arg_0, arg_1, "delete")


return self.pool.map(_Pool_starworker, self._handle_batch_ids(batches), chunksize=chunksize)

def Func(arg_0, arg_1, arg_2=None):
        """
        Augment batches.

        Parameters
        ----------
        batches : list of imgaug.augmentables.batches.Batch
            The batches to augment.

        chunksize : None or int, optional
            Rough indicator of how many tasks should be sent to each worker. Increasing this number can improve
            performance.

        Returns
        -------
        list of imgaug.augmentables.batches.Batch
            Augmented batches.

        """
        assert isinstance(arg_1, list), ("Expected to get a list as 'batches', got type %s. "
                                           + "Call iFunc() if you use generators.") % (type(arg_1),)
        return arg_0.pool.map(_Pool_starworker, arg_0._handle_batch_ids(arg_1), arg_2=arg_2)


def Func(arg_0):
    """
    Decode geohash, returning two strings with latitude and longitude
    containing only relevant digits and with trailing zeroes removed.
    """
    arg_1, arg_2, arg_3, arg_4 = Func_exactly(arg_0)
    # Format to the number of decimals that are known
    arg_5 = "%.*f" % (max(1, int(round(-log10(arg_3)))) - 1, arg_1)
    arg_6 = "%.*f" % (max(1, int(round(-log10(arg_4)))) - 1, arg_2)
    if '.' in arg_5: arg_5 = arg_5.rstrip('0')
    if '.' in arg_6: arg_6 = arg_6.rstrip('0')
    return arg_5, arg_6

Decode geohash returning two strings with latitude and longitude containing only relevant digits and with trailing zeroes removed .


def Func(arg_0, arg_1, arg_2):
        """
        Given a module-like object that defines a type, add it to our type system so that
        it can be used with the iotile tool and with other annotated API functions.
        """

        arg_1 = arg_0._canonicalize_type(arg_1)
        arg_3, arg_4, arg_3 = arg_0.split_type(arg_1)

        if arg_0.is_known_type(arg_1):
            raise ArgumentError("attempting to inject a type that is already defined", type=arg_1)

        if (not arg_4) and arg_0._is_factory(arg_2):
            if arg_1 in arg_0.type_factories:
                raise ArgumentError("attempted to inject a complex type factory that is already defined", type=arg_1)
            arg_0.type_factories[arg_1] = arg_2
        else:
            arg_0._validate_type(arg_2)
            arg_0.known_types[arg_1] = arg_2

        if not hasattr(arg_2, "default_formatter"):
            raise ArgumentError("type is invalid, does not have default_formatter function", type=arg_2, methods=dir(arg_2))

Given a module - like object that defines a type add it to our type system so that it can be used with the iotile tool and with other annotated API functions .


def Func ( arg_0 , arg_1 ) : arg_2 = ( 'verbose_name' , 'help_text' , 'default' ) for arg_3 in arg_2 : setattr ( arg_0 , arg_3 , getattr ( arg_1 , arg_3 ) )

def Func(arg_0, arg_1):
    """Updates field object with data from a PrefProxy object.

    :param models.Field field_obj:

    :param PrefProxy pref_proxy:

    """
    arg_2 = ('verbose_name', 'help_text', 'default')

    for arg_3 in arg_2:
        setattr(arg_0, arg_3, getattr(arg_1, arg_3))

Updates field object with data from a PrefProxy object .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_1 = _prepare_path ( arg_1 , "png" ) arg_0 . driver . Func ( arg_1 , ** arg_2 ) return arg_1

def Func(arg_0, arg_1=None, **arg_2):
        """
        Save a screenshot of the page.

        If invoked without arguments, it will save a file to :data:`capybara.save_path` and the
        file will be given a randomly generated filename. If invoked with a relative path, the path
        will be relative to :data:`capybara.save_path`.

        Args:
            path (str, optional): The path to where it should be saved.
            **kwargs: Arbitrary keywords arguments for the driver.

        Returns:
            str: The path to which the file was saved.
        """

        arg_1 = _prepare_path(arg_1, "png")
        arg_0.driver.Func(arg_1, **arg_2)
        return arg_1


(self, method, url, extra_headers={}, body_producer=None, full_url=False)

def Func(arg_0, arg_1, arg_2, arg_3={}, arg_4=None, arg_5=False):
        """ Build a request for twisted

        Args:
            method (str): Request method (GET/POST/PUT/DELETE/etc.) If not specified, it will be POST if post_data is not None
            url (str): Destination URL (full, or relative)

        Kwargs:
            extra_headers (dict): Headers (override default connection headers, if any)
            body_producer (:class:`twisted.web.iweb.IBodyProducer`): Object producing request body
            full_url (bool): If False, URL is relative

        Returns:
            tuple. Tuple with two elements: reactor, and request
        """
        arg_6 = arg_2 if arg_5 else arg_0._url(arg_2)

        arg_7 = arg_0.get_headers()
        if arg_3:
            arg_7.update(arg_3)

        arg_8 = http_headers.Headers()
        for arg_9 in arg_7:
            arg_8.addRawHeader(arg_9, arg_7[arg_9])

        arg_10 = client.Agent(reactor)
        arg_11 = arg_10.request(arg_1, arg_6, arg_8, arg_4)

        return (reactor, arg_11)


return default_timezone if not locale_code[0] else \
        str(pytz.country_timezones[locale_code[0][-2:]][0])

def Func ( ) : arg_0 = 'America/New_York' arg_1 = locale . getdefaultlocale ( ) return arg_0 if not arg_1 [ 0 ] else str ( pytz . country_timezones [ arg_1 [ 0 ] [ - 2 : ] ] [ 0 ] )

def Func():
    '''
    Get timezone as set by the system
    '''
    arg_0 = 'America/New_York'
    arg_1 = locale.getdefaultlocale()
    return arg_0 if not arg_1[0] else \
        str(pytz.country_timezones[arg_1[0][-2:]][0])


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
defaultdict
(
list
)
for
arg_4
in
arg_1
.
get_all
(
arg_2
)
:
arg_5
=
EXTRA_RE
.
search
(
arg_4
)
if
arg_5
:
arg_6
=
arg_5
.
groupdict
(
)
arg_7
=
arg_6
[
'condition'
]
arg_8
=
arg_6
[
'extra'
]
arg_9
=
arg_6
[
'package'
]
if
arg_7
.
endswith
(
' and '
)
:
arg_7
=
arg_7
[
:
5
]
else
:
arg_7
,
arg_8
=
,
arg_9
=
arg_4
arg_2
=
MayRequiresKey
(
arg_7
,
arg_8
)
arg_3
[
arg_2
]
.
append
(
arg_9
)
if
arg_3
:
arg_0
[
'run_requires'
]
=
[
]
for
arg_2
,
arg_4
in
arg_3
.
items
(
)
:
arg_10
=
{
'requires'
:
arg_4
}
if
arg_2
.
extra
:
arg_10
[
'extra'
]
=
arg_2
.
extra
if
arg_2
.
condition
:
arg_10
[
'environment'
]
=
arg_2
.
condition
arg_0
[
'run_requires'
]
.
append
(
arg_10
)
if
not
'extras'
in
arg_0
:
arg_0
[
'extras'
]
=
[
]
arg_0
[
'extras'
]
.
extend
(
[
arg_2
.
extra
for
arg_2
in
arg_3
.
keys
(
)
if
arg_2
.
extra
]
)

def Func(arg_0, arg_1, arg_2):
    """
    Place the runtime requirements from pkg_info into metadata.
    """
    arg_3 = defaultdict(list)
    for arg_4 in arg_1.get_all(arg_2):
        arg_5 = EXTRA_RE.search(arg_4)
        if arg_5:
            arg_6 = arg_5.groupdict()
            arg_7 = arg_6['condition']
            arg_8 = arg_6['extra']
            arg_9 = arg_6['package']
            if arg_7.endswith(' and '):
                arg_7 = arg_7[:-5]
        else:
            arg_7, arg_8 = None, None
            arg_9 = arg_4
        arg_2 = MayRequiresKey(arg_7, arg_8)
        arg_3[arg_2].append(arg_9)

    if arg_3:
        arg_0['run_requires'] = []
        for arg_2, arg_4 in arg_3.items():
            arg_10 = {'requires':arg_4}
            if arg_2.extra:
                arg_10['extra'] = arg_2.extra
            if arg_2.condition:
                arg_10['environment'] = arg_2.condition
            arg_0['run_requires'].append(arg_10)

        if not 'extras' in arg_0:
            arg_0['extras'] = []
        arg_0['extras'].extend([arg_2.extra for arg_2 in arg_3.keys() if arg_2.extra])

Place the runtime requirements from pkg_info into metadata .


return self.request(path, method, call_params)

def Func ( arg_0 , arg_1 ) : arg_2 = '/' + arg_0 . api_version + '/ConferenceKick/' arg_3 = 'POST' return arg_0 . request ( arg_2 , arg_3 , arg_1 )

def Func(arg_0, arg_1):
        """REST Conference Kick helper
        """
        arg_2 = '/' + arg_0.api_version + '/ConferenceKick/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def Func(arg_0, arg_1):
        """
        Validate that all required type methods are implemented.

        At minimum a type must have:
        - a convert() or convert_binary() function
        - a default_formatter() function

        Raises an ArgumentError if the type is not valid
        """

        if not (hasattr(arg_1, "convert") or hasattr(arg_1, "convert_binary")):
            raise ArgumentError("type is invalid, does not have convert or convert_binary function", type=arg_1, methods=dir(arg_1))

        if not hasattr(arg_1, "default_formatter"):
            raise ArgumentError("type is invalid, does not have default_formatter function", type=arg_1, methods=dir(arg_1))

Validate that all required type methods are implemented .


def Func(arg_0, arg_1):
    """
    Drops the historical sap_success_factors table named herein.
    """
    arg_2 = 'sap_success_factors_historicalsapsuccessfactorsenterprisecus80ad'
    if arg_2 in connection.introspection.table_names():
        migrations.DeleteModel(
            name=arg_2,
        )

Drops the historical sap_success_factors table named herein .