def Func(arg_0, arg_1):
        """Return the omission key.

        Parameters
        ----------
        word : str
            The word to transform into its omission key

        Returns
        -------
        str
            The omission key

        Examples
        --------
        >>> ok = OmissionKey()
        >>> ok.Func('The quick brown fox jumped over the lazy dog.')
        'JKQXZVWYBFMGPDHCLNTREUIOA'
        >>> ok.Func('Christopher')
        'PHCTSRIOE'
        >>> ok.Func('Niall')
        'LNIA'

        """
        arg_1 = unicode_normalize('NFKD', text_type(arg_1.upper()))
        arg_1 = ''.join(c for c in arg_1 if c in arg_0._letters)

        arg_2 = ''

        # add consonants in order supplied by _consonants (no duplicates)
        for arg_3 in arg_0._consonants:
            if arg_3 in arg_1:
                arg_2 += arg_3

        # add vowels in order they appeared in the word (no duplicates)
        for arg_3 in arg_1:
            if arg_3 not in arg_0._consonants and arg_3 not in arg_2:
                arg_2 += arg_3

        return arg_2

Return the omission key.

        Parameters
        ----------
        word : str
            The word to transform into its omission key

        Returns
        -------
        str
            The omission key

        Examples
        --------
        >>> ok = OmissionKey()
        >>> ok.fingerprint('The quick brown fox jumped over the lazy dog.')
        'JKQXZVWYBFMGPDHCLNTREUIOA'
        >>> ok.fingerprint('Christopher')
        'PHCTSRIOE'
        >>> ok.fingerprint('Niall')
        'LNIA'


def Func ( arg_0 , arg_1 = arg_2 . CASH_ON_DELIVERY ) : arg_4 = { 'paymentMethod' : arg_1 } return arg_0 . __post ( '/PaymentOptions/SetPaymentMethod' , json = arg_4 )

def Func(arg_0, arg_1=arg_2.CASH_ON_DELIVERY):
        '''
        Select the payment method going to be used to make a purchase.

        :param int method: Payment method id.
        :return: A response having set the payment option.
        :rtype: requests.Response
        '''
        arg_4 = {'paymentMethod': arg_1}
        return arg_0.__post('/PaymentOptions/SetPaymentMethod', json=arg_4)

Select the payment method going to be used to make a purchase .


def Func ( arg_0 , arg_1 : arg_2 ) -> arg_2 : arg_3 = { 'response' : { 'shouldEndSession' : False , 'outputSpeech' : { 'type' : 'PlainText' , 'text' : arg_0 . config [ 'unsupported_message' ] } , 'card' : { 'type' : 'Simple' , 'content' : arg_0 . config [ 'unsupported_message' ] } } } arg_3 = arg_0 . _generate_response ( arg_3 , arg_1 ) return arg_3

def Func(arg_0, arg_1: arg_2) -> arg_2:
        """Handles all unsupported types of Alexa requests. Returns standard message.

        Args:
            request: Alexa request.
        Returns:
            response: "response" part of response dict conforming Alexa specification.
        """
        arg_3 = {
            'response': {
                'shouldEndSession': False,
                'outputSpeech': {
                    'type': 'PlainText',
                    'text': arg_0.config['unsupported_message']
                },
                'card': {
                    'type': 'Simple',
                    'content': arg_0.config['unsupported_message']
                }
            }
        }

        arg_3 = arg_0._generate_response(arg_3, arg_1)

        return arg_3

Handles all unsupported types of Alexa requests . Returns standard message .


def Func(arg_0, arg_1):
        """
        Notify listeners that an instruction has been executed.
        """
        arg_0._icount += 1
        arg_0._publish('did_execute_instruction', arg_0._last_pc, arg_0.PC, arg_1)

Notify listeners that an instruction has been executed .


The decorator to mark deprecated functions.

def Func(arg_0):
    """The decorator to mark Func functions."""
    from traceback import extract_stack
    assert arg_0, "`message` argument in @Func is required."

    def Func_decorator(arg_1):
        def arg_5(*arg_2, **arg_3):
            arg_4 = extract_stack()
            assert len(arg_4) >= 2 and arg_4[-1][2] == "decorator_invisible", "Got confusing stack... %r" % arg_4
            print("[WARNING] in %s line %d:" % (arg_4[-2][0], arg_4[-2][1]))
            print("    >>> %s" % (arg_4[-2][3] or "????"))
            print("        ^^^^ %s" % arg_0)
            return arg_1(*arg_2, **arg_3)

        arg_5.__doc__ = arg_0
        arg_5.__name__ = arg_1.__name__
        arg_5.__module__ = arg_1.__module__
        arg_5.__Func__ = True
        return arg_5

    return Func_decorator

The decorator to mark deprecated functions .


return -1 * _largest_integer_by_dtype(dt)

def
Func
(
arg_0
)
:
if
not
_is_known_dtype
(
arg_0
)
:
raise
TypeError
(
"Unrecognized dtype: {}"
.
format
(
arg_0
.
name
)
)
if
_is_known_unsigned_by_dtype
(
arg_0
)
:
return
0
return
1
*
_largest_integer_by_dtype
(
arg_0
)

def Func(arg_0):
  """Helper returning the smallest integer exactly representable by dtype."""
  if not _is_known_dtype(arg_0):
    raise TypeError("Unrecognized dtype: {}".format(arg_0.name))
  if _is_known_unsigned_by_dtype(arg_0):
    return 0
  return -1 * _largest_integer_by_dtype(arg_0)

Helper returning the smallest integer exactly representable by dtype .


def Func ( ) : arg_0 = wave . open ( 'audio.wav' , mode = 'wb' ) arg_0 . setnchannels ( 2 ) arg_1 = pyaudio . PyAudio ( ) arg_0 . setsampwidth ( arg_1 . get_sample_size ( pyaudio . paInt16 ) ) arg_0 . setframerate ( arg_1 . get_default_input_device_info ( ) [ 'defaultSampleRate' ] ) try : yield arg_0 finally : arg_0 . close ( )

def Func():
    """
    Returns a file handle which is used to record audio
    """
    arg_0 = wave.open('audio.wav', mode='wb')
    arg_0.setnchannels(2)
    arg_1 = pyaudio.PyAudio()
    arg_0.setsampwidth(arg_1.get_sample_size(pyaudio.paInt16))
    arg_0.setframerate(arg_1.get_default_input_device_info()['defaultSampleRate'])
    try:
        yield arg_0
    finally:
        arg_0.close()


def Func ( arg_0 , arg_1 , arg_2 ) : setattr ( arg_0 , arg_1 , getattr ( arg_0 , arg_1 , arg_2 ) )

def Func(arg_0, arg_1, arg_2):
    """
    Patch a method onto an object if it isn't already there.
    """
    setattr(arg_0, arg_1, getattr(arg_0, arg_1, arg_2))

Patch a method onto an object if it isn t already there .


return sum(s1 != s2 for s1, s2 in zip(str1, str2))

def
Func
(
arg_0
,
arg_1
)
:
if
len
(
arg_0
)
!=
len
(
arg_1
)
:
raise
VisualizationError
(
'Strings not same length.'
)
return
sum
(
arg_2
!=
arg_3
for
arg_2
,
arg_3
in
zip
(
arg_0
,
arg_1
)
)

def Func(arg_0, arg_1):
    """Calculate the Hamming distance between two bit strings

    Args:
        str1 (str): First string.
        str2 (str): Second string.
    Returns:
        int: Distance between strings.
    Raises:
        VisualizationError: Strings not same length
    """
    if len(arg_0) != len(arg_1):
        raise VisualizationError('Strings not same length.')
    return sum(arg_2 != arg_3 for arg_2, arg_3 in zip(arg_0, arg_1))


(permutationsFilePath, options,
                                 outputLabel, permWorkDir)

def Func(arg_0, arg_1,
                                 arg_2, arg_3):
  """
  Starts a swarm, given a path to a permutations.py script.

  This function is meant to be used with a CLI wrapper that passes command line
  arguments in through the options parameter.

  @param permutationsFilePath {string} Path to permutations.py.
  @param options {dict} CLI options.
  @param outputLabel {string} Label for output.
  @param permWorkDir {string} Location of working directory.

  @returns {object} Model parameters.
  """
  global arg_4
  if "verbosityCount" in arg_1:
    arg_4 = arg_1["verbosityCount"]
    del arg_1["verbosityCount"]
  else:
    arg_4 = 1

  _setupInterruptHandling()

  arg_1["permutationsScriptPath"] = arg_0
  arg_1["outputLabel"] = arg_2
  arg_1["outDir"] = arg_3
  arg_1["permWorkDir"] = arg_3

  # Assume it's a permutations python script
  arg_5 = _injectDefaultOptions(arg_1)
  _validateOptions(arg_5)

  return _runAction(arg_5)

Starts a swarm given a path to a permutations . py script .


Lets a user join a room on a specific Namespace.

def Func ( arg_0 , arg_1 ) : arg_0 . socket . rooms . add ( arg_0 . _get_room_name ( arg_1 ) )

def Func(arg_0, arg_1):
        """Lets a user Func a room on a specific Namespace."""
        arg_0.socket.rooms.add(arg_0._get_room_name(arg_1))

Lets a user join a room on a specific Namespace .


def Func(arg_0, arg_1=1.0, arg_2=(0.0, 0.0, 0.0)):
    """Select all vertices within a spherical radius

    Args:
        radius (float): radius of the sphere
        center_pt (3 coordinate tuple or list): center point of the sphere

    Layer stack:
        No impacts

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_3 = 'sqrt((x-{})^2+(y-{})^2+(z-{})^2)<={}'.format(
        arg_2[0], arg_2[1], arg_2[2], arg_1)
    vert_function(arg_0, arg_3=arg_3)
    return None


def Func ( arg_0 , arg_1 , arg_2 ) : def _get_outname ( arg_3 ) : arg_4 = re . sub ( ':0$' , '' , arg_3 ) arg_4 = arg_4 . lstrip ( 'lm/' ) arg_4 = re . sub ( '/rnn/' , '/RNN/' , arg_4 ) arg_4 = re . sub ( '/multi_rnn_cell/' , '/MultiRNNCell/' , arg_4 ) arg_4 = re . sub ( '/cell_' , '/Cell' , arg_4 ) arg_4 = re . sub ( '/lstm_cell/' , '/LSTMCell/' , arg_4 ) if '/RNN/' in arg_4 : if 'projection' in arg_4 : arg_4 = re . sub ( 'projection/kernel' , 'W_P_0' , arg_4 ) else : arg_4 = re . sub ( '/kernel' , '/W_0' , arg_4 ) arg_4 = re . sub ( '/bias' , '/B' , arg_4 ) return arg_4 arg_5 = tf . train . latest_checkpoint ( arg_0 ) arg_6 = tf . ConfigProto ( allow_soft_placement = True ) with tf . Graph ( ) . as_default ( ) : with tf . Session ( arg_6 = arg_6 ) as sess : with tf . variable_scope ( 'lm' ) : LanguageModel ( arg_2 , False ) arg_7 = tf . train . Saver ( ) arg_7 . restore ( sess , arg_5 ) with h5py . File ( arg_1 , 'w' ) as fout : for arg_8 in tf . trainable_variables ( ) : if arg_8 . name . find ( 'softmax' ) >= 0 : continue arg_4 = _get_outname ( arg_8 . name ) arg_9 = arg_8 . get_shape ( ) . as_list ( ) arg_10 = fout . create_dataset ( arg_4 , arg_9 , dtype = 'float32' ) arg_11 = sess . run ( [ arg_8 ] ) [ 0 ] arg_10 [ ... ] = arg_11

def Func(arg_0, arg_1, arg_2):
    """
    Dump the trained weights from a model to a HDF5 file.
    """

    def _get_outname(arg_3):
        arg_4 = re.sub(':0$', '', arg_3)
        arg_4 = arg_4.lstrip('lm/')
        arg_4 = re.sub('/rnn/', '/RNN/', arg_4)
        arg_4 = re.sub('/multi_rnn_cell/', '/MultiRNNCell/', arg_4)
        arg_4 = re.sub('/cell_', '/Cell', arg_4)
        arg_4 = re.sub('/lstm_cell/', '/LSTMCell/', arg_4)
        if '/RNN/' in arg_4:
            if 'projection' in arg_4:
                arg_4 = re.sub('projection/kernel', 'W_P_0', arg_4)
            else:
                arg_4 = re.sub('/kernel', '/W_0', arg_4)
                arg_4 = re.sub('/bias', '/B', arg_4)
        return arg_4

    arg_5 = tf.train.latest_checkpoint(arg_0)

    arg_6 = tf.ConfigProto(allow_soft_placement=True)
    with tf.Graph().as_default():
        with tf.Session(arg_6=arg_6) as sess:
            with tf.variable_scope('lm'):
                LanguageModel(arg_2, False)  # Create graph
                # we use the "Saver" class to load the variables
                arg_7 = tf.train.Saver()
                arg_7.restore(sess, arg_5)

            with h5py.File(arg_1, 'w') as fout:
                for arg_8 in tf.trainable_variables():
                    if arg_8.name.find('softmax') >= 0:
                        # don't dump these
                        continue
                    arg_4 = _get_outname(arg_8.name)
                    # print("Saving variable {0} with name {1}".format(
                    #     v.name, outname))
                    arg_9 = arg_8.get_shape().as_list()
                    arg_10 = fout.create_dataset(arg_4, arg_9, dtype='float32')
                    arg_11 = sess.run([arg_8])[0]
                    arg_10[...] = arg_11

Dump the trained weights from a model to a HDF5 file .


def
Func
(
arg_0
)
:
arg_0
.
log
.
debug
(
"creating overlayed protocols plot"
)
arg_0
.
figure
(
)
plt
.
plot
(
arg_0
.
abf
.
protoX
,
arg_0
.
abf
.
protoY
,
color
=
'r'
)
arg_0
.
marginX
=
0
arg_0
.
decorate
(
protocol
=
True
)

def Func(arg_0):
        """plot the current sweep protocol."""
        arg_0.log.debug("creating overlayed protocols plot")
        arg_0.figure()
        plt.plot(arg_0.abf.protoX,arg_0.abf.protoY,color='r')
        arg_0.marginX=0
        arg_0.decorate(protocol=True)


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Subscribe to the passed pair's raw order book channel.

        :param pair: str, Symbol pair to request data for
        :param prec:
        :param kwargs:
        :return:
        """
        arg_4 = ('raw_book', arg_1)
        arg_2 = 'R0' if arg_2 is None else arg_2
        arg_0._subscribe('book', arg_4, arg_1=arg_1, arg_2=arg_2, **arg_3)

