(self, radius : dim.Length, unit_luminosity='eps', kpc_per_arcsec=None, exposure_time=None)

def Func ( arg_0 , arg_1 : arg_2 . Length , arg_4 = 'eps' , arg_5 = None , arg_6 = None ) : if arg_0 . has_light_profile : return sum ( map ( lambda p : p . Func ( arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 ) , arg_0 . light_profiles ) ) else : return None

def Func(arg_0, arg_1 : arg_2.Length, arg_4='eps', arg_5=None, arg_6=None):
        """Compute the total luminosity of the galaxy's light profiles within a circle of specified radius.

        See *light_profiles.luminosity_within_circle* for details of how this is performed.

        Parameters
        ----------
        radius : float
            The radius of the circle to compute the dimensionless mass within.
        unit_luminosity : str
            The units the luminosity is returned in (eps | counts).
        exposure_time : float
            The exposure time of the observation, which converts luminosity from electrons per second units to counts.
        """
        if arg_0.has_light_profile:
            return sum(map(lambda p: p.Func(arg_1=arg_1, arg_4=arg_4,
                                                                         arg_5=arg_5, arg_6=arg_6),
                           arg_0.light_profiles))
        else:
            return None

Compute the total luminosity of the galaxy s light profiles within a circle of specified radius .


return [
            self._clean_isbn(isbn)
            for isbn in self["901i"]
        ]

def Func(arg_0):
        """
        Get list of VALID ISBN.

        Returns:
            list: List with *valid* ISBN strings.
        """
        arg_1 = set(arg_0.get_invalid_ISBNs())

        arg_2 = [
            arg_0._clean_isbn(arg_3)
            for arg_3 in arg_0["020a"]
            if arg_0._clean_isbn(arg_3) not in arg_1
        ]

        if arg_2:
            return arg_2

        # this is used sometimes in czech national library
        return [
            arg_0._clean_isbn(arg_3)
            for arg_3 in arg_0["901i"]
        ]


def Func ( arg_0 , arg_1 ) : if arg_0 . parent is None : return arg_0 if arg_0 . parent . task_spec == arg_1 : return arg_0 return arg_0 . parent . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        Returns the ancestor that has a task with the given task spec
        as a parent.
        If no such ancestor was found, the root task is returned.

        :type  parent_task_spec: TaskSpec
        :param parent_task_spec: The wanted ancestor.
        :rtype:  Task
        :returns: The child of the given ancestor.
        """
        if arg_0.parent is None:
            return arg_0
        if arg_0.parent.task_spec == arg_1:
            return arg_0
        return arg_0.parent.Func(arg_1)

Returns the ancestor that has a task with the given task spec as a parent . If no such ancestor was found the root task is returned .


def
Func
(
arg_0
)
:
arg_1
=
settings
.
Session
(
)
arg_2
=
arg_1
.
query
(
DagModel
)
.
filter
(
DagModel
.
dag_id
.
in_
(
DAG_IDS
)
)
for
arg_3
in
arg_2
:
logging
.
info
(
'Setting DAG :: {} is_paused={}'
.
format
(
arg_3
,
arg_0
)
)
arg_3
.
is_paused
=
arg_0
arg_1
.
commit
(
)

def Func(arg_0):
    """
    Toggle the pause state of the DAGs in the test.
    """
    arg_1 = settings.Session()
    arg_2 = arg_1.query(DagModel).filter(
        DagModel.dag_id.in_(DAG_IDS))
    for arg_3 in arg_2:
        logging.info('Setting DAG :: {} is_paused={}'.format(arg_3, arg_0))
        arg_3.is_paused = arg_0
    arg_1.commit()

Toggle the pause state of the DAGs in the test .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Updates the ports through redis."""
        arg_4 = db_api.port_find(arg_1, id=arg_2, scope=db_api.ONE)
        if not arg_4:
            LOG.warning("Port not found")
            return
        arg_5 = port_api._get_net_driver(arg_4.network, arg_4=arg_4)
        arg_6 = port_api._get_net_driver(arg_4.network)
        arg_7 = [sg for sg in arg_4.security_groups]

        arg_8 = False
        arg_9 = None
        arg_10 = 3
        arg_11 = 2
        for arg_12 in xrange(arg_10):
            try:
                arg_5.update_port(arg_1, port_id=arg_4["backend_key"],
                                       mac_address=arg_4["mac_address"],
                                       device_id=arg_4["device_id"],
                                       arg_6=arg_6,
                                       security_groups=arg_7)
                arg_8 = True
                arg_9 = None
                break
            except Exception as arg_9:
                LOG.warning("Could not connect to redis, but retrying soon")
                time.sleep(arg_11)
        arg_13 = ""
        if not arg_8:
            arg_13 = "Port %s update failed after %d tries. Error: %s" % (
                arg_2, arg_10, arg_9)
        arg_14 = dict(completed=True, status=arg_13)
        arg_14 = dict(job=arg_14)
        job_api.update_job(arg_1.elevated(), arg_3, arg_14)


def Func ( arg_0 ) : if arg_0 . project_name == 'setuptools' : if not len ( arg_0 . specs ) : return True for arg_1 , arg_2 in arg_0 . specs : if arg_1 in [ '==' , '>=' , '>' ] : if '0.7' in arg_2 : return False return True return False

def Func(arg_0):
    """Return True when distribute wants to override a setuptools dependency.

    We want to override when the requirement is setuptools and the version is
    a variant of 0.6.

    """
    if arg_0.project_name == 'setuptools':
        if not len(arg_0.specs):
            # Just setuptools: ok
            return True
        for arg_1, arg_2 in arg_0.specs:
            if arg_1 in ['==', '>=', '>']:
                if '0.7' in arg_2:
                    # We want some setuptools not from the 0.6 series.
                    return False
        return True
    return False

Return True when distribute wants to override a setuptools dependency .


def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . feed_forward ( arg_1 , ** arg_2 ) [ arg_0 . layers [ - 1 ] . full_name ( 'pre' ) ]

def Func(arg_0, arg_1, **arg_2):
        '''Compute the logit values that underlie the softmax output.

        Parameters
        ----------
        x : ndarray (num-examples, num-variables)
            An array containing examples to classify. Examples are given as the
            rows in this array.

        Returns
        -------
        l : ndarray (num-examples, num-classes)
            An array of posterior class logit values, one row of logit values
            per row of input data.
        '''
        return arg_0.feed_forward(arg_1, **arg_2)[arg_0.layers[-1].full_name('pre')]

Compute the logit values that underlie the softmax output .


(cls, obj, serializedClasses,
                              serializedConfiguredUnits)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = isinstance ( arg_1 , Entity ) arg_5 = isinstance ( arg_1 , Architecture ) if arg_4 : arg_6 = arg_1 . origin elif arg_5 : arg_6 = arg_1 . entity . origin else : return True assert isinstance ( arg_6 , Unit ) arg_7 = arg_6 . _serializeDecision if arg_7 is None : return True else : arg_8 = arg_2 . get ( arg_6 . __class__ , None ) arg_9 , arg_10 = arg_7 ( arg_6 , arg_1 , arg_4 , arg_8 ) arg_2 [ arg_6 . __class__ ] = arg_10 return arg_9

def Func(arg_0, arg_1, arg_2,
                              arg_3):
        """
        Decide if this unit should be serialized or not eventually fix name
        to fit same already serialized unit

        :param obj: object to serialize
        :param serializedClasses: dict {unitCls : unitobj}
        :param serializedConfiguredUnits: (unitCls, paramsValues) : unitObj
            where paramsValues are named tuple name:value
        """
        arg_4 = isinstance(arg_1, Entity)
        arg_5 = isinstance(arg_1, Architecture)
        if arg_4:
            arg_6 = arg_1.origin
        elif arg_5:
            arg_6 = arg_1.entity.origin
        else:
            return True

        assert isinstance(arg_6, Unit)
        arg_7 = arg_6._serializeDecision
        if arg_7 is None:
            return True
        else:
            arg_8 = arg_2.get(arg_6.__class__, None)
            arg_9, arg_10 = arg_7(arg_6, arg_1, arg_4, arg_8)
            arg_2[arg_6.__class__] = arg_10
            return arg_9


def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_1 == 'any' : return arg_0 if arg_2 : arg_1 = tags . tag ( arg_1 ) . language . format return [ arg_3 for arg_3 in arg_0 if tags . tag ( arg_3 . language ) . language . format == arg_1 ] else : arg_1 = tags . tag ( arg_1 ) . format return [ arg_3 for arg_3 in arg_0 if tags . tag ( arg_3 . language ) . format == arg_1 ]

def Func(arg_0, arg_1, arg_2=False):
    '''
    Filter a list of labels, leaving only labels of a certain language.

    :param list labels: A list of :class:`Label`.
    :param str language: An IANA language string, eg. `nl` or `nl-BE`.
    :param boolean broader: When true, will also match `nl-BE` when filtering
        on `nl`. When false, only exact matches are considered.
    '''
    if arg_1 == 'any':
        return arg_0
    if arg_2:
        arg_1 = tags.tag(arg_1).language.format
        return [arg_3 for arg_3 in arg_0 if tags.tag(arg_3.language).language.format == arg_1]
    else:
        arg_1 = tags.tag(arg_1).format
        return [arg_3 for arg_3 in arg_0 if tags.tag(arg_3.language).format == arg_1]

Filter a list of labels leaving only labels of a certain language .


(
            self,
            index=0,
            count=1,
            security_level=AddressGenerator.DEFAULT_SECURITY_LEVEL,
            checksum=False,
    )

return extended.GetNewAddressesCommand(self.adapter)(
            count=count,
            index=index,
            securityLevel=security_level,
            checksum=checksum,
            seed=self.seed,
        )

def Func ( arg_0 , arg_1 = 0 , arg_2 = 1 , arg_3 = arg_4 . DEFAULT_SECURITY_LEVEL , arg_6 = False , ) : return extended . GetNewAddressesCommand ( arg_0 . adapter ) ( arg_2 = arg_2 , arg_1 = arg_1 , securityLevel = arg_3 , arg_6 = arg_6 , seed = arg_0 . seed , )

def Func(
            arg_0,
            arg_1=0,
            arg_2=1,
            arg_3=arg_4.DEFAULT_SECURITY_LEVEL,
            arg_6=False,
    ):
        # type: (int, Optional[int], int, bool) -> dict
        """
        Generates one or more new addresses from the seed.

        :param index:
            The key index of the first new address to generate (must be
            >= 1).

        :param count:
            Number of addresses to generate (must be >= 1).

            .. tip::
                This is more efficient than calling ``get_new_address``
                inside a loop.

            If ``None``, this method will progressively generate
            addresses and scan the Tangle until it finds one that has no
            transactions referencing it.

        :param security_level:
            Number of iterations to use when generating new addresses.

            Larger values take longer, but the resulting signatures are
            more secure.

            This value must be between 1 and 3, inclusive.

        :param checksum:
            Specify whether to return the address with the checksum.
            Defaults to ``False``.

        :return:
            Dict with the following structure::

            {
                'addresses': List[Address],
                    Always a list, even if only one address was
                    generated.
            }

        References:

        - https://github.com/iotaledger/wiki/blob/master/api-proposal.md#getnewaddress
        """
        return extended.GetNewAddressesCommand(arg_0.adapter)(
            arg_2=arg_2,
            arg_1=arg_1,
            securityLevel=arg_3,
            arg_6=arg_6,
            seed=arg_0.seed,
        )

