def Func(arg_0=1., arg_1=None):
  """Returns a callable that adds a random uniform perturbation to the input.

  For more details on `Func`, see
  `random_walk_normal_fn`. `scale` might
  be a `Tensor` or a list of `Tensor`s that should broadcast with state parts
  of the `current_state`. The generated uniform perturbation is sampled as a
  uniform point on the rectangle `[-scale, scale]`.

  Args:
    scale: a `Tensor` or Python `list` of `Tensor`s of any shapes and `dtypes`
      controlling the upper and lower bound of the uniform proposal
      distribution.
    name: Python `str` name prefixed to Ops created by this function.
        Default value: 'Func'.

  Returns:
    Func: A callable accepting a Python `list` of `Tensor`s
      representing the state parts of the `current_state` and an `int`
      representing the random seed used to generate the proposal. The callable
      returns the same-type `list` of `Tensor`s as the input and represents the
      proposal for the RWM algorithm.
  """
  def _fn(arg_2, arg_3):
    """Adds a uniform perturbation to the input state.

    Args:
      state_parts: A list of `Tensor`s of any shape and real dtype representing
        the state parts of the `current_state` of the Markov chain.
      seed: `int` or None. The random seed for this `Op`. If `None`, no seed is
        applied.
        Default value: `None`.

    Returns:
      perturbed_state_parts: A Python `list` of The `Tensor`s. Has the same
        shape and type as the `state_parts`.

    Raises:
      ValueError: if `scale` does not broadcast with `state_parts`.
    """
    with tf.compat.v1.name_scope(
        arg_1, 'Func', values=[arg_2, arg_0, arg_3]):
      arg_4 = arg_0 if mcmc_util.is_list_like(arg_0) else [arg_0]
      if len(arg_4) == 1:
        arg_4 *= len(arg_2)
      if len(arg_2) != len(arg_4):
        raise ValueError('`scale` must broadcast with `state_parts`.')
      arg_5 = distributions.SeedStream(arg_3, salt='RandomWalkUniformFn')
      arg_6 = [
          tf.random.uniform(
              minval=state_part - scale_part,
              maxval=state_part + scale_part,
              shape=tf.shape(input=state_part),
              dtype=state_part.dtype.base_dtype,
              arg_3=arg_5())
          for scale_part, state_part in zip(arg_4, arg_2)
      ]
      return arg_6
  return _fn

Returns a callable that adds a random uniform perturbation to the input.

  For more details on `random_walk_uniform_fn`, see
  `random_walk_normal_fn`. `scale` might
  be a `Tensor` or a list of `Tensor`s that should broadcast with state parts
  of the `current_state`. The generated uniform perturbation is sampled as a
  uniform point on the rectangle `[-scale, scale]`.

  Args:
    scale: a `Tensor` or Python `list` of `Tensor`s of any shapes and `dtypes`
      controlling the upper and lower bound of the uniform proposal
      distribution.
    name: Python `str` name prefixed to Ops created by this function.
        Default value: 'random_walk_uniform_fn'.

  Returns:
    random_walk_uniform_fn: A callable accepting a Python `list` of `Tensor`s
      representing the state parts of the `current_state` and an `int`
      representing the random seed used to generate the proposal. The callable
      returns the same-type `list` of `Tensor`s as the input and represents the
      proposal for the RWM algorithm.

Returns a callable that adds a random uniform perturbation to the input .