Subscribe to the passed pair s raw order book channel .


return self.fetch_json(
            uri_path='/boards/' + self.id,
            query_params=query_params or {}
        )

def Func ( arg_0 , arg_1 = None ) : return arg_0 . fetch_json ( uri_path = '/boards/' + arg_0 . id , arg_1 = arg_1 or { } )

def Func(arg_0, arg_1=None):
        '''
        Get all information for this board. Returns a dictionary of values.
        '''
        return arg_0.fetch_json(
            uri_path='/boards/' + arg_0.id,
            arg_1=arg_1 or {}
        )

Get all information for this board . Returns a dictionary of values .


def Func(arg_0):
    """Given a dictionary or JSON string; return a dictionary.

    Args:
        json_data(dict, str): Input JSON object.

    Returns:
        A Python dictionary with the contents of the JSON object.

    Raises:
        TypeError: If the input object is not a dictionary or string.

    """
    if isinstance(arg_0, dict):
        return arg_0
    elif isinstance(arg_0, basestring):
        return json.loads(arg_0, object_hook=OrderedDict)
    else:
        raise TypeError(
            "'json_data' must be a dictionary or valid JSON string; "
            "received: {!r}".format(arg_0)
        )

Given a dictionary or JSON string ; return a dictionary .


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Authenticate itself in other means.

        Other means means is described in `Section 3.2.1`_.

        .. _`Section 3.2.1`: http://tools.ietf.org/html/rfc6749#section-3.2.1
        """
        arg_4, arg_5 = arg_0._get_client_creds_from_request(arg_1)
        log.debug('Authenticate client %r', arg_4)

        arg_6 = arg_0._clientgetter(arg_4)
        if not arg_6:
            log.debug('Authenticate client failed, client not found.')
            return False

        arg_1.client = arg_6

        # http://tools.ietf.org/html/rfc6749#section-2
        # The client MAY omit the parameter if the client secret is an empty string.
        if hasattr(arg_6, 'client_secret') and arg_6.client_secret != arg_5:
            log.debug('Authenticate client failed, secret not match.')
            return False

        log.debug('Authenticate client success.')
        return True


def Func ( arg_0 , arg_1 = None , arg_2 = 'ipython_edit_' ) : arg_3 = tempfile . mktemp ( '.py' , arg_2 ) arg_0 . tempfiles . append ( arg_3 ) if arg_1 : arg_4 = open ( arg_3 , 'w' ) arg_4 . write ( arg_1 ) arg_4 . close ( ) return arg_3

def Func(arg_0, arg_1=None, arg_2='ipython_edit_'):
        """Make a new tempfile and return its filename.

        This makes a call to tempfile.mktemp, but it registers the created
        filename internally so ipython cleans it up at exit time.

        Optional inputs:

          - data(None): if data is given, it gets written out to the temp file
          immediately, and the file is closed again."""

        arg_3 = tempfile.mktemp('.py', arg_2)
        arg_0.tempfiles.append(arg_3)

        if arg_1:
            arg_4 = open(arg_3,'w')
            arg_4.write(arg_1)
            arg_4.close()
        return arg_3

Make a new tempfile and return its filename .


(alpha=0, direction=(0.0, 1.0), name=None, deterministic=False, random_state=None)

return Convolve(create_matrices, name=name, deterministic=deterministic, random_state=random_state)

def Func(arg_0=0, arg_1=(0.0, 1.0), arg_2=None, arg_3=False, arg_4=None):
    """
    Augmenter that detects edges that have certain directions and marks them
    in a black and white image and then overlays the result with the original
    image.

    dtype support::

        See ``imgaug.augmenters.convolutional.Convolve``.

    Parameters
    ----------
    alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Visibility of the sharpened image. At 0, only the original image is
        visible, at 1.0 only its sharpened version is visible.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    direction : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Angle of edges to pronounce, where 0 represents 0 degrees and 1.0
        represents 360 degrees (both clockwise, starting at the top).
        Default value is ``(0.0, 1.0)``, i.e. pick a random angle per image.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = Func(alpha=1.0, direction=0)

    turns input images into edge images in which edges are detected from
    top side of the image (i.e. the top sides of horizontal edges are
    added to the output).

    >>> aug = Func(alpha=1.0, direction=90/360)

    same as before, but detecting edges from the right (right side of each
    vertical edge).

    >>> aug = Func(alpha=1.0, direction=(0.0, 1.0))

    same as before, but detecting edges from a variable direction (anything
    between 0 and 1.0, i.e. 0 degrees and 360 degrees, starting from the
    top and moving clockwise).

    >>> aug = Func(alpha=(0.0, 0.3), direction=0)

    generates edge images (edges detected from the top) and overlays them
    with the input images by a variable amount between 0 and 30 percent
    (e.g. for 0.3 then ``0.7*old_image + 0.3*edge_image``).

    """
    arg_5 = iap.handle_continuous_param(arg_0, "alpha", value_range=(0, 1.0), tuple_to_uniform=True,
                                              list_to_choice=True)
    arg_6 = iap.handle_continuous_param(arg_1, "direction", value_range=None, tuple_to_uniform=True,
                                                  list_to_choice=True)

    def create_matrices(arg_7, arg_8, arg_9):
        arg_10 = arg_5.draw_sample(arg_4=arg_9)
        ia.do_assert(0 <= arg_10 <= 1.0)
        arg_11 = arg_6.draw_sample(arg_4=arg_9)

        arg_12 = int(arg_11 * 360) % 360
        arg_13 = np.deg2rad(arg_12)
        arg_14 = np.cos(arg_13 - 0.5*np.pi)
        arg_15 = np.sin(arg_13 - 0.5*np.pi)
        arg_16 = np.array([arg_14, arg_15])

        arg_17 = np.array([
            [0, 0, 0],
            [0, 0, 0],
            [0, 0, 0]
        ], dtype=np.float32)
        for arg_14 in [-1, 0, 1]:
            for arg_15 in [-1, 0, 1]:
                if (arg_14, arg_15) != (0, 0):
                    arg_18 = np.array([arg_14, arg_15])
                    arg_19 = np.rad2deg(ia.angle_between_vectors(arg_18, arg_16))
                    arg_20 = arg_19 / 180
                    arg_21 = (1 - arg_20)**4
                    arg_17[arg_15+1, arg_14+1] = arg_21
        arg_17 = arg_17 / np.sum(arg_17)
        arg_17 = arg_17 * (-1)
        arg_17[1, 1] = 1

        arg_22 = np.array([
            [0, 0, 0],
            [0, 1, 0],
            [0, 0, 0]
        ], dtype=np.float32)

        arg_23 = (1-arg_10) * arg_22 + arg_10 * arg_17

        return [arg_23] * arg_8

    if arg_2 is None:
        arg_2 = "Unnamed%s" % (ia.caller_name(),)

    return Convolve(create_matrices, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Augmenter that detects edges that have certain directions and marks them
    in a black and white image and then overlays the result with the original
    image.

    dtype support::

        See ``imgaug.augmenters.convolutional.Convolve``.

    Parameters
    ----------
    alpha : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Visibility of the sharpened image. At 0, only the original image is
        visible, at 1.0 only its sharpened version is visible.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    direction : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Angle of edges to pronounce, where 0 represents 0 degrees and 1.0
        represents 360 degrees (both clockwise, starting at the top).
        Default value is ``(0.0, 1.0)``, i.e. pick a random angle per image.

            * If an int or float, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = DirectedEdgeDetect(alpha=1.0, direction=0)

    turns input images into edge images in which edges are detected from
    top side of the image (i.e. the top sides of horizontal edges are
    added to the output).

    >>> aug = DirectedEdgeDetect(alpha=1.0, direction=90/360)

    same as before, but detecting edges from the right (right side of each
    vertical edge).

    >>> aug = DirectedEdgeDetect(alpha=1.0, direction=(0.0, 1.0))

    same as before, but detecting edges from a variable direction (anything
    between 0 and 1.0, i.e. 0 degrees and 360 degrees, starting from the
    top and moving clockwise).

    >>> aug = DirectedEdgeDetect(alpha=(0.0, 0.3), direction=0)

    generates edge images (edges detected from the top) and overlays them
    with the input images by a variable amount between 0 and 30 percent
    (e.g. for 0.3 then ``0.7*old_image + 0.3*edge_image``).

Augmenter that detects edges that have certain directions and marks them in a black and white image and then overlays the result with the original image .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
requests
.
get
(
arg_1
,
headers
=
{
'Authorization'
:
'Token {}'
.
format
(
arg_0
.
_user_token
)
}
,
verify
=
False
)
if
arg_2
.
status_code
is
403
:
raise
ValueError
(
"Access Denied"
)
else
:
return
arg_2
except
requests
.
exceptions
.
ConnectionError
as
e
:
if
str
(
e
)
==
'403 Client Error: Forbidden'
:
raise
ValueError
(
'Access Denied'
)
else
:
raise
e

def Func(arg_0, arg_1):
        """
        Get a response object for a given url.

        Arguments:
            url (str): The url make a get to
            token (str): The authentication token

        Returns:
            obj: The response object
        """
        try:
            arg_2 = requests.get(arg_1, headers={
                'Authorization': 'Token {}'.format(arg_0._user_token)
            }, verify=False)
            if arg_2.status_code is 403:
                raise ValueError("Access Denied")
            else:
                return arg_2
        except requests.exceptions.ConnectionError as e:
            if str(e) == '403 Client Error: Forbidden':
                raise ValueError('Access Denied')
            else:
                raise e


def Func(arg_0):
        """
        Return Func thumbnails in a dict format.
        """
        if arg_0._thumbnails is not None:
            return arg_0._thumbnails
        arg_0._refresh_cache()
        return arg_0._thumbnails

Return all thumbnails in a dict format .


def Func ( arg_0 ) : arg_1 = request . args . to_dict ( ) arg_1 [ 'scopes' ] = request . args . getlist ( 'scopes' ) arg_2 = arg_1 . pop ( 'return_url' , None ) if arg_2 is None : arg_2 = request . referrer or '/' arg_3 = arg_0 . _make_flow ( arg_2 = arg_2 , ** arg_1 ) arg_4 = arg_3 . step1_get_authorize_url ( ) return redirect ( arg_4 )

def Func(arg_0):
        """Flask view that starts the authorization flow.

        Starts flow by redirecting the user to the OAuth2 provider.
        """
        arg_1 = request.args.to_dict()

        # Scopes will be passed as mutliple args, and to_dict() will only
        # return one. So, we use getlist() to get all of the scopes.
        arg_1['scopes'] = request.args.getlist('scopes')

        arg_2 = arg_1.pop('return_url', None)
        if arg_2 is None:
            arg_2 = request.referrer or '/'

        arg_3 = arg_0._make_flow(arg_2=arg_2, **arg_1)
        arg_4 = arg_3.step1_get_authorize_url()

        return redirect(arg_4)

Flask view that starts the authorization flow .


(lclist,
                        outdir,
                        lc_catalog_pickle,
                        neighbor_radius_arcsec,
                        maxobjects=None,
                        deredden=True,
                        custom_bandpasses=None,
                        lcformat='hat-sql',
                        lcformatdir=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = True , arg_6 = None , arg_7 = 'hat-sql' , arg_8 = None ) : if not os . path . exists ( arg_1 ) : os . makedirs ( arg_1 ) if arg_4 : arg_0 = arg_0 [ : arg_4 ] with open ( arg_2 , 'rb' ) as infd : arg_9 = pickle . load ( infd ) arg_10 = arg_9 [ 'kdtree' ] arg_11 = arg_9 [ 'objects' ] [ 'objectid' ] arg_12 = arg_9 [ 'objects' ] [ 'lcfname' ] arg_13 = [ ( x , arg_1 , arg_10 , arg_11 , arg_12 , arg_3 , arg_5 , arg_6 , arg_7 , arg_8 ) for x in arg_0 ] for arg_14 in tqdm ( arg_13 ) : arg_15 = _starfeatures_worker ( arg_14 ) return arg_15

def Func(arg_0,
                        arg_1,
                        arg_2,
                        arg_3,
                        arg_4=None,
                        arg_5=True,
                        arg_6=None,
                        arg_7='hat-sql',
                        arg_8=None):
    '''This drives the `get_starfeatures` function for a collection of LCs.

    Parameters
    ----------

    lclist : list of str
        The list of light curve file names to process.

    outdir : str
        The output directory where the results will be placed.

    lc_catalog_pickle : str
        The path to a catalog containing at a dict with least:

        - an object ID array accessible with `dict['objects']['objectid']`

        - an LC filename array accessible with `dict['objects']['lcfname']`

        - a `scipy.spatial.KDTree` or `cKDTree` object to use for finding
          neighbors for each object accessible with `dict['kdtree']`

        A catalog pickle of the form needed can be produced using
        :py:func:`astrobase.lcproc.catalogs.make_lclist` or
        :py:func:`astrobase.lcproc.catalogs.filter_lclist`.

    neighbor_radius_arcsec : float
        This indicates the radius in arcsec to search for neighbors for this
        object using the light curve catalog's `kdtree`, `objlist`, `lcflist`,
        and in GAIA.

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

    deredden : bool
        This controls if the colors and any color classifications will be
        dereddened using 2MASS DUST.

    custom_bandpasses : dict or None
        This is a dict used to define any custom bandpasses in the
        `in_objectinfo` dict you want to make this function aware of and
        generate colors for. Use the format below for this dict::

            {
            '<bandpass_key_1>':{'dustkey':'<twomass_dust_key_1>',
                                'label':'<band_label_1>'
                                'colors':[['<bandkey1>-<bandkey2>',
                                           '<BAND1> - <BAND2>'],
                                          ['<bandkey3>-<bandkey4>',
                                           '<BAND3> - <BAND4>']]},
            .
            ...
            .
            '<bandpass_key_N>':{'dustkey':'<twomass_dust_key_N>',
                                'label':'<band_label_N>'
                                'colors':[['<bandkey1>-<bandkey2>',
                                           '<BAND1> - <BAND2>'],
                                          ['<bandkey3>-<bandkey4>',
                                           '<BAND3> - <BAND4>']]},
            }

        Where:

        `bandpass_key` is a key to use to refer to this bandpass in the
        `objectinfo` dict, e.g. 'sdssg' for SDSS g band

        `twomass_dust_key` is the key to use in the 2MASS DUST result table for
        reddening per band-pass. For example, given the following DUST result
        table (using http://irsa.ipac.caltech.edu/applications/DUST/)::

            |Filter_name|LamEff |A_over_E_B_V_SandF|A_SandF|A_over_E_B_V_SFD|A_SFD|
            |char       |float  |float             |float  |float           |float|
            |           |microns|                  |mags   |                |mags |
             CTIO U       0.3734              4.107   0.209            4.968 0.253
             CTIO B       0.4309              3.641   0.186            4.325 0.221
             CTIO V       0.5517              2.682   0.137            3.240 0.165
            .
            .
            ...

        The `twomass_dust_key` for 'vmag' would be 'CTIO V'. If you want to
        skip DUST lookup and want to pass in a specific reddening magnitude
        for your bandpass, use a float for the value of
        `twomass_dust_key`. If you want to skip DUST lookup entirely for
        this bandpass, use None for the value of `twomass_dust_key`.

        `band_label` is the label to use for this bandpass, e.g. 'W1' for
        WISE-1 band, 'u' for SDSS u, etc.

        The 'colors' list contains color definitions for all colors you want
        to generate using this bandpass. this list contains elements of the
        form::

            ['<bandkey1>-<bandkey2>','<BAND1> - <BAND2>']

        where the the first item is the bandpass keys making up this color,
        and the second item is the label for this color to be used by the
        frontends. An example::

            ['sdssu-sdssg','u - g']

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

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

    Returns
    -------

    list of str
        A list of all star features pickles produced.

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

    if arg_4:
        arg_0 = arg_0[:arg_4]

    # read in the kdtree pickle
    with open(arg_2, 'rb') as infd:
        arg_9 = pickle.load(infd)

    arg_10 = arg_9['kdtree']
    arg_11 = arg_9['objects']['objectid']
    arg_12 = arg_9['objects']['lcfname']

    arg_13 = [(x, arg_1, arg_10, arg_11, arg_12,
              arg_3,
              arg_5, arg_6,
              arg_7, arg_8) for x in arg_0]

    for arg_14 in tqdm(arg_13):
        arg_15 = _starfeatures_worker(arg_14)

    return arg_15

This drives the get_starfeatures function for a collection of LCs .


def Func(arg_0):
        """Iterator over sections, option names, and option values.

        This iterator is also implemented at the section level. The two loops
        produce the same output::

            for sct, opt, val in conf.Func():
                print(sct, opt, val)

            for sct in conf.sections_():
                for opt, val in conf[sct].Func():
                    print(sct, opt, val)

        Yields:
            tuples with sections, option names, and option values.
        """
        for arg_1, arg_2 in arg_0.options_():
            yield arg_1, arg_2, arg_0[arg_1][arg_2]

Iterator over sections, option names, and option values.

        This iterator is also implemented at the section level. The two loops
        produce the same output::

            for sct, opt, val in conf.opt_vals_():
                print(sct, opt, val)

            for sct in conf.sections_():
                for opt, val in conf[sct].opt_vals_():
                    print(sct, opt, val)

        Yields:
            tuples with sections, option names, and option values.

Iterator over sections option names and option values .


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
arg_0
.
command
(
"NEXT"
)
if
arg_1
!=
223
:
raise
NNTPReplyError
(
arg_1
,
arg_2
)
arg_3
=
arg_2
.
split
(
,
3
)
try
:
arg_4
=
int
(
arg_3
[
0
]
)
arg_5
=
arg_3
[
1
]
except
(
IndexError
,
ValueError
)
:
raise
NNTPDataError
(
"Invalid NEXT status"
)
return
arg_4
,
arg_5

def Func(arg_0):
        """NEXT command.
        """
        arg_1, arg_2 = arg_0.command("NEXT")
        if arg_1 != 223:
            raise NNTPReplyError(arg_1, arg_2)

        arg_3 = arg_2.split(None, 3)
        try:
            arg_4 = int(arg_3[0])
            arg_5 = arg_3[1]
        except (IndexError, ValueError):
            raise NNTPDataError("Invalid NEXT status")

        return arg_4, arg_5


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
{
}
arg_3
=
0
if
isinstance
(
arg_1
,
str
)
:
arg_1
=
json_iter
(
arg_1
)
for
arg_4
in
arg_1
:
arg_5
=
arg_4
[
"graf"
]
arg_6
=
[
WordNode
.
_make
(
x
)
for
x
in
arg_5
]
arg_7
=
" "
.
join
(
[
w
.
raw
for
w
in
arg_6
]
)
arg_8
=
mh_digest
(
[
str
(
w
.
word_id
)
for
w
in
arg_6
]
)
arg_9
=
sum
(
[
arg_8
.
jaccard
(
m
)
*
rl
.
rank
for
rl
,
m
in
arg_0
]
)
arg_2
[
arg_7
]
=
(
arg_9
,
arg_3
)
arg_3
+=
1
for
arg_7
,
(
arg_9
,
arg_3
)
in
sorted
(
arg_2
.
items
(
)
,
key
=
lambda
x
:
x
[
1
]
[
0
]
,
reverse
=
True
)
:
yield
SummarySent
(
arg_9
=
arg_9
,
idx
=
arg_3
,
arg_7
=
arg_7
)

def Func (arg_0, arg_1):
    """
    determine distance for each sentence
    """
    arg_2 = {}
    arg_3 = 0

    if isinstance(arg_1, str):
        arg_1 = json_iter(arg_1)

    for arg_4 in arg_1:
        arg_5 = arg_4["graf"]
        arg_6 = [WordNode._make(x) for x in arg_5]
        arg_7 = " ".join([w.raw for w in arg_6])

        arg_8 = mh_digest([str(w.word_id) for w in arg_6])
        arg_9 = sum([arg_8.jaccard(m) * rl.rank for rl, m in arg_0])
        arg_2[arg_7] = (arg_9, arg_3)
        arg_3 += 1

    for arg_7, (arg_9, arg_3) in sorted(arg_2.items(), key=lambda x: x[1][0], reverse=True):
        yield SummarySent(arg_9=arg_9, idx=arg_3, arg_7=arg_7)


return max(0, len(output.split(b'\n')) - 2)

def Func ( ) : if shutil . which ( 'nvidia-smi' ) is None : return 0 arg_0 = subprocess . check_output ( [ 'nvidia-smi' , '--query-gpu=gpu_name' , '--format=csv' ] ) return max ( 0 , len ( arg_0 . split ( b'\n' ) ) - 2 )

def Func():
    """
    Count the GPUs on this machine.
    """
    if shutil.which('nvidia-smi') is None:
        return 0
    arg_0 = subprocess.check_output(['nvidia-smi', '--query-gpu=gpu_name', '--format=csv'])
    return max(0, len(arg_0.split(b'\n')) - 2)


(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', res_type=None)

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', arg_13=None):
    '''Compute the hybrid constant-Q transform of an audio signal.

    Here, the hybrid CQT uses the pseudo CQT for higher frequencies where
    the hop_length is longer than half the filter length and the full CQT
    for lower frequencies.

    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`.

    res_type : string
        Resampling mode.  See `librosa.core.cqt` for details.

    Returns
    -------
    CQT : np.ndarray [shape=(n_bins, t), dtype=np.float]
        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.

    See Also
    --------
    cqt
    pseudo_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)

    # Get all CQT frequencies
    arg_14 = cqt_frequencies(arg_4, arg_3,
                            arg_5=arg_5,
                            arg_6=arg_6)

    # Compute the length of each constant-Q basis function
    arg_15 = filters.constant_q_lengths(arg_1, arg_3,
                                         arg_4=arg_4,
                                         arg_5=arg_5,
                                         arg_6=arg_6,
                                         arg_7=arg_7,
                                         arg_10=arg_10)

    # Determine which filters to use with Pseudo CQT
    # These are the ones that fit within 2 hop lengths after padding
    arg_16 = 2.0**np.ceil(np.log2(arg_15)) < 2 * arg_2

    arg_17 = int(np.sum(arg_16))

    arg_18 = arg_4 - arg_17
    arg_19 = []

    if arg_17 > 0:
        arg_20 = np.min(arg_14[arg_16])

        arg_19.append(pseudo_cqt(arg_0, arg_1,
                                   arg_2=arg_2,
                                   arg_3=arg_20,
                                   arg_4=arg_17,
                                   arg_5=arg_5,
                                   arg_6=arg_6,
                                   arg_7=arg_7,
                                   arg_8=arg_8,
                                   arg_9=arg_9,
                                   arg_10=arg_10,
                                   arg_11=arg_11,
                                   arg_12=arg_12))

    if arg_18 > 0:
        arg_19.append(np.abs(cqt(arg_0, arg_1,
                                   arg_2=arg_2,
                                   arg_3=arg_3,
                                   arg_4=arg_18,
                                   arg_5=arg_5,
                                   arg_6=arg_6,
                                   arg_7=arg_7,
                                   arg_8=arg_8,
                                   arg_9=arg_9,
                                   arg_10=arg_10,
                                   arg_11=arg_11,
                                   arg_12=arg_12,
                                   arg_13=arg_13)))

    return __trim_stack(arg_19, arg_4)

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


def Func(arg_0, arg_1):
        """ uct tree search """
        arg_2 = arg_1.color
        arg_3 = arg_0
        arg_4 = [arg_3]
        while True:
            arg_5 = arg_3.select(arg_1)
            if arg_5 == PASS:
                break
            arg_1.move(arg_5)
            arg_6 = arg_3.pos_child[arg_5]
            if not arg_6:
                arg_6 = arg_3.pos_child[arg_5] = UCTNode()
                arg_6.unexplored = arg_1.useful_moves()
                arg_6.pos = arg_5
                arg_6.parent = arg_3
                arg_4.append(arg_6)
                break
            arg_4.append(arg_6)
            arg_3 = arg_6
        arg_0.random_Funcout(arg_1)
        arg_0.update_path(arg_1, arg_2, arg_4)


(self, doc_id, nosave=False, score=1.0, payload=None,
                     replace=False, partial=False, language=None, **fields)

return self._add_document(doc_id, conn=None, nosave=nosave, score=score,
                                  payload=payload, replace=replace,
                                  partial=partial, language=language, **fields)

def Func(arg_0, arg_1, arg_2=False, arg_3=1.0, arg_4=None,
                     arg_5=False, arg_6=False, arg_7=None, **arg_8):
        """
        Add a single document to the index.

        ### Parameters

        - **doc_id**: the id of the saved document.
        - **nosave**: if set to true, we just index the document, and don't save a copy of it. This means that searches will just return ids.
        - **score**: the document ranking, between 0.0 and 1.0
        - **payload**: optional inner-index payload we can save for fast access in scoring functions
        - **replace**: if True, and the document already is in the index, we perform an update and reindex the document
        - **partial**: if True, the fields specified will be added to the existing document.
                       This has the added benefit that any fields specified with `no_index`
                       will not be reindexed again. Implies `replace`
        - **language**: Specify the language used for document tokenization.
        - **fields** kwargs dictionary of the document fields to be saved and/or indexed.
                     NOTE: Geo points shoule be encoded as strings of "lon,lat"
        """
        return arg_0._Func(arg_1, conn=None, arg_2=arg_2, arg_3=arg_3,
                                  arg_4=arg_4, arg_5=arg_5,
                                  arg_6=arg_6, arg_7=arg_7, **arg_8)


def Func ( arg_0 ) : arg_1 = amean ( arg_0 ) arg_2 = gmean ( arg_0 ) arg_3 = hmean ( arg_0 ) if math . isnan ( arg_1 ) or math . isnan ( arg_2 ) or math . isnan ( arg_3 ) : return float ( 'nan' ) while round ( arg_1 , 12 ) != round ( arg_2 , 12 ) and round ( arg_2 , 12 ) != round ( arg_3 , 12 ) : arg_1 , arg_2 , arg_3 = ( ( arg_1 + arg_2 + arg_3 ) / 3 , ( arg_1 * arg_2 * arg_3 ) ** ( 1 / 3 ) , 3 / ( 1 / arg_1 + 1 / arg_2 + 1 / arg_3 ) , ) return arg_1

def Func(arg_0):
    """Return arithmetic-geometric-harmonic mean.

    Iterates over arithmetic, geometric, & harmonic means until they
    converge to a single value (rounded to 12 digits), following the
    method described in :cite:`Raissouli:2009`.

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The arithmetic-geometric-harmonic mean of nums

    Examples
    --------
    >>> Func([1, 2, 3, 4])
    2.198327159900212
    >>> Func([1, 2])
    1.4142135623731884
    >>> Func([0, 5, 1000])
    335.0

    """
    arg_1 = amean(arg_0)
    arg_2 = gmean(arg_0)
    arg_3 = hmean(arg_0)
    if math.isnan(arg_1) or math.isnan(arg_2) or math.isnan(arg_3):
        return float('nan')
    while round(arg_1, 12) != round(arg_2, 12) and round(arg_2, 12) != round(
        arg_3, 12
    ):
        arg_1, arg_2, arg_3 = (
            (arg_1 + arg_2 + arg_3) / 3,
            (arg_1 * arg_2 * arg_3) ** (1 / 3),
            3 / (1 / arg_1 + 1 / arg_2 + 1 / arg_3),
        )
    return arg_1

Return arithmetic-geometric-harmonic mean.

    Iterates over arithmetic, geometric, & harmonic means until they
    converge to a single value (rounded to 12 digits), following the
    method described in :cite:`Raissouli:2009`.

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The arithmetic-geometric-harmonic mean of nums

    Examples
    --------
    >>> aghmean([1, 2, 3, 4])
    2.198327159900212
    >>> aghmean([1, 2])
    1.4142135623731884
    >>> aghmean([0, 5, 1000])
    335.0

Return arithmetic - geometric - harmonic mean .


(self, case_obj, chrom=None, start=None, end=None,
                       gene_obj=None, variant_type='clinical', category='snv',
                       rank_threshold=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
arg_6
=
'clinical'
,
arg_7
=
'snv'
,
arg_8
=
)
:
arg_8
=
arg_8
or
100
arg_9
=
if
arg_6
==
'clinical'
:
if
arg_7
==
'snv'
:
arg_9
=
arg_1
[
'vcf_files'
]
.
get
(
'vcf_snv'
)
elif
arg_7
==
'sv'
:
arg_9
=
arg_1
[
'vcf_files'
]
.
get
(
'vcf_sv'
)
elif
arg_7
==
'str'
:
arg_9
=
arg_1
[
'vcf_files'
]
.
get
(
'vcf_str'
)
elif
arg_6
==
'research'
:
if
arg_7
==
'snv'
:
arg_9
=
arg_1
[
'vcf_files'
]
.
get
(
'vcf_snv_research'
)
elif
arg_7
==
'sv'
:
arg_9
=
arg_1
[
'vcf_files'
]
.
get
(
'vcf_sv_research'
)
if
not
arg_9
:
raise
SyntaxError
(
"Vcf file does not seem to exist"
)
arg_10
=
VCF
(
arg_9
)
arg_11
=
""
if
arg_5
:
arg_2
=
arg_5
[
'chromosome'
]
arg_3
=
arg_5
[
'start'
]
arg_4
=
arg_5
[
'end'
]
if
arg_2
:
if
(
arg_3
and
arg_4
)
:
arg_11
=
"{0}:{1}-{2}"
.
format
(
arg_2
,
arg_3
,
arg_4
)
else
:
arg_11
=
"{0}"
.
format
(
arg_2
)
else
:
arg_8
=
arg_8
or
5
with
tempfile
.
NamedTemporaryFile
(
mode
=
'w'
,
delete
=
False
)
as
temp
:
arg_12
=
str
(
pathlib
.
Path
(
temp
.
name
)
)
for
arg_13
in
arg_10
.
raw_header
.
split
(
'\n'
)
:
if
len
(
arg_13
)
>
3
:
temp
.
write
(
arg_13
+
'\n'
)
for
arg_14
in
arg_10
(
arg_11
)
:
temp
.
write
(
str
(
arg_14
)
)
return
arg_12

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
                       arg_5=None, arg_6='clinical', arg_7='snv',
                       arg_8=None):
        """Produce a reduced vcf with variants from the specified coordinates
           This is used for the alignment viewer.

        Args:
            case_obj(dict): A case from the scout database
            variant_type(str): 'clinical' or 'research'. Default: 'clinical'
            category(str): 'snv' or 'sv'. Default: 'snv'
            rank_threshold(float): Only load variants above this score. Default: 5
            chrom(str): Load variants from a certain chromosome
            start(int): Specify the start position
            end(int): Specify the end position
            gene_obj(dict): A gene object from the database

        Returns:
            file_name(str): Path to the temporary file
        """
        arg_8 = arg_8 or -100

        arg_9 = None
        if arg_6 == 'clinical':
            if arg_7 == 'snv':
                arg_9 = arg_1['vcf_files'].get('vcf_snv')
            elif arg_7 == 'sv':
                arg_9 = arg_1['vcf_files'].get('vcf_sv')
            elif arg_7 == 'str':
                arg_9 = arg_1['vcf_files'].get('vcf_str')
        elif arg_6 == 'research':
            if arg_7 == 'snv':
                arg_9 = arg_1['vcf_files'].get('vcf_snv_research')
            elif arg_7 == 'sv':
                arg_9 = arg_1['vcf_files'].get('vcf_sv_research')

        if not arg_9:
            raise SyntaxError("Vcf file does not seem to exist")

        arg_10 = VCF(arg_9)
        arg_11 = ""

        if arg_5:
            arg_2 = arg_5['chromosome']
            arg_3 = arg_5['start']
            arg_4 = arg_5['end']

        if arg_2:
            if (arg_3 and arg_4):
                arg_11 = "{0}:{1}-{2}".format(arg_2, arg_3, arg_4)
            else:
                arg_11 = "{0}".format(arg_2)

        else:
            arg_8 = arg_8 or 5

        with tempfile.NamedTemporaryFile(mode='w', delete=False) as temp:
            arg_12 = str(pathlib.Path(temp.name))
            for arg_13 in arg_10.raw_header.split('\n'):
                if len(arg_13) > 3:
                    temp.write(arg_13 + '\n')
            for arg_14 in arg_10(arg_11):
                temp.write(str(arg_14))

        return arg_12

Produce a reduced vcf with variants from the specified coordinates This is used for the alignment viewer .


def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Build a dictionary of metadata for the requested object.
        """
        arg_4 = arg_3.get('maxwidth', None)
        arg_5 = arg_3.get('maxheight', None)

        arg_6, arg_7 = arg_0.provider_from_url(arg_1)

        arg_8 = {
            'version': '1.0',
            'url': arg_1,
            'provider_name': arg_7,
            'provider_url': arg_6,
            'type': arg_0.resource_type
        }

        # a hook
        arg_0.preprocess(arg_2, arg_8, **arg_3)

        # resize image if we have a photo, otherwise use the given maximums
        if arg_0.resource_type == 'photo' and arg_0.get_image(arg_2):
            arg_0.resize_photo(arg_2, arg_8, arg_4, arg_5)
        elif arg_0.resource_type in ('video', 'rich', 'photo'):
            arg_9, arg_10 = size_to_nearest(
                arg_4,
                arg_5,
                arg_0._meta.valid_sizes,
                arg_0._meta.force_fit
            )
            arg_8.update(arg_9=arg_9, arg_10=arg_10)

        # create a thumbnail
        if arg_0.get_image(arg_2):
            arg_0.thumbnail(arg_2, arg_8)

        # map attributes to the mapping dictionary.  if the attribute is
        # a callable, it must have an argument signature of
        # (self, obj)
        for arg_11 in ('title', 'author_name', 'author_url', 'html'):
            arg_0.map_attr(arg_8, arg_11, arg_2)

        # fix any urls
        if 'url' in arg_8:
            arg_8['url'] = relative_to_full(arg_8['url'], arg_1)

        if 'thumbnail_url' in arg_8:
            arg_8['thumbnail_url'] = relative_to_full(arg_8['thumbnail_url'], arg_1)

        if 'html' not in arg_8 and arg_8['type'] in ('video', 'rich'):
            arg_8['html'] = arg_0.render_html(arg_2, context=Context(arg_8))

        # a hook
        arg_0.postprocess(arg_2, arg_8, **arg_3)

        return arg_8

