def Func ( arg_0 , arg_1 ) : arg_0 . relationships . load ( arg_1 = arg_0 , data = arg_1 )

def Func(arg_0, arg_1):
		"""Load relationships from source XML."""
		# don't get confused here - the original source is string data;
		#  the parameter source below is a Part object
		arg_0.relationships.load(arg_1=arg_0, data=arg_1)


def Func ( arg_0 ) : arg_0 = lens . robots . Each ( ) . call_step_towards ( arg_0 . player ) ( arg_0 ) arg_0 = lens . crashes . call_union ( duplicates ( arg_0 . robots ) ) ( arg_0 ) arg_0 = lens . robots . modify ( lambda r : list ( set ( r ) - arg_0 . crashes ) ) ( arg_0 ) return arg_0

def Func(arg_0):
        '''Produces a new game state in which the robots have advanced
        towards the player by one step. Handles the robots crashing into
        one another too.'''

        # move the robots towards the player
        arg_0 = lens.robots.Each().call_step_towards(arg_0.player)(arg_0)
        # robots in the same place are crashes
        arg_0 = lens.crashes.call_union(duplicates(arg_0.robots))(arg_0)
        # remove crashed robots
        arg_0 = lens.robots.modify(lambda r: list(set(r) - arg_0.crashes))(arg_0)

        return arg_0

Produces a new game state in which the robots have advanced towards the player by one step . Handles the robots crashing into one another too .


return mir_eval.hierarchy.evaluate(ref_hier, ref_hier_lab,
                                       est_hier, est_hier_lab,
                                       **kwargs)

def Func(arg_0, arg_1, **arg_2):
    r'''Multi-level segmentation evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.Func.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='multi_segment')[0]
    >>> est_ann = est_jam.search(namespace='multi_segment')[0]
    >>> scores = jams.eval.Func(ref_ann, est_ann)
    '''
    arg_3 = 'multi_segment'
    arg_0 = coerce_annotation(arg_0, arg_3)
    arg_1 = coerce_annotation(arg_1, arg_3)
    arg_4, arg_5 = Func_flatten(arg_0)
    arg_6, arg_7 = Func_flatten(arg_1)

    return mir_eval.Func.evaluate(arg_4, arg_5,
                                       arg_6, arg_7,
                                       **arg_2)