Generates one or more new addresses from the seed .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
[
x
for
x
in
arg_0
if
x
not
in
arg_2
]
if
arg_3
:
arg_4
=
", "
.
join
(
arg_3
)
raise
Exception
(
"Missing fields: %s"
%
arg_4
)
arg_5
=
[
x
for
x
in
arg_2
if
x
not
in
arg_1
and
x
not
in
arg_0
]
if
arg_5
:
arg_4
=
", "
.
join
(
arg_5
)
raise
Exception
(
"Disallowed fields: %s"
%
arg_4
)

def Func(arg_0, arg_1, arg_2):
    """
    Helps us validate the parameters for the request

    :param valid_options: a list of strings of valid options for the
                          api request
    :param params: a dict, the key-value store which we really only care about
                   the key which has tells us what the user is using for the
                   API request

    :returns: None or throws an exception if the validation fails
    """

    arg_3 = [x for x in arg_0 if x not in arg_2]
    if arg_3:
        arg_4 = ", ".join(arg_3)
        raise Exception("Missing fields: %s" % arg_4)

    arg_5 = [x for x in arg_2 if x not in arg_1 and x not in arg_0]
    if arg_5:
        arg_4 = ", ".join(arg_5)
        raise Exception("Disallowed fields: %s" % arg_4)