def
Func
(
arg_0
)
:
try
:
arg_1
=
arg_0
.
mgmt_client
.
Func
(
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
raise
ServiceBusConnectionError
(
"Namespace: {} not found"
.
format
(
arg_0
.
service_namespace
)
,
e
)
arg_2
=
[
]
for
arg_3
in
arg_1
:
arg_2
.
append
(
TopicClient
.
from_entity
(
arg_0
.
_get_host
(
)
,
arg_3
,
shared_access_key_name
=
arg_0
.
shared_access_key_name
,
shared_access_key_value
=
arg_0
.
shared_access_key_value
,
debug
=
arg_0
.
debug
)
)
return
arg_2

def Func(arg_0):
        """Get a client for all topic entities in the namespace.

        :rtype: list[~azure.servicebus.servicebus_client.TopicClient]
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START Func]
                :end-before: [END Func]
                :language: python
                :dedent: 4
                :caption: List the topics from Service Bus client

        """
        try:
            arg_1 = arg_0.mgmt_client.Func()
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        arg_2 = []
        for arg_3 in arg_1:
            arg_2.append(TopicClient.from_entity(
                arg_0._get_host(), arg_3,
                shared_access_key_name=arg_0.shared_access_key_name,
                shared_access_key_value=arg_0.shared_access_key_value,
                debug=arg_0.debug))
        return arg_2

Get a client for all topic entities in the namespace.

        :rtype: list[~azure.servicebus.servicebus_client.TopicClient]
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.

        Example:
            .. literalinclude:: ../examples/test_examples.py
                :start-after: [START list_topics]
                :end-before: [END list_topics]
                :language: python
                :dedent: 4
                :caption: List the topics from Service Bus client

Get a client for all topic entities in the namespace .


def Func ( arg_0 , arg_1 ) : arg_2 = set ( ) arg_3 = [ ] for arg_4 , arg_5 in iteritems ( arg_1 ) : try : arg_6 = arg_0 . genes . index ( arg_4 ) except ValueError : arg_6 = None arg_7 = arg_6 is not None arg_8 = arg_5 in arg_0 . genes if arg_7 and arg_8 : arg_9 = arg_0 . genes . get_by_id ( arg_4 ) if arg_9 is not arg_0 . genes . get_by_id ( arg_5 ) : arg_3 . append ( arg_9 ) arg_2 . update ( arg_9 . _reaction ) elif arg_7 and not arg_8 : arg_10 = arg_0 . genes [ arg_6 ] arg_0 . genes . _dict . pop ( arg_10 . id ) arg_10 . id = arg_5 arg_0 . genes [ arg_6 ] = arg_10 elif not arg_7 and arg_8 : pass else : pass arg_0 . repair ( ) class Renamer ( NodeTransformer ) : def visit_Name ( arg_13 , arg_14 ) : arg_14 . id = arg_1 . get ( arg_14 . id , arg_14 . id ) return arg_14 arg_15 = Renamer ( ) for arg_16 , arg_17 in iteritems ( get_compiled_gene_reaction_rules ( arg_0 ) ) : if arg_17 is not None : arg_16 . _gene_reaction_rule = ast2str ( arg_15 . visit ( arg_17 ) ) for arg_16 in arg_2 : arg_16 . gene_reaction_rule = arg_16 . _gene_reaction_rule for arg_20 in arg_3 : arg_0 . genes . remove ( arg_20 )

def Func(arg_0, arg_1):
    """renames genes in a model from the rename_dict"""
    arg_2 = set()  # need to recomptue related genes
    arg_3 = []
    for arg_4, arg_5 in iteritems(arg_1):
        # undefined if there a value matches a different key
        # because dict is unordered
        try:
            arg_6 = arg_0.genes.index(arg_4)
        except ValueError:
            arg_6 = None
        arg_7 = arg_6 is not None
        arg_8 = arg_5 in arg_0.genes
        if arg_7 and arg_8:
            arg_9 = arg_0.genes.get_by_id(arg_4)
            # Added in case not renaming some genes:
            if arg_9 is not arg_0.genes.get_by_id(arg_5):
                arg_3.append(arg_9)
                arg_2.update(arg_9._reaction)
        elif arg_7 and not arg_8:
            # rename old gene to new gene
            arg_10 = arg_0.genes[arg_6]
            # trick DictList into updating index
            arg_0.genes._dict.pop(arg_10.id)  # ugh
            arg_10.id = arg_5
            arg_0.genes[arg_6] = arg_10
        elif not arg_7 and arg_8:
            pass
        else:  # if not old gene_present and not new_gene_present
            # the new gene's _model will be set by repair
            # This would add genes from rename_dict
            # that are not associated with a rxn
            # cobra_model.genes.append(Gene(new_name))
            pass
    arg_0.repair()

    class Renamer(NodeTransformer):
        def visit_Name(arg_13, arg_14):
            arg_14.id = arg_1.get(arg_14.id, arg_14.id)
            return arg_14

    arg_15 = Renamer()
    for arg_16, arg_17 in iteritems(get_compiled_gene_reaction_rules(arg_0)):
        if arg_17 is not None:
            arg_16._gene_reaction_rule = ast2str(arg_15.visit(arg_17))

    for arg_16 in arg_2:
        arg_16.gene_reaction_rule = arg_16._gene_reaction_rule
    for arg_20 in arg_3:
        arg_0.genes.remove(arg_20)


def Func(arg_0, arg_1):
        '''Create a new weighted MinHash given a weighted Jaccard vector.
        Each dimension is an integer
        frequency of the corresponding element in the multi-set represented
        by the vector.

        Args:
            v (numpy.array): The Jaccard vector.
        '''
        if not isinstance(arg_1, collections.Iterable):
            raise TypeError("Input vector must be an iterable")
        if not len(arg_1) == arg_0.dim:
            raise ValueError("Input dimension mismatch, expecting %d" % arg_0.dim)
        if not isinstance(arg_1, np.ndarray):
            arg_1 = np.array(arg_1, dtype=np.float32)
        elif arg_1.dtype != np.float32:
            arg_1 = arg_1.astype(np.float32)
        arg_2 = np.zeros((arg_0.sample_size, 2), dtype=np.int)
        arg_3 = (arg_1 == 0)
        if arg_3.all():
            raise ValueError("Input is all zeros")
        arg_1[arg_3] = np.nan
        arg_4 = np.log(arg_1)
        for arg_5 in range(arg_0.sample_size):
            arg_6 = np.floor((arg_4 / arg_0.rs[arg_5]) + arg_0.betas[arg_5])
            arg_7 = (arg_6 - arg_0.betas[arg_5]) * arg_0.rs[arg_5]
            arg_8 = arg_0.ln_cs[arg_5] - arg_7 - arg_0.rs[arg_5]
            arg_9 = np.nanargmin(arg_8)
            arg_2[arg_5][0], arg_2[arg_5][1] = arg_9, int(arg_6[arg_9])
        return WeightedMinHash(arg_0.seed, arg_2)

Create a new weighted MinHash given a weighted Jaccard vector . Each dimension is an integer frequency of the corresponding element in the multi - set represented by the vector .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = _Func_counters if arg_1 == - 1 : arg_1 = { } if arg_0 not in arg_1 : arg_1 [ arg_0 ] = infinite ( ) while arg_1 [ arg_0 ] : yield "{0}-{1}" . format ( arg_0 , next ( arg_1 [ arg_0 ] ) )

def Func(arg_0, arg_1=None):
    """
    generator that returns an unique string

    :param prefix: prefix of string
    :param cache: cache used to store the last used number

    >>> next(Func('abc'))
    'abc-0'
    >>> next(Func('abc'))
    'abc-1'
    """
    if arg_1 is None:
        arg_1 = _Func_counters
    if arg_1 == -1:
        arg_1 = {}

    if arg_0 not in arg_1:
        arg_1[arg_0] = infinite()

    while arg_1[arg_0]:
        yield "{0}-{1}".format(arg_0, next(arg_1[arg_0]))

generator that returns an unique string

    :param prefix: prefix of string
    :param cache: cache used to store the last used number

    >>> next(sequence('abc'))
    'abc-0'
    >>> next(sequence('abc'))
    'abc-1'


def Func ( arg_0 , arg_1 ) : @ wraps ( arg_0 ) def _wrapped ( * arg_2 , ** arg_3 ) : with arg_1 . as_default ( ) : return arg_0 ( * arg_2 , ** arg_3 ) return _wrapped

def Func(arg_0, arg_1):
    """Constructs function encapsulated in the graph."""
    @wraps(arg_0)
    def _wrapped(*arg_2, **arg_3):
        with arg_1.as_default():
            return arg_0(*arg_2, **arg_3)
    return _wrapped

Constructs function encapsulated in the graph .


def
Func
(
arg_0
)
:
if
arg_0
.
reuse_files
:
try
:
arg_0
.
load_config_from_json
(
)
except
(
AssertionError
,
IOError
)
as
e
:
arg_0
.
log
.
error
(
"Could not load config from JSON: %s"
%
e
)
else
:
arg_0
.
write_connection_files
=
False
default_secure
(
arg_0
.
config
)
arg_0
.
log
.
debug
(
"Config changed"
)
arg_0
.
log
.
debug
(
repr
(
arg_0
.
config
)
)

def Func(arg_0):
        """secondary config, loading from JSON and setting defaults"""
        if arg_0.reuse_files:
            try:
                arg_0.load_config_from_json()
            except (AssertionError,IOError) as e:
                arg_0.log.error("Could not load config from JSON: %s" % e)
            else:
                # successfully loaded config from JSON, and reuse=True
                # no need to wite back the same file
                arg_0.write_connection_files = False

        # switch Session.key default to secure
        default_secure(arg_0.config)
        arg_0.log.debug("Config changed")
        arg_0.log.debug(repr(arg_0.config))

secondary config loading from JSON and setting defaults


def Func(arg_0):
    """Decorate methods when repository path is required."""
    @wraps(arg_0)
    def wrapper(arg_1, *arg_2, **arg_3):
        if arg_1.path is None:
            warnings.warn('Must load (Repository.load_repository) or initialize (Repository.create_repository) the repository first !')
            return
        return arg_0(arg_1, *arg_2, **arg_3)
    return wrapper

Decorate methods when repository path is required .


return int(time_since_epoch.total_seconds() * magnitude)

def Func(arg_0, arg_1=1.0):
    """
    Convert an ISO-8601 datetime string to a Unix epoch timestamp in some magnitude.

    By default, returns seconds.
    """
    arg_2 = parse_lms_api_datetime(arg_0)
    arg_3 = arg_2 - UNIX_EPOCH
    return int(arg_3.total_seconds() * arg_1)

Convert an ISO - 8601 datetime string to a Unix epoch timestamp in some magnitude .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = Membership . get ( arg_0 , arg_1 ) if arg_3 is not None : if arg_2 : return True elif arg_3 . state == MembershipState . ACTIVE : return True return False

def Func(arg_0, arg_1, arg_2=False):
        """Verify if given user is a group member.

        :param user: User to be checked.
        :param bool with_pending: Whether to include pending users or not.
        :returns: True or False.
        """
        arg_3 = Membership.get(arg_0, arg_1)
        if arg_3 is not None:
            if arg_2:
                return True
            elif arg_3.state == MembershipState.ACTIVE:
                return True
        return False

Verify if given user is a group member .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = list ( set ( arg_0 . vars ) | set ( arg_1 . vars ) ) arg_4 = dict ( ( event_values ( e , arg_3 ) , arg_0 . p ( e ) * arg_1 . p ( e ) ) for e in all_events ( arg_3 , arg_2 , { } ) ) return Factor ( arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2):
        "Multiply two factors, combining their variables."
        arg_3 = list(set(arg_0.vars) | set(arg_1.vars))
        arg_4 = dict((event_values(e, arg_3), arg_0.p(e) * arg_1.p(e))
                   for e in all_events(arg_3, arg_2, {}))
        return Factor(arg_3, arg_4)

Multiply two factors combining their variables .


def
Func
(
arg_0
,
arg_1
)
:
logger
.
info
(
"Removing old dashboard menu, if any"
)
if
arg_1
==
"6"
:
arg_2
=
".kibana/doc/metadashboard"
else
:
arg_2
=
".kibana/metadashboard/main"
arg_3
=
urijoin
(
arg_0
.
conf
[
'es_enrichment'
]
[
'url'
]
,
arg_2
)
arg_0
.
grimoire_con
.
delete
(
arg_3
)

def Func(arg_0, arg_1):
        """Remove existing menu for dashboard, if any.

        Usually, we remove the menu before creating a new one.

        :param kibiter_major: major version of kibiter
        """
        logger.info("Removing old dashboard menu, if any")
        if arg_1 == "6":
            arg_2 = ".kibana/doc/metadashboard"
        else:
            arg_2 = ".kibana/metadashboard/main"
        arg_3 = urijoin(arg_0.conf['es_enrichment']['url'], arg_2)
        arg_0.grimoire_con.delete(arg_3)

Remove existing menu for dashboard if any .


def Func():
    """Fetches changes and applies them to VIFs periodically

    Process as of RM11449:
    * Get all groups from redis
    * Fetch ALL VIFs from Xen
    * Walk ALL VIFs and partition them into added, updated and removed
    * Walk the final "modified" VIFs list and apply flows to each
    """
    arg_0 = sg_cli.SecurityGroupsClient()
    arg_1 = xapi.XapiClient()

    arg_2 = set()
    while True:
        try:
            arg_2 = arg_1.get_interfaces()
        except Exception:
            LOG.exception("Unable to get instances/interfaces from xapi")
            _sleep()
            continue

        try:
            arg_3 = arg_0.get_security_group_states(arg_2)
            arg_4, arg_5, arg_6 = partition_vifs(arg_1,
                                                            arg_2,
                                                            arg_3)
            arg_1.update_interfaces(arg_4, arg_5, arg_6)
            arg_7 = [v for v in arg_4 + arg_5 if v.success]
            # NOTE(quade): This solves a race condition where a security group
            # rule may have changed between the time the sg_states were called
            # and when they were officially ack'd. It functions as a compare
            # and set. This is a fix until we get onto a proper messaging
            # queue. NCP-2287
            arg_8 = arg_0.get_security_group_states(arg_2)
            arg_7 = get_groups_to_ack(arg_7, arg_3,
                                              arg_8)
            # This list will contain all the security group rules that do not
            # match
            ack_groups(arg_0, arg_7)

        except Exception:
            LOG.exception("Unable to get security groups from registry and "
                          "apply them to xapi")
            _sleep()
            continue

        _sleep()


def Func(arg_0):
        """
        Pull a water heater's usage report from the API.
        """
        arg_1 = USAGE_URL % arg_0
        arg_2 = requests.get(arg_1, headers=HEADERS)
        arg_3 = str(arg_2.status_code)
        if arg_3 == '401':
            _LOGGER.error("Token expired.")
            return False
        try:
            return arg_2.json()
        except ValueError:
            _LOGGER.info("Failed to get usage. Not supported by unit?")
            return None

Pull a water heater s usage report from the API .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_active ( ) if arg_2 : arg_0 . fullscreen ( ) else : arg_0 . unfullscreen ( )

def Func(arg_0, arg_1):
        """
        Widget Action to Toggle fullscreen from the GUI
        """
        arg_2 = arg_1.get_active()
        if arg_2:
            arg_0.fullscreen()
        else:
            arg_0.unfullscreen()


def Func(arg_0):
    """Returns the Scrabble score of a letter.

    Args:
        letter: a single character string

    Raises:
        TypeError if a non-Scrabble character is supplied
    """

    arg_1 = {
        1: ["a", "e", "i", "o", "u", "l", "n", "r", "s", "t"],
        2: ["d", "g"],
        3: ["b", "c", "m", "p"],
        4: ["f", "h", "v", "w", "y"],
        5: ["k"],
        8: ["j", "x"],
        10: ["q", "z"],
    }

    for arg_2, arg_3 in arg_1.items():
        if arg_0.lower() in arg_3:
            return arg_2
    else:
        raise TypeError("Invalid letter: %s", arg_0)

Returns the Scrabble score of a letter .


def Func ( arg_0 , arg_1 = 100 , ** arg_2 ) : arg_3 = arg_0 . array [ 0 , : : arg_1 ] arg_4 = gromacs . collections . Collection ( [ numkit . timeseries . tcorrel ( arg_3 , Y , arg_1 = 1 , ** arg_2 ) for Y in arg_0 . array [ 1 : , : : arg_1 ] ] ) return arg_4

def Func(arg_0, arg_1=100, **arg_2):
        """Correlation "time" of data.

        The 0-th column of the data is interpreted as a time and the
        decay of the data is computed from the autocorrelation
        function (using FFT).

        .. SeeAlso:: :func:`numkit.timeseries.tcorrel`
        """
        arg_3 = arg_0.array[0,::arg_1]
        arg_4 = gromacs.collections.Collection([numkit.timeseries.tcorrel(arg_3, Y, arg_1=1, **arg_2) for Y in arg_0.array[1:,::arg_1]])
        return arg_4


(self, identity=None, overwrite=True, path=None)

def Func ( arg_0 , arg_1 = None , arg_2 = True , arg_3 = None ) : arg_4 = arg_0 . filepath if arg_3 is not None : arg_4 = Path ( arg_3 , arg_4 . name ) arg_0 . merge_da ( ) arg_5 = arg_0 . _make_photon_hdf5 ( arg_1 = arg_1 ) phc . hdf5 . Func ( arg_5 , h5_fname = str ( arg_4 ) , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=True, arg_3=None):
        """Create a smFRET Photon-HDF5 file with current timestamps."""
        arg_4 = arg_0.filepath
        if arg_3 is not None:
            arg_4 = Path(arg_3, arg_4.name)
        arg_0.merge_da()
        arg_5 = arg_0._make_photon_hdf5(arg_1=arg_1)
        phc.hdf5.Func(arg_5, h5_fname=str(arg_4),
                                  arg_2=arg_2)

Create a smFRET Photon - HDF5 file with current timestamps .


(self, body, request_id=None, project_id=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Inserts instance template using body specified
        Must be called with keyword arguments rather than positional.

        :param body: Instance template representation as object according to
            https://cloud.google.com/compute/docs/reference/rest/v1/instanceTemplates
        :type body: dict
        :param request_id: Optional, unique request_id that you might add to achieve
            full idempotence (for example when client call times out repeating the request
            with the same request id will not create a new instance template again)
            It should be in UUID format as defined in RFC 4122
        :type request_id: str
        :param project_id: Optional, Google Cloud Platform project ID where the
            Compute Engine Instance exists. If set to None or missing,
            the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """
        arg_4 = arg_0.get_conn().instanceTemplates().insert(
            project=arg_3,
            arg_1=arg_1,
            requestId=arg_2
        ).execute(num_retries=arg_0.num_retries)
        try:
            arg_5 = arg_4["name"]
        except KeyError:
            raise AirflowException(
                "Wrong response '{}' returned - it should contain "
                "'name' field".format(arg_4))
        arg_0._wait_for_operation_to_complete(arg_3=arg_3,
                                             arg_5=arg_5)

Inserts instance template using body specified Must be called with keyword arguments rather than positional .


def Func(arg_0):
        """
        Installs the mod-evasive Apache module for combating DDOS attacks.

        https://www.linode.com/docs/websites/apache-tips-and-tricks/modevasive-on-apache
        """
        arg_1 = arg_0.local_renderer
        if arg_1.env.modevasive_enabled:
            arg_0.install_packages()

            # Write conf for each Ubuntu version since they don't conflict.
            arg_2 = arg_1.render_to_file('apache/apache_modevasive.template.conf')

            # Ubuntu 12.04
            arg_1.put(
                local_path=arg_2,
                remote_path='/etc/apache2/mods-available/mod-evasive.conf',
                use_sudo=True)

            # Ubuntu 14.04
            arg_1.put(
                local_path=arg_2,
                remote_path='/etc/apache2/mods-available/evasive.conf',
                use_sudo=True)

            arg_0.enable_mod('evasive')
        else:
#             print('self.last_manifest:', self.last_manifest)
#             print('a:', self.last_manifest.apache_modevasive_enabled)
#             print('b:', self.last_manifest.modevasive_enabled)
            if arg_0.last_manifest.modevasive_enabled:
                arg_0.disable_mod('evasive')

Installs the mod - evasive Apache module for combating DDOS attacks .


def Func ( arg_0 , arg_1 , arg_2 ) -> bool : if not hasattr ( arg_1 , 'parser_tree' ) : if hasattr ( arg_2 , 'parser_tree' ) : arg_1 . parser_tree = arg_2 . parser_tree else : arg_1 . parser_tree = arg_2 else : arg_4 = arg_1 if isinstance ( arg_4 . parser_tree , parsing . Alt ) : arg_5 = list ( arg_4 . parser_tree . ptlist ) else : arg_5 = [ arg_4 . parser_tree ] arg_5 . append ( arg_2 . parser_tree ) arg_1 . parser_tree = parsing . Alt ( * tuple ( arg_5 ) ) return True

def Func(arg_0, arg_1, arg_2) -> bool:
    """Create a tree.Alt"""
    if not hasattr(arg_1, 'parser_tree'):
        # forward sublevel of alt as is
        if hasattr(arg_2, 'parser_tree'):
            arg_1.parser_tree = arg_2.parser_tree
        else:
            arg_1.parser_tree = arg_2
    else:
        arg_4 = arg_1
        if isinstance(arg_4.parser_tree, parsing.Alt):
            arg_5 = list(arg_4.parser_tree.ptlist)
        else:
            arg_5 = [arg_4.parser_tree]
        arg_5.append(arg_2.parser_tree)
        arg_1.parser_tree = parsing.Alt(*tuple(arg_5))
    return True


(self, name, factory, *factory_args, **factory_kwargs)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_5 = Funcattr ( arg_2 , 'update_thread_local' , True ) if ( not arg_5 ) or ( arg_1 not in arg_0 . __dict__ ) : arg_6 = arg_2 ( * arg_3 , ** arg_4 ) if arg_5 : setattr ( arg_0 , arg_1 , arg_6 ) return arg_6 return Funcattr ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Get attribute, creating if required using specified factory."""
        arg_5 = Funcattr(arg_2, 'update_thread_local', True)
        if (not arg_5) or (arg_1 not in arg_0.__dict__):
            arg_6 = arg_2(*arg_3, **arg_4)
            if arg_5:
                setattr(arg_0, arg_1, arg_6)
            return arg_6
        return Funcattr(arg_0, arg_1)

Get attribute creating if required using specified factory .


def
Func
(
arg_0
)
:
if
arg_0
.
Funcd
:
return
arg_0
.
callbacks
=
{
}
arg_2
=
re
.
compile
(
"^{}_?"
.
format
(
arg_0
.
function_name
)
,
flags
=
re
.
I
)
arg_3
=
set
(
)
arg_4
=
arg_0
.
body
arg_5
=
ast
.
Func
(
arg_0
.
body
,
arg_0
.
path
)
for
arg_6
in
arg_5
.
body
:
if
hasattr
(
arg_6
,
'name'
)
:
if
arg_2
.
match
(
arg_6
.
name
)
:
arg_3
.
add
(
arg_6
.
name
)
if
hasattr
(
arg_6
,
'value'
)
:
arg_7
=
arg_6
.
value
if
hasattr
(
arg_7
,
'id'
)
:
if
arg_2
.
match
(
arg_7
.
id
)
:
arg_3
.
add
(
arg_7
.
id
)
if
hasattr
(
arg_6
,
'targets'
)
:
arg_7
=
arg_6
.
targets
[
0
]
if
hasattr
(
arg_7
,
'id'
)
:
if
arg_2
.
match
(
arg_7
.
id
)
:
arg_3
.
add
(
arg_7
.
id
)
if
hasattr
(
arg_6
,
'names'
)
:
for
arg_7
in
arg_6
.
names
:
if
hasattr
(
arg_7
,
'name'
)
:
if
arg_2
.
match
(
arg_7
.
name
)
:
arg_3
.
add
(
arg_7
.
name
)
if
getattr
(
arg_7
,
'asname'
,
)
:
if
arg_2
.
match
(
arg_7
.
asname
)
:
arg_3
.
add
(
arg_7
.
asname
)
if
len
(
arg_3
)
>
0
:
arg_8
=
arg_0
.
module
for
arg_9
in
arg_3
:
arg_10
=
getattr
(
arg_8
,
arg_9
,
)
if
arg_10
and
callable
(
arg_10
)
:
arg_0
.
callbacks
[
arg_9
]
=
arg_10
else
:
raise
ParseError
(
"no main function found"
)
arg_0
.
Funcd
=
True
return
len
(
arg_0
.
callbacks
)
>
0

def Func(arg_0):
        """load the script and set the Funcr and argument info

        I feel that this is way too brittle to be used long term, I think it just
        might be best to import the stupid module, the thing I don't like about that
        is then we import basically everything, which seems bad?
        """
        if arg_0.Funcd: return

        arg_0.callbacks = {}

        # search for main and any main_* callable objects
        arg_2 = re.compile("^{}_?".format(arg_0.function_name), flags=re.I)
        arg_3 = set()
        arg_4 = arg_0.body
        arg_5 = ast.Func(arg_0.body, arg_0.path)
        for arg_6 in arg_5.body:
            if hasattr(arg_6, 'name'):
                if arg_2.match(arg_6.name):
                    arg_3.add(arg_6.name)

            if hasattr(arg_6, 'value'):
                arg_7 = arg_6.value
                if hasattr(arg_7, 'id'):
                    if arg_2.match(arg_7.id):
                        arg_3.add(arg_7.id)

            if hasattr(arg_6, 'targets'):
                arg_7 = arg_6.targets[0]
                if hasattr(arg_7, 'id'):
                    if arg_2.match(arg_7.id):
                        arg_3.add(arg_7.id)

            if hasattr(arg_6, 'names'):
                for arg_7 in arg_6.names:
                    if hasattr(arg_7, 'name'):
                        if arg_2.match(arg_7.name):
                            arg_3.add(arg_7.name)

                    if getattr(arg_7, 'asname', None):
                        if arg_2.match(arg_7.asname):
                            arg_3.add(arg_7.asname)

        if len(arg_3) > 0:
            arg_8 = arg_0.module
            for arg_9 in arg_3:
                arg_10 = getattr(arg_8, arg_9, None)
                if arg_10 and callable(arg_10):
                    arg_0.callbacks[arg_9] = arg_10

        else:
            raise ParseError("no main function found")

        arg_0.Funcd = True
        return len(arg_0.callbacks) > 0

load the script and set the parser and argument info

        I feel that this is way too brittle to be used long term, I think it just
        might be best to import the stupid module, the thing I don't like about that
        is then we import basically everything, which seems bad?


def Func ( arg_0 , arg_1 : arg_2 ) : arg_3 = arg_0 . submonitor ( arg_1 ) try : yield arg_3 finally : if arg_3 . total is None : arg_0 . update ( arg_1 ) else : arg_3 . done ( )

def Func(arg_0, arg_1: arg_2):
        """Create a submonitor with the given units"""
        arg_3 = arg_0.submonitor(arg_1)
        try:
            yield arg_3
        finally:
            if arg_3.total is None:
                # begin was never called, so the Func cannot be closed
                arg_0.update(arg_1)
            else:
                arg_3.done()


def Func ( arg_0 ) : arg_1 = unipath ( os . environ . get ( 'CPENV_HOME' , '~/.cpenv' ) ) arg_0 = unipath ( arg_0 ) return arg_0 . startswith ( arg_1 )

def Func(arg_0):
    '''Returns True if path is in CPENV_HOME'''

    arg_1 = unipath(os.environ.get('CPENV_HOME', '~/.cpenv'))
    arg_0 = unipath(arg_0)

    return arg_0.startswith(arg_1)


(y_true: List[int], y_pred: List[List[np.ndarray]], k: int)

return float(num_correct) / num_examples

def Func(arg_0: arg_1[arg_2], arg_3: arg_1[arg_1[arg_4.ndarray]], arg_6: arg_2):
    """
    Calculates recall at k ranking metric.

    Args:
        y_true: Labels. Not used in the calculation of the metric.
        y_predicted: Predictions.
            Each prediction contains ranking score of all ranking candidates for the particular data sample.
            It is supposed that the ranking score for the true candidate goes first in the prediction.

    Returns:
        Recall at k
    """
    arg_7 = float(len(arg_3))
    arg_8 = arg_4.array(arg_3)
    arg_8 = arg_4.flip(arg_4.argsort(arg_8, -1), -1)[:, :arg_6]
    arg_9 = 0
    for arg_10 in arg_8:
        if 0 in arg_10:
            arg_9 += 1
    return float(arg_9) / arg_7


def Func(arg_0, arg_1):
        """ Process a reply for a successful execution request.
        """
        arg_2 = arg_1['content']['payload']
        for arg_3 in arg_2:
            if not arg_0._process_execute_payload(arg_3):
                arg_4 = 'Warning: received unknown payload of type %s'
                print(arg_4 % repr(arg_3['source']))

Process a reply for a successful execution request .


def
Func
(
arg_0
)
:
arg_1
=
{
}
for
arg_2
in
arg_0
:
arg_3
=
arg_2
.
split
(
)
arg_4
=
"_"
.
join
(
arg_3
[
0
]
.
strip
(
)
.
split
(
"_"
)
[
0
:
3
]
)
arg_5
=
arg_3
[
1
]
arg_6
=
float
(
arg_3
[
2
]
.
rstrip
(
)
)
if
arg_4
not
in
arg_1
:
arg_1
[
arg_4
]
=
{
}
arg_1
[
arg_4
]
[
arg_5
]
=
arg_6
logger
.
info
(
"Finished parsing depth file."
)
arg_0
.
close
(
)
logger
.
debug
(
"Size of dict_cov: {} kb"
.
format
(
asizeof
(
arg_1
)
/
1024
)
)
return
arg_1

def Func(arg_0):
    """
    Function that parse samtools depth file and creates 3 dictionaries that
    will be useful to make the outputs of this script, both the tabular file
    and the json file that may be imported by pATLAS

    Parameters
    ----------
    depth_file: textIO
        the path to depth file for each sample

    Returns
    -------
    depth_dic_coverage: dict
            dictionary with the coverage per position for each plasmid
    """

    # dict to store the mean coverage for each reference
    arg_1 = {}

    for arg_2 in arg_0:
        arg_3 = arg_2.split()  # split by any white space
        arg_4 = "_".join(arg_3[0].strip().split("_")[0:3])  # store
        # only the gi for the reference
        arg_5 = arg_3[1]
        arg_6 = float(arg_3[2].rstrip())

        if arg_4 not in arg_1:
            arg_1[arg_4] = {}

        arg_1[arg_4][arg_5] = arg_6

    logger.info("Finished parsing depth file.")
    arg_0.close()

    logger.debug("Size of dict_cov: {} kb".format(
        asizeof(arg_1)/1024))

    return arg_1

Function that parse samtools depth file and creates 3 dictionaries that will be useful to make the outputs of this script both the tabular file and the json file that may be imported by pATLAS


def Func(arg_0, arg_1):
        """
        Send a line, or multiple lines sperapted by '\\r\\n'
        """
        if isinstance(arg_1, APRSPacket):
            arg_1 = str(arg_1)
        elif not isinstance(arg_1, string_type):
            raise TypeError("Expected line to be str or APRSPacket, got %s", type(arg_1))
        if not arg_0._connected:
            raise ConnectionError("not connected")

        if arg_1 == "":
            return

        arg_1 = arg_1.rstrip("\r\n") + "\r\n"

        try:
            arg_0.sock.setblocking(1)
            arg_0.sock.settimeout(5)
            arg_0._Func(arg_1)
        except socket.error as exp:
            arg_0.close()
            raise ConnectionError(str(exp))

Send a line or multiple lines sperapted by \\ r \\ n


def Func ( ) -> None : if os . path . exists ( Logger . FileName ) : os . remove ( Logger . FileName )

def Func() -> None:
        """Delete log file."""
        if os.path.exists(Logger.FileName):
            os.remove(Logger.FileName)


Try to load a blockade state file in the current directory

def
Func
(
arg_0
)
:
try
:
with
open
(
arg_0
.
_state_file
)
as
f
:
arg_1
=
yaml
.
safe_Func
(
f
)
arg_0
.
_containers
=
arg_1
[
'containers'
]
except
(
IOError
,
OSError
)
as
err
:
if
err
.
errno
==
errno
.
ENOENT
:
raise
NotInitializedError
(
"No blockade exists in this context"
)
raise
InconsistentStateError
(
"Failed to Func Blockade state: "
+
str
(
err
)
)
except
Exception
as
err
:
raise
InconsistentStateError
(
"Failed to Func Blockade state: "
+
str
(
err
)
)

def Func(arg_0):
        '''Try to Func a blockade state file in the current directory'''
        try:
            with open(arg_0._state_file) as f:
                arg_1 = yaml.safe_Func(f)
                arg_0._containers = arg_1['containers']
        except (IOError, OSError) as err:
            if err.errno == errno.ENOENT:
                raise NotInitializedError("No blockade exists in this context")
            raise InconsistentStateError("Failed to Func Blockade state: "
                                         + str(err))
        except Exception as err:
            raise InconsistentStateError("Failed to Func Blockade state: "
                                         + str(err))


return np.multiply(np.divide(self.intensity, self.sigma * np.sqrt(2.0 * np.pi)),
                           np.exp(-0.5 * np.square(np.divide(grid_radii, self.sigma))))

def Func ( arg_0 , arg_1 ) : return np . multiply ( np . divide ( arg_0 . intensity , arg_0 . sigma * np . sqrt ( 2.0 * np . pi ) ) , np . exp ( - 0.5 * np . square ( np . divide ( arg_1 , arg_0 . sigma ) ) ) )

def Func(arg_0, arg_1):
        """Calculate the intensity of the Gaussian light profile on a grid of radial coordinates.

        Parameters
        ----------
        grid_radii : float
            The radial distance from the centre of the profile. for each coordinate on the grid.
        """
        return np.multiply(np.divide(arg_0.intensity, arg_0.sigma * np.sqrt(2.0 * np.pi)),
                           np.exp(-0.5 * np.square(np.divide(arg_1, arg_0.sigma))))

Calculate the intensity of the Gaussian light profile on a grid of radial coordinates .


return [
            Tag(token=self.token, **tag) for tag in data['tags']
        ]

def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "tags" ) return [ Tag ( token = arg_0 . token , ** arg_2 ) for arg_2 in arg_1 [ 'tags' ] ]

def Func(arg_0):
        """
            This method returns a list of all tags.
        """
        arg_1 = arg_0.get_data("tags")
        return [
            Tag(token=arg_0.token, **arg_2) for arg_2 in arg_1['tags']
        ]

This method returns a list of all tags .


(I,Q,U,V, gain_offsets, phase_offsets, chan_per_coarse, feedtype='l')

def Func(arg_0,arg_1,arg_2,arg_3, arg_4, arg_5, arg_6, arg_7='l'):
    '''
    Returns calibrated Stokes parameters for an observation given an array
    of differential gains and phase differences.
    '''

    #Find shape of data arrays and calculate number of coarse channels
    arg_8 = arg_0.shape
    arg_9 = arg_0.shape[0]
    arg_10 = arg_0.shape[1]
    arg_11 = arg_0.shape[2]
    arg_12 = arg_11/arg_6

    #Reshape data arrays to separate coarse channels
    arg_0 = np.reshape(arg_0,(arg_9,arg_10,arg_12,arg_6))
    arg_1 = np.reshape(arg_1,(arg_9,arg_10,arg_12,arg_6))
    arg_2 = np.reshape(arg_2,(arg_9,arg_10,arg_12,arg_6))
    arg_3 = np.reshape(arg_3,(arg_9,arg_10,arg_12,arg_6))

    #Swap axes 2 and 3 to in order for broadcasting to work correctly
    arg_0 = np.swapaxes(arg_0,2,3)
    arg_1 = np.swapaxes(arg_1,2,3)
    arg_2 = np.swapaxes(arg_2,2,3)
    arg_3 = np.swapaxes(arg_3,2,3)

    #Apply top left corner of electronics chain inverse Mueller matrix
    arg_13 = 1/(1-arg_4**2)
    if arg_7=='l':
        arg_14 = arg_13*(arg_0-arg_4*arg_1)
        arg_15 = arg_13*(-1*arg_4*arg_0+arg_1)
        arg_0 = None
        arg_1 = None
    if arg_7=='c':
        arg_14 = arg_13*(arg_0-arg_4*arg_3)
        arg_16 = arg_13*(-1*arg_4*arg_0+arg_3)
        arg_0 = None
        arg_3 = None

    #Apply bottom right corner of electronics chain inverse Mueller matrix
    if arg_7=='l':
        arg_17 = arg_2*np.cos(arg_5)-arg_3*np.sin(arg_5)
        arg_16 = arg_2*np.sin(arg_5)+arg_3*np.cos(arg_5)
        arg_2 = None
        arg_3 = None
    if arg_7=='c':
        arg_15 = arg_1*np.cos(arg_5)+arg_2*np.sin(arg_5)
        arg_17 = -1*arg_1*np.sin(arg_5)+arg_2*np.cos(arg_5)
        arg_1 = None
        arg_2 = None

    #Reshape arrays to original shape
    arg_14 = np.reshape(np.swapaxes(arg_14,2,3),arg_8)
    arg_15 = np.reshape(np.swapaxes(arg_15,2,3),arg_8)
    arg_17 = np.reshape(np.swapaxes(arg_17,2,3),arg_8)
    arg_16 = np.reshape(np.swapaxes(arg_16,2,3),arg_8)

    #Return corrected data arrays
    return arg_14,arg_15,arg_17,arg_16

Returns calibrated Stokes parameters for an observation given an array of differential gains and phase differences .


def Func ( arg_0 , arg_1 ) : arg_0 . source = open ( arg_0 . source , 'rb' ) arg_0 . Funced = True

def Func(arg_0, arg_1):
        """
        Opens the source file.
        """
        arg_0.source = open(arg_0.source, 'rb')
        arg_0.Funced = True


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
time
.
time
(
)
arg_4
=
os
.
path
.
join
(
arg_0
.
dirs
.
outfiles
,
"tmp-{}.h5"
.
format
(
arg_0
.
name
)
)
with
h5py
.
File
(
arg_4
,
'r'
)
as
io5
:
arg_5
=
io5
[
"snparr"
]
arg_6
=
io5
[
"bisarr"
]
arg_7
=
np
.
where
(
np
.
all
(
arg_6
[
:
]
==
""
,
axis
=
0
)
)
[
0
]
if
np
.
any
(
arg_7
)
:
arg_7
=
arg_7
.
min
(
)
else
:
arg_7
=
arg_6
.
shape
[
1
]
arg_8
=
np
.
where
(
np
.
all
(
arg_5
[
:
]
==
""
,
axis
=
0
)
)
[
0
]
if
np
.
any
(
arg_8
)
:
arg_8
=
arg_8
.
min
(
)
else
:
arg_8
=
arg_5
.
shape
[
1
]
arg_9
=
open
(
arg_0
.
outfiles
.
str
,
'w'
)
arg_10
=
open
(
arg_0
.
outfiles
.
ustr
,
'w'
)
arg_11
=
{
'A'
:
'0'
,
'T'
:
'1'
,
'G'
:
'2'
,
'C'
:
'3'
,
'N'
:
'-9'
,
'-'
:
'-9'
}
if
arg_0
.
paramsdict
[
"max_alleles_consens"
]
>
1
:
for
arg_12
,
arg_13
in
enumerate
(
arg_2
)
:
arg_9
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
0
]
]
for
arg_14
in
arg_5
[
arg_12
,
:
arg_8
]
]
)
)
)
arg_9
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
1
]
]
for
arg_14
in
arg_5
[
arg_12
,
:
arg_8
]
]
)
)
)
arg_10
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
0
]
]
for
arg_14
in
arg_6
[
arg_12
,
:
arg_7
]
]
)
)
)
arg_10
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
1
]
]
for
arg_14
in
arg_6
[
arg_12
,
:
arg_7
]
]
)
)
)
else
:
for
arg_12
,
arg_13
in
enumerate
(
arg_2
)
:
arg_9
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
0
]
]
for
arg_14
in
arg_5
[
arg_12
,
:
arg_8
]
]
)
)
)
arg_10
.
write
(
"{}\t\t\t\t\t{}\n"
.
format
(
arg_13
,
"\t"
.
join
(
[
arg_11
[
DUCT
[
arg_14
]
[
0
]
]
for
arg_14
in
arg_6
[
arg_12
,
:
arg_7
]
]
)
)
)
arg_9
.
close
(
)
arg_10
.
close
(
)
LOGGER
.
debug
(
"finished writing str in: %s"
,
time
.
time
(
)
arg_3
)