Build a dictionary of metadata for the requested object .


return {key: value for key, value in items}

def Func ( arg_0 ) : arg_1 = arg_0 . split ( "&" ) arg_1 = [ item . split ( "=" ) for item in arg_1 ] return { arg_2 : arg_3 for arg_2 , arg_3 in arg_1 }

def Func(arg_0):
    """
    parse the responses containing the tokens

    Parameters
    ----------
    response : str
        The response containing the tokens

    Returns
    -------
    dict
        The parsed tokens
    """
    arg_1 = arg_0.split("&")
    arg_1 = [item.split("=") for item in arg_1]

    return {arg_2: arg_3 for arg_2, arg_3 in arg_1}


(self, assay=None, mfr=0.0, P=1.0, T=25.0,
                      normalise=True)

return MaterialStream(self, mfr * self.converted_assays[assay] /
                              assay_total, P, T, self._isCoal(assay),
                              self._get_HHV(assay))

def Func(arg_0, arg_1=None, arg_2=0.0, arg_3=1.0, arg_4=25.0,
                      arg_5=True):
        """
        Create a MaterialStream based on the specified parameters.

        :param assay: Name of the assay to be used to create the stream.
        :param mfr: Stream mass flow rate. [kg/h]
        :param P: Stream pressure. [atm]
        :param T: Stream temperature. [°C]
        :param normalise: Indicates whether the assay must be normalised
        before creating the Stream.

        :returns: MaterialStream object.
        """

        if arg_1 is None:
            return MaterialStream(arg_0, arg_0.create_empty_assay(), arg_3, arg_4)

        if arg_5:
            arg_6 = arg_0.get_assay_total(arg_1)
        else:
            arg_6 = 1.0

        return MaterialStream(arg_0, arg_2 * arg_0.converted_assays[arg_1] /
                              arg_6, arg_3, arg_4, arg_0._isCoal(arg_1),
                              arg_0._get_HHV(arg_1))

