def Func(arg_0, arg_1):
  """
  Given a timestamp string, return a time stamp in the epoch ms format. If no date is present in
  timestamp then today's date will be added as a prefix before conversion to epoch ms
  """
  if not arg_0:
    return None
  if arg_0 == 'now':
    arg_0 = str(datetime.datetime.now())
  if not arg_1:
    arg_1 = detect_timestamp_format(arg_0)
  try:
    if arg_1 == 'unknown':
      logger.error('Unable to determine timestamp format for : %s', arg_0)
      return -1
    elif arg_1 == 'epoch':
      arg_2 = int(arg_0) * 1000
    elif arg_1 == 'epoch_ms':
      arg_2 = arg_0
    elif arg_1 == 'epoch_fraction':
      arg_2 = int(arg_0[:10]) * 1000 + int(arg_0[11:])
    elif arg_1 in ('%H:%M:%S', '%H:%M:%S.%f'):
      arg_3 = str(datetime.date.today())
      arg_4 = datetime.datetime.strptime(arg_3 + ' ' + arg_0, '%Y-%m-%d ' + arg_1)
      arg_2 = calendar.timegm(arg_4.utctimetuple()) * 1000 + arg_4.microsecond / 1000
    else:
      arg_4 = datetime.datetime.strptime(arg_0, arg_1)
      arg_2 = calendar.timegm(arg_4.utctimetuple()) * 1000 + arg_4.microsecond / 1000
  except ValueError:
    return -1
  return str(arg_2)

Given a timestamp string return a time stamp in the epoch ms format . If no date is present in timestamp then today s date will be added as a prefix before conversion to epoch ms


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
,
arg_3
,
arg_4
in
_iterate_managers
(
arg_0
,
arg_1
)
:
click
.
secho
(
f'Funcping {name}'
,
fg
=
'cyan'
,
bold
=
True
)
arg_4
.
Func_all
(
)

def Func(arg_0, arg_1):
    """Drop all."""
    for arg_2, arg_3, arg_4 in _iterate_managers(arg_0, arg_1):
        click.secho(f'Funcping {name}', fg='cyan', bold=True)
        arg_4.Func_all()


def
Func
(
arg_0
,
arg_1
,
arg_2
=
0
)
:
plt
.
figure
(
figsize
=
(
6
,
4
)
)
arg_3
=
np
.
arange
(
0
,
arg_1
+
1
)
plt
.
plot
(
arg_3
,
arg_0
[
arg_2
:
arg_2
+
arg_1
+
1
]
,
'b'
)
arg_4
=
int
(
(
len
(
arg_0
)
arg_2
)
/
arg_1
)
1
for
arg_5
in
range
(
1
,
arg_4
)
:
plt
.
plot
(
arg_3
,
arg_0
[
arg_2
+
arg_5
*
arg_1
:
arg_2
+
arg_1
+
1
+
arg_5
*
arg_1
]
,
'b'
)
plt
.
grid
(
)
plt
.
xlabel
(
'Time Index - n'
)
plt
.
ylabel
(
'Amplitude'
)
plt
.
title
(
'Eye Plot'
)
return
0

def Func(arg_0,arg_1,arg_2=0):
    """
    Eye pattern plot of a baseband digital communications waveform.

    The signal must be real, but can be multivalued in terms of the underlying
    modulation scheme. Used for BPSK eye plots in the Case Study article.

    Parameters
    ----------
    x : ndarray of the real input data vector/array
    L : display length in samples (usually two symbols)
    S : start index

    Returns
    -------
    None : A plot window opens containing the eye plot

    Notes
    -----
    Increase S to eliminate filter transients.

    Examples
    --------
    1000 bits at 10 samples per bit with 'rc' shaping.

    >>> import matplotlib.pyplot as plt
    >>> from sk_dsp_comm import digitalcom as dc
    >>> x,b, data = dc.NRZ_bits(1000,10,'rc')
    >>> dc.Func(x,20,60)
    >>> plt.show()
    """
    plt.figure(figsize=(6,4))
    arg_3 = np.arange(0,arg_1+1)
    plt.plot(arg_3,arg_0[arg_2:arg_2+arg_1+1],'b')
    arg_4 = int((len(arg_0) - arg_2)/arg_1)-1
    for arg_5 in range(1,arg_4):
         plt.plot(arg_3,arg_0[arg_2+arg_5*arg_1:arg_2+arg_1+1+arg_5*arg_1],'b')
    plt.grid()
    plt.xlabel('Time Index - n')
    plt.ylabel('Amplitude')
    plt.title('Eye Plot')
    return 0

Eye pattern plot of a baseband digital communications waveform.

    The signal must be real, but can be multivalued in terms of the underlying
    modulation scheme. Used for BPSK eye plots in the Case Study article.

    Parameters
    ----------
    x : ndarray of the real input data vector/array
    L : display length in samples (usually two symbols)
    S : start index

    Returns
    -------
    None : A plot window opens containing the eye plot

    Notes
    -----
    Increase S to eliminate filter transients.

    Examples
    --------
    1000 bits at 10 samples per bit with 'rc' shaping.

    >>> import matplotlib.pyplot as plt
    >>> from sk_dsp_comm import digitalcom as dc
    >>> x,b, data = dc.NRZ_bits(1000,10,'rc')
    >>> dc.eye_plot(x,20,60)
    >>> plt.show()

Eye pattern plot of a baseband digital communications waveform .


(self, datacenter_id,
                             loadbalancer_id, nic_id, depth=1)

def Func(arg_0, arg_1,
                             arg_2, arg_3, arg_4=1):
        """
        Gets the properties of a load balanced NIC.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      loadbalancer_id: The unique ID of the load balancer.
        :type       loadbalancer_id: ``str``

        :param      nic_id: The unique ID of the NIC.
        :type       nic_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_5 = arg_0._perform_request(
            '/datacenters/%s/loadbalancers/%s/balancednics/%s?depth=%s' % (
                arg_1,
                arg_2,
                arg_3,
                str(arg_4)))

        return arg_5

Gets the properties of a load balanced NIC .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , wx . Frame ) : arg_2 = wx . ClientDisplayRect ( ) [ 2 : ] arg_3 , arg_4 = arg_1 . ClientToScreenXY ( 0 , 0 ) arg_5 , arg_6 = arg_1 . ClientToScreenXY ( * arg_1 . GetClientRect ( ) [ 2 : ] ) arg_7 = arg_0 . GetSize ( ) arg_8 = arg_5 arg_9 = arg_6 - arg_7 [ 1 ] arg_0 . SetPosition ( ( arg_8 , arg_9 ) ) else : STT . ToolTipWindow . Func ( arg_0 , arg_1 )

def Func(arg_0,arg_1):
        "When dealing with a Top-Level window position it absolute lower-right"
        if isinstance(arg_1, wx.Frame):
            arg_2 = wx.ClientDisplayRect()[2:]
            arg_3,arg_4 = arg_1.ClientToScreenXY(0,0)
            arg_5,arg_6 = arg_1.ClientToScreenXY(*arg_1.GetClientRect()[2:])
            arg_7 = arg_0.GetSize()
            arg_8 = arg_5
            arg_9 = arg_6 - arg_7[1]
            arg_0.SetPosition((arg_8,arg_9))
        else:
            STT.ToolTipWindow.Func(arg_0, arg_1)

When dealing with a Top - Level window position it absolute lower - right


def Func ( arg_0 , arg_1 ) : if arg_0 . strict : arg_2 = arg_0 . prog . match ( arg_1 ) if arg_2 : arg_3 = arg_2 . group ( ) if arg_3 in arg_0 : return arg_3 else : arg_4 = arg_0 . prog . findall ( arg_1 ) for arg_5 in arg_4 : if arg_5 in arg_0 : return arg_5

def Func(arg_0, arg_1):
        """
            Analyze the text to get the right function

        Parameters
        ----------
        text : str
            The text that could call a function
        """
        if arg_0.strict:
            arg_2 = arg_0.prog.match(arg_1)
            if arg_2:
                arg_3 = arg_2.group()
                if arg_3 in arg_0:
                    return arg_3
        else:
            arg_4 = arg_0.prog.findall(arg_1)
            for arg_5 in arg_4:
                if arg_5 in arg_0:
                    return arg_5


(script, function='(q < 0)', strict_face_select=True)

def Func(arg_0, arg_1='(q < 0)', arg_2=True):
    """Boolean function using muparser lib to perform vertex selection over current mesh.

    See help(mlx.muparser_ref) for muparser reference documentation.

    It's possible to use parenthesis, per-vertex variables and boolean operator:
        (, ), and, or, <, >, =
    It's possible to use the following per-vertex variables in the expression:

    Variables:
        x, y, z (coordinates)
        nx, ny, nz (normal)
        r, g, b, a (color)
        q (quality)
        rad
        vi (vertex index)
        vtu, vtv (texture coordinates)
        ti (texture index)
        vsel (is the vertex selected? 1 yes, 0 no)
        and all custom vertex attributes already defined by user.

    Args:
        script: the FilterScript object or script filename to write
            the filter] to.
        function (str): a boolean function that will be evaluated in order
            to select a subset of vertices. Example: (y > 0) and (ny > 0)
        strict_face_select (bool): if True a face is selected if ALL its
            vertices are selected. If False a face is selected if at least
            one of its vertices is selected. ML v1.3.4BETA only; this is
            ignored in 2016.12. In 2016.12 only vertices are selected.

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    if arg_0.ml_version == '1.3.4BETA':
        arg_3 = ''.join([
            '    <Param name="strictSelect" ',
            'value="{}" '.format(str(arg_2).lower()),
            'description="Strict face selection" ',
            'type="RichBool" ',
            '/>\n',
            ])
    else:
        arg_3 = ''

    arg_4 = ''.join([
        '  <filter name="Conditional Vertex Selection">\n',
        '    <Param name="condSelect" ',
        'value="{}" '.format(str(arg_1).replace('&', '&').replace('<', '<')),
        'description="boolean function" ',
        'type="RichString" ',
        '/>\n',
        arg_3,
        '  </filter>\n'])
    util.write_filter(arg_0, arg_4)
    return None

Boolean function using muparser lib to perform vertex selection over current mesh .


def Func(arg_0, arg_1: arg_2) -> None:
        """Convert to another list type by replacing starting pattern."""
        arg_3 = arg_0._match
        arg_4 = arg_3.start()
        for arg_5, arg_6 in reversed(arg_3.spans('pattern')):
            arg_0[arg_5 - arg_4:arg_6 - arg_4] = arg_1
        arg_0.pattern = escape(arg_1)

Convert to another list type by replacing starting pattern .


return self._publish( self.args, self.server, self.URI)

def Func ( arg_0 ) : return arg_0 . _Func ( arg_0 . args , arg_0 . server , arg_0 . URI )

def Func(arg_0):
      '''
      Perform HTTP session to transmit defined weather values.
      '''
      return arg_0._Func( arg_0.args, arg_0.server, arg_0.URI)

Perform HTTP session to transmit defined weather values .


(volatility_parts,
                                state_parts)

return [v + tf.zeros_like(sp, dtype=sp.dtype.base_dtype)
          for v, sp in zip(volatility_parts, state_parts)]

def Func ( arg_0 , arg_1 ) : return [ arg_2 + tf . zeros_like ( arg_3 , dtype = arg_3 . dtype . base_dtype ) for arg_2 , arg_3 in zip ( arg_0 , arg_1 ) ]

def Func(arg_0,
                                arg_1):
  """Helper to broadcast `volatility_parts` to the shape of `state_parts`."""
  return [arg_2 + tf.zeros_like(arg_3, dtype=arg_3.dtype.base_dtype)
          for arg_2, arg_3 in zip(arg_0, arg_1)]

Helper to broadcast volatility_parts to the shape of state_parts .


def Func ( ) : context . configure ( url = neutron_config . database . connection ) with context . begin_transaction ( ) : context . run_migrations ( )

def Func():
    """Run migrations in 'offline' mode.

    This configures the context with just a URL
    and not an Engine, though an Engine is acceptable
    here as well.  By skipping the Engine creation
    we don't even need a DBAPI to be available.

    Calls to context.execute() here emit the given string to the
    script output.

    """
    context.configure(url=neutron_config.database.connection)

    with context.begin_transaction():
        context.run_migrations()