def Func(arg_0, arg_1, arg_2):
    """ Write STRUCTURE format for all SNPs and unlinked SNPs """

    ## grab snp and bis data from tmparr
    arg_3 = time.time()
    arg_4 = os.path.join(arg_0.dirs.outfiles, "tmp-{}.h5".format(arg_0.name))
    with h5py.File(arg_4, 'r') as io5:
        arg_5 = io5["snparr"]
        arg_6 = io5["bisarr"]

        ## trim to size b/c it was made longer than actual
        arg_7 = np.where(np.all(arg_6[:] == "", axis=0))[0]
        if np.any(arg_7):
            arg_7 = arg_7.min()
        else:
            arg_7 = arg_6.shape[1]

        arg_8 = np.where(np.all(arg_5[:] == "", axis=0))[0]
        if np.any(arg_8):
            arg_8 = arg_8.min()
        else:
            arg_8 = arg_5.shape[1]

        ## write to str and ustr
        arg_9 = open(arg_0.outfiles.str, 'w')
        arg_10 = open(arg_0.outfiles.ustr, 'w')
        arg_11 = {'A': '0', 'T': '1', 'G': '2', 'C': '3', 'N': '-9', '-': '-9'}
        if arg_0.paramsdict["max_alleles_consens"] > 1:
            for arg_12, arg_13 in enumerate(arg_2):
                arg_9.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][0]] for arg_14 in arg_5[arg_12, :arg_8]])))
                arg_9.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][1]] for arg_14 in arg_5[arg_12, :arg_8]])))
                arg_10.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][0]] for arg_14 in arg_6[arg_12, :arg_7]])))
                arg_10.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][1]] for arg_14 in arg_6[arg_12, :arg_7]])))
        else:
            ## haploid output
            for arg_12, arg_13 in enumerate(arg_2):
                arg_9.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][0]] for arg_14 in arg_5[arg_12, :arg_8]])))
                arg_10.write("{}\t\t\t\t\t{}\n"\
                    .format(arg_13,
                    "\t".join([arg_11[DUCT[arg_14][0]] for arg_14 in arg_6[arg_12, :arg_7]])))
        arg_9.close()
        arg_10.close()
    LOGGER.debug("finished writing str in: %s", time.time() - arg_3)