Create a MaterialStream based on the specified parameters .


checks if the sample should be run and passes the args

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . dirs . consens = os . path . join ( arg_0 . dirs . project , arg_0 . name + "_consens" ) if not os . path . exists ( arg_0 . dirs . consens ) : os . mkdir ( arg_0 . dirs . consens ) arg_6 = glob . glob ( os . path . join ( arg_0 . dirs . consens , "*_tmpcons.*" ) ) arg_7 = glob . glob ( os . path . join ( arg_0 . dirs . consens , "*_tmpcats.*" ) ) for arg_8 in arg_6 + arg_7 : os . remove ( arg_8 ) arg_1 = get_subsamples ( arg_0 , arg_1 , arg_2 ) arg_9 = arg_3 . load_balanced_view ( ) arg_0 . cpus = arg_0 . _ipcluster [ "cores" ] if not arg_0 . cpus : arg_0 . cpus = len ( arg_3 . ids ) arg_11 = "" try : arg_1 = calculate_depths ( arg_0 , arg_1 , arg_9 ) arg_12 = make_chunks ( arg_0 , arg_1 , arg_9 ) process_chunks ( arg_0 , arg_1 , arg_12 , arg_9 ) except KeyboardInterrupt as arg_11 : raise arg_11 finally : arg_6 = glob . glob ( os . path . join ( arg_0 . dirs . clusts , "tmp_*.[0-9]*" ) ) arg_6 += glob . glob ( os . path . join ( arg_0 . dirs . consens , "*_tmpcons.*" ) ) arg_6 += glob . glob ( os . path . join ( arg_0 . dirs . consens , "*_tmpcats.*" ) ) for arg_13 in arg_6 : os . remove ( arg_13 ) arg_0 . _checkpoint = 0

