def Func ( arg_0 ) : if arg_0 . tab_always_indent : arg_1 = arg_0 . editor . textCursor ( ) if not arg_1 . hasSelection ( ) : arg_1 . select ( arg_1 . LineUnderCursor ) arg_0 . Func_selection ( arg_1 ) else : super ( PyIndenterMode , arg_0 ) . Func ( )

def Func(arg_0):
        """
        Performs an un-indentation
        """
        if arg_0.tab_always_indent:
            arg_1 = arg_0.editor.textCursor()
            if not arg_1.hasSelection():
                arg_1.select(arg_1.LineUnderCursor)
            arg_0.Func_selection(arg_1)
        else:
            super(PyIndenterMode, arg_0).Func()


return self.paginator.paginate_dataframe(dataframe, self.request, view=self)

def Func ( arg_0 , arg_1 ) : if arg_0 . paginator is None : return None return arg_0 . paginator . Func ( arg_1 , arg_0 . request , view = arg_0 )

def Func(arg_0, arg_1):
        """
        Return a single page of results, or `None` if pagination is disabled.
        """
        if arg_0.paginator is None:
            return None
        return arg_0.paginator.Func(arg_1, arg_0.request, view=arg_0)

Return a single page of results or None if pagination is disabled .


def Func ( arg_0 , arg_1 ) : if arg_0 == '__builtin__' and six . PY3 : arg_0 = 'builtins' arg_0 = importlib . import_module ( arg_0 ) return getattr ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
    """
    Evaluate an OpenMath symbol describing a global Python object

    EXAMPLES::

        >>> from openmath.convert_pickle import to_python
        >>> from openmath.convert_pickle  import Func
        >>> Func('math', 'sin')
        <built-in function sin>

        >>> from openmath import openmath as om
        >>> o = om.OMSymbol(cdbase="http://python.org/", cd='math', name='sin')
        >>> to_python(o)
        <built-in function sin>
    """

    # The builtin module has been renamed in python3
    if arg_0 == '__builtin__' and six.PY3:
        arg_0 = 'builtins'
    arg_0 = importlib.import_module(arg_0)
    return getattr(arg_0, arg_1)

Evaluate an OpenMath symbol describing a global Python object

    EXAMPLES::

        >>> from openmath.convert_pickle import to_python
        >>> from openmath.convert_pickle  import load_python_global
        >>> load_python_global('math', 'sin')
        <built-in function sin>

        >>> from openmath import openmath as om
        >>> o = om.OMSymbol(cdbase="http://python.org/", cd='math', name='sin')
        >>> to_python(o)
        <built-in function sin>


def Func ( arg_0 ) : try : return arg_0 . get_argument ( constants . PARAM_CLUSTER ) except tornado . web . MissingArgumentError as e : raise Exception ( e . log_message )

def Func(arg_0):
    """
    Helper function to get request argument.
    Raises exception if argument is missing.
    Returns the cluster argument.
    """
    try:
      return arg_0.get_argument(constants.PARAM_CLUSTER)
    except tornado.web.MissingArgumentError as e:
      raise Exception(e.log_message)

Helper function to get request argument . Raises exception if argument is missing . Returns the cluster argument .


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
False
)
:
arg_1
=
arg_1
or
[
]
arg_3
=
[
" "
.
join
(
arg_0
.
_command
)
]
if
arg_2
else
arg_0
.
_command
arg_4
=
arg_1
+
arg_3
arg_0
.
log
.
info
(
'Running: %s'
,
arg_4
)
arg_5
=
subprocess
.
Popen
(
arg_4
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
STDOUT
,
universal_newlines
=
True
,
close_fds
=
True
,
env
=
os
.
environ
.
copy
(
)
,
preexec_fn
=
os
.
setsid
)
arg_6
=
threading
.
Thread
(
target
=
arg_0
.
_read_task_logs
,
args
=
(
arg_5
.
stdout
,
)
,
)
arg_6
.
daemon
=
True
arg_6
.
start
(
)
return
arg_5

def Func(arg_0, arg_1=None, arg_2=False):
        """
        Run the task command.

        :param run_with: list of tokens to run the task command with e.g. ``['bash', '-c']``
        :type run_with: list
        :param join_args: whether to concatenate the list of command tokens e.g. ``['airflow', 'run']`` vs
            ``['airflow run']``
        :param join_args: bool
        :return: the process that was run
        :rtype: subprocess.Popen
        """
        arg_1 = arg_1 or []
        arg_3 = [" ".join(arg_0._command)] if arg_2 else arg_0._command
        arg_4 = arg_1 + arg_3

        arg_0.log.info('Running: %s', arg_4)
        arg_5 = subprocess.Popen(
            arg_4,
            stdout=subprocess.PIPE,
            stderr=subprocess.STDOUT,
            universal_newlines=True,
            close_fds=True,
            env=os.environ.copy(),
            preexec_fn=os.setsid
        )

        # Start daemon thread to read subprocess logging output
        arg_6 = threading.Thread(
            target=arg_0._read_task_logs,
            args=(arg_5.stdout,),
        )
        arg_6.daemon = True
        arg_6.start()
        return arg_5


def Func ( arg_0 ) : arg_1 = callJavaFunc ( arg_0 . value . Func ) from bigdl . nn . layer import Layer return Layer . of ( arg_1 )

def Func(arg_0):
        """
        Do an optimization.
        """
        arg_1 = callJavaFunc(arg_0.value.Func)
        from bigdl.nn.layer import Layer
        return Layer.of(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_0 . cond_task_specs : if arg_0 . choice is not None and arg_4 not in arg_0 . choice : continue if arg_3 is None : arg_2 . append ( arg_0 . _wf_spec . get_task_spec_from_name ( arg_4 ) ) continue if not arg_3 . _matches ( arg_1 ) : continue arg_2 . append ( arg_0 . _wf_spec . get_task_spec_from_name ( arg_4 ) ) arg_1 . _sync_children ( arg_2 , Task . FUTURE ) for arg_5 in arg_1 . children : arg_5 . task_spec . _update ( arg_5 )

def Func(arg_0, arg_1):
        """
        Runs the task. Should not be called directly.
        Returns True if completed, False otherwise.
        """
        # Find all matching conditions.
        arg_2 = []
        for arg_3, arg_4 in arg_0.cond_task_specs:
            if arg_0.choice is not None and arg_4 not in arg_0.choice:
                continue
            if arg_3 is None:
                arg_2.append(arg_0._wf_spec.get_task_spec_from_name(arg_4))
                continue
            if not arg_3._matches(arg_1):
                continue
            arg_2.append(arg_0._wf_spec.get_task_spec_from_name(arg_4))

        arg_1._sync_children(arg_2, Task.FUTURE)
        for arg_5 in arg_1.children:
            arg_5.task_spec._update(arg_5)

Runs the task . Should not be called directly . Returns True if completed False otherwise .


def Func(arg_0):
        """The remote has closed its end of the endpoint."""
        LOG.debug("Connection remotely closed")
        if arg_0._handler:
            arg_1 = arg_0._pn_connection.remote_condition
            with arg_0._callback_lock:
                arg_0._handler.connection_remote_closed(arg_0, arg_1)

The remote has closed its end of the endpoint .


def Func(arg_0, arg_1):
    """
    Gets template fields for specific operator class.

    :param fullname: Full path to operator class.
        For example: ``airflow.contrib.operators.gcp_vision_operator.CloudVisionProductSetCreateOperator``
    :return: List of template field
    :rtype: list[str]
    """
    arg_2, arg_3 = arg_1.rsplit(".", 1)

    try:
        with mock(arg_0.config.autodoc_mock_imports):
            arg_4 = import_module(arg_2)
    except ImportError:
        raise RoleException("Error loading %s module." % (arg_2, ))

    arg_5 = getattr(arg_4, arg_3)
    if not arg_5:
        raise RoleException("Error finding %s class in %s module." % (arg_3, arg_2))

    arg_6 = getattr(arg_5, "template_fields")

    if not arg_6:
        raise RoleException(
            "Could not find the template fields for %s class in %s module." % (arg_3, arg_2)
        )

    return list(arg_6)

Gets template fields for specific operator class .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tf . broadcast_dynamic_shape ( tf . shape ( input = arg_0 ) [ : arg_2 ] , tf . shape ( input = arg_1 ) [ : - 1 ] ) arg_0 += tf . zeros ( tf . concat ( ( arg_3 , tf . shape ( input = arg_0 ) [ arg_2 : ] ) , arg_2 = 0 ) , dtype = arg_0 . dtype ) arg_1 += tf . zeros ( tf . concat ( ( arg_3 , tf . shape ( input = arg_1 ) [ - 1 : ] ) , arg_2 = 0 ) , dtype = arg_1 . dtype ) return tf . compat . v1 . batch_gather ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2):
  """Like batch_gather, but broadcasts to the left of axis."""
  # batch_gather assumes...
  #   params.shape =  [A1,...,AN, B1,...,BM]
  #   indices.shape = [A1,...,AN, C]
  # which gives output of shape
  #                   [A1,...,AN, C, B1,...,BM]
  # Here we broadcast dims of each to the left of `axis` in params, and left of
  # the rightmost dim in indices, e.g. we can
  # have
  #   params.shape =  [A1,...,AN, B1,...,BM]
  #   indices.shape = [a1,...,aN, C],
  # where ai broadcasts with Ai.

  # leading_bcast_shape is the broadcast of [A1,...,AN] and [a1,...,aN].
  arg_3 = tf.broadcast_dynamic_shape(
      tf.shape(input=arg_0)[:arg_2],
      tf.shape(input=arg_1)[:-1])
  arg_0 += tf.zeros(
      tf.concat((arg_3, tf.shape(input=arg_0)[arg_2:]), arg_2=0),
      dtype=arg_0.dtype)
  arg_1 += tf.zeros(
      tf.concat((arg_3, tf.shape(input=arg_1)[-1:]), arg_2=0),
      dtype=arg_1.dtype)
  return tf.compat.v1.batch_gather(arg_0, arg_1)

Like batch_gather but broadcasts to the left of axis .


def Func(arg_0, arg_1=None):
    """Generate a tag for use with the tag backends.

    The key and value (if there is one) are sanitized according to the
    following rules:

    1. after the first character, all characters must be alphanumeric,
       underscore, minus, period, or slash--invalid characters are converted
       to "_"
    2. lowercase

    If a value is provided, the final tag is `key:value`.

    The final tag must start with a letter. If it doesn't, an "a" is prepended.

    The final tag is truncated to 200 characters.

    If the final tag is "device", "host", or "source", then a "_" will be
    appended the end.

    :arg str key: the key to use
    :arg str value: the value (if any)

    :returns: the final tag

    Examples:

    >>> Func('yellow')
    'yellow'
    >>> Func('rule', 'is_yellow')
    'rule:is_yellow'

    Example with ``incr``:

    >>> import markus
    >>> mymetrics = markus.get_metrics(__name__)

    >>> mymetrics.incr('somekey', value=1,
    ...                tags=[Func('rule', 'is_yellow')])

    """
    # Verify the types
    if not isinstance(arg_0, six.string_types):
        raise ValueError('key must be a string type, but got %r instead' % arg_0)

    if not isinstance(arg_1, six.string_types + (NONE_TYPE,)):
        raise ValueError('value must be None or a string type, but got %r instead' % arg_1)

    # Sanitize the key
    arg_0 = BAD_TAG_CHAR_REGEXP.sub('_', arg_0).strip()

    # Build the tag
    if arg_1 is None or not arg_1.strip():
        arg_2 = arg_0
    else:
        arg_1 = BAD_TAG_CHAR_REGEXP.sub('_', arg_1).strip()
        arg_2 = '%s:%s' % (arg_0, arg_1)

    if arg_2 and not arg_2[0].isalpha():
        arg_2 = 'a' + arg_2

    # Lowercase and truncate
    arg_2 = arg_2.lower()[:200]

    # Add _ if it's a reserved word
    if arg_2 in ['device', 'host', 'source']:
        arg_2 = arg_2 + '_'

    return arg_2

Generate a tag for use with the tag backends.

    The key and value (if there is one) are sanitized according to the
    following rules:

    1. after the first character, all characters must be alphanumeric,
       underscore, minus, period, or slash--invalid characters are converted
       to "_"
    2. lowercase

    If a value is provided, the final tag is `key:value`.

    The final tag must start with a letter. If it doesn't, an "a" is prepended.

    The final tag is truncated to 200 characters.

    If the final tag is "device", "host", or "source", then a "_" will be
    appended the end.

    :arg str key: the key to use
    :arg str value: the value (if any)

    :returns: the final tag

    Examples:

    >>> generate_tag('yellow')
    'yellow'
    >>> generate_tag('rule', 'is_yellow')
    'rule:is_yellow'

    Example with ``incr``:

    >>> import markus
    >>> mymetrics = markus.get_metrics(__name__)

    >>> mymetrics.incr('somekey', value=1,
    ...                tags=[generate_tag('rule', 'is_yellow')])