def Func ( arg_0 , arg_1 = 0 ) : if len ( arg_0 . stack ) - arg_1 < 0 : raise StackUnderflow ( ) return arg_0 . stack [ arg_1 - 1 ]

def Func(arg_0, arg_1=0):
        """Read a value from the top of the stack without removing it"""
        if len(arg_0.stack) - arg_1 < 0:
            raise StackUnderflow()
        return arg_0.stack[arg_1 - 1]


def Func ( arg_0 , arg_1 , arg_2 = None ) : def cond ( arg_3 ) : if arg_3 . type . upper ( ) == "RANGE" : if arg_3 . name . upper ( ) == arg_1 . upper ( ) : if arg_2 is None : if not arg_3 . localSheetId : return True else : arg_4 = [ arg_13 . upper ( ) for arg_13 in arg_0 . sheetnames ] . index ( arg_2 . upper ( ) ) if arg_3 . localSheetId == arg_4 : return True return False def get_destinations ( arg_5 ) : from openpyxl . formula import Tokenizer from openpyxl . utils . cell import SHEETRANGE_RE if arg_5 . type == "RANGE" : arg_6 = Tokenizer ( "=" + arg_5 . value ) for arg_7 in arg_6 . items : if arg_7 . subtype == "RANGE" : arg_8 = SHEETRANGE_RE . match ( arg_7 . value ) if arg_8 . group ( "quoted" ) : arg_9 = arg_8 . group ( "quoted" ) else : arg_9 = arg_8 . group ( "notquoted" ) yield arg_9 , arg_8 . group ( "cells" ) arg_3 = next ( ( item for item in arg_0 . defined_names . definedName if cond ( item ) ) , None ) if arg_3 is None : return None arg_10 = get_destinations ( arg_3 ) arg_11 = [ ] arg_12 = [ name . upper ( ) for name in arg_0 . sheetnames ] for arg_13 , arg_14 in arg_10 : if arg_2 : arg_13 = arg_2 arg_15 = arg_12 . index ( arg_13 . upper ( ) ) arg_11 . append ( arg_0 . worksheets [ arg_15 ] [ arg_14 ] ) if len ( arg_11 ) == 1 : return arg_11 [ 0 ] else : return arg_11