(self, op, qargs, cargs, condition=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Add a new operation node to the graph and assign properties.

        Args:
            op (Instruction): the operation associated with the DAG node
            qargs (list): list of quantum wires to attach to.
            cargs (list): list of classical wires to attach to.
            condition (tuple or None): optional condition (ClassicalRegister, int)
        """
        arg_5 = {
            "type": "op",
            "op": arg_1,
            "name": arg_1.name,
            "qargs": arg_2,
            "cargs": arg_3,
            "condition": arg_4
        }

        # Add a new operation node to the graph
        arg_0._max_node_id += 1
        arg_6 = DAGNode(data_dict=arg_5, nid=arg_0._max_node_id)
        arg_0._multi_graph.add_node(arg_6)
        arg_0._id_to_node[arg_0._max_node_id] = arg_6

Add a new operation node to the graph and assign properties .


(context, method, path, seconds=None, use_container=False)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False):
    """
    Generates a TempURL and sends that to the context.io_manager's
    stdout.

    See :py:mod:`swiftly.cli.tempurl` for context usage information.

    See :py:class:`CLITempURL` for more information.

    :param context: The :py:class:`swiftly.cli.context.CLIContext` to
        use.
    :param method: The method for the TempURL (GET, PUT, etc.)
    :param path: The path the TempURL should direct to.
    :param seconds: The number of seconds the TempURL should be good
        for. Default: 3600
    :param use_container: If True, will create a container level TempURL
        useing X-Container-Meta-Temp-Url-Key instead of
        X-Account-Meta-Temp-Url-Key.
    """
    with contextlib.nested(
            arg_0.io_manager.with_stdout(),
            arg_0.client_manager.with_client()) as (fp, client):
        arg_1 = arg_1.upper()
        arg_2 = arg_2.lstrip('/')
        arg_3 = arg_3 if arg_3 is not None else 3600
        if '/' not in arg_2:
            raise ReturnCode(
                'invalid tempurl path %r; should have a / within it' % arg_2)
        if arg_4:
            arg_5 = 'container'
            arg_6 = arg_2.split('/', 1)[0]
            arg_7, arg_8, arg_9, arg_10 = \
                client.head_container(arg_6)
        else:
            arg_5 = 'account'
            arg_7, arg_8, arg_9, arg_10 = \
                client.head_account()
        if arg_7 // 100 != 2:
            raise ReturnCode(
                'obtaining X-%s-Meta-Temp-Url-Key: %s %s' %
                (arg_5.title(), arg_7, arg_8))
        arg_11 = arg_9.get('x-%s-meta-temp-url-key' % arg_5)
        if not arg_11:
            raise ReturnCode(
                'there is no X-%s-Meta-Temp-Url-Key set for this %s' %
                (arg_5.title(), arg_5))
        arg_12 = client.storage_url + '/' + arg_2
        fp.write(generate_temp_url(arg_1, arg_12, arg_3, arg_11))
        fp.write('\n')
        fp.flush()

Generates a TempURL and sends that to the context . io_manager s stdout .


def Func ( arg_0 = None ) : arg_1 , arg_2 , arg_3 , arg_4 = tl . files . load_imdb_dataset ( nb_words = VOCAB_SIZE ) if arg_0 is not None : arg_1 = np . array ( [ augment_with_ngrams ( x , VOCAB_SIZE , N_BUCKETS , n = arg_0 ) for x in arg_1 ] ) arg_3 = np . array ( [ augment_with_ngrams ( x , VOCAB_SIZE , N_BUCKETS , n = arg_0 ) for x in arg_3 ] ) return arg_1 , arg_2 , arg_3 , arg_4

def Func(arg_0=None):
    """Load IMDb data and augment with hashed n-gram features."""
    arg_1, arg_2, arg_3, arg_4 = tl.files.load_imdb_dataset(nb_words=VOCAB_SIZE)

    if arg_0 is not None:
        arg_1 = np.array([augment_with_ngrams(x, VOCAB_SIZE, N_BUCKETS, n=arg_0) for x in arg_1])
        arg_3 = np.array([augment_with_ngrams(x, VOCAB_SIZE, N_BUCKETS, n=arg_0) for x in arg_3])

    return arg_1, arg_2, arg_3, arg_4

Load IMDb data and augment with hashed n - gram features .


(filename, key, outputFile, fields=None, watermark=1024 * 1024 * 100)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = 1024 * 1024 * 100 ) : if arg_3 is not None : assert set ( arg_1 ) . issubset ( set ( [ arg_5 [ 0 ] for arg_5 in arg_3 ] ) ) with FileRecordStream ( arg_0 ) as arg_5 : if arg_3 : arg_6 = [ ff [ 0 ] for ff in arg_3 ] arg_7 = [ arg_5 . getFieldNames ( ) . index ( name ) for name in arg_6 ] assert len ( arg_7 ) == len ( arg_3 ) else : arg_8 = arg_5 . getFields ( ) arg_6 = arg_5 . getFieldNames ( ) arg_7 = None arg_1 = [ arg_6 . index ( name ) for name in arg_1 ] arg_9 = 0 arg_10 = [ ] for arg_11 , arg_12 in enumerate ( arg_5 ) : if arg_7 : arg_13 = [ ] for arg_11 in arg_7 : arg_13 . append ( arg_12 [ arg_11 ] ) arg_12 = arg_13 arg_10 . append ( arg_12 ) arg_14 = psutil . avail_phymem ( ) if arg_14 < arg_4 : _FuncChunk ( arg_10 , arg_1 , arg_9 , arg_3 ) arg_10 = [ ] arg_9 += 1 if len ( arg_10 ) > 0 : _FuncChunk ( arg_10 , arg_1 , arg_9 , arg_3 ) arg_9 += 1 _mergeFiles ( arg_1 , arg_9 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=1024 * 1024 * 100):
  """Sort a potentially big file

  filename - the input file (standard File format)
  key - a list of field names to Func by
  outputFile - the name of the output file
  fields - a list of fields that should be included (all fields if None)
  watermark - when available memory goes bellow the watermark create a new chunk

  Func() works by reading as records from the file into memory
  and calling _FuncChunk() on each chunk. In the process it gets
  rid of unneeded fields if any. Once all the chunks have been Funced and
  written to chunk files it calls _merge() to merge all the chunks into a
  single Funced file.

  Note, that Func() gets a key that contains field names, which it converts
  into field indices for _FuncChunk() becuase _FuncChunk() doesn't need to know
  the field name.

  Func() figures out by itself how many chunk files to use by reading records
  from the file until the low watermark value of availabel memory is hit and
  then it Funcs the current records, generates a chunk file, clears the Funced
  records and starts on a new chunk.

  The key field names are turned into indices
  """
  if arg_3 is not None:
    assert set(arg_1).issubset(set([arg_5[0] for arg_5 in arg_3]))

  with FileRecordStream(arg_0) as arg_5:

    # Find the indices of the requested fields
    if arg_3:
      arg_6 = [ff[0] for ff in arg_3]
      arg_7 = [arg_5.getFieldNames().index(name) for name in arg_6]
      assert len(arg_7) == len(arg_3)
    else:
      arg_8 = arg_5.getFields()
      arg_6 = arg_5.getFieldNames()
      arg_7 = None

    # turn key fields to key indices
    arg_1 = [arg_6.index(name) for name in arg_1]

    arg_9 = 0
    arg_10 = []
    for arg_11, arg_12 in enumerate(arg_5):
      # Select requested fields only
      if arg_7:
        arg_13 = []
        for arg_11 in arg_7:
          arg_13.append(arg_12[arg_11])
        arg_12 = arg_13
      # Store processed record
      arg_10.append(arg_12)

      # Check memory
      arg_14 = psutil.avail_phymem()

      # If bellow the watermark create a new chunk, reset and keep going
      if arg_14 < arg_4:
        _FuncChunk(arg_10, arg_1, arg_9, arg_3)
        arg_10 = []
        arg_9 += 1

    # Sort and write the remainder
    if len(arg_10) > 0:
      _FuncChunk(arg_10, arg_1, arg_9, arg_3)
      arg_9 += 1

    # Marge all the files
    _mergeFiles(arg_1, arg_9, arg_2, arg_3)

Sort a potentially big file

  filename - the input file (standard File format)
  key - a list of field names to sort by
  outputFile - the name of the output file
  fields - a list of fields that should be included (all fields if None)
  watermark - when available memory goes bellow the watermark create a new chunk

  sort() works by reading as records from the file into memory
  and calling _sortChunk() on each chunk. In the process it gets
  rid of unneeded fields if any. Once all the chunks have been sorted and
  written to chunk files it calls _merge() to merge all the chunks into a
  single sorted file.

  Note, that sort() gets a key that contains field names, which it converts
  into field indices for _sortChunk() becuase _sortChunk() doesn't need to know
  the field name.

  sort() figures out by itself how many chunk files to use by reading records
  from the file until the low watermark value of availabel memory is hit and
  then it sorts the current records, generates a chunk file, clears the sorted
  records and starts on a new chunk.

  The key field names are turned into indices


(self, message, json=False, callback=None)

def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = None ) : arg_4 = dict ( type = "message" , data = arg_1 , endpoint = arg_0 . ns_name ) if arg_2 : arg_4 [ 'type' ] = "json" if arg_3 : arg_4 [ 'ack' ] = True arg_4 [ 'id' ] = msgid = arg_0 . socket . _get_next_msgid ( ) arg_0 . socket . _save_ack_callback ( msgid , arg_3 ) arg_0 . socket . Func_packet ( arg_4 )

def Func(arg_0, arg_1, arg_2=False, arg_3=None):
        """Use Func to Func a simple string message.

        If ``json`` is True, the message will be encoded as a JSON object
        on the wire, and decoded on the other side.

        This is mostly for backwards compatibility.  ``emit()`` is more fun.

        :param callback: This is a callback function that will be
                         called automatically by the client upon
                         reception.  It does not verify that the
                         listener over there was completed with
                         success.  It just tells you that the browser
                         got a hold of the packet.
        :type callback: callable
        """
        arg_4 = dict(type="message", data=arg_1, endpoint=arg_0.ns_name)
        if arg_2:
            arg_4['type'] = "json"

        if arg_3:
            # By passing ack=True, we use the old behavior of being returned
            # an 'ack' packet, automatically triggered by the client-side
            # with no user-code being run.  The emit() version of the
            # callback is more useful I think :)  So migrate your code.
            arg_4['ack'] = True
            arg_4['id'] = msgid = arg_0.socket._get_next_msgid()
            arg_0.socket._save_ack_callback(msgid, arg_3)

        arg_0.socket.Func_packet(arg_4)

Use send to send a simple string message.

        If ``json`` is True, the message will be encoded as a JSON object
        on the wire, and decoded on the other side.

        This is mostly for backwards compatibility.  ``emit()`` is more fun.

        :param callback: This is a callback function that will be
                         called automatically by the client upon
                         reception.  It does not verify that the
                         listener over there was completed with
                         success.  It just tells you that the browser
                         got a hold of the packet.
        :type callback: callable

Use send to send a simple string message .


def Func(arg_0, arg_1):
        """
        get directory info from the Repository.

        :Parameters:
            #. relativePath (string): The relative to the repository path of the directory.

        :Returns:
            #. info (None, dictionary): The directory information dictionary.
               If None, it means an error has occurred.
            #. error (string): The error message if any error occurred.
        """
        arg_1 = os.path.normpath(arg_1)
        # if root directory
        if arg_1 in ('','.'):
            return arg_0, ""
        arg_2  = arg_0.__path
        arg_3 = arg_0
        for arg_4 in arg_1.split(os.sep):
            arg_3 = dict.__getitem__(arg_3, "directories")
            arg_2 = os.path.join(arg_2, arg_4)
            # check if path exists
            if not os.path.exists(arg_2):
                return None,  "directory '%s' is not found"%arg_2
            arg_5 = arg_3.get(arg_4, None)
            # check if directory is registered in repository
            if arg_5 is None:
                return None,  "directory '%s' is not registered in PyrepInfo"%arg_2
            arg_3 = arg_5
        return arg_3, ""

get directory info from the Repository .


def
Func
(
)
:
arg_0
.
token
=
arg_0
.
communicator
.
login_with_api_key
(
arg_0
.
email
,
arg_0
.
api_key
,
application
=
arg_0
.
application
)
if
len
(
arg_0
.
token
)
<
10
:
arg_2
=
getpass
.
getpass
(
'One-Time Password: '
)
arg_0
.
token
=
arg_0
.
communicator
.
mfa_otp_login
(
arg_0
.
token
,
arg_2
)
return
arg_0
.
token

def Func():
    """
    Renew or get a token to use for transactions with the Midas Server
    instance.

    :returns: API token.
    :rtype: string
    """
    arg_0.token = arg_0.communicator.login_with_api_key(
        arg_0.email, arg_0.api_key, application=arg_0.application)
    if len(arg_0.token) < 10:  # HACK to check for mfa being enabled
        arg_2 = getpass.getpass('One-Time Password: ')
        arg_0.token = arg_0.communicator.mfa_otp_login(
            arg_0.token, arg_2)
    return arg_0.token

Renew or get a token to use for transactions with the Midas Server instance .


def Func(arg_0: arg_1[arg_2[arg_3, arg_4]]) -> arg_1[arg_3]:
    """Builds a skeleton for gene summaries

    :param entrez_ids: A list of Entrez Gene identifiers to query the PubMed service
    :return: An iterator over statement lines for NCBI Entrez Gene summaries
    """
    arg_5 = PUBMED_GENE_QUERY_URL.format(','.join(arg_3(arg_8).strip() for arg_8 in arg_0))
    arg_6 = requests.get(arg_5)
    arg_7 = ElementTree.fromstring(arg_6.content)

    for arg_8 in arg_7.findall('./DocumentSummarySet/DocumentSummary'):
        yield '\n# {}'.format(arg_8.find('Description').text)
        yield 'SET Citation = {{"Other", "PubMed Gene", "{}"}}'.format(arg_8.attrib['uid'])
        yield 'SET Evidence = "{}"'.format(arg_8.find('Summary').text.strip().replace('\n', ''))
        yield '\nUNSET Evidence\nUNSET Citation'


(cur, route_id, offset=0, tripid_glob='')

'      LEFT JOIN trips USING (route_I) '

def Func(arg_0, arg_1, arg_2=0, arg_3=''):
    """Get all scheduled stops on a particular route_id.

    Given a route_id, return the trip-stop-list with
    latitude/longitudes.  This is a bit more tricky than it seems,
    because we have to go from table route->trips->stop_times.  This
    functions finds an arbitrary trip (in trip table) with this route ID
    and, and then returns all stop points for that trip.

    Parameters
    ----------
    cur : sqlite3.Cursor
        cursor to sqlite3 DB containing GTFS
    route_id : string or any
        route_id to get stop points of
    offset : int
        LIMIT offset if you don't want the first trip returned.
    tripid_glob : string
        If given, allows you to limit tripids which can be selected.
        Mainly useful in debugging.

    Returns
    -------
    stop-list
        List of stops in stop-seq format.
    """
    arg_4 = ''
    if arg_3:
        arg_4 = "AND trip_id GLOB '%s'" % arg_3
    arg_0.execute('SELECT seq, lat, lon '
                'FROM (select trip_I from route '
                '      LEFT JOIN trips USING (route_I) '
                '      WHERE route_id=? %s limit 1 offset ? ) '
                'JOIN stop_times USING (trip_I) '
                'LEFT JOIN stop USING (stop_id) '
                'ORDER BY seq' % arg_4, (arg_1, arg_2))
    arg_5 = [dict(seq=row[0], lat=row[1], lon=row[2]) for row in arg_0]
    return arg_5

Get all scheduled stops on a particular route_id .


def Func(arg_0, arg_1):
    '''This imports the module specified.

    Used to dynamically import Python modules that are needed to support LC
    formats not natively supported by astrobase.

    Parameters
    ----------

    module : str
        This is either:

        - a Python module import path, e.g. 'astrobase.lcproc.catalogs' or
        - a path to a Python file, e.g. '/astrobase/hatsurveys/hatlc.py'

        that contains the Python module that contains functions used to open
        (and optionally normalize) a custom LC format that's not natively
        supported by astrobase.

    formatkey : str
        A str used as the unique ID of this LC format for all lcproc functions
        and can be used to look it up later and import the correct functions
        needed to support it for lcproc operations. For example, we use
        'kep-fits' as a the specifier for Kepler FITS light curves, which can be
        read by the `astrobase.astrokep.read_kepler_fitslc` function as
        specified by the `<astrobase install path>/data/lcformats/kep-fits.json`
        LC format specification JSON.

    Returns
    -------

    Python module
        This returns a Python module if it's able to successfully import it.

    '''

    try:

        if os.path.exists(arg_0):

            sys.path.append(os.path.dirname(arg_0))
            arg_2 = importlib.import_module(
                os.path.basename(arg_0.replace('.py',''))
            )

        else:
            arg_2 = importlib.import_module(arg_0)

    except Exception as e:

        LOGEXCEPTION('could not import the module: %s for LC format: %s. '
                     'check the file path or fully qualified module name?'
                     % (arg_0, arg_1))
        arg_2 = False

    return arg_2


def Func ( arg_0 , arg_1 , arg_2 : arg_3 ) -> None : arg_0 . extra_conditions . append ( ( arg_1 , arg_2 ) )

def Func(arg_0, arg_1, arg_2: arg_3) -> None:
        """Adds an extra condition to this join.

        Arguments:
            field:
                The field that the condition will apply to.

            value:
                The value to compare.
        """

        arg_0.extra_conditions.append((arg_1, arg_2))


return Manhattan().sim(src, tar, qval, alphabet)

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

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

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

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Manhattan similarity

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

    """
    return Manhattan().sim(arg_0, arg_1, arg_2, arg_3)

Return the normalized Manhattan similarity of two strings.

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

    Parameters
    ----------
    src : str
        Source string (or QGrams/Counter objects) for comparison
    tar : str
        Target string (or QGrams/Counter objects) for comparison
    qval : int
        The length of each q-gram; 0 for non-q-gram version
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float
        The normalized Manhattan similarity

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

Return the normalized Manhattan similarity of two strings .


def Func ( arg_0 ) : if arg_0 . tab_widget . count ( ) <= 1 : arg_0 . tab_widget . tabBar ( ) . setVisible ( False ) else : arg_0 . tab_widget . tabBar ( ) . setVisible ( True ) if arg_0 . tab_widget . count ( ) == 0 : arg_0 . close ( )

def Func(arg_0):
        """ update visibility of the tabBar depending of the number of tab

        0 or 1 tab, tabBar hidden
        2+ tabs, tabBar visible

        send a self.close if number of tab ==0

        need to be called explicitly, or be connected to tabInserted/tabRemoved
        """
        if arg_0.tab_widget.count() <= 1:
            arg_0.tab_widget.tabBar().setVisible(False)
        else:
            arg_0.tab_widget.tabBar().setVisible(True)
        if arg_0.tab_widget.count()==0 :
            arg_0.close()


def Func(arg_0):
    """Decides where to write the stream.

    Depending on arguments it can be one of these:
     - The stdout pipe
     - A subprocess' stdin pipe
     - A named pipe that the subprocess reads from
     - A regular file

    """

    if (args.output or args.stdout) and (args.record or args.record_and_pipe):
        console.exit("Cannot use record options with other file output options.")

    if args.output:
        if args.output == "-":
            arg_1 = FileOutput(fd=stdout)
        else:
            arg_1 = check_file_output(args.output, args.force)
    elif args.stdout:
        arg_1 = FileOutput(fd=stdout)
    elif args.record_and_pipe:
        arg_2 = check_file_output(args.record_and_pipe, args.force)
        arg_1 = FileOutput(fd=stdout, arg_2=arg_2)
    else:
        arg_3 = arg_5 = arg_2 = None

        if not args.player:
            console.exit("The default player (VLC) does not seem to be "
                         "installed. You must specify the path to a player "
                         "executable with --player.")

        if args.player_fifo:
            arg_4 = "streamlinkpipe-{0}".format(os.getpid())
            log.info("Creating pipe {0}", arg_4)

            try:
                arg_5 = NamedPipe(arg_4)
            except IOError as err:
                console.exit("Failed to create pipe: {0}", err)
        elif args.player_http:
            arg_3 = create_http_server()

        arg_6 = create_title(arg_0)

        if args.record:
            arg_2 = check_file_output(args.record, args.force)

        log.info("Starting player: {0}", args.player)

        arg_1 = PlayerOutput(args.player, args=args.player_args,
                           quiet=not args.verbose_player,
                           kill=not args.player_no_close,
                           arg_5=arg_5, arg_3=arg_3,
                           arg_2=arg_2, arg_6=arg_6)

    return arg_1


def Func ( arg_0 ) : if arg_0 . scale_by_freq == False : return sum ( arg_0 . psd ) * len ( arg_0 . psd ) else : return sum ( arg_0 . psd ) * arg_0 . df / ( 2. * numpy . pi )

def Func(arg_0):
        r"""Return the Func contained in the PSD

        if scale_by_freq is False, the Func is:

        .. math:: P = N \sum_{k=1}^{N} P_{xx}(k)

        else, it is

        .. math:: P =  \sum_{k=1}^{N} P_{xx}(k) \frac{df}{2\pi}

        .. todo:: check these equations

        """
        if arg_0.scale_by_freq == False:
            return sum(arg_0.psd) * len(arg_0.psd)
        else:
            return sum(arg_0.psd) * arg_0.df/(2.*numpy.pi)

r"""Return the power contained in the PSD

        if scale_by_freq is False, the power is:

        .. math:: P = N \sum_{k=1}^{N} P_{xx}(k)

        else, it is

        .. math:: P =  \sum_{k=1}^{N} P_{xx}(k) \frac{df}{2\pi}

        .. todo:: check these equations


(self, delay=0, depth=2, regen=0, width=71, speed=0.5,
                shape='sine', phase=25, interp='linear')

def Func(arg_0, arg_1=0, arg_2=2, arg_3=0, arg_4=71, arg_5=0.5,
                arg_6='sine', arg_7=25, arg_8='linear'):
        '''Apply a flanging effect to the audio.

        Parameters
        ----------
        delay : float, default=0
            Base delay (in miliseconds) between 0 and 30.
        depth : float, default=2
            Added swept delay (in miliseconds) between 0 and 10.
        regen : float, default=0
            Percentage regeneration between -95 and 95.
        width : float, default=71,
            Percentage of delayed signal mixed with original between 0 and 100.
        speed : float, default=0.5
            Sweeps per second (in Hz) between 0.1 and 10.
        shape : 'sine' or 'triangle', default='sine'
            Swept wave shape
        phase : float, default=25
            Swept wave percentage phase-shift for multi-channel flange between
            0 and 100. 0 = 100 = same phase on each channel
        interp : 'linear' or 'quadratic', default='linear'
            Digital delay-line interpolation type.

        See Also
        --------
        tremolo
        '''
        if not is_number(arg_1) or arg_1 < 0 or arg_1 > 30:
            raise ValueError("delay must be a number between 0 and 30.")
        if not is_number(arg_2) or arg_2 < 0 or arg_2 > 10:
            raise ValueError("depth must be a number between 0 and 10.")
        if not is_number(arg_3) or arg_3 < -95 or arg_3 > 95:
            raise ValueError("regen must be a number between -95 and 95.")
        if not is_number(arg_4) or arg_4 < 0 or arg_4 > 100:
            raise ValueError("width must be a number between 0 and 100.")
        if not is_number(arg_5) or arg_5 < 0.1 or arg_5 > 10:
            raise ValueError("speed must be a number between 0.1 and 10.")
        if arg_6 not in ['sine', 'triangle']:
            raise ValueError("shape must be one of 'sine' or 'triangle'.")
        if not is_number(arg_7) or arg_7 < 0 or arg_7 > 100:
            raise ValueError("phase must be a number between 0 and 100.")
        if arg_8 not in ['linear', 'quadratic']:
            raise ValueError("interp must be one of 'linear' or 'quadratic'.")

        arg_9 = [
            'Func',
            '{:f}'.format(arg_1),
            '{:f}'.format(arg_2),
            '{:f}'.format(arg_3),
            '{:f}'.format(arg_4),
            '{:f}'.format(arg_5),
            '{}'.format(arg_6),
            '{:f}'.format(arg_7),
            '{}'.format(arg_8)
        ]

        arg_0.effects.extend(arg_9)
        arg_0.effects_log.append('Func')

        return arg_0


return DagsterLog(run_config.run_id, get_logging_tags(None, run_config, pipeline_def), loggers)

def Func ( arg_0 , arg_1 ) : check . inst_param ( arg_0 , 'run_config' , RunConfig ) check . inst_param ( arg_1 , 'pipeline_def' , PipelineDefinition ) arg_2 = [ define_colored_console_logger ( 'dagster' ) ] if arg_0 . event_callback : arg_2 += [ construct_event_logger ( arg_0 . event_callback ) ] elif arg_0 . loggers : arg_2 += arg_0 . loggers return DagsterLog ( arg_0 . run_id , get_logging_tags ( None , arg_0 , arg_1 ) , arg_2 )

def Func(arg_0, arg_1):
    '''In the event of pipeline initialization failure, we want to be able to log the failure
    without a dependency on the ExecutionContext to initialize DagsterLog
    '''
    check.inst_param(arg_0, 'run_config', RunConfig)
    check.inst_param(arg_1, 'pipeline_def', PipelineDefinition)

    # Use the default logger
    arg_2 = [define_colored_console_logger('dagster')]
    if arg_0.event_callback:
        arg_2 += [construct_event_logger(arg_0.event_callback)]
    elif arg_0.loggers:
        arg_2 += arg_0.loggers

    return DagsterLog(arg_0.run_id, get_logging_tags(None, arg_0, arg_1), arg_2)

In the event of pipeline initialization failure we want to be able to log the failure without a dependency on the ExecutionContext to initialize DagsterLog


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Begins the async update process."""
        arg_5 = db_api.security_group_find(arg_1, id=arg_2, scope=db_api.ONE)
        if not arg_5:
            return None
        with arg_1.session.begin():
            arg_6 = dict(arg_4="%s sg rule %s" % (arg_4, arg_3),
                            resource_id=arg_3,
                            tenant_id=arg_5['tenant_id'])
            arg_6 = dict(arg_7=arg_6)
            arg_7 = job_api.create_job(arg_1.elevated(), arg_6)
            arg_8 = QuarkSGAsyncProducerClient()
            try:
                arg_8.populate_subtasks(arg_1, arg_2, arg_7['id'])
            except om_exc.MessagingTimeout:
                LOG.error("Failed to create subtasks. Rabbit running?")
                return None
        return {"job_id": arg_7['id']}


return [attr_i if i in self.inputs else None
               for i, attr_i in enumerate(example)]

def Func ( arg_0 , arg_1 ) : return [ arg_3 if arg_2 in arg_0 . inputs else None for arg_2 , arg_3 in enumerate ( arg_1 ) ]

def Func(arg_0, arg_1):
       "Return a copy of example, with non-input attributes replaced by None."
       return [arg_3 if arg_2 in arg_0.inputs else None
               for arg_2, arg_3 in enumerate(arg_1)]

Return a copy of example with non - input attributes replaced by None .


def Func(arg_0, arg_1):
        """Helper function for stats tables on season pages. Returns a
        DataFrame."""
        arg_2 = arg_0.get_main_doc()
        arg_3 = arg_2(arg_1)
        arg_4 = sportsref.utils.parse_table(arg_3)
        arg_4.set_index('team_id', inplace=True)
        return arg_4

Helper function for stats tables on season pages . Returns a DataFrame .


def Func ( arg_0 , arg_1 = None ) : Func = arg_0 . board_zobrist_hash ( arg_1 ) if arg_1 is None : arg_1 = DEFAULT_RANDOM_ARRAY if arg_0 . turn == WHITE : Func ^= arg_1 [ 2268 ] arg_3 = ( arg_0 . pieces_in_hand [ BLACK ] [ ROOK ] * 35625 + arg_0 . pieces_in_hand [ BLACK ] [ BISHOP ] * 11875 + arg_0 . pieces_in_hand [ BLACK ] [ GOLD ] * 2375 + arg_0 . pieces_in_hand [ BLACK ] [ SILVER ] * 475 + arg_0 . pieces_in_hand [ BLACK ] [ KNIGHT ] * 95 + arg_0 . pieces_in_hand [ BLACK ] [ LANCE ] * 19 + arg_0 . pieces_in_hand [ BLACK ] [ PAWN ] ) arg_4 = bit_scan ( arg_3 ) while arg_4 != - 1 and arg_4 is not None : Func ^= arg_1 [ 2269 + arg_4 ] arg_4 = bit_scan ( arg_3 , arg_4 + 1 ) return Func

def Func(arg_0, arg_1=None):
        '''
        Returns a Zobrist hash of the current position.
        '''
        # Hash in the board setup.
        Func = arg_0.board_zobrist_hash(arg_1)

        if arg_1 is None:
            arg_1 = DEFAULT_RANDOM_ARRAY

        if arg_0.turn == WHITE:
            Func ^= arg_1[2268]

        # pieces in hand pattern is
        # 19 * 5 * 5 * 5 * 5 * 3 * 3 = 106875 < pow(2, 17)
        # just checking black side is okay in normal state
        arg_3 = (
                arg_0.pieces_in_hand[BLACK][ROOK] * 35625 +
                arg_0.pieces_in_hand[BLACK][BISHOP] * 11875 +
                arg_0.pieces_in_hand[BLACK][GOLD] * 2375 +
                arg_0.pieces_in_hand[BLACK][SILVER] * 475 +
                arg_0.pieces_in_hand[BLACK][KNIGHT] * 95 +
                arg_0.pieces_in_hand[BLACK][LANCE] * 19 +
                arg_0.pieces_in_hand[BLACK][PAWN])
        arg_4 = bit_scan(arg_3)
        while arg_4 != -1 and arg_4 is not None:
            Func ^= arg_1[2269 + arg_4]
            arg_4 = bit_scan(arg_3, arg_4 + 1)

        return Func

Returns a Zobrist hash of the current position .


def
Func
(
arg_0
)
:
arg_1
=
requests
.
get
(
urljoin
(
arg_0
.
ENDPOINT
,
'dashboard'
)
,
headers
=
arg_0
.
_headers
)
arg_1
.
raise_for_status
(
)
for
arg_2
in
arg_1
.
json
(
)
[
'robots'
]
:
if
arg_2
[
'mac_address'
]
is
:
continue
try
:
arg_0
.
_robots
.
add
(
Robot
(
name
=
arg_2
[
'name'
]
,
serial
=
arg_2
[
'serial'
]
,
secret
=
arg_2
[
'secret_key'
]
,
traits
=
arg_2
[
'traits'
]
,
endpoint
=
arg_2
[
'nucleo_url'
]
)
)
except
requests
.
exceptions
.
HTTPError
:
print
(
"Your '{}' robot is offline."
.
format
(
arg_2
[
'name'
]
)
)
continue
arg_0
.
refresh_persistent_maps
(
)
for
arg_2
in
arg_0
.
_robots
:
arg_2
.
has_persistent_maps
=
arg_2
.
serial
in
arg_0
.
_persistent_maps

def Func(arg_0):
        """
        Get information about robots connected to account.

        :return:
        """
        arg_1 = requests.get(urljoin(arg_0.ENDPOINT, 'dashboard'),
                            headers=arg_0._headers)
        arg_1.raise_for_status()

        for arg_2 in arg_1.json()['robots']:
            if arg_2['mac_address'] is None:
                continue    # Ignore robots without mac-address

            try:
                arg_0._robots.add(Robot(name=arg_2['name'],
                                       serial=arg_2['serial'],
                                       secret=arg_2['secret_key'],
                                       traits=arg_2['traits'],
                                       endpoint=arg_2['nucleo_url']))
            except requests.exceptions.HTTPError:
                print ("Your '{}' robot is offline.".format(arg_2['name']))
                continue

        arg_0.refresh_persistent_maps()
        for arg_2 in arg_0._robots:
            arg_2.has_persistent_maps = arg_2.serial in arg_0._persistent_maps

Get information about robots connected to account .


def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes the specified hosted service from Windows Azure.

        service_name:
            Name of the hosted service.
        complete:
            True if all OS/data disks and the source blobs for the disks should
            also be deleted from storage.
        '''

        _validate_not_none('service_name', arg_1)

        arg_3 = arg_0._get_hosted_service_path(arg_1)

        if arg_2 == True:
            arg_3 = arg_3 +'?comp=media'

        return arg_0._perform_delete(arg_3, as_async=True)

Deletes the specified hosted service from Windows Azure .


def
Func
(
arg_0
)
:
logging
.
info
(
"network inputs: %s"
,
" "
.
join
(
map
(
str
,
arg_0
.
input_variables
)
)
)
logging
.
info
(
"network targets: %s"
,
" "
.
join
(
map
(
str
,
arg_0
.
target_variables
)
)
)
logging
.
info
(
"network parameters: %s"
,
" "
.
join
(
map
(
str
,
arg_0
.
all_parameters
)
)
)
logging
.
info
(
"parameter count: %d"
,
arg_0
.
parameter_count
)

def Func(arg_0):
        """
        Print network statistics.
        """
        logging.info("network inputs: %s", " ".join(map(str, arg_0.input_variables)))
        logging.info("network targets: %s", " ".join(map(str, arg_0.target_variables)))
        logging.info("network parameters: %s", " ".join(map(str, arg_0.all_parameters)))
        logging.info("parameter count: %d", arg_0.parameter_count)


def
Func
(
arg_0
=
"sentence"
,
*
arg_1
,
**
arg_2
)
:
if
arg_0
==
"character"
:
return
character
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"characters"
:
return
characters
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"word"
:
return
word
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"words"
:
return
words
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"sentence"
:
return
sentence
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"sentences"
:
return
sentences
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"paragraph"
:
return
paragraph
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"paragraphs"
:
return
paragraphs
(
*
arg_1
,
**
arg_2
)
elif
arg_0
==
"title"
:
return
title
(
*
arg_1
,
**
arg_2
)
else
:
raise
NameError
(
'No such method'
)

def Func(arg_0="sentence", *arg_1, **arg_2):
    """An aggregator for all above defined public methods."""

    if arg_0 == "character":
        return character(*arg_1, **arg_2)
    elif arg_0 == "characters":
        return characters(*arg_1, **arg_2)
    elif arg_0 == "word":
        return word(*arg_1, **arg_2)
    elif arg_0 == "words":
        return words(*arg_1, **arg_2)
    elif arg_0 == "sentence":
        return sentence(*arg_1, **arg_2)
    elif arg_0 == "sentences":
        return sentences(*arg_1, **arg_2)
    elif arg_0 == "paragraph":
        return paragraph(*arg_1, **arg_2)
    elif arg_0 == "paragraphs":
        return paragraphs(*arg_1, **arg_2)
    elif arg_0 == "title":
        return title(*arg_1, **arg_2)
    else:
        raise NameError('No such method')

An aggregator for all above defined public methods .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . context . get ( 'enterprise_customer' ) try : return models . EnterpriseCustomerUser . objects . get ( user_id = arg_1 , arg_2 = arg_2 ) except models . EnterpriseCustomerUser . DoesNotExist : pass return None

def Func(arg_0, arg_1):
        """
        Validates the lms_user_id, if is given, to see if there is an existing EnterpriseCustomerUser for it.
        """
        arg_2 = arg_0.context.get('enterprise_customer')

        try:
            # Ensure the given user is associated with the enterprise.
            return models.EnterpriseCustomerUser.objects.get(
                user_id=arg_1,
                arg_2=arg_2
            )
        except models.EnterpriseCustomerUser.DoesNotExist:
            pass

        return None

Validates the lms_user_id if is given to see if there is an existing EnterpriseCustomerUser for it .


def Func ( arg_0 ) : if arg_0 and isinstance ( arg_0 , str ) : load_config ( True ) return Check ( arg_0 ) . Func ( ) return None

def Func(arg_0):  # pragma: no cover
    """
    Check if the given domain is a subdomain.

    :param domain: The domain we are checking.
    :type domain: str

    :return: The subdomain state.
    :rtype: bool

    .. warning::
        If an empty or a non-string :code:`domain` is given, we return :code:`None`.
    """

    if arg_0 and isinstance(arg_0, str):
        # * The given domain is not empty nor None.
        # and
        # * The given domain is a string.

        # We silently load the configuration.
        load_config(True)

        return Check(arg_0).Func()

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

Check if the given domain is a subdomain .


def
Func
(
arg_0
)
:
arg_1
=
''
.
join
(
[
'{} {}\n'
.
format
(
spec
[
'forwarded_ip'
]
,
spec
[
'host_address'
]
)
for
spec
in
arg_0
]
)
return
config_file
.
create_config_section
(
arg_1
)

def Func(arg_0):
    """Return a string of all host rules required to match
    the given spec. This string is wrapped in the Dusty hosts
    header and footer so it can be easily removed later."""
    arg_1 =  ''.join(['{} {}\n'.format(spec['forwarded_ip'], spec['host_address']) for spec in arg_0])
    return config_file.create_config_section(arg_1)

Return a string of all host rules required to match the given spec . This string is wrapped in the Dusty hosts header and footer so it can be easily removed later .


def Func ( arg_0 ) : arg_1 = arg_0 . _find_directive ( "entry_point" ) if arg_1 : return arg_1 . args [ "value" ] else : return arg_0 . rules [ 0 ] . name

def Func(arg_0):
    """Gets the entry_point value for the parser."""
    arg_1 = arg_0._find_directive("entry_point")
    if arg_1:
      return arg_1.args["value"]
    else:
      return arg_0.rules[0].name

Gets the entry_point value for the parser .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Will add the tenant_id to the context from body.

        It is assumed that the body must have a tenant_id because neutron
        core could never have gotten here otherwise.
        """
        if not arg_2:
            raise n_exc.BadRequest(arg_4=arg_3,
                                   arg_6="Body malformed")
        arg_4 = arg_2.get(arg_3)
        if not arg_4:
            raise n_exc.BadRequest(arg_4=arg_3,
                                   arg_6="Body malformed")
        if arg_1.tenant_id is None:
            arg_1.tenant_id = arg_4.get("tenant_id")
        if arg_1.tenant_id is None:
            arg_6 = _("Running without keystone AuthN requires "
                    "that tenant_id is specified")
            raise n_exc.BadRequest(arg_4=arg_3, arg_6=arg_6)

Will add the tenant_id to the context from body .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
in
arg_0
.
format_tags
:
arg_3
=
"New format value [{}] already exists."
.
format
(
arg_1
)
raise
KeyError
(
arg_3
)
if
not
arg_0
.
_samples_match
(
arg_2
)
:
raise
KeyError
(
"Sample name values must match "
"existing sample names"
)
for
arg_4
in
arg_0
.
sample_tag_values
.
keys
(
)
:
arg_5
=
str
(
arg_2
[
arg_4
]
)
arg_0
.
sample_tag_values
[
arg_4
]
[
arg_1
]
=
arg_5

def Func(arg_0, arg_1, arg_2):
        """Appends a new format tag-value for all samples.

        Args:
            tag_name: string tag name; must not already exist
            new_sample

        Raises:
            KeyError: if tag_name to be added already exists
        """
        if arg_1 in arg_0.format_tags:
            arg_3 = "New format value [{}] already exists.".format(arg_1)
            raise KeyError(arg_3)

        if not arg_0._samples_match(arg_2):
            raise KeyError("Sample name values must match "
                           "existing sample names")
        for arg_4 in arg_0.sample_tag_values.keys():
            arg_5 = str(arg_2[arg_4])
            arg_0.sample_tag_values[arg_4][arg_1] = arg_5

Appends a new format tag - value for all samples .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
tempfile
.
mkdtemp
(
)
arg_4
=
join
(
arg_3
,
"tmp.patch"
)
arg_5
=
join
(
arg_3
,
"tmp.lcat"
)
for
arg_6
in
arg_1
:
remove
(
arg_4
)
copy
(
arg_6
.
mfile
[
'changeset'
]
[
'filename'
]
,
arg_4
)
logging
.
info
(
"mv %s %s"
%
(
arg_2
,
arg_5
)
)
shutil
.
move
(
arg_2
,
arg_5
)
arg_7
=
arg_0
.
patch_cmd
.
replace
(
"$in1"
,
arg_5
)
.
replace
(
"$patch"
,
arg_4
)
.
replace
(
"$out"
,
arg_2
)
logging
.
info
(
"Patch: %s"
%
arg_7
)
subprocess
.
check_call
(
arg_7
,
shell
=
True
)
shutil
.
rmtree
(
arg_3
,
ignore_errors
=
True
)

def Func(arg_0, arg_1, arg_2):
    """Apply to the 'catalog' the changesets in the metafile list 'changesets'"""

    arg_3 = tempfile.mkdtemp()
    arg_4 = join(arg_3, "tmp.patch")
    arg_5  = join(arg_3, "tmp.lcat")

    for arg_6 in arg_1:
        remove(arg_4)
        copy(arg_6.mfile['changeset']['filename'], arg_4)
        logging.info("mv %s %s"%(arg_2, arg_5))
        shutil.move(arg_2, arg_5)

        arg_7 = arg_0.patch_cmd.replace("$in1", arg_5)\
                            .replace("$patch", arg_4)\
                            .replace("$out", arg_2)
        logging.info("Patch: %s"%arg_7)
        subprocess.check_call(arg_7, shell=True)

    shutil.rmtree(arg_3, ignore_errors=True)

Apply to the catalog the changesets in the metafile list changesets


(in_file, out_file, print_cmd=False, pre_options='',
                  **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
''
,
**
arg_4
)
:
arg_5
=
[
]
for
arg_6
,
arg_7
in
arg_4
.
items
(
)
:
if
isinstance
(
arg_7
,
bool
)
:
if
arg_7
:
arg_5
.
append
(
'-{}'
.
format
(
arg_6
)
)
elif
arg_6
==
'log_level'
:
assert
arg_7
in
[
'quiet'
,
'panic'
,
'fatal'
,
'error'
,
'warning'
,
'info'
,
'verbose'
,
'debug'
,
'trace'
]
arg_5
.
append
(
'-loglevel {}'
.
format
(
arg_7
)
)
else
:
arg_5
.
append
(
'-{} {}'
.
format
(
arg_6
,
arg_7
)
)
arg_8
=
'ffmpeg -y {} -i {} {} {}'
.
format
(
arg_3
,
arg_0
,
' '
.
join
(
arg_5
)
,
arg_1
)
if
arg_2
:
print
(
arg_8
)
subprocess
.
call
(
arg_8
,
shell
=
True
)

def Func(arg_0, arg_1, arg_2=False, arg_3='',
                  **arg_4):
    """Convert a video with ffmpeg.

    This provides a general api to ffmpeg, the executed command is::

        `ffmpeg -y <pre_options> -i <in_file> <options> <out_file>`

    Options(kwargs) are mapped to ffmpeg commands with the following rules:

    - key=val: "-key val"
    - key=True: "-key"
    - key=False: ""

    Args:
        in_file (str): Input video filename.
        out_file (str): Output video filename.
        pre_options (str): Options appears before "-i <in_file>".
        print_cmd (bool): Whether to print the final ffmpeg command.
    """
    arg_5 = []
    for arg_6, arg_7 in arg_4.items():
        if isinstance(arg_7, bool):
            if arg_7:
                arg_5.append('-{}'.format(arg_6))
        elif arg_6 == 'log_level':
            assert arg_7 in [
                'quiet', 'panic', 'fatal', 'error', 'warning', 'info',
                'verbose', 'debug', 'trace'
            ]
            arg_5.append('-loglevel {}'.format(arg_7))
        else:
            arg_5.append('-{} {}'.format(arg_6, arg_7))
    arg_8 = 'ffmpeg -y {} -i {} {} {}'.format(arg_3, arg_0,
                                            ' '.join(arg_5), arg_1)
    if arg_2:
        print(arg_8)
    subprocess.call(arg_8, shell=True)


def Func(arg_0):
        """Returns a list of parameters"""
        if arg_0.plugin_class is None:
            arg_1 = inspect.signature(arg_0.func)
            for arg_2, arg_3 in enumerate(arg_1.parameters.values()):
                if not arg_3.kind in [arg_3.POSITIONAL_ONLY, arg_3.KEYWORD_ONLY, arg_3.POSITIONAL_OR_KEYWORD]:
                    raise RuntimeError("Task {} contains an unsupported {} parameter".format(arg_3, arg_3.kind))

                yield arg_3

        else:
            arg_4 = set()

            for arg_5 in inspect.getmro(arg_0.plugin_class):
                if issubclass(arg_5, BasePlugin) and hasattr(arg_5, arg_0.func.__name__):
                    arg_6 = getattr(arg_5, arg_0.func.__name__)
                    logger.debug("Found method %s from class %s", arg_6, arg_5)
                    arg_7 = False
                    arg_1 = inspect.signature(arg_6)
                    for arg_2, arg_3 in enumerate(arg_1.parameters.values()):
                        if arg_2 == 0:
                            # skip "self" parameter
                            continue

                        if arg_3.kind == inspect.Parameter.VAR_KEYWORD:
                            # found "**kwargs" parameter.  we will continue to the next class in the mro
                            # to add any keyword parameters we have not yet used (i.e. whose name
                            # we have not yet seen)
                            arg_7 = True
                            continue

                        if arg_3.kind in [arg_3.POSITIONAL_ONLY, arg_3.VAR_POSITIONAL]:
                            raise RuntimeError("Task {} contains an unsupported parameter \"{}\"".format(arg_6, arg_3))

                        if not arg_3.name in arg_4:
                            arg_4.add(arg_3.name)

                            logger.debug("Found parameter %s (%s)", arg_3, arg_3.kind)
                            yield arg_3

                    # we only need to look at the next class in the mro
                    # when "**kwargs" is found
                    if not arg_7:
                        break


return Connection(
            settings["url"],
            settings["base_url"],
            settings["user"],
            settings["password"],
            authorizations = settings["authorizations"],
            debug = settings["debug"]
        )

def Func ( arg_0 ) : return Connection ( arg_0 [ "url" ] , arg_0 [ "base_url" ] , arg_0 [ "user" ] , arg_0 [ "password" ] , authorizations = arg_0 [ "authorizations" ] , debug = arg_0 [ "debug" ] )

def Func(arg_0):
        """ Create a connection with given settings.

        Args:
            settings (dict): A dictionary of settings

        Returns:
            :class:`Connection`. The connection
        """
        return Connection(
            arg_0["url"],
            arg_0["base_url"],
            arg_0["user"],
            arg_0["password"],
            authorizations = arg_0["authorizations"],
            debug = arg_0["debug"]
        )

Create a connection with given settings .


return VersionedCLI(cli_name=SF_CLI_NAME,
                        config_dir=SF_CLI_CONFIG_DIR,
                        config_env_var_prefix=SF_CLI_ENV_VAR_PREFIX,
                        commands_loader_cls=SFCommandLoader,
                        help_cls=SFCommandHelp)

def Func ( ) : return VersionedCLI ( Func_name = SF_CLI_NAME , config_dir = SF_CLI_CONFIG_DIR , config_env_var_prefix = SF_CLI_ENV_VAR_PREFIX , commands_loader_cls = SFCommandLoader , help_cls = SFCommandHelp )

def Func():
    """Create CLI environment"""
    return VersionedCLI(Func_name=SF_CLI_NAME,
                        config_dir=SF_CLI_CONFIG_DIR,
                        config_env_var_prefix=SF_CLI_ENV_VAR_PREFIX,
                        commands_loader_cls=SFCommandLoader,
                        help_cls=SFCommandHelp)


def Func ( arg_0 ) : if not os . path . exists ( arg_0 . cache ) : os . makedirs ( arg_0 . cache ) arg_1 = os . path . join ( arg_0 . cache , arg_0 . name + ".xml" ) arg_2 = open ( arg_1 , "w" ) arg_2 . write ( arg_0 . xml ) arg_2 . close ( )

def Func(arg_0):
        """
        Saves the color information in the cache as XML.
        """
        if not os.path.exists(arg_0.cache):
            os.makedirs(arg_0.cache)

        arg_1 = os.path.join(arg_0.cache, arg_0.name + ".xml")
        arg_2 = open(arg_1, "w")
        arg_2.write(arg_0.xml)
        arg_2.close()

Saves the color information in the cache as XML .


(fname, options, data, noise=None, frac_length=10, exp_length=2)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=10, arg_5=2):
    r"""
    Write a `Touchstone`_ file.

    Parameter data is first resized to an :code:`points` x :code:`nports` x
    :code:`nports` where :code:`points` represents the number of frequency
    points and :code:`nports` represents the number of ports in the file; then
    parameter data is written to file in scientific notation

    :param fname: Touchstone file name
    :type  fname: `FileNameExists <https://pexdoc.readthedocs.io/en/stable/
                  ptypes.html#filenameexists>`_

    :param options: Touchstone file options
    :type  options: :ref:`TouchstoneOptions`

    :param data: Touchstone file parameter data
    :type  data: :ref:`TouchstoneData`

    :param noise: Touchstone file parameter noise data (only supported in
                  two-port files)
    :type  noise: :ref:`TouchstoneNoiseData`

    :param frac_length: Number of digits to use in fractional part of data
    :type  frac_length: non-negative integer

    :param exp_length: Number of digits to use in exponent
    :type  exp_length: positive integer

    .. [[[cog cog.out(exobj.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.touchstone.Func

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

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

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

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

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

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

     * RuntimeError (File *[fname]* does not have a valid extension)

     * RuntimeError (Malformed data)

     * RuntimeError (Noise data only supported in two-port files)

    .. [[[end]]]
    """
    # pylint: disable=R0913
    # Exceptions definitions
    arg_6 = pexdoc.exh.addex(
        RuntimeError, "File *[fname]* does not have a valid extension"
    )
    arg_7 = pexdoc.exh.addex(
        RuntimeError, "Noise data only supported in two-port files"
    )
    arg_8 = pexdoc.exh.addex(RuntimeError, "Malformed data")
    # Data validation
    arg_9, arg_10 = os.path.splitext(arg_0)
    arg_10 = arg_10.lower()
    arg_11 = re.compile(r"\.s(\d+)p")
    arg_12 = arg_11.match(arg_10)
    arg_6(not arg_12, edata={"field": "fname", "value": arg_0})
    arg_13 = int(arg_12.groups()[0])
    arg_7(bool((arg_13 != 2) and arg_3))
    arg_14 = arg_13 ** 2
    arg_8(arg_2["points"] * arg_14 != arg_2["pars"].size)
    #
    arg_15 = arg_2["points"]
    arg_16 = np.resize(np.copy(arg_2["pars"]), (arg_15, arg_13, arg_13))
    if arg_13 == 2:
        arg_16 = np.transpose(arg_16, (0, 2, 1))
    arg_17 = {"ghz": "GHz", "mhz": "MHz", "khz": "KHz", "hz": "Hz"}
    arg_1["units"] = arg_17[arg_1["units"].lower()]
    arg_18 = 2 + arg_4 + (arg_5 + 2)
    # Format data
    with open(arg_0, "w") as fobj:
        fobj.write(
            "# {units} {ptype} {pformat} R {z0}\n".format(
                units=arg_1["units"],
                ptype=arg_1["ptype"],
                pformat=arg_1["pformat"],
                z0=arg_1["z0"],
            )
        )
        for arg_19 in _chunk_pars(arg_2["freq"], arg_16, arg_1["pformat"]):
            arg_20 = [
                to_scientific_string(item, arg_4, arg_5, bool(num != 0))
                if item is not None
                else arg_18 * " "
                for num, item in enumerate(arg_19)
            ]
            fobj.write(" ".join(arg_20) + "\n")
        if (arg_13 == 2) and arg_3:
            fobj.write("! Noise data\n")
            for arg_19 in _chunk_noise(arg_3):
                arg_20 = [
                    to_scientific_string(item, arg_4, arg_5, bool(num != 0))
                    for num, item in enumerate(arg_19)
                ]
                fobj.write(" ".join(arg_20) + "\n")

r"""
    Write a `Touchstone`_ file.

    Parameter data is first resized to an :code:`points` x :code:`nports` x
    :code:`nports` where :code:`points` represents the number of frequency
    points and :code:`nports` represents the number of ports in the file; then
    parameter data is written to file in scientific notation

    :param fname: Touchstone file name
    :type  fname: `FileNameExists <https://pexdoc.readthedocs.io/en/stable/
                  ptypes.html#filenameexists>`_

    :param options: Touchstone file options
    :type  options: :ref:`TouchstoneOptions`

    :param data: Touchstone file parameter data
    :type  data: :ref:`TouchstoneData`

    :param noise: Touchstone file parameter noise data (only supported in
                  two-port files)
    :type  noise: :ref:`TouchstoneNoiseData`

    :param frac_length: Number of digits to use in fractional part of data
    :type  frac_length: non-negative integer

    :param exp_length: Number of digits to use in exponent
    :type  exp_length: positive integer

    .. [[[cog cog.out(exobj.get_sphinx_autodoc()) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.touchstone.write_touchstone

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

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

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

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

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

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

     * RuntimeError (File *[fname]* does not have a valid extension)

     * RuntimeError (Malformed data)

     * RuntimeError (Noise data only supported in two-port files)

    .. [[[end]]]


(k=5, angle=(0, 360), direction=(-1.0, 1.0), order=1, name=None, deterministic=False, random_state=None)

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

def Func ( arg_0 = 5 , arg_1 = ( 0 , 360 ) , arg_2 = ( - 1.0 , 1.0 ) , arg_3 = 1 , arg_4 = None , arg_5 = False , arg_6 = None ) : arg_7 = iap . handle_discrete_param ( arg_0 , "k" , value_range = ( 3 , None ) , tuple_to_uniform = True , list_to_choice = True , allow_floats = False ) arg_8 = iap . handle_continuous_param ( arg_1 , "angle" , value_range = None , tuple_to_uniform = True , list_to_choice = True ) arg_9 = iap . handle_continuous_param ( arg_2 , "direction" , value_range = ( - 1.0 - 1e-6 , 1.0 + 1e-6 ) , tuple_to_uniform = True , list_to_choice = True ) def create_matrices ( arg_10 , arg_11 , arg_12 ) : from . import geometric as iaa_geometric arg_13 = int ( arg_7 . draw_sample ( arg_6 = arg_12 ) ) arg_14 = arg_8 . draw_sample ( arg_6 = arg_12 ) arg_15 = arg_9 . draw_sample ( arg_6 = arg_12 ) arg_13 = arg_13 if arg_13 % 2 != 0 else arg_13 + 1 arg_15 = np . clip ( arg_15 , - 1.0 , 1.0 ) arg_15 = ( arg_15 + 1.0 ) / 2.0 arg_16 = np . zeros ( ( arg_13 , arg_13 ) , dtype = np . float32 ) arg_16 [ : , arg_13 // 2 ] = np . linspace ( float ( arg_15 ) , 1.0 - float ( arg_15 ) , num = arg_13 ) arg_17 = iaa_geometric . Affine ( rotate = arg_14 , arg_3 = arg_3 ) arg_16 = ( arg_17 . augment_image ( ( arg_16 * 255 ) . astype ( np . uint8 ) ) / 255.0 ) . astype ( np . float32 ) return [ arg_16 / np . sum ( arg_16 ) ] * arg_11 if arg_4 is None : arg_4 = "Unnamed%s" % ( ia . caller_name ( ) , ) return iaa_convolutional . Convolve ( create_matrices , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 )

def Func(arg_0=5, arg_1=(0, 360), arg_2=(-1.0, 1.0), arg_3=1, arg_4=None, arg_5=False, arg_6=None):
    """
    Augmenter that sharpens images and overlays the result with the original image.

    dtype support::

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

    Parameters
    ----------
    k : int or tuple of int or list of int or imgaug.parameters.StochasticParameter, optional
        Kernel size to use.

            * If a single int, then that value will be used for the height
              and width of the kernel.
            * If a tuple of two ints ``(a, b)``, then the kernel size will be
              sampled from the interval ``[a..b]``.
            * If a list, then a random value will be sampled from that list per image.
            * If a StochasticParameter, then ``N`` samples will be drawn from
              that parameter per ``N`` input images, each representing the kernel
              size for the nth image.

    angle : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Angle of the motion blur in degrees (clockwise, relative to top center direction).

            * If a number, 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
        Forward/backward direction of the motion blur. Lower values towards -1.0 will point the motion blur towards
        the back (with angle provided via `angle`). Higher values towards 1.0 will point the motion blur forward.
        A value of 0.0 leads to a uniformly (but still angled) motion blur.

            * If a number, 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.

    order : int or iterable of int or imgaug.ALL or imgaug.parameters.StochasticParameter, optional
        Interpolation order to use when rotating the kernel according to `angle`.
        See :func:`imgaug.augmenters.geometric.Affine.__init__`.
        Recommended to be ``0`` or ``1``, with ``0`` being faster, but less continuous/smooth as `angle` is changed,
        particularly around multiple of 45 degrees.

    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 = iaa.Func(k=15)

    Create a motion blur augmenter with kernel size of 15x15.

    >>> aug = iaa.Func(k=15, angle=[-45, 45])

    Create a motion blur augmenter with kernel size of 15x15 and a blur angle of either -45 or 45 degrees (randomly
    picked per image).

    """
    # TODO allow (1, None) and set to identity matrix if k == 1
    arg_7 = iap.handle_discrete_param(arg_0, "k", value_range=(3, None), tuple_to_uniform=True, list_to_choice=True,
                                        allow_floats=False)
    arg_8 = iap.handle_continuous_param(arg_1, "angle", value_range=None, tuple_to_uniform=True,
                                              list_to_choice=True)
    arg_9 = iap.handle_continuous_param(arg_2, "direction", value_range=(-1.0-1e-6, 1.0+1e-6),
                                                  tuple_to_uniform=True, list_to_choice=True)

    def create_matrices(arg_10, arg_11, arg_12):
        # avoid cyclic import between blur and geometric
        from . import geometric as iaa_geometric

        # force discrete for k_sample via int() in case of stochastic parameter
        arg_13 = int(arg_7.draw_sample(arg_6=arg_12))
        arg_14 = arg_8.draw_sample(arg_6=arg_12)
        arg_15 = arg_9.draw_sample(arg_6=arg_12)

        arg_13 = arg_13 if arg_13 % 2 != 0 else arg_13 + 1
        arg_15 = np.clip(arg_15, -1.0, 1.0)
        arg_15 = (arg_15 + 1.0) / 2.0

        arg_16 = np.zeros((arg_13, arg_13), dtype=np.float32)
        arg_16[:, arg_13//2] = np.linspace(float(arg_15), 1.0 - float(arg_15), num=arg_13)
        arg_17 = iaa_geometric.Affine(rotate=arg_14, arg_3=arg_3)
        arg_16 = (arg_17.augment_image((arg_16 * 255).astype(np.uint8)) / 255.0).astype(np.float32)

        return [arg_16/np.sum(arg_16)] * arg_11

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

    return iaa_convolutional.Convolve(create_matrices, arg_4=arg_4, arg_5=arg_5,
                                      arg_6=arg_6)

Augmenter that sharpens images and overlays the result with the original image.

    dtype support::

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

    Parameters
    ----------
    k : int or tuple of int or list of int or imgaug.parameters.StochasticParameter, optional
        Kernel size to use.

            * If a single int, then that value will be used for the height
              and width of the kernel.
            * If a tuple of two ints ``(a, b)``, then the kernel size will be
              sampled from the interval ``[a..b]``.
            * If a list, then a random value will be sampled from that list per image.
            * If a StochasticParameter, then ``N`` samples will be drawn from
              that parameter per ``N`` input images, each representing the kernel
              size for the nth image.

    angle : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Angle of the motion blur in degrees (clockwise, relative to top center direction).

            * If a number, 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
        Forward/backward direction of the motion blur. Lower values towards -1.0 will point the motion blur towards
        the back (with angle provided via `angle`). Higher values towards 1.0 will point the motion blur forward.
        A value of 0.0 leads to a uniformly (but still angled) motion blur.

            * If a number, 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.

    order : int or iterable of int or imgaug.ALL or imgaug.parameters.StochasticParameter, optional
        Interpolation order to use when rotating the kernel according to `angle`.
        See :func:`imgaug.augmenters.geometric.Affine.__init__`.
        Recommended to be ``0`` or ``1``, with ``0`` being faster, but less continuous/smooth as `angle` is changed,
        particularly around multiple of 45 degrees.

    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 = iaa.MotionBlur(k=15)

    Create a motion blur augmenter with kernel size of 15x15.

    >>> aug = iaa.MotionBlur(k=15, angle=[-45, 45])

    Create a motion blur augmenter with kernel size of 15x15 and a blur angle of either -45 or 45 degrees (randomly
    picked per image).

Augmenter that sharpens images and overlays the result with the original image .


def Func ( arg_0 , arg_1 ) : with open ( arg_1 ) as f : arg_0 . lexer . input ( f . read ( ) ) return arg_0

def Func(arg_0, arg_1):
        """
        Lex Func.
        """
        with open(arg_1) as f:
            arg_0.lexer.input(f.read())
        return arg_0


def Func(arg_0, arg_1):
        """
        Adds an URL to the download queue.

        :param str url: URL to the music service track
        """

        if arg_0.connection_handler.current_music is None:
            log.error('Music service is not initialized. URL was not added to queue.')
        elif arg_0.connection_handler.current_storage is None:
            log.error('Drive service is not initialized. URL was not added to queue.')
        else:
            arg_0.queues['download'].put(arg_1)


def Func(arg_0, arg_1):
        """
        Unregister the FilteredImage subclass currently assigned to attr_name.

        If a FilteredImage subclass isn't already registered to filters.
        `attr_name` NotRegistered will raise.
        """
        if arg_1 not in arg_0._filter_registry:
            raise NotRegistered(
                'No FilteredImage subclass is registered to %s' % arg_1
            )
        else:
            del arg_0._filter_registry[arg_1]

Unregister the FilteredImage subclass currently assigned to attr_name .


def Func ( arg_0 , arg_1 ) : if arg_1 is None : arg_1 = len ( arg_0 . layers ) // 2 if isinstance ( arg_1 , int ) : arg_1 = arg_0 . layers [ arg_1 ] if isinstance ( arg_1 , util . basestring ) : try : arg_1 = [ l for l in arg_0 . layers if l . name == arg_1 ] [ 0 ] except IndexError : pass if isinstance ( arg_1 , layers . Layer ) : arg_1 = arg_1 . output_name return arg_1

def Func(arg_0, arg_1):
        '''Find a layer output name for the given layer specifier.

        Parameters
        ----------
        layer : None, int, str, or :class:`theanets.layers.Layer`
            A layer specification. If this is None, the "middle" layer in the
            network will be used (i.e., the layer at the middle index in the
            list of network layers). If this is an integer, the corresponding
            layer in the network's layer list will be used. If this is a string,
            the layer with the corresponding name will be returned.

        Returns
        -------
        name : str
            The fully-scoped output name for the desired layer.
        '''
        if arg_1 is None:
            arg_1 = len(arg_0.layers) // 2
        if isinstance(arg_1, int):
            arg_1 = arg_0.layers[arg_1]
        if isinstance(arg_1, util.basestring):
            try:
                arg_1 = [l for l in arg_0.layers if l.name == arg_1][0]
            except IndexError:
                pass
        if isinstance(arg_1, layers.Layer):
            arg_1 = arg_1.output_name
        return arg_1

Find a layer output name for the given layer specifier .


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        """Unsubscribe 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._unsubscribe('book', arg_4, arg_1=arg_1, arg_2=arg_2, **arg_3)

Unsubscribe to the passed pair s raw order book channel .


(self, projection_matrix=None, view_matrix=None, camera_matrix=None, time=0)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=0):
        """
        Draw the mesh using the assigned mesh program

        :param projection_matrix: projection_matrix (bytes)
        :param view_matrix: view_matrix (bytes)
        :param camera_matrix: camera_matrix (bytes)
        """
        if arg_0.mesh_program:
            arg_0.mesh_program.Func(
                arg_0,
                arg_1=arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
                arg_4=arg_4
            )


(self, name, expression, overwrite=True, unique=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True , arg_4 = True ) : if arg_4 or arg_3 or arg_1 not in arg_0 . variables : arg_5 = arg_0 . get_column_names ( virtual = False ) + list ( arg_0 . variables . keys ( ) ) arg_1 = vaex . utils . find_valid_name ( arg_1 , used = [ ] if not arg_4 else arg_5 ) arg_0 . variables [ arg_1 ] = arg_2 arg_0 . signal_variable_changed . emit ( arg_0 , arg_1 , "add" ) if arg_4 : return arg_1

def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=True):
        """Add a variable to to a DataFrame.

        A variable may refer to other variables, and virtual columns and expression may refer to variables.

        Example

        >>> df.Func('center', 0)
        >>> df.add_virtual_column('x_prime', 'x-center')
        >>> df.select('x_prime < 0')

        :param: str name: name of virtual varible
        :param: expression: expression for the variable
        """
        if arg_4 or arg_3 or arg_1 not in arg_0.variables:
            arg_5 = arg_0.get_column_names(virtual=False) + list(arg_0.variables.keys())
            arg_1 = vaex.utils.find_valid_name(arg_1, used=[] if not arg_4 else arg_5)
            arg_0.variables[arg_1] = arg_2
            arg_0.signal_variable_changed.emit(arg_0, arg_1, "add")
            if arg_4:
                return arg_1

Add a variable to to a DataFrame.

        A variable may refer to other variables, and virtual columns and expression may refer to variables.

        Example

        >>> df.add_variable('center', 0)
        >>> df.add_virtual_column('x_prime', 'x-center')
        >>> df.select('x_prime < 0')

        :param: str name: name of virtual varible
        :param: expression: expression for the variable


(name, contact, description, pmids, version, copyright, authors, licenses, disclaimer, output)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):
    """Build a template BEL document with the given PubMed identifiers."""
    from .document_utils import write_Func

    write_Func(
        arg_0=arg_0,
        arg_4=arg_4,
        arg_2=arg_2,
        arg_6=arg_6,
        arg_1=arg_1,
        arg_5=arg_5,
        arg_7=arg_7,
        arg_8=arg_8,
        arg_3=arg_3,
        file=arg_9,
    )

Build a template BEL document with the given PubMed identifiers .


def Func(arg_0, arg_1):
        """Load a gene panel based on the info sent
        A panel object is built and integrity checks are made.
        The panel object is then loaded into the database.

        Args:
            path(str): Path to panel file
            institute(str): Name of institute that owns the panel
            panel_id(str): Panel id
            date(datetime.datetime): Date of creation
            version(float)
            full_name(str): Option to have a long name

            panel_info(dict): {
                'file': <path to panel file>(str),
                'institute': <institute>(str),
                'type': <panel type>(str),
                'date': date,
                'version': version,
                'panel_name': panel_id,
                'full_name': name,
            }
        """
        arg_2 = build_panel(arg_1, arg_0)

        arg_0.add_gene_panel(arg_2)

Load a gene panel based on the info sent A panel object is built and integrity checks are made . The panel object is then loaded into the database .


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] arg_0 . Func_fn ( lambda row : arg_2 . append ( row ) , arg_1 = arg_1 ) return arg_2

def Func(arg_0, arg_1=None):
        """Returns a big list of all log lines since the last run
        """
        arg_2 = []

        arg_0.Func_fn(lambda row: arg_2.append(row), arg_1=arg_1)

        return arg_2


(template, target, *, checkout, extra_context)

def Func ( arg_0 , arg_1 , * , arg_2 , arg_3 ) : with tempfile . TemporaryDirectory ( ) as tempdir : arg_4 = cc_main . cookiecutter ( arg_0 , arg_2 = arg_2 , no_input = True , output_dir = tempdir , arg_3 = arg_3 ) for arg_5 in os . listdir ( arg_4 ) : arg_6 = os . path . join ( arg_4 , arg_5 ) arg_7 = os . path . join ( arg_1 , arg_5 ) if os . path . isdir ( arg_6 ) : if os . path . exists ( arg_7 ) : shutil . rmtree ( arg_7 ) shutil . copytree ( arg_6 , arg_7 ) else : if os . path . exists ( arg_7 ) : os . remove ( arg_7 ) shutil . copy2 ( arg_6 , arg_7 )

def Func(arg_0, arg_1, *, arg_2, arg_3):
    """Apply a template to a temporary directory and then copy results to target."""
    with tempfile.TemporaryDirectory() as tempdir:
        arg_4 = cc_main.cookiecutter(
            arg_0,
            arg_2=arg_2,
            no_input=True,
            output_dir=tempdir,
            arg_3=arg_3)
        for arg_5 in os.listdir(arg_4):
            arg_6 = os.path.join(arg_4, arg_5)
            arg_7 = os.path.join(arg_1, arg_5)
            if os.path.isdir(arg_6):
                if os.path.exists(arg_7):
                    shutil.rmtree(arg_7)
                shutil.copytree(arg_6, arg_7)
            else:
                if os.path.exists(arg_7):
                    os.remove(arg_7)
                shutil.copy2(arg_6, arg_7)

Apply a template to a temporary directory and then copy results to target .


(self, other, max_distance=1e-6, points_per_edge=8)

return self.to_line_string(closed=True).coords_almost_equals(
            other.to_line_string(closed=True),
            max_distance=max_distance,
            points_per_edge=points_per_edge
        )

def Func ( arg_0 , arg_1 , arg_2 = 1e-6 , arg_3 = 8 ) : if isinstance ( arg_1 , list ) : arg_1 = Polygon ( np . float32 ( arg_1 ) ) elif ia . is_np_array ( arg_1 ) : arg_1 = Polygon ( arg_1 ) else : assert isinstance ( arg_1 , Polygon ) arg_1 = arg_1 return arg_0 . to_line_string ( closed = True ) . coords_almost_equals ( arg_1 . to_line_string ( closed = True ) , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=1e-6, arg_3=8):
        """
        Estimate if this and other polygon's exterior are almost identical.

        The two exteriors can have different numbers of points, but any point
        randomly sampled on the exterior of one polygon should be close to the
        closest point on the exterior of the other polygon.

        Note that this method works approximately. One can come up with
        polygons with fairly different shapes that will still be estimated as
        equal by this method. In practice however this should be unlikely to be
        the case. The probability for something like that goes down as the
        interpolation parameter is increased.

        Parameters
        ----------
        other : imgaug.Polygon or (N,2) ndarray or list of tuple
            The other polygon with which to compare the exterior.
            If this is an ndarray, it is assumed to represent an exterior.
            It must then have dtype ``float32`` and shape ``(N,2)`` with the
            second dimension denoting xy-coordinates.
            If this is a list of tuples, it is assumed to represent an exterior.
            Each tuple then must contain exactly two numbers, denoting
            xy-coordinates.

        max_distance : number, optional
            The maximum euclidean distance between a point on one polygon and
            the closest point on the other polygon. If the distance is exceeded
            for any such pair, the two exteriors are not viewed as equal. The
            points are other the points contained in the polygon's exterior
            ndarray or interpolated points between these.

        points_per_edge : int, optional
            How many points to interpolate on each edge.

        Returns
        -------
        bool
            Whether the two polygon's exteriors can be viewed as equal
            (approximate test).

        """
        if isinstance(arg_1, list):
            arg_1 = Polygon(np.float32(arg_1))
        elif ia.is_np_array(arg_1):
            arg_1 = Polygon(arg_1)
        else:
            assert isinstance(arg_1, Polygon)
            arg_1 = arg_1

        return arg_0.to_line_string(closed=True).coords_almost_equals(
            arg_1.to_line_string(closed=True),
            arg_2=arg_2,
            arg_3=arg_3
        )

Estimate if this and other polygon s exterior are almost identical .


(self,
                    string_data,
                    key,
                    bucket_name=None,
                    replace=False,
                    encrypt=False,
                    encoding='utf-8')

def Func(arg_0,
                    arg_1,
                    arg_2,
                    arg_3=None,
                    arg_4=False,
                    arg_5=False,
                    arg_6='utf-8'):
        """
        Loads a string to S3

        This is provided as a convenience to drop a string in S3. It uses the
        boto infrastructure to ship a file to s3.

        :param string_data: str to set as content for the key.
        :type string_data: str
        :param key: S3 key that will point to the file
        :type key: str
        :param bucket_name: Name of the bucket in which to store the file
        :type bucket_name: str
        :param replace: A flag to decide whether or not to overwrite the key
            if it already exists
        :type replace: bool
        :param encrypt: If True, the file will be encrypted on the server-side
            by S3 and will be stored in an encrypted form while at rest in S3.
        :type encrypt: bool
        """
        arg_0.load_bytes(arg_1.encode(arg_6),
                        arg_2=arg_2,
                        arg_3=arg_3,
                        arg_4=arg_4,
                        arg_5=arg_5)


def Func ( arg_0 , arg_1 ) : arg_2 = np . zeros ( ( arg_1 , ) ) for arg_3 in xrange ( arg_1 ) : arg_4 = np . random . randint ( 0 , arg_0 . shape [ 0 ] , arg_0 . shape [ 0 ] ) arg_5 = arg_0 [ arg_4 ] arg_6 , arg_6 , arg_7 = _prop_dstat ( arg_5 ) arg_2 [ arg_3 ] = arg_7 return arg_2

def Func(arg_0, arg_1):
    """
    return array of bootstrap D-stats
    """
    ## hold results (nboots, [dstat, ])
    arg_2 = np.zeros((arg_1,))

    ## iterate to fill boots
    for arg_3 in xrange(arg_1):
        ## sample with replacement
        arg_4 = np.random.randint(0, arg_0.shape[0], arg_0.shape[0])
        arg_5 = arg_0[arg_4]
        arg_6, arg_6, arg_7 = _prop_dstat(arg_5)
        arg_2[arg_3] = arg_7

    ## return bootarr
    return arg_2