Generate a tag for use with the tag backends .


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_1 , tf . Tensor ) : return tf . where ( arg_0 , arg_1 , arg_2 ) elif isinstance ( arg_1 , tuple ) : arg_3 = type ( arg_1 ) return arg_3 ( * ( Func ( arg_0 , arg_4 , arg_5 ) for arg_4 , arg_5 in zip ( arg_1 , arg_2 ) ) ) else : raise Exception ( TypeError )

def Func(arg_0, arg_1, arg_2):
  """Like tf.where but works on namedtuples."""
  if isinstance(arg_1, tf.Tensor):
    return tf.where(arg_0, arg_1, arg_2)
  elif isinstance(arg_1, tuple):
    arg_3 = type(arg_1)
    return arg_3(*(Func(arg_0, arg_4, arg_5) for arg_4, arg_5 in zip(arg_1, arg_2)))
  else:
    raise Exception(TypeError)

Like tf . where but works on namedtuples .


def
Func
(
arg_0
,
arg_1
)
:
if
__debug__
:
log
.
info
(
"Connecting SQLAlchemy database layer."
,
extra
=
dict
(
uri
=
redact_uri
(
arg_0
.
uri
)
,
config
=
arg_0
.
config
,
arg_5
=
arg_0
.
alias
,
)
)
arg_2
=
arg_0
.
engine
=
create_engine
(
arg_0
.
uri
,
**
arg_0
.
config
)
arg_0
.
Session
=
scoped_session
(
sessionmaker
(
bind
=
arg_2
)
)
arg_2
.
connect
(
)
.
close
(
)
arg_1
.
db
[
arg_0
.
alias
]
=
arg_2

def Func(arg_0, arg_1):
		"""Construct the SQLAlchemy engine and session factory."""

		if __debug__:
			log.info("Connecting SQLAlchemy database layer.", extra=dict(
					uri = redact_uri(arg_0.uri),
					config = arg_0.config,
					arg_5 = arg_0.alias,
				))

		# Construct the engine.
		arg_2 = arg_0.engine = create_engine(arg_0.uri, **arg_0.config)

		# Construct the session factory.
		arg_0.Session = scoped_session(sessionmaker(bind=arg_2))

		# Test the connection.
		arg_2.connect().close()

		# Assign the engine to our database alias.
		arg_1.db[arg_0.alias] = arg_2

Construct the SQLAlchemy engine and session factory .


(self, path, read_size, cbuf, stop, barrier, cyclic, offset, read_skip, sync)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 ) : import tables as tb arg_10 = tb . open_file ( arg_0 . filename , 'r' , ** arg_0 . h5_kw_args ) arg_11 = arg_10 . get_node ( arg_1 ) arg_12 = arg_7 while not arg_4 . is_set ( ) : arg_13 = arg_11 [ arg_12 : arg_12 + arg_2 ] if arg_12 + arg_2 > len ( arg_11 ) : arg_13 = np . concatenate ( [ arg_13 , arg_11 [ 0 : arg_2 - len ( arg_13 ) ] ] ) if arg_9 is None : with arg_3 . put_direct ( ) as arg_14 : arg_14 [ : ] = arg_13 else : with arg_9 . do ( arg_3 . put_direct ( ) , arg_12 , ( arg_12 + arg_2 ) % len ( arg_11 ) ) as arg_14 : arg_14 [ : ] = arg_13 arg_12 += arg_8 if arg_6 : if arg_12 >= len ( arg_11 ) : arg_12 %= len ( arg_11 ) arg_5 . wait ( ) else : if arg_12 + arg_2 > len ( arg_11 ) : break

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):
    """
    Main function for the processes that read from the HDF5 file.

    :param self: A reference to the streamer object that created these processes.
    :param path: The HDF5 path to the node to be read from.
    :param read_size: The length of the block along the outer dimension to read.
    :param cbuf: The circular buffer to place read elements into.
    :param stop: The Event that signals the process to stop reading.
    :param barrier: The Barrier that synchonises read cycles.
    :param cyclic: True if the process should read cyclically.
    :param offset: Offset into the dataset that this process should start reading at.
    :param read_skip: How many element to skip on each iteration.
    :param sync: GuardSynchonizer to order writes to the buffer.
    :return: Nothing
    """
    # Multi-process access to HDF5 seems to behave better there are no top level imports of PyTables.
    import tables as tb
    arg_10 = tb.open_file(arg_0.filename, 'r', **arg_0.h5_kw_args)
    arg_11 = arg_10.get_node(arg_1)

    arg_12 = arg_7
    while not arg_4.is_set():
        arg_13 = arg_11[arg_12:arg_12 + arg_2]
        # If the read goes off the end of the dataset, then wrap to the start.
        if arg_12 + arg_2 > len(arg_11):
            arg_13 = np.concatenate([arg_13, arg_11[0:arg_2 - len(arg_13)]])

        if arg_9 is None:
            # If no ordering is requested, then just write to the next available space in the buffer.
            with arg_3.put_direct() as arg_14:
                arg_14[:] = arg_13
        else:
            # Otherwise, use the sync object to ensure that writes occur in the order provided by i.
            # So i = 0 will write first, then i = block_size, then i = 2*block_size, etc...
            # The sync object has two ordered barriers so that acquisition and release of the buffer spaces
            # are synchronized in order, but the actual writing to the buffer can happen simultaneously.
            # If only one barrier were used, writing to the buffer would be linearised.
            with arg_9.do(arg_3.put_direct(), arg_12, (arg_12+arg_2) % len(arg_11)) as arg_14:
                arg_14[:] = arg_13

        arg_12 += arg_8
        if arg_6:
            # If the next iteration is past the end of the dataset, wrap it around.
            if arg_12 >= len(arg_11):
                arg_12 %= len(arg_11)
                arg_5.wait()
        else:
            # But if cyclic mode is disabled, break the loop as the work is now done.
            if arg_12 + arg_2 > len(arg_11):
                break

Main function for the processes that read from the HDF5 file .


def Func ( arg_0 , arg_1 = '' ) : return lens . running . set ( False ) ( lens . message . set ( arg_1 ) ( arg_0 ) )

def Func(arg_0, arg_1=''):
        '''Returns a completed game state object, setting an optional
        message to display after the game is over.'''

        return lens.running.set(False)(lens.message.set(arg_1)(arg_0))

Returns a completed game state object setting an optional message to display after the game is over .


def Func(arg_0, arg_1):
        """
        Matches a given Request instance contract against the registered mocks.

        If a mock passes all the Funcers, its response will be returned.

        Arguments:
            request (pook.Request): Request contract to Func.

        Raises:
            pook.PookNoMatches: if networking is disabled and no mock Funces
                with the given request contract.

        Returns:
            pook.Response: the mock response to be used by the interceptor.
        """
        # Trigger engine-level request filters
        for arg_2 in arg_0.filters:
            if not arg_2(arg_1, arg_0):
                return False

        # Trigger engine-level request mappers
        for arg_3 in arg_0.mappers:
            arg_1 = arg_3(arg_1, arg_0)
            if not arg_1:
                raise ValueError('map function must return a request object')

        # Store list of mock Funcing errors for further debugging
        arg_4 = []

        # Try to Func the request against registered mock definitions
        for arg_5 in arg_0.mocks[:]:
            try:
                # Return the first Funced HTTP request mock
                arg_6, arg_7 = arg_5.Func(arg_1.copy())
                if len(arg_7):
                    arg_4 += arg_7
                if arg_6:
                    return arg_5
            except PookExpiredMock:
                # Remove the mock if already expired
                arg_0.mocks.remove(arg_5)

        # Validate that we have a mock
        if not arg_0.should_use_network(arg_1):
            arg_8 = 'pook error!\n\n'

            arg_8 += (
                '=> Cannot Func any mock for the '
                'following request:\n{}'.format(arg_1)
            )

            # Compose unFunc error details, if debug mode is enabled
            if arg_0.debug:
                arg_9 = '\n\n'.join([str(arg_9) for arg_9 in arg_4])
                if arg_9:
                    arg_8 += '\n\n=> Detailed Funcing errors:\n{}\n'.format(arg_9)

            # Raise no Funces exception
            raise PookNoMatches(arg_8)

        # Register unFunced request
        arg_0.unFunced_reqs.append(arg_1)

Matches a given Request instance contract against the registered mocks.

        If a mock passes all the matchers, its response will be returned.

        Arguments:
            request (pook.Request): Request contract to match.

        Raises:
            pook.PookNoMatches: if networking is disabled and no mock matches
                with the given request contract.

        Returns:
            pook.Response: the mock response to be used by the interceptor.

Matches a given Request instance contract against the registered mocks .


def Func(arg_0, arg_1, arg_2):
        """Click the right mouse button with modifiers pressed.

        Parameters: coordinates to click; modifiers (list)
        Returns: None
        """
        arg_3 = arg_0._pressModifiers(arg_2)
        arg_0._queueMouseButton(arg_1, Quartz.kCGMouseButtonRight, arg_3)
        arg_0._releaseModifiers(arg_2)
        arg_0._postQueuedEvents()

Click the right mouse button with modifiers pressed .


def Func ( arg_0 ) : if not arg_0 . size : arg_0 . size = arg_0 . DEFAULT_SIZE return arg_0 . size

def Func(arg_0):
        '''
        If size is not set, otherwise set size to DEFAULT_SIZE
        and return it.

        This means, only the first call to size() is valid.
        '''
        if not arg_0.size:
            arg_0.size = arg_0.DEFAULT_SIZE
        return arg_0.size

If size is not set otherwise set size to DEFAULT_SIZE and return it .


def Func ( arg_0 , arg_1 ) : arg_2 = os . getcwd ( ) os . chdir ( arg_1 ) try : yield finally : os . chdir ( arg_2 )

def Func(arg_0, arg_1):
        """
        go to the path
        """
        arg_2 = os.getcwd()
        os.chdir(arg_1)
        try:
            yield
        finally:
            os.chdir(arg_2)


def Func ( arg_0 ) : @ functools . wraps ( arg_0 ) def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return arg_1 if arg_4 is None else arg_4 return wrapper

def Func(arg_0):
    """
    Simple function decorator allowing easy method chaining.

    Arguments:
        fn (function): target function to decorate.
    """
    @functools.wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        # Trigger method proxy
        arg_4 = arg_0(arg_1, *arg_2, **arg_3)
        # Return self instance or method result
        return arg_1 if arg_4 is None else arg_4
    return wrapper

Simple function decorator allowing easy method chaining .


def Func ( arg_0 , * arg_1 ) : for arg_2 in arg_1 : arg_2 . bundle = arg_0 arg_0 . files . append ( arg_2 )

def Func(arg_0, *arg_1):
        """
        Add custom path objects

        :type: path_object: static_bundle.paths.AbstractPath
        """
        for arg_2 in arg_1:
            arg_2.bundle = arg_0
            arg_0.files.append(arg_2)


return X.map(
            lambda X: super(SparkBaseNB, self).predict_proba(X))

def Func ( arg_0 , arg_1 ) : check_rdd ( arg_1 , ( sp . spmatrix , np . ndarray ) ) return arg_1 . map ( lambda arg_1 : super ( SparkBaseNB , arg_0 ) . Func ( arg_1 ) )

def Func(arg_0, arg_1):
        """
        Return probability estimates for the RDD containing test vector X.

        Parameters
        ----------
        X : RDD containing array-like items, shape = [m_samples, n_features]

        Returns
        -------
        C : RDD with array-like items , shape = [n_samples, n_classes]
            Returns the probability of the samples for each class in
            the models for each RDD block. The columns correspond to the classes
            in sorted order, as they appear in the attribute `classes_`.
        """
        check_rdd(arg_1, (sp.spmatrix, np.ndarray))
        return arg_1.map(
            lambda arg_1: super(SparkBaseNB, arg_0).Func(arg_1))

Return probability estimates for the RDD containing test vector X .


def Func ( arg_0 , arg_1 ) : arg_2 = set ( arg_0 . _prefixes . values ( ) ) arg_2 |= set ( arg_1 . values ( ) ) while True : arg_3 = u"ns{0}" . format ( arg_0 . _next_id ) arg_0 . _next_id += 1 if arg_3 not in arg_2 : break return arg_3

def Func(arg_0, arg_1):
        """Make up a new namespace prefix, which won't conflict
        with `_prefixes` and prefixes declared in the current scope.

        :Parameters:
            - `declared_prefixes`: namespace to prefix mapping for the current
              scope
        :Types:
            - `declared_prefixes`: `unicode` to `unicode` dictionary

        :Returns: a new prefix
        :Returntype: `unicode`
        """
        arg_2 = set(arg_0._prefixes.values())
        arg_2 |= set(arg_1.values())
        while True:
            arg_3 = u"ns{0}".format(arg_0._next_id)
            arg_0._next_id += 1
            if arg_3 not in arg_2:
                break
        return arg_3

Make up a new namespace prefix which won t conflict with _prefixes and prefixes declared in the current scope .


(self, item, variant=VARIANT.MEDIUM, quantity=1)