def Func(arg_0, arg_1, arg_2=None):
    """Get range from a workbook.

    A workbook can contain multiple definitions for a single name,
    as a name can be defined for the entire book or for
    a particular sheet.

    If sheet is None, the book-wide def is searched,
    otherwise sheet-local def is looked up.

    Args:
        book: An openpyxl workbook object.
        rangename (str): Range expression, such as "A1", "$G4:$K10",
            named range "NamedRange1".
        sheetname (str, optional): None for book-wide name def,
            sheet name for sheet-local named range.

    Returns:
        Range object specified by the name.

    """

    def cond(arg_3):

        if arg_3.type.upper() == "RANGE":
            if arg_3.name.upper() == arg_1.upper():

                if arg_2 is None:
                    if not arg_3.localSheetId:
                        return True

                else:  # sheet local name
                    arg_4 = [arg_13.upper() for arg_13 in arg_0.sheetnames].index(
                        arg_2.upper()
                    )

                    if arg_3.localSheetId == arg_4:
                        return True

        return False

    def get_destinations(arg_5):
        """Workaround for the bug in DefinedName.destinations"""

        from openpyxl.formula import Tokenizer
        from openpyxl.utils.cell import SHEETRANGE_RE

        if arg_5.type == "RANGE":
            arg_6 = Tokenizer("=" + arg_5.value)
            for arg_7 in arg_6.items:
                if arg_7.subtype == "RANGE":
                    arg_8 = SHEETRANGE_RE.match(arg_7.value)
                    if arg_8.group("quoted"):
                        arg_9 = arg_8.group("quoted")
                    else:
                        arg_9 = arg_8.group("notquoted")

                    yield arg_9, arg_8.group("cells")

    arg_3 = next(
        (item for item in arg_0.defined_names.definedName if cond(item)), None
    )

    if arg_3 is None:
        return None

    arg_10 = get_destinations(arg_3)
    arg_11 = []

    arg_12 = [name.upper() for name in arg_0.sheetnames]

    for arg_13, arg_14 in arg_10:
        if arg_2:
            arg_13 = arg_2
        arg_15 = arg_12.index(arg_13.upper())
        arg_11.append(arg_0.worksheets[arg_15][arg_14])

    if len(arg_11) == 1:
        return arg_11[0]
    else:
        return arg_11


def Func(arg_0, arg_1):
        """Exports the stream to the given directory. The directory can't exist.
        You can later import this device by running import_stream on a device.
        """
        if os.path.exists(arg_1):
            raise FileExistsError(
                "The stream Func directory already exists")

        os.mkdir(arg_1)

        # Write the stream's info
        with open(os.path.join(arg_1, "stream.json"), "w") as f:
            json.dump(arg_0.data, f)

        # Now write the stream's data
        # We sort it first, since older versions of ConnectorDB had a bug
        # where sometimes datapoints would be returned out of order.
        arg_0[:].sort().writeJSON(os.path.join(arg_1, "data.json"))

        # And if the stream is a downlink, write the downlink data
        if arg_0.downlink:
            arg_0(i1=0, i2=0, downlink=True).sort().writeJSON(os.path.join(arg_1, "downlink.json"))

Exports the stream to the given directory . The directory can t exist . You can later import this device by running import_stream on a device .


(message, level='error', request=None, extra_data=None, payload_data=None)

def Func(arg_0, arg_1='error', arg_2=None, arg_3=None, arg_4=None):
    """
    Reports an arbitrary string message to Rollbar.

    message: the string body of the message
    level: level to report at. One of: 'critical', 'error', 'warning', 'info', 'debug'
    request: the request object for the context of the message
    extra_data: dictionary of params to include with the message. 'body' is reserved.
    payload_data: param names to pass in the 'data' level of the payload; overrides defaults.
    """
    try:
        return _Func(arg_0, arg_1, arg_2, arg_3, arg_4)
    except Exception as e:
        log.exception("Exception while reporting message to Rollbar. %r", e)

Reports an arbitrary string message to Rollbar .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
iterkeys
(
)
:
if
isinstance
(
arg_1
,
basestring
)
:
arg_2
=
arg_3
=
try
:
arg_2
=
int
(
arg_1
)
except
ValueError
:
try
:
arg_3
=
float
(
arg_1
)
except
ValueError
:
continue
if
arg_2
is
not
:
arg_4
=
arg_2
else
:
arg_4
=
arg_3
if
arg_4
in
arg_0
:
raise
KeyError
(
"already have key %r"
%
arg_4
)
arg_0
[
arg_4
]
=
arg_0
.
pop
(
arg_1
)
return
arg_0

def Func(arg_0):
    """Rekey a dict that has been forced to use str keys where there should be
    ints by json."""
    for arg_1 in arg_0.iterkeys():
        if isinstance(arg_1, basestring):
            arg_2=arg_3=None
            try:
                arg_2 = int(arg_1)
            except ValueError:
                try:
                    arg_3 = float(arg_1)
                except ValueError:
                    continue
            if arg_2 is not None:
                arg_4 = arg_2
            else:
                arg_4 = arg_3
            if arg_4 in arg_0:
                raise KeyError("already have key %r"%arg_4)
            arg_0[arg_4] = arg_0.pop(arg_1)
    return arg_0

Rekey a dict that has been forced to use str keys where there should be ints by json .


def Func(arg_0, arg_1):
    """Merge the annotations from tokens_old into tokens_new, when the
    tokens in the new document already existed in the old document.
    """
    arg_2 = InsensitiveSequenceMatcher(a=arg_0, b=arg_1)
    arg_3 = arg_2.get_opcodes()

    for arg_4, arg_5, arg_6, arg_7, arg_8 in arg_3:
        if arg_4 == 'equal':
            arg_9 = arg_0[arg_5:arg_6]
            arg_10 = arg_1[arg_7:arg_8]
            copy_annotations(arg_9, arg_10)

Merge the annotations from tokens_old into tokens_new when the tokens in the new document already existed in the old document .


def Func ( arg_0 , arg_1 = 2 ) : if arg_1 == 2 : def logfn ( arg_2 ) : return - arg_2 * np . log2 ( arg_2 ) elif arg_1 == np . e : def logfn ( arg_2 ) : return - arg_2 * np . log ( arg_2 ) else : def logfn ( arg_2 ) : return - arg_2 * np . log ( arg_2 ) / np . log ( arg_1 ) arg_3 = 0. for arg_2 in arg_0 : if 0 < arg_2 < 1 : arg_3 += logfn ( arg_2 ) return arg_3

def Func(arg_0, arg_1=2):
    """
    Compute the Shannon entropy of a probability vector.

    The shannon entropy of a probability vector pv is defined as
    $H(pv) = - \\sum_j pv[j] log_b (pv[j])$ where $0 log_b 0 = 0$.

    Args:
        pvec (array_like): a probability vector.
        base (int): the base of the logarith

    Returns:
        float: The Shannon entropy H(pvec).
    """
    # pylint: disable=missing-docstring
    if arg_1 == 2:
        def logfn(arg_2):
            return - arg_2 * np.log2(arg_2)
    elif arg_1 == np.e:
        def logfn(arg_2):
            return - arg_2 * np.log(arg_2)
    else:
        def logfn(arg_2):
            return -arg_2 * np.log(arg_2) / np.log(arg_1)

    arg_3 = 0.
    for arg_2 in arg_0:
        if 0 < arg_2 < 1:
            arg_3 += logfn(arg_2)
    return arg_3

Compute the Shannon entropy of a probability vector .


def Func ( arg_0 , arg_1 ) : arg_1 . sort ( ) if arg_1 [ 0 ] == 0 : del arg_1 [ 0 ] arg_0 . flatten ( arg_1 )

def Func(arg_0, arg_1):

        """Flattens the given layers on the canvas.

        Merges the given layers with the indices in the list
        on the bottom layer in the list.
        The other layers are discarded.

        """

        arg_1.sort()
        if arg_1[0] == 0: del arg_1[0]
        arg_0.flatten(arg_1)

Flattens the given layers on the canvas . Merges the given layers with the indices in the list on the bottom layer in the list . The other layers are discarded .


def Func ( arg_0 , arg_1 ) : arg_1 = json . dumps ( arg_1 ) with warnings . catch_warnings ( ) : warnings . simplefilter ( "ignore" ) arg_2 = arg_0 . cipher . encrypt ( arg_1 . encode ( 'utf8' ) ) arg_3 = binascii . hexlify ( arg_2 ) . decode ( 'ascii' ) return arg_3

def Func(arg_0, arg_1):
        """Turn a json serializable value into an jsonified, encrypted,
        hexa string.
        """
        arg_1 = json.dumps(arg_1)
        with warnings.catch_warnings():
            warnings.simplefilter("ignore")
            arg_2 = arg_0.cipher.encrypt(arg_1.encode('utf8'))
        arg_3 = binascii.hexlify(arg_2).decode('ascii')
        return arg_3

Turn a json serializable value into an jsonified encrypted hexa string .


(new_bound_idxs, old_bound_idxs, old_labels, N)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : assert len ( arg_1 ) - 1 == len ( arg_2 ) arg_4 = np . zeros ( arg_3 ) for arg_5 , ( arg_6 , arg_7 ) in enumerate ( zip ( arg_1 [ : - 1 ] , arg_2 ) ) : arg_4 [ arg_6 : arg_1 [ arg_5 + 1 ] ] = arg_7 arg_8 = np . zeros ( len ( arg_0 ) - 1 ) for arg_5 , arg_6 in enumerate ( arg_0 [ : - 1 ] ) : arg_8 [ arg_5 ] = np . median ( arg_4 [ arg_6 : arg_0 [ arg_5 + 1 ] ] ) return arg_8

def Func(arg_0, arg_1, arg_2, arg_3):
    """Synchronizes the labels from the old_bound_idxs to the new_bound_idxs.

    Parameters
    ----------
    new_bound_idxs: np.array
        New indeces to synchronize with.
    old_bound_idxs: np.array
        Old indeces, same shape as labels + 1.
    old_labels: np.array
        Labels associated to the old_bound_idxs.
    N: int
        Total number of frames.

    Returns
    -------
    new_labels: np.array
        New labels, synchronized to the new boundary indeces.
    """
    assert len(arg_1) - 1 == len(arg_2)

    # Construct unfolded labels array
    arg_4 = np.zeros(arg_3)
    for arg_5, (arg_6, arg_7) in enumerate(
            zip(arg_1[:-1], arg_2)):
        arg_4[arg_6:arg_1[arg_5 + 1]] = arg_7

    # Constuct new labels
    arg_8 = np.zeros(len(arg_0) - 1)
    for arg_5, arg_6 in enumerate(arg_0[:-1]):
        arg_8[arg_5] = np.median(
            arg_4[arg_6:arg_0[arg_5 + 1]])

    return arg_8

Synchronizes the labels from the old_bound_idxs to the new_bound_idxs .


def Func ( ) : arg_0 = _get_uri_from_request ( request ) arg_1 = request . method arg_2 = dict ( request . headers ) if 'wsgi.input' in arg_2 : del arg_2 [ 'wsgi.input' ] if 'wsgi.errors' in arg_2 : del arg_2 [ 'wsgi.errors' ] if request . authorization : arg_2 [ 'Authorization' ] = request . authorization arg_3 = request . form . to_dict ( ) return arg_0 , arg_1 , arg_3 , arg_2

def Func():
    """Extract request params."""

    arg_0 = _get_uri_from_request(request)
    arg_1 = request.method
    arg_2 = dict(request.headers)
    if 'wsgi.input' in arg_2:
        del arg_2['wsgi.input']
    if 'wsgi.errors' in arg_2:
        del arg_2['wsgi.errors']
    # Werkzeug, and subsequently Flask provide a safe Authorization header
    # parsing, so we just replace the Authorization header with the extraced
    # info if it was successfully parsed.
    if request.authorization:
        arg_2['Authorization'] = request.authorization

    arg_3 = request.form.to_dict()
    return arg_0, arg_1, arg_3, arg_2


def Func(arg_0, arg_1):
    """Maxheap version of a heappop followed by a heappush."""
    arg_2 = arg_0[0]    # raises appropriate IndexError if heap is empty
    arg_0[0] = arg_1
    _siftup_max(arg_0, 0)
    return arg_2

Maxheap version of a heappop followed by a heappush .


(value_and_gradients_function,
            val_0,
            search_interval,
            f_lim,
            sufficient_decrease_param=0.1,
            curvature_param=0.9,
            name=None)