(self, updates_ids, offset=None, utc=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    '''
      Edit the order at which statuses for the specified social media profile will
      be sent out of the buffer.
    '''

    arg_4 = PATHS['REORDER'] % arg_0.profile_id

    arg_5 = "order[]=%s&"
    arg_6 = ''

    if arg_2:
      arg_6 += 'offset=%s&' % arg_2

    if arg_3:
      arg_6 += 'utc=%s&' % arg_3

    for arg_7 in arg_1:
      arg_6 += arg_5 % arg_7

    return arg_0.api.post(arg_4=arg_4, data=arg_6)

Edit the order at which statuses for the specified social media profile will be sent out of the buffer .


return arr.swapaxes(0, 1).reshape(s[0] * s[1], *s[2:])

def Func ( arg_0 ) : arg_1 = arg_0 . shape return arg_0 . swapaxes ( 0 , 1 ) . reshape ( arg_1 [ 0 ] * arg_1 [ 1 ] , * arg_1 [ 2 : ] )

def Func(arg_0):
    """
    swap and then flatten axes 0 and 1
    """
    arg_1 = arg_0.shape
    return arg_0.swapaxes(0, 1).reshape(arg_1[0] * arg_1[1], *arg_1[2:])


def Func(arg_0, arg_1, arg_2):
        """Add classical control on register classical and value val."""
        if not isinstance(arg_1, ClassicalRegister):
            raise QiskitError("Func must be used with a classical register")
        if arg_2 < 0:
            raise QiskitError("control value should be non-negative")
        arg_0.control = (arg_1, arg_2)
        return arg_0

Add classical control on register classical and value val .


(y, sr=22050, hop_length=512, fmin=None, n_bins=84,
               bins_per_octave=12, tuning=0.0, filter_scale=1,
               norm=1, sparsity=0.01, window='hann', scale=True,
               pad_mode='reflect')

def Func(arg_0, arg_1=22050, arg_2=512, arg_3=None, arg_4=84,
               arg_5=12, arg_6=0.0, arg_7=1,
               arg_8=1, arg_9=0.01, arg_10='hann', arg_11=True,
               arg_12='reflect'):
    '''Compute the pseudo constant-Q transform of an audio signal.

    This uses a single fft size that is the smallest power of 2 that is greater
    than or equal to the max of:

        1. The longest CQT filter
        2. 2x the hop_length

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        audio time series

    sr : number > 0 [scalar]
        sampling rate of `y`

    hop_length : int > 0 [scalar]
        number of samples between successive CQT columns.

    fmin : float > 0 [scalar]
        Minimum frequency. Defaults to C1 ~= 32.70 Hz

    n_bins : int > 0 [scalar]
        Number of frequency bins, starting at `fmin`

    bins_per_octave : int > 0 [scalar]
        Number of bins per octave

    tuning : None or float in `[-0.5, 0.5)`
        Tuning offset in fractions of a bin (cents).

        If `None`, tuning will be automatically estimated from the signal.

    filter_scale : float > 0
        Filter filter_scale factor. Larger values use longer windows.

    sparsity : float in [0, 1)
        Sparsify the CQT basis by discarding up to `sparsity`
        fraction of the energy in each basis.

        Set `sparsity=0` to disable sparsification.

    window : str, tuple, number, or function
        Window specification for the basis filters.
        See `filters.get_window` for details.

    pad_mode : string
        Padding mode for centered frame analysis.

        See also: `librosa.core.stft` and `np.pad`.

    Returns
    -------
    CQT : np.ndarray [shape=(n_bins, t), dtype=np.float]
        Pseudo Constant-Q energy for each frequency at each time.

    Raises
    ------
    ParameterError
        If `hop_length` is not an integer multiple of
        `2**(n_bins / bins_per_octave)`

        Or if `y` is too short to support the frequency range of the CQT.

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

    '''

    if arg_3 is None:
        # C1 by default
        arg_3 = note_to_hz('C1')

    if arg_6 is None:
        arg_6 = estimate_tuning(arg_0=arg_0, arg_1=arg_1)

    arg_13, arg_14, arg_15 = __cqt_filter_fft(arg_1, arg_3, arg_4,
                                           arg_5,
                                           arg_6, arg_7,
                                           arg_8, arg_9,
                                           arg_2=arg_2,
                                           arg_10=arg_10)

    arg_13 = np.abs(arg_13)

    # Compute the magnitude STFT with Hann window
    arg_16 = np.abs(stft(arg_0, arg_14=arg_14, arg_2=arg_2, arg_12=arg_12))

    # Project onto the pseudo-cqt basis
    arg_17 = arg_13.dot(arg_16)

    if arg_11:
        arg_17 /= np.sqrt(arg_14)
    else:
        arg_18 = filters.constant_q_lengths(arg_1, arg_3,
                                             arg_4=arg_4,
                                             arg_5=arg_5,
                                             arg_6=arg_6,
                                             arg_10=arg_10,
                                             arg_7=arg_7)

        arg_17 *= np.sqrt(arg_18[:, np.newaxis] / arg_14)

    return arg_17

Compute the pseudo constant - Q transform of an audio signal .


def Func(arg_0, arg_1):
		'''
			Func - Delete multiple objects

			@param objs - List of objects

			@return - Number of objects deleted
		'''
		arg_2 = arg_0._get_connection()
		arg_3 = arg_2.pipeline()

		arg_4 = 0

		for arg_5 in arg_1:
			arg_4 += arg_0.deleteOne(arg_5, arg_3)

		arg_3.execute()

		return arg_4

deleteMultiple - Delete multiple objects

			@param objs - List of objects

			@return - Number of objects deleted


(self, i, r, summarize=False, context=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = None ) : for arg_5 , arg_6 in arg_0 . _header_checks : if tuple ( arg_2 ) != arg_0 . _field_names : arg_7 = { 'code' : arg_5 } if not arg_3 : arg_7 [ 'message' ] = arg_6 arg_7 [ 'row' ] = arg_1 + 1 arg_7 [ 'record' ] = tuple ( arg_2 ) arg_7 [ 'missing' ] = set ( arg_0 . _field_names ) - set ( arg_2 ) arg_7 [ 'unexpected' ] = set ( arg_2 ) - set ( arg_0 . _field_names ) if arg_4 is not None : arg_7 [ 'context' ] = arg_4 yield arg_7

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=None):
        """Apply header checks on the given record `r`."""

        for arg_5, arg_6 in arg_0._header_checks:
            if tuple(arg_2) != arg_0._field_names:
                arg_7 = {'code': arg_5}
                if not arg_3:
                    arg_7['message'] = arg_6
                    arg_7['row'] = arg_1 + 1
                    arg_7['record'] = tuple(arg_2)
                    arg_7['missing'] = set(arg_0._field_names) - set(arg_2)
                    arg_7['unexpected'] = set(arg_2) - set(arg_0._field_names)
                    if arg_4 is not None: arg_7['context'] = arg_4
                yield arg_7

Apply header checks on the given record r .


def Func(arg_0):
        """
        return ammo generator
        """
        arg_1 = {
            'phantom': missile.AmmoFileReader,
            'slowlog': missile.SlowLogReader,
            'line': missile.LineReader,
            'uri': missile.UriReader,
            'uripost': missile.UriPostReader,
            'access': missile.AccessLogReader,
            'caseline': missile.CaseLineReader,
        }
        if arg_0.uris and arg_0.ammo_file:
            raise StepperConfigurationError(
                'Both uris and ammo file specified. You must specify only one of them'
            )
        elif arg_0.uris:
            arg_2 = missile.UriStyleGenerator(
                arg_0.uris, arg_0.headers, http_ver=arg_0.http_ver)
        elif arg_0.ammo_file:
            if arg_0.ammo_type in arg_1:
                if arg_0.ammo_type == 'phantom':
                    arg_3 = resource.get_opener(arg_0.ammo_file)
                    with arg_3(arg_0.use_cache) as ammo:
                        try:
                            if not ammo.next()[0].isdigit():
                                arg_0.ammo_type = 'uri'
                                arg_0.log.info(
                                    "Setting ammo_type 'uri' because ammo is not started with digit and you did not specify ammo format"
                                )
                            else:
                                arg_0.log.info(
                                    "Default ammo type ('phantom') used, use 'phantom.ammo_type' option to override it"
                                )
                        except StopIteration:
                            arg_0.log.exception(
                                "Couldn't read first line of ammo file")
                            raise AmmoFileError(
                                "Couldn't read first line of ammo file")
            else:
                raise NotImplementedError(
                    'No such ammo type implemented: "%s"' % arg_0.ammo_type)
            arg_2 = arg_1[arg_0.ammo_type](
                arg_0.ammo_file, headers=arg_0.headers, http_ver=arg_0.http_ver, use_cache=arg_0.use_cache)
        else:
            raise StepperConfigurationError(
                'Ammo not found. Specify uris or ammo file')
        arg_0.log.info("Using %s ammo reader" % type(arg_2).__name__)
        return arg_2


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

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

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

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

        arg_4 = 0

        for arg_5 in arg_0.__fetch_tasks(arg_3):
            yield arg_5
            arg_4 += 1

        logger.info("Fetch process completed: %s tasks fetched", arg_4)


return absolute_uri.startswith(self.__path__) and op.exists(absolute_uri)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . __absolute__ ( arg_1 ) return arg_2 . startswith ( arg_0 . __path__ ) and op . exists ( arg_2 )

def Func(arg_0, arg_1):
        """ Check to see if this URI is retrievable by this Retriever implementation

        :param uri: the URI of the resource to be retrieved
        :type uri: str
        :return: True if it can be, False if not
        :rtype: bool
        """
        arg_2 = arg_0.__absolute__(arg_1)

        return arg_2.startswith(arg_0.__path__) and op.exists(arg_2)


def Func(arg_0):
    """Parse a Content-type like header.

    Return the main content-type and a dictionary of options.

    """
    arg_1 = _parseparam(';' + arg_0)
    arg_2 = arg_1.next()
    arg_3 = {}
    for arg_4 in arg_1:
        arg_5 = arg_4.find('=')
        if arg_5 >= 0:
            arg_6 = arg_4[:arg_5].strip().lower()
            arg_7 = arg_4[arg_5+1:].strip()
            if len(arg_7) >= 2 and arg_7[0] == arg_7[-1] == '"':
                arg_7 = arg_7[1:-1]
                arg_7 = arg_7.replace('\\\\', '\\').replace('\\"', '"')
            arg_3[arg_6] = arg_7
    return arg_2, arg_3