def Func(arg_0, arg_1, arg_2=arg_3.MEDIUM, arg_5=1):
        '''
        Add an item to the current basket.

        :param Item item: Item from menu.
        :param int variant: Item SKU id. Ignored if the item is a side.
        :param int quantity: The quantity of item to be added.
        :return: A response having added an item to the current basket.
        :rtype: requests.Response
        '''
        arg_6 = arg_1.type

        if arg_6 == 'Pizza':
            return arg_0.add_pizza_to_basket(arg_1, arg_2, arg_5)
        elif arg_6 == 'Side':
            return arg_0.add_side_to_basket(arg_1, arg_5)
        return None


def
Func
(
arg_0
)
:
def
parse
(
arg_1
)
:
arg_1
=
arg_1
.
replace
(
"from PySide2 import"
,
"from Qt import"
)
arg_1
=
arg_1
.
replace
(
"QtWidgets.QApplication.translate"
,
"Qt.QtCompat.translate"
)
return
arg_1
arg_2
=
list
(
)
for
arg_1
in
arg_0
:
arg_1
=
parse
(
arg_1
)
arg_2
.
append
(
arg_1
)
return
arg_2

def Func(arg_0):
    """Convert compiled .ui file from PySide2 to Qt.py

    Arguments:
        lines (list): Each line of of .ui file

    Usage:
        >> with open("myui.py") as f:
        ..   lines = Func(f.readlines())

    """

    def parse(arg_1):
        arg_1 = arg_1.replace("from PySide2 import", "from Qt import")
        arg_1 = arg_1.replace("QtWidgets.QApplication.translate",
                            "Qt.QtCompat.translate")
        return arg_1

    arg_2 = list()
    for arg_1 in arg_0:
        arg_1 = parse(arg_1)
        arg_2.append(arg_1)

    return arg_2

Convert compiled .ui file from PySide2 to Qt.py

    Arguments:
        lines (list): Each line of of .ui file

    Usage:
        >> with open("myui.py") as f:
        ..   lines = convert(f.readlines())

Convert compiled . ui file from PySide2 to Qt . py


def Func ( arg_0 ) : with FakeContext ( arg_0 ) : with SetupMonkey ( ) as sm : try : arg_1 = run_setup ( 'setup.py' , stop_after = 'config' ) arg_2 = { '_setuptools' : sm . used_setuptools } for arg_3 , arg_4 in arg_1 . metadata . __dict__ . items ( ) : if arg_3 [ 0 ] == '_' or not arg_4 : continue if all ( not arg_5 for arg_5 in arg_4 ) : continue arg_2 [ arg_3 ] = arg_4 if sm . used_setuptools : for arg_6 in [ 'cmdclass' , 'zip_safe' , 'test_suite' ] : arg_4 = getattr ( arg_1 , arg_6 , None ) if arg_4 is not None and arg_4 not in ( [ ] , { } ) : arg_2 [ arg_6 ] = arg_4 except ImportError as e : logging . exception ( e ) arg_2 = { } return arg_2

def Func(arg_0):
    """
    Returns data from a package directory.
    'path' should be an absolute path.
    """
    # Run the imported setup to get the metadata.
    with FakeContext(arg_0):
        with SetupMonkey() as sm:
            try:
                arg_1 = run_setup('setup.py', stop_after='config')

                arg_2 = {'_setuptools': sm.used_setuptools}

                for arg_3, arg_4 in arg_1.metadata.__dict__.items():
                    if arg_3[0] == '_' or not arg_4:
                        continue
                    if all(not arg_5 for arg_5 in arg_4):
                        continue
                    arg_2[arg_3] = arg_4

                if sm.used_setuptools:
                    for arg_6 in ['cmdclass', 'zip_safe', 'test_suite']:
                        arg_4 = getattr(arg_1, arg_6, None)
                        if arg_4 is not None and arg_4 not in ([], {}):
                            arg_2[arg_6] = arg_4

            except ImportError as e:
                # Either there is no setup py, or it's broken.
                logging.exception(e)
                arg_2 = {}

    return arg_2

Returns data from a package directory . path should be an absolute path .


return default if item is default else item[0]

def Func(arg_0, arg_1, arg_2=arg_3):
        """Get predecessor to key, raises KeyError if key is min key
        or key does not exist.
        """
        arg_4 = arg_0.prev_item(arg_1, arg_2)
        return arg_2 if arg_4 is arg_2 else arg_4[0]

Get predecessor to key raises KeyError if key is min key or key does not exist .


def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 ) arg_3 = np . random . random_integers ( 0 , arg_2 - 1 , 1 ) [ 0 ] arg_4 = copy . deepcopy ( arg_0 [ arg_3 ] ) if arg_1 == 0 : return arg_4 return modifyBits ( arg_4 , arg_1 )

def Func(arg_0, arg_1):
  """ Returns a random selection from the inputSpace with randomly modified
  up to maxChanges number of bits.
  """
  arg_2 = len(arg_0)
  arg_3 = np.random.random_integers(0, arg_2-1, 1)[0]

  arg_4 = copy.deepcopy(arg_0[arg_3])

  if arg_1 == 0:
    return arg_4

  return modifyBits(arg_4, arg_1)

Returns a random selection from the inputSpace with randomly modified up to maxChanges number of bits .


return next((self._sanitize(branch)
                     for branch in self._git.branch(color="never").splitlines()
                     if branch.startswith('*')),
                    None)

def Func ( arg_0 ) : return next ( ( arg_0 . _sanitize ( arg_1 ) for arg_1 in arg_0 . _git . branch ( color = "never" ) . splitlines ( ) if arg_1 . startswith ( '*' ) ) , None )

def Func(arg_0):
        """Returns the currently active branch"""
        return next((arg_0._sanitize(arg_1)
                     for arg_1 in arg_0._git.branch(color="never").splitlines()
                     if arg_1.startswith('*')),
                    None)


def Func(arg_0):
    """Encode a string using Base32.

    s is the string to encode.  The encoded string is returned.
    """
    arg_1 = []
    arg_2, arg_3 = divmod(len(arg_0), 5)
    # Pad the last quantum with zero bits if necessary
    if arg_3:
        arg_0 += ('\0' * (5 - arg_3))
        arg_2 += 1
    for arg_4 in range(arg_2):
        # c1 and c2 are 16 bits wide, c3 is 8 bits wide.  The intent of this
        # code is to process the 40 bits in units of 5 bits.  So we take the 1
        # leftover bit of c1 and tack it onto c2.  Then we take the 2 leftover
        # bits of c2 and tack them onto c3.  The shifts and masks are intended
        # to give us values of exactly 5 bits in width.
        arg_5, arg_6, arg_7 = struct.unpack('!HHB', arg_0[arg_4*5:(arg_4+1)*5])
        arg_6 += (arg_5 & 1) << 16 # 17 bits wide
        arg_7 += (arg_6 & 3) << 8  # 10 bits wide
        arg_1.extend([_b32tab[arg_5 >> 11],         # bits 1 - 5
                      _b32tab[(arg_5 >> 6) & 0x1f], # bits 6 - 10
                      _b32tab[(arg_5 >> 1) & 0x1f], # bits 11 - 15
                      _b32tab[arg_6 >> 12],         # bits 16 - 20 (1 - 5)
                      _b32tab[(arg_6 >> 7) & 0x1f], # bits 21 - 25 (6 - 10)
                      _b32tab[(arg_6 >> 2) & 0x1f], # bits 26 - 30 (11 - 15)
                      _b32tab[arg_7 >> 5],          # bits 31 - 35 (1 - 5)
                      _b32tab[arg_7 & 0x1f],        # bits 36 - 40 (1 - 5)
                      ])
    arg_8 = EMPTYSTRING.join(arg_1)
    # Adjust for any leftover partial quanta
    if arg_3 == 1:
        return arg_8[:-6] + '======'
    elif arg_3 == 2:
        return arg_8[:-4] + '===='
    elif arg_3 == 3:
        return arg_8[:-3] + '==='
    elif arg_3 == 4:
        return arg_8[:-1] + '='
    return arg_8


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _perform_request ( url = '/um/groups/%s/users/%s' % ( arg_1 , arg_2 ) , method = 'DELETE' ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Removes a user from a group.

        :param      group_id: The unique ID of the group.
        :type       group_id: ``str``

        :param      user_id: The unique ID of the user.
        :type       user_id: ``str``

        """
        arg_3 = arg_0._perform_request(
            url='/um/groups/%s/users/%s' % (arg_1, arg_2),
            method='DELETE')

        return arg_3


(self, make_ndx_output, message=None, err=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Simple tests to flag problems with a ``make_ndx`` run."""
        if arg_2 is None:
            arg_2 = ""
        else:
            arg_2 = '\n' + arg_2
        def format(arg_4, arg_5=60):
            arg_6 = "====[ GromacsError (diagnostic output) ]".ljust(arg_5,"=")
            return arg_6 + '\n' + str(arg_4) + arg_6

        arg_7 = True
        if arg_0._is_empty_group(arg_1):
            warnings.warn("Selection produced empty group.{message!s}".format(**vars()), category=GromacsValueWarning)
            arg_7 = False
        if arg_0._has_syntax_error(arg_1):
            arg_7 = False
            arg_8 = format(arg_1)
            raise GromacsError("make_ndx encountered a Syntax Error, "
                               "%(message)s\noutput:\n%(out_formatted)s" % vars())
        if arg_1.strip() == "":
            arg_7 = False
            arg_8 = format(arg_3)
            raise GromacsError("make_ndx produced no output, "
                               "%(message)s\nerror output:\n%(out_formatted)s" % vars())
        return arg_7

Simple tests to flag problems with a make_ndx run .


def Func ( arg_0 : arg_1 ) -> bool : arg_2 = urlsplit ( arg_0 ) arg_3 : arg_1 = arg_2 . scheme arg_4 : arg_1 = arg_2 . netloc arg_5 : arg_1 = arg_2 . path try : arg_6 = arg_2 . port except ValueError : arg_6 = None arg_7 = ( arg_3 . lower ( ) == 'https' and arg_4 . lower ( ) . split ( ':' ) [ 0 ] == 's3.amazonaws.com' and arg_5 . startswith ( '/echo.api/' ) and ( arg_6 == 443 or arg_6 is None ) ) return arg_7

def Func(arg_0: arg_1) -> bool:
    """Verify signature certificate URL against Amazon Alexa requirements.

    Each call of Agent passes incoming utterances batch through skills filter,
    agent skills, skills processor. Batch of dialog IDs can be provided, in
    other case utterances indexes in incoming batch are used as dialog IDs.

    Args:
        url: Signature certificate URL from SignatureCertChainUrl HTTP header.

    Returns:
        result: True if verification was successful, False if not.
    """
    arg_2 = urlsplit(arg_0)

    arg_3: arg_1 = arg_2.scheme
    arg_4: arg_1 = arg_2.netloc
    arg_5: arg_1 = arg_2.path

    try:
        arg_6 = arg_2.port
    except ValueError:
        arg_6 = None

    arg_7 = (arg_3.lower() == 'https' and
              arg_4.lower().split(':')[0] == 's3.amazonaws.com' and
              arg_5.startswith('/echo.api/') and
              (arg_6 == 443 or arg_6 is None))

    return arg_7

Verify signature certificate URL against Amazon Alexa requirements .


def Func(arg_0):
        """
        Closes the worker. No more jobs will be handled by the worker, and any
        running job is immediately returned to the job manager.
        """

        if arg_0._Funcd:
            return

        arg_0._Funcd = True

        if arg_0._job is not None:
            arg_0._manager.return_job(arg_0._job)
            arg_0._job = None

Closes the worker . No more jobs will be handled by the worker and any running job is immediately returned to the job manager .


return (self.marathon_client.get_apps()
                .addCallback(self._apps_acme_domains)
                .addCallback(self._filter_new_domains)
                .addCallback(self._issue_certs)
                .addCallbacks(log_success, log_failure))

def
Func
(
arg_0
)
:
arg_0
.
log
.
info
(
'Starting a Func...'
)
def
log_success
(
arg_1
)
:
arg_0
.
log
.
info
(
'Sync completed successfully'
)
return
arg_1
def
log_failure
(
arg_2
)
:
arg_0
.
log
.
failure
(
'Sync failed'
,
arg_2
,
LogLevel
.
error
)
return
arg_2
return
(
arg_0
.
marathon_client
.
get_apps
(
)
.
addCallback
(
arg_0
.
_apps_acme_domains
)
.
addCallback
(
arg_0
.
_filter_new_domains
)
.
addCallback
(
arg_0
.
_issue_certs
)
.
addCallbacks
(
log_success
,
log_failure
)
)

def Func(arg_0):
        """
        Fetch the list of apps from Marathon, find the domains that require
        certificates, and issue certificates for any domains that don't already
        have a certificate.
        """
        arg_0.log.info('Starting a Func...')

        def log_success(arg_1):
            arg_0.log.info('Sync completed successfully')
            return arg_1

        def log_failure(arg_2):
            arg_0.log.failure('Sync failed', arg_2, LogLevel.error)
            return arg_2

        return (arg_0.marathon_client.get_apps()
                .addCallback(arg_0._apps_acme_domains)
                .addCallback(arg_0._filter_new_domains)
                .addCallback(arg_0._issue_certs)
                .addCallbacks(log_success, log_failure))

Fetch the list of apps from Marathon find the domains that require certificates and issue certificates for any domains that don t already have a certificate .


(filename, clean_lines, linenum, nesting_state, error)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
  """Checks for the correctness of various spacing issues in the code.

  Things we check for: spaces around operators, spaces after
  if/for/while/switch, no spaces around parens in function calls, two
  spaces between code and comment, don't start a block with a blank
  line, don't end a function with a blank line, don't add a blank line
  after public/protected/private, don't have too many blank lines in a row.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    nesting_state: A NestingState instance which maintains information about
                   the current stack of nested blocks being parsed.
    error: The function to call with any errors found.
  """

  # Don't use "elided" lines here, otherwise we can't check commented lines.
  # Don't want to use "raw" either, because we don't want to check inside C++11
  # raw strings,
  arg_5 = arg_1.lines_without_raw_strings
  arg_6 = arg_5[arg_2]

  # Before nixing comments, check if the line is blank for no good
  # reason.  This includes the first line after a block is opened, and
  # blank lines at the end of a function (ie, right before a line like '}'
  #
  # Skip all the blank line checks if we are immediately inside a
  # namespace body.  In other words, don't issue blank line warnings
  # for this block:
  #   namespace {
  #
  #   }
  #
  # A warning about missing end of namespace comments will be issued instead.
  #
  # Also skip blank line checks for 'extern "C"' blocks, which are formatted
  # like namespaces.
  if (IsBlankLine(arg_6) and
      not arg_3.InNamespaceBody() and
      not arg_3.InExternC()):
    arg_7 = arg_1.elided
    arg_8 = arg_7[arg_2 - 1]
    arg_9 = arg_8.rfind('{')
    # TODO(unknown): Don't complain if line before blank line, and line after,
    #                both start with alnums and are indented the same amount.
    #                This ignores whitespace at the start of a namespace block
    #                because those are not usually indented.
    if arg_9 != -1 and arg_8[arg_9:].find('}') == -1:
      # OK, we have a blank line at the start of a code block.  Before we
      # complain, we check if it is an exception to the rule: The previous
      # non-empty line has the parameters of a function header that are indented
      # 4 spaces (because they did not fit in a 80 column line when placed on
      # the same line as the function name).  We also check for the case where
      # the previous line is indented 6 spaces, which may happen when the
      # initializers of a constructor do not fit into a 80 column line.
      arg_10 = False
      if Match(r' {6}\w', arg_8):  # Initializer list?
        # We are looking for the opening column of initializer list, which
        # should be indented 4 spaces to cause 6 space indentation afterwards.
        arg_11 = arg_2-2
        while (arg_11 >= 0
               and Match(r' {6}\w', arg_7[arg_11])):
          arg_11 -= 1
        arg_10 = (arg_11 >= 0
                     and arg_7[arg_11][:5] == '    :')
      else:
        # Search for the function arguments or an initializer list.  We use a
        # simple heuristic here: If the line is indented 4 spaces; and we have a
        # closing paren, without the opening paren, followed by an opening brace
        # or colon (for initializer lists) we assume that it is the last line of
        # a function header.  If we have a colon indented 4 spaces, it is an
        # initializer list.
        arg_10 = (Match(r' {4}\w[^\(]*\)\s*(const\s*)?(\{\s*$|:)',
                           arg_8)
                     or Match(r' {4}:', arg_8))

      if not arg_10:
        arg_4(arg_0, arg_2, 'whitespace/blank_line', 2,
              'Redundant blank line at the start of a code block '
              'should be deleted.')
    # Ignore blank lines at the end of a block in a long if-else
    # chain, like this:
    #   if (condition1) {
    #     // Something followed by a blank line
    #
    #   } else if (condition2) {
    #     // Something else
    #   }
    if arg_2 + 1 < arg_1.NumLines():
      arg_12 = arg_5[arg_2 + 1]
      if (arg_12
          and Match(r'\s*}', arg_12)
          and arg_12.find('} else ') == -1):
        arg_4(arg_0, arg_2, 'whitespace/blank_line', 3,
              'Redundant blank line at the end of a code block '
              'should be deleted.')

    arg_13 = Match(r'\s*(public|protected|private):', arg_8)
    if arg_13:
      arg_4(arg_0, arg_2, 'whitespace/blank_line', 3,
            'Do not leave a blank line after "%s:"' % arg_13.group(1))

  # Next, check comments
  arg_14 = 0
  if arg_2 + 1 < arg_1.NumLines():
    arg_12 = arg_5[arg_2 + 1]
    arg_14 = len(arg_12) - len(arg_12.lstrip())
  CheckComment(arg_6, arg_0, arg_2, arg_14, arg_4)

  # get rid of comments and strings
  arg_6 = arg_1.elided[arg_2]

  # You shouldn't have spaces before your brackets, except maybe after
  # 'delete []' or 'return []() {};'
  if Search(r'\w\s+\[', arg_6) and not Search(r'(?:delete|return)\s+\[', arg_6):
    arg_4(arg_0, arg_2, 'whitespace/braces', 5,
          'Extra space before [')

  # In range-based for, we wanted spaces before and after the colon, but
  # not around "::" tokens that might appear.
  if (Search(r'for *\(.*[^:]:[^: ]', arg_6) or
      Search(r'for *\(.*[^: ]:[^:]', arg_6)):
    arg_4(arg_0, arg_2, 'whitespace/forcolon', 2,
          'Missing space around colon in range-based for loop')

Checks for the correctness of various spacing issues in the code .


return sum([x*p for x,p in pred.items()])

def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) == 1 : return arg_1 . keys ( ) [ 0 ] return sum ( [ arg_2 * arg_3 for arg_2 , arg_3 in arg_1 . items ( ) ] )