def Func(arg_0,
            arg_1,
            arg_2,
            arg_3,
            arg_4=0.1,
            arg_5=0.9,
            arg_6=None):
  """Performs the secant square procedure of Hager Zhang.

  Given an interval that brackets a root, this procedure performs an update of
  both end points using two intermediate points generated using the secant
  interpolation. For details see the steps S1-S4 in [Hager and Zhang (2006)][2].

  The interval [a, b] must satisfy the opposite slope conditions described in
  the documentation for `update`.

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns an object that can be converted to a namedtuple.
      The namedtuple should have fields 'f' and 'df' that correspond to scalar
      tensors of real dtype containing the value of the function and its
      derivative at that point. The other namedtuple fields, if present,
      should be tensors or sequences (possibly nested) of tensors.
      In usual optimization application, this function would be generated by
      projecting the multivariate objective function along some specific
      direction. The direction is determined by some other procedure but should
      be a descent direction (i.e. the derivative of the projected univariate
      function must be negative at 0.).
      Alternatively, the function may represent the batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and the fields 'f' and 'df' in the returned
      namedtuple should each be a tensor of shape [n], with the corresponding
      function values and derivatives at the input points.
    val_0: A namedtuple, as returned by value_and_gradients_function evaluated
      at `0.`.
    search_interval: A namedtuple describing the current search interval,
      must include the fields:
      - converged: Boolean `Tensor` of shape [n], indicating batch members
          where search has already converged. Interval for these batch members
          won't be modified.
      - failed: Boolean `Tensor` of shape [n], indicating batch members
          where search has already failed. Interval for these batch members
          wont be modified.
      - iterations: Scalar int32 `Tensor`. Number of line search iterations
          so far.
      - func_evals: Scalar int32 `Tensor`. Number of function evaluations
          so far.
      - left: A namedtuple, as returned by value_and_gradients_function,
          of the left end point of the current search interval.
      - right: A namedtuple, as returned by value_and_gradients_function,
          of the right end point of the current search interval.
    f_lim: Scalar `Tensor` of real dtype. The function value threshold for
      the approximate Wolfe conditions to be checked.
    sufficient_decrease_param: Positive scalar `Tensor` of real dtype.
      Bounded above by the curvature param. Corresponds to 'delta' in the
      terminology of [Hager and Zhang (2006)][2].
    curvature_param: Positive scalar `Tensor` of real dtype. Bounded above
      by `1.`. Corresponds to 'sigma' in the terminology of
      [Hager and Zhang (2006)][2].
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'Func' is used.

  Returns:
    A namedtuple containing the following fields.
      active: A boolean `Tensor` of shape [n]. Used internally by the procedure
        to indicate batch members on which there is work left to do.
      converged: A boolean `Tensor` of shape [n]. Indicates whether a point
        satisfying the Wolfe conditions has been found. If this is True, the
        interval will be degenerate (i.e. `left` and `right` below will be
        identical).
      failed: A boolean `Tensor` of shape [n]. Indicates if invalid function or
        gradient values were encountered (i.e. infinity or NaNs).
      num_evals: A scalar int32 `Tensor`. The total number of function
        evaluations made.
      left: Return value of value_and_gradients_function at the updated left
        end point of the interval.
      right: Return value of value_and_gradients_function at the updated right
        end point of the interval.
  """
  with tf.compat.v1.name_scope(arg_6, 'Func', [
      arg_1, arg_2, arg_3, arg_4,
      arg_5]):
    # This will always be s.t. left <= c <= right
    arg_7 = arg_0(
        _secant(arg_2.left, arg_2.right))
    arg_8 = arg_2.failed | ~is_finite(arg_7)
    arg_9 = arg_2.converged | (~arg_8 & _satisfies_wolfe(
        arg_1, arg_7, arg_3, arg_4, arg_5))
    arg_10 = arg_9 & ~arg_2.converged
    arg_11 = val_where(arg_10, arg_7, arg_2.left)
    arg_12 = val_where(arg_10, arg_7, arg_2.right)

    arg_13 = _Secant2Result(
        active=~arg_8 & ~arg_9,
        arg_9=arg_9,
        arg_8=arg_8,
        num_evals=arg_2.func_evals + 1,
        left=arg_11,
        right=arg_12)

    def _apply_Func_inner():
      return _Func_inner(
          arg_0,
          arg_13,
          arg_1,
          arg_7,
          arg_3,
          arg_4,
          arg_5)

    return prefer_static.cond(
        tf.reduce_any(input_tensor=arg_13.active),
        _apply_Func_inner,
        lambda: arg_13)

Performs the secant square procedure of Hager Zhang.

  Given an interval that brackets a root, this procedure performs an update of
  both end points using two intermediate points generated using the secant
  interpolation. For details see the steps S1-S4 in [Hager and Zhang (2006)][2].

  The interval [a, b] must satisfy the opposite slope conditions described in
  the documentation for `update`.

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns an object that can be converted to a namedtuple.
      The namedtuple should have fields 'f' and 'df' that correspond to scalar
      tensors of real dtype containing the value of the function and its
      derivative at that point. The other namedtuple fields, if present,
      should be tensors or sequences (possibly nested) of tensors.
      In usual optimization application, this function would be generated by
      projecting the multivariate objective function along some specific
      direction. The direction is determined by some other procedure but should
      be a descent direction (i.e. the derivative of the projected univariate
      function must be negative at 0.).
      Alternatively, the function may represent the batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and the fields 'f' and 'df' in the returned
      namedtuple should each be a tensor of shape [n], with the corresponding
      function values and derivatives at the input points.
    val_0: A namedtuple, as returned by value_and_gradients_function evaluated
      at `0.`.
    search_interval: A namedtuple describing the current search interval,
      must include the fields:
      - converged: Boolean `Tensor` of shape [n], indicating batch members
          where search has already converged. Interval for these batch members
          won't be modified.
      - failed: Boolean `Tensor` of shape [n], indicating batch members
          where search has already failed. Interval for these batch members
          wont be modified.
      - iterations: Scalar int32 `Tensor`. Number of line search iterations
          so far.
      - func_evals: Scalar int32 `Tensor`. Number of function evaluations
          so far.
      - left: A namedtuple, as returned by value_and_gradients_function,
          of the left end point of the current search interval.
      - right: A namedtuple, as returned by value_and_gradients_function,
          of the right end point of the current search interval.
    f_lim: Scalar `Tensor` of real dtype. The function value threshold for
      the approximate Wolfe conditions to be checked.
    sufficient_decrease_param: Positive scalar `Tensor` of real dtype.
      Bounded above by the curvature param. Corresponds to 'delta' in the
      terminology of [Hager and Zhang (2006)][2].
    curvature_param: Positive scalar `Tensor` of real dtype. Bounded above
      by `1.`. Corresponds to 'sigma' in the terminology of
      [Hager and Zhang (2006)][2].
    name: (Optional) Python str. The name prefixed to the ops created by this
      function. If not supplied, the default name 'secant2' is used.

  Returns:
    A namedtuple containing the following fields.
      active: A boolean `Tensor` of shape [n]. Used internally by the procedure
        to indicate batch members on which there is work left to do.
      converged: A boolean `Tensor` of shape [n]. Indicates whether a point
        satisfying the Wolfe conditions has been found. If this is True, the
        interval will be degenerate (i.e. `left` and `right` below will be
        identical).
      failed: A boolean `Tensor` of shape [n]. Indicates if invalid function or
        gradient values were encountered (i.e. infinity or NaNs).
      num_evals: A scalar int32 `Tensor`. The total number of function
        evaluations made.
      left: Return value of value_and_gradients_function at the updated left
        end point of the interval.
      right: Return value of value_and_gradients_function at the updated right
        end point of the interval.

Performs the secant square procedure of Hager Zhang .


return self.optimize(constraints, X, 'minimize', M)

def Func ( arg_0 , arg_1 , arg_2 : arg_3 , arg_4 = 10000 ) : assert isinstance ( arg_2 , arg_3 ) return arg_0 . optimize ( arg_1 , arg_2 , 'Funcimize' , arg_4 )

def Func(arg_0, arg_1, arg_2: arg_3, arg_4=10000):
        """
        Iteratively finds the Funcimum value for a symbol within given constraints.

        :param constraints: constraints that the expression must fulfil
        :param X: a symbol or expression
        :param M: maximum number of iterations allowed
        """
        assert isinstance(arg_2, arg_3)
        return arg_0.optimize(arg_1, arg_2, 'Funcimize', arg_4)

Iteratively finds the minimum value for a symbol within given constraints.

        :param constraints: constraints that the expression must fulfil
        :param X: a symbol or expression
        :param M: maximum number of iterations allowed

Iteratively finds the minimum value for a symbol within given constraints .


def Func ( arg_0 , arg_1 , arg_2 = False ) : with arg_0 . _lock : if not arg_0 . done ( ) or arg_2 : arg_0 . _exception = arg_1 arg_0 . _status = 'failed'

def Func(arg_0, arg_1, arg_2=False):
        """Set an exception for the TransferFuture

        Implies the TransferFuture failed.

        :param exception: The exception that cause the transfer to fail.
        :param override: If True, override any existing state.
        """
        with arg_0._lock:
            if not arg_0.done() or arg_2:
                arg_0._exception = arg_1
                arg_0._status = 'failed'


return -R*math.log(self.beta0_mag + 1)*s

def Func(arg_0, arg_1):
        """
        Calculate the phase's magnetic contribution to entropy at the
        specified temperature.

        :param T: [K] temperature

        :returns: [J/mol/K] The magnetic entropy of the compound phase.

        Dinsdale, A. T. (1991). SGTE data for pure elements. Calphad, 15(4),
        317–425. http://doi.org/10.1016/0364-5916(91)90030-N
        """

        arg_2 = arg_1 / arg_0.Tc_mag

        if arg_2 <= 1.0:
            arg_3 = 1 - (arg_0._B_mag*(2*arg_2**3/3 + 2*arg_2**9/27 + 2*arg_2**15/75)) / \
                arg_0._D_mag
        else:
            arg_3 = (2*arg_2**-5/5 + 2*arg_2**-15/45 + 2*arg_2**-25/125)/arg_0._D_mag

        return -R*math.log(arg_0.beta0_mag + 1)*arg_3

Calculate the phase s magnetic contribution to entropy at the specified temperature .


(
    client, docs, language, name, account=None, progress=False
)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
,
arg_5
=
False
)
:
arg_6
=
'Uploaded using lumi-upload at {}'
.
format
(
time
.
asctime
(
)
)
if
arg_4
is
not
:
arg_7
=
arg_0
.
post
(
'projects'
,
arg_3
=
arg_3
,
arg_2
=
arg_2
,
arg_6
=
arg_6
,
account_id
=
arg_4
,
)
else
:
arg_7
=
arg_0
.
post
(
'projects'
,
arg_3
=
arg_3
,
arg_2
=
arg_2
,
arg_6
=
arg_6
)
arg_8
=
arg_7
[
'project_id'
]
arg_9
=
arg_0
.
client_for_path
(
'projects/'
+
arg_8
)
try
:
if
arg_5
:
arg_10
=
tqdm
(
desc
=
'Uploading documents'
)
else
:
arg_10
=
for
arg_11
in
_batches
(
arg_1
,
BATCH_SIZE
)
:
arg_12
=
[
_simplify_doc
(
doc
)
for
doc
in
arg_11
]
arg_9
.
post
(
'upload'
,
arg_1
=
arg_12
)
if
arg_5
:
arg_10
.
update
(
BATCH_SIZE
)
finally
:
if
arg_5
:
arg_10
.
close
(
)
print
(
'The server is building project {!r}.'
.
format
(
arg_8
)
)
arg_9
.
post
(
'build'
)
while
True
:
time
.
sleep
(
10
)
arg_13
=
arg_9
.
get
(
)
arg_14
=
arg_13
[
'last_build_info'
]
if
'success'
in
arg_14
:
if
not
arg_14
[
'success'
]
:
raise
LuminosoServerError
(
arg_14
[
'reason'
]
)
return
arg_13

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=False
):
    """
    Given an iterator of documents, upload them as a Luminoso project.
    """
    arg_6 = 'Uploaded using lumi-upload at {}'.format(time.asctime())
    if arg_4 is not None:
        arg_7 = arg_0.post(
            'projects',
            arg_3=arg_3,
            arg_2=arg_2,
            arg_6=arg_6,
            account_id=arg_4,
        )
    else:
        arg_7 = arg_0.post(
            'projects', arg_3=arg_3, arg_2=arg_2, arg_6=arg_6
        )
    arg_8 = arg_7['project_id']
    arg_9 = arg_0.client_for_path('projects/' + arg_8)
    try:
        if arg_5:
            arg_10 = tqdm(desc='Uploading documents')
        else:
            arg_10 = None

        for arg_11 in _batches(arg_1, BATCH_SIZE):
            arg_12 = [_simplify_doc(doc) for doc in arg_11]
            arg_9.post('upload', arg_1=arg_12)
            if arg_5:
                arg_10.update(BATCH_SIZE)

    finally:
        if arg_5:
            arg_10.close()

    print('The server is building project {!r}.'.format(arg_8))
    arg_9.post('build')

    while True:
        time.sleep(10)
        arg_13 = arg_9.get()
        arg_14 = arg_13['last_build_info']
        if 'success' in arg_14:
            if not arg_14['success']:
                raise LuminosoServerError(arg_14['reason'])
            return arg_13