r'''Multi-level segmentation evaluation

    Parameters
    ----------
    ref : jams.Annotation
        Reference annotation object
    est : jams.Annotation
        Estimated annotation object
    kwargs
        Additional keyword arguments

    Returns
    -------
    scores : dict
        Dictionary of scores, where the key is the metric name (str) and
        the value is the (float) score achieved.

    See Also
    --------
    mir_eval.hierarchy.evaluate

    Examples
    --------
    >>> # Load in the JAMS objects
    >>> ref_jam = jams.load('reference.jams')
    >>> est_jam = jams.load('estimated.jams')
    >>> # Select the first relevant annotations
    >>> ref_ann = ref_jam.search(namespace='multi_segment')[0]
    >>> est_ann = est_jam.search(namespace='multi_segment')[0]
    >>> scores = jams.eval.hierarchy(ref_ann, est_ann)


def Func(arg_0, *arg_1):
    """Add specs to the topology

    :type specs: HeronComponentSpec
    :param specs: specs to add to the topology
    """
    for arg_2 in arg_1:
      if not isinstance(arg_2, HeronComponentSpec):
        raise TypeError("Argument to Func needs to be HeronComponentSpec, given: %s"
                        % str(arg_2))
      if arg_2.name is None:
        raise ValueError("TopologyBuilder cannot take a spec without name")
      if arg_2.name == "config":
        raise ValueError("config is a reserved name")
      if arg_2.name in arg_0._specs:
        raise ValueError("Attempting to add duplicate spec name: %r %r" % (arg_2.name, arg_2))

      arg_0._specs[arg_2.name] = arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = gOpenMol . Plt ( ) arg_2 . read ( arg_1 ) arg_3 , arg_4 = arg_2 . histogramdd ( ) arg_0 . __init__ ( arg_3 = arg_3 , arg_4 = arg_4 , metadata = arg_0 . metadata )

def Func(arg_0, arg_1):
        """Initialize Grid from gOpenMol plt file."""
        arg_2 = gOpenMol.Plt()
        arg_2.read(arg_1)
        arg_3, arg_4 = arg_2.histogramdd()
        arg_0.__init__(arg_3=arg_3, arg_4=arg_4, metadata=arg_0.metadata)

Initialize Grid from gOpenMol plt file .


def Func(arg_0, arg_1="train", arg_2="/tmp/mnist"):
    """
    Get mnist dataset and parallelize into RDDs.
    Data would be downloaded automatically if it doesn't present at the specific location.

    :param sc: SparkContext.
    :param data_type: "train" for training data and "test" for testing data.
    :param location: Location to store mnist dataset.
    :return: RDD of (features: ndarray, label: ndarray).
    """
    (arg_3, arg_4) = mnist.read_data_sets(arg_2, arg_1)
    arg_3 = arg_0.parallelize(arg_3)
    arg_4 = arg_0.parallelize(arg_4 + 1)  # Target start from 1 in BigDL
    arg_5 = arg_3.zip(arg_4)
    return arg_5

Get mnist dataset and parallelize into RDDs . Data would be downloaded automatically if it doesn t present at the specific location .


def Func(arg_0, **arg_1):
        """
        Get the similar movies for a specific movie id.

        Args:
            page: (optional) Minimum value of 1.  Expected value is an integer.
            language: (optional) ISO 639-1 code.
            append_to_response: (optional) Comma separated, any movie method.

        Returns:
            A dict representation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_id_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the similar movies for a specific movie id .


def
Func
(
arg_0
,
arg_1
=
1
,
arg_2
=
)
:
if
not
arg_0
.
_initialized
:
arg_3
=
(
"Network has not been initialized. "
"Call '.initialize()' first."
)
raise
QueueingToolError
(
arg_3
)
if
arg_2
is
:
for
arg_4
in
range
(
arg_1
)
:
arg_0
.
_Func_next_event
(
slow
=
False
)
else
:
arg_5
=
arg_0
.
_t
while
arg_0
.
_t
<
arg_5
+
arg_2
:
arg_0
.
_Func_next_event
(
slow
=
False
)

def Func(arg_0, arg_1=1, arg_2=None):
        """Simulates the network forward.

        Simulates either a specific number of events or for a specified
        amount of simulation time.

        Parameters
        ----------
        n : int (optional, default: 1)
            The number of events to Func. If ``t`` is not given
            then this parameter is used.
        t : float (optional)
            The amount of simulation time to Func forward. If
            given, ``t`` is used instead of ``n``.

        Raises
        ------
        QueueingToolError
            Will raise a :exc:`.QueueingToolError` if the
            ``QueueNetwork`` has not been initialized. Call
            :meth:`.initialize` before calling this method.

        Examples
        --------
        Let ``net`` denote your instance of a ``QueueNetwork``. Before
        you Func, you need to initialize the network, which allows
        arrivals from outside the network. To initialize with 2 (random
        chosen) edges accepting arrivals run:

        >>> import queueing_tool as qt
        >>> g = qt.generate_pagerank_graph(100, seed=50)
        >>> net = qt.QueueNetwork(g, seed=50)
        >>> net.initialize(2)

        To Func the network 50000 events run:

        >>> net.num_events
        0
        >>> net.Func(50000)
        >>> net.num_events
        50000

        To Func the network for at least 75 simulation time units
        run:

        >>> t0 = net.current_time
        >>> net.Func(t=75)
        >>> t1 = net.current_time
        >>> t1 - t0 # doctest: +ELLIPSIS
        75...
        """
        if not arg_0._initialized:
            arg_3 = ("Network has not been initialized. "
                   "Call '.initialize()' first.")
            raise QueueingToolError(arg_3)
        if arg_2 is None:
            for arg_4 in range(arg_1):
                arg_0._Func_next_event(slow=False)
        else:
            arg_5 = arg_0._t
            while arg_0._t < arg_5 + arg_2:
                arg_0._Func_next_event(slow=False)

Simulates the network forward.

        Simulates either a specific number of events or for a specified
        amount of simulation time.

        Parameters
        ----------
        n : int (optional, default: 1)
            The number of events to simulate. If ``t`` is not given
            then this parameter is used.
        t : float (optional)
            The amount of simulation time to simulate forward. If
            given, ``t`` is used instead of ``n``.

        Raises
        ------
        QueueingToolError
            Will raise a :exc:`.QueueingToolError` if the
            ``QueueNetwork`` has not been initialized. Call
            :meth:`.initialize` before calling this method.

        Examples
        --------
        Let ``net`` denote your instance of a ``QueueNetwork``. Before
        you simulate, you need to initialize the network, which allows
        arrivals from outside the network. To initialize with 2 (random
        chosen) edges accepting arrivals run:

        >>> import queueing_tool as qt
        >>> g = qt.generate_pagerank_graph(100, seed=50)
        >>> net = qt.QueueNetwork(g, seed=50)
        >>> net.initialize(2)

        To simulate the network 50000 events run:

        >>> net.num_events
        0
        >>> net.simulate(50000)
        >>> net.num_events
        50000

        To simulate the network for at least 75 simulation time units
        run:

        >>> t0 = net.current_time
        >>> net.simulate(t=75)
        >>> t1 = net.current_time
        >>> t1 - t0 # doctest: +ELLIPSIS
        75...


(self, analytes, filt_str='all', nbin=5, samples=None,
                       outdir=None, subset='All_Samples')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'all'
,
arg_3
=
5
,
arg_4
=
,
arg_5
=
,
arg_6
=
'All_Samples'
)
:
if
arg_5
is
:
arg_5
=
arg_0
.
report_dir
+
'/filters/'
+
arg_2
if
not
os
.
path
.
isdir
(
arg_0
.
report_dir
+
'/filters'
)
:
os
.
mkdir
(
arg_0
.
report_dir
+
'/filters'
)
if
not
os
.
path
.
isdir
(
arg_5
)
:
os
.
mkdir
(
arg_5
)
if
arg_4
is
not
:
arg_6
=
arg_0
.
make_subset
(
arg_4
)
arg_4
=
arg_0
.
_get_samples
(
arg_6
)
with
arg_0
.
pbar
.
set
(
total
=
len
(
arg_4
)
,
desc
=
'Drawing Plots'
)
as
prog
:
for
arg_7
in
arg_4
:
arg_8
=
arg_0
.
data
[
arg_7
]
.
filter_report
(
filt
=
arg_2
,
arg_1
=
arg_1
,
savedir
=
arg_5
,
arg_3
=
arg_3
)
prog
.
update
(
)
return

def Func(arg_0, arg_1, arg_2='all', arg_3=5, arg_4=None,
                       arg_5=None, arg_6='All_Samples'):
        """
        Plot filter reports for all filters that contain ``filt_str``
        in the name.
        """
        if arg_5 is None:
            arg_5 = arg_0.report_dir + '/filters/' + arg_2
            if not os.path.isdir(arg_0.report_dir + '/filters'):
                os.mkdir(arg_0.report_dir + '/filters')
        if not os.path.isdir(arg_5):
            os.mkdir(arg_5)

        if arg_4 is not None:
            arg_6 = arg_0.make_subset(arg_4)

        arg_4 = arg_0._get_samples(arg_6)

        with arg_0.pbar.set(total=len(arg_4), desc='Drawing Plots') as prog:
            for arg_7 in arg_4:
                arg_8 = arg_0.data[arg_7].filter_report(filt=arg_2,
                                            arg_1=arg_1,
                                            savedir=arg_5,
                                            arg_3=arg_3)
                prog.update()
            # plt.close(fig)
        return

Plot filter reports for all filters that contain filt_str in the name .


def Func ( arg_0 ) : assert arg_0 . mode in ( cs . CS_MODE_ARM , cs . CS_MODE_THUMB ) if arg_0 . mode == cs . CS_MODE_ARM : arg_0 . mode = cs . CS_MODE_THUMB else : arg_0 . mode = cs . CS_MODE_ARM

def Func(arg_0):
        """Toggle between ARM and Thumb mode"""
        assert arg_0.mode in (cs.CS_MODE_ARM, cs.CS_MODE_THUMB)
        if arg_0.mode == cs.CS_MODE_ARM:
            arg_0.mode = cs.CS_MODE_THUMB
        else:
            arg_0.mode = cs.CS_MODE_ARM


def Func ( arg_0 ) : for arg_1 in arg_0 . keys ( ) : if arg_1 [ : 2 ] == '00' and arg_0 [ arg_1 ] [ 0 ] [ 3 ] : del arg_0 [ arg_1 ]

def Func(arg_0):
    """
    Remove all non-empty controlfields from the record.

    :param rec:  A record dictionary structure
    :type  rec:  dictionary
    """
    for arg_1 in arg_0.keys():
        if arg_1[:2] == '00' and arg_0[arg_1][0][3]:
            del arg_0[arg_1]

Remove all non - empty controlfields from the record .


def Func ( arg_0 ) : try : arg_0 . manager . handle ( arg_0 . socket . recv ( 1024 ) ) except socket . error : pass

def Func(arg_0):
        """
        Tells the connection manager to receive the next 1024 byte of messages
        to analyze.
        """
        try:
            arg_0.manager.handle(arg_0.socket.recv(1024))
        except socket.error:
            pass

Tells the connection manager to receive the next 1024 byte of messages to analyze .


def Func(arg_0):
        """Load the object to which this entry point refers.
        """
        arg_1 = import_module(arg_0.module_name)
        arg_2 = arg_1
        if arg_0.object_name:
            for arg_3 in arg_0.object_name.split('.'):
                arg_2 = getattr(arg_2, arg_3)
        return arg_2

Load the object to which this entry point refers .


def Func ( arg_0 ) : arg_0 = os . path . normpath ( arg_0 ) arg_0 = os . path . abspath ( arg_0 ) arg_0 = os . path . normcase ( arg_0 ) return arg_0

def Func(arg_0):
    '''
    Returns a version of a path that is unique.

    Given two paths path1 and path2:
        Func(path1) == Func(path2) if and only if they represent the same file on
        the host OS. Takes account of case, slashes and relative paths.

    :param unicode path:
        The original path.

    :rtype: unicode
    :returns:
        The unique path.
    '''
    arg_0 = os.path.normpath(arg_0)
    arg_0 = os.path.abspath(arg_0)
    arg_0 = os.path.normcase(arg_0)

    return arg_0

Returns a version of a path that is unique.

    Given two paths path1 and path2:
        CanonicalPath(path1) == CanonicalPath(path2) if and only if they represent the same file on
        the host OS. Takes account of case, slashes and relative paths.

    :param unicode path:
        The original path.

    :rtype: unicode
    :returns:
        The unique path.

Returns a version of a path that is unique .


def Func ( arg_0 , arg_1 ) : if timezone . is_aware ( arg_1 ) : return arg_1 . astimezone ( arg_0 . timezone ) else : return timezone . make_aware ( arg_1 , arg_0 . timezone )

def Func(arg_0, arg_1):
        """Converts a datetime to the timezone of this Schedule."""
        if timezone.is_aware(arg_1):
            return arg_1.astimezone(arg_0.timezone)
        else:
            return timezone.make_aware(arg_1, arg_0.timezone)

Converts a datetime to the timezone of this Schedule .


def Func ( arg_0 , arg_1 ) : if arg_0 . encoderType is None : if arg_0 . dataType in [ 'int' , 'float' ] : arg_0 . encoderType = 'adaptiveScalar' elif arg_0 . dataType == 'string' : arg_0 . encoderType = 'category' elif arg_0 . dataType in [ 'date' , 'datetime' ] : arg_0 . encoderType = 'date' if arg_0 . dataType is None : if arg_0 . encoderType in [ 'scalar' , 'adaptiveScalar' ] : arg_0 . dataType = 'float' elif arg_0 . encoderType in [ 'category' , 'enumeration' ] : arg_0 . dataType = 'string' elif arg_0 . encoderType in [ 'date' , 'datetime' ] : arg_0 . dataType = 'datetime'

def Func(arg_0, arg_1):
    """Set up the dataTypes and initialize encoders"""

    if arg_0.encoderType is None:
      if arg_0.dataType in ['int','float']:
        arg_0.encoderType='adaptiveScalar'
      elif arg_0.dataType=='string':
        arg_0.encoderType='category'
      elif arg_0.dataType in ['date', 'datetime']:
        arg_0.encoderType='date'

    if arg_0.dataType is None:
      if arg_0.encoderType in ['scalar','adaptiveScalar']:
        arg_0.dataType='float'
      elif arg_0.encoderType in ['category', 'enumeration']:
        arg_0.dataType='string'
      elif arg_0.encoderType in ['date', 'datetime']:
        arg_0.dataType='datetime'


def Func ( arg_0 , arg_1 ) : arg_1 . provider = arg_0 . name arg_0 . gateway . onReceive ( arg_1 ) return arg_1

def Func(arg_0, arg_1):
        """ Incoming message callback

            Calls Gateway.onReceive event hook

            Providers are required to:
            * Cast phone numbers to digits-only
            * Support both ASCII and Unicode messages
            * Populate `message.msgid` and `message.meta` fields
            * If this method fails with an exception, the provider is required to respond with an error to the service

            :type message: IncomingMessage
            :param message: The received message
            :rtype: IncomingMessage
        """
        # Populate fields
        arg_1.provider = arg_0.name

        # Fire the event hook
        arg_0.gateway.onReceive(arg_1)

        # Finish
        return arg_1


(src, tar, qval=2, normalized=False, alphabet=None)

return Euclidean().dist_abs(src, tar, qval, normalized, alphabet)

def Func ( arg_0 , arg_1 , arg_2 = 2 , arg_3 = False , arg_4 = None ) : return Euclidean ( ) . dist_abs ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2=2, arg_3=False, arg_4=None):
    """Return the Euclidean distance between two strings.

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

    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
    normalized : bool
        Normalizes to [0, 1] if True
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float: The Euclidean distance

    Examples
    --------
    >>> Func('cat', 'hat')
    2.0
    >>> round(Func('Niall', 'Neil'), 12)
    2.645751311065
    >>> Func('Colin', 'Cuilen')
    3.0
    >>> round(Func('ATCG', 'TAGC'), 12)
    3.162277660168

    """
    return Euclidean().dist_abs(arg_0, arg_1, arg_2, arg_3, arg_4)

Return the Euclidean distance between two strings.

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

    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
    normalized : bool
        Normalizes to [0, 1] if True
    alphabet : collection or int
        The values or size of the alphabet

    Returns
    -------
    float: The Euclidean distance

    Examples
    --------
    >>> euclidean('cat', 'hat')
    2.0
    >>> round(euclidean('Niall', 'Neil'), 12)
    2.645751311065
    >>> euclidean('Colin', 'Cuilen')
    3.0
    >>> round(euclidean('ATCG', 'TAGC'), 12)
    3.162277660168

Return the Euclidean distance between two strings .


def Func(arg_0, arg_1: arg_2) -> Optional[str]:
        """Returns the signature of the normal function with the selector ``hsh``,
        or ``None`` if no such function exists.

        This function returns ``None`` for any selector that will be dispatched to a fallback function.
        """
        if not isinstance(arg_1, (arg_2, bytearray)):
            raise TypeError('The selector argument must be a concrete byte array')
        return arg_0._function_signatures_by_selector.get(arg_1)

Returns the signature of the normal function with the selector hsh or None if no such function exists .


return (not self.is_alive()) and self._queue.empty() or self._fd.closed

def Func ( arg_0 ) : return ( not arg_0 . is_alive ( ) ) and arg_0 . _queue . empty ( ) or arg_0 . _fd . closed

def Func(arg_0):
        """
        Check whether there is no more content to expect.
        """
        return (not arg_0.is_alive()) and arg_0._queue.empty() or arg_0._fd.closed

Check whether there is no more content to expect .


def
Func
(
arg_0
,
arg_1
)
:
if
'b'
not
in
arg_1
.
mode
:
raise
GiraffeError
(
"Archive writer must be in binary mode"
)
arg_1
.
write
(
GIRAFFE_MAGIC
)
arg_1
.
write
(
arg_0
.
columns
.
serialize
(
)
)
arg_2
=
0
for
arg_3
,
arg_4
in
enumerate
(
arg_0
.
_fetchall
(
ROW_ENCODING_RAW
)
,
1
)
:
arg_1
.
write
(
arg_4
)
yield
TeradataEncoder
.
count
(
arg_4
)

def Func(arg_0, arg_1):
        """
        Writes export archive files in the Giraffez archive format.
        This takes a `giraffez.io.Writer` and writes archive chunks to
        file until all rows for a given statement have been exhausted.

        .. code-block:: python

            with giraffez.BulkExport("database.table_name") as export:
                with giraffez.Writer("database.table_name.tar.gz", 'wb', use_gzip=True) as out:
                    for n in export.Func(out):
                        print("Rows: {}".format(n))

        :param `giraffez.io.Writer` writer: A writer handling the archive output

        :rtype: iterator (yields ``int``)
        """
        if 'b' not in arg_1.mode:
            raise GiraffeError("Archive writer must be in binary mode")
        arg_1.write(GIRAFFE_MAGIC)
        arg_1.write(arg_0.columns.serialize())
        arg_2 = 0
        for arg_3, arg_4 in enumerate(arg_0._fetchall(ROW_ENCODING_RAW), 1):
            arg_1.write(arg_4)
            yield TeradataEncoder.count(arg_4)

Writes export archive files in the Giraffez archive format.
        This takes a `giraffez.io.Writer` and writes archive chunks to
        file until all rows for a given statement have been exhausted.

        .. code-block:: python

            with giraffez.BulkExport("database.table_name") as export:
                with giraffez.Writer("database.table_name.tar.gz", 'wb', use_gzip=True) as out:
                    for n in export.to_archive(out):
                        print("Rows: {}".format(n))

        :param `giraffez.io.Writer` writer: A writer handling the archive output

        :rtype: iterator (yields ``int``)

Writes export archive files in the Giraffez archive format . This takes a giraffez . io . Writer and writes archive chunks to file until all rows for a given statement have been exhausted .


Establishes a connection to the Lavalink server.

async
def
Func
(
arg_0
)
:
await
arg_0
.
_lavalink
.
bot
.
wait_until_ready
(
)
if
arg_0
.
_ws
and
arg_0
.
_ws
.
open
:
log
.
debug
(
'WebSocket still open, closing...'
)
await
arg_0
.
_ws
.
close
(
)
arg_1
=
arg_0
.
_lavalink
.
bot
.
user
.
id
arg_2
=
arg_0
.
_lavalink
.
bot
.
shard_count
or
arg_0
.
_shards
arg_3
=
{
'Authorization'
:
arg_0
.
_password
,
'Num-Shards'
:
arg_2
,
'User-Id'
:
str
(
arg_1
)
}
log
.
debug
(
'Preparing to Func to Lavalink'
)
log
.
debug
(
'    with URI: {}'
.
format
(
arg_0
.
_uri
)
)
log
.
debug
(
'    with headers: {}'
.
format
(
str
(
arg_3
)
)
)
log
.
info
(
'Connecting to Lavalink...'
)
try
:
arg_0
.
_ws
=
await
websockets
.
Func
(
arg_0
.
_uri
,
loop
=
arg_0
.
_loop
,
extra_headers
=
arg_3
)
except
OSError
as
error
:
log
.
exception
(
'Failed to Func to Lavalink: {}'
.
format
(
str
(
error
)
)
)
else
:
log
.
info
(
'Connected to Lavalink!'
)
arg_0
.
_loop
.
create_task
(
arg_0
.
listen
(
)
)
arg_5
=
arg_0
.
_ws
.
response_headers
.
get
(
'Lavalink-Major-Version'
,
2
)
try
:
arg_0
.
_lavalink
.
_server_version
=
int
(
arg_5
)
except
ValueError
:
arg_0
.
_lavalink
.
_server_version
=
2
log
.
info
(
'Lavalink server version is {}'
.
format
(
arg_5
)
)
if
arg_0
.
_queue
:
log
.
info
(
'Replaying {} queued events...'
.
format
(
len
(
arg_0
.
_queue
)
)
)
for
arg_8
in
arg_0
.
_queue
:
await
arg_0
.
send
(
**
arg_8
)

async def Func(arg_0):
        """ Establishes a Funcion to the Lavalink server. """
        await arg_0._lavalink.bot.wait_until_ready()

        if arg_0._ws and arg_0._ws.open:
            log.debug('WebSocket still open, closing...')
            await arg_0._ws.close()

        arg_1 = arg_0._lavalink.bot.user.id
        arg_2 = arg_0._lavalink.bot.shard_count or arg_0._shards

        arg_3 = {
            'Authorization': arg_0._password,
            'Num-Shards': arg_2,
            'User-Id': str(arg_1)
        }
        log.debug('Preparing to Func to Lavalink')
        log.debug('    with URI: {}'.format(arg_0._uri))
        log.debug('    with headers: {}'.format(str(arg_3)))
        log.info('Connecting to Lavalink...')

        try:
            arg_0._ws = await websockets.Func(arg_0._uri, loop=arg_0._loop, extra_headers=arg_3)
        except OSError as error:
            log.exception('Failed to Func to Lavalink: {}'.format(str(error)))
        else:
            log.info('Connected to Lavalink!')
            arg_0._loop.create_task(arg_0.listen())
            arg_5 = arg_0._ws.response_headers.get('Lavalink-Major-Version', 2)
            try:
                arg_0._lavalink._server_version = int(arg_5)
            except ValueError:
                arg_0._lavalink._server_version = 2
            log.info('Lavalink server version is {}'.format(arg_5))
            if arg_0._queue:
                log.info('Replaying {} queued events...'.format(len(arg_0._queue)))
                for arg_8 in arg_0._queue:
                    await arg_0.send(**arg_8)

Establishes a connection to the Lavalink server .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
Register
(
)
if
arg_0
.
form
:
arg_2
.
form
=
arg_1
.
make_submit
(
)
return
arg_2
if
"FORM_TYPE"
not
in
arg_1
or
"jabber:iq:register"
not
in
arg_1
[
"FORM_TYPE"
]
.
values
:
raise
ValueError
(
"FORM_TYPE is not jabber:iq:register"
)
for
arg_3
in
legacy_fields
:
arg_0
.
__logger
.
debug
(
u"submitted field %r"
%
(
arg_3
,
)
)
arg_4
=
getattr
(
arg_0
,
arg_3
)
try
:
arg_5
=
arg_1
[
arg_3
]
.
value
except
KeyError
:
if
arg_4
:
raise
ValueError
(
"Required field with no value!"
)
continue
setattr
(
arg_2
,
arg_3
,
arg_5
)
return
arg_2

def Func(arg_0, arg_1):
        """Make `Register` object for submitting the registration form.

        Convert form data to legacy fields if `self.form` is `None`.

        :Parameters:
            - `form`: The form to submit. Its type doesn't have to be "submit"
              (a "submit" form will be created here), so it could be the form
              obtained from `get_form` just with the data entered.

        :return: new registration element
        :returntype: `Register`"""

        arg_2 = Register()
        if arg_0.form:
            arg_2.form = arg_1.make_submit()
            return arg_2

        if "FORM_TYPE" not in arg_1 or "jabber:iq:register" not in arg_1["FORM_TYPE"].values:
            raise ValueError("FORM_TYPE is not jabber:iq:register")

        for arg_3 in legacy_fields:
            arg_0.__logger.debug(u"submitted field %r" % (arg_3, ))
            arg_4 = getattr(arg_0, arg_3)
            try:
                arg_5 = arg_1[arg_3].value
            except KeyError:
                if arg_4:
                    raise ValueError("Required field with no value!")
                continue
            setattr(arg_2, arg_3, arg_5)

        return arg_2

Make Register object for submitting the registration form .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . pop ( 'protocol' ) arg_3 = arg_1 . pop ( 'channel_width' ) if 'htmode' in arg_1 : return arg_1 [ 'htmode' ] if arg_2 == '802.11n' : return 'HT{0}' . format ( arg_3 ) elif arg_2 == '802.11ac' : return 'VHT{0}' . format ( arg_3 ) return 'NONE'

def Func(arg_0, arg_1):
        """
        only for mac80211 driver
        """
        arg_2 = arg_1.pop('protocol')
        arg_3 = arg_1.pop('channel_width')
        # allow overriding htmode
        if 'htmode' in arg_1:
            return arg_1['htmode']
        if arg_2 == '802.11n':
            return 'HT{0}'.format(arg_3)
        elif arg_2 == '802.11ac':
            return 'VHT{0}'.format(arg_3)
        # disables n
        return 'NONE'


def
Func
(
arg_0
,
arg_1
)
:
bot
.
debug
(
"DELETE %s"
%
arg_1
)
for
arg_2
in
files
:
if
isinstance
(
arg_2
,
dict
)
:
if
"kind"
in
arg_2
:
if
arg_2
[
'kind'
]
==
"storage#object"
:
arg_3
=
"/"
.
join
(
arg_2
[
'id'
]
.
split
(
'/'
)
[
:
1
]
)
arg_3
=
re
.
sub
(
'%s/'
%
arg_0
.
_bucket
[
'name'
]
,
''
,
arg_3
,
1
)
Func_object
(
service
=
arg_0
.
_bucket_service
,
bucket_name
=
bucket
[
'name'
]
,
arg_3
=
arg_3
)

def Func(arg_0, arg_1):
    '''Func an image from Google Storage.

       Parameters
       ==========
       name: the name of the file (or image) to Func

    '''

    bot.debug("DELETE %s" % arg_1)

    for arg_2 in files:
        if isinstance(arg_2, dict):
            if "kind" in arg_2:
                if arg_2['kind'] == "storage#object":
                    arg_3 = "/".join(arg_2['id'].split('/')[:-1])
                    arg_3 = re.sub('%s/' %arg_0._bucket['name'],'', arg_3,1)

                    Func_object(service=arg_0._bucket_service,
                                  bucket_name=bucket['name'],
                                  arg_3=arg_3)

delete an image from Google Storage.

       Parameters
       ==========
       name: the name of the file (or image) to delete


def Func(arg_0, arg_1, arg_2=None):
        """Try to convert a prefix into a parameter name.

        If the result could be ambiguous or there is no matching
        parameter, throw an ArgumentError

        Args:
            name (str): A prefix for a parameter name
            filled_args (list): A list of filled positional arguments that will be
                removed from consideration.

        Returns:
            str: The full matching parameter name
        """

        arg_3 = 0
        if arg_2 is not None:
            arg_3 = len(arg_2)

        arg_4 = [x for x in arg_0.arg_names[arg_3:] if x.startswith(arg_1)]
        if len(arg_4) == 0:
            raise ArgumentError("Could not convert short-name full parameter name, none could be found", short_name=arg_1, parameters=arg_0.arg_names)
        elif len(arg_4) > 1:
            raise ArgumentError("Short-name is ambiguous, could match multiple keyword parameters", short_name=arg_1, possible_matches=arg_4)

        return arg_4[0]

Try to convert a prefix into a parameter name .


return True, fileOnDisk, infoOnDisk, classOnDisk

def Func ( arg_0 , arg_1 ) : arg_1 = arg_0 . to_repo_relative_path ( path = arg_1 , split = False ) if arg_1 == '' : return False , False , False , False arg_2 , arg_3 = os . path . split ( arg_1 ) arg_4 = os . path . isfile ( os . path . join ( arg_0 . __path , arg_1 ) ) arg_5 = os . path . isfile ( os . path . join ( arg_0 . __path , os . path . dirname ( arg_1 ) , arg_0 . __fileInfo % arg_3 ) ) arg_6 = os . path . isfile ( os . path . join ( arg_0 . __path , os . path . dirname ( arg_1 ) , arg_0 . __fileClass % arg_3 ) ) arg_7 = arg_0 . __repo [ 'walk_repo' ] if len ( arg_2 ) : for arg_8 in arg_2 . split ( os . sep ) : arg_9 = [ d for d in arg_7 if isinstance ( d , dict ) ] if not len ( arg_9 ) : arg_7 = None break arg_10 = [ d for d in arg_9 if arg_8 in d ] if not len ( arg_10 ) : arg_7 = None break arg_7 = arg_10 [ 0 ] [ arg_8 ] if arg_7 is None : return False , arg_4 , arg_5 , arg_6 if str ( arg_3 ) not in [ str ( arg_11 ) for arg_11 in arg_7 ] : return False , arg_4 , arg_5 , arg_6 return True , arg_4 , arg_5 , arg_6

def Func(arg_0, arg_1):
        """
        Check whether a given relative path is a repository file path

        :Parameters:
            #. relativePath (string): File relative path

        :Returns:
            #. isRepoFile (boolean): Whether file is a repository file.
            #. isFileOnDisk (boolean): Whether file is found on disk.
            #. isFileInfoOnDisk (boolean): Whether file info is found on disk.
            #. isFileClassOnDisk (boolean): Whether file class is found on disk.
        """
        arg_1  = arg_0.to_repo_relative_path(path=arg_1, split=False)
        if arg_1 == '':
            return False, False, False, False
        arg_2, arg_3 = os.path.split(arg_1)
        arg_4    = os.path.isfile(os.path.join(arg_0.__path, arg_1))
        arg_5    = os.path.isfile(os.path.join(arg_0.__path,os.path.dirname(arg_1),arg_0.__fileInfo%arg_3))
        arg_6   = os.path.isfile(os.path.join(arg_0.__path,os.path.dirname(arg_1),arg_0.__fileClass%arg_3))
        arg_7          = arg_0.__repo['walk_repo']
        if len(arg_2):
            for arg_8 in arg_2.split(os.sep):
                arg_9 = [d for d in arg_7 if isinstance(d, dict)]
                if not len(arg_9):
                    arg_7 = None
                    break
                arg_10 = [d for d in arg_9 if arg_8 in d]
                if not len(arg_10):
                    arg_7 = None
                    break
                arg_7 = arg_10[0][arg_8]
        if arg_7 is None:
            return False, arg_4, arg_5, arg_6
        #if name not in cDir:
        if str(arg_3) not in [str(arg_11) for arg_11 in arg_7]:
            return False, arg_4, arg_5, arg_6
        # this is a repository registered file. check whether all is on disk
        return True, arg_4, arg_5, arg_6


(self, password, use_config=True, config_filename=None,
                      use_keyring=HAS_KEYRING)

def Func(arg_0, arg_1, arg_2=True, arg_3=None,
                      arg_4=arg_5):
        """
        Determine the user password

        If the password is given, this password is used. Otherwise
        this function will try to get the password from the user's keyring
        if `use_keyring` is set to True.

        :param      username: Username (used directly if given)
        :type       username: ``str``

        :param      use_config: Whether to read username from configuration file
        :type       use_config: ``bool``

        :param      config_filename: Path to the configuration file
        :type       config_filename: ``str``

        """
        if not arg_1 and arg_2:
            if arg_0._config is None:
                arg_0._read_config(arg_3)
            arg_1 = arg_0._config.get("credentials", "password", fallback=None)

        if not arg_1 and arg_4:
            arg_6 = logging.getLogger(__name__)
            arg_7 = ("Please enter your password for {} on {}: "
                        .format(arg_0.username, arg_0.host_base))
            if arg_5:
                arg_1 = keyring.get_password(arg_0.keyring_identificator, arg_0.username)
                if arg_1 is None:
                    arg_1 = getpass.getpass(arg_7)
                    try:
                        keyring.set_password(arg_0.keyring_identificator, arg_0.username, arg_1)
                    except keyring.errors.PasswordSetError as error:
                        arg_6.warning("Storing password in keyring '%s' failed: %s",
                                       arg_0.keyring_identificator, error)
            else:
                arg_6.warning("Install the 'keyring' Python module to store your password "
                               "securely in your keyring!")
                arg_1 = arg_0._config.get("credentials", "password", fallback=None)
                if arg_1 is None:
                    arg_1 = getpass.getpass(arg_7)
                    arg_8 = arg_0._config.get(
                        "preferences", "store-plaintext-passwords", fallback=None)
                    if arg_8 != "no":
                        arg_7 = ("Do you want to store your password in plain text in " +
                                    arg_0._config_filename())
                        arg_9 = ask(arg_7, ["yes", "no", "never"], "no")
                        if arg_9 == "yes":
                            arg_0._config.set("credentials", "password", arg_1)
                            arg_0._save_config()
                        elif arg_9 == "never":
                            if "preferences" not in arg_0._config:
                                arg_0._config.add_section("preferences")
                            arg_0._config.set("preferences", "store-plaintext-passwords", "no")
                            arg_0._save_config()

        return arg_1


def Func ( arg_0 , arg_1 ) : if arg_0 . should_check_whitelist ( arg_1 ) : if arg_1 . arg not in arg_0 . whitelist and not arg_1 . arg . startswith ( "debug_" ) : arg_0 . violations . append ( ( arg_0 . current_logging_call , WHITELIST_VIOLATION . format ( arg_1 . arg ) ) ) if arg_0 . should_check_extra_exception ( arg_1 ) : arg_0 . check_exception_arg ( arg_1 . value ) super ( LoggingVisitor , arg_0 ) . generic_visit ( arg_1 )

def Func(arg_0, arg_1):
        """
        Process keyword arguments.

        """
        if arg_0.should_check_whitelist(arg_1):
            if arg_1.arg not in arg_0.whitelist and not arg_1.arg.startswith("debug_"):
                arg_0.violations.append((arg_0.current_logging_call, WHITELIST_VIOLATION.format(arg_1.arg)))

        if arg_0.should_check_extra_exception(arg_1):
            arg_0.check_exception_arg(arg_1.value)

        super(LoggingVisitor, arg_0).generic_visit(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = None arg_3 = None arg_4 = None arg_5 = False for arg_6 in range ( 0 , len ( arg_1 ) ) : arg_7 , arg_8 = arg_1 [ arg_6 ] arg_7 = arg_7 . lower ( ) if arg_7 == 'http-equiv' : arg_2 = arg_8 elif arg_7 == 'content' : arg_3 = arg_8 arg_4 = arg_6 if arg_2 and arg_3 : arg_9 = arg_0 . CHARSET_RE . search ( arg_3 ) if arg_9 : if ( arg_0 . declaredHTMLEncoding is not None or arg_0 . originalEncoding == arg_0 . fromEncoding ) : def rewrite ( arg_9 ) : return arg_9 . group ( 1 ) + "%SOUP-ENCODING%" arg_10 = arg_0 . CHARSET_RE . sub ( rewrite , arg_3 ) arg_1 [ arg_4 ] = ( arg_1 [ arg_4 ] [ 0 ] , arg_10 ) arg_5 = True else : arg_11 = arg_9 . group ( 3 ) if arg_11 and arg_11 != arg_0 . originalEncoding : arg_0 . declaredHTMLEncoding = arg_11 arg_0 . _feed ( arg_0 . declaredHTMLEncoding ) raise StopParsing pass arg_13 = arg_0 . unknown_starttag ( "meta" , arg_1 ) if arg_13 and arg_5 : arg_13 . containsSubstitutions = True

def Func(arg_0, arg_1):
        """Beautiful Soup can detect a charset included in a META tag,
        try to convert the document to that charset, and re-parse the
        document from the beginning."""
        arg_2 = None
        arg_3 = None
        arg_4 = None
        arg_5 = False

        for arg_6 in range(0, len(arg_1)):
            arg_7, arg_8 = arg_1[arg_6]
            arg_7 = arg_7.lower()
            if arg_7 == 'http-equiv':
                arg_2 = arg_8
            elif arg_7 == 'content':
                arg_3 = arg_8
                arg_4 = arg_6

        if arg_2 and arg_3: # It's an interesting meta tag.
            arg_9 = arg_0.CHARSET_RE.search(arg_3)
            if arg_9:
                if (arg_0.declaredHTMLEncoding is not None or
                    arg_0.originalEncoding == arg_0.fromEncoding):
                    # An HTML encoding was sniffed while converting
                    # the document to Unicode, or an HTML encoding was
                    # sniffed during a previous pass through the
                    # document, or an encoding was specified
                    # explicitly and it worked. Rewrite the meta tag.
                    def rewrite(arg_9):
                        return arg_9.group(1) + "%SOUP-ENCODING%"
                    arg_10 = arg_0.CHARSET_RE.sub(rewrite, arg_3)
                    arg_1[arg_4] = (arg_1[arg_4][0],
                                               arg_10)
                    arg_5 = True
                else:
                    # This is our first pass through the document.
                    # Go through it again with the encoding information.
                    arg_11 = arg_9.group(3)
                    if arg_11 and arg_11 != arg_0.originalEncoding:
                        arg_0.declaredHTMLEncoding = arg_11
                        arg_0._feed(arg_0.declaredHTMLEncoding)
                        raise StopParsing
                    pass
        arg_13 = arg_0.unknown_starttag("meta", arg_1)
        if arg_13 and arg_5:
            arg_13.containsSubstitutions = True

Beautiful Soup can detect a charset included in a META tag try to convert the document to that charset and re - parse the document from the beginning .


(cls, session: Optional[Session] = None)

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] = None ) -> List [ 'Action' ] : if arg_1 is None : arg_1 = _make_session ( ) arg_4 = arg_1 . query ( arg_0 ) . order_by ( arg_0 . created . desc ( ) ) . all ( ) arg_1 . close ( ) return arg_4

def Func(arg_0, arg_1: arg_2[arg_3] = None) -> List['Action']:
        """Get all actions."""
        if arg_1 is None:
            arg_1 = _make_session()

        arg_4 = arg_1.query(arg_0).order_by(arg_0.created.desc()).all()
        arg_1.close()
        return arg_4


def Func ( arg_0 , arg_1 = None , arg_2 = 'bye!' ) : try : arg_3 = six . moves . input ( arg_0 ) except ( KeyboardInterrupt , EOFError ) : print ( ) print ( arg_2 ) exit ( ) try : return int ( arg_3 ) except ValueError : if arg_3 . strip ( ) == "" and arg_1 is not None : return arg_1 else : return arg_3

def Func(arg_0, arg_1=None, arg_2='bye!'):
    """
    Reads stdin, exits with a message if interrupted, EOF, or a quit message.

    :return: The entered input. Converts to an integer if possible.
    :rtype: ``str`` or ``int``
    """
    try:
        arg_3 = six.moves.input(arg_0)
    except (KeyboardInterrupt, EOFError):
        print()
        print(arg_2)
        exit()
    try:
        return int(arg_3)
    except ValueError:
        if arg_3.strip() == "" and arg_1 is not None:
            return arg_1
        else:
            return arg_3

Reads stdin exits with a message if interrupted EOF or a quit message .


def Func(arg_0):
		'''
			Func - Return the module used for compression on this field

			@return <module> - The module for compression
		'''
		if arg_0.compressMode == COMPRESS_MODE_ZLIB:
			return zlib
		if arg_0.compressMode == COMPRESS_MODE_BZ2:
			return bz2
		if arg_0.compressMode == COMPRESS_MODE_LZMA:
			# Since lzma is not provided by python core in python2, search out some common alternatives.
			#  Throw exception if we can find no lzma implementation.
			global arg_1
			if arg_1 is not None:
				return arg_1
			try:
				import lzma
				arg_1 = lzma
				return arg_1
			except:
				# Python2 does not provide "lzma" module, search for common alternatives
				try:
					from backports import lzma
					arg_1 = lzma
					return arg_1
				except:
					pass
				try:
					import lzmaffi as lzma
					arg_1 = lzma
					return arg_1
				except:
					pass
				raise ImportError("Requested compress mode is lzma and could not find a module providing lzma support. Tried: 'lzma', 'backports.lzma', 'lzmaffi' and none of these were available. Please install one of these, or to use an unlisted implementation, set IndexedRedis.fields.compressed._lzmaMod to the module (must implement standard python compression interface)")

getCompressMod - Return the module used for compression on this field

			@return <module> - The module for compression


def
Func
(
arg_0
)
:
if
(
hasattr
(
arg_0
,
'message'
)
and
'errorName'
in
arg_0
.
message
and
'message'
in
arg_0
.
message
)
:
return
(
'{name}: {message}'
.
format
(
name
=
arg_0
.
message
[
'errorName'
]
,
message
=
arg_0
.
message
[
'message'
]
)
)
else
:
return
str
(
arg_0
)

def Func(arg_0):
        """
        Parses some DatabaseError to provide a better error message
        """
        if (hasattr(arg_0, 'message') and
            'errorName' in arg_0.message and
                'message' in arg_0.message):
            return ('{name}: {message}'.format(
                    name=arg_0.message['errorName'],
                    message=arg_0.message['message']))
        else:
            return str(arg_0)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
2
)
:
arg_4
=
re
.
IGNORECASE
arg_5
=
getattr
(
arg_0
,
arg_2
)
arg_6
=
re
.
compile
(
r'(\b'
+
r'\b|\b'
.
join
(
arg_5
)
+
r'\b)'
,
flags
=
arg_4
)
arg_7
=
arg_6
.
finditer
(
arg_1
)
arg_8
,
arg_9
=
[
]
,
[
]
arg_10
=
[
]
for
arg_11
in
arg_7
:
arg_8
.
append
(
arg_11
.
span
(
)
[
0
]
)
arg_9
.
append
(
arg_11
.
span
(
)
[
1
]
)
arg_10
.
append
(
arg_11
.
group
(
)
.
lower
(
)
)
arg_12
=
[
]
arg_13
=
[
]
arg_14
=
False
for
arg_15
,
arg_16
in
enumerate
(
arg_10
)
:
if
arg_14
:
arg_14
=
False
continue
if
(
arg_15
<
len
(
arg_10
)
1
)
and
(
arg_8
[
arg_15
+
1
]
arg_9
[
arg_15
]
<=
arg_3
)
:
if
arg_16
[
1
]
==
'-'
:
arg_17
=
''
else
:
arg_17
=
' '
arg_13
.
append
(
arg_16
+
arg_17
+
arg_10
[
arg_15
+
1
]
)
arg_12
.
append
(
arg_8
[
arg_15
]
)
arg_14
=
True
else
:
if
arg_16
not
in
arg_13
:
arg_13
.
append
(
arg_16
)
arg_12
.
append
(
arg_8
[
arg_15
]
)
arg_14
=
False
return
arg_13

def Func(arg_0, arg_1, arg_2, arg_3=2):
        """
        Given a string and a category, finds and combines words into
        groups based on their proximity.

        Args:
            text (str): Some text.
            tokens (list): A list of regex strings.

        Returns:
            list. The combined strings it found.

        Example:
            COLOURS = [r"red(?:dish)?", r"grey(?:ish)?", r"green(?:ish)?"]
            s = 'GREYISH-GREEN limestone with RED or GREY sandstone.'
            Func(s, COLOURS) --> ['greyish green', 'red', 'grey']
        """
        arg_4 = re.IGNORECASE
        arg_5 = getattr(arg_0, arg_2)
        arg_6 = re.compile(r'(\b' + r'\b|\b'.join(arg_5) + r'\b)', flags=arg_4)
        arg_7 = arg_6.finditer(arg_1)

        arg_8, arg_9 = [], []
        arg_10 = []

        for arg_11 in arg_7:
            arg_8.append(arg_11.span()[0])
            arg_9.append(arg_11.span()[1])
            arg_10.append(arg_11.group().lower())

        arg_12 = []  # As a check only.
        arg_13 = []  # This is what I want.

        arg_14 = False
        for arg_15, arg_16 in enumerate(arg_10):
            if arg_14:
                arg_14 = False
                continue
            if (arg_15 < len(arg_10)-1) and (arg_8[arg_15+1]-arg_9[arg_15] <= arg_3):
                if arg_16[-1] == '-':
                    arg_17 = ''  # Don't insert spaces after hyphens.
                else:
                    arg_17 = ' '
                arg_13.append(arg_16 + arg_17 + arg_10[arg_15+1])
                arg_12.append(arg_8[arg_15])
                arg_14 = True
            else:
                if arg_16 not in arg_13:
                    arg_13.append(arg_16)
                    arg_12.append(arg_8[arg_15])
                arg_14 = False

        return arg_13

Given a string and a category, finds and combines words into
        groups based on their proximity.

        Args:
            text (str): Some text.
            tokens (list): A list of regex strings.

        Returns:
            list. The combined strings it found.

        Example:
            COLOURS = [r"red(?:dish)?", r"grey(?:ish)?", r"green(?:ish)?"]
            s = 'GREYISH-GREEN limestone with RED or GREY sandstone.'
            find_word_groups(s, COLOURS) --> ['greyish green', 'red', 'grey']

Given a string and a category finds and combines words into groups based on their proximity .


def Func ( arg_0 , arg_1 ) : return vaex . utils . find_valid_name ( arg_1 , used = arg_0 . get_column_names ( hidden = True ) )

def Func(arg_0, arg_1):
        '''Finds a non-colliding name by optional postfixing'''
        return vaex.utils.find_valid_name(arg_1, used=arg_0.get_column_names(hidden=True))

Finds a non - colliding name by optional postfixing


return (role, method, resource) in self._allowed

def Func(arg_0, arg_1, arg_2, arg_3):
        """Check whether role is allowed to access resource

        :param role: Role to be checked.
        :param method: Method to be checked.
        :param resource: View function to be checked.
        """
        return (arg_1, arg_2, arg_3) in arg_0._allowed


(x, y=None, maxlags=None, norm='biased')

def Func(arg_0, arg_1=None, arg_2=None, arg_3='biased'):
    """Cross-correlation using numpy.correlate

    Estimates the cross-correlation (and autocorrelation) sequence of a random
    process of length N. By default, there is no normalisation and the output
    sequence of the cross-correlation has a length 2*N+1.

    :param array x: first data array of length N
    :param array y: second data array of length N. If not specified, computes the
        autocorrelation.
    :param int maxlags: compute cross correlation between [-maxlags:maxlags]
        when maxlags is not specified, the range of lags is [-N+1:N-1].
    :param str option: normalisation in ['biased', 'unbiased', None, 'coeff']

    The true cross-correlation sequence is

    .. math:: r_{xy}[m] = E(x[n+m].y^*[n]) = E(x[n].y^*[n-m])

    However, in practice, only a finite segment of one realization of the
    infinite-length random process is available.

    The correlation is estimated using numpy.correlate(x,y,'full').
    Normalisation is handled by this function using the following cases:

        * 'biased': Biased estimate of the cross-correlation function
        * 'unbiased': Unbiased estimate of the cross-correlation function
        * 'coeff': Normalizes the sequence so the autocorrelations at zero
           lag is 1.0.

    :return:
        * a numpy.array containing the cross-correlation sequence (length 2*N-1)
        * lags vector

    .. note:: If x and y are not the same length, the shorter vector is
        zero-padded to the length of the longer vector.

    .. rubric:: Examples

    .. doctest::

        >>> from spectrum import Func
        >>> x = [1,2,3,4,5]
        >>> c, l = Func(x,x, maxlags=0, norm='biased')
        >>> c
        array([ 11.])

    .. seealso:: :func:`CORRELATION`.
    """
    arg_4 = len(arg_0)
    if arg_1 is None:
        arg_1 = arg_0
    assert len(arg_0) == len(arg_1), 'x and y must have the same length. Add zeros if needed'

    if arg_2 is None:
        arg_2 = arg_4-1
        arg_5 = np.arange(0, 2*arg_4-1)
    else:
        assert arg_2 <= arg_4, 'maxlags must be less than data length'
        arg_5 = np.arange(arg_4-arg_2-1, arg_4+arg_2)

    arg_6 = np.correlate(arg_0, arg_1, mode='full')

    if arg_3 == 'biased':
        arg_7 = float(arg_4)
        arg_6 = arg_6[arg_5] / float(arg_4)    # do not use /= !!
    elif arg_3 == 'unbiased':
        arg_6 = arg_6[arg_5] / (float(arg_4)-abs(np.arange(-arg_4+1, arg_4)))[arg_5]
    elif arg_3 == 'coeff':
        arg_7 = float(arg_4)
        arg_8 = pylab_rms_flat(arg_0) * pylab_rms_flat(arg_1)
        arg_6 = arg_6[arg_5] / arg_8 / arg_7
    else:
        arg_6 = arg_6[arg_5]

    arg_5 = np.arange(-arg_2, arg_2+1)
    return arg_6, arg_5

Cross-correlation using numpy.correlate

    Estimates the cross-correlation (and autocorrelation) sequence of a random
    process of length N. By default, there is no normalisation and the output
    sequence of the cross-correlation has a length 2*N+1.

    :param array x: first data array of length N
    :param array y: second data array of length N. If not specified, computes the
        autocorrelation.
    :param int maxlags: compute cross correlation between [-maxlags:maxlags]
        when maxlags is not specified, the range of lags is [-N+1:N-1].
    :param str option: normalisation in ['biased', 'unbiased', None, 'coeff']

    The true cross-correlation sequence is

    .. math:: r_{xy}[m] = E(x[n+m].y^*[n]) = E(x[n].y^*[n-m])

    However, in practice, only a finite segment of one realization of the
    infinite-length random process is available.

    The correlation is estimated using numpy.correlate(x,y,'full').
    Normalisation is handled by this function using the following cases:

        * 'biased': Biased estimate of the cross-correlation function
        * 'unbiased': Unbiased estimate of the cross-correlation function
        * 'coeff': Normalizes the sequence so the autocorrelations at zero
           lag is 1.0.

    :return:
        * a numpy.array containing the cross-correlation sequence (length 2*N-1)
        * lags vector

    .. note:: If x and y are not the same length, the shorter vector is
        zero-padded to the length of the longer vector.

    .. rubric:: Examples

    .. doctest::

        >>> from spectrum import xcorr
        >>> x = [1,2,3,4,5]
        >>> c, l = xcorr(x,x, maxlags=0, norm='biased')
        >>> c
        array([ 11.])

    .. seealso:: :func:`CORRELATION`.

Cross - correlation using numpy . correlate


(self, client_jid = None, domains = None)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = [ arg_4 for arg_4 in arg_0 . get_jids ( ) if arg_4 . local ] if not arg_3 : return None if arg_1 is not None and arg_1 in arg_3 : return arg_1 if arg_2 is None : return arg_3 [ 0 ] for arg_4 in arg_3 : for arg_5 in arg_2 : if are_domains_equal ( arg_4 . domain , arg_5 ) : return arg_4 return None

def Func(arg_0, arg_1 = None, arg_2 = None):
        """Verify certificate for a client.

        Please note that `client_jid` is only a hint to choose from the names,
        other JID may be returned if `client_jid` is not included in the
        certificate.

        :Parameters:
            - `client_jid`: client name requested. May be `None` to allow
              any name in one of the `domains`.
            - `domains`: list of domains we can handle.
        :Types:
            - `client_jid`: `JID`
            - `domains`: `list` of `unicode`

        :Return: one of the jids in the certificate or `None` is no authorized
        name is found.
        """
        arg_3 = [arg_4 for arg_4 in arg_0.get_jids() if arg_4.local]
        if not arg_3:
            return None
        if arg_1 is not None and arg_1 in arg_3:
            return arg_1
        if arg_2 is None:
            return arg_3[0]
        for arg_4 in arg_3:
            for arg_5 in arg_2:
                if are_domains_equal(arg_4.domain, arg_5):
                    return arg_4
        return None


return [int(x) for x in tuple(data_str)]

def Func ( arg_0 , arg_1 ) : arg_2 = bin ( arg_0 & ( 2 ** arg_1 - 1 ) ) [ 2 : ] . zfill ( arg_1 ) return [ int ( arg_3 ) for arg_3 in tuple ( arg_2 ) ]

def Func(arg_0, arg_1):
    """
    Convert an unsigned integer to a numpy binary array with the first
    element the MSB and the last element the LSB.
    """
    arg_2 = bin(arg_0 & (2**arg_1-1))[2:].zfill(arg_1)
    return [int(arg_3) for arg_3 in tuple(arg_2)]

Convert an unsigned integer to a numpy binary array with the first element the MSB and the last element the LSB .


def Func(arg_0=6, arg_1=.01, arg_2=.6, arg_3=.65):
    """
    Get a set of evenly spaced colors in HLS hue space.

    h, l, and s should be between 0 and 1

    Parameters
    ----------

    n_colors : int
        number of colors in the palette
    h : float
        first hue
    l : float
        lightness
    s : float
        saturation

    Returns
    -------
    palette : list
        List of colors as RGB hex strings.

    See Also
    --------
    husl_palette : Make a palette using evenly spaced circular
        hues in the HUSL system.

    Examples
    --------
    >>> len(Func(2))
    2
    >>> len(Func(9))
    9
    """
    arg_4 = np.linspace(0, 1, arg_0 + 1)[:-1]
    arg_4 += arg_1
    arg_4 %= 1
    arg_4 -= arg_4.astype(int)
    arg_5 = [colorsys.hls_to_rgb(h_i, arg_2, arg_3) for h_i in arg_4]
    return arg_5

Get a set of evenly spaced colors in HLS hue space.

    h, l, and s should be between 0 and 1

    Parameters
    ----------

    n_colors : int
        number of colors in the palette
    h : float
        first hue
    l : float
        lightness
    s : float
        saturation

    Returns
    -------
    palette : list
        List of colors as RGB hex strings.

    See Also
    --------
    husl_palette : Make a palette using evenly spaced circular
        hues in the HUSL system.

    Examples
    --------
    >>> len(hls_palette(2))
    2
    >>> len(hls_palette(9))
    9

Get a set of evenly spaced colors in HLS hue space .


def Func ( arg_0 ) : if ( arg_0 . url_file and not arg_0 . Func_download ( arg_0 . url_file ) ) : arg_1 . INTERN [ "file_to_test" ] = arg_0 . url_file

def Func(arg_0):
        """
        Manage the loading of the url system.
        """

        if (
            arg_0.url_file  # pylint: disable=no-member
            and not arg_0.Func_download(
                arg_0.url_file  # pylint: disable=no-member
            )
        ):  # pylint: disable=no-member
            # The current url_file is not a URL.

            # We initiate the filename as the file we have to test.
            arg_1.INTERN[
                "file_to_test"
            ] = arg_0.url_file


def Func(arg_0, arg_1):
        """ Delete mesh layer """
        del arg_0.layer_stack[arg_1]
        # Adjust current layer if needed
        if arg_1 < arg_0.current_layer():
            arg_0.set_current_layer(arg_0.current_layer() - 1)
        return None


def Func ( arg_0 ) : try : arg_1 = _pybossa_req ( 'delete' , 'taskrun' , arg_0 ) if type ( arg_1 ) . __name__ == 'bool' : return True else : return arg_1 except : raise

def Func(arg_0):
    """Delete the given taskrun.

    :param task: PYBOSSA task
    """
    try:
        arg_1 = _pybossa_req('delete', 'taskrun', arg_0)
        if type(arg_1).__name__ == 'bool':
            return True
        else:
            return arg_1
    except:  # pragma: no cover
        raise


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = super ( VersatileImageField , arg_0 ) . Func ( arg_1 , arg_2 ) arg_0 . update_ppoi_field ( arg_1 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Return field's value just before saving."""
        arg_3 = super(VersatileImageField, arg_0).Func(arg_1, arg_2)
        arg_0.update_ppoi_field(arg_1)
        return arg_3

Return field s value just before saving .


Apply the criteria to filter out on the metrics required

def Func ( arg_0 ) : if arg_0 . Func_expression is not None : arg_1 = [ ] arg_2 = arg_0 . metrics [ 'result' ] for arg_3 in arg_2 : if arg_0 . Func_expression . search ( arg_3 [ 'name' ] ) : arg_1 . append ( arg_3 ) else : arg_1 = arg_0 . metrics [ 'result' ] arg_0 . metrics = arg_0 . extract_dictionary ( arg_1 )

def Func(arg_0):
        """
        Apply the criteria to Func out on the metrics required
        """
        if arg_0.Func_expression is not None:
            arg_1 = []
            arg_2 = arg_0.metrics['result']
            for arg_3 in arg_2:
                if arg_0.Func_expression.search(arg_3['name']):
                    arg_1.append(arg_3)
        else:
            arg_1 = arg_0.metrics['result']

        arg_0.metrics = arg_0.extract_dictionary(arg_1)


def Func(arg_0, arg_1, arg_2):
        """
        Sends a PUB command to the server on the specified subject.

          ->> PUB hello 5
          ->> MSG_PAYLOAD: world
          <<- MSG hello 2 5

        """
        if arg_0.is_closed:
            raise ErrConnectionClosed
        if arg_0.is_draining_pubs:
            raise ErrConnectionDraining

        arg_3 = len(arg_2)
        if arg_3 > arg_0._max_payload:
            raise ErrMaxPayload
        yield from arg_0._Func(arg_1, _EMPTY_, arg_2, arg_3)

Sends a PUB command to the server on the specified subject .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Loads double width data from memory."""
        assert arg_1.type == 'register'
        assert arg_2.type == 'register'
        assert arg_3.type == 'memory'
        arg_5 = arg_0.read_int(arg_3.address(), 32)
        arg_6 = arg_0.read_int(arg_3.address() + 4, 32)
        arg_7 = arg_0._compute_writeback(arg_3, arg_4)
        arg_1.write(arg_5)
        arg_2.write(arg_6)
        arg_0._cs_hack_ldr_str_writeback(arg_3, arg_4, arg_7)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
1
)
:
arg_4
=
open
(
arg_0
+
".migrate"
,
'w'
)
arg_5
=
open
(
arg_1
,
'r'
)
if
isinstance
(
arg_3
,
int
)
:
arg_3
=
{
pop
:
arg_3
for
pop
in
arg_2
}
else
:
arg_3
=
arg_3
arg_6
=
[
]
arg_7
=
zip
(
taxa
.
keys
(
)
,
minhits
)
arg_8
=
arg_5
.
read
(
)
.
strip
(
)
.
split
(
"|"
)
[
:
1
]
for
arg_9
in
arg_8
:
arg_10
=
[
arg_14
.
split
(
)
[
0
]
.
replace
(
">"
,
""
)
for
arg_14
in
arg_9
.
split
(
"\n"
)
if
">"
in
arg_14
]
arg_11
=
[
]
for
arg_12
,
arg_13
in
arg_7
:
arg_11
.
append
(
sum
(
[
arg_14
in
arg_10
for
arg_14
in
taxa
[
arg_12
]
]
)
>=
int
(
arg_13
)
)
if
all
(
arg_11
)
:
arg_6
.
append
(
arg_9
)
print
>>
arg_4
,
len
(
taxa
)
,
len
(
arg_6
)
,
"( npops nloci for data set"
,
data
.
name
+
".loci"
,
")"
arg_15
=
0
for
arg_12
in
taxa
:
if
not
arg_15
:
arg_16
=
[
len
(
arg_9
.
split
(
"\n"
)
[
1
]
.
split
(
)
[
1
]
.
replace
(
"x"
,
"n"
)
.
replace
(
"n"
,
""
)
)
for
arg_9
in
arg_6
]
print
>>
arg_4
,
" "
.
join
(
map
(
str
,
arg_16
)
)
arg_15
+=
1
arg_17
=
[
]
for
arg_9
in
arg_6
:
arg_10
=
[
arg_14
.
split
(
)
[
0
]
.
replace
(
">"
,
""
)
for
arg_14
in
arg_9
.
split
(
"\n"
)
if
">"
in
arg_14
]
arg_18
=
sum
(
[
arg_14
in
arg_10
for
arg_14
in
taxa
[
arg_12
]
]
)
arg_17
.
append
(
arg_18
)
print
>>
arg_4
,
" "
.
join
(
map
(
str
,
arg_17
)
)
,
arg_12
for
arg_9
in
range
(
len
(
arg_6
)
)
:
arg_19
=
[
arg_14
.
split
(
)
[
1
]
for
arg_14
in
arg_6
[
arg_9
]
.
split
(
"\n"
)
if
arg_14
.
split
(
)
[
0
]
.
replace
(
">"
,
""
)
in
taxa
[
arg_12
]
]
for
arg_14
in
range
(
len
(
arg_19
)
)
:
print
>>
arg_4
,
arg_12
[
0
:
8
]
+
"_"
+
str
(
arg_14
)
+
(
" "
*
(
10
len
(
arg_12
[
0
:
8
]
+
"_"
+
str
(
arg_14
)
)
)
)
+
arg_19
[
arg_14
]
.
replace
(
"x"
,
"n"
)
.
replace
(
"n"
,
""
)
arg_4
.
close
(
)

def Func(arg_0, arg_1, arg_2, arg_3=1):
    """
    A function to build an input file for the program migrate from an ipyrad
    .loci file, and a dictionary grouping Samples into populations.

    Parameters:
    -----------
    name: (str)
       The name prefix for the migrate formatted output file.
    locifile: (str)
       The path to the .loci file produced by ipyrad.
    popdict: (dict)
       A Python dictionary grouping Samples into Populations.

    Examples:
    ---------
    You can create the population dictionary by hand, and pass in the path
    to your .loci file as a string.
       >> popdict = {'A': ['a', 'b', 'c'], 'B': ['d', 'e', 'f']}
       >> Func("outfile.migrate", "./mydata.loci", popdict)

    Or, if you load your ipyrad.Assembly object from it's JSON file, you can
    access the loci file path and population information from there directly.
       >> data = ip.load_json("mydata.json")
       >> Func("outfile.migrate", data.outfiles.loci, data.populations)

    """

    ## I/O
    arg_4 = open(arg_0+".migrate", 'w')
    arg_5 = open(arg_1, 'r')

    ## minhits dictionary can be an int (all same) or a dictionary (set each)
    if isinstance(arg_3, int):
        arg_3 = {pop: arg_3 for pop in arg_2}
    else:
        arg_3 = arg_3

    ## filter data to only the loci that have data for mindict setting
    arg_6 = []
    arg_7 = zip(taxa.keys(), minhits)

    ## read in data to sample names
    arg_8  = arg_5.read().strip().split("|")[:-1]
    for arg_9 in arg_8:
        arg_10 = [arg_14.split()[0].replace(">","") for arg_14 in arg_9.split("\n") if ">" in arg_14]
        ## filter for coverage
        arg_11 = []
        for arg_12,arg_13 in arg_7:
            arg_11.append( sum([arg_14 in arg_10 for arg_14 in taxa[arg_12]]) >= int(arg_13) )
        if all(arg_11):
            arg_6.append(arg_9)

    ## print data to file
    print >>arg_4, len(taxa), len(arg_6), "( npops nloci for data set", data.name+".loci",")"

    ## print all data for each population at a time
    arg_15 = 0
    for arg_12 in taxa:
        ## print a list of lengths of each locus
        if not arg_15:
            arg_16 = [len(arg_9.split("\n")[1].split()[-1].replace("x","n").replace("n","")) for arg_9 in arg_6]
            print >>arg_4, " ".join(map(str,arg_16))
            arg_15 += 1

        ## print a list of number of individuals in each locus
        arg_17 = []
        for arg_9 in arg_6:
            arg_10 = [arg_14.split()[0].replace(">","") for arg_14 in arg_9.split("\n") if ">" in arg_14]
            arg_18 = sum([arg_14 in arg_10 for arg_14 in taxa[arg_12]])
            arg_17.append(arg_18)
        print >>arg_4, " ".join(map(str,arg_17)), arg_12

        ## print sample id, spaces, and sequence data
        #for loc in range(len(keep)):
        for arg_9 in range(len(arg_6)):
            arg_19 = [arg_14.split()[-1] for arg_14 in arg_6[arg_9].split("\n") if \
                    arg_14.split()[0].replace(">","") in taxa[arg_12]]
            for arg_14 in range(len(arg_19)):
                print >>arg_4, arg_12[0:8]+"_"+str(arg_14)+\
                      (" "*(10-len(arg_12[0:8]+"_"+str(arg_14))))+arg_19[arg_14].replace("x","n").replace("n","")

    arg_4.close()

A function to build an input file for the program migrate from an ipyrad
    .loci file, and a dictionary grouping Samples into populations.

    Parameters:
    -----------
    name: (str)
       The name prefix for the migrate formatted output file.
    locifile: (str)
       The path to the .loci file produced by ipyrad.
    popdict: (dict)
       A Python dictionary grouping Samples into Populations.

    Examples:
    ---------
    You can create the population dictionary by hand, and pass in the path
    to your .loci file as a string.
       >> popdict = {'A': ['a', 'b', 'c'], 'B': ['d', 'e', 'f']}
       >> loci2migrate("outfile.migrate", "./mydata.loci", popdict)

    Or, if you load your ipyrad.Assembly object from it's JSON file, you can
    access the loci file path and population information from there directly.
       >> data = ip.load_json("mydata.json")
       >> loci2migrate("outfile.migrate", data.outfiles.loci, data.populations)

A function to build an input file for the program migrate from an ipyrad . loci file and a dictionary grouping Samples into populations .


def Func ( arg_0 , arg_1 = arg_2 . BOTH ) : arg_4 = [ ] for arg_5 in arg_0 . splitlines ( ) : if arg_1 & arg_2 . RIGHT : arg_5 = arg_5 . rstrip ( ) if arg_1 & arg_2 . LEFT : arg_5 = arg_5 . lstrip ( ) arg_4 . append ( arg_5 ) return '' . join ( arg_4 )

def Func(arg_0, arg_1=arg_2.BOTH):
    '''
    Join strings together and strip whitespace in between if needed
    '''
    arg_4 = []

    for arg_5 in arg_0.splitlines():
        if arg_1 & arg_2.RIGHT:
            arg_5 = arg_5.rstrip()

        if arg_1 & arg_2.LEFT:
            arg_5 = arg_5.lstrip()

        arg_4.append(arg_5)

    return ''.join(arg_4)


def
Func
(
arg_0
)
:
arg_1
=
'/home/bitergia/mboxes'
arg_2
=
[
project
for
project
in
arg_0
if
'mailing_lists'
in
arg_0
[
project
]
]
for
arg_3
in
arg_2
:
arg_0
[
arg_3
]
[
'mbox'
]
=
[
]
for
arg_4
in
arg_0
[
arg_3
]
[
'mailing_lists'
]
:
if
'listinfo'
in
arg_4
:
arg_5
=
arg_4
.
split
(
'listinfo/'
)
[
1
]
elif
'mailing-list'
in
arg_4
:
arg_5
=
arg_4
.
split
(
'mailing-list/'
)
[
1
]
else
:
arg_5
=
arg_4
.
split
(
'@'
)
[
0
]
arg_6
=
"%s %s/%s.mbox/%s.mbox"
%
(
arg_5
,
arg_1
,
arg_5
,
arg_5
)
arg_0
[
arg_3
]
[
'mbox'
]
.
append
(
arg_6
)
return
arg_0

def Func(arg_0):
    """ Compose projects.json only for mbox, but using the mailing_lists lists

    change: 'https://dev.eclipse.org/mailman/listinfo/emft-dev'
    to: 'emfg-dev /home/bitergia/mboxes/emft-dev.mbox/emft-dev.mbox

    :param projects: projects.json
    :return: projects.json with mbox
    """
    arg_1 = '/home/bitergia/mboxes'

    arg_2 = [project for project in arg_0 if 'mailing_lists' in arg_0[project]]
    for arg_3 in arg_2:
        arg_0[arg_3]['mbox'] = []
        for arg_4 in arg_0[arg_3]['mailing_lists']:
            if 'listinfo' in arg_4:
                arg_5 = arg_4.split('listinfo/')[1]
            elif 'mailing-list' in arg_4:
                arg_5 = arg_4.split('mailing-list/')[1]
            else:
                arg_5 = arg_4.split('@')[0]

            arg_6 = "%s %s/%s.mbox/%s.mbox" % (arg_5, arg_1, arg_5, arg_5)
            arg_0[arg_3]['mbox'].append(arg_6)

    return arg_0

Compose projects . json only for mbox but using the mailing_lists lists


(self, contents, def_buf, kwh_scale=ScaleKWH.EmptyScale)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
arg_4
.
EmptyScale
)
:
arg_6
=
""
arg_7
=
0
if
arg_3
==
arg_4
.
EmptyScale
:
arg_8
=
int
(
arg_2
.
keys
(
)
.
index
(
Field
.
kWh_Scale
)
)
arg_0
.
m_kwh_precision
=
arg_3
=
int
(
arg_1
[
arg_8
]
)
for
arg_10
in
arg_2
:
if
arg_2
[
arg_10
]
[
arg_17
.
CalculatedFlag
]
:
arg_7
+=
1
continue
if
len
(
arg_1
)
==
0
:
arg_7
+=
1
continue
try
:
arg_11
=
arg_1
[
arg_7
]
arg_12
=
arg_2
[
arg_10
]
[
arg_17
.
TypeValue
]
arg_13
=
arg_2
[
arg_10
]
[
arg_17
.
ScaleValue
]
if
arg_12
==
FieldType
.
Float
:
arg_14
=
float
(
str
(
arg_11
)
)
arg_15
=
1
if
arg_13
==
ScaleType
.
KWH
:
arg_15
=
1
if
arg_3
==
arg_4
.
Scale10
:
arg_15
=
10
elif
arg_3
==
arg_4
.
Scale100
:
arg_15
=
100
elif
(
arg_3
!=
arg_4
.
NoScale
)
and
(
arg_3
!=
arg_4
.
EmptyScale
)
:
ekm_log
(
"Unrecognized kwh scale."
)
elif
arg_13
==
ScaleType
.
Div10
:
arg_15
=
10
elif
arg_13
==
ScaleType
.
Div100
:
arg_15
=
100
elif
arg_13
!=
ScaleType
.
No
:
ekm_log
(
"Unrecognized float scale."
)
arg_14
/=
arg_15
arg_16
=
str
(
arg_14
)
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
=
arg_16
arg_2
[
arg_10
]
[
arg_17
.
NativeValue
]
=
arg_14
elif
arg_12
==
FieldType
.
Hex
:
arg_20
=
arg_11
.
encode
(
'hex'
)
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
=
arg_20
arg_2
[
arg_10
]
[
arg_17
.
NativeValue
]
=
arg_20
elif
arg_12
==
FieldType
.
Int
:
arg_21
=
int
(
arg_11
)
arg_22
=
str
(
arg_21
)
if
len
(
arg_22
)
==
0
:
arg_22
=
str
(
0
)
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
=
arg_22
arg_2
[
arg_10
]
[
arg_17
.
NativeValue
]
=
arg_21
elif
arg_12
==
FieldType
.
String
:
arg_23
=
str
(
arg_11
)
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
=
arg_23
arg_2
[
arg_10
]
[
arg_17
.
NativeValue
]
=
arg_23
elif
arg_12
==
FieldType
.
PowerFactor
:
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
=
str
(
arg_11
)
arg_2
[
arg_10
]
[
arg_17
.
NativeValue
]
=
str
(
arg_11
)
else
:
ekm_log
(
"Unrecognized field type"
)
arg_6
=
arg_6
+
'"'
+
arg_10
+
'":  "'
+
arg_2
[
arg_10
]
[
arg_17
.
StringValue
]
+
'"\n'
except
:
ekm_log
(
"Exception on Field:"
+
str
(
arg_10
)
)
ekm_log
(
traceback
.
format_exc
(
sys
.
exc_info
(
)
)
)
arg_0
.
writeCmdMsg
(
"Exception on Field:"
+
str
(
arg_10
)
)
arg_7
+=
1
return
True

def Func(arg_0, arg_1, arg_2, arg_3=arg_4.EmptyScale):
        """ Move data from raw tuple into scaled and conveted values.

        Args:
            contents (tuple): Breakout of passed block from unpackStruct().
            def_buf (): Read buffer destination.
            kwh_scale (int):  :class:`~ekmmeters.ScaleKWH` as int, from Field.kWhScale`

        Returns:
            bool: True on completion.
        """
        arg_6 = ""
        arg_7 = 0

        # getting scale does not require a full read.  It does require that the
        # reads have the scale value in the first block read.  This requirement
        # is filled by default in V3 and V4 requests
        if arg_3 == arg_4.EmptyScale:
            arg_8 = int(arg_2.keys().index(Field.kWh_Scale))
            arg_0.m_kwh_precision = arg_3 = int(arg_1[arg_8])

        for arg_10 in arg_2:

            if arg_2[arg_10][arg_17.CalculatedFlag]:
                arg_7 += 1
                continue

            if len(arg_1) == 0:
                arg_7 += 1
                continue

            try:  # scrub up messes on a field by field basis
                arg_11 = arg_1[arg_7]
                arg_12 = arg_2[arg_10][arg_17.TypeValue]
                arg_13 = arg_2[arg_10][arg_17.ScaleValue]

                if arg_12 == FieldType.Float:
                    arg_14 = float(str(arg_11))
                    arg_15 = 1
                    if arg_13 == ScaleType.KWH:
                        arg_15 = 1
                        if arg_3 == arg_4.Scale10:
                            arg_15 = 10
                        elif arg_3 == arg_4.Scale100:
                            arg_15 = 100
                        elif (arg_3 != arg_4.NoScale) and (arg_3 != arg_4.EmptyScale):
                            ekm_log("Unrecognized kwh scale.")
                    elif arg_13 == ScaleType.Div10:
                        arg_15 = 10
                    elif arg_13 == ScaleType.Div100:
                        arg_15 = 100
                    elif arg_13 != ScaleType.No:
                        ekm_log("Unrecognized float scale.")
                    arg_14 /= arg_15
                    arg_16 = str(arg_14)
                    arg_2[arg_10][arg_17.StringValue] = arg_16
                    arg_2[arg_10][arg_17.NativeValue] = arg_14

                elif arg_12 == FieldType.Hex:
                    arg_20 = arg_11.encode('hex')
                    arg_2[arg_10][arg_17.StringValue] = arg_20
                    arg_2[arg_10][arg_17.NativeValue] = arg_20

                elif arg_12 == FieldType.Int:
                    arg_21 = int(arg_11)
                    arg_22 = str(arg_21)
                    if len(arg_22) == 0:
                        arg_22 = str(0)
                    arg_2[arg_10][arg_17.StringValue] = arg_22
                    arg_2[arg_10][arg_17.NativeValue] = arg_21

                elif arg_12 == FieldType.String:
                    arg_23 = str(arg_11)
                    arg_2[arg_10][arg_17.StringValue] = arg_23
                    arg_2[arg_10][arg_17.NativeValue] = arg_23

                elif arg_12 == FieldType.PowerFactor:
                    arg_2[arg_10][arg_17.StringValue] = str(arg_11)
                    arg_2[arg_10][arg_17.NativeValue] = str(arg_11)

                else:
                    ekm_log("Unrecognized field type")

                arg_6 = arg_6 + '"' + arg_10 + '":  "' + arg_2[arg_10][arg_17.StringValue] + '"\n'

            except:
                ekm_log("Exception on Field:" + str(arg_10))
                ekm_log(traceback.format_exc(sys.exc_info()))
                arg_0.writeCmdMsg("Exception on Field:" + str(arg_10))

            arg_7 += 1

        return True

Move data from raw tuple into scaled and conveted values .


def Func ( arg_0 , arg_1 ) : arg_0 . _validateCell ( arg_1 ) return int ( arg_1 / arg_0 . cellsPerColumn )

def Func(arg_0, arg_1):
    """
    Returns the index of the column that a cell belongs to.

    :param cell: (int) Cell index

    :returns: (int) Column index
    """
    arg_0._validateCell(arg_1)

    return int(arg_1 / arg_0.cellsPerColumn)

Returns the index of the column that a cell belongs to .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = GeneralLedgerAccount ( arg_1 , None , arg_2 , arg_3 ) arg_0 . accounts . append ( arg_4 ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create an account in the general ledger structure.

        :param name: The account name.
        :param number: The account number.
        :param account_type: The account type.

        :returns: The created account.
        """

        arg_4 = GeneralLedgerAccount(arg_1, None, arg_2, arg_3)
        arg_0.accounts.append(arg_4)
        return arg_4

Create an account in the general ledger structure .


def
Func
(
arg_0
,
arg_1
=
arg_2
.
md5
)
->
str
:
arg_4
=
arg_1
(
)
if
arg_0
.
has_names
:
arg_5
=
arg_0
.
_get_namespace_name_to_encoding
(
desc
=
'getting hash'
)
.
items
(
)
else
:
arg_5
=
arg_0
.
_get_namespace_identifier_to_encoding
(
desc
=
'getting hash'
)
.
items
(
)
for
arg_6
,
arg_7
in
arg_5
:
arg_4
.
update
(
f'{name}:{encoding}'
.
encode
(
'utf8'
)
)
return
arg_4
.
hexdigest
(
)

def Func(arg_0, arg_1=arg_2.md5) -> str:
        """Get the namespace hash.

        Defaults to MD5.
        """
        arg_4 = arg_1()

        if arg_0.has_names:
            arg_5 = arg_0._get_namespace_name_to_encoding(desc='getting hash').items()
        else:
            arg_5 = arg_0._get_namespace_identifier_to_encoding(desc='getting hash').items()

        for arg_6, arg_7 in arg_5:
            arg_4.update(f'{name}:{encoding}'.encode('utf8'))
        return arg_4.hexdigest()


def
Func
(
arg_0
,
**
arg_1
)
:
arg_2
=
int
(
arg_1
.
get
(
'limit'
,
288
)
)
arg_3
=
arg_1
.
get
(
'end_date'
,
False
)
if
arg_3
and
isinstance
(
arg_3
,
datetime
.
datetime
)
:
arg_3
=
arg_0
.
convert_datetime
(
arg_3
)
if
arg_0
.
mac_address
is
not
:
arg_4
=
'devices/%s'
%
arg_0
.
mac_address
arg_0
.
api_instance
.
log
(
'SERVICE ADDRESS: %s'
%
arg_4
)
arg_5
=
dict
(
arg_2
=
arg_2
)
if
arg_3
:
arg_5
.
update
(
{
'endDate'
:
arg_3
}
)
arg_0
.
api_instance
.
log
(
'DATA:'
)
arg_0
.
api_instance
.
log
(
arg_5
)
return
arg_0
.
api_instance
.
api_call
(
arg_4
,
**
arg_5
)

def Func(arg_0, **arg_1):
        """
        Get the data for a specific device for a specific end date

        Keyword Arguments:
            limit - max 288
            end_date - is Epoch in milliseconds

        :return:
        """
        arg_2 = int(arg_1.get('limit', 288))
        arg_3 = arg_1.get('end_date', False)

        if arg_3 and isinstance(arg_3, datetime.datetime):
            arg_3 = arg_0.convert_datetime(arg_3)

        if arg_0.mac_address is not None:
            arg_4 = 'devices/%s' % arg_0.mac_address
            arg_0.api_instance.log('SERVICE ADDRESS: %s' % arg_4)

            arg_5 = dict(arg_2=arg_2)

            # If endDate is left blank (not passed in), the most recent results will be returned.
            if arg_3:
                arg_5.update({'endDate': arg_3})

            arg_0.api_instance.log('DATA:')
            arg_0.api_instance.log(arg_5)

            return arg_0.api_instance.api_call(arg_4, **arg_5)


def Func(arg_0, arg_1, arg_2):
        """
        Reads the "pre-assign" or "post-assign" tag from the given node.

        start_node -- the xml node (xml.dom.minidom.Node)
        """
        arg_3 = arg_2.getAttribute('name')
        arg_4 = arg_2.getAttribute('field')
        arg_5 = arg_2.getAttribute('value')
        arg_6 = {}
        if arg_3 == '':
            _exc('name attribute required')
        if arg_4 != '' and arg_5 != '':
            _exc('Both, field and right-value attributes found')
        elif arg_4 == '' and arg_5 == '':
            _exc('field or value attribute required')
        elif arg_5 != '':
            arg_6['right'] = arg_5
        else:
            arg_6['right_attribute'] = arg_4
        return operators.Assign(arg_3, **arg_6)

Reads the pre - assign or post - assign tag from the given node .


def Func ( arg_0 , arg_1 , arg_2 ) : if not PyFunceble . CONFIGURATION [ "no_files" ] : if not isinstance ( arg_1 , dict ) : arg_1 = { } Dict ( arg_1 ) . to_json ( arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Write the content into the given file.

        :param content: The dict to write.
        :type content: dict

        :param file: The file to write.
        :type file: str
        """

        if not PyFunceble.CONFIGURATION["no_files"]:
            if not isinstance(arg_1, dict):
                arg_1 = {}

            Dict(arg_1).to_json(arg_2)


def Func(arg_0, arg_1):
        """ Sends hold command to all managers which are in a specific block

        Parameters
        ----------
        block_id : str
             Block identifier of the block to be put on hold
        """

        arg_2 = arg_0.connected_managers

        for arg_3 in arg_2:
            if arg_3['block_id'] == arg_1:
                logger.debug("[HOLD_BLOCK]: Sending hold to manager:{}".format(arg_3['manager']))
                arg_0.hold_worker(arg_3['manager'])


def Func ( arg_0 , arg_1 ) : arg_2 = SitePackagesDir ( ) arg_3 = arg_2 and os . path . commonprefix ( [ arg_2 , arg_1 ] ) != arg_2 for arg_4 , arg_5 , arg_6 in os . Func ( arg_1 , topdown = True ) : arg_5 [ : ] = [ d for d in arg_5 if d [ 0 ] != '.' and d [ 0 ] != "_" ] if arg_3 : arg_5 [ : ] = [ d for d in arg_5 if not d . startswith ( arg_2 ) ] yield arg_4 , arg_5 , arg_6

def Func(arg_0, arg_1):
        """Walk all the directories of basedir except hidden directories

        :param basedir: string, the directory to Func
        :returns: generator, same as os.Func
        """
        arg_2 = SitePackagesDir()
        arg_3 = arg_2 and os.path.commonprefix([arg_2, arg_1]) != arg_2

        for arg_4, arg_5, arg_6 in os.Func(arg_1, topdown=True):
            # ignore dot directories and private directories (start with underscore)
            arg_5[:] = [d for d in arg_5 if d[0] != '.' and d[0] != "_"]

            if arg_3:
                arg_5[:] = [d for d in arg_5 if not d.startswith(arg_2)]

            yield arg_4, arg_5, arg_6

Walk all the directories of basedir except hidden directories

        :param basedir: string, the directory to walk
        :returns: generator, same as os.walk


def Func ( arg_0 , arg_1 = None ) : arg_2 = util . get_object ( obj = arg_0 , predefined_objects = tensorforce . core . memories . memories , arg_1 = arg_1 ) assert isinstance ( arg_2 , Memory ) return arg_2

def Func(arg_0, arg_1=None):
        """
        Creates a memory from a specification dict.
        """
        arg_2 = util.get_object(
            obj=arg_0,
            predefined_objects=tensorforce.core.memories.memories,
            arg_1=arg_1
        )
        assert isinstance(arg_2, Memory)
        return arg_2

Creates a memory from a specification dict .


def Func(arg_0, arg_1):
        """Create a brand new archive.

         Call this method to Func a new and empty archive. It will initialize
         the storage file in the path defined by `archive_path`.

        :param archive_path: absolute path where the archive file will be Funcd

        :raises ArchiveError: when the archive file already exists
        """
        if os.path.exists(arg_1):
            arg_2 = "archive %s already exists; remove it before creating a new one"
            raise ArchiveError(cause=arg_2 % (arg_1))

        arg_3 = sqlite3.connect(arg_1)

        arg_4 = arg_3.cursor()
        arg_4.execute(arg_0.METADATA_CREATE_STMT)
        arg_4.execute(arg_0.ARCHIVE_CREATE_STMT)
        arg_3.commit()

        arg_4.close()
        arg_3.close()

        logger.debug("Creating archive %s", arg_1)
        arg_5 = arg_0(arg_1)
        logger.debug("Achive %s was Funcd", arg_1)

        return arg_5

Create a brand new archive.

         Call this method to create a new and empty archive. It will initialize
         the storage file in the path defined by `archive_path`.

        :param archive_path: absolute path where the archive file will be created

        :raises ArchiveError: when the archive file already exists


def Func ( arg_0 ) : if hasattr ( arg_0 , 'rollbar_person' ) : arg_1 = arg_0 . rollbar_person try : arg_2 = arg_1 ( ) except TypeError : arg_2 = arg_1 if arg_2 and isinstance ( arg_2 , dict ) : return arg_2 else : return None if hasattr ( arg_0 , 'user' ) : arg_3 = arg_0 . user try : arg_4 = arg_3 ( ) except TypeError : arg_4 = arg_3 if not arg_4 : return None elif isinstance ( arg_4 , dict ) : return arg_4 else : arg_5 = { } if getattr ( arg_4 , 'id' , None ) : arg_5 [ 'id' ] = text ( arg_4 . id ) elif getattr ( arg_4 , 'user_id' , None ) : arg_5 [ 'id' ] = text ( arg_4 . user_id ) if arg_5 . get ( 'id' ) : arg_6 = getattr ( arg_4 , 'username' , None ) arg_7 = getattr ( arg_4 , 'email' , None ) arg_5 . update ( { 'username' : arg_6 , 'email' : arg_7 } ) return arg_5 if hasattr ( arg_0 , 'user_id' ) : arg_8 = arg_0 . user_id try : arg_9 = arg_8 ( ) except TypeError : arg_9 = arg_8 if not arg_9 : return None return { 'id' : text ( arg_9 ) }

def Func(arg_0):
    """
    Returns a dictionary describing the logged-in user using data from `request.

    Try request.rollbar_person first, then 'user', then 'user_id'
    """
    if hasattr(arg_0, 'rollbar_person'):
        arg_1 = arg_0.rollbar_person
        try:
            arg_2 = arg_1()
        except TypeError:
            arg_2 = arg_1

        if arg_2 and isinstance(arg_2, dict):
            return arg_2
        else:
            return None

    if hasattr(arg_0, 'user'):
        arg_3 = arg_0.user
        try:
            arg_4 = arg_3()
        except TypeError:
            arg_4 = arg_3

        if not arg_4:
            return None
        elif isinstance(arg_4, dict):
            return arg_4
        else:
            arg_5 = {}
            if getattr(arg_4, 'id', None):
                arg_5['id'] = text(arg_4.id)
            elif getattr(arg_4, 'user_id', None):
                arg_5['id'] = text(arg_4.user_id)

            # id is required, so only include username/email if we have an id
            if arg_5.get('id'):
                arg_6 = getattr(arg_4, 'username', None)
                arg_7 = getattr(arg_4, 'email', None)
                arg_5.update({
                    'username': arg_6,
                    'email': arg_7
                })
            return arg_5

    if hasattr(arg_0, 'user_id'):
        arg_8 = arg_0.user_id
        try:
            arg_9 = arg_8()
        except TypeError:
            arg_9 = arg_8

        if not arg_9:
            return None
        return {'id': text(arg_9)}

Returns a dictionary describing the logged - in user using data from request .


async def Func(arg_0, arg_1, arg_2: arg_3 = 1):
        """ Shows the player's queue. """
        arg_4 = arg_0.bot.lavalink.players.get(arg_1.guild.id)

        if not arg_4.queue:
            return await arg_1.send('There\'s nothing in the queue! Why not queue something?')

        arg_5 = 10
        arg_6 = math.ceil(len(arg_4.queue) / arg_5)

        arg_7 = (arg_2 - 1) * arg_5
        arg_8 = arg_7 + arg_5

        arg_9 = ''
        for arg_10, arg_11 in enumerate(arg_4.queue[arg_7:arg_8], arg_7=arg_7):
            arg_9 += f'`{index + 1}.` [**{track.title}**]({track.uri})\n'

        arg_12 = discord.Embed(colour=discord.Color.blurple(),
                              description=f'**{len(player.queue)} tracks**\n\n{queue_list}')
        arg_12.set_footer(text=f'Viewing page {page}/{pages}')
        await arg_1.send(arg_12=arg_12)


def Func ( arg_0 ) : if arg_0 . editable : return IsSDist ( arg_0 ) elif arg_0 . link and arg_0 . link . is_wheel : return IsWheel ( arg_0 ) else : return IsSDist ( arg_0 )

def Func(arg_0):
    """Factory to make an abstract dist object.

    Preconditions: Either an editable req with a source_dir, or satisfied_by or
    a wheel link, or a non-editable req with a source_dir.

    :return: A concrete DistAbstraction.
    """
    if arg_0.editable:
        return IsSDist(arg_0)
    elif arg_0.link and arg_0.link.is_wheel:
        return IsWheel(arg_0)
    else:
        return IsSDist(arg_0)

Factory to make an abstract dist object .


def
Func
(
arg_0
)
:
class
K
(
object
)
:
arg_1
=
[
'obj'
]
def
__init__
(
arg_2
,
arg_3
,
*
arg_4
)
:
arg_2
.
obj
=
arg_3
def
__lt__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
<
0
def
__gt__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
>
0
def
__eq__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
==
0
def
__le__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
<=
0
def
__ge__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
>=
0
def
__ne__
(
arg_2
,
arg_5
)
:
return
arg_0
(
arg_2
.
obj
,
arg_5
.
obj
)
!=
0
def
__hash__
(
arg_2
)
:
raise
TypeError
(
'hash not implemented'
)
return
K

def Func(arg_0):
    """Convert a cmp= function into a key= function"""
    class K(object):
        arg_1 = ['obj']
        def __init__(arg_2, arg_3, *arg_4):
            arg_2.obj = arg_3
        def __lt__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) < 0
        def __gt__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) > 0
        def __eq__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) == 0
        def __le__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) <= 0
        def __ge__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) >= 0
        def __ne__(arg_2, arg_5):
            return arg_0(arg_2.obj, arg_5.obj) != 0
        def __hash__(arg_2):
            raise TypeError('hash not implemented')
    return K

Convert a cmp = function into a key = function


def Func(arg_0: arg_1.Symbol) -> "Var":
        """Return the Var currently bound to the name in the namespace specified
        by `ns_qualified_sym`. If no Var is bound to that name, raise an exception.

        This is a utility method to return useful debugging information when code
        refers to an invalid symbol at runtime."""
        arg_3 = Var.find(arg_0)
        if arg_3 is None:
            raise RuntimeException(
                f"Unable to resolve symbol {ns_qualified_sym} in this context"
            )
        return arg_3

Return the Var currently bound to the name in the namespace specified by ns_qualified_sym . If no Var is bound to that name raise an exception .


(cls, x, y, z, formatter=numpy_formatter)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=arg_5):
        """Construct a contour generator from a rectilinear grid.

        Parameters
        ----------
        x : array_like
            x coordinates of each column of `z`.  Must be the same length as
            the number of columns in `z`.  (len(x) == z.shape[1])
        y : array_like
            y coordinates of each row of `z`.  Must be the same length as the
            number of columns in `z`.  (len(y) == z.shape[0])
        z : array_like
            The 2-dimensional rectilinear grid of data to compute contours for.
            Masked arrays are supported.
        formatter : callable
            A conversion function to convert from the internal `Matplotlib`_
            contour format to an external format.  See :ref:`formatters` for
            more information.

        Returns
        -------
        : :class:`QuadContourGenerator`
            Initialized contour generator.

        """
        arg_1 = np.asarray(arg_1, dtype=np.float64)
        arg_2 = np.asarray(arg_2, dtype=np.float64)
        arg_3 = np.ma.asarray(arg_3, dtype=np.float64)
        # Check arguments.
        if arg_1.ndim != 1:
            raise TypeError(
                "'x' must be a 1D array but is a {:d}D array".format(arg_1.ndim))
        if arg_2.ndim != 1:
            raise TypeError(
                "'y' must be a 1D array but is a {:d}D array".format(arg_2.ndim))
        if arg_3.ndim != 2:
            raise TypeError(
                "'z' must be a 2D array but it a {:d}D array".format(arg_3.ndim))
        if arg_1.size != arg_3.shape[1]:
            raise TypeError(
                ("the length of 'x' must be equal to the number of columns in "
                 "'z' but the length of 'x' is {:d} and 'z' has {:d} "
                 "columns").format(arg_1.size, arg_3.shape[1]))
        if arg_2.size != arg_3.shape[0]:
            raise TypeError(
                ("the length of 'y' must be equal to the number of rows in "
                 "'z' but the length of 'y' is {:d} and 'z' has {:d} "
                 "rows").format(arg_2.size, arg_3.shape[0]))
        # Convert to curvilinear format and call constructor.
        arg_2, arg_1 = np.meshgrid(arg_2, arg_1, indexing='ij')
        return arg_0(arg_1, arg_2, arg_3, arg_4)

Construct a contour generator from a rectilinear grid .


def Func ( arg_0 , arg_1 ) : for arg_2 in dir ( arg_1 ) : if arg_2 . startswith ( "__" ) : continue arg_3 = getattr ( arg_1 , arg_2 ) if isinstance ( arg_3 , types . MethodType ) : arg_3 = arg_3 . im_func setattr ( arg_0 , arg_2 , arg_3 ) return arg_1

def Func(arg_0, arg_1):
        """Decorator for Funcg in additional functionality into field type

        Example:

        >>> @Integer.Func
        ... class IntegerPostgresExtensions:
        ...     postgres_type = 'INT'
        ...
        ...     def postgres_dump(self, obj):
        ...         self.dump(obj) + "::integer"

        Is roughly equivalent to:

        >>> Integer.postgres_type = 'INT'
        ...
        ... def postgres_dump(self, obj):
        ...     self.dump(obj) + "::integer"
        ...
        ... Integer.postgres_dump = postgres_dump

        """
        for arg_2 in dir(arg_1):
            if arg_2.startswith("__"):
                # don't copy magic properties
                continue
            arg_3 = getattr(arg_1, arg_2)

            if isinstance(arg_3, types.MethodType):
                # unbound method will cause problems
                # so get the underlying function instead
                arg_3 = arg_3.im_func

            setattr(arg_0, arg_2, arg_3)
        return arg_1

Decorator for mixing in additional functionality into field type

        Example:

        >>> @Integer.mixin
        ... class IntegerPostgresExtensions:
        ...     postgres_type = 'INT'
        ...
        ...     def postgres_dump(self, obj):
        ...         self.dump(obj) + "::integer"

        Is roughly equivalent to:

        >>> Integer.postgres_type = 'INT'
        ...
        ... def postgres_dump(self, obj):
        ...     self.dump(obj) + "::integer"
        ...
        ... Integer.postgres_dump = postgres_dump


return super(ServiceAccountCredentials, self)._to_json(
            strip, to_serialize=to_serialize)

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = copy . copy ( arg_0 . __dict__ ) arg_3 = arg_2 . get ( arg_4 ) if arg_3 is not None : arg_2 [ arg_4 ] = base64 . b64encode ( arg_3 ) return super ( ServiceAccountCredentials , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """Utility function that creates JSON repr. of a credentials object.

        Over-ride is needed since PKCS#12 keys will not in general be JSON
        serializable.

        Args:
            strip: array, An array of names of members to exclude from the
                   JSON.
            to_serialize: dict, (Optional) The properties for this object
                          that will be serialized. This allows callers to
                          modify before serializing.

        Returns:
            string, a JSON representation of this instance, suitable to pass to
            from_json().
        """
        if arg_2 is None:
            arg_2 = copy.copy(arg_0.__dict__)
        arg_3 = arg_2.get(arg_4)
        if arg_3 is not None:
            arg_2[arg_4] = base64.b64encode(arg_3)
        return super(ServiceAccountCredentials, arg_0).Func(
            arg_1, arg_2=arg_2)

Utility function that creates JSON repr . of a credentials object .


def Func(arg_0):
        """Detect the byteorder of stream `ccp4file` and return format character.

        Try all endinaness and alignment options until we find
        something that looks sensible ("MAPS " in the first 4 bytes).

        (The ``machst`` field could be used to obtain endianness, but
        it does not specify alignment.)

        .. SeeAlso::

          :mod:`struct`
        """
        arg_1 = None
        arg_0.seek(52 * 4)
        arg_2 = arg_0.read(4)
        for arg_3 in '@=<>':
            mapstr = struct.unpack(arg_3 + '4s', arg_2)[0].decode('utf-8')
            if mapstr.upper() == 'MAP ':
                arg_1 = arg_3
                break  # Only possible value according to spec.
        else:
            raise TypeError(
                "Cannot decode header --- corrupted or wrong format?")
        arg_0.seek(0)
        return arg_1

Detect the byteorder of stream ccp4file and return format character .


return [x for x in olist if getattr(x, fieldname) == fieldval]

def Func ( arg_0 , arg_1 , arg_2 ) : return [ arg_3 for arg_3 in arg_0 if getattr ( arg_3 , arg_1 ) == arg_2 ]

def Func(arg_0, arg_1, arg_2):
    """
    Returns a list with of the objects in olist that have a fieldname valued as fieldval

    Parameters
    ----------
    olist: list of objects

    fieldname: string

    fieldval: anything

    Returns
    -------
    list of objets
    """
    return [arg_3 for arg_3 in arg_0 if getattr(arg_3, arg_1) == arg_2]


def
Func
(
*
arg_0
)
:
if
arg_0
and
isinstance
(
arg_0
[
0
]
,
dataframe
.
DataFrame
)
:
return
arg_0
[
0
]
.
Func
(
arg_0
[
1
]
,
arg_0
[
2
]
,
*
arg_0
[
3
:
]
)
elif
not
arg_0
:
raise
ValueError
(
"No arguments provided"
)
else
:
return
pipeable
.
Pipeable
(
pipeable
.
PipingMethod
.
MODIFY
,
*
arg_0
)

def Func(*arg_0):
    """
    Pipeable modification method

    Takes either
     - a dataframe and a tuple of arguments required for modification,
     - a tuple of arguments if a dataframe has already been piped into.
    In any case one argument has to be a class that extends callable.

    :Example:

    Func(dataframe, Function, "new_col_name", "old_col_name")

    :Example:

    dataframe >> Func(Function, "new_col_name", "old_col_name")

    :param args: tuple of arguments
    :type args: tuple
    :return: returns a dataframe object
    :rtype: DataFrame
    """

    if arg_0 and isinstance(arg_0[0], dataframe.DataFrame):
        return arg_0[0].Func(arg_0[1], arg_0[2], *arg_0[3:])
    elif not arg_0:
        raise ValueError("No arguments provided")
    else:
        return pipeable.Pipeable(pipeable.PipingMethod.MODIFY, *arg_0)

Pipeable modification method

    Takes either
     - a dataframe and a tuple of arguments required for modification,
     - a tuple of arguments if a dataframe has already been piped into.
    In any case one argument has to be a class that extends callable.

    :Example:

    modify(dataframe, Function, "new_col_name", "old_col_name")

    :Example:

    dataframe >> modify(Function, "new_col_name", "old_col_name")

    :param args: tuple of arguments
    :type args: tuple
    :return: returns a dataframe object
    :rtype: DataFrame

Pipeable modification method Takes either - a dataframe and a tuple of arguments required for modification - a tuple of arguments if a dataframe has already been piped into . In any case one argument has to be a class that extends callable .