def Func(arg_0, arg_1):
    """ Helper function to return a scalar value representing the expected
        value of a probability distribution
    """
    if len(arg_1) == 1:
      return arg_1.keys()[0]

    return sum([arg_2*arg_3 for arg_2,arg_3 in arg_1.items()])


return self.request(path, method, call_params)

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

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


def Func(arg_0, arg_1):
    """Parse any frequency from the info dict

    Args:
        variant(cyvcf2.Variant)
        info_key(str)

    Returns:
        frequency(float): or None if frequency does not exist
    """
    arg_2 = arg_0.INFO.get(arg_1)
    arg_2 = None if arg_2 == '.' else arg_2
    arg_3 = float(arg_2) if arg_2 else None
    return arg_3


def Func(arg_0, arg_1):
        ''' Returns the data Func for the table. '''

        for arg_2 in arg_0._data:
            yield [
                arg_0.cell_text(arg_1, arg_3, arg_4)
                for arg_3, arg_4 in enumerate(arg_2)
            ]


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . filter_by_include_labels ( arg_1 ) arg_3 = arg_0 . filter_wo_labels ( arg_1 ) arg_4 = set ( [ f [ "number" ] for f in arg_2 ] ) arg_5 = set ( [ w [ "number" ] for w in arg_3 ] ) arg_6 = [ ] for arg_7 in arg_1 : if arg_7 [ "number" ] in arg_4 or arg_7 [ "number" ] in arg_5 : arg_6 . append ( arg_7 ) return arg_6

def Func(arg_0, arg_1):
        """
        Include issues with labels, specified in self.options.include_labels.

        :param list(dict) all_issues: All issues.
        :rtype: list(dict)
        :return: Filtered issues.
        """

        arg_2 = arg_0.filter_by_include_labels(arg_1)
        arg_3 = arg_0.filter_wo_labels(arg_1)
        arg_4 = set([f["number"] for f in arg_2])
        arg_5 = set([w["number"] for w in arg_3])
        arg_6 = []
        for arg_7 in arg_1:
            if arg_7["number"] in arg_4 or arg_7["number"] in arg_5:
                arg_6.append(arg_7)
        return arg_6

Include issues with labels specified in self . options . include_labels .


(a, b, inclusive_min=True, inclusive_max=True)