Given an iterator of documents upload them as a Luminoso project .


def Func(arg_0):
        """Returns whether the next event is an arrival or a departure
        and the queue the event is accuring at.

        Returns
        -------
        des : str
            Indicates whether the next event is an arrival, a
            departure, or nothing; returns ``'Arrival'``,
            ``'Departure'``, or ``'Nothing'``.
        edge : int or ``None``
            The edge index of the edge that this event will occur at.
            If there are no events then ``None`` is returned.
        """
        if arg_0._fancy_heap.size == 0:
            arg_1 = 'Nothing'
            arg_2 = None
        else:
            arg_3 = [arg_5._key() for arg_5 in arg_0.edge2queue]
            arg_3.sort()
            arg_4 = arg_3[0][1]
            arg_5 = arg_0.edge2queue[arg_4]

            arg_1 = 'Arrival' if arg_5.Func() == 1 else 'Departure'
            arg_2 = arg_5.edge[2]
        return arg_1, arg_2

Returns whether the next event is an arrival or a departure and the queue the event is accuring at .


def Func ( arg_0 = arg_1 . cpu_count ( ) ) : arg_3 = TaskQueue ( arg_0 ) yield arg_3 arg_3 . execute ( )

def Func(arg_0=arg_1.cpu_count()):
    """Context manager for setting up a TaskQueue. Upon leaving the
    context manager, all tasks that were enqueued will be executed
    in parallel subject to `pool_size` concurrency constraints."""
    arg_3 = TaskQueue(arg_0)
    yield arg_3
    arg_3.execute()

Context manager for setting up a TaskQueue . Upon leaving the context manager all tasks that were enqueued will be executed in parallel subject to pool_size concurrency constraints .


(pfpkl_list,
                              lcbasedir,
                              outdir,
                              starfeaturesdir=None,
                              fourierorder=5,
                              # these are depth, duration, ingress duration
                              transitparams=(-0.01,0.1,0.1),
                              # these are depth, duration, depth ratio, secphase
                              ebparams=(-0.2,0.3,0.7,0.5),
                              pdiff_threshold=1.0e-4,
                              sidereal_threshold=1.0e-4,
                              sampling_peak_multiplier=5.0,
                              sampling_startp=None,
                              sampling_endp=None,
                              timecols=None,
                              magcols=None,
                              errcols=None,
                              lcformat='hat-sql',
                              lcformatdir=None,
                              sigclip=10.0,
                              verbose=False,
                              maxobjects=None,
                              nworkers=NCPUS)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
5
,
arg_5
=
(
0.01
,
0.1
,
0.1
)
,
arg_6
=
(
0.2
,
0.3
,
0.7
,
0.5
)
,
arg_7
=
1.0e-4
,
arg_8
=
1.0e-4
,
arg_9
=
5.0
,
arg_10
=
,
arg_11
=
,
arg_12
=
,
arg_13
=
,
arg_14
=
,
arg_15
=
'hat-sql'
,
arg_16
=
,
arg_17
=
10.0
,
arg_18
=
False
,
arg_19
=
,
arg_20
=
arg_21
)
:
if
not
os
.
path
.
exists
(
arg_2
)
:
os
.
makedirs
(
arg_2
)
if
arg_19
:
arg_0
=
arg_0
[
:
arg_19
]
LOGINFO
(
'%s periodfinding pickles to process'
%
len
(
arg_0
)
)
if
arg_3
and
os
.
path
.
exists
(
arg_3
)
:
arg_22
=
[
]
LOGINFO
(
'collecting starfeatures pickles...'
)
for
arg_23
in
arg_0
:
arg_24
=
os
.
path
.
basename
(
arg_23
)
.
replace
(
'periodfinding'
,
'starfeatures'
)
arg_25
=
arg_24
.
replace
(
'.gz'
,
''
)
arg_26
=
os
.
path
.
join
(
arg_3
,
arg_24
)
arg_27
=
os
.
path
.
join
(
arg_3
,
arg_25
)
if
os
.
path
.
exists
(
arg_26
)
:
arg_22
.
append
(
arg_24
)
elif
os
.
path
.
exists
(
arg_27
)
:
arg_22
.
append
(
arg_25
)
else
:
arg_22
.
append
(
)
else
:
arg_22
=
[
for
x
in
arg_0
]
arg_28
=
{
'fourierorder'
:
arg_4
,
'transitparams'
:
arg_5
,
'ebparams'
:
arg_6
,
'pdiff_threshold'
:
arg_7
,
'sidereal_threshold'
:
arg_8
,
'sampling_peak_multiplier'
:
arg_9
,
'sampling_startp'
:
arg_10
,
'sampling_endp'
:
arg_11
,
'timecols'
:
arg_12
,
'magcols'
:
arg_13
,
'errcols'
:
arg_14
,
'lcformat'
:
arg_15
,
'lcformatdir'
:
arg_15
,
'sigclip'
:
arg_17
,
'verbose'
:
arg_18
}
arg_29
=
[
(
x
,
arg_1
,
arg_2
,
y
,
arg_28
)
for
(
x
,
y
)
in
zip
(
arg_0
,
arg_22
)
]
LOGINFO
(
'processing periodfinding pickles...'
)
with
ProcessPoolExecutor
(
max_workers
=
arg_20
)
as
executor
:
arg_30
=
executor
.
map
(
_periodicfeatures_worker
,
arg_29
)
arg_31
=
[
x
for
x
in
arg_30
]
arg_32
=
{
os
.
path
.
basename
(
x
)
:
y
for
(
x
,
y
)
in
zip
(
arg_0
,
arg_31
)
}
return
arg_32