def Func(arg_0, arg_1, arg_2, arg_3):
    """ checks if the sample should be Func and passes the args """
    ## prepare dirs
    arg_0.dirs.consens = os.path.join(arg_0.dirs.project, arg_0.name+"_consens")
    if not os.path.exists(arg_0.dirs.consens):
        os.mkdir(arg_0.dirs.consens)

    ## zap any tmp files that might be leftover
    arg_6 = glob.glob(os.path.join(arg_0.dirs.consens, "*_tmpcons.*"))
    arg_7 = glob.glob(os.path.join(arg_0.dirs.consens, "*_tmpcats.*"))
    for arg_8 in arg_6+arg_7:
        os.remove(arg_8)

    ## filter through samples for those ready
    arg_1 = get_subsamples(arg_0, arg_1, arg_2)

    ## set up parallel client: how many cores?
    arg_9 = arg_3.load_balanced_view()
    arg_0.cpus = arg_0._ipcluster["cores"]
    if not arg_0.cpus:
        arg_0.cpus = len(arg_3.ids)

    ## wrap everything to ensure destruction of temp files
    arg_11 = ""
    try:
        ## calculate depths, if they changed.
        arg_1 = calculate_depths(arg_0, arg_1, arg_9)

        ## chunk clusters into bits for parallel processing
        arg_12 = make_chunks(arg_0, arg_1, arg_9)

        ## process chunks and cleanup
        process_chunks(arg_0, arg_1, arg_12, arg_9)

    except KeyboardInterrupt as arg_11:
        raise arg_11

    finally:
        ## if process failed at any point delete tmp files
        arg_6 = glob.glob(os.path.join(arg_0.dirs.clusts, "tmp_*.[0-9]*"))
        arg_6 += glob.glob(os.path.join(arg_0.dirs.consens, "*_tmpcons.*"))
        arg_6 += glob.glob(os.path.join(arg_0.dirs.consens, "*_tmpcats.*"))
        for arg_13 in arg_6:
            os.remove(arg_13)

        ## Finished step 5. Set step 6 checkpoint to 0 to force
        ## re-Funcning from scratch.
        arg_0._checkpoint = 0


def Func ( arg_0 ) : arg_1 = nib . Nifti1Header ( ) for arg_2 in list ( arg_0 . keys ( ) ) : arg_1 [ arg_3 ( arg_2 ) ] = np . array ( arg_0 [ arg_2 ] ) return arg_1

def Func(arg_0):
    """Transforms an H5py Attributes set to a dict.
    Converts unicode string keys into standard strings
    and each value into a numpy array.

    Parameters
    ----------
    h5attrs: H5py Attributes

    Returns
    --------
    dict
    """
    arg_1 = nib.Nifti1Header()
    for arg_2 in list(arg_0.keys()):
        arg_1[arg_3(arg_2)] = np.array(arg_0[arg_2])

    return arg_1

Transforms an H5py Attributes set to a dict . Converts unicode string keys into standard strings and each value into a numpy array .