return RangeValue(a, b,
                      inclusive_min=inclusive_min, inclusive_max=inclusive_max)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : return RangeValue ( arg_0 , arg_1 , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
    """
    Indicate that value is a numeric range
    """
    return RangeValue(arg_0, arg_1,
                      arg_2=arg_2, arg_3=arg_3)


(self, folder_id=None, sha1=None, httponly=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False ) : arg_4 = { 'folder' : arg_1 , 'sha1' : arg_2 , 'httponly' : arg_3 } arg_5 = { key : value for key , value in arg_4 . items ( ) if value } return arg_0 . _get ( 'file/ul' , arg_5 = arg_5 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False):
        """Makes a request to prepare for file upload.

        Note:
            If folder_id is not provided, it will make and upload link to the ``Home`` folder.

        Args:
            folder_id (:obj:`str`, optional): folder-ID to upload to.
            sha1 (:obj:`str`, optional): expected sha1 If sha1 of uploaded file doesn't match this value, upload fails.
            httponly (:obj:`bool`, optional): If this is set to true, use only http upload links.

        Returns:
            dict: dictionary containing (url: will be used in actual upload, valid_until). ::

                {
                    "url": "https://1fiafqj.oloadcdn.net/uls/nZ8H3X9e0AotInbU",
                    "valid_until": "2017-08-19 19:06:46"
                }

        """

        arg_4 = {'folder': arg_1, 'sha1': arg_2, 'httponly': arg_3}
        arg_5 = {key: value for key, value in arg_4.items() if value}
        return arg_0._get('file/ul', arg_5=arg_5)

Makes a request to prepare for file upload .


def
Func
(
arg_0
)
:
for
arg_1
in
[
get_ipython_dir
(
)
,
os
.
getcwdu
(
)
]
:
for
arg_2
in
list_profiles_in
(
arg_1
)
:
arg_3
=
arg_0
.
get_profile_dir
(
arg_2
,
arg_1
)
if
arg_2
not
in
arg_0
.
profiles
:
arg_0
.
log
.
debug
(
"Adding cluster profile '%s'"
%
arg_2
)
arg_0
.
profiles
[
arg_2
]
=
{
'profile'
:
arg_2
,
'profile_dir'
:
arg_3
,
'status'
:
'stopped'
}

def Func(arg_0):
        """List all profiles in the ipython_dir and cwd.
        """
        for arg_1 in [get_ipython_dir(), os.getcwdu()]:
            for arg_2 in list_profiles_in(arg_1):
                arg_3 = arg_0.get_profile_dir(arg_2, arg_1)
                if arg_2 not in arg_0.profiles:
                    arg_0.log.debug("Adding cluster profile '%s'" % arg_2)
                    arg_0.profiles[arg_2] = {
                        'profile': arg_2,
                        'profile_dir': arg_3,
                        'status': 'stopped'
                    }

List all profiles in the ipython_dir and cwd .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : super ( Deposit , arg_0 ) . Func ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Clear only drafts.

        Status required: ``'draft'``.

        Meta information inside `_deposit` are preserved.
        """
        super(Deposit, arg_0).Func(*arg_1, **arg_2)


def Func(arg_0, arg_1, arg_2):
        """
        Deletes an object from the bucket.

        :param bucket_name: name of the bucket, where the object resides
        :type bucket_name: str
        :param object_name: name of the object to Func
        :type object_name: str
        """
        arg_3 = arg_0.get_conn()
        arg_4 = arg_3.get_bucket(arg_1=arg_1)
        arg_5 = arg_4.blob(blob_name=arg_2)
        arg_5.Func()

        arg_0.log.info('Blob %s Funcd.', arg_2)

Deletes an object from the bucket.

        :param bucket_name: name of the bucket, where the object resides
        :type bucket_name: str
        :param object_name: name of the object to delete
        :type object_name: str


(self, k, wait=False, wait_index=False, timeout='5m')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
arg_3
=
False
,
arg_4
=
'5m'
)
:
arg_1
=
arg_1
.
lstrip
(
'/'
)
arg_5
=
'{}/{}'
.
format
(
arg_0
.
endpoint
,
arg_1
)
arg_6
=
{
}
if
arg_2
:
arg_6
[
'index'
]
=
arg_3
arg_6
[
'wait'
]
=
arg_4
arg_7
=
requests
.
Func
(
arg_5
,
arg_6
=
arg_6
)
if
arg_7
.
status_code
==
404
:
raise
KeyDoesNotExist
(
"Key "
+
arg_1
+
" does not exist"
)
if
arg_7
.
status_code
!=
200
:
raise
KVStoreError
(
'GET returned {}'
.
format
(
arg_7
.
status_code
)
)
try
:
return
base64
.
b64decode
(
arg_7
.
json
(
)
[
0
]
[
'Value'
]
)
except
TypeError
as
e
:
return
""

def Func(arg_0, arg_1, arg_2=False, arg_3=False, arg_4='5m'):
        """Get the value of a given key"""
        arg_1 = arg_1.lstrip('/')
        arg_5 = '{}/{}'.format(arg_0.endpoint, arg_1)
        arg_6 = {}
        if arg_2:
            arg_6['index'] = arg_3
            arg_6['wait'] = arg_4
        arg_7 = requests.Func(arg_5, arg_6=arg_6)
        if arg_7.status_code == 404:
            raise KeyDoesNotExist("Key " + arg_1 + " does not exist")
        if arg_7.status_code != 200:
            raise KVStoreError('GET returned {}'.format(arg_7.status_code))

        try:
            return base64.b64decode(arg_7.json()[0]['Value'])
        except TypeError as e:
            # Value was empty and wild None appeared
            return ""


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_2 . author = arg_1 . user arg_2 . save ( )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Set currently authenticated user as the author of the gallery.
        """
        arg_2.author = arg_1.user
        arg_2.save()

Set currently authenticated user as the author of the gallery .


def Func ( arg_0 , arg_1 ) : arg_2 = pkl . dumps ( arg_0 , - 1 ) with open ( arg_1 , 'wb' ) as f : arg_3 = 0 while arg_3 < len ( arg_2 ) : arg_4 = min ( arg_3 + blosc . MAX_BUFFERSIZE , len ( arg_2 ) ) arg_5 = blosc . compress ( arg_2 [ arg_3 : arg_4 ] , typesize = 8 ) f . write ( arg_5 ) arg_3 = arg_4

def Func(arg_0, arg_1):
    """Pickle and compress."""
    arg_2 = pkl.dumps(arg_0, -1)
    with open(arg_1, 'wb') as f:
        arg_3 = 0
        while arg_3 < len(arg_2):
            arg_4 = min(arg_3 + blosc.MAX_BUFFERSIZE, len(arg_2))
            arg_5 = blosc.compress(arg_2[arg_3:arg_4], typesize=8)
            f.write(arg_5)
            arg_3 = arg_4


def Func ( arg_0 , ** arg_1 ) : arg_2 = { 'form_class' : RichTextFormField , 'config' : arg_0 . config , } arg_2 . update ( arg_1 ) return super ( RichTextField , arg_0 ) . Func ( ** arg_2 )

def Func(arg_0, **arg_1):
        """Get the form for field."""
        arg_2 = {
            'form_class': RichTextFormField,
            'config': arg_0.config,
        }
        arg_2.update(arg_1)
        return super(RichTextField, arg_0).Func(**arg_2)


def
Func
(
arg_0
,
arg_1
)
:
lg
.
info
(
'Reading ahpi absorption'
)
try
:
arg_0
.
a_phi
=
arg_0
.
_read_iop_from_file
(
arg_1
)
except
:
lg
.
exception
(
'Problem reading file :: '
+
arg_1
)
arg_0
.
a_phi
=
1

def Func(arg_0, arg_1):
        """Read the phytoplankton absorption file from a csv formatted file

        :param file_name: filename and path of the csv file
        """
        lg.info('Reading ahpi absorption')
        try:
            arg_0.a_phi = arg_0._read_iop_from_file(arg_1)
        except:
            lg.exception('Problem reading file :: ' + arg_1)
            arg_0.a_phi = -1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_home_set : arg_0 . package_home_set = True if validations . validate_pkg_homepage ( arg_2 ) : arg_1 . package . homepage = arg_2 return True else : raise SPDXValueError ( 'Package::HomePage' ) else : raise CardinalityError ( 'Package::HomePage' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package homepage location if not already set.
        location - A string or None or NoAssert.
        Raises CardinalityError if already defined.
        Raises OrderError if no package previously defined.
        Raises SPDXValueError if location has incorrect value.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_home_set:
            arg_0.package_home_set = True
            if validations.validate_pkg_homepage(arg_2):
                arg_1.package.homepage = arg_2
                return True
            else:
                raise SPDXValueError('Package::HomePage')
        else:
            raise CardinalityError('Package::HomePage')

Sets the package homepage location if not already set . location - A string or None or NoAssert . Raises CardinalityError if already defined . Raises OrderError if no package previously defined . Raises SPDXValueError if location has incorrect value .


def Func ( arg_0 ) : arg_1 = arg_0 . _api . camera_list ( ) arg_0 . _cameras_by_id = { v . camera_id : v for i , v in enumerate ( arg_1 ) } arg_3 = [ ] for arg_4 in arg_0 . _cameras_by_id . keys ( ) : arg_5 = arg_0 . _api . camera_event_motion_enum ( arg_4 ) arg_3 . append ( arg_5 ) arg_0 . _motion_settings_by_id = { v . camera_id : v for i , v in enumerate ( arg_3 ) }

def Func(arg_0):
        """Update cameras and motion settings with latest from API."""
        arg_1 = arg_0._api.camera_list()
        arg_0._cameras_by_id = {v.camera_id: v for i, v in enumerate(arg_1)}

        arg_3 = []
        for arg_4 in arg_0._cameras_by_id.keys():
            arg_5 = arg_0._api.camera_event_motion_enum(arg_4)
            arg_3.append(arg_5)

        arg_0._motion_settings_by_id = {
            v.camera_id: v for i, v in enumerate(arg_3)}

Update cameras and motion settings with latest from API .


async def Func(arg_0):
    """Sync all conversations by making paginated requests.

    Conversations are ordered by ascending sort timestamp.

    Args:
        client (Client): Connected client.

    Raises:
        NetworkError: If the requests fail.

    Returns:
        tuple of list of ``ConversationState`` messages and sync timestamp
    """
    arg_1 = []
    arg_2 = None
    arg_3 = hangouts_pb2.SyncRecentConversationsRequest(
        request_header=arg_0.get_request_header(),
        max_conversations=CONVERSATIONS_PER_REQUEST,
        max_events_per_conversation=1,
        sync_filter=[
            hangouts_pb2.SYNC_FILTER_INBOX,
            hangouts_pb2.SYNC_FILTER_ARCHIVED,
        ]
    )
    for arg_4 in range(MAX_CONVERSATION_PAGES):
        logger.info(
            'Requesting conversations page %s', arg_3.last_event_timestamp
        )
        response = await arg_0.sync_recent_conversations(arg_3)
        arg_1 = list(response.conversation_state) + arg_1
        arg_2 = parsers.from_timestamp(
            # SyncRecentConversations seems to return a sync_timestamp 4
            # minutes before the present. To prevent SyncAllNewEvents later
            # breaking requesting events older than what we already have, use
            # current_server_time instead.
            response.response_header.current_server_time
        )
        if response.continuation_end_timestamp == 0:
            logger.info('Reached final conversations page')
            break
        else:
            arg_3.last_event_timestamp = response.continuation_end_timestamp
    else:
        logger.warning('Exceeded maximum number of conversation pages')
    logger.info('Synced %s total conversations', len(arg_1))
    return arg_1, arg_2

Sync all conversations by making paginated requests .


(module_name: str, connection: Optional[str] = None)

return module_config.connection or config.connection

def Func ( arg_0 : arg_1 , arg_2 : arg_3 [ arg_1 ] = None ) -> arg_1 : if arg_2 is not None : return arg_2 arg_0 = arg_0 . lower ( ) arg_4 = get_module_config_cls ( arg_0 ) arg_5 = arg_4 . load ( ) return arg_5 . connection or config . connection

def Func(arg_0: arg_1, arg_2: arg_3[arg_1] = None) -> arg_1:
    """Return the SQLAlchemy connection string if it is set.

    Order of operations:

    1. Return the connection if given as a parameter
    2. Check the environment for BIO2BEL_{module_name}_CONNECTION
    3. Look in the bio2bel config file for module-specific connection. Create if doesn't exist. Check the
       module-specific section for ``connection``
    4. Look in the bio2bel module folder for a config file. Don't create if doesn't exist. Check the default section
       for ``connection``
    5. Check the environment for BIO2BEL_CONNECTION
    6. Check the bio2bel config file for default
    7. Fall back to standard default cache connection

    :param module_name: The name of the module to get the configuration for
    :param connection: get the SQLAlchemy connection string
    :return: The SQLAlchemy connection string based on the configuration
    """
    # 1. Use given connection
    if arg_2 is not None:
        return arg_2

    arg_0 = arg_0.lower()
    arg_4 = get_module_config_cls(arg_0)
    arg_5 = arg_4.load()

    return arg_5.connection or config.connection

Return the SQLAlchemy connection string if it is set .


def Func ( arg_0 , arg_1 ) : StreamBase . Func ( arg_0 , arg_1 ) if not arg_0 . initiator : if arg_1 . from_jid != arg_0 . peer : arg_1 . set_from ( arg_0 . peer )

def Func(arg_0, arg_1):
        """Fix an incoming stanza.

        Ona server replace the sender address with authorized client JID."""
        StreamBase.Func(arg_0, arg_1)
        if not arg_0.initiator:
            if arg_1.from_jid != arg_0.peer:
                arg_1.set_from(arg_0.peer)


def Func(arg_0, arg_1, arg_2=-1):
    """Extract the constant value of 'symbol' from 'code'

    If the name 'symbol' is bound to a constant value by the Python code
    object 'code', return that value.  If 'symbol' is bound to an expression,
    return 'default'.  Otherwise, return 'None'.

    Return value is based on the first assignment to 'symbol'.  'symbol' must
    be a global, or at least a non-"fast" local in the code block.  That is,
    only 'STORE_NAME' and 'STORE_GLOBAL' opcodes are checked, and 'symbol'
    must be present in 'code.co_names'.
    """

    if arg_1 not in arg_0.co_names:
        # name's not there, can't possibly be an assigment
        return None

    arg_3 = list(arg_0.co_names).index(arg_1)

    arg_4 = 90
    arg_5 = 97
    arg_6 = 100

    arg_7 = arg_2

    for arg_8, arg_9 in _iter_code(arg_0):

        if arg_8==arg_6:
            arg_7 = arg_0.co_consts[arg_9]
        elif arg_9==arg_3 and (arg_8==arg_4 or arg_8==arg_5):
            return arg_7
        else:
            arg_7 = arg_2

Extract the constant value of symbol from code


def Func ( arg_0 ) : if arg_0 is None : return if arg_0 : pickle . dump ( pyfftw . export_wisdom ( ) , open ( arg_0 , 'wb' ) , protocol = 2 )

def Func(arg_0):
    """
    Save the acquired 'wisdom' generated by FFTW to file so that future
    initializations of FFTW will be faster.
    """
    if arg_0 is None:
        return

    if arg_0:
        pickle.dump(
            pyfftw.export_wisdom(), open(arg_0, 'wb'),
            protocol=2
        )

Save the acquired wisdom generated by FFTW to file so that future initializations of FFTW will be faster .


def Func(arg_0, arg_1):
        "support cursor keys to move components one pixel at a time"
        arg_2 = arg_1.GetKeyCode()
        if arg_2 in (wx.WXK_LEFT, wx.WXK_UP, wx.WXK_RIGHT, wx.WXK_DOWN):
            for arg_3 in arg_0.selection:
                arg_4, arg_5 = arg_3.pos
                if arg_1.ShiftDown():     # snap to grid:t
                    # for now I'm only going to align to grid
                    # in the direction of the cursor movement
                    if arg_2 == wx.WXK_LEFT:
                        arg_4 = (arg_4 - GRID_SIZE[0]) / GRID_SIZE[0] * GRID_SIZE[0]
                    elif arg_2 == wx.WXK_RIGHT:
                        arg_4 = (arg_4 + GRID_SIZE[0]) / GRID_SIZE[0] * GRID_SIZE[0]
                    elif arg_2 == wx.WXK_UP:
                        arg_5 = (arg_5 - GRID_SIZE[1]) / GRID_SIZE[1] * GRID_SIZE[1]
                    elif arg_2 == wx.WXK_DOWN:
                        arg_5 = (arg_5 + GRID_SIZE[1]) / GRID_SIZE[1] * GRID_SIZE[1]
                else:
                    if arg_2 == wx.WXK_LEFT:
                        arg_4 = arg_4 - 1
                    elif arg_2 == wx.WXK_RIGHT:
                        arg_4 = arg_4 + 1
                    elif arg_2 == wx.WXK_UP:
                        arg_5 = arg_5 - 1
                    elif arg_2 == wx.WXK_DOWN:
                        arg_5 = arg_5 + 1
                arg_3.pos = (arg_4, arg_5)
        elif arg_2 == wx.WXK_DELETE:
            arg_0.delete(arg_1)
        elif arg_2 == wx.WXK_INSERT:
            arg_0.duplicate(arg_1)
        else:
            if DEBUG: print "KEY:", arg_2


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 . iter , astroid . Call ) : return if not arg_0 . _is_builtin ( arg_1 . iter . func , "range" ) : return if len ( arg_1 . iter . args ) == 2 and not _is_constant_zero ( arg_1 . iter . args [ 0 ] ) : return if len ( arg_1 . iter . args ) > 2 : return if not isinstance ( arg_1 . iter . args [ - 1 ] , astroid . Call ) : return arg_2 = arg_1 . iter . args [ - 1 ] . func if not arg_0 . _is_builtin ( arg_2 , "len" ) : return arg_3 = arg_1 . iter . args [ - 1 ] . args if not arg_3 or len ( arg_3 ) != 1 : return arg_4 = arg_3 [ 0 ] if not isinstance ( arg_4 , astroid . Name ) : return arg_5 = arg_1 . scope ( ) if arg_4 . name == "self" and arg_5 . name == "__iter__" : return for arg_6 in arg_1 . body : for arg_7 in arg_6 . nodes_of_class ( astroid . Subscript ) : if not isinstance ( arg_7 . value , astroid . Name ) : continue if not isinstance ( arg_7 . slice , astroid . Index ) : continue if not isinstance ( arg_7 . slice . value , astroid . Name ) : continue if arg_7 . slice . value . name != arg_1 . target . name : continue if arg_4 . name != arg_7 . value . name : continue if arg_7 . value . scope ( ) != arg_1 . scope ( ) : continue arg_0 . add_message ( "consider-using-enumerate" , arg_1 = arg_1 ) return

def Func(arg_0, arg_1):
        """Emit a convention whenever range and len are used for indexing."""
        # Verify that we have a `range([start], len(...), [stop])` call and
        # that the object which is iterated is used as a subscript in the
        # body of the for.

        # Is it a proper range call?
        if not isinstance(arg_1.iter, astroid.Call):
            return
        if not arg_0._is_builtin(arg_1.iter.func, "range"):
            return
        if len(arg_1.iter.args) == 2 and not _is_constant_zero(arg_1.iter.args[0]):
            return
        if len(arg_1.iter.args) > 2:
            return

        # Is it a proper len call?
        if not isinstance(arg_1.iter.args[-1], astroid.Call):
            return
        arg_2 = arg_1.iter.args[-1].func
        if not arg_0._is_builtin(arg_2, "len"):
            return
        arg_3 = arg_1.iter.args[-1].args
        if not arg_3 or len(arg_3) != 1:
            return
        arg_4 = arg_3[0]
        if not isinstance(arg_4, astroid.Name):
            return
        # If we're defining __iter__ on self, enumerate won't work
        arg_5 = arg_1.scope()
        if arg_4.name == "self" and arg_5.name == "__iter__":
            return

        # Verify that the body of the for loop uses a subscript
        # with the object that was iterated. This uses some heuristics
        # in order to make sure that the same object is used in the
        # for body.
        for arg_6 in arg_1.body:
            for arg_7 in arg_6.nodes_of_class(astroid.Subscript):
                if not isinstance(arg_7.value, astroid.Name):
                    continue
                if not isinstance(arg_7.slice, astroid.Index):
                    continue
                if not isinstance(arg_7.slice.value, astroid.Name):
                    continue
                if arg_7.slice.value.name != arg_1.target.name:
                    continue
                if arg_4.name != arg_7.value.name:
                    continue
                if arg_7.value.scope() != arg_1.scope():
                    # Ignore this subscript if it's not in the same
                    # scope. This means that in the body of the for
                    # loop, another scope was created, where the same
                    # name for the iterating object was used.
                    continue
                arg_0.add_message("consider-using-enumerate", arg_1=arg_1)
                return

Emit a convention whenever range and len are used for indexing .


def
Func
(
)
:
if
os
.
getenv
(
"BIGDL_CLASSPATH"
)
:
return
os
.
environ
[
"BIGDL_CLASSPATH"
]
arg_0
=
os
.
path
.
abspath
(
__file__
+
"/../../"
)
arg_1
=
glob
.
glob
(
os
.
path
.
join
(
arg_0
,
"share/lib/*.jar"
)
)
if
arg_1
:
assert
len
(
arg_1
)
==
1
,
"Expecting one jar: %s"
%
len
(
arg_1
)
return
arg_1
[
0
]
return
""

def Func():
    """
    Get and return the jar path for bigdl if exists.
    """
    if os.getenv("BIGDL_CLASSPATH"):
        return os.environ["BIGDL_CLASSPATH"]
    arg_0 = os.path.abspath(__file__ + "/../../")
    arg_1 = glob.glob(os.path.join(arg_0, "share/lib/*.jar"))
    if arg_1:
        assert len(arg_1) == 1, "Expecting one jar: %s" % len(arg_1)
        return arg_1[0]
    return ""

Get and return the jar path for bigdl if exists .


def Func ( arg_0 ) : for arg_1 , arg_2 , arg_3 in Func ( arg_0 ) : for arg_4 in arg_3 : yield arg_4

def Func(arg_0):
    """
    Iterate over all files visible to ``mgr``.
    """
    for arg_1, arg_2, arg_3 in Func(arg_0):
        for arg_4 in arg_3:
            yield arg_4


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
'%s, %s'
%
(
arg_1
,
arg_0
)
if
arg_2
:
print
'%s!'
%
arg_3
.
upper
(
)
else
:
print
'%s.'
%
arg_3

def Func(arg_0, arg_1, arg_2):
    '''Same as mix_and_match, but using the @option decorator.'''
    # Use the @option decorator when you need more control over the
    # command line options.
    arg_3 = '%s, %s' % (arg_1, arg_0)
    if arg_2:
        print '%s!' % arg_3.upper()
    else:
        print '%s.' % arg_3


(numSequences = 10,
                      seqLen = [2,3,4],
                      numPatterns = 5,
                      numOnBitsPerPattern = 3,
                      patternOverlap = 0,
                      **kwargs
                      )

def
Func
(
arg_0
=
10
,
arg_1
=
[
2
,
3
,
4
]
,
arg_2
=
5
,
arg_3
=
3
,
arg_4
=
0
,
**
arg_5
)
:
arg_6
=
getSimplePatterns
(
arg_3
,
arg_2
,
arg_4
)
arg_7
=
len
(
arg_6
[
0
]
)
arg_8
=
[
]
for
arg_9
in
xrange
(
arg_0
)
:
arg_10
=
[
]
arg_11
=
random
.
choice
(
arg_1
)
for
arg_9
in
xrange
(
arg_11
)
:
arg_12
=
random
.
choice
(
xrange
(
arg_2
)
)
arg_10
.
append
(
arg_6
[
arg_12
]
)
arg_8
.
append
(
arg_10
)
if
VERBOSITY
>=
3
:
print
"\nTraining sequences"
printAllTrainingSequences
(
arg_8
)
return
(
arg_7
,
arg_8
)

def Func(arg_0 = 10,
                      arg_1 = [2,3,4],
                      arg_2 = 5,
                      arg_3 = 3,
                      arg_4 = 0,
                      **arg_5
                      ):
  """ Create a bunch of sequences of various lengths, all built from
  a fixed set of patterns.

  Parameters:
  -----------------------------------------------------
  numSequences:         Number of training sequences to generate
  seqLen:               List of possible sequence lengths
  numPatterns:          How many possible patterns there are to use within
                          sequences
  numOnBitsPerPattern:  Number of ON bits in each TM input pattern
  patternOverlap:       Max number of bits of overlap between any 2 patterns
  retval:               (numCols, trainingSequences)
                          numCols - width of the patterns
                          trainingSequences - a list of training sequences

  """

  # Create the table of patterns
  arg_6 = getSimplePatterns(arg_3, arg_2, arg_4)

  # Total number of columns required
  arg_7 = len(arg_6[0])

  # -----------------------------------------------------------------------
  # Create the training sequences
  arg_8 = []
  for arg_9 in xrange(arg_0):

    # Build it up from patterns
    arg_10 = []
    arg_11 = random.choice(arg_1)
    for arg_9 in xrange(arg_11):
      arg_12 = random.choice(xrange(arg_2))
      arg_10.append(arg_6[arg_12])

    # Put it in
    arg_8.append(arg_10)

  if VERBOSITY >= 3:
    print "\nTraining sequences"
    printAllTrainingSequences(arg_8)

  return (arg_7, arg_8)

Create a bunch of sequences of various lengths all built from a fixed set of patterns .


def Func(arg_0, arg_1, arg_2):
    """ function to check expected type and raise
    error if type is not correct """
    if not isinstance(arg_1, arg_2):
        raise TypeError("{} argument must have a type {} not {}".format(
            arg_0, arg_2, type(arg_1)))


(url, into_directory, cache_key, origin_info=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
try
:
access_common
.
unpackFromCache
(
arg_2
,
arg_1
)
except
KeyError
as
e
:
arg_4
=
settings
.
getProperty
(
'github'
,
'authtoken'
)
arg_5
=
{
}
if
arg_4
is
not
:
arg_5
[
'Authorization'
]
=
'token '
+
str
(
arg_4
)
logger
.
debug
(
'GET %s'
,
arg_0
)
arg_6
=
requests
.
get
(
arg_0
,
allow_redirects
=
True
,
stream
=
True
,
arg_5
=
arg_5
)
arg_6
.
raise_for_status
(
)
logger
.
debug
(
'getting file: %s'
,
arg_0
)
logger
.
debug
(
'headers: %s'
,
arg_6
.
headers
)
arg_6
.
raise_for_status
(
)
access_common
.
unpackTarballStream
(
stream
=
arg_6
,
arg_1
=
arg_1
,
hash
=
{
}
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    '''unpack the specified tarball url into the specified directory'''

    try:
        access_common.unpackFromCache(arg_2, arg_1)
    except KeyError as e:
        arg_4 = settings.getProperty('github', 'authtoken')
        arg_5 = {}
        if arg_4 is not None:
            arg_5['Authorization'] = 'token ' + str(arg_4)

        logger.debug('GET %s', arg_0)
        arg_6 = requests.get(arg_0, allow_redirects=True, stream=True, arg_5=arg_5)
        arg_6.raise_for_status()

        logger.debug('getting file: %s', arg_0)
        logger.debug('headers: %s', arg_6.headers)
        arg_6.raise_for_status()

        # github doesn't exposes hashes of the archives being downloaded as far
        # as I can tell :(
        access_common.unpackTarballStream(
                    stream = arg_6,
            arg_1 = arg_1,
                      hash = {},
                 arg_2 = arg_2,
               arg_3 = arg_3
        )


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

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

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

This function deal with the cinder notification .


(job_handler, host="localhost", port=48484,
                      *, max_workers=None)

def
Func
(
arg_0
,
arg_1
=
"localhost"
,
arg_2
=
48484
,
*
,
arg_3
=
)
:
if
arg_3
is
:
arg_3
=
multiprocessing
.
cpu_count
(
)
arg_4
=
[
]
for
arg_5
in
range
(
arg_3
)
:
arg_6
=
multiprocessing
.
Process
(
target
=
worker_main
,
args
=
(
arg_0
,
arg_1
,
arg_2
)
)
arg_6
.
start
(
)
arg_4
.
append
(
arg_6
)
logger
.
debug
(
"workers started"
)
for
arg_6
in
arg_4
:
arg_6
.
join
(
)
logger
.
debug
(
"all workers completed"
)

def Func(arg_0, arg_1="localhost", arg_2=48484,
                      *, arg_3=None):
    """
    Runs a pool of workers which connect to a remote HighFive master and begin
    executing calls.
    """

    if arg_3 is None:
        arg_3 = multiprocessing.cpu_count()

    arg_4 = []
    for arg_5 in range(arg_3):
        arg_6 = multiprocessing.Process(target=worker_main,
                args=(arg_0, arg_1, arg_2))
        arg_6.start()
        arg_4.append(arg_6)

    logger.debug("workers started")

    for arg_6 in arg_4:
        arg_6.join()

    logger.debug("all workers completed")

Runs a pool of workers which connect to a remote HighFive master and begin executing calls .


return urlunsplit((scheme, netloc, path, new_query_string, fragment))

def Func(arg_0, arg_1, arg_2):
    """Given a URL, set or replace a query parameter and return the modified URL.

    Args:
        url: a given  URL
        param_name: the parameter name to add
        param_value: the parameter value
    Returns:
        URL with the added parameter

    """
    arg_3, arg_4, arg_5, arg_6, arg_7 = urlsplit(arg_0)
    arg_8 = parse_qs(arg_6)

    arg_8[arg_1] = [arg_2]
    arg_9 = urlencode(arg_8, doseq=True)

    return urlunsplit((arg_3, arg_4, arg_5, arg_9, arg_7))

Given a URL set or replace a query parameter and return the modified URL .


def Func ( arg_0 ) : arg_1 = ( '.zip' , '.tar.gz' , '.tar.bz2' , '.tgz' , '.tar' , '.whl' ) arg_2 = splitext ( arg_0 ) [ 1 ] . lower ( ) if arg_2 in arg_1 : return True return False

def Func(arg_0):
    """Return True if `name` is a considered as an archive file."""
    arg_1 = (
        '.zip', '.tar.gz', '.tar.bz2', '.tgz', '.tar', '.whl'
    )
    arg_2 = splitext(arg_0)[1].lower()
    if arg_2 in arg_1:
        return True
    return False

Return True if name is a considered as an archive file .


def Func ( arg_0 ) : arg_1 = dict ( ) for arg_2 in sorted ( arg_0 . actions_spec ) : arg_3 = arg_0 . actions_spec [ arg_2 ] if arg_0 . distributions_spec is not None and arg_2 in arg_0 . distributions_spec : arg_4 = dict ( arg_3 ) arg_4 [ 'scope' ] = arg_2 arg_4 [ 'summary_labels' ] = arg_0 . summary_labels arg_1 [ arg_2 ] = Distribution . from_spec ( spec = arg_0 . distributions_spec [ arg_2 ] , arg_4 = arg_4 ) elif arg_3 [ 'type' ] == 'bool' : arg_1 [ arg_2 ] = Bernoulli ( shape = arg_3 [ 'shape' ] , scope = arg_2 , summary_labels = arg_0 . summary_labels ) elif arg_3 [ 'type' ] == 'int' : arg_1 [ arg_2 ] = Categorical ( shape = arg_3 [ 'shape' ] , num_actions = arg_3 [ 'num_actions' ] , scope = arg_2 , summary_labels = arg_0 . summary_labels ) elif arg_3 [ 'type' ] == 'float' : if 'min_value' in arg_3 : arg_1 [ arg_2 ] = Beta ( shape = arg_3 [ 'shape' ] , min_value = arg_3 [ 'min_value' ] , max_value = arg_3 [ 'max_value' ] , scope = arg_2 , summary_labels = arg_0 . summary_labels ) else : arg_1 [ arg_2 ] = Gaussian ( shape = arg_3 [ 'shape' ] , scope = arg_2 , summary_labels = arg_0 . summary_labels ) return arg_1

def Func(arg_0):
        """
        Creates and returns the Distribution objects based on self.distributions_spec.

        Returns: Dict of distributions according to self.distributions_spec.
        """
        arg_1 = dict()
        for arg_2 in sorted(arg_0.actions_spec):
            arg_3 = arg_0.actions_spec[arg_2]

            if arg_0.distributions_spec is not None and arg_2 in arg_0.distributions_spec:
                arg_4 = dict(arg_3)
                arg_4['scope'] = arg_2
                arg_4['summary_labels'] = arg_0.summary_labels
                arg_1[arg_2] = Distribution.from_spec(
                    spec=arg_0.distributions_spec[arg_2],
                    arg_4=arg_4
                )

            elif arg_3['type'] == 'bool':
                arg_1[arg_2] = Bernoulli(
                    shape=arg_3['shape'],
                    scope=arg_2,
                    summary_labels=arg_0.summary_labels
                )

            elif arg_3['type'] == 'int':
                arg_1[arg_2] = Categorical(
                    shape=arg_3['shape'],
                    num_actions=arg_3['num_actions'],
                    scope=arg_2,
                    summary_labels=arg_0.summary_labels
                )

            elif arg_3['type'] == 'float':
                if 'min_value' in arg_3:
                    arg_1[arg_2] = Beta(
                        shape=arg_3['shape'],
                        min_value=arg_3['min_value'],
                        max_value=arg_3['max_value'],
                        scope=arg_2,
                        summary_labels=arg_0.summary_labels
                    )

                else:
                    arg_1[arg_2] = Gaussian(
                        shape=arg_3['shape'],
                        scope=arg_2,
                        summary_labels=arg_0.summary_labels
                    )

        return arg_1

Creates and returns the Distribution objects based on self . distributions_spec .


(cls, compressed_buffer, point_format, count, laszip_vlr)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """  Construct the point record by reading and decompressing the points data from
        the input buffer
        """
        arg_5 = arg_2.dtype
        arg_6 = decompress_buffer(
            arg_1, arg_5, arg_3, arg_4
        )
        return arg_0(arg_6, arg_2)


def
Func
(
arg_0
)
:
with
open
(
arg_0
)
as
f
:
arg_1
=
json
.
loads
(
f
.
read
(
)
)
arg_2
=
HostSearch
(
)
arg_3
=
0
arg_4
=
0
print_notification
(
"Parsing {} entries"
.
format
(
len
(
arg_1
)
)
)
for
arg_5
in
arg_1
:
arg_4
+=
1
arg_6
=
parse_single_computer
(
arg_5
)
if
arg_6
.
ip
:
try
:
arg_7
=
arg_2
.
id_to_object
(
arg_6
.
ip
)
arg_7
.
description
.
append
(
arg_6
.
description
)
arg_7
.
hostname
.
append
(
arg_6
.
dns_hostname
)
if
arg_6
.
os
:
arg_7
.
os
=
arg_6
.
os
arg_7
.
domain_controller
=
arg_6
.
dc
arg_7
.
add_tag
(
'domaindump'
)
arg_7
.
save
(
)
arg_3
+=
1
except
ValueError
:
pass
sys
.
stdout
.
write
(
'\r'
)
sys
.
stdout
.
write
(
"[{}/{}] {} resolved"
.
format
(
arg_4
,
len
(
arg_1
)
,
arg_3
)
)
sys
.
stdout
.
flush
(
)
sys
.
stdout
.
write
(
'\r'
)
return
arg_3

def Func(arg_0):
    """
        Parse the file and extract the computers, import the computers that resolve into jackal.
    """
    with open(arg_0) as f:
        arg_1 = json.loads(f.read())
    arg_2 = HostSearch()
    arg_3 = 0
    arg_4 = 0
    print_notification("Parsing {} entries".format(len(arg_1)))
    for arg_5 in arg_1:
        arg_4 += 1
        arg_6 = parse_single_computer(arg_5)
        if arg_6.ip:
            try:
                arg_7 = arg_2.id_to_object(arg_6.ip)
                arg_7.description.append(arg_6.description)
                arg_7.hostname.append(arg_6.dns_hostname)
                if arg_6.os:
                    arg_7.os = arg_6.os
                arg_7.domain_controller = arg_6.dc
                arg_7.add_tag('domaindump')
                arg_7.save()
                arg_3 += 1
            except ValueError:
                pass
        sys.stdout.write('\r')
        sys.stdout.write(
            "[{}/{}] {} resolved".format(arg_4, len(arg_1), arg_3))
        sys.stdout.flush()
    sys.stdout.write('\r')
    return arg_3

Parse the file and extract the computers import the computers that resolve into jackal .


def Func ( arg_0 ) : arg_1 = SlackAPI ( token = arg_0 . token ) arg_2 = arg_1 . rtm_start ( ) arg_3 = SlackClientFactory ( arg_2 [ 'url' ] ) arg_3 . protocol = SlackClientProtocol arg_3 . protocol . slack = arg_1 arg_3 . protocol . channel_layer = arg_0 . channel_layer arg_3 . channel_name = arg_0 . channel_name arg_3 . Func ( )

def Func(arg_0):
        """
        Main interface. Instantiate the SlackAPI, connect to RTM
        and start the client.
        """
        arg_1 = SlackAPI(token=arg_0.token)
        arg_2 = arg_1.rtm_start()

        arg_3 = SlackClientFactory(arg_2['url'])
        # Attach attributes
        arg_3.protocol = SlackClientProtocol
        arg_3.protocol.slack = arg_1
        arg_3.protocol.channel_layer = arg_0.channel_layer
        arg_3.channel_name = arg_0.channel_name

        # Here we go
        arg_3.Func()

Main interface . Instantiate the SlackAPI connect to RTM and start the client .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
""
,
arg_3
=
"  "
)
:
if
arg_0
:
arg_4
=
100
*
(
arg_1
/
float
(
arg_0
)
)
else
:
arg_4
=
100
arg_5
=
'#'
*
int
(
arg_4
/
5.
)
arg_6
=
' '
*
int
(
20
len
(
arg_5
)
)
if
not
ipyrad
.
__interactive__
:
arg_2
=
arg_2
.
rsplit
(
"|"
,
2
)
[
0
]
arg_7
=
[
arg_3
,
arg_5
+
arg_6
,
int
(
arg_4
)
,
arg_2
]
print
(
"\r{}[{}] {:>3}% {} "
.
format
(
*
arg_7
)
,
end
=
""
)
sys
.
stdout
.
flush
(
)

def Func(arg_0, arg_1, arg_2="", arg_3="  "):
    """ prints a progress bar """
    if arg_0:
        arg_4 = 100*(arg_1 / float(arg_0))
    else:
        arg_4 = 100

    arg_5 = '#'*int(arg_4/5.)
    arg_6 = ' '*int(20-len(arg_5))
    if not ipyrad.__interactive__:
        arg_2 = arg_2.rsplit("|", 2)[0]

    arg_7 = [arg_3, arg_5+arg_6, int(arg_4), arg_2]
    print("\r{}[{}] {:>3}% {} ".format(*arg_7), end="")
    sys.stdout.flush()


def Func ( arg_0 : arg_1 ) -> Mapping [ str , Mapping [ Tuple [ BaseEntity , BaseEntity ] , str ] ] : arg_2 = defaultdict ( lambda : defaultdict ( set ) ) for arg_3 , arg_4 , arg_5 in arg_0 . edges ( arg_5 = True ) : if CITATION not in arg_5 : continue arg_2 [ arg_5 [ CITATION ] [ CITATION_TYPE ] ] [ arg_3 , arg_4 ] . add ( arg_5 [ CITATION ] [ CITATION_REFERENCE ] . strip ( ) ) return dict ( arg_2 )

def Func(arg_0: arg_1) -> Mapping[str, Mapping[Tuple[BaseEntity, BaseEntity], str]]:
    """Prepare a citation data dictionary from a graph.

    :return: A dictionary of dictionaries {citation type: {(source, target): citation reference}
    """
    arg_2 = defaultdict(lambda: defaultdict(set))

    for arg_3, arg_4, arg_5 in arg_0.edges(arg_5=True):
        if CITATION not in arg_5:
            continue
        arg_2[arg_5[CITATION][CITATION_TYPE]][arg_3, arg_4].add(arg_5[CITATION][CITATION_REFERENCE].strip())

    return dict(arg_2)

Prepare a citation data dictionary from a graph .


(self, parent_item, navigation_type, use_template, context)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Builds and returns site tree item Func structure for 'sitetree_Func' tag.

        :param TreeItemBase parent_item:
        :param str|unicode navigation_type: menu, sitetree
        :param str|unicode use_template:
        :param Context context:
        :rtype: list
        """
        # Resolve parent item and current tree alias.
        arg_1 = arg_0.resolve_var(arg_1, arg_4)
        arg_5, arg_6 = arg_0.get_sitetree(arg_1.tree.alias)

        # Mark path to current item.
        arg_0.tree_climber(arg_5, arg_0.get_tree_current_item(arg_5))

        arg_6 = arg_0.get_Func(arg_5, arg_1)
        arg_6 = arg_0.filter_items(arg_6, arg_2)
        arg_6 = arg_0.apply_hook(arg_6, '%s.Func' % arg_2)
        arg_0.update_has_Func(arg_5, arg_6, arg_2)

        arg_7 = get_template(arg_3)

        arg_4.push()
        arg_4['sitetree_items'] = arg_6
        arg_8 = arg_7.render(arg_4.flatten() if _CONTEXT_FLATTEN else arg_4)
        arg_4.pop()

        return arg_8

Builds and returns site tree item children structure for 'sitetree_children' tag.

        :param TreeItemBase parent_item:
        :param str|unicode navigation_type: menu, sitetree
        :param str|unicode use_template:
        :param Context context:
        :rtype: list

Builds and returns site tree item children structure for sitetree_children tag .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = yield from arg_0 . call ( 'SET/{}' . format ( arg_1 ) , dict ( arg_2 = arg_2 ) ) if arg_3 is None : return None return arg_3 . status == 'FS_OK'

def Func(arg_0, arg_1, arg_2):
        """Helper method for setting a value by using the fsapi API."""
        arg_3 = yield from arg_0.call('SET/{}'.format(arg_1), dict(arg_2=arg_2))
        if arg_3 is None:
            return None

        return arg_3.status == 'FS_OK'

Helper method for setting a value by using the fsapi API .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Internal callback for messages that have not been handled by any of the specific internal callbacks, these
        messages are not passed on to any user provided callback
        """
        arg_0.logger.warning(
            "Received messaging on unsupported topic '%s' on topic '%s'" % (arg_3.payload, arg_3.topic)
        )

Internal callback for messages that have not been handled by any of the specific internal callbacks these messages are not passed on to any user provided callback


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_0 . skeleton = arg_3 . Skeleton ( arg_0 ) arg_0 . skeleton . load ( arg_1 , color = ( 0.3 , 0.5 , 0.9 , 0.8 ) ) if arg_2 : arg_0 . skeleton . set_pid_params ( ** arg_2 ) arg_0 . skeleton . erp = 0.1 arg_0 . skeleton . cfm = 0

def Func(arg_0, arg_1, arg_2=None):
        '''Create and configure a skeleton in our model.

        Parameters
        ----------
        filename : str
            The name of a file containing skeleton configuration data.
        pid_params : dict, optional
            If given, use this dictionary to set the PID controller
            parameters on each joint in the skeleton. See
            :func:`pagoda.skeleton.pid` for more information.
        '''
        arg_0.skeleton = arg_3.Skeleton(arg_0)
        arg_0.skeleton.load(arg_1, color=(0.3, 0.5, 0.9, 0.8))
        if arg_2:
            arg_0.skeleton.set_pid_params(**arg_2)
        arg_0.skeleton.erp = 0.1
        arg_0.skeleton.cfm = 0

Create and configure a skeleton in our model .


def
Func
(
*
arg_0
)
:
with
disable_error_handler
(
)
:
arg_0
=
parse_args
(
arg_0
or
sys
.
argv
[
1
:
]
)
arg_1
=
read_config
(
arg_0
.
config
,
arg_0
)
if
arg_1
is
:
return
True
arg_2
=
arg_1
[
__script__
]
if
not
check_pre_requirements
(
arg_2
[
'pre_requirements'
]
)
:
return
True
arg_3
=
prepare_args
(
arg_1
[
'virtualenv'
]
,
arg_2
)
if
not
create_env
(
arg_2
[
'env'
]
,
arg_3
,
arg_2
[
'recreate'
]
,
arg_2
[
'ignore_activated'
]
,
arg_2
[
'quiet'
]
)
:
return
True
arg_4
=
prepare_args
(
arg_1
[
'pip'
]
,
arg_2
)
if
not
install
(
arg_2
[
'env'
]
,
arg_2
[
'requirements'
]
,
arg_4
,
arg_2
[
'ignore_activated'
]
,
arg_2
[
'install_dev_requirements'
]
,
arg_2
[
'quiet'
]
)
:
return
True
run_hook
(
arg_2
[
'hook'
]
,
arg_2
,
arg_2
[
'quiet'
]
)
if
not
arg_2
[
'quiet'
]
:
print_message
(
'All OK!'
)
return
False

def Func(*arg_0):
    r"""Bootstrap Python projects and libraries with virtualenv and pip.

    Also check system requirements before bootstrap and run post bootstrap
    hook if any.

    :param \*args: Command line arguments list.
    """
    # Create parser, read arguments from direct input or command line
    with disable_error_handler():
        arg_0 = parse_args(arg_0 or sys.argv[1:])

    # Read current config from file and command line arguments
    arg_1 = read_config(arg_0.config, arg_0)
    if arg_1 is None:
        return True
    arg_2 = arg_1[__script__]

    # Check pre-requirements
    if not check_pre_requirements(arg_2['pre_requirements']):
        return True

    # Create virtual environment
    arg_3 = prepare_args(arg_1['virtualenv'], arg_2)
    if not create_env(
        arg_2['env'],
        arg_3,
        arg_2['recreate'],
        arg_2['ignore_activated'],
        arg_2['quiet']
    ):
        # Exit if couldn't create virtual environment
        return True

    # And install library or project here
    arg_4 = prepare_args(arg_1['pip'], arg_2)
    if not install(
        arg_2['env'],
        arg_2['requirements'],
        arg_4,
        arg_2['ignore_activated'],
        arg_2['install_dev_requirements'],
        arg_2['quiet']
    ):
        # Exist if couldn't install requirements into venv
        return True

    # Run post-bootstrap hook
    run_hook(arg_2['hook'], arg_2, arg_2['quiet'])

    # All OK!
    if not arg_2['quiet']:
        print_message('All OK!')

    # False means everything went alright, exit code: 0
    return False

r Bootstrap Python projects and libraries with virtualenv and pip .


def Func(arg_0, arg_1):
        """Expand phonetic alternates separated by |s.

        Parameters
        ----------
        phonetic : str
            A Beider-Morse phonetic encoding

        Returns
        -------
        str
            A Beider-Morse phonetic code

        """
        arg_2 = arg_1.find('(')
        if arg_2 == -1:
            return arg_0._normalize_lang_attrs(arg_1, False)

        arg_3 = arg_1[:arg_2]
        arg_2 += 1  # get past the (
        arg_4 = arg_1.find(')', arg_2)
        arg_5 = arg_1[arg_2:arg_4]
        arg_4 += 1  # get past the )
        arg_6 = arg_1[arg_4:]
        arg_7 = arg_5.split('|')
        arg_8 = ''

        for arg_9 in range(len(arg_7)):
            arg_10 = arg_7[arg_9]
            arg_11 = arg_0.Func(arg_3 + arg_10 + arg_6)
            if arg_11 != '' and arg_11 != '[0]':
                if arg_8 != '':
                    arg_8 += '|'
                arg_8 += arg_11

        return arg_8

Expand phonetic alternates separated by |s .


def Func(arg_0, arg_1, arg_2):
        """
        Save the current model progress into ``self._progress_data``, and update ``self._next_poll_time``.

        :param res: tuple (progress level, poll delay).
        :param now: current timestamp.
        """
        arg_3, arg_4 = arg_1
        arg_3 = clamp(arg_3, 0, arg_0._maxval)
        arg_0._progress_data.append((arg_2, arg_3))

        if arg_4 < 0:
            # calculation of ``_guess_next_poll_interval()`` should be done only *after* we pushed the fresh data to
            # ``self._progress_data``.
            arg_4 = arg_0._guess_next_poll_interval()
        arg_0._next_poll_time = arg_2 + clamp(arg_4, arg_0.MIN_PROGRESS_CHECK_INTERVAL, arg_0.MAX_PROGRESS_CHECK_INTERVAL)

Save the current model progress into self . _progress_data and update self . _next_poll_time .


def
Func
(
arg_0
)
:
arg_0
.
_logger
.
debug
(
"Acquiring connection"
)
arg_1
=
SteadyDB
.
connect
(
**
_getCommonSteadyDBArgsDict
(
)
)
arg_2
=
ConnectionWrapper
(
arg_1
=
arg_1
,
cursor
=
arg_1
.
cursor
(
)
,
releaser
=
arg_0
.
_releaseConnection
,
logger
=
arg_0
.
_logger
)
return
arg_2

def Func(arg_0):
    """ Create a Connection instance.

    Parameters:
    ----------------------------------------------------------------
    retval:       A ConnectionWrapper instance. NOTE: Caller
                    is responsible for calling the  ConnectionWrapper
                    instance's release() method or use it in a context manager
                    expression (with ... as:) to release resources.
    """
    arg_0._logger.debug("Acquiring connection")

    arg_1 = SteadyDB.connect(** _getCommonSteadyDBArgsDict())
    arg_2 = ConnectionWrapper(arg_1=arg_1,
                                 cursor=arg_1.cursor(),
                                 releaser=arg_0._releaseConnection,
                                 logger=arg_0._logger)
    return arg_2


open the serial port using the configuration data
        returns a reference to this instance

def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
:
print
(
'\nOpening Arduino Serial port %s '
%
arg_0
.
port_id
)
try
:
arg_0
.
arduino
.
close
(
)
time
.
sleep
(
1
)
arg_0
.
arduino
.
Func
(
)
time
.
sleep
(
1
)
return
arg_0
.
arduino
except
Exception
:
raise

def Func(arg_0, arg_1):
        """
        Func the serial port using the configuration data
        returns a reference to this instance
        """
        # Func a serial port
        if arg_1:
            print('\nOpening Arduino Serial port %s ' % arg_0.port_id)

        try:

            # in case the port is already Func, let's close it and then
            # reFunc it
            arg_0.arduino.close()
            time.sleep(1)
            arg_0.arduino.Func()
            time.sleep(1)
            return arg_0.arduino

        except Exception:
            # Funced failed - will report back to caller
            raise


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 [ "_anidata" ] = { } arg_3 = arg_1 [ "_anidata" ] arg_3 [ "keyframe" ] = 0 arg_3 [ "last_tick" ] = time . time ( ) arg_3 [ "jumptype" ] = arg_2 arg_3 [ "phase" ] = "transition"

def Func(arg_0,arg_1,arg_2):
        """
        Callback that is called to initialize this animation on a specific actor.

        Internally sets the ``_anidata`` key of the given dict ``data``\ .

        ``jumptype`` is either ``jump`` or ``animate`` to define how to switch to this animation.
        """
        arg_1["_anidata"]={}
        arg_3 = arg_1["_anidata"]

        arg_3["keyframe"]=0
        arg_3["last_tick"]=time.time()
        arg_3["jumptype"]=arg_2
        arg_3["phase"]="transition"

Callback that is called to initialize this animation on a specific actor . Internally sets the _anidata key of the given dict data \ . jumptype is either jump or animate to define how to switch to this animation .


def Func ( arg_0 ) : if arg_0 == Kind . CLIENT : return zipkin_pb2 . Span . CLIENT elif arg_0 == Kind . SERVER : return zipkin_pb2 . Span . SERVER elif arg_0 == Kind . PRODUCER : return zipkin_pb2 . Span . PRODUCER elif arg_0 == Kind . CONSUMER : return zipkin_pb2 . Span . CONSUMER return None

def Func(arg_0):
    """Converts py_zipkin's Kind to Protobuf's Kind.

    :param kind: py_zipkin's Kind.
    :type kind: py_zipkin.Kind
    :return: correcponding protobuf's kind value.
    :rtype: zipkin_pb2.Span.Kind
    """
    if arg_0 == Kind.CLIENT:
        return zipkin_pb2.Span.CLIENT
    elif arg_0 == Kind.SERVER:
        return zipkin_pb2.Span.SERVER
    elif arg_0 == Kind.PRODUCER:
        return zipkin_pb2.Span.PRODUCER
    elif arg_0 == Kind.CONSUMER:
        return zipkin_pb2.Span.CONSUMER
    return None

Converts py_zipkin s Kind to Protobuf s Kind .


def Func ( arg_0 ) : if arg_0 . is_internal : return Func_for ( arg_0 . endpoint , ** arg_0 . args ) return arg_0 . _Func

def Func(arg_0):
        """The final Func of this navigation item.

        By default, the value is generated by the :attr:`self.endpoint` and
        :attr:`self.args`.

        .. note::

           The :attr:`Func` property require the app context without a provided
           config value :const:`SERVER_NAME`, because of :func:`flask.Func_for`.

        :type: :class:`str`
        """
        if arg_0.is_internal:
            return Func_for(arg_0.endpoint, **arg_0.args)
        return arg_0._Func

The final url of this navigation item.

        By default, the value is generated by the :attr:`self.endpoint` and
        :attr:`self.args`.

        .. note::

           The :attr:`url` property require the app context without a provided
           config value :const:`SERVER_NAME`, because of :func:`flask.url_for`.

        :type: :class:`str`


return response.Response(
            serializer.errors, status=status.HTTP_400_BAD_REQUEST)

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . serializer_class ( data = arg_1 . data ) if arg_2 . is_valid ( ) : arg_3 = arg_2 . validated_data [ 'user' ] signals . user_logged_in . send ( type ( arg_0 ) , arg_3 = arg_3 , arg_1 = arg_1 ) arg_4 = arg_0 . model . objects . create ( arg_3 = arg_3 ) arg_4 . update_expiry ( ) return response . Response ( { 'token' : arg_4 . key } ) return response . Response ( arg_2 . errors , status = status . HTTP_400_BAD_REQUEST )

def Func(arg_0, arg_1):
        """Create auth token. Differs from DRF that it always creates new token
        but not re-using them."""
        arg_2 = arg_0.serializer_class(data=arg_1.data)
        if arg_2.is_valid():
            arg_3 = arg_2.validated_data['user']
            signals.user_logged_in.send(type(arg_0), arg_3=arg_3, arg_1=arg_1)
            arg_4 = arg_0.model.objects.create(arg_3=arg_3)
            arg_4.update_expiry()
            return response.Response({'token': arg_4.key})

        return response.Response(
            arg_2.errors, status=status.HTTP_400_BAD_REQUEST)

Create auth token . Differs from DRF that it always creates new token but not re - using them .


def Func ( arg_0 ) : arg_0 . _Wmapped_index = vq ( arg_0 . data , arg_0 . W ) arg_0 . Wmapped = np . zeros ( arg_0 . W . shape ) for arg_3 , arg_4 in enumerate ( arg_0 . _Wmapped_index ) : arg_0 . Wmapped [ : , arg_3 ] = arg_0 . data [ : , arg_4 ]

def Func(arg_0):
        """ Return data points that are most similar to basis vectors W
        """

        # assign W to the next best data sample
        arg_0._Wmapped_index = vq(arg_0.data, arg_0.W)
        arg_0.Wmapped = np.zeros(arg_0.W.shape)

        # do not directly assign, i.e. Wdist = self.data[:,sel]
        # as self might be unsorted (in non ascending order)
        # -> sorting sel would screw the matching to W if
        # self.data is stored as a hdf5 table (see h5py)
        for arg_3, arg_4 in enumerate(arg_0._Wmapped_index):
            arg_0.Wmapped[:,arg_3] = arg_0.data[:,arg_4]


def Func ( arg_0 ) : arg_0 . requested = True arg_2 = ElementTree . Element ( STARTTLS_TAG ) arg_0 . stream . write_element ( arg_2 )

def Func(arg_0):
        """Request a TLS-encrypted connection.

        [initiating entity only]"""
        arg_0.requested = True
        arg_2 = ElementTree.Element(STARTTLS_TAG)
        arg_0.stream.write_element(arg_2)