def Func(arg_0,
                              arg_1,
                              arg_2,
                              arg_3=None,
                              arg_4=5,
                              # these are depth, duration, ingress duration
                              arg_5=(-0.01,0.1,0.1),
                              # these are depth, duration, depth ratio, secphase
                              arg_6=(-0.2,0.3,0.7,0.5),
                              arg_7=1.0e-4,
                              arg_8=1.0e-4,
                              arg_9=5.0,
                              arg_10=None,
                              arg_11=None,
                              arg_12=None,
                              arg_13=None,
                              arg_14=None,
                              arg_15='hat-sql',
                              arg_16=None,
                              arg_17=10.0,
                              arg_18=False,
                              arg_19=None,
                              arg_20=arg_21):
    '''This runs periodic feature generation in parallel for all periodfinding
    pickles in the input list.

    Parameters
    ----------

    pfpkl_list : list of str
        The list of period-finding pickles to use.

    lcbasedir : str
        The base directory where the associated light curves are located.

    outdir : str
        The directory where the results will be written.

    starfeaturesdir : str or None
        The directory containing the `starfeatures-<objectid>.pkl` files for
        each object to use calculate neighbor proximity light curve features.

    fourierorder : int
        The Fourier order to use to generate sinusoidal function and fit that to
        the phased light curve.

    transitparams : list of floats
        The transit depth, duration, and ingress duration to use to generate a
        trapezoid planet transit model fit to the phased light curve. The period
        used is the one provided in `period`, while the epoch is automatically
        obtained from a spline fit to the phased light curve.

    ebparams : list of floats
        The primary eclipse depth, eclipse duration, the primary-secondary depth
        ratio, and the phase of the secondary eclipse to use to generate an
        eclipsing binary model fit to the phased light curve. The period used is
        the one provided in `period`, while the epoch is automatically obtained
        from a spline fit to the phased light curve.

    pdiff_threshold : float
        This is the max difference between periods to consider them the same.

    sidereal_threshold : float
        This is the max difference between any of the 'best' periods and the
        sidereal day periods to consider them the same.

    sampling_peak_multiplier : float
        This is the minimum multiplicative factor of a 'best' period's
        normalized periodogram peak over the sampling periodogram peak at the
        same period required to accept the 'best' period as possibly real.

    sampling_startp, sampling_endp : float
        If the `pgramlist` doesn't have a time-sampling Lomb-Scargle
        periodogram, it will be obtained automatically. Use these kwargs to
        control the minimum and maximum period interval to be searched when
        generating this periodogram.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

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

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

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    verbose : bool
        If True, will indicate progress while working.

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

    nworkers : int
        The number of parallel workers to launch to process the input.

    Returns
    -------

    dict
        A dict containing key: val pairs of the input period-finder result and
        the output periodic feature result pickles for each input pickle is
        returned.

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

    if arg_19:
        arg_0 = arg_0[:arg_19]

    LOGINFO('%s periodfinding pickles to process' % len(arg_0))

    # if the starfeaturedir is provided, try to find a starfeatures pickle for
    # each periodfinding pickle in pfpkl_list
    if arg_3 and os.path.exists(arg_3):

        arg_22 = []

        LOGINFO('collecting starfeatures pickles...')

        for arg_23 in arg_0:

            arg_24 = os.path.basename(arg_23).replace('periodfinding',
                                                     'starfeatures')
            arg_25 = arg_24.replace('.gz','')

            arg_26 = os.path.join(arg_3, arg_24)
            arg_27 = os.path.join(arg_3, arg_25)

            if os.path.exists(arg_26):
                arg_22.append(arg_24)
            elif os.path.exists(arg_27):
                arg_22.append(arg_25)
            else:
                arg_22.append(None)

    else:

        arg_22 = [None for x in arg_0]

    # generate the task list
    arg_28 = {'fourierorder':arg_4,
              'transitparams':arg_5,
              'ebparams':arg_6,
              'pdiff_threshold':arg_7,
              'sidereal_threshold':arg_8,
              'sampling_peak_multiplier':arg_9,
              'sampling_startp':arg_10,
              'sampling_endp':arg_11,
              'timecols':arg_12,
              'magcols':arg_13,
              'errcols':arg_14,
              'lcformat':arg_15,
              'lcformatdir':arg_15,
              'sigclip':arg_17,
              'verbose':arg_18}

    arg_29 = [(x, arg_1, arg_2, y, arg_28) for (x,y) in
             zip(arg_0, arg_22)]

    LOGINFO('processing periodfinding pickles...')

    with ProcessPoolExecutor(max_workers=arg_20) as executor:
        arg_30 = executor.map(_periodicfeatures_worker, arg_29)

    arg_31 = [x for x in arg_30]
    arg_32 = {os.path.basename(x):y for (x,y) in zip(arg_0, arg_31)}

    return arg_32

This runs periodic feature generation in parallel for all periodfinding pickles in the input list .


def Func(arg_0, arg_1, arg_2="all"):
        """Search this address book for contacts matching the query.

        The method can be one of "all", "name" and "uid".  The backend for this
        address book migth be load()ed if needed.

        :param query: the query to Func for
        :type query: str
        :param method: the type of fileds to use when seaching
        :type method: str
        :returns: all found contacts
        :rtype: list(carddav_object.CarddavObject)

        """
        logging.debug('address book %s, Funcing with %s', arg_0.name, arg_1)
        if not arg_0._loaded:
            arg_0.load(arg_1)
        if arg_2 == "all":
            arg_3 = arg_0._Func_all
        elif arg_2 == "name":
            arg_3 = arg_0._Func_names
        elif arg_2 == "uid":
            arg_3 = arg_0._Func_uid
        else:
            raise ValueError('Only the Func methods "all", "name" and "uid" '
                             'are supported.')
        return list(arg_3(arg_1))

Search this address book for contacts matching the query.

        The method can be one of "all", "name" and "uid".  The backend for this
        address book migth be load()ed if needed.

        :param query: the query to search for
        :type query: str
        :param method: the type of fileds to use when seaching
        :type method: str
        :returns: all found contacts
        :rtype: list(carddav_object.CarddavObject)

Search this address book for contacts matching the query .


def Func ( arg_0 ) : arg_1 = arg_0 . _model_json [ "output" ] arg_2 = arg_1 [ "centers_std" ] . cell_values Func = [ list ( cval [ 1 : ] ) for cval in arg_2 ] Func = [ list ( x ) for x in zip ( * Func ) ] return Func

def Func(arg_0):
        """The standardized centers for the kmeans model."""
        arg_1 = arg_0._model_json["output"]
        arg_2 = arg_1["centers_std"].cell_values
        Func = [list(cval[1:]) for cval in arg_2]
        Func = [list(x) for x in zip(*Func)]
        return Func

The standardized centers for the kmeans model .


return(list(reversed(sorted(
        Members, key=lambda Member: Member.fitness_score
    ))))

def Func ( arg_0 ) : return ( list ( reversed ( sorted ( arg_0 , key = lambda Member : Member . fitness_score ) ) ) )

def Func(arg_0):
    '''
    Orders population members from lowest fitness to highest fitness

    Args:
        Members (list): list of PyGenetics Member objects

    Returns:
        lsit: ordered lsit of Members, from highest fitness to lowest fitness
    '''

    return(list(reversed(sorted(
        arg_0, key=lambda Member: Member.fitness_score
    ))))


return repo in workspaces[workspace]["repositories"]

def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . exists ( arg_1 ) : return False arg_3 = arg_0 . list ( ) return arg_2 in arg_3 [ arg_1 ] [ "repositories" ]

def Func(arg_0, arg_1, arg_2):
        """Return True if workspace contains repository name."""
        if not arg_0.exists(arg_1):
            return False

        arg_3 = arg_0.list()
        return arg_2 in arg_3[arg_1]["repositories"]

Return True if workspace contains repository name .


return (10 - ((evensum + oddsum * 3) % 10)) % 10

def Func ( arg_0 ) : def sum_ ( arg_1 , arg_2 ) : return int ( arg_1 ) + int ( arg_2 ) arg_3 = reduce ( sum_ , arg_0 . ean [ : : 2 ] ) arg_4 = reduce ( sum_ , arg_0 . ean [ 1 : : 2 ] ) return ( 10 - ( ( arg_3 + arg_4 * 3 ) % 10 ) ) % 10

def Func(arg_0):
        """Calculates the checksum for EAN13-Code.

        :returns: The checksum for `self.ean`.
        :rtype: Integer
        """
        def sum_(arg_1, arg_2):
            return int(arg_1) + int(arg_2)

        arg_3 = reduce(sum_, arg_0.ean[::2])
        arg_4 = reduce(sum_, arg_0.ean[1::2])
        return (10 - ((arg_3 + arg_4 * 3) % 10)) % 10

Calculates the checksum for EAN13 - Code .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 , arg_4 = arg_0 . get_breakpoint ( arg_1 ) if not arg_2 : return False , arg_3 arg_0 . delete_breakpoint ( arg_4 ) return ( True , '' )

def Func(arg_0, arg_1):
        "Remove a breakpoint given its breakpoint number."
        arg_2, arg_3, arg_4 = arg_0.get_breakpoint(arg_1)
        if not arg_2:
            return False, arg_3
        arg_0.delete_breakpoint(arg_4)
        return (True, '')

Remove a breakpoint given its breakpoint number .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
__class__
.
MAX_TOL
if
arg_1
<
0
:
raise
QiskitError
(
"Invalid atol: must be non-negative."
)
if
arg_1
>
arg_2
:
raise
QiskitError
(
"Invalid atol: must be less than {}."
.
format
(
arg_2
)
)
arg_0
.
__class__
.
ATOL
=
arg_1

def Func(arg_0, arg_1):
        """Set the absolute tolerence parameter for float comparisons."""
        # NOTE: that this overrides the class value so applies to all
        # instances of the class.
        arg_2 = arg_0.__class__.MAX_TOL
        if arg_1 < 0:
            raise QiskitError("Invalid atol: must be non-negative.")
        if arg_1 > arg_2:
            raise QiskitError(
                "Invalid atol: must be less than {}.".format(arg_2))
        arg_0.__class__.ATOL = arg_1

Set the absolute tolerence parameter for float comparisons .


(sample, dry_run, limit, no_limit,
        database_filename, template_filename, config_filename)

def Func(arg_0, arg_1, arg_2, arg_3,
        arg_4, arg_5, arg_6):
    """Command line interface."""
    # pylint: disable=too-many-arguments
    mailmerge.api.main(
        arg_0=arg_0,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5,
        arg_6=arg_6,
    )


return {
            'objectName': self._object_name,
            'callStats': self._transform_stats(prof_stats),
            'totalTime': prof_stats.total_tt,
            'primitiveCalls': prof_stats.prim_calls,
            'totalCalls': prof_stats.total_calls,
            'timestamp': int(time.time())
        }

def Func ( arg_0 ) : arg_1 = cProfile . Profile ( ) try : with open ( arg_0 . _run_object , 'rb' ) as srcfile : arg_2 = compile ( srcfile . read ( ) , arg_0 . _run_object , 'exec' ) arg_1 . runctx ( arg_2 , arg_0 . _globs , None ) except SystemExit : pass arg_3 = pstats . Stats ( arg_1 ) arg_3 . calc_callees ( ) return { 'objectName' : arg_0 . _object_name , 'callStats' : arg_0 . _transform_stats ( arg_3 ) , 'totalTime' : arg_3 . total_tt , 'primitiveCalls' : arg_3 . prim_calls , 'totalCalls' : arg_3 . total_calls , 'timestamp' : int ( time . time ( ) ) }

def Func(arg_0):
        """Runs cProfile on a module."""
        arg_1 = cProfile.Profile()
        try:
            with open(arg_0._run_object, 'rb') as srcfile:
                arg_2 = compile(srcfile.read(), arg_0._run_object, 'exec')
            arg_1.runctx(arg_2, arg_0._globs, None)
        except SystemExit:
            pass
        arg_3 = pstats.Stats(arg_1)
        arg_3.calc_callees()
        return {
            'objectName': arg_0._object_name,
            'callStats': arg_0._transform_stats(arg_3),
            'totalTime': arg_3.total_tt,
            'primitiveCalls': arg_3.prim_calls,
            'totalCalls': arg_3.total_calls,
            'timestamp': int(time.time())
        }


def Func ( arg_0 , arg_1 ) : if not arg_1 : return arg_2 = docutils . parsers . rst . Parser ( ) arg_3 = docutils . utils . new_document ( '<%s>' % arg_0 ) arg_3 . settings = docutils . frontend . OptionParser ( ) . get_default_values ( ) arg_3 . settings . tab_width = 4 arg_3 . settings . pep_references = False arg_3 . settings . rfc_references = False arg_3 . settings . env = Env ( ) arg_2 . parse ( arg_1 , arg_3 ) if len ( arg_3 . children ) == 1 : return arg_3 . children [ 0 ] else : arg_9 = docutils . nodes . paragraph ( ) for arg_10 in arg_3 . children : arg_9 += arg_10 return arg_9

def Func(arg_0, arg_1):
    """Converts a reStructuredText into its node
    """
    if not arg_1:
        return
    arg_2 = docutils.parsers.rst.Parser()
    arg_3 = docutils.utils.new_document('<%s>' % arg_0)
    arg_3.settings = docutils.frontend.OptionParser().get_default_values()
    arg_3.settings.tab_width = 4
    arg_3.settings.pep_references = False
    arg_3.settings.rfc_references = False
    arg_3.settings.env = Env()
    arg_2.parse(arg_1, arg_3)
    if len(arg_3.children) == 1:
        return arg_3.children[0]
    else:
        arg_9 = docutils.nodes.paragraph()
        for arg_10 in arg_3.children:
            arg_9 += arg_10
        return arg_9


return [name for name, state in six.iteritems(states) if state.check()]

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { child . basename ( ) : child for child in arg_2 . children ( ) } arg_4 = set ( arg_1 ) arg_5 = set ( arg_3 ) arg_6 = arg_4 - arg_5 arg_7 = arg_5 - arg_4 for arg_8 in arg_6 : arg_1 [ arg_8 ] . close ( ) del arg_1 [ arg_8 ] for arg_8 in arg_7 : arg_1 [ arg_8 ] = State ( arg_2 = arg_3 [ arg_8 ] , arg_0 = arg_0 ) return [ arg_8 for arg_8 , arg_9 in six . iteritems ( arg_1 ) if arg_9 . Func ( ) ]

def Func(arg_0, arg_1, arg_2):
    """Check all processes"""
    arg_3 = {child.basename(): child for child in arg_2.children()}
    arg_4 = set(arg_1)
    arg_5 = set(arg_3)
    arg_6 = arg_4 - arg_5
    arg_7 = arg_5 - arg_4
    for arg_8 in arg_6:
        arg_1[arg_8].close()
        del arg_1[arg_8]
    for arg_8 in arg_7:
        arg_1[arg_8] = State(arg_2=arg_3[arg_8], arg_0=arg_0)
    return [arg_8 for arg_8, arg_9 in six.iteritems(arg_1) if arg_9.Func()]


def Func ( arg_0 , arg_1 ) : arg_2 = PALETTE . get ( arg_0 . option . palette , { } ) arg_2 = arg_2 . get ( arg_0 . term . colors , None ) Func = [ ] if arg_2 is not None : arg_4 = len ( arg_2 ) / float ( arg_1 ) for arg_5 in range ( int ( arg_1 ) ) : Func . append ( arg_0 . term . color ( arg_2 [ int ( arg_4 * arg_5 ) ] ) ) return Func

def Func(arg_0, arg_1):
        """Generate a color ramp for the current screen height."""
        arg_2 = PALETTE.get(arg_0.option.palette, {})
        arg_2 = arg_2.get(arg_0.term.colors, None)
        Func = []
        if arg_2 is not None:
            arg_4 = len(arg_2) / float(arg_1)
            for arg_5 in range(int(arg_1)):
                Func.append(arg_0.term.color(arg_2[int(arg_4 * arg_5)]))

        return Func

Generate a color ramp for the current screen height .


(self, sis_account_id,
                                                   params={})

return self.get_published_courses_in_account(
            self._sis_id(sis_account_id, sis_field="account"), params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_published_courses_in_account ( arg_0 . _sis_id ( arg_1 , sis_field = "account" ) , arg_2 )

def Func(arg_0, arg_1,
                                                   arg_2={}):
        """
        Return a list of published courses for the passed account SIS ID.
        """

        return arg_0.get_published_courses_in_account(
            arg_0._sis_id(arg_1, sis_field="account"), arg_2)

Return a list of published courses for the passed account SIS ID .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_1 += arg_3 arg_4 = arg_0 . _control . document ( ) if arg_1 == arg_0 . _get_cursor ( ) . position ( ) : arg_0 . _call_tip ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        """ Called whenever the document's content changes. Display a call tip
            if appropriate.
        """
        # Calculate where the cursor should be *after* the change:
        arg_1 += arg_3

        arg_4 = arg_0._control.document()
        if arg_1 == arg_0._get_cursor().position():
            arg_0._call_tip()

Called whenever the document s content changes . Display a call tip if appropriate .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if isinstance ( arg_3 , basestring ) : arg_3 = getattr ( logging , arg_3 ) arg_0 . log_level = arg_3 arg_0 . log . setLevel ( arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Adjust the log level when log_level is set."""
        if isinstance(arg_3, basestring):
            arg_3 = getattr(logging, arg_3)
            arg_0.log_level = arg_3
        arg_0.log.setLevel(arg_3)

Adjust the log level when log_level is set .


def Func(arg_0):
    """
    check FILENAME
        Check that FILENAME has not been edited since writing.
    """
    if len(arg_0) != 1:
        print("Please provide the name of a file to check.")
        return 1

    arg_1 = arg_0[0]

    if os.path.exists(arg_1):
        print(u"Checking existing copy of %s" % arg_1)
        arg_2 = TamperEvidentFile(arg_1)
        if arg_2.validate():
            print(u"Your copy of %s is good" % arg_1)
        else:
            print(u"Your copy of %s seems to have been edited" % arg_1)
    else:
        print(u"You don't have a copy of %s" % arg_1)

    return 0

check FILENAME Check that FILENAME has not been edited since writing .