(self, queues=None, edge=None, edge_type=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_1 = _get_queues ( arg_0 . g , arg_1 , arg_2 , arg_3 ) for arg_4 in arg_1 : arg_0 . edge2queue [ arg_4 ] . data = { }

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Clears data from all queues.

        If none of the parameters are given then every queue's data is
        cleared.

        Parameters
        ----------
        queues : int or an iterable of int (optional)
            The edge index (or an iterable of edge indices) identifying
            the :class:`QueueServer(s)<.QueueServer>` whose data will
            be cleared.
        edge : 2-tuple of int or *array_like* (optional)
            Explicitly specify which queues' data to clear. Must be
            either:

            * A 2-tuple of the edge's source and target vertex
              indices, or
            * An iterable of 2-tuples of the edge's source and
              target vertex indices.

        edge_type : int or an iterable of int (optional)
            A integer, or a collection of integers identifying which
            edge types will have their data cleared.
        """
        arg_1 = _get_queues(arg_0.g, arg_1, arg_2, arg_3)

        for arg_4 in arg_1:
            arg_0.edge2queue[arg_4].data = {}


def Func ( arg_0 ) : arg_1 = arg_0 . get_last_update ( ) arg_2 = now ( ) - arg_1 . last_update if arg_2 . seconds < arg_0 . update_interval : return False return True

def Func(arg_0):
        """
        Checks if an update is needed.

        Checks against ``self.update_interval`` and this widgets
        ``DashboardWidgetLastUpdate`` instance if an update is overdue.

        This should be called by
        ``DashboardWidgetPool.get_widgets_that_need_update()``, which in turn
        should be called by an admin command which should be scheduled every
        minute via crontab.

        """
        arg_1 = arg_0.get_last_update()
        arg_2 = now() - arg_1.last_update
        if arg_2.seconds < arg_0.update_interval:
            return False
        return True


def Func ( arg_0 , arg_1 : arg_2 ) -> bool : if arg_0 . read_eof ( ) : return False arg_0 . _stream . save_context ( ) if arg_1 == arg_0 . _stream . peek_char : arg_0 . _stream . incpos ( ) return arg_0 . _stream . validate_context ( ) return arg_0 . _stream . restore_context ( )

def Func(arg_0, arg_1: arg_2) -> bool:
        """
        Consume the c head byte, increment current index and return True
        else return False. It use peekchar and it's the same as '' in BNF.
        """
        if arg_0.read_eof():
            return False
        arg_0._stream.save_context()
        if arg_1 == arg_0._stream.peek_char:
            arg_0._stream.incpos()
            return arg_0._stream.validate_context()
        return arg_0._stream.restore_context()

Consume the c head byte increment current index and return True else return False . It use peekchar and it s the same as in BNF .


def
Func
(
)
:
arg_0
=
[
'audioread'
,
'numpy'
,
'scipy'
,
'sklearn'
,
'joblib'
,
'decorator'
,
'six'
,
'soundfile'
,
'resampy'
,
'numba'
]
arg_1
=
[
'numpydoc'
,
'sphinx'
,
'sphinx_rtd_theme'
,
'sphinxcontrib.versioning'
,
'sphinx-gallery'
,
'pytest'
,
'pytest-mpl'
,
'pytest-cov'
,
'matplotlib'
]
print
(
'INSTALLED VERSIONS'
)
print
(
'------------------'
)
print
(
'python: {}\n'
.
format
(
sys
.
version
)
)
print
(
'librosa: {}\n'
.
format
(
version
)
)
for
arg_2
in
arg_0
:
print
(
'{}: {}'
.
format
(
arg_2
,
__get_mod_version
(
arg_2
)
)
)
print
(
''
)
for
arg_2
in
arg_1
:
print
(
'{}: {}'
.
format
(
arg_2
,
__get_mod_version
(
arg_2
)
)
)
pass

def Func():
    '''Return the version information for all librosa dependencies.'''

    arg_0 = ['audioread',
                 'numpy',
                 'scipy',
                 'sklearn',
                 'joblib',
                 'decorator',
                 'six',
                 'soundfile',
                 'resampy',
                 'numba']

    arg_1 = ['numpydoc',
                  'sphinx',
                  'sphinx_rtd_theme',
                  'sphinxcontrib.versioning',
                  'sphinx-gallery',
                  'pytest',
                  'pytest-mpl',
                  'pytest-cov',
                  'matplotlib']

    print('INSTALLED VERSIONS')
    print('------------------')
    print('python: {}\n'.format(sys.version))
    print('librosa: {}\n'.format(version))
    for arg_2 in arg_0:
        print('{}: {}'.format(arg_2, __get_mod_version(arg_2)))
    print('')
    for arg_2 in arg_1:
        print('{}: {}'.format(arg_2, __get_mod_version(arg_2)))
    pass

Return the version information for all librosa dependencies .


def
Func
(
arg_0
,
arg_1
)
:
if
'id'
in
arg_1
and
arg_1
[
'id'
]
is
not
:
arg_0
.
logger
.
debug
(
'Updating existing project: '
+
json
.
dumps
(
arg_1
)
)
arg_2
=
'%(base_url)s/%(project_id)s'
%
{
'base_url'
:
arg_0
.
base_url
,
'project_id'
:
arg_1
[
'id'
]
}
arg_3
=
arg_0
.
gbdx_connection
.
put
(
arg_2
,
json
=
arg_1
)
try
:
arg_3
.
raise_for_status
(
)
except
:
print
(
arg_3
.
text
)
raise
return
arg_1
[
'id'
]
else
:
arg_0
.
logger
.
debug
(
'Creating new project: '
+
json
.
dumps
(
arg_1
)
)
arg_2
=
arg_0
.
base_url
arg_3
=
arg_0
.
gbdx_connection
.
post
(
arg_2
,
json
=
arg_1
)
try
:
arg_3
.
raise_for_status
(
)
except
:
print
(
arg_3
.
text
)
raise
arg_4
=
arg_3
.
json
(
)
return
arg_4
[
'id'
]

def Func(arg_0, arg_1):
        '''
        Saves an AnswerFactory Project

        Args:
            project (dict): Dictionary specifying an AnswerFactory Project.

        Returns:
            AnswerFactory Project id
        '''

        # test if this is a create vs. an update
        if 'id' in arg_1 and arg_1['id'] is not None:
            # update -> use put op
            arg_0.logger.debug('Updating existing project: ' + json.dumps(arg_1))
            arg_2 = '%(base_url)s/%(project_id)s' % {
                'base_url': arg_0.base_url, 'project_id': arg_1['id']
            }
            arg_3 = arg_0.gbdx_connection.put(arg_2, json=arg_1)
            try:
                arg_3.raise_for_status()
            except:
                print(arg_3.text)
                raise
            # updates only get the Accepted response -> return the original project id
            return arg_1['id']
        else:
            arg_0.logger.debug('Creating new project: ' + json.dumps(arg_1))
            # create -> use post op
            arg_2 = arg_0.base_url
            arg_3 = arg_0.gbdx_connection.post(arg_2, json=arg_1)
            try:
                arg_3.raise_for_status()
            except:
                print(arg_3.text)
                raise
            arg_4 = arg_3.json()
            # create returns the Funcd project -> return the project id that's Funcd
            return arg_4['id']


def Func ( arg_0 , arg_1 ) : @ coroutine @ functools . wraps ( arg_0 ) def wrapper ( * arg_2 , ** arg_3 ) : arg_1 . activate ( ) try : if iscoroutinefunction ( arg_0 ) : yield from arg_0 ( * arg_2 , ** arg_3 ) else : arg_0 ( * arg_2 , ** arg_3 ) finally : arg_1 . disable ( ) return wrapper

def Func(arg_0, arg_1):
    """
    Async version of activate decorator

    Arguments:
        fn (function): function that be wrapped by decorator.
        _engine (Engine): pook engine instance

    Returns:
        function: decorator wrapper function.
    """
    @coroutine
    @functools.wraps(arg_0)
    def wrapper(*arg_2, **arg_3):
        arg_1.activate()
        try:
            if iscoroutinefunction(arg_0):
                yield from arg_0(*arg_2, **arg_3)  # noqa
            else:
                arg_0(*arg_2, **arg_3)
        finally:
            arg_1.disable()

    return wrapper


(
        self,
        template_id,
        locale,
        version_name,
        subject,
        text='',
        html='',
        timeout=None
    )

return self._api_request(
            self.TEMPLATES_LOCALES_ENDPOINT % template_id,
            self.HTTP_POST,
            payload=payload,
            timeout=timeout
        )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3,
        arg_4,
        arg_5='',
        arg_6='',
        arg_7=None
    ):
        """ API call to create a new locale and version of a template """
        arg_8 = {
            'locale': arg_2,
            'name': arg_3,
            'subject': arg_4
        }

        if arg_6:
            arg_8['html'] = arg_6
        if arg_5:
            arg_8['text'] = arg_5

        return arg_0._api_request(
            arg_0.TEMPLATES_LOCALES_ENDPOINT % arg_1,
            arg_0.HTTP_POST,
            arg_8=arg_8,
            arg_7=arg_7
        )


(self, recursive=True, load_data=pypetconstants.LOAD_DATA,
               max_depth=None)

def Func(arg_0, arg_1=True, arg_2=arg_3.LOAD_DATA,
               arg_5=None):
        """Loads a group from disk.

        :param recursive:

            Default is ``True``.
            Whether recursively all nodes below the current node should be loaded, too.
            Note that links are never evaluated recursively. Only the linked node
            will be loaded if it does not exist in the tree, yet. Any nodes or links
            of this linked node are not loaded.

        :param load_data:

            Flag how to load the data.
            For how to choose 'load_data' see :ref:`more-on-loading`.

        :param max_depth:

            In case `recursive` is `True`, you can specify the maximum depth to load
            load data relative from current node.

        :returns:

            The node itself.

        """

        arg_6 = arg_0._nn_interface._root_instance
        arg_7 = arg_6.v_storage_service

        arg_7.load(arg_3.GROUP, arg_0,
                             trajectory_name=arg_6.v_name,
                             arg_2=arg_2,
                             arg_1=arg_1,
                             arg_5=arg_5)
        return arg_0


def Func ( arg_0 ) : if "ConferencePaper" not in arg_0 . collections : arg_1 = record_get_field_values ( arg_0 . record , '773' , code = "w" ) for arg_2 in arg_1 : arg_3 = [ ( "9" , "INSPIRE-CNUM" ) , ( "a" , arg_2 ) ] record_add_field ( arg_0 . record , "035" , subfields = arg_3 )

def Func(arg_0):
        """Check if we shall add cnum in 035."""
        if "ConferencePaper" not in arg_0.collections:
            arg_1 = record_get_field_values(arg_0.record, '773', code="w")
            for arg_2 in arg_1:
                arg_3 = [
                    ("9", "INSPIRE-CNUM"),
                    ("a", arg_2)
                ]
                record_add_field(arg_0.record, "035", subfields=arg_3)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_3 [ 'license_name' ] = 'Apache' arg_3 [ 'year' ] = time . strftime ( '%Y' , time . localtime ( ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Called before template is applied.
        """
        # import pdb;pdb.set_trace()
        arg_3['license_name'] = 'Apache'
        arg_3['year'] = time.strftime('%Y', time.localtime())


def
Func
(
)
:
arg_0
=
Func_parser
(
)
arg_1
=
arg_0
.
parse_args
(
)
if
not
arg_1
.
raw
and
not
arg_1
.
enrich
and
not
arg_1
.
identities
and
not
arg_1
.
panels
:
print
(
"No tasks enabled"
)
sys
.
exit
(
1
)
return
arg_1

def Func():
    """Get params to execute the micro-mordred"""

    arg_0 = Func_parser()
    arg_1 = arg_0.parse_args()

    if not arg_1.raw and not arg_1.enrich and not arg_1.identities and not arg_1.panels:
        print("No tasks enabled")
        sys.exit(1)

    return arg_1

Get params to execute the micro - mordred


def Func ( arg_0 , arg_1 ) : arg_2 = BNode ( ) arg_3 = ( arg_2 , RDF . type , arg_0 . spdx_namespace . Review ) arg_0 . graph . add ( arg_3 ) arg_4 = Literal ( arg_1 . reviewer . to_value ( ) ) arg_0 . graph . add ( ( arg_2 , arg_0 . spdx_namespace . reviewer , arg_4 ) ) arg_5 = Literal ( arg_1 . review_date_iso_format ) arg_6 = ( arg_2 , arg_0 . spdx_namespace . reviewDate , arg_5 ) arg_0 . graph . add ( arg_6 ) if arg_1 . has_comment : arg_7 = Literal ( arg_1 . comment ) arg_8 = ( arg_2 , RDFS . comment , arg_7 ) arg_0 . graph . add ( arg_8 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return a review node.
        """
        arg_2 = BNode()
        arg_3 = (arg_2, RDF.type, arg_0.spdx_namespace.Review)
        arg_0.graph.add(arg_3)

        arg_4 = Literal(arg_1.reviewer.to_value())
        arg_0.graph.add((arg_2, arg_0.spdx_namespace.reviewer, arg_4))
        arg_5 = Literal(arg_1.review_date_iso_format)
        arg_6 = (arg_2, arg_0.spdx_namespace.reviewDate, arg_5)
        arg_0.graph.add(arg_6)
        if arg_1.has_comment:
            arg_7 = Literal(arg_1.comment)
            arg_8 = (arg_2, RDFS.comment, arg_7)
            arg_0.graph.add(arg_8)

        return arg_2


(wave, npoints=None, indep_min=None, indep_max=None)

return imag(fft(wave, npoints, indep_min, indep_max))

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : return imag ( fft ( arg_0 , arg_1 , arg_2 , arg_3 ) )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
    r"""
    Return the imaginary part of the Fast Fourier Transform of a waveform.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param npoints: Number of points to use in the transform. If **npoints**
                    is less than the size of the independent variable vector
                    the waveform is truncated; if **npoints** is greater than
                    the size of the independent variable vector, the waveform
                    is zero-padded
    :type  npoints: positive integer

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`npoints\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

     * RuntimeError (Non-uniform sampling)

    .. [[[end]]]
    """
    return imag(fft(arg_0, arg_1, arg_2, arg_3))

r"""
    Return the imaginary part of the Fast Fourier Transform of a waveform.

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param npoints: Number of points to use in the transform. If **npoints**
                    is less than the size of the independent variable vector
                    the waveform is truncated; if **npoints** is greater than
                    the size of the independent variable vector, the waveform
                    is zero-padded
    :type  npoints: positive integer

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.ffti

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`npoints\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

     * RuntimeError (Non-uniform sampling)

    .. [[[end]]]

r Return the imaginary part of the Fast Fourier Transform of a waveform .


def Func(arg_0, arg_1):
        """Create error response for the a "get" or "set" iq stanza.

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

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

        if arg_0.stanza_type in ("result", "error"):
            raise ValueError("Errors may not be generated for"
                                                " 'result' and 'error' iq")

        arg_2 = Iq(stanza_type="error", from_jid = arg_0.to_jid,
                        to_jid = arg_0.from_jid, stanza_id = arg_0.stanza_id,
                        error_cond = arg_1)
        if arg_0._payload is None:
            arg_0.decode_payload()
        for arg_3 in arg_0._payload:
            # use Stanza.add_payload to skip the payload length check
            Stanza.add_payload(arg_2, arg_3)
        return arg_2

Create error response for the a get or set iq stanza .


def Func(arg_0):
        """Retrieve entity from datastore.

        Uses a different model method for db or ndb models.

        Returns:
            Instance of the model corresponding to the current storage object
            and stored using the key name of the storage object.
        """
        if arg_0._is_ndb():
            return arg_0._model.get_by_id(arg_0._key_name)
        else:
            return arg_0._model.get_by_key_name(arg_0._key_name)


(self, error=None, topic=None, parser=None)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
)
:
assert
arg_1
or
arg_2
or
arg_3
if
arg_1
:
print
(
arg_1
)
print
(
"Use 'coverage Func' for Func."
)
elif
arg_3
:
print
(
arg_3
.
format_Func
(
)
.
strip
(
)
)
else
:
arg_4
=
HELP_TOPICS
.
get
(
arg_2
,
''
)
.
strip
(
)
if
arg_4
:
print
(
arg_4
%
arg_0
.
covpkg
.
__dict__
)
else
:
print
(
"Don't know topic %r"
%
arg_2
)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Display an error message, or the named topic."""
        assert arg_1 or arg_2 or arg_3
        if arg_1:
            print(arg_1)
            print("Use 'coverage Func' for Func.")
        elif arg_3:
            print(arg_3.format_Func().strip())
        else:
            arg_4 = HELP_TOPICS.get(arg_2, '').strip()
            if arg_4:
                print(arg_4 % arg_0.covpkg.__dict__)
            else:
                print("Don't know topic %r" % arg_2)

Display an error message or the named topic .


def
Func
(
arg_0
)
:
logging
.
info
(
'Updating nginx with new Dusty config'
)
arg_1
=
tempfile
.
mkdtemp
(
)
os
.
mkdir
(
os
.
path
.
join
(
arg_1
,
'html'
)
)
_write_nginx_config
(
constants
.
NGINX_BASE_CONFIG
,
os
.
path
.
join
(
arg_1
,
constants
.
NGINX_PRIMARY_CONFIG_NAME
)
)
_write_nginx_config
(
arg_0
[
'http'
]
,
os
.
path
.
join
(
arg_1
,
constants
.
NGINX_HTTP_CONFIG_NAME
)
)
_write_nginx_config
(
arg_0
[
'stream'
]
,
os
.
path
.
join
(
arg_1
,
constants
.
NGINX_STREAM_CONFIG_NAME
)
)
_write_nginx_config
(
constants
.
NGINX_502_PAGE_HTML
,
os
.
path
.
join
(
arg_1
,
'html'
,
constants
.
NGINX_502_PAGE_NAME
)
)
sync_local_path_to_vm
(
arg_1
,
constants
.
NGINX_CONFIG_DIR_IN_VM
)

def Func(arg_0):
    """Write the given config to disk as a Dusty sub-config
    in the Nginx includes directory. Then, either start nginx
    or tell it to reload its config to pick up what we've
    just written."""
    logging.info('Updating nginx with new Dusty config')
    arg_1 = tempfile.mkdtemp()
    os.mkdir(os.path.join(arg_1, 'html'))
    _write_nginx_config(constants.NGINX_BASE_CONFIG, os.path.join(arg_1, constants.NGINX_PRIMARY_CONFIG_NAME))
    _write_nginx_config(arg_0['http'], os.path.join(arg_1, constants.NGINX_HTTP_CONFIG_NAME))
    _write_nginx_config(arg_0['stream'], os.path.join(arg_1, constants.NGINX_STREAM_CONFIG_NAME))
    _write_nginx_config(constants.NGINX_502_PAGE_HTML, os.path.join(arg_1, 'html', constants.NGINX_502_PAGE_NAME))
    sync_local_path_to_vm(arg_1, constants.NGINX_CONFIG_DIR_IN_VM)

Write the given config to disk as a Dusty sub - config in the Nginx includes directory . Then either start nginx or tell it to reload its config to pick up what we ve just written .


return [src_song for src_song in src_songs if gather_field_values(_normalize_song(src_song)) not in dst_songs_criteria]

def Func(arg_0, arg_1):
	"""Compare two song collections to find missing songs.

	Parameters:
		src_songs (list): Google Music song dicts or filepaths of local songs.

		dest_songs (list): Google Music song dicts or filepaths of local songs.

	Returns:
		A list of Google Music song dicts or local song filepaths from source missing in destination.
	"""

	def gather_field_values(arg_2):
		return tuple((_normalize_metadata(arg_2[arg_3]) for arg_3 in _filter_comparison_fields(arg_2)))

	arg_4 = {gather_field_values(_normalize_song(dst_song)) for dst_song in arg_1}

	return [arg_5 for arg_5 in arg_0 if gather_field_values(_normalize_song(arg_5)) not in arg_4]

Compare two song collections to find missing songs .


def Func ( arg_0 ) : arg_1 = copy . copy ( arg_0 ) arg_1 . _compound_masses = copy . deepcopy ( arg_0 . _compound_masses ) return arg_1

def Func(arg_0):
        """Create a complete copy of the package.

        :returns: A new MaterialPackage object."""

        arg_1 = copy.copy(arg_0)
        arg_1._compound_masses = copy.deepcopy(arg_0._compound_masses)
        return arg_1


return compat.urllib_parse.urlunsplit((
            self.uri.scheme,
            self.uri.netloc,
            self.uri.path.rstrip('/') + '/jobs/' + job_id,
            self.uri.query,
            self.uri.fragment,
        ))

def Func ( arg_0 , arg_1 ) : return compat . urllib_parse . urlunsplit ( ( arg_0 . uri . scheme , arg_0 . uri . netloc , arg_0 . uri . path . rstrip ( '/' ) + '/jobs/' + arg_1 , arg_0 . uri . query , arg_0 . uri . fragment , ) )

def Func(arg_0, arg_1):
        # type: (Text) -> Text
        """
        Returns the URL to check job status.

        :param job_id:
            The ID of the job to check.
        """
        return compat.urllib_parse.urlunsplit((
            arg_0.uri.scheme,
            arg_0.uri.netloc,
            arg_0.uri.path.rstrip('/') + '/jobs/' + arg_1,
            arg_0.uri.query,
            arg_0.uri.fragment,
        ))


def Func ( arg_0 ) : arg_1 = Manticore . linux ( prog , workspace_url = 'mem:' ) arg_2 = Follower ( arg_0 ) arg_1 . verbosity ( VERBOSITY ) arg_1 . register_plugin ( arg_2 ) def on_term_testcase ( arg_3 , arg_4 , arg_5 , arg_6 ) : with arg_1 . locked_context ( ) as arg_11 : arg_7 = [ ] for arg_8 , arg_9 , arg_10 in arg_4 . platform . syscall_trace : if arg_8 in ( '_receive' , '_read' ) and arg_9 == 0 : arg_7 . append ( arg_10 ) arg_11 [ 'readdata' ] = arg_7 arg_11 [ 'constraints' ] = list ( arg_4 . constraints . constraints ) arg_1 . subscribe ( 'will_terminate_state' , on_term_testcase ) arg_1 . run ( ) arg_12 = arg_1 . context [ 'constraints' ] arg_13 = arg_1 . context [ 'readdata' ] return arg_12 , arg_13

def Func(arg_0):
    '''
    Execute a symbolic run that follows a concrete run; return constraints generated
    and the stdin data produced
    '''

    arg_1 = Manticore.linux(prog, workspace_url='mem:')
    arg_2 = Follower(arg_0)
    arg_1.verbosity(VERBOSITY)
    arg_1.register_plugin(arg_2)

    def on_term_testcase(arg_3, arg_4, arg_5, arg_6):
        with arg_1.locked_context() as arg_11:
            arg_7 = []
            for arg_8, arg_9, arg_10 in arg_4.platform.syscall_trace:
                if arg_8 in ('_receive', '_read') and arg_9 == 0:
                    arg_7.append(arg_10)
            arg_11['readdata'] = arg_7
            arg_11['constraints'] = list(arg_4.constraints.constraints)

    arg_1.subscribe('will_terminate_state', on_term_testcase)

    arg_1.run()

    arg_12 = arg_1.context['constraints']
    arg_13 = arg_1.context['readdata']

    return arg_12, arg_13

Execute a symbolic run that follows a concrete run ; return constraints generated and the stdin data produced


def Func ( arg_0 ) : if arg_0 . _check_exists ( ) : return makedir_exist_ok ( arg_0 . raw_folder ) makedir_exist_ok ( arg_0 . processed_folder ) for arg_1 in arg_0 . urls : arg_2 = arg_1 . rpartition ( '/' ) [ 2 ] arg_3 = os . path . join ( arg_0 . raw_folder , arg_2 ) Func_url ( arg_1 , root = arg_0 . raw_folder , arg_2 = arg_2 , md5 = None ) arg_0 . extract_gzip ( gzip_path = arg_3 , remove_finished = True ) print ( 'Processing...' ) arg_4 = ( read_image_file ( os . path . join ( arg_0 . raw_folder , 'train-images-idx3-ubyte' ) ) , read_label_file ( os . path . join ( arg_0 . raw_folder , 'train-labels-idx1-ubyte' ) ) ) arg_5 = ( read_image_file ( os . path . join ( arg_0 . raw_folder , 't10k-images-idx3-ubyte' ) ) , read_label_file ( os . path . join ( arg_0 . raw_folder , 't10k-labels-idx1-ubyte' ) ) ) with open ( os . path . join ( arg_0 . processed_folder , arg_0 . training_file ) , 'wb' ) as f : torch . save ( arg_4 , f ) with open ( os . path . join ( arg_0 . processed_folder , arg_0 . test_file ) , 'wb' ) as f : torch . save ( arg_5 , f ) print ( 'Done!' )

def Func(arg_0):
        """Download the MNIST data if it doesn't exist in processed_folder already."""

        if arg_0._check_exists():
            return

        makedir_exist_ok(arg_0.raw_folder)
        makedir_exist_ok(arg_0.processed_folder)

        # Func files
        for arg_1 in arg_0.urls:
            arg_2 = arg_1.rpartition('/')[2]
            arg_3 = os.path.join(arg_0.raw_folder, arg_2)
            Func_url(arg_1, root=arg_0.raw_folder, arg_2=arg_2, md5=None)
            arg_0.extract_gzip(gzip_path=arg_3, remove_finished=True)

        # process and save as torch files
        print('Processing...')

        arg_4 = (
            read_image_file(os.path.join(arg_0.raw_folder, 'train-images-idx3-ubyte')),
            read_label_file(os.path.join(arg_0.raw_folder, 'train-labels-idx1-ubyte'))
        )
        arg_5 = (
            read_image_file(os.path.join(arg_0.raw_folder, 't10k-images-idx3-ubyte')),
            read_label_file(os.path.join(arg_0.raw_folder, 't10k-labels-idx1-ubyte'))
        )
        with open(os.path.join(arg_0.processed_folder, arg_0.training_file), 'wb') as f:
            torch.save(arg_4, f)
        with open(os.path.join(arg_0.processed_folder, arg_0.test_file), 'wb') as f:
            torch.save(arg_5, f)

        print('Done!')

Download the MNIST data if it doesn t exist in processed_folder already .


def Func(arg_0, arg_1):
        """Deletes a GBDX task.

        Args:
            task_name (str): Task name.

        Returns:
            Response (str).
        """
        arg_2 = arg_0.gbdx_connection.Func(arg_0._base_url + '/' + arg_1)
        raise_for_status(arg_2)

        return arg_2.text


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Metric for ordinal data."""
    if arg_2 > arg_3:
        arg_2, arg_3 = arg_3, arg_2
    return (np.sum(arg_4[arg_2:(arg_3 + 1)]) - (arg_4[arg_2] + arg_4[arg_3]) / 2) ** 2


def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
,
six
.
string_types
)
:
raise
ValueError
(
'value ({}) should be a string type.'
.
format
(
arg_0
)
)
return
config_parser
.
ConfigParser
(
arg_0
,
ParserDelegate
(
)
)
.
Func
(
)

def Func(arg_0):
  """Parse and return a single Gin value."""
  if not isinstance(arg_0, six.string_types):
    raise ValueError('value ({}) should be a string type.'.format(arg_0))
  return config_parser.ConfigParser(arg_0, ParserDelegate()).Func()


def Func ( arg_0 , arg_1 ) : if arg_1 == '/' : arg_0 . chdir ( '/' ) return if arg_1 == '' : return try : arg_0 . chdir ( arg_1 ) except IOError : arg_2 , arg_3 = os . path . split ( arg_1 . rstrip ( '/' ) ) Func ( arg_0 , arg_2 ) arg_0 . mkdir ( arg_3 ) arg_0 . chdir ( arg_3 ) return

def Func(arg_0, arg_1):
    """
    Create all the intermediate directories in a remote host

    :param sftp_client: A Paramiko SFTP client.
    :param remote_directory: Absolute Path of the directory containing the file
    :return:
    """
    if arg_1 == '/':
        arg_0.chdir('/')
        return
    if arg_1 == '':
        return
    try:
        arg_0.chdir(arg_1)
    except IOError:
        arg_2, arg_3 = os.path.split(arg_1.rstrip('/'))
        Func(arg_0, arg_2)
        arg_0.mkdir(arg_3)
        arg_0.chdir(arg_3)
        return


def Func(arg_0):
        """
        1. get a list of CDS with the same parent
        2. sort according to strand
        3. calculate and validate phase
        """
        arg_1 = set(['+', '-'])
        for arg_2, arg_3 in groupby(sorted([arg_6 for arg_6 in arg_0.lines if  arg_6['line_type'] == 'feature' and arg_6['type'] == 'CDS' and 'Parent' in arg_6['attributes']], key=lambda x: x['attributes']['Parent']), key=lambda x: x['attributes']['Parent']):
            arg_4 = list(arg_3)
            arg_5 = list(set([arg_6['strand'] for arg_6 in arg_4]))
            if len(arg_5) != 1:
                for arg_6 in arg_4:
                    arg_0.add_line_error(arg_6, {'message': 'Inconsistent CDS strand with parent: {0:s}'.format(arg_2), 'error_type': 'STRAND'})
                continue
            if len(arg_4) == 1:
                if arg_4[0]['phase'] != 0:
                    arg_0.add_line_error(arg_4[0], {'message': 'Wrong phase {0:d}, should be {1:d}'.format(arg_4[0]['phase'], 0), 'error_type': 'PHASE'})
                continue
            arg_7 = arg_5[0]
            if arg_7 not in arg_1:
                # don't process unknown strands
                continue
            if arg_7 == '-':
                # sort end descending
                arg_8 = sorted(arg_4, key=lambda x: x['end'], reverse=True)
            else:
                arg_8 = sorted(arg_4, key=lambda x: x['start'])
            arg_9 = 0
            for arg_6 in arg_8:
                if arg_6['phase'] != arg_9:
                    arg_0.add_line_error(arg_6, {'message': 'Wrong phase {0:d}, should be {1:d}'.format(arg_6['phase'], arg_9), 'error_type': 'PHASE'})
                arg_9 = (3 - ((arg_6['end'] - arg_6['start'] + 1 - arg_9) % 3)) % 3

1 . get a list of CDS with the same parent 2 . sort according to strand 3 . calculate and validate phase


def Func ( arg_0 ) : arg_1 = { 'name' : arg_0 . name , 'href' : arg_0 . href_prefix if arg_0 . href_prefix else '/' , '@context' : arg_0 . context , '@type' : arg_0 . type , 'properties' : arg_0 . get_property_descriptions ( ) , 'actions' : { } , 'events' : { } , 'links' : [ { 'rel' : 'properties' , 'href' : '{}/properties' . format ( arg_0 . href_prefix ) , } , { 'rel' : 'actions' , 'href' : '{}/actions' . format ( arg_0 . href_prefix ) , } , { 'rel' : 'events' , 'href' : '{}/events' . format ( arg_0 . href_prefix ) , } , ] , } for arg_2 , arg_3 in arg_0 . available_actions . items ( ) : arg_1 [ 'actions' ] [ arg_2 ] = arg_3 [ 'metadata' ] arg_1 [ 'actions' ] [ arg_2 ] [ 'links' ] = [ { 'rel' : 'action' , 'href' : '{}/actions/{}' . format ( arg_0 . href_prefix , arg_2 ) , } , ] for arg_2 , arg_4 in arg_0 . available_events . items ( ) : arg_1 [ 'events' ] [ arg_2 ] = arg_4 [ 'metadata' ] arg_1 [ 'events' ] [ arg_2 ] [ 'links' ] = [ { 'rel' : 'event' , 'href' : '{}/events/{}' . format ( arg_0 . href_prefix , arg_2 ) , } , ] if arg_0 . ui_href is not None : arg_1 [ 'links' ] . append ( { 'rel' : 'alternate' , 'mediaType' : 'text/html' , 'href' : arg_0 . ui_href , } ) if arg_0 . description : arg_1 [ 'description' ] = arg_0 . description return arg_1

def Func(arg_0):
        """
        Return the thing state as a Thing Description.

        Returns the state as a dictionary.
        """
        arg_1 = {
            'name': arg_0.name,
            'href': arg_0.href_prefix if arg_0.href_prefix else '/',
            '@context': arg_0.context,
            '@type': arg_0.type,
            'properties': arg_0.get_property_descriptions(),
            'actions': {},
            'events': {},
            'links': [
                {
                    'rel': 'properties',
                    'href': '{}/properties'.format(arg_0.href_prefix),
                },
                {
                    'rel': 'actions',
                    'href': '{}/actions'.format(arg_0.href_prefix),
                },
                {
                    'rel': 'events',
                    'href': '{}/events'.format(arg_0.href_prefix),
                },
            ],
        }

        for arg_2, arg_3 in arg_0.available_actions.items():
            arg_1['actions'][arg_2] = arg_3['metadata']
            arg_1['actions'][arg_2]['links'] = [
                {
                    'rel': 'action',
                    'href': '{}/actions/{}'.format(arg_0.href_prefix, arg_2),
                },
            ]

        for arg_2, arg_4 in arg_0.available_events.items():
            arg_1['events'][arg_2] = arg_4['metadata']
            arg_1['events'][arg_2]['links'] = [
                {
                    'rel': 'event',
                    'href': '{}/events/{}'.format(arg_0.href_prefix, arg_2),
                },
            ]

        if arg_0.ui_href is not None:
            arg_1['links'].append({
                'rel': 'alternate',
                'mediaType': 'text/html',
                'href': arg_0.ui_href,
            })

        if arg_0.description:
            arg_1['description'] = arg_0.description

        return arg_1

Return the thing state as a Thing Description .


def Func ( arg_0 , arg_1 = "{ScanningTemplate}leicacam.xml" ) : arg_2 = [ ( 'sys' , '0' ) , ( 'cmd' , 'save' ) , ( 'fil' , str ( arg_1 ) ) ] arg_0 . send ( arg_2 ) return arg_0 . wait_for ( * arg_2 [ 0 ] )

def Func(arg_0, arg_1="{ScanningTemplate}leicacam.xml"):
        """Save scanning template to filename."""
        arg_2 = [
            ('sys', '0'),
            ('cmd', 'save'),
            ('fil', str(arg_1))
        ]
        arg_0.send(arg_2)
        return arg_0.wait_for(*arg_2[0])


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def make_if_not_present ( ) : arg_1 = arg_0 ( ) if not os . path . isdir ( arg_1 ) : os . makedirs ( arg_1 ) return arg_1 return make_if_not_present

def Func(arg_0):
	"wrap a function that returns a dir, making sure it exists"
	@functools.wraps(arg_0)
	def make_if_not_present():
		arg_1 = arg_0()
		if not os.path.isdir(arg_1):
			os.makedirs(arg_1)
		return arg_1
	return make_if_not_present

wrap a function that returns a dir making sure it exists


def Func ( arg_0 ) : if not arg_0 : return arg_1 = arg_0 . split ( "/" ) arg_2 , arg_3 = arg_1 [ : - 1 ] , arg_1 [ - 1 ] for arg_4 in arg_2 : if arg_4 == "**" : yield "(|.+/)" else : yield glob2re ( arg_4 ) + "/" yield glob2re ( arg_3 )

def Func(arg_0):
    """Generate parts of regex transformed from glob pattern."""
    if not arg_0:
        return

    arg_1 = arg_0.split("/")
    arg_2, arg_3 = arg_1[:-1], arg_1[-1]

    for arg_4 in arg_2:
        if arg_4 == "**":
            yield  "(|.+/)"
        else:
            yield glob2re(arg_4) + "/"

    yield glob2re(arg_3)

Generate parts of regex transformed from glob pattern .


def Func(arg_0, arg_1):
        """Open conversation tab for new messages & pass events to notifier."""
        arg_2 = arg_0._conv_list.get(arg_1.conversation_id)
        arg_3 = arg_2.get_user(arg_1.user_id)
        arg_4 = all((
            isinstance(arg_1, hangups.ChatMessageEvent),
            not arg_3.is_self,
            not arg_2.is_quiet,
        ))
        if arg_4:
            arg_0.add_conversation_tab(arg_1.conversation_id)
            if arg_0._discreet_notifications:
                arg_5 = DISCREET_NOTIFICATION
            else:
                arg_5 = notifier.Notification(
                    arg_3.full_name, get_conv_name(arg_2), arg_1.text
                )
            arg_0._notifier.send(arg_5)

Open conversation tab for new messages & pass events to notifier .


def Func ( arg_0 , arg_1 ) : return np . sqrt ( np . square ( arg_0 - arg_1 ) . mean ( ) )

def Func(arg_0, arg_1):
    """Returns the root mean square error betwwen a and b
    """
    return np.sqrt(np.square(arg_0 - arg_1).mean())


(src, tar, gap_cost=1, sim_func=sim_ident)

return NeedlemanWunsch().dist_abs(src, tar, gap_cost, sim_func)

def Func(arg_0, arg_1, arg_2=1, arg_3=arg_4):
    """Return the Needleman-Wunsch score of two strings.

    This is a wrapper for :py:meth:`NeedlemanWunsch.dist_abs`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    gap_cost : float
        The cost of an alignment gap (1 by default)
    sim_func : function
        A function that returns the similarity of two characters (identity
        similarity by default)

    Returns
    -------
    float
        Needleman-Wunsch score

    Examples
    --------
    >>> Func('cat', 'hat')
    2.0
    >>> Func('Niall', 'Neil')
    1.0
    >>> Func('aluminum', 'Catalan')
    -1.0
    >>> Func('ATCG', 'TAGC')
    0.0

    """
    return NeedlemanWunsch().dist_abs(arg_0, arg_1, arg_2, arg_3)

Return the Needleman-Wunsch score of two strings.

    This is a wrapper for :py:meth:`NeedlemanWunsch.dist_abs`.

    Parameters
    ----------
    src : str
        Source string for comparison
    tar : str
        Target string for comparison
    gap_cost : float
        The cost of an alignment gap (1 by default)
    sim_func : function
        A function that returns the similarity of two characters (identity
        similarity by default)

    Returns
    -------
    float
        Needleman-Wunsch score

    Examples
    --------
    >>> needleman_wunsch('cat', 'hat')
    2.0
    >>> needleman_wunsch('Niall', 'Neil')
    1.0
    >>> needleman_wunsch('aluminum', 'Catalan')
    -1.0
    >>> needleman_wunsch('ATCG', 'TAGC')
    0.0

Return the Needleman - Wunsch score of two strings .


def Func(arg_0, arg_1):
        """Handle a watermark notification."""
        # Update the conversation:
        if arg_0.get_user(arg_1.user_id).is_self:
            logger.info('latest_read_timestamp for {} updated to {}'
                        .format(arg_0.id_, arg_1.read_timestamp))
            arg_2 = (
                arg_0._conversation.self_conversation_state
            )
            arg_2.self_read_state.latest_read_timestamp = (
                parsers.to_timestamp(arg_1.read_timestamp)
            )
        # Update the participants' watermarks:
        arg_5 = arg_0._watermarks.get(
            arg_1.user_id,
            datetime.datetime.min.replace(tzinfo=datetime.timezone.utc)
        )
        if arg_1.read_timestamp > arg_5:
            logger.info(('latest_read_timestamp for conv {} participant {}' +
                         ' updated to {}').format(arg_0.id_,
                                                  arg_1.user_id.chat_id,
                                                  arg_1.read_timestamp))
            arg_0._watermarks[arg_1.user_id] = arg_1.read_timestamp


return "".join([unparse_header(n, v) for n, v in hdrs.items()]) + "\r\n"

def Func ( arg_0 ) : return "" . join ( [ unparse_header ( arg_1 , arg_2 ) for arg_1 , arg_2 in arg_0 . items ( ) ] ) + "\r\n"

def Func(arg_0):
    """Parse a dictionary of headers to a string.

    Args:
        hdrs: A dictionary of headers.

    Returns:
        The headers as a string that can be used in an NNTP POST.
    """
    return "".join([unparse_header(arg_1, arg_2) for arg_1, arg_2 in arg_0.items()]) + "\r\n"

Parse a dictionary of headers to a string .


def
Func
(
arg_0
=
arg_1
)
:
arg_2
=
local
(
"git Func {0}"
.
format
(
arg_0
)
)
if
arg_2
.
succeeded
:
local
(
"git push --Funcs"
)

def Func(arg_0=arg_1):
    """Deploy a version Func."""
    arg_2 = local("git Func {0}".format(arg_0))
    if arg_2.succeeded:
        local("git push --Funcs")


(cls, connections, segment, prevActiveCells,
                    permanenceIncrement, permanenceDecrement)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = [ ] for arg_7 in arg_1 . synapsesForSegment ( arg_2 ) : arg_8 = arg_7 . permanence if binSearch ( arg_3 , arg_7 . presynapticCell ) != - 1 : arg_8 += arg_4 else : arg_8 -= arg_5 arg_8 = max ( 0.0 , min ( 1.0 , arg_8 ) ) if arg_8 < EPSILON : arg_6 . append ( arg_7 ) else : arg_1 . updateSynapsePermanence ( arg_7 , arg_8 ) for arg_7 in arg_6 : arg_1 . destroySynapse ( arg_7 ) if arg_1 . numSynapses ( arg_2 ) == 0 : arg_1 . destroySegment ( arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3,
                    arg_4, arg_5):
    """
    Updates synapses on segment.
    Strengthens active synapses; weakens inactive synapses.

    :param connections:          (Object) Connections instance for the tm
    :param segment:              (int)    Segment to adapt
    :param prevActiveCells:      (list)   Active cells in `t-1`
    :param permanenceIncrement:  (float)  Amount to increment active synapses
    :param permanenceDecrement:  (float)  Amount to decrement inactive synapses
    """

    # Destroying a synapse modifies the set that we're iterating through.
    arg_6 = []

    for arg_7 in arg_1.synapsesForSegment(arg_2):
      arg_8 = arg_7.permanence

      if binSearch(arg_3, arg_7.presynapticCell) != -1:
        arg_8 += arg_4
      else:
        arg_8 -= arg_5

      # Keep permanence within min/max bounds
      arg_8 = max(0.0, min(1.0, arg_8))

      if arg_8 < EPSILON:
        arg_6.append(arg_7)
      else:
        arg_1.updateSynapsePermanence(arg_7, arg_8)

    for arg_7 in arg_6:
      arg_1.destroySynapse(arg_7)

    if arg_1.numSynapses(arg_2) == 0:
      arg_1.destroySegment(arg_2)

Updates synapses on segment . Strengthens active synapses ; weakens inactive synapses .