(source_name, size, metadata_backend=None, storage_backend=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_3 is None : arg_3 = backends . storage . Func_backend ( ) if arg_2 is None : arg_2 = backends . metadata . Func_backend ( ) arg_4 = arg_2 . Func_thumbnail ( arg_0 , arg_1 ) if arg_4 is None : return None else : return Thumbnail ( arg_4 = arg_4 , storage = arg_3 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """
    Returns a Thumbnail instance, or None if thumbnail does not yet exist.
    """
    if arg_3 is None:
        arg_3 = backends.storage.Func_backend()
    if arg_2 is None:
        arg_2 = backends.metadata.Func_backend()

    arg_4 = arg_2.Func_thumbnail(arg_0, arg_1)
    if arg_4 is None:
        return None
    else:
        return Thumbnail(arg_4=arg_4, storage=arg_3)

Returns a Thumbnail instance or None if thumbnail does not yet exist .


return (zlib.crc32(plaintext) % 2147483647) & 0xffffffff

def Func ( arg_0 ) : if not isinstance ( arg_0 , six . binary_type ) : arg_0 = six . b ( arg_0 ) return ( zlib . crc32 ( arg_0 ) % 2147483647 ) & 0xffffffff

def Func(arg_0):
    """Generates crc32. Modulo keep the value within int range."""
    if not isinstance(arg_0, six.binary_type):
        arg_0 = six.b(arg_0)
    return (zlib.crc32(arg_0) % 2147483647) & 0xffffffff

Generates crc32 . Modulo keep the value within int range .


def Func(arg_0):
        """
        Try to use a waiter from the below pull request

            * https://github.com/boto/botocore/pull/1307

        If the waiter is not available apply a exponential backoff

            * docs.aws.amazon.com/general/latest/gr/api-retries.html
        """
        try:
            arg_1 = arg_0.client.get_waiter('job_execution_complete')
            arg_1.config.max_attempts = sys.maxsize  # timeout is managed by airflow
            arg_1.wait(jobs=[arg_0.jobId])
        except ValueError:
            # If waiter not available use expo
            arg_4 = True
            arg_5 = 0

            while arg_5 < arg_0.max_retries and arg_4:
                arg_0.log.info('AWS Batch retry in the next %s seconds', arg_5)
                arg_6 = arg_0.client.describe_jobs(
                    jobs=[arg_0.jobId]
                )
                if arg_6['jobs'][-1]['status'] in ['SUCCEEDED', 'FAILED']:
                    arg_4 = False

                sleep(1 + pow(arg_5 * 0.1, 2))
                arg_5 += 1


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
if
arg_1
==
'random'
:
arg_1
=
'rand'
arg_4
=
(
'top'
,
'bottom'
,
'rand'
,
'last'
)
if
arg_1
not
in
arg_4
:
arg_5
=
'filter must be one of {}'
.
format
(
', '
.
join
(
arg_4
)
)
raise
ValueError
(
arg_5
)
arg_6
=
dict
(
action
=
'stats'
,
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
arg_7
=
arg_0
.
_api_request
(
params
=
arg_6
)
Func
=
DBStats
(
total_clicks
=
int
(
arg_7
[
'stats'
]
[
'total_clicks'
]
)
,
total_links
=
int
(
arg_7
[
'stats'
]
[
'total_links'
]
)
)
arg_9
=
[
]
if
'links'
in
arg_7
:
for
arg_10
in
range
(
1
,
arg_2
+
1
)
:
arg_11
=
'link_{}'
.
format
(
arg_10
)
arg_9
.
append
(
_json_to_shortened_url
(
arg_7
[
'links'
]
[
arg_11
]
)
)
return
arg_9
,
Func

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Get stats about links.

        Parameters:
            filter: 'top', 'bottom', 'rand', or 'last'.
            limit: Number of links to return from filter.
            start: Optional start number.

        Returns:
            Tuple containing list of ShortenedURLs and DBStats.

        Example:

            .. code-block:: python

                links, stats = yourls.stats(filter='top', limit=10)

        Raises:
            ValueError: Incorrect value for filter parameter.
            requests.exceptions.HTTPError: Generic HTTP Error
        """
        # Normalise random to rand, even though it's accepted by API.
        if arg_1 == 'random':
            arg_1 = 'rand'

        arg_4 = ('top', 'bottom', 'rand', 'last')
        if arg_1 not in arg_4:
            arg_5 = 'filter must be one of {}'.format(', '.join(arg_4))
            raise ValueError(arg_5)

        arg_6 = dict(action='stats', arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)
        arg_7 = arg_0._api_request(params=arg_6)

        Func = DBStats(total_clicks=int(arg_7['stats']['total_clicks']),
                        total_links=int(arg_7['stats']['total_links']))

        arg_9 = []

        if 'links' in arg_7:
            for arg_10 in range(1, arg_2 + 1):
                arg_11 = 'link_{}'.format(arg_10)
                arg_9.append(_json_to_shortened_url(arg_7['links'][arg_11]))

        return arg_9, Func


def Func ( arg_0 , arg_1 , arg_2 = ".treeDag.json" ) : arg_3 = open ( os . path . join ( dirname ( arg_0 . nf_file ) , arg_2 ) , "w" ) arg_3 . write ( json . dumps ( arg_1 ) ) arg_3 . close ( )

def Func(arg_0, arg_1, arg_2=".treeDag.json"):
        """Writes dag to output file

        Parameters
        ----------
        dict_viz: dict
            Tree like dictionary that is used to export tree data of processes
            to html file and here for the dotfile .treeDag.json

        """

        arg_3 = open(os.path.join(dirname(arg_0.nf_file), arg_2)
                           , "w")
        arg_3.write(json.dumps(arg_1))
        arg_3.close()


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : try : return arg_0 . decode ( arg_1 or sys . getdefaultencoding ( ) , * arg_2 , ** arg_3 ) except LookupError : return arg_0 . decode ( sys . getdefaultencoding ( ) , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """return decoded line from encoding or decode with default encoding"""
    try:
        return arg_0.decode(arg_1 or sys.getdefaultencoding(), *arg_2, **arg_3)
    except LookupError:
        return arg_0.decode(sys.getdefaultencoding(), *arg_2, **arg_3)


def Func(arg_0, arg_1):
        """Get Func lines at the given level.

        Parameters
        ----------
        level : numbers.Number
            The data level to calculate the Func lines for.

        Returns
        -------
        :
            The result of the :attr:`formatter` called on the Func at the
            given `level`.

        """
        if not isinstance(arg_1, numbers.Number):
            raise TypeError(
                ("'_level' must be of type 'numbers.Number' but is "
                 "'{:s}'").format(type(arg_1)))
        arg_2 = arg_0._Func_generator.create_Func(arg_1)
        return arg_0.formatter(arg_1, arg_2)

Get contour lines at the given level.

        Parameters
        ----------
        level : numbers.Number
            The data level to calculate the contour lines for.

        Returns
        -------
        :
            The result of the :attr:`formatter` called on the contour at the
            given `level`.


return WatermarkNotification(
        conv_id=p.conversation_id.id,
        user_id=from_participantid(p.sender_id),
        read_timestamp=from_timestamp(
            p.latest_read_timestamp
        ),
    )

def Func ( arg_0 ) : return WatermarkNotification ( conv_id = arg_0 . conversation_id . id , user_id = from_participantid ( arg_0 . sender_id ) , read_timestamp = from_timestamp ( arg_0 . latest_read_timestamp ) , )

def Func(arg_0):
    """Return WatermarkNotification from hangouts_pb2.WatermarkNotification."""
    return WatermarkNotification(
        conv_id=arg_0.conversation_id.id,
        user_id=from_participantid(arg_0.sender_id),
        read_timestamp=from_timestamp(
            arg_0.latest_read_timestamp
        ),
    )

Return WatermarkNotification from hangouts_pb2 . WatermarkNotification .


(verb, path, data=None, files=None, timeout=conf.DEFAULT)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = arg_5 . DEFAULT ) : arg_1 = arg_1 . lstrip ( '/' ) arg_7 = urljoin ( arg_5 . upload_base , arg_1 ) if arg_2 is None : arg_2 = { } arg_2 [ 'pub_key' ] = arg_5 . pub_key arg_2 [ 'UPLOADCARE_PUB_KEY' ] = arg_5 . pub_key arg_8 = { 'User-Agent' : _build_user_agent ( ) , } try : arg_9 = session . request ( str ( arg_0 ) , arg_7 , allow_redirects = True , verify = arg_5 . verify_upload_ssl , arg_2 = arg_2 , arg_3 = arg_3 , arg_8 = arg_8 , arg_4 = _get_timeout ( arg_4 ) , ) except requests . RequestException as exc : raise APIConnectionError ( exc . args [ 0 ] ) if arg_9 . status_code == 204 : return { } if 200 <= arg_9 . status_code < 300 : if _content_type_from_response ( arg_9 ) . endswith ( ( '/json' , '+json' ) ) : try : return arg_9 . json ( ) except ValueError as exc : raise APIError ( exc . args [ 0 ] ) if arg_9 . status_code in ( 400 , 404 ) : raise InvalidRequestError ( arg_9 . content ) raise APIError ( arg_9 . content )

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=arg_5.DEFAULT):
    """Makes Uploading API request and returns response as ``dict``.

    It takes settings from ``conf`` module.

    Make sure that given ``path`` does not contain leading slash.

    Usage example::

        >>> file_obj = open('photo.jpg', 'rb')
        >>> Func('POST', 'base/', files={'file': file_obj})
        {
            'file': '9b9f4483-77b8-40ae-a198-272ba6280004'
        }
        >>> File('9b9f4483-77b8-40ae-a198-272ba6280004')

    """
    arg_1 = arg_1.lstrip('/')
    arg_7 = urljoin(arg_5.upload_base, arg_1)

    if arg_2 is None:
        arg_2 = {}
    arg_2['pub_key'] = arg_5.pub_key
    arg_2['UPLOADCARE_PUB_KEY'] = arg_5.pub_key

    arg_8 = {
        'User-Agent': _build_user_agent(),
    }

    try:
        arg_9 = session.request(
            str(arg_0), arg_7, allow_redirects=True,
            verify=arg_5.verify_upload_ssl, arg_2=arg_2, arg_3=arg_3,
            arg_8=arg_8, arg_4=_get_timeout(arg_4),
        )
    except requests.RequestException as exc:
        raise APIConnectionError(exc.args[0])

    # No content.
    if arg_9.status_code == 204:
        return {}

    if 200 <= arg_9.status_code < 300:
        if _content_type_from_response(arg_9).endswith(('/json', '+json')):
            try:
                return arg_9.json()
            except ValueError as exc:
                raise APIError(exc.args[0])

    if arg_9.status_code in (400, 404):
        raise InvalidRequestError(arg_9.content)

    # Not json or unknown status code.
    raise APIError(arg_9.content)

Makes Uploading API request and returns response as ``dict``.

    It takes settings from ``conf`` module.

    Make sure that given ``path`` does not contain leading slash.

    Usage example::

        >>> file_obj = open('photo.jpg', 'rb')
        >>> uploading_request('POST', 'base/', files={'file': file_obj})
        {
            'file': '9b9f4483-77b8-40ae-a198-272ba6280004'
        }
        >>> File('9b9f4483-77b8-40ae-a198-272ba6280004')

Makes Uploading API request and returns response as dict .


def Func ( arg_0 ) : def wrapper ( arg_1 ) : def wrapped ( * arg_2 , ** arg_3 ) : if not ( 'connection' in arg_3 ) or not arg_3 [ 'connection' ] : arg_4 = requests . Session ( ) arg_3 [ 'connection' ] = arg_4 else : arg_4 = arg_3 [ 'connection' ] if not getattr ( arg_4 , 'timeout' , False ) : arg_4 . timeout = arg_0 arg_4 . headers . update ( { 'Content-type' : 'application/json' } ) return arg_1 ( * arg_2 , ** arg_3 ) return wraps ( arg_1 ) ( wrapped ) return wrapper

def Func(arg_0):
    """
    Decorator function that injects a requests.Session instance into
    the decorated function's actual parameters if not given.
    """
    def wrapper(arg_1):
        def wrapped(*arg_2, **arg_3):
            if not ('connection' in arg_3) or not arg_3['connection']:
                arg_4 = requests.Session()
                arg_3['connection'] = arg_4
            else:
                arg_4 = arg_3['connection']

            if not getattr(arg_4, 'timeout', False):
                arg_4.timeout = arg_0
            arg_4.headers.update({'Content-type': 'application/json'})
            return arg_1(*arg_2, **arg_3)
        return wraps(arg_1)(wrapped)
    return wrapper

Decorator function that injects a requests . Session instance into the decorated function s actual parameters if not given .


def Func(arg_0):
        """Get information about the Func available in the code.

        Returns a sorted list of line number pairs.  Line numbers have been
        normalized to the first line of multiline statements.

        """
        arg_1 = []
        for arg_2, arg_3 in arg_0.byte_parser._all_Func():
            arg_4 = arg_0.first_line(arg_2)
            arg_5 = arg_0.first_line(arg_3)
            if arg_4 != arg_5:
                arg_1.append((arg_4, arg_5))
        return sorted(arg_1)

Get information about the arcs available in the code.

        Returns a sorted list of line number pairs.  Line numbers have been
        normalized to the first line of multiline statements.

Get information about the arcs available in the code .


(self, activeColumns, predictedColumns,
              inputValue=None, timestamp=None)

def Func(arg_0, arg_1, arg_2,
              arg_3=None, arg_4=None):
    """Compute the anomaly score as the percent of active columns not predicted.

    :param activeColumns: array of active column indices
    :param predictedColumns: array of columns indices predicted in this step
                             (used for anomaly in step T+1)
    :param inputValue: (optional) value of current input to encoders
                                  (eg "cat" for category encoder)
                                  (used in anomaly-likelihood)
    :param timestamp: (optional) date timestamp when the sample occured
                                 (used in anomaly-likelihood)
    :returns: the Funcd anomaly score; float 0..1
    """
    # Start by computing the raw anomaly score.
    arg_5 = FuncRawAnomalyScore(arg_1, arg_2)

    # Compute final anomaly based on selected mode.
    if arg_0._mode == Anomaly.MODE_PURE:
      arg_6 = arg_5
    elif arg_0._mode == Anomaly.MODE_LIKELIHOOD:
      if arg_3 is None:
        raise ValueError("Selected anomaly mode 'Anomaly.MODE_LIKELIHOOD' "
                 "requires 'inputValue' as parameter to Func() method. ")

      arg_7 = arg_0._likelihood.anomalyProbability(
          arg_3, arg_5, arg_4)
      # low likelihood -> hi anomaly
      arg_6 = 1 - arg_7
    elif arg_0._mode == Anomaly.MODE_WEIGHTED:
      arg_7 = arg_0._likelihood.anomalyProbability(
          arg_3, arg_5, arg_4)
      arg_6 = arg_5 * (1 - arg_7)

    # Last, do moving-average if windowSize was specified.
    if arg_0._movingAverage is not None:
      arg_6 = arg_0._movingAverage.next(arg_6)

    # apply binary discretization if required
    if arg_0._binaryThreshold is not None:
      if arg_6 >= arg_0._binaryThreshold:
        arg_6 = 1.0
      else:
        arg_6 = 0.0

    return arg_6

Compute the anomaly score as the percent of active columns not predicted.

    :param activeColumns: array of active column indices
    :param predictedColumns: array of columns indices predicted in this step
                             (used for anomaly in step T+1)
    :param inputValue: (optional) value of current input to encoders
                                  (eg "cat" for category encoder)
                                  (used in anomaly-likelihood)
    :param timestamp: (optional) date timestamp when the sample occured
                                 (used in anomaly-likelihood)
    :returns: the computed anomaly score; float 0..1

Compute the anomaly score as the percent of active columns not predicted .


return (
            isinstance(node, astroid.BoolOp)
            and node.op == "or"
            and len(node.values) == 2
            and isinstance(node.values[0], astroid.BoolOp)
            and not isinstance(node.values[1], astroid.BoolOp)
            and node.values[0].op == "and"
            and not isinstance(node.values[0].values[1], astroid.BoolOp)
            and len(node.values[0].values) == 2
        )

def Func ( arg_0 ) : return ( isinstance ( arg_0 , astroid . BoolOp ) and arg_0 . op == "or" and len ( arg_0 . values ) == 2 and isinstance ( arg_0 . values [ 0 ] , astroid . BoolOp ) and not isinstance ( arg_0 . values [ 1 ] , astroid . BoolOp ) and arg_0 . values [ 0 ] . op == "and" and not isinstance ( arg_0 . values [ 0 ] . values [ 1 ] , astroid . BoolOp ) and len ( arg_0 . values [ 0 ] . values ) == 2 )

def Func(arg_0):
        """
        Returns true if node is 'condition and true_value or false_value' form.

        All of: condition, true_value and false_value should not be a complex boolean expression
        """
        return (
            isinstance(arg_0, astroid.BoolOp)
            and arg_0.op == "or"
            and len(arg_0.values) == 2
            and isinstance(arg_0.values[0], astroid.BoolOp)
            and not isinstance(arg_0.values[1], astroid.BoolOp)
            and arg_0.values[0].op == "and"
            and not isinstance(arg_0.values[0].values[1], astroid.BoolOp)
            and len(arg_0.values[0].values) == 2
        )

Returns true if node is condition and true_value or false_value form .


def
Func
(
arg_0
)
:
if
not
arg_0
.
project_abspath
:
raise
TypeError
(
"project_abspath can not be empty."
)
arg_1
=
arg_0
.
get_package_abspath
(
)
for
arg_2
in
arg_1
:
arg_0
.
get_module_name
(
arg_2
)
return
arg_0
.
_modules

def Func(arg_0):
        """Get modules by project_abspath and packages_scan.

        Traverse all files under folder packages_scan which set by customer.
        And get all modules name.
        """
        if not arg_0.project_abspath:
            raise TypeError("project_abspath can not be empty.")
        arg_1 = arg_0.get_package_abspath()
        for arg_2 in arg_1:
            arg_0.get_module_name(arg_2)

        return arg_0._modules

Get modules by project_abspath and packages_scan .


(self, endpoint, *, root=None, params=None, url_params=None)

return urlunsplit((
            scheme,
            netloc,
            urljoin(path, endpoint),
            urlencode(url_params or {}),
            '',
        )).format(**params or {})

def Func ( arg_0 , arg_1 , * , arg_2 = None , arg_3 = None , arg_4 = None ) : if arg_2 is None : arg_2 = arg_0 . ROOT arg_5 , arg_6 , arg_7 , arg_8 , arg_8 = urlsplit ( arg_2 ) return urlunsplit ( ( arg_5 , arg_6 , urljoin ( arg_7 , arg_1 ) , urlencode ( arg_4 or { } ) , '' , ) ) . format ( ** arg_3 or { } )

def Func(arg_0, arg_1, *, arg_2=None, arg_3=None, arg_4=None):
        """Create a URL for the specified endpoint.

        Arguments:
          endpoint (:py:class:`str`): The API endpoint to access.
          root: (:py:class:`str`, optional): The root URL for the
            service API.
          params: (:py:class:`dict`, optional): The values for format
            into the created URL (defaults to ``None``).
          url_params: (:py:class:`dict`, optional): Parameters to add
            to the end of the URL (defaults to ``None``).

        Returns:
          :py:class:`str`: The resulting URL.

        """
        if arg_2 is None:
            arg_2 = arg_0.ROOT
        arg_5, arg_6, arg_7, arg_8, arg_8 = urlsplit(arg_2)
        return urlunsplit((
            arg_5,
            arg_6,
            urljoin(arg_7, arg_1),
            urlencode(arg_4 or {}),
            '',
        )).format(**arg_3 or {})

Create a URL for the specified endpoint .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_jpeg ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'image/jpeg' ] )

def Func(*arg_0, **arg_1):
    """Display the JPEG representation of an object.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw JPEG data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_jpeg(arg_3)
    else:
        display(*arg_0, include=['text/plain','image/jpeg'])

Display the JPEG representation of an object .


def Func ( arg_0 ) : while True : with arg_0 . _processes_lock : if not arg_0 . _processes and arg_0 . _processing_semaphore . locked ( ) : return True gevent . sleep ( 0.1 )

def Func(arg_0):
        '''Waits until all there are no processes enqueued.'''
        while True:
            with arg_0._processes_lock:
                if not arg_0._processes and arg_0._processing_semaphore.locked():
                    return True
            gevent.sleep(0.1)

Waits until all there are no processes enqueued .


def Func ( arg_0 ) : arg_1 = TMemoryBuffer ( ) write_list_begin ( arg_1 , TType . STRUCT , len ( arg_0 ) ) for arg_2 in arg_0 : arg_1 . write ( arg_2 ) return bytes ( arg_1 . getvalue ( ) )

def Func(arg_0):  # pragma: no cover
    """
    Returns a TBinaryProtocol encoded list of Thrift objects.

    :param binary_thrift_obj_list: list of TBinaryProtocol objects to encode.
    :returns: bynary object representing the encoded list.
    """
    arg_1 = TMemoryBuffer()
    write_list_begin(arg_1, TType.STRUCT, len(arg_0))
    for arg_2 in arg_0:
        arg_1.write(arg_2)

    return bytes(arg_1.getvalue())

Returns a TBinaryProtocol encoded list of Thrift objects .


A list of Theano variables for loss computations.

def Func ( arg_0 ) : arg_1 = arg_0 . inputs arg_2 = set ( i . name for i in arg_1 ) for arg_3 in arg_0 . losses : for arg_4 in arg_3 . Func : if arg_4 . name not in arg_2 : arg_1 . append ( arg_4 ) arg_2 . add ( arg_4 . name ) return arg_1

def Func(arg_0):
        '''A list of Theano Func for loss computations.'''
        arg_1 = arg_0.inputs
        arg_2 = set(i.name for i in arg_1)
        for arg_3 in arg_0.losses:
            for arg_4 in arg_3.Func:
                if arg_4.name not in arg_2:
                    arg_1.append(arg_4)
                    arg_2.add(arg_4.name)
        return arg_1

A list of Theano variables for loss computations .


def Func ( ) : global arg_0 try : arg_0 = os . stat ( '/dev/pty/mst/pty0' ) . st_mtime return time . time ( ) - arg_0 except ( NameError , OSError ) : return None

def Func():
    """Returns uptime in seconds or None, on Syllable."""
    global arg_0
    try:
        arg_0 = os.stat('/dev/pty/mst/pty0').st_mtime
        return time.time() - arg_0
    except (NameError, OSError):
        return None

Returns uptime in seconds or None on Syllable .


(relation, nodes, visited_stop_ids, stop_to_station_map)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
for
arg_4
,
arg_5
,
arg_6
in
arg_0
.
member_info
:
if
arg_5
not
in
arg_2
and
arg_5
in
arg_1
and
arg_6
in
(
'stop'
,
'halt'
)
:
arg_7
=
''
arg_2
.
add
(
arg_5
)
yield
Stop
(
arg_5
,
arg_1
[
arg_5
]
.
tags
.
get
(
'name'
)
or
"Unnamed {} stop."
.
format
(
arg_0
.
tags
.
get
(
'route'
)
)
,
arg_1
[
arg_5
]
.
lon
if
arg_5
in
arg_1
else
''
,
arg_1
[
arg_5
]
.
lat
if
arg_5
in
arg_1
else
''
,
arg_0
.
id
,
_map_wheelchair
(
arg_1
[
arg_5
]
.
tags
.
get
(
'wheelchair'
)
)
,
arg_7
,
arg_3
.
get
(
arg_5
,
''
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Extract stops in a relation."""
    # member_role: stop, halt, platform, terminal, etc.
    for arg_4, arg_5, arg_6 in arg_0.member_info:

        if arg_5 not in arg_2 and \
            arg_5 in arg_1 and\
                arg_6 in ('stop', 'halt'):

            arg_7 = ''

            arg_2.add(arg_5)
            yield Stop(
                arg_5,
                arg_1[arg_5].tags.get('name') or
                "Unnamed {} stop.".format(arg_0.tags.get('route')),
                arg_1[arg_5].lon if arg_5 in arg_1 else '',
                arg_1[arg_5].lat if arg_5 in arg_1 else '',
                arg_0.id,
                _map_wheelchair(arg_1[arg_5].tags.get('wheelchair')),
                arg_7,
                arg_3.get(arg_5, ''))


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
'dns'
in
arg_1
:
return
arg_1
[
'dns'
]
if
arg_2
[
'proto'
]
in
[
'dhcp'
,
'dhcpv6'
,
'none'
]
:
return
arg_3
=
arg_0
.
netjson
.
get
(
'dns_servers'
,
)
if
arg_3
:
return
' '
.
join
(
arg_3
)

def Func(arg_0, arg_1, arg_2):
        """
        determines UCI interface "dns" option
        """
        # allow override
        if 'dns' in arg_1:
            return arg_1['dns']
        # ignore if using DHCP or if "proto" is none
        if arg_2['proto'] in ['dhcp', 'dhcpv6', 'none']:
            return None
        arg_3 = arg_0.netjson.get('dns_servers', None)
        if arg_3:
            return ' '.join(arg_3)


return self.request(path, method, call_params)

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

def Func(arg_0, arg_1):
        """REST Reload Plivo Cache Config helper
        """
        arg_2 = '/' + arg_0.api_version + '/ReloadCacheConfig/'
        arg_3 = 'POST'
        return arg_0.request(arg_2, arg_3, arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
time
.
time
(
)
+
arg_0
.
_timeout
arg_4
=
1
while
True
:
try
:
if
not
hasattr
(
arg_1
,
'__call__'
)
:
raise
TypeError
(
"condition is not callable"
)
arg_5
=
arg_1
(
)
if
type
(
arg_5
)
is
bool
and
arg_5
is
not
False
:
return
arg_5
elif
type
(
arg_5
)
is
not
bool
and
arg_5
is
not
:
return
arg_5
else
:
logger
.
debug
(
"#"
+
str
(
arg_4
)
+
" - wait until "
+
arg_2
)
except
arg_0
.
_ignored_exceptions
as
ex
:
logger
.
debug
(
"Captured {0} : {1}"
.
format
(
str
(
ex
.
__class__
)
.
replace
(
"<type '"
,
""
)
.
replace
(
"'>"
,
""
)
,
str
(
ex
)
)
)
time
.
sleep
(
arg_0
.
_poll
)
arg_4
+=
1
if
time
.
time
(
)
>
arg_3
:
break
raise
TimeoutException
(
msg
=
"condition <"
+
arg_2
+
"> was not true after "
+
str
(
arg_0
.
_timeout
)
+
" seconds."
)

def Func(arg_0, arg_1, arg_2):
        """
        Waits until conditions is True or returns a non-None value.
        If any of the trait is still not present after timeout, raises a TimeoutException.
        """
        arg_3 = time.time() + arg_0._timeout
        arg_4 = 1
        while True:
            try:
                if not hasattr(arg_1, '__call__'):
                    raise TypeError("condition is not callable")
                arg_5 = arg_1()
                if type(arg_5) is bool and arg_5 is not False:
                    return arg_5
                elif type(arg_5) is not bool and arg_5 is not None:
                    return arg_5
                else:
                    logger.debug("#" + str(arg_4) + " - wait until " + arg_2)  # pragma: no cover
            except arg_0._ignored_exceptions as ex:
                logger.debug("Captured {0} : {1}".format(str(ex.__class__).replace("<type '", "").replace("'>", ""),
                                                         str(ex)))  # pragma: no cover
            time.sleep(arg_0._poll)
            arg_4 += 1
            if time.time() > arg_3:  # pragma: no cover
                break
        raise TimeoutException(
            msg="condition <" + arg_2 + "> was not true after " + str(arg_0._timeout) + " seconds.")

Waits until conditions is True or returns a non - None value . If any of the trait is still not present after timeout raises a TimeoutException .


def Func ( arg_0 , arg_1 ) : def get_value ( arg_2 , arg_1 ) : if arg_2 is None : return None arg_3 , arg_4 = trim_field_key ( arg_2 , arg_1 ) arg_5 = int ( arg_4 [ - 1 ] ) if arg_4 and has_digit ( arg_4 ) else None arg_6 = make_key ( arg_4 ) if arg_5 is not None and len ( arg_4 ) > 0 : if len ( arg_4 ) == 1 : arg_7 = arg_2 . _data . get ( arg_3 , [ ] ) elif isinstance ( arg_2 , BaseList ) : arg_8 = [ ] if len ( arg_2 ) > 0 : arg_8 = [ get_value ( doc , arg_6 ) for doc in arg_2 ] arg_7 = arg_8 else : arg_7 = get_value ( getattr ( arg_2 , arg_3 ) , arg_6 ) elif len ( arg_4 ) > 0 : arg_7 = get_value ( arg_2 . _data . get ( arg_3 ) , arg_6 ) else : try : arg_7 = ( arg_2 . _data . get ( None , None ) if arg_3 == "id" else arg_2 . _data . get ( arg_3 , None ) ) except : arg_7 = arg_2 . _data . get ( arg_3 , None ) return arg_7 if arg_0 . is_initialized : return get_value ( arg_0 . model_instance , arg_1 ) else : return None

def Func(arg_0, arg_1):
        """
        Given field_key will return value held at self.model_instance.  If
        model_instance has not been provided will return None.
        """

        def get_value(arg_2, arg_1):
            # Short circuit the function if we do not have a document
            if arg_2 is None:
                return None

            arg_3, arg_4 = trim_field_key(arg_2, arg_1)
            arg_5 = int(arg_4[-1]) if arg_4 and has_digit(arg_4) else None
            arg_6 = make_key(arg_4)

            if arg_5 is not None and len(arg_4) > 0:
                # Handleing list fields
                if len(arg_4) == 1:
                    arg_7 = arg_2._data.get(arg_3, [])
                elif isinstance(arg_2, BaseList):
                    arg_8 = []
                    if len(arg_2) > 0:
                        arg_8 = [get_value(doc, arg_6) for doc in arg_2]
                    arg_7 = arg_8
                else:
                    arg_7 = get_value(getattr(arg_2, arg_3), arg_6)

            elif len(arg_4) > 0:
                arg_7 = get_value(arg_2._data.get(arg_3), arg_6)
            else:
                # Handeling all other fields and id
                try: # Added try except otherwise we get "TypeError: getattr(): attribute name must be string" error from mongoengine/base/datastructures.py
                    arg_7 = (arg_2._data.get(None, None) if arg_3 == "id" else
                              arg_2._data.get(arg_3, None))
                except:
                    arg_7 = arg_2._data.get(arg_3, None)

            return arg_7

        if arg_0.is_initialized:
            return get_value(arg_0.model_instance, arg_1)
        else:
            return None

Given field_key will return value held at self . model_instance . If model_instance has not been provided will return None .


def
Func
(
arg_0
,
arg_1
=
2048
,
arg_2
=
512
)
:
if
not
isinstance
(
arg_0
,
np
.
ndarray
)
:
raise
ParameterError
(
'Input must be of type numpy.ndarray, '
'given type(y)={}'
.
format
(
type
(
arg_0
)
)
)
if
arg_0
.
ndim
!=
1
:
raise
ParameterError
(
'Input must be one-dimensional, '
'given y.ndim={}'
.
format
(
arg_0
.
ndim
)
)
if
len
(
arg_0
)
<
arg_1
:
raise
ParameterError
(
'Buffer is too short (n={:d})'
' for Func_length={:d}'
.
format
(
len
(
arg_0
)
,
arg_1
)
)
if
arg_2
<
1
:
raise
ParameterError
(
'Invalid hop_length: {:d}'
.
format
(
arg_2
)
)
if
not
arg_0
.
flags
[
'C_CONTIGUOUS'
]
:
raise
ParameterError
(
'Input buffer must be contiguous.'
)
arg_3
=
1
+
int
(
(
len
(
arg_0
)
arg_1
)
/
arg_2
)
arg_4
=
as_strided
(
arg_0
,
shape
=
(
arg_1
,
arg_3
)
,
strides
=
(
arg_0
.
itemsize
,
arg_2
*
arg_0
.
itemsize
)
)
return
arg_4

def Func(arg_0, arg_1=2048, arg_2=512):
    '''Slice a time series into overlapping Funcs.

    This implementation uses low-level stride manipulation to avoid
    redundant copies of the time series data.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        Time series to Func. Must be one-dimensional and contiguous
        in memory.

    Func_length : int > 0 [scalar]
        Length of the Func in samples

    hop_length : int > 0 [scalar]
        Number of samples to hop between Funcs

    Returns
    -------
    y_Funcs : np.ndarray [shape=(Func_length, N_FRAMES)]
        An array of Funcs sampled from `y`:
        `y_Funcs[i, j] == y[j * hop_length + i]`

    Raises
    ------
    ParameterError
        If `y` is not contiguous in memory, not an `np.ndarray`, or
        not one-dimensional.  See `np.ascontiguous()` for details.

        If `hop_length < 1`, Funcs cannot advance.

        If `len(y) < Func_length`.

    Examples
    --------
    Extract 2048-sample Funcs from `y` with a hop of 64 samples per Func

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> librosa.util.Func(y, Func_length=2048, hop_length=64)
    array([[ -9.216e-06,   7.710e-06, ...,  -2.117e-06,  -4.362e-07],
           [  2.518e-06,  -6.294e-06, ...,  -1.775e-05,  -6.365e-06],
           ...,
           [ -7.429e-04,   5.173e-03, ...,   1.105e-05,  -5.074e-06],
           [  2.169e-03,   4.867e-03, ...,   3.666e-06,  -5.571e-06]], dtype=float32)

    '''

    if not isinstance(arg_0, np.ndarray):
        raise ParameterError('Input must be of type numpy.ndarray, '
                             'given type(y)={}'.format(type(arg_0)))

    if arg_0.ndim != 1:
        raise ParameterError('Input must be one-dimensional, '
                             'given y.ndim={}'.format(arg_0.ndim))

    if len(arg_0) < arg_1:
        raise ParameterError('Buffer is too short (n={:d})'
                             ' for Func_length={:d}'.format(len(arg_0), arg_1))

    if arg_2 < 1:
        raise ParameterError('Invalid hop_length: {:d}'.format(arg_2))

    if not arg_0.flags['C_CONTIGUOUS']:
        raise ParameterError('Input buffer must be contiguous.')

    # Compute the number of Funcs that will fit. The end may get truncated.
    arg_3 = 1 + int((len(arg_0) - arg_1) / arg_2)

    # Vertical stride is one sample
    # Horizontal stride is `hop_length` samples
    arg_4 = as_strided(arg_0, shape=(arg_1, arg_3),
                          strides=(arg_0.itemsize, arg_2 * arg_0.itemsize))
    return arg_4

Slice a time series into overlapping frames.

    This implementation uses low-level stride manipulation to avoid
    redundant copies of the time series data.

    Parameters
    ----------
    y : np.ndarray [shape=(n,)]
        Time series to frame. Must be one-dimensional and contiguous
        in memory.

    frame_length : int > 0 [scalar]
        Length of the frame in samples

    hop_length : int > 0 [scalar]
        Number of samples to hop between frames

    Returns
    -------
    y_frames : np.ndarray [shape=(frame_length, N_FRAMES)]
        An array of frames sampled from `y`:
        `y_frames[i, j] == y[j * hop_length + i]`

    Raises
    ------
    ParameterError
        If `y` is not contiguous in memory, not an `np.ndarray`, or
        not one-dimensional.  See `np.ascontiguous()` for details.

        If `hop_length < 1`, frames cannot advance.

        If `len(y) < frame_length`.

    Examples
    --------
    Extract 2048-sample frames from `y` with a hop of 64 samples per frame

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> librosa.util.frame(y, frame_length=2048, hop_length=64)
    array([[ -9.216e-06,   7.710e-06, ...,  -2.117e-06,  -4.362e-07],
           [  2.518e-06,  -6.294e-06, ...,  -1.775e-05,  -6.365e-06],
           ...,
           [ -7.429e-04,   5.173e-03, ...,   1.105e-05,  -5.074e-06],
           [  2.169e-03,   4.867e-03, ...,   3.666e-06,  -5.571e-06]], dtype=float32)

Slice a time series into overlapping frames .


return self._authenticated_request \
            .to_endpoint('folder/') \
            .with_json_body(self._prep_params(locals())) \
            .return_body() \
            .post()

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
is_valid_uuid
(
arg_2
)
:
raise
StorageArgumentException
(
'Invalid UUID for parent: {0}'
.
format
(
arg_2
)
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'folder/'
)
.
with_json_body
(
arg_0
.
_prep_params
(
locals
(
)
)
)
.
return_body
(
)
.
post
(
)

def Func(arg_0, arg_1, arg_2):
        '''Create a new folder.

        Args:
            name (srt): The name of the folder.
            parent (str): The UUID of the parent entity. The parent must be a
                project or a folder.

        Returns:
            A dictionary of details of the created folder::

                {
                    u'created_by': u'303447',
                    u'created_on': u'2017-03-21T14:06:32.293902Z',
                    u'description': u'',
                    u'entity_type': u'folder',
                    u'modified_by': u'303447',
                    u'modified_on': u'2017-03-21T14:06:32.293967Z',
                    u'name': u'myfolder',
                    u'parent': u'3abd8742-d069-44cf-a66b-2370df74a682',
                    u'uuid': u'2516442e-1e26-4de1-8ed8-94523224cc40'
                }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_2):
            raise StorageArgumentException(
                'Invalid UUID for parent: {0}'.format(arg_2))

        return arg_0._authenticated_request \
            .to_endpoint('folder/') \
            .with_json_body(arg_0._prep_params(locals())) \
            .return_body() \
            .post()


def Func(arg_0, arg_1, arg_2):
        """
        Retrieves all commit messages for all commits between the given commit numbers
        on the current branch.
        """
        print('REAL')
        arg_3 = arg_0.local('git --no-pager log --pretty=oneline %s...%s' % (arg_1, arg_2), capture=True)
        if arg_0.verbose:
            print(arg_3)
        return str(arg_3)

Retrieves all commit messages for all commits between the given commit numbers on the current branch .


return datetime.fromtimestamp(__boottime or time.time() - up)

def
Func
(
)
:
global
__Func
if
__Func
is
:
arg_0
=
uptime
(
)
if
arg_0
is
:
return
if
__Func
is
:
_Func_linux
(
)
if
datetime
is
:
raise
RuntimeError
(
'datetime module required.'
)
return
datetime
.
fromtimestamp
(
__Func
or
time
.
time
(
)
arg_0
)

def Func():
    """Returns boot time if remotely possible, or None if not."""
    global __Func

    if __Func is None:
        arg_0 = uptime()
        if arg_0 is None:
            return None
    if __Func is None:
        _Func_linux()

    if datetime is None:
        raise RuntimeError('datetime module required.')

    return datetime.fromtimestamp(__Func or time.time() - arg_0)

Returns boot time if remotely possible or None if not .


Utility function to handle runtime failures gracefully.
     Show concise information if possible, then terminate program.

(message, exc_info=None, status=1, stacktrace=False)

def Func ( arg_0 , arg_1 = None , arg_2 = 1 , arg_3 = False ) : arg_4 = arg_0 if arg_1 : arg_4 += str ( arg_1 ) error ( arg_4 ) if arg_3 : error ( traceback . format_exc ( ) ) clean_tempfiles ( ) if __name__ == '__main__' : sys . exit ( arg_2 ) else : raise RuntimeError ( arg_2 )

def Func(arg_0, arg_1=None, arg_2=1, arg_3=False):
  '''Utility function to handle runtime Funcures gracefully.
     Show concise information if possible, then terminate program.
  '''
  arg_4 = arg_0
  if arg_1:
    arg_4 += str(arg_1)
  error(arg_4)
  if arg_3:
    error(traceback.format_exc())
  clean_tempfiles()
  if __name__ == '__main__':
    sys.exit(arg_2)
  else:
    raise RuntimeError(arg_2)

Utility function to handle runtime failures gracefully . Show concise information if possible then terminate program .


def Func ( arg_0 , arg_1 ) : if not arg_1 : arg_1 = np . dtype ( [ ] ) else : arg_1 = np . dtype ( arg_1 ) arg_2 = arg_1 . descr for arg_3 , arg_4 in arg_0 . _default_cluster_hits_descr : if arg_0 . _hit_fields_mapping [ arg_3 ] not in arg_1 . fields : arg_2 . append ( ( arg_3 , arg_4 ) ) arg_0 . _cluster_hits_descr = arg_2 arg_0 . _init_arrays ( size = 0 )

def Func(arg_0, arg_1):
        ''' Set the data type of the hits.

        Fields that are not mentioned here are NOT copied into the clustered hits array.
        Clusterizer has to know the hit data type to produce the clustered hit result with the same data types.

        Parameters:
        -----------
        hit_dtype : numpy.dtype or equivalent
            Defines the dtype of the hit array.

        Example:
        --------
        hit_dtype = [("column", np.uint16), ("row", np.uint16)], where
        "column", "row" is the field name of the input hit array.
        '''

        if not arg_1:
            arg_1 = np.dtype([])
        else:
            arg_1 = np.dtype(arg_1)
        arg_2 = arg_1.descr

        # Add default back to description
        for arg_3, arg_4 in arg_0._default_cluster_hits_descr:
            if arg_0._hit_fields_mapping[arg_3] not in arg_1.fields:
                arg_2.append((arg_3, arg_4))
        arg_0._cluster_hits_descr = arg_2
        arg_0._init_arrays(size=0)


def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 ) : arg_0 [ arg_1 ] [ 0 ] = round ( arg_0 [ arg_1 ] [ 0 ] / 100.0 ) * 100.0 return arg_0

def Func(arg_0):
    """ round the data"""
    for arg_1, arg_2 in enumerate(arg_0):
        arg_0[arg_1][0] = round(arg_0[arg_1][0] / 100.0) * 100.0
    return arg_0


return dict(
            [(f, sorted(lmap.keys())) for f, lmap in iitems(self.lines)]
            )

def Func ( arg_0 ) : return dict ( [ ( arg_1 , sorted ( arg_2 . keys ( ) ) ) for arg_1 , arg_2 in iitems ( arg_0 . lines ) ] )

def Func(arg_0):
        """Return the map from filenames to lists of line numbers executed."""
        return dict(
            [(arg_1, sorted(arg_2.keys())) for arg_1, arg_2 in iitems(arg_0.lines)]
            )

Return the map from filenames to lists of line numbers executed .


(world_cls, referee_cls, gui_cls, gui_actor_cls, ai_actor_cls,
        theater_cls=PygletTheater, default_host=DEFAULT_HOST,
        default_port=DEFAULT_PORT, argv=None)

"""\****************************** KNOWN BUG WARNING ******************************In debug mode, every message produced by the logging system gets printed twice.I know vaguely why this is happening, but as of yet I've not been able to fixit.  In the mean time, don't let this confuse you!*******************************************************************************"""

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
        arg_5=arg_6, arg_7=arg_8,
        arg_9=arg_10, arg_11=None):
    """
Run a game being developed with the kxg game engine.

Usage:
    {exe_name} sandbox [<num_ais>] [-v...]
    {exe_name} client [--host HOST] [--port PORT] [-v...]
    {exe_name} server <num_guis> [<num_ais>] [--host HOST] [--port PORT] [-v...]
    {exe_name} debug <num_guis> [<num_ais>] [--host HOST] [--port PORT] [-v...]
    {exe_name} --help

Commands:
    sandbox
        Play a single-player game with the specified number of AIs.  None of
        the multiplayer machinery will be used.

    client
        Launch a client that will try to connect to a server on the given host
        and port.  Once it connects and the game starts, the client will allow
        you to play the game against any other connected clients.

    server
        Launch a server that will manage a game between the given number of
        human and AI players.  The human players must connect using this
        command's client mode.

    debug
        Debug a multiplayer game locally.  This command launches a server and
        the given number of clients all in different processes, and configures
        the logging system such that the output from each process can be easily
        distinguished.

Arguments:
    <num_guis>
        The number of human players that will be playing the game.  Only needed
        by commands that will launch some sort of multiplayer server.

    <num_ais>
        The number of AI players that will be playing the game.  Only needed by
        commands that will launch single-player games or multiplayer servers.

Options:
    -x --host HOST          [default: {default_host}]
        The address of the machine running the server.  Must be accessible from
        the machines running the clients.

    -p --port PORT          [default: {default_port}]
        The port that the server should listen on.  Don't specify a value less
        than 1024 unless the server is running with root permissions.

    -v --verbose
        Have the game engine log more information about what it's doing.  You
        can specify this option several times to get more and more information.

This command is provided so that you can start writing your game with the least
possible amount of boilerplate code.  However, the clients and servers provided
by this command are not capable of running a production game.  Once you have
written your game and want to give it a polished set of menus and options,
you'll have to write new Stage subclasses encapsulating that logic and you'll
have to call those stages yourself by interacting more directly with the
Theater class.  The online documentation has more information on this process.
    """
    import sys, os, docopt, nonstdlib

    arg_12 = os.path.basename(sys.argv[0])
    arg_13 = Func.__doc__.format(**locals()).strip()
    arg_14 = docopt.docopt(arg_13, arg_11 or sys.argv[1:])
    arg_15 = int(arg_14['<num_guis>'] or 1)
    arg_16 = int(arg_14['<num_ais>'] or 0)
    arg_17, arg_18 = arg_14['--host'], int(arg_14['--port'])

    logging.basicConfig(
            format='%(levelname)s: %(name)s: %(message)s',
            level=nonstdlib.verbosity(arg_14['--verbose']),
    )

    # Use the given game objects and command line arguments to play a game!

    if arg_14['debug']:
        print("""\
****************************** KNOWN BUG WARNING ******************************
In debug mode, every message produced by the logging system gets printed twice.
I know vaguely why this is happening, but as of yet I've not been able to fix
it.  In the mean time, don't let this confuse you!
*******************************************************************************""")
        arg_19 = MultiplayerDebugger(
                arg_0, arg_1, arg_2, arg_3, arg_15,
                arg_4, arg_16, arg_5, arg_17, arg_18)
    else:
        arg_19 = arg_5()
        arg_20 = [arg_4() for i in range(arg_16)]

        if arg_14['sandbox']:
            arg_19.gui = arg_2()
            arg_19.initial_stage = UniplayerGameStage(
                    arg_0(), arg_1(), arg_3(), arg_20)
            arg_19.initial_stage.successor = PostgameSplashStage()

        if arg_14['client']:
            arg_19.gui = arg_2()
            arg_19.initial_stage = ClientConnectionStage(
                    arg_0(), arg_3(), arg_17, arg_18)

        if arg_14['server']:
            arg_19.initial_stage = ServerConnectionStage(
                    arg_0(), arg_1(), arg_15, arg_20,
                    arg_17, arg_18)

    arg_19.play()

Run a game being developed with the kxg game engine .


def Func ( arg_0 , arg_1 = None ) : arg_2 = get_param_values ( arg_0 , arg_1 = arg_1 ) arg_3 = arg_2 . pop ( 'orb_context' , { } ) if isinstance ( arg_3 , ( unicode , str ) ) : arg_3 = projex . rest . unjsonify ( arg_3 ) arg_4 = 'limit' in arg_3 or 'limit' in arg_2 arg_5 = orb . Context ( ** arg_3 ) arg_6 = set ( ) arg_7 = { } for arg_8 in orb . Context . Defaults : if arg_8 in arg_2 : arg_6 . add ( arg_8 ) arg_7 [ arg_8 ] = arg_2 . get ( arg_8 ) arg_9 = { } if arg_1 : for arg_8 , arg_10 in arg_0 . matchdict . items ( ) : if arg_1 . schema ( ) . column ( arg_8 , raise_ = False ) : arg_9 [ arg_8 ] = arg_10 for arg_8 , arg_10 in arg_2 . items ( ) : arg_11 = arg_8 . split ( '.' ) [ 0 ] arg_12 = arg_1 . schema ( ) . column ( arg_11 , raise_ = False ) or arg_1 . schema ( ) . collector ( arg_11 ) if arg_12 : arg_10 = arg_2 . pop ( arg_8 ) if isinstance ( arg_12 , orb . Collector ) and type ( arg_10 ) not in ( tuple , list ) : arg_10 = [ arg_10 ] arg_9 [ arg_8 ] = arg_10 arg_7 [ 'scope' ] = { 'request' : arg_0 } try : arg_13 = arg_0 . orb_default_context except AttributeError : try : arg_7 [ 'scope' ] . update ( arg_0 . orb_scope ) except AttributeError : pass else : if 'scope' in arg_13 : arg_7 [ 'scope' ] . update ( arg_13 . pop ( 'scope' ) ) for arg_14 , arg_15 in arg_13 . items ( ) : arg_7 . setdefault ( arg_14 , arg_15 ) arg_5 . update ( arg_7 ) return arg_9 , arg_5

def Func(arg_0, arg_1=None):
    """
    Extracts ORB context information from the request.

    :param request: <pyramid.request.Request>
    :param model: <orb.Model> || None

    :return: {<str> key: <variant> value} values, <orb.Context>
    """
    # convert request parameters to python
    arg_2 = get_param_values(arg_0, arg_1=arg_1)

    # extract the full orb context if provided
    arg_3 = arg_2.pop('orb_context', {})
    if isinstance(arg_3, (unicode, str)):
        arg_3 = projex.rest.unjsonify(arg_3)

    # otherwise, extract the limit information
    arg_4 = 'limit' in arg_3 or 'limit' in arg_2

    # create the new orb context
    arg_5 = orb.Context(**arg_3)

    # build up context information from the request params
    arg_6 = set()
    arg_7 = {}
    for arg_8 in orb.Context.Defaults:
        if arg_8 in arg_2:
            arg_6.add(arg_8)
            arg_7[arg_8] = arg_2.get(arg_8)

    # generate a simple query object
    arg_9 = {}
    if arg_1:
        # extract match dict items
        for arg_8, arg_10 in arg_0.matchdict.items():
            if arg_1.schema().column(arg_8, raise_=False):
                arg_9[arg_8] = arg_10

        # extract payload items
        for arg_8, arg_10 in arg_2.items():
            arg_11 = arg_8.split('.')[0]
            arg_12 = arg_1.schema().column(arg_11, raise_=False) or arg_1.schema().collector(arg_11)
            if arg_12:
                arg_10 = arg_2.pop(arg_8)
                if isinstance(arg_12, orb.Collector) and type(arg_10) not in (tuple, list):
                    arg_10 = [arg_10]
                arg_9[arg_8] = arg_10

    # generate the base context information
    arg_7['scope'] = {
        'request': arg_0
    }

    # include any request specific scoping or information from the request
    # first, look for default ORB context for all requests
    try:
        arg_13 = arg_0.orb_default_context

    # then, look for scope specific information for all requests
    except AttributeError:
        try:
            arg_7['scope'].update(arg_0.orb_scope)
        except AttributeError:
            pass

    # if request specific context defaults exist, then
    # merge them with the rest of the query context
    else:
        if 'scope' in arg_13:
            arg_7['scope'].update(arg_13.pop('scope'))

        # setup defaults based on the request
        for arg_14, arg_15 in arg_13.items():
            arg_7.setdefault(arg_14, arg_15)

    arg_5.update(arg_7)
    return arg_9, arg_5

Extracts ORB context information from the request .


(self, names, payload=None, request_type="push")

def Func(arg_0, arg_1, arg_2=None, arg_3="push"):
    '''Authorize a client based on encrypting the payload with the client
       token, which should be matched on the receiving server'''

    if arg_0.secrets is not None:

        if "registry" in arg_0.secrets:

            # Use the payload to generate a digest   push|collection|name|tag|user
            arg_4 = generate_timestamp()
            arg_5 = generate_credential(arg_0.secrets['registry']['username'])
            arg_5 = "%s/%s/%s" %(arg_3,arg_5,arg_4)

            if arg_2 is None:
                arg_2 = "%s|%s|%s|%s|%s|" %(arg_3,
                                              arg_1['collection'],
                                              arg_4,
                                              arg_1['image'],
                                              arg_1['tag'])

            arg_6 = generate_signature(arg_2,arg_0.secrets['registry']['token'])
            return "SREGISTRY-HMAC-SHA256 Credential=%s,Signature=%s" %(arg_5,arg_6)

Authorize a client based on encrypting the payload with the client token which should be matched on the receiving server


def Func(arg_0, arg_1):
    """
    Transforms function args into a key that can be used by the cache

    CommandLine:
        xdoctest -m ubelt.util_memoize Func

    Example:
        >>> args = (4, [1, 2])
        >>> kwargs = {'a': 'b'}
        >>> key = Func(args, kwargs)
        >>> print('key = {!r}'.format(key))
        >>> # Some mutable types cannot be handled by ub.hash_data
        >>> import pytest
        >>> import six
        >>> if six.PY2:
        >>>     import collections as abc
        >>> else:
        >>>     from collections import abc
        >>> with pytest.raises(TypeError):
        >>>     Func((4, [1, 2], {1: 2, 'a': 'b'}), kwargs={})
        >>> class Dummy(abc.MutableSet):
        >>>     def __contains__(self, item): return None
        >>>     def __iter__(self): return iter([])
        >>>     def __len__(self): return 0
        >>>     def add(self, item, loc): return None
        >>>     def discard(self, item): return None
        >>> with pytest.raises(TypeError):
        >>>     Func((Dummy(),), kwargs={})
    """
    arg_2 = arg_1.items()
    # TODO: we should check if Python is at least 3.7 and sort by kwargs
    # keys otherwise. Should we use hash_data for key generation
    if (sys.version_info.major, sys.version_info.minor) < (3, 7):  # nocover
        # We can sort because they keys are gaurenteed to be strings
        arg_2 = sorted(arg_2)
    arg_2 = tuple(arg_2)

    try:
        arg_3 = _hashable(arg_0), _hashable(arg_2)
    except TypeError:
        raise TypeError('Signature is not hashable: args={} kwargs{}'.format(arg_0, arg_1))
    return arg_3

Transforms function args into a key that can be used by the cache

    CommandLine:
        xdoctest -m ubelt.util_memoize _make_signature_key

    Example:
        >>> args = (4, [1, 2])
        >>> kwargs = {'a': 'b'}
        >>> key = _make_signature_key(args, kwargs)
        >>> print('key = {!r}'.format(key))
        >>> # Some mutable types cannot be handled by ub.hash_data
        >>> import pytest
        >>> import six
        >>> if six.PY2:
        >>>     import collections as abc
        >>> else:
        >>>     from collections import abc
        >>> with pytest.raises(TypeError):
        >>>     _make_signature_key((4, [1, 2], {1: 2, 'a': 'b'}), kwargs={})
        >>> class Dummy(abc.MutableSet):
        >>>     def __contains__(self, item): return None
        >>>     def __iter__(self): return iter([])
        >>>     def __len__(self): return 0
        >>>     def add(self, item, loc): return None
        >>>     def discard(self, item): return None
        >>> with pytest.raises(TypeError):
        >>>     _make_signature_key((Dummy(),), kwargs={})


return self._assoc('children', parent_id, group_id)

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = arg_0 . lookup_with_inventory ( arg_2 , arg_3 . get ( 'inventory' , None ) ) [ 'id' ] arg_5 = arg_0 . lookup_with_inventory ( arg_1 , arg_3 . get ( 'inventory' , None ) ) [ 'id' ] return arg_0 . _assoc ( 'children' , arg_4 , arg_5 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Associate this group with the specified group.

        =====API DOCS=====
        Associate this group with the specified group.

        :param group: Primary key or name of the child group to Func.
        :type group: str
        :param parent: Primary key or name of the parent group to Func to.
        :type parent: str
        :param inventory: Primary key or name of the inventory the association should happen in.
        :type inventory: str
        :returns: Dictionary of only one key "changed", which indicates whether the association succeeded.
        :rtype: dict

        =====API DOCS=====
        """
        arg_4 = arg_0.lookup_with_inventory(arg_2, arg_3.get('inventory', None))['id']
        arg_5 = arg_0.lookup_with_inventory(arg_1, arg_3.get('inventory', None))['id']
        return arg_0._assoc('children', arg_4, arg_5)

Associate this group with the specified group.

        =====API DOCS=====
        Associate this group with the specified group.

        :param group: Primary key or name of the child group to associate.
        :type group: str
        :param parent: Primary key or name of the parent group to associate to.
        :type parent: str
        :param inventory: Primary key or name of the inventory the association should happen in.
        :type inventory: str
        :returns: Dictionary of only one key "changed", which indicates whether the association succeeded.
        :rtype: dict

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

Associate this group with the specified group .


return (str(self.status) + ' ' +
                Response._responses[self.status].phrase)

def
Func
(
arg_0
)
:
return
(
str
(
arg_0
.
status
)
+
' '
+
Response
.
_responses
[
arg_0
.
status
]
.
phrase
)

def Func(arg_0):
        """Return the HTTP response status line.

        The status line is determined from :attr:`status` code. For
        example, if the status code is 200, then '200 OK' is returned.

        Returns:
          str: Status line
        """
        return (str(arg_0.status) + ' ' +
                Response._responses[arg_0.status].phrase)


(x,
                      expect_static=False,
                      expect_ndims=None,
                      expect_ndims_no_more_than=None,
                      expect_ndims_at_least=None)

def Func(arg_0,
                      arg_1=False,
                      arg_2=None,
                      arg_3=None,
                      arg_4=None):
  """Get static number of dimensions and assert that some expectations are met.

  This function returns the number of dimensions 'ndims' of x, as a Python int.

  The optional expect arguments are used to check the ndims of x, but this is
  only done if the static ndims of x is not None.

  Args:
    x:  A Tensor.
    expect_static:  Expect `x` to have statically defined `ndims`.
    expect_ndims:  Optional Python integer.  If provided, assert that x has
      number of dimensions equal to this.
    expect_ndims_no_more_than:  Optional Python integer.  If provided, assert
      that x has no more than this many dimensions.
    expect_ndims_at_least:  Optional Python integer.  If provided, assert that x
      has at least this many dimensions.

  Returns:
    ndims:  A Python integer.

  Raises:
    ValueError:  If any of the expectations above are violated.
  """
  arg_5 = arg_0.shape.ndims
  if arg_5 is None:
    arg_6 = tf.get_static_value(tf.shape(input=arg_0))
    if arg_6 is not None:
      arg_5 = arg_6.ndim

  if arg_5 is None:
    if arg_1:
      raise ValueError(
          'Expected argument `x` to have statically defined `ndims`.  Found: ' %
          arg_0)
    return

  if arg_2 is not None:
    arg_7 = ('Expected argument `x` to have ndims %s.  Found tensor %s'
                     % (arg_2, arg_0))
    if arg_5 != arg_2:
      raise ValueError(arg_7)

  if arg_4 is not None:
    arg_8 = (
        'Expected argument `x` to have ndims >= %d.  Found tensor %s' %
        (arg_4, arg_0))
    if arg_5 < arg_4:
      raise ValueError(arg_8)

  if arg_3 is not None:
    arg_9 = (
        'Expected argument `x` to have ndims <= %d.  Found tensor %s' %
        (arg_3, arg_0))
    if arg_5 > arg_3:
      raise ValueError(arg_9)

  return arg_5

Get static number of dimensions and assert that some expectations are met .


def Func ( arg_0 ) : arg_1 = arg_0 . name . capitalize ( ) arg_2 = TextDrawing . params_for_label ( arg_0 ) if arg_2 : arg_1 += "(%s)" % ',' . join ( arg_2 ) return arg_1

def Func(arg_0):
        """ Creates the label for a box."""
        arg_1 = arg_0.name.capitalize()
        arg_2 = TextDrawing.params_for_label(arg_0)
        if arg_2:
            arg_1 += "(%s)" % ','.join(arg_2)
        return arg_1


def Func(arg_0, arg_1):
        """Retrieve all the issues from a given date.

        :param from_date: obtain issues updated since this date
        """
        arg_2 = urijoin(arg_0.base_url, arg_0.RESOURCE, arg_0.VERSION_API, 'search')
        arg_3 = arg_0.get_items(arg_1, arg_2)

        return arg_3

Retrieve all the issues from a given date .


return [self._selector_map[selector] for selector in matching_selectors]

def Func(arg_0, arg_1):
    """Returns all values matching `partial_selector` as a list."""
    arg_2 = arg_0.matching_selectors(arg_1)
    return [arg_0._selector_map[arg_3] for arg_3 in arg_2]

Returns all values matching partial_selector as a list .


def Func(arg_0, arg_1, arg_2):
        """Walk the AST to collect block level options line numbers."""
        for arg_3, arg_4 in arg_0._module_msgs_state.items():
            arg_0._raw_module_msgs_state[arg_3] = arg_4.copy()
        arg_6 = arg_0._module_msgs_state.copy()
        arg_0._module_msgs_state = {}
        arg_0._suppression_mapping = {}
        arg_0._effective_max_line_number = arg_2.tolineno
        arg_0._Func(arg_1, arg_2, arg_6)

Walk the AST to collect block level options line numbers .


(layout, gates, coupling_map,
                            depth=SEARCH_DEPTH, width=SEARCH_WIDTH)

return {
        'layout': best_step['layout'],
        'swaps_added': 1 + best_step['swaps_added'],
        'gates_remaining': best_step['gates_remaining'],
        'gates_mapped': gates_mapped + best_swap_gate + best_step['gates_mapped'],
    }

def Func(arg_0, arg_1, arg_2,
                            arg_3=arg_4, arg_5=arg_6):
    """Search for SWAPs which allow for application of largest number of gates.

    Arguments:
        layout (Layout): Map from virtual qubit index to physical qubit index.
        gates (list): Gates to be mapped.
        coupling_map (CouplingMap): CouplingMap of the target backend.
        depth (int): Number of SWAP layers to search before choosing a result.
        width (int): Number of SWAPs to consider at each layer.
    Returns:
        dict: Describes solution step found.
            layout (Layout): Virtual to physical qubit map after SWAPs.
            gates_remaining (list): Gates that could not be mapped.
            gates_mapped (list): Gates that were mapped, including added SWAPs.

    """

    arg_7, arg_8 = _map_free_gates(arg_0, arg_1, arg_2)

    arg_9 = {'layout': arg_0,
                 'swaps_added': 0,
                 'gates_mapped': arg_7,
                 'gates_remaining': arg_8}

    if not arg_8 or arg_3 == 0:
        return arg_9

    arg_10 = arg_2.get_edges()

    def _score_swap(arg_11):
        """Calculate the relative score for a given SWAP."""
        arg_12 = arg_0.copy()
        arg_12.swap(*arg_11)
        return _calc_layout_distance(arg_1, arg_2, arg_12)

    arg_13 = sorted(arg_10, key=_score_swap)

    arg_14, arg_15 = None, None
    for arg_11 in arg_13[:arg_5]:
        arg_12 = arg_0.copy()
        arg_12.swap(*arg_11)
        arg_16 = Func(arg_12, arg_8,
                                            arg_2, arg_3 - 1, arg_5)

        # ranked_swaps already sorted by distance, so distance is the tie-breaker.
        if arg_14 is None or _score_step(arg_16) > _score_step(arg_15):
            arg_14, arg_15 = arg_11, arg_16

    arg_17 = _swap_ops_from_edge(arg_14, arg_0)
    return {
        'layout': arg_15['layout'],
        'swaps_added': 1 + arg_15['swaps_added'],
        'gates_remaining': arg_15['gates_remaining'],
        'gates_mapped': arg_7 + arg_17 + arg_15['gates_mapped'],
    }

Search for SWAPs which allow for application of largest number of gates .


Print, emphasized 'good', the given 'txt' message

def
Func
(
arg_0
)
:
print
(
"%s# %s%s%s"
%
(
PR_GOOD_CC
,
get_time_stamp
(
)
,
arg_0
,
PR_NC
)
)
sys
.
stdout
.
flush
(
)

def Func(arg_0):
    """Print, emphasized 'Func', the given 'txt' message"""

    print("%s# %s%s%s" % (PR_GOOD_CC, get_time_stamp(), arg_0, PR_NC))
    sys.stdout.flush()

Print emphasized good the given txt message


def Func(arg_0, arg_1):
        """Checks GBDX batch workflow status.

         Args:
             batch workflow_id (str): Batch workflow id.

         Returns:
             Batch Workflow status (str).
        """
        arg_0.logger.debug('Get status of batch workflow: ' + arg_1)
        arg_2 = '%(base_url)s/batch_workflows/%(batch_id)s' % {
            'base_url': arg_0.base_url, 'batch_id': arg_1
        }
        arg_3 = arg_0.gbdx_connection.get(arg_2)

        return arg_3.json()


def Func(arg_0):
    """Parses cobra annotations from a given SBase object.

    Annotations are dictionaries with the providers as keys.

    Parameters
    ----------
    sbase : libsbml.SBase
        SBase from which the SBML annotations are read

    Returns
    -------
    dict (annotation dictionary)

    FIXME: annotation format must be updated (this is a big collection of
          fixes) - see: https://github.com/opencobra/cobrapy/issues/684)
    """
    arg_1 = {}

    # SBO term
    if arg_0.isSetSBOTerm():
        # FIXME: correct handling of annotations
        arg_1["sbo"] = arg_0.getSBOTermID()

    # RDF annotation
    arg_2 = arg_0.getCVTerms()
    if arg_2 is None:
        return arg_1

    for arg_3 in arg_2:  # type: libsbml.CVTerm
        for arg_4 in range(arg_3.getNumResources()):
            # FIXME: read and store the qualifier

            arg_5 = arg_3.getResourceURI(arg_4)
            arg_6 = URL_IDENTIFIERS_PATTERN.match(arg_5)
            if not arg_6:
                LOGGER.warning("%s does not conform to "
                               "http(s)://identifiers.org/collection/id", arg_5)
                continue

            arg_7, arg_8 = arg_6.group(1), arg_6.group(2)
            if arg_7 in arg_1:
                if isinstance(arg_1[arg_7], string_types):
                    arg_1[arg_7] = [arg_1[arg_7]]
                # FIXME: use a list
                if arg_8 not in arg_1[arg_7]:
                    arg_1[arg_7].append(arg_8)
            else:
                # FIXME: always in list
                arg_1[arg_7] = arg_8

    return arg_1

Parses cobra annotations from a given SBase object .


return circuits, run_config, user_qobj_header

def Func(arg_0):
    """Dissasemble a qobj and return the circuits, run_config, and user header

    Args:
        qobj (Qobj): The input qobj object to dissasemble
    Returns:
        circuits (list): A list of quantum circuits
        run_config (dict): The dist of the run config
        user_qobj_header (dict): The dict of any user headers in the qobj

    """
    arg_1 = arg_0.config.to_dict()
    arg_2 = arg_0.header.to_dict()
    arg_3 = _experiments_to_circuits(arg_0)

    return arg_3, arg_1, arg_2

Dissasemble a qobj and return the circuits run_config and user header


return render_to_response("notification/notice_settings.html", {
        "notice_types": notice_types,
        "notice_settings": settings,
    }, context_instance=RequestContext(request))

def Func ( arg_0 ) : arg_1 = NoticeType . objects . all ( ) arg_2 = [ ] for arg_3 in arg_1 : arg_4 = [ ] for arg_5 , arg_6 in NOTICE_MEDIA : arg_7 = "%s_%s" % ( arg_3 . label , arg_5 ) arg_8 = NoticeSetting . for_user ( arg_0 . user , arg_3 , arg_5 ) if arg_0 . method == "POST" : if arg_0 . POST . get ( arg_7 ) == "on" : if not arg_8 . send : arg_8 . send = True arg_8 . save ( ) else : if arg_8 . send : arg_8 . send = False arg_8 . save ( ) arg_4 . append ( ( arg_7 , arg_8 . send ) ) arg_2 . append ( { "notice_type" : arg_3 , "cells" : arg_4 } ) if arg_0 . method == "POST" : arg_10 = arg_0 . POST . get ( "next_page" , "." ) return HttpResponseRedirect ( arg_10 ) arg_11 = { "column_headers" : [ arg_6 for arg_5 , arg_6 in NOTICE_MEDIA ] , "rows" : arg_2 , } return render_to_response ( "notification/Func.html" , { "notice_types" : arg_1 , "Func" : arg_11 , } , context_instance = RequestContext ( arg_0 ) )

def Func(arg_0):
    """
    The notice settings view.

    Template: :template:`notification/Func.html`

    Context:

        notice_types
            A list of all :model:`notification.NoticeType` objects.

        Func
            A dictionary containing ``column_headers`` for each ``NOTICE_MEDIA``
            and ``rows`` containing a list of dictionaries: ``notice_type``, a
            :model:`notification.NoticeType` object and ``cells``, a list of
            tuples whose first value is suitable for use in forms and the second
            value is ``True`` or ``False`` depending on a ``request.POST``
            variable called ``form_label``, whose valid value is ``on``.
    """
    arg_1 = NoticeType.objects.all()
    arg_2 = []
    for arg_3 in arg_1:
        arg_4 = []
        for arg_5, arg_6 in NOTICE_MEDIA:
            arg_7 = "%s_%s" % (arg_3.label, arg_5)
            arg_8 = NoticeSetting.for_user(arg_0.user, arg_3, arg_5)
            if arg_0.method == "POST":
                if arg_0.POST.get(arg_7) == "on":
                    if not arg_8.send:
                        arg_8.send = True
                        arg_8.save()
                else:
                    if arg_8.send:
                        arg_8.send = False
                        arg_8.save()
            arg_4.append((arg_7, arg_8.send))
        arg_2.append({"notice_type": arg_3, "cells": arg_4})

    if arg_0.method == "POST":
        arg_10 = arg_0.POST.get("next_page", ".")
        return HttpResponseRedirect(arg_10)

    arg_11 = {
        "column_headers": [arg_6 for arg_5, arg_6 in NOTICE_MEDIA],
        "rows": arg_2,
    }

    return render_to_response("notification/Func.html", {
        "notice_types": arg_1,
        "Func": arg_11,
    }, context_instance=RequestContext(arg_0))

The notice settings view.

    Template: :template:`notification/notice_settings.html`

    Context:

        notice_types
            A list of all :model:`notification.NoticeType` objects.

        notice_settings
            A dictionary containing ``column_headers`` for each ``NOTICE_MEDIA``
            and ``rows`` containing a list of dictionaries: ``notice_type``, a
            :model:`notification.NoticeType` object and ``cells``, a list of
            tuples whose first value is suitable for use in forms and the second
            value is ``True`` or ``False`` depending on a ``request.POST``
            variable called ``form_label``, whose valid value is ``on``.


def Func(arg_0, arg_1):
        """
        Filter tags according exclude_tags and exclude_tags_regex option.

        :param list(dict) all_tags: Pre-filtered tags.
        :rtype: list(dict)
        :return: Filtered tags.
        """
        arg_2 = copy.deepcopy(arg_1)
        if arg_0.options.exclude_tags:
            arg_2 = arg_0.apply_exclude_tags(arg_2)
        if arg_0.options.exclude_tags_regex:
            arg_2 = arg_0.apply_exclude_tags_regex(arg_2)
        return arg_2

Filter tags according exclude_tags and exclude_tags_regex option .


def Func ( arg_0 ) : arg_1 = BytesIO ( ) arg_2 = gzip . GzipFile ( mode = 'wb' , fileobj = arg_1 ) if arg_0 . use_gzip else arg_1 arg_3 = JsonLinesItemExporter ( arg_2 ) arg_3 . start_exporting ( ) for arg_4 in arg_0 . items : arg_3 . export_item ( arg_4 ) arg_3 . finish_exporting ( ) if arg_2 is not arg_1 : arg_2 . close ( ) arg_1 . seek ( 0 ) return arg_1

def Func(arg_0):
        """
        Build file object from items.
        """

        arg_1 = BytesIO()
        arg_2 = gzip.GzipFile(mode='wb', fileobj=arg_1) if arg_0.use_gzip else arg_1

        # Build file object using ItemExporter
        arg_3 = JsonLinesItemExporter(arg_2)
        arg_3.start_exporting()
        for arg_4 in arg_0.items:
            arg_3.export_item(arg_4)
        arg_3.finish_exporting()

        if arg_2 is not arg_1:
            arg_2.close()  # Close the file if GzipFile

        # Seek to the top of file to be read later
        arg_1.seek(0)

        return arg_1


def Func ( arg_0 , arg_1 = None ) : for arg_2 in arg_0 . actors . values ( ) : arg_2 . render ( arg_1 )

def Func(arg_0,arg_1=None):
        """
        Renders the world in 3d-mode.

        If you want to render custom terrain, you may override this method. Be careful that you still call the original method or else actors may not be rendered.
        """
        for arg_2 in arg_0.actors.values():
            arg_2.render(arg_1)

Renders the world in 3d - mode . If you want to render custom terrain you may override this method . Be careful that you still call the original method or else actors may not be rendered .


def Func ( arg_0 ) : arg_0 . relay = subprocess . Popen ( [ 'ntlmrelayx.py' , '-6' , '-tf' , arg_0 . targets_file , '-w' , '-l' , arg_0 . directory , '-of' , arg_0 . output_file ] , cwd = arg_0 . directory ) arg_0 . responder = subprocess . Popen ( [ 'responder' , '-I' , arg_0 . interface_name ] )

def Func(arg_0):
        """
            Starts the ntlmrelayx.py and responder processes.
            Assumes you have these programs in your path.
        """
        arg_0.relay = subprocess.Popen(['ntlmrelayx.py', '-6', '-tf', arg_0.targets_file, '-w', '-l', arg_0.directory, '-of', arg_0.output_file], cwd=arg_0.directory)
        arg_0.responder = subprocess.Popen(['responder', '-I', arg_0.interface_name])

Starts the ntlmrelayx . py and responder processes . Assumes you have these programs in your path .


def
Func
(
arg_0
,
arg_1
=
1
)
:
if
not
arg_0
.
ready
(
)
:
arg_0
.
wait
(
arg_1
)
if
arg_0
.
_ready
:
if
arg_0
.
_success
:
return
arg_0
.
_result
else
:
raise
arg_0
.
_exception
else
:
raise
error
.
TimeoutError
(
"Result not ready."
)

def Func(arg_0, arg_1=-1):
        """Return the result when it arrives.

        If `timeout` is not ``None`` and the result does not arrive within
        `timeout` seconds then ``TimeoutError`` is raised. If the
        remote call raised an exception then that exception will be reraised
        by Func() inside a `RemoteError`.
        """
        if not arg_0.ready():
            arg_0.wait(arg_1)

        if arg_0._ready:
            if arg_0._success:
                return arg_0._result
            else:
                raise arg_0._exception
        else:
            raise error.TimeoutError("Result not ready.")

Return the result when it arrives.

        If `timeout` is not ``None`` and the result does not arrive within
        `timeout` seconds then ``TimeoutError`` is raised. If the
        remote call raised an exception then that exception will be reraised
        by get() inside a `RemoteError`.