def Func(arg_0, arg_1=False):
        """How many non-entangled subcircuits can the circuit be factored to.

        Args:
            unitary_only (bool): Compute only unitary part of graph.

        Returns:
            int: Number of connected components in circuit.
        """
        # Convert registers to ints (as done in depth).
        arg_2 = 0
        arg_3 = {}

        if arg_1:
            arg_4 = arg_0.qregs
        else:
            arg_4 = arg_0.qregs+arg_0.cregs

        for arg_5 in arg_4:
            arg_3[arg_5.name] = arg_2
            arg_2 += arg_5.size
        # Start with each qubit or cbit being its own subgraph.
        arg_7 = [[bit] for bit in range(arg_2)]

        arg_8 = len(arg_7)

        # Here we are traversing the gates and looking to see
        # which of the sub_graphs the gate joins together.
        for arg_9, arg_10, arg_11 in arg_0.data:
            if arg_1:
                arg_12 = arg_10
                arg_13 = len(arg_12)
            else:
                arg_12 = arg_10+arg_11
                arg_13 = len(arg_12) + (1 if arg_9.control else 0)

            if arg_13 >= 2 and arg_9.name not in ['barrier', 'snapshot']:
                arg_14 = []
                arg_15 = 0
                # Controls necessarily join all the cbits in the
                # register that they use.
                if arg_9.control and not arg_1:
                    arg_16 = arg_9.control[0]
                    arg_17 = arg_3[arg_16.name]
                    for arg_18 in range(arg_16.size):
                        arg_19 = arg_17+arg_18
                        for arg_20 in range(arg_8):
                            if arg_19 in arg_7[arg_20]:
                                arg_14.append(arg_20)
                                arg_15 += 1
                                break

                for arg_21 in arg_12:
                    arg_22 = arg_3[arg_21[0].name]+arg_21[1]
                    for arg_20 in range(arg_8):
                        if arg_22 in arg_7[arg_20]:
                            if arg_20 not in arg_14:
                                arg_14.append(arg_20)
                                arg_15 += 1
                                break

                # If the gate touches more than one subgraph
                # join those graphs together and return
                # reduced number of subgraphs
                if arg_15 > 1:
                    arg_23 = []
                    for arg_24 in arg_14:
                        arg_23.extend(arg_7[arg_24])
                    arg_25 = []
                    for arg_24 in range(arg_8):
                        if arg_24 not in arg_14:
                            arg_25.append(arg_7[arg_24])
                    arg_25.append(arg_23)
                    arg_7 = arg_25
                    arg_8 -= (arg_15-1)
            # Cannot go lower than one so break
            if arg_8 == 1:
                break
        return arg_8

How many non - entangled subcircuits can the circuit be factored to .


def Func(arg_0):
        """Calculate size of data of interest.
        """

        #Check to see how many integrations requested
        arg_1 = arg_0.t_stop - arg_0.t_start
        #Check to see how many frequency channels requested
        arg_2 = (arg_0.f_stop - arg_0.f_start) / abs(arg_0.header[b'foff'])

        arg_3  = arg_0._n_bytes
        arg_4 = int(arg_1*arg_2*arg_3)

        return arg_4


def Func(arg_0):
        """ Kill the running kernel. """
        if arg_0.has_kernel:
            # Pause the heart beat channel if it exists.
            if arg_0._hb_channel is not None:
                arg_0._hb_channel.pause()

            # Attempt to kill the kernel.
            try:
                arg_0.kernel.kill()
            except OSError, e:
                # In Windows, we will get an Access Denied error if the process
                # has already terminated. Ignore it.
                if sys.platform == 'win32':
                    if e.winerror != 5:
                        raise
                # On Unix, we may get an ESRCH error if the process has already
                # terminated. Ignore it.
                else:
                    from errno import ESRCH
                    if e.errno != ESRCH:
                        raise
            arg_0.kernel = None
        else:
            raise RuntimeError("Cannot kill kernel. No kernel is running!")


def Func(arg_0):
    """Test if it's OK to exit this worker. This is only called when we run
    out of prospective new models to evaluate. This method sees if all models
    have matured yet. If not, it will sleep for a bit and return False. This
    will indicate to the hypersearch worker that we should keep running, and
    check again later. This gives this worker a chance to pick up and adopt any
    model which may become orphaned by another worker before it matures.

    If all models have matured, this method will send a STOP message to all
    matured, running models (presummably, there will be just one - the model
    which thinks it's the best) before returning True.
    """
    # Send an update status periodically to the JobTracker so that it doesn't
    # think this worker is dead.
    print >> sys.stderr, "reporter:status:In hypersearchV2: Func"

    # Any immature models still running?
    if not arg_0._jobCancelled:
      (arg_1, arg_2, arg_1, arg_1, arg_1) = arg_0._resultsDB.getParticleInfos(matured=False)
      if len(arg_2) > 0:
        arg_0.logger.info("Ready to end hyperseach, but not all models have " \
                         "matured yet. Sleeping a bit to wait for all models " \
                         "to mature.")
        # Sleep for a bit, no need to check for orphaned models very often
        time.sleep(5.0 * random.random())
        return False

    # All particles have matured, send a STOP signal to any that are still
    # running.
    (arg_1, arg_2, arg_1, arg_1, arg_1) = arg_0._resultsDB.getParticleInfos(completed=False)
    for arg_3 in arg_2:
      arg_0.logger.info("Stopping model %d because the search has ended" \
                          % (arg_3))
      arg_0._cjDAO.modelSetFields(arg_3,
                      dict(engStop=ClientJobsDAO.STOP_REASON_STOPPED),
                      ignoreUnchanged = True)

    # Update the HsState to get the accurate field contributions.
    arg_0._hsStatePeriodicUpdate()
    arg_4, arg_5 = \
                                          arg_0._hsState.getFieldContributions()

    # Update the results field with the new field contributions.
    arg_6 = arg_0._cjDAO.jobGetFields(arg_0._jobID, ['results'])[0]
    if arg_6 is not None:
      arg_7 = json.loads(arg_6)
    else:
      arg_7 = {}

    # Update the fieldContributions field.
    if arg_4 != arg_7.get('fieldContributions', None):
      arg_7['fieldContributions'] = arg_4
      arg_7['absoluteFieldContributions'] = arg_5

      arg_8 = arg_0._cjDAO.jobSetFieldIfEqual(arg_0._jobID,
                                                   fieldName='results',
                                                   curValue=arg_6,
                                                   newValue=json.dumps(arg_7))
      if arg_8:
        arg_0.logger.info('Successfully updated the field contributions:%s',
                                                              arg_4)
      else:
        arg_0.logger.info('Failed updating the field contributions, ' \
                         'another hypersearch worker must have updated it')

    return True

Test if it s OK to exit this worker . This is only called when we run out of prospective new models to evaluate . This method sees if all models have matured yet . If not it will sleep for a bit and return False . This will indicate to the hypersearch worker that we should keep running and check again later . This gives this worker a chance to pick up and adopt any model which may become orphaned by another worker before it matures .


def Func(arg_0, arg_1, arg_2, arg_3):
        """ Set memory protections in Unicorn correctly """
        logger.info(f"Changing permissions on {hex(start)}:{hex(start + size)} to {perms}")
        arg_0._emu.mem_protect(arg_1, arg_2, convert_permissions(arg_3))


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] while True : arg_3 , arg_4 = choice ( _tag ( True , arg_1 ) , _tag ( False , arg_0 ) ) if arg_3 : return arg_2 , arg_4 else : arg_2 . append ( arg_4 )

def Func(arg_0, arg_1):
    """Consumes as many of these as it can until it term is encountered.

    Returns a tuple of the list of these results and the term result
    """
    arg_2 = []
    while True:
        arg_3, arg_4 = choice(_tag(True, arg_1),
                              _tag(False, arg_0))
        if arg_3:
            return arg_2, arg_4
        else:
            arg_2.append(arg_4)

Consumes as many of these as it can until it term is encountered . Returns a tuple of the list of these results and the term result


def Func ( arg_0 , arg_1 ) : arg_2 = 0 for arg_3 , arg_4 , arg_5 in os . walk ( arg_1 ) : if arg_0 . dirname not in arg_4 : arg_4 [ : ] = [ ] continue arg_4 . remove ( arg_0 . dirname ) arg_6 = os . path . join ( arg_3 , arg_0 . dirname , 'entries' ) if not os . path . exists ( arg_6 ) : continue arg_7 , arg_8 = arg_0 . _get_svn_url_rev ( arg_3 ) if arg_3 == arg_1 : arg_9 = arg_7 + '/' elif not arg_7 or not arg_7 . startswith ( arg_9 ) : arg_4 [ : ] = [ ] continue arg_2 = max ( arg_2 , arg_8 ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the maximum revision for all files under a given location
        """
        # Note: taken from setuptools.command.egg_info
        arg_2 = 0

        for arg_3, arg_4, arg_5 in os.walk(arg_1):
            if arg_0.dirname not in arg_4:
                arg_4[:] = []
                continue    # no sense walking uncontrolled subdirs
            arg_4.remove(arg_0.dirname)
            arg_6 = os.path.join(arg_3, arg_0.dirname, 'entries')
            if not os.path.exists(arg_6):
                # FIXME: should we warn?
                continue

            arg_7, arg_8 = arg_0._get_svn_url_rev(arg_3)

            if arg_3 == arg_1:
                arg_9 = arg_7 + '/'   # save the root url
            elif not arg_7 or not arg_7.startswith(arg_9):
                arg_4[:] = []
                continue    # not part of the same svn tree, skip it
            arg_2 = max(arg_2, arg_8)
        return arg_2


def Func ( arg_0 , arg_1 , arg_2 = None ) : while arg_0 . current is not None : if arg_0 . current . kind == arg_1 and ( arg_2 is None or arg_0 . current . value == arg_2 ) : arg_0 . consume ( arg_1 ) return arg_0 . stream . move ( )

def Func(arg_0, arg_1, arg_2=None):
        """Skip tokens in the stream until a certain token kind is reached.

        If `value` is specified, tokens whose values are different will also
        be skipped.
        """
        while arg_0.current is not None:
            if arg_0.current.kind == arg_1 and (
                arg_2 is None or arg_0.current.value == arg_2
            ):
                arg_0.consume(arg_1)
                return
            arg_0.stream.move()

Skip tokens in the stream until a certain token kind is reached .


(service, service_type='client', future_expiration_minutes=15, account_number=None,
                      assume_role=None, session_name='cloudaux', region='us-east-1', return_credentials=False,
                      external_id=None, arn_partition='aws')

def Func(arg_0, arg_1='client', arg_2=15, arg_3=None,
                      arg_4=None, arg_5='cloudaux', arg_6='us-east-1', arg_7=False,
                      arg_8=None, arg_9='aws'):
    """
    Used to obtain a boto3 client or resource connection.
    For cross account, provide both account_number and assume_role.

    :usage:

    # Same Account:
    client = Func('iam')
    resource = Func('iam', service_type='resource')

    # Cross Account Client:
    client = Func('iam', account_number='000000000000', assume_role='role_name')

    # Cross Account Resource:
    resource = Func('iam', service_type='resource', account_number='000000000000', assume_role='role_name')

    :param service: AWS service (i.e. 'iam', 'ec2', 'kms')
    :param service_type: 'client' or 'resource'
    :param future_expiration_minutes: Connections will expire from the cache
        when their expiration is within this many minutes of the present time. [Default 15]
    :param account_number: Required if assume_role is provided.
    :param assume_role:  Name of the role to assume into for account described by account_number.
    :param session_name: Session name to attach to requests. [Default 'cloudaux']
    :param region: Region name for connection. [Default us-east-1]
    :param return_credentials: Indicates if the STS credentials should be returned with the client [Default False]
    :param external_id: Optional external id to pass to sts:AssumeRole.
        See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
    :param arn_partition: Optional parameter to specify other aws partitions such as aws-us-gov for aws govcloud
    :return: boto3 client or resource connection
    """
    arg_10 = (
        arg_3,
        arg_4,
        arg_5,
        arg_8,
        arg_6,
        arg_1,
        arg_0,
        arg_9
    )

    if arg_10 in arg_17:
        arg_11 = _get_cached_creds(arg_10, arg_0, arg_1, arg_6, arg_2, arg_7)
        if arg_11:
            return arg_11

    arg_12 = None
    if arg_4:
        arg_13 = boto3.session.Session().client('sts')

        # prevent malformed ARN
        if not all([arg_3, arg_4]):
            raise ValueError("Account number and role to assume are both required")

        arg_14 = 'arn:{partition}:iam::{0}:role/{1}'.format(
            arg_3,
            arg_4,
            partition=arg_9
        )

        arg_15 = {
            'RoleArn': arg_14,
            'RoleSessionName': arg_5
        }

        if arg_8:
            arg_15['ExternalId'] = arg_8

        arg_12 = arg_13.assume_role(**arg_15)

    if arg_1 == 'client':
        arg_16 = _client(arg_0, arg_6, arg_12)
    elif arg_1 == 'resource':
        arg_16 = _resource(arg_0, arg_6, arg_12)

    if arg_12:
        arg_17[arg_10] = arg_12

    if arg_7:
        return arg_16, arg_12['Credentials']

    return arg_16

Used to obtain a boto3 client or resource connection.
    For cross account, provide both account_number and assume_role.

    :usage:

    # Same Account:
    client = boto3_cached_conn('iam')
    resource = boto3_cached_conn('iam', service_type='resource')

    # Cross Account Client:
    client = boto3_cached_conn('iam', account_number='000000000000', assume_role='role_name')

    # Cross Account Resource:
    resource = boto3_cached_conn('iam', service_type='resource', account_number='000000000000', assume_role='role_name')

    :param service: AWS service (i.e. 'iam', 'ec2', 'kms')
    :param service_type: 'client' or 'resource'
    :param future_expiration_minutes: Connections will expire from the cache
        when their expiration is within this many minutes of the present time. [Default 15]
    :param account_number: Required if assume_role is provided.
    :param assume_role:  Name of the role to assume into for account described by account_number.
    :param session_name: Session name to attach to requests. [Default 'cloudaux']
    :param region: Region name for connection. [Default us-east-1]
    :param return_credentials: Indicates if the STS credentials should be returned with the client [Default False]
    :param external_id: Optional external id to pass to sts:AssumeRole.
        See https://docs.aws.amazon.com/IAM/latest/UserGuide/id_roles_create_for-user_externalid.html
    :param arn_partition: Optional parameter to specify other aws partitions such as aws-us-gov for aws govcloud
    :return: boto3 client or resource connection

Used to obtain a boto3 client or resource connection . For cross account provide both account_number and assume_role .


(self, script, job_descriptor, inputs, outputs, mounts)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = sorted ( [ var . docker_path if var . recursive else os . path . dirname ( var . docker_path ) for var in arg_3 | arg_4 | arg_5 if var . value ] ) arg_7 = { _SCRIPT_VARNAME : repr ( arg_1 . value ) , _META_YAML_VARNAME : repr ( arg_2 . to_yaml ( ) ) , 'DIR_COUNT' : str ( len ( arg_6 ) ) } for arg_8 , arg_9 in enumerate ( arg_6 ) : arg_7 [ 'DIR_{}' . format ( arg_8 ) ] = os . path . join ( providers_util . DATA_MOUNT_POINT , arg_9 ) return arg_7

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Return a dict with variables for the 'prepare' action."""

    # Add the _SCRIPT_REPR with the repr(script) contents
    # Add the _META_YAML_REPR with the repr(meta) contents

    # Add variables for directories that need to be created, for example:
    # DIR_COUNT: 2
    # DIR_0: /mnt/data/input/gs/bucket/path1/
    # DIR_1: /mnt/data/output/gs/bucket/path2

    # List the directories in sorted order so that they are created in that
    # order. This is primarily to ensure that permissions are set as we create
    # each directory.
    # For example:
    #   mkdir -m 777 -p /root/first/second
    #   mkdir -m 777 -p /root/first
    # *may* not actually set 777 on /root/first

    arg_6 = sorted([
        var.docker_path if var.recursive else os.path.dirname(var.docker_path)
        for var in arg_3 | arg_4 | arg_5
        if var.value
    ])

    arg_7 = {
        _SCRIPT_VARNAME: repr(arg_1.value),
        _META_YAML_VARNAME: repr(arg_2.to_yaml()),
        'DIR_COUNT': str(len(arg_6))
    }

    for arg_8, arg_9 in enumerate(arg_6):
      arg_7['DIR_{}'.format(arg_8)] = os.path.join(providers_util.DATA_MOUNT_POINT,
                                               arg_9)

    return arg_7

Return a dict with variables for the prepare action .


def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : arg_4 = arg_0 . _data . Func ( arg_1 . lower ( ) ) if arg_4 is not None : return arg_4 [ 1 ] elif arg_2 is not arg_3 : return arg_2 else : return None

def Func(arg_0, arg_1, arg_2=arg_3):
        """
        Gets the value from the key.
        If the key doesn't exist, the default value is returned, otherwise None.

        :param key: The key
        :param default: The default value
        :return: The value
        """
        arg_4 = arg_0._data.Func(arg_1.lower())
        if arg_4 is not None:
            return arg_4[1]
        elif arg_2 is not arg_3:
            return arg_2
        else:
            return None

Gets the value from the key . If the key doesn t exist the default value is returned otherwise None .


def Func ( arg_0 ) : arg_0 . hide_error_message ( ) arg_0 . ui . show_all_curves . setDisabled ( True ) arg_0 . ui . sens . setDisabled ( True ) arg_0 . ui . show_grid . setDisabled ( True ) arg_1 = os . path . dirname ( sys . argv [ 0 ] ) arg_2 = os . path . abspath ( arg_1 ) arg_0 . verbose_value = arg_0 . ui . verbose_value . setText ( "6" ) arg_0 . report_parameter_value = arg_0 . ui . report_parameter_value . setText ( "Rrs" ) arg_0 . ui . progressBar . reset ( )

def Func(arg_0):
        """
        This function does all required actions at the beginning when we run the GUI.
        """
        arg_0.hide_error_message()

        arg_0.ui.show_all_curves.setDisabled(True)
        arg_0.ui.sens.setDisabled(True)
        arg_0.ui.show_grid.setDisabled(True)

        arg_1 = os.path.dirname(sys.argv[0])
        arg_2 = os.path.abspath(arg_1)
        # self.phytoplankton_path = self.ui.phyto_path.setText(path.replace('gui', 'inputs/iop_files'))
        # self.bottom_path = self.ui.bottom_path.setText(path.replace('gui', 'inputs/bottom_files'))
        # self.executive_path = self.ui.exec_path.setText("Decide where will be 'jude2_install/bin'")
        arg_0.verbose_value = arg_0.ui.verbose_value.setText("6")
        arg_0.report_parameter_value = arg_0.ui.report_parameter_value.setText("Rrs")

        arg_0.ui.progressBar.reset()

This function does all required actions at the beginning when we run the GUI .


return _convert_points_to_shapely_line_string(self.exterior, closed=closed, interpolate=interpolate)

def Func(arg_0, arg_1=False, arg_2=0):
        """
        Convert this polygon to a Shapely LineString object.

        Parameters
        ----------
        closed : bool, optional
            Whether to return the line string with the last point being identical to the first point.

        interpolate : int, optional
            Number of points to interpolate between any pair of two consecutive points. These points are added
            to the final line string.

        Returns
        -------
        shapely.geometry.LineString
            The Shapely LineString matching the polygon's exterior.

        """
        return _convert_points_Func(arg_0.exterior, arg_1=arg_1, arg_2=arg_2)

Convert this polygon to a Shapely LineString object .


(self, name=None, attrs={}, text=None, **kwargs)

return self._findOne(self.findAllNext, name, attrs, text, **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = { } , arg_3 = None , ** arg_4 ) : return arg_0 . _findOne ( arg_0 . findAllNext , arg_1 , arg_2 , arg_3 , ** arg_4 )

def Func(arg_0, arg_1=None, arg_2={}, arg_3=None, **arg_4):
        """Returns the first item that matches the given criteria and
        appears after this Tag in the document."""
        return arg_0._findOne(arg_0.findAllNext, arg_1, arg_2, arg_3, **arg_4)

Returns the first item that matches the given criteria and appears after this Tag in the document .


(self, window_name, object_name, row_text)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
_get_object_handle
(
arg_1
,
arg_2
)
if
not
arg_4
.
AXEnabled
:
raise
LdtpServerException
(
u"Object %s state disabled"
%
arg_2
)
arg_5
=
0
for
arg_6
in
arg_4
.
AXRows
:
if
re
.
match
(
arg_3
,
arg_6
.
AXChildren
[
0
]
.
AXValue
)
:
return
arg_5
arg_5
+=
1
raise
LdtpServerException
(
u"Unable to find row: %s"
%
arg_3
)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Get table row index matching given text

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string
        @param row_text: Row text to select
        @type row_text: string

        @return: row index matching the text on success.
        @rtype: integer
        """
        arg_4 = arg_0._get_object_handle(arg_1, arg_2)
        if not arg_4.AXEnabled:
            raise LdtpServerException(u"Object %s state disabled" % arg_2)

        arg_5 = 0
        for arg_6 in arg_4.AXRows:
            if re.match(arg_3,
                        arg_6.AXChildren[0].AXValue):
                return arg_5
            arg_5 += 1
        raise LdtpServerException(u"Unable to find row: %s" % arg_3)


def Func ( arg_0 ) : arg_1 = tfd . MultivariateNormalDiag ( scale_diag = tf . ones ( [ 0 ] , arg_0 = arg_0 ) ) arg_1 . covariance = lambda : arg_1 . variance ( ) [ ... , tf . newaxis ] return arg_1

def Func(arg_0):
  """Build a zero-dimensional MVNDiag object."""
  arg_1 = tfd.MultivariateNormalDiag(
      scale_diag=tf.ones([0], arg_0=arg_0))
  arg_1.covariance = lambda: arg_1.variance()[..., tf.newaxis]
  return arg_1

Build a zero - dimensional MVNDiag object .


(
            self, nodes_health_state_filter=0, applications_health_state_filter=0, events_health_state_filter=0, exclude_health_statistics=False, include_system_application_health_statistics=False, timeout=60, custom_headers=None, raw=False, **operation_config)

def Func(
            arg_0, arg_1=0, arg_2=0, arg_3=0, arg_4=False, arg_5=False, arg_6=60, arg_7=None, arg_8=False, **arg_9):
        """Gets the health of a Service Fabric cluster.

        Use EventsHealthStateFilter to filter the collection of health events
        reported on the cluster based on the health state.
        Similarly, use NodesHealthStateFilter and ApplicationsHealthStateFilter
        to filter the collection of nodes and applications returned based on
        their aggregated health state.

        :param nodes_health_state_filter: Allows filtering of the node health
         state objects returned in the result of cluster health query
         based on their health state. The possible values for this parameter
         include integer value of one of the
         following health states. Only nodes that match the filter are
         returned. All nodes are used to evaluate the aggregated health state.
         If not specified, all entries are returned.
         The state values are flag-based enumeration, so the value could be a
         combination of these values obtained using bitwise 'OR' operator.
         For example, if the provided value is 6 then health state of nodes
         with HealthState value of OK (2) and Warning (4) are returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type nodes_health_state_filter: int
        :param applications_health_state_filter: Allows filtering of the
         application health state objects returned in the result of cluster
         health
         query based on their health state.
         The possible values for this parameter include integer value obtained
         from members or bitwise operations
         on members of HealthStateFilter enumeration. Only applications that
         match the filter are returned.
         All applications are used to evaluate the aggregated health state. If
         not specified, all entries are returned.
         The state values are flag-based enumeration, so the value could be a
         combination of these values obtained using bitwise 'OR' operator.
         For example, if the provided value is 6 then health state of
         applications with HealthState value of OK (2) and Warning (4) are
         returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type applications_health_state_filter: int
        :param events_health_state_filter: Allows filtering the collection of
         HealthEvent objects returned based on health state.
         The possible values for this parameter include integer value of one of
         the following health states.
         Only events that match the filter are returned. All events are used to
         evaluate the aggregated health state.
         If not specified, all entries are returned. The state values are
         flag-based enumeration, so the value could be a combination of these
         values, obtained using the bitwise 'OR' operator. For example, If the
         provided value is 6 then all of the events with HealthState value of
         OK (2) and Warning (4) are returned.
         - Default - Default value. Matches any HealthState. The value is zero.
         - None - Filter that doesn't match any HealthState value. Used in
         order to return no results on a given collection of states. The value
         is 1.
         - Ok - Filter that matches input with HealthState value Ok. The value
         is 2.
         - Warning - Filter that matches input with HealthState value Warning.
         The value is 4.
         - Error - Filter that matches input with HealthState value Error. The
         value is 8.
         - All - Filter that matches input with any HealthState value. The
         value is 65535.
        :type events_health_state_filter: int
        :param exclude_health_statistics: Indicates whether the health
         statistics should be returned as part of the query result. False by
         default.
         The statistics show the number of children entities in health state
         Ok, Warning, and Error.
        :type exclude_health_statistics: bool
        :param include_system_application_health_statistics: Indicates whether
         the health statistics should include the fabric:/System application
         health statistics. False by default.
         If IncludeSystemApplicationHealthStatistics is set to true, the health
         statistics include the entities that belong to the fabric:/System
         application.
         Otherwise, the query result includes health statistics only for user
         applications.
         The health statistics must be included in the query result for this
         parameter to be applied.
        :type include_system_application_health_statistics: bool
        :param timeout: The server timeout for performing the operation in
         seconds. This timeout specifies the time duration that the client is
         willing to wait for the requested operation to complete. The default
         value for this parameter is 60 seconds.
        :type timeout: long
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: ClusterHealth or ClientRawResponse if raw=true
        :rtype: ~azure.servicefabric.models.ClusterHealth or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`FabricErrorException<azure.servicefabric.models.FabricErrorException>`
        """
        arg_10 = "6.0"

        # Construct URL
        arg_11 = arg_0.Func.metadata['url']

        # Construct parameters
        arg_12 = {}
        arg_12['api-version'] = arg_0._serialize.query("api_version", arg_10, 'str')
        if arg_1 is not None:
            arg_12['NodesHealthStateFilter'] = arg_0._serialize.query("nodes_health_state_filter", arg_1, 'int')
        if arg_2 is not None:
            arg_12['ApplicationsHealthStateFilter'] = arg_0._serialize.query("applications_health_state_filter", arg_2, 'int')
        if arg_3 is not None:
            arg_12['EventsHealthStateFilter'] = arg_0._serialize.query("events_health_state_filter", arg_3, 'int')
        if arg_4 is not None:
            arg_12['ExcludeHealthStatistics'] = arg_0._serialize.query("exclude_health_statistics", arg_4, 'bool')
        if arg_5 is not None:
            arg_12['IncludeSystemApplicationHealthStatistics'] = arg_0._serialize.query("include_system_application_health_statistics", arg_5, 'bool')
        if arg_6 is not None:
            arg_12['timeout'] = arg_0._serialize.query("timeout", arg_6, 'long', maximum=4294967295, minimum=1)

        # Construct headers
        arg_13 = {}
        arg_13['Accept'] = 'application/json'
        if arg_7:
            arg_13.update(arg_7)

        # Construct and send request
        arg_14 = arg_0._client.get(arg_11, arg_12, arg_13)
        arg_15 = arg_0._client.send(arg_14, stream=False, **arg_9)

        if arg_15.status_code not in [200]:
            raise models.FabricErrorException(arg_0._deserialize, arg_15)

        arg_16 = None

        if arg_15.status_code == 200:
            arg_16 = arg_0._deserialize('ClusterHealth', arg_15)

        if arg_8:
            arg_17 = ClientRawResponse(arg_16, arg_15)
            return arg_17

        return arg_16

Gets the health of a Service Fabric cluster .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
arg_3
,
arg_4
=
arg_0
.
command
(
"GROUP"
,
arg_2
)
if
arg_3
!=
211
:
raise
NNTPReplyError
(
arg_3
,
arg_4
)
arg_5
=
arg_4
.
split
(
,
4
)
try
:
arg_6
=
int
(
arg_5
[
0
]
)
arg_7
=
int
(
arg_5
[
1
]
)
arg_8
=
int
(
arg_5
[
2
]
)
Func
=
arg_5
[
3
]
except
(
IndexError
,
ValueError
)
:
raise
NNTPDataError
(
"Invalid GROUP status '%s'"
%
arg_4
)
return
arg_6
,
arg_7
,
arg_8
,
Func

def Func(arg_0, arg_1):
        """GROUP command.
        """
        arg_2 = arg_1

        arg_3, arg_4 = arg_0.command("GROUP", arg_2)
        if arg_3 != 211:
            raise NNTPReplyError(arg_3, arg_4)

        arg_5 = arg_4.split(None, 4)
        try:
            arg_6 = int(arg_5[0])
            arg_7 = int(arg_5[1])
            arg_8  = int(arg_5[2])
            Func = arg_5[3]
        except (IndexError, ValueError):
            raise NNTPDataError("Invalid GROUP status '%s'" % arg_4)

        return arg_6, arg_7, arg_8, Func


def
Func
(
arg_0
)
:
arg_1
=
{
'instance-state-name'
:
'running'
,
'tag:Name'
:
arg_0
}
arg_2
=
boto
.
connect_ec2
(
region
=
get_region
(
)
)
arg_3
=
arg_2
.
get_all_instances
(
filters
=
arg_1
)
if
len
(
arg_3
)
==
0
:
raise
Exception
(
'Host "%s" not found'
%
arg_0
)
print
(
arg_3
[
0
]
.
instances
[
0
]
.
public_dns_name
)

def Func(arg_0):
    """
    Prints the public dns name of `name`, if it exists.

    :param name: The instance name.
    :type name: ``str``
    """
    arg_1 = {'instance-state-name': 'running', 'tag:Name': arg_0}
    arg_2 = boto.connect_ec2(region=get_region())
    arg_3 = arg_2.get_all_instances(filters=arg_1)
    if len(arg_3) == 0:
        raise Exception('Host "%s" not found' % arg_0)
    print(arg_3[0].instances[0].public_dns_name)

Prints the public dns name of name if it exists .


(gene_list, gene_sets, organism='human', description='',
            outdir='Enrichr', background='hsapiens_gene_ensembl', cutoff=0.05,
            format='pdf', figsize=(8,6), top_term=10, no_plot=False, verbose=False)

def Func(arg_0, arg_1, arg_2='human', arg_3='',
            arg_4='Enrichr', arg_5='hsapiens_gene_ensembl', arg_6=0.05,
            arg_7='pdf', arg_8=(8,6), arg_9=10, arg_10=False, arg_11=False):
    """Enrichr API.

    :param gene_list: Flat file with list of genes, one gene id per row, or a python list object
    :param gene_sets: Enrichr Library to query. Required Func library name(s). Separate each name by comma.
    :param organism: Enrichr supported organism. Select from (human, mouse, yeast, fly, fish, worm).
                     see here for details: https://amp.pharm.mssm.edu/modEnrichr
    :param description: name of analysis. optional.
    :param outdir: Output file directory
    :param float cutoff: Adjusted P-value (benjamini-hochberg correction) cutoff. Default: 0.05
    :param int background: BioMart dataset name for retrieving background gene information.
                           This argument only works when gene_sets input is a gmt file or python dict.
                           You could also specify a number by yourself, e.g. total expressed genes number.
                           In this case, you will skip retrieving background infos from biomart.

    Use the code below to see valid background dataset names from BioMart.
    Here are example code:
    >>> from gseapy.parser import Biomart
    >>> bm = Biomart(verbose=False, host="asia.ensembl.org")
    >>> ## view validated marts
    >>> marts = bm.get_marts()
    >>> ## view validated dataset
    >>> datasets = bm.get_datasets(mart='ENSEMBL_MART_ENSEMBL')

    :param str format: Output figure format supported by matplotlib,('pdf','png','eps'...). Default: 'pdf'.
    :param list figsize: Matplotlib figsize, accept a tuple or list, e.g. (width,height). Default: (6.5,6).
    :param bool no_plot: If equals to True, no figure will be drawn. Default: False.
    :param bool verbose: Increase output verbosity, print out progress of your job, Default: False.

    :return: An Enrichr object, which obj.res2d stores your last query, obj.results stores your all queries.

    """
    arg_12 = Enrichr(arg_0, arg_1, arg_2, arg_3, arg_4,
                  arg_6, arg_5, arg_7, arg_8, arg_9, arg_10, arg_11)
    arg_12.run()

    return arg_12

Enrichr API.

    :param gene_list: Flat file with list of genes, one gene id per row, or a python list object
    :param gene_sets: Enrichr Library to query. Required enrichr library name(s). Separate each name by comma.
    :param organism: Enrichr supported organism. Select from (human, mouse, yeast, fly, fish, worm).
                     see here for details: https://amp.pharm.mssm.edu/modEnrichr
    :param description: name of analysis. optional.
    :param outdir: Output file directory
    :param float cutoff: Adjusted P-value (benjamini-hochberg correction) cutoff. Default: 0.05
    :param int background: BioMart dataset name for retrieving background gene information.
                           This argument only works when gene_sets input is a gmt file or python dict.
                           You could also specify a number by yourself, e.g. total expressed genes number.
                           In this case, you will skip retrieving background infos from biomart.

    Use the code below to see valid background dataset names from BioMart.
    Here are example code:
    >>> from gseapy.parser import Biomart
    >>> bm = Biomart(verbose=False, host="asia.ensembl.org")
    >>> ## view validated marts
    >>> marts = bm.get_marts()
    >>> ## view validated dataset
    >>> datasets = bm.get_datasets(mart='ENSEMBL_MART_ENSEMBL')

    :param str format: Output figure format supported by matplotlib,('pdf','png','eps'...). Default: 'pdf'.
    :param list figsize: Matplotlib figsize, accept a tuple or list, e.g. (width,height). Default: (6.5,6).
    :param bool no_plot: If equals to True, no figure will be drawn. Default: False.
    :param bool verbose: Increase output verbosity, print out progress of your job, Default: False.

    :return: An Enrichr object, which obj.res2d stores your last query, obj.results stores your all queries.


def Func ( arg_0 , ** arg_1 ) : arg_0 . items ( ** arg_1 ) return int ( arg_0 . request . headers . get ( "last-modified-version" , 0 ) )

def Func(arg_0, **arg_1):
        """ Get the last modified version
        """
        arg_0.items(**arg_1)
        return int(arg_0.request.headers.get("last-modified-version", 0))


def Func(arg_0):
    """
    Replaces invalid MLEngine job_id characters with '_'.

    This also adds a leading 'z' in case job_id starts with an invalid
    character.

    Args:
        job_id: A job_id str that may have invalid characters.

    Returns:
        A valid job_id representation.
    """

    # Add a prefix when a job_id starts with a digit or a template
    arg_1 = re.search(r'\d|\{{2}', arg_0)
    if arg_1 and arg_1.start() == 0:
        arg_2 = 'z_{}'.format(arg_0)
    else:
        arg_2 = arg_0

    # Clean up 'bad' characters except templates
    arg_3 = 0
    arg_4 = ''
    for arg_5 in re.finditer(r'\{{2}.+?\}{2}', arg_2):
        arg_4 += re.sub(r'[^0-9a-zA-Z]+', '_',
                                  arg_2[arg_3:arg_5.start()])
        arg_4 += arg_2[arg_5.start():arg_5.end()]
        arg_3 = arg_5.end()

    # Clean up last substring or the full string if no templates
    arg_4 += re.sub(r'[^0-9a-zA-Z]+', '_', arg_2[arg_3:])

    return arg_4

Replaces invalid MLEngine job_id characters with _ .


return is_np_array(val) and issubclass(val.dtype.type, np.floating)

def Func ( arg_0 ) : return is_np_array ( arg_0 ) and issubclass ( arg_0 . dtype . type , np . floating )

def Func(arg_0):
    """
    Checks whether a variable is a numpy float array.

    Parameters
    ----------
    val
        The variable to check.

    Returns
    -------
    bool
        True if the variable is a numpy float array. Otherwise False.

    """
    return is_np_array(arg_0) and issubclass(arg_0.dtype.type, np.floating)

Checks whether a variable is a numpy float array .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
tier_type
!=
'TextTier'
:
raise
Exception
(
'Tiertype must be TextTier.'
)
arg_0
.
intervals
=
[
i
for
i
in
arg_0
.
intervals
if
i
[
0
]
!=
arg_1
]

def Func(arg_0, arg_1):
        """Remove a point, if no point is found nothing happens.

        :param int time: Time of the point.
        :raises TierTypeException: If the tier is not a TextTier.
        """
        if arg_0.tier_type != 'TextTier':
            raise Exception('Tiertype must be TextTier.')
        arg_0.intervals = [i for i in arg_0.intervals if i[0] != arg_1]

Remove a point if no point is found nothing happens .


def Func(arg_0):
        """Asserts that val is iterable and does not contain any duplicate items."""
        try:
            if len(arg_0.val) == len(set(arg_0.val)):
                return arg_0
        except TypeError:
            raise TypeError('val is not iterable')
        arg_0._err('Expected <%s> to not contain duplicates, but did.' % arg_0.val)

Asserts that val is iterable and does not contain any duplicate items .


(X, order, norm='biased', allow_singularity=True)

def Func ( arg_0 , arg_1 , arg_2 = 'biased' , arg_3 = True ) : assert arg_2 in [ 'biased' , 'unbiased' ] arg_4 = CORRELATION ( arg_0 , maxlags = arg_1 , arg_2 = arg_2 ) arg_5 , arg_6 , arg_7 = LEVINSON ( arg_4 , arg_3 = arg_3 ) return arg_5 , arg_6 , arg_7

def Func(arg_0, arg_1, arg_2='biased', arg_3=True):
    r"""Compute AR coefficients using Yule-Walker method

    :param X: Array of complex data values, X(1) to X(N)
    :param int order: Order of autoregressive process to be fitted (integer)
    :param str norm: Use a biased or unbiased correlation.
    :param bool allow_singularity:

    :return:
        * AR coefficients (complex)
        * variance of white noise (Real)
        * reflection coefficients for use in lattice filter

    .. rubric:: Description:

    The Yule-Walker method returns the polynomial A corresponding to the
    AR parametric signal model estimate of vector X using the Yule-Walker
    (autocorrelation) method. The autocorrelation may be computed using a
    **biased** or **unbiased** estimation. In practice, the biased estimate of
    the autocorrelation is used for the unknown true autocorrelation. Indeed,
    an unbiased estimate may result in nonpositive-definite autocorrelation
    matrix.
    So, a biased estimate leads to a stable AR filter.
    The following matrix form represents the Yule-Walker equations. The are
    solved by means of the Levinson-Durbin recursion:

     .. math::

        \left( \begin{array}{cccc}
        r(1) & r(2)^* & \dots & r(n)^*\\
        r(2) & r(1)^* & \dots & r(n-1)^*\\
        \dots & \dots & \dots & \dots\\
        r(n) & \dots & r(2) & r(1) \end{array} \right)
        \left( \begin{array}{cccc}
        a(2)\\
        a(3) \\
        \dots \\
        a(n+1)  \end{array} \right)
        =
        \left( \begin{array}{cccc}
        -r(2)\\
        -r(3) \\
        \dots \\
        -r(n+1)  \end{array} \right)

    The outputs consists of the AR coefficients, the estimated variance of the
    white noise process, and the reflection coefficients. These outputs can be
    used to estimate the optimal order by using :mod:`~spectrum.criteria`.

    .. rubric:: Examples:

    From a known AR process or order 4, we estimate those AR parameters using
    the Func function.

    .. doctest::

        >>> from scipy.signal import lfilter
        >>> from spectrum import *
        >>> from numpy.random import randn
        >>> A  =[1, -2.7607, 3.8106, -2.6535, 0.9238]
        >>> noise = randn(1, 1024)
        >>> y = lfilter([1], A, noise);
        >>> #filter a white noise input to create AR(4) process
        >>> [ar, var, reflec] = Func(y[0], 4)
        >>> # ar should contains values similar to A

    The PSD estimate of a data samples is computed and plotted as follows:

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import *
        from pylab import *

        ar, P, k = Func(marple_data, 15, norm='biased')
        psd = arma2psd(ar)
        plot(linspace(-0.5, 0.5, 4096), 10 * log10(psd/max(psd)))
        axis([-0.5, 0.5, -60, 0])

    .. note:: The outputs have been double checked against (1) octave outputs
        (octave has norm='biased' by default) and (2) Marple test code.

    .. seealso:: This function uses :func:`~spectrum.levinson.LEVINSON` and
        :func:`~spectrum.correlation.CORRELATION`. See the :mod:`~spectrum.criteria`
        module for criteria to automatically select the AR order.

    :References: [Marple]_

    """
    assert arg_2 in ['biased', 'unbiased']
    arg_4 = CORRELATION(arg_0, maxlags=arg_1, arg_2=arg_2)
    arg_5, arg_6, arg_7 = LEVINSON(arg_4, arg_3=arg_3)
    return arg_5, arg_6, arg_7

r"""Compute AR coefficients using Yule-Walker method

    :param X: Array of complex data values, X(1) to X(N)
    :param int order: Order of autoregressive process to be fitted (integer)
    :param str norm: Use a biased or unbiased correlation.
    :param bool allow_singularity:

    :return:
        * AR coefficients (complex)
        * variance of white noise (Real)
        * reflection coefficients for use in lattice filter

    .. rubric:: Description:

    The Yule-Walker method returns the polynomial A corresponding to the
    AR parametric signal model estimate of vector X using the Yule-Walker
    (autocorrelation) method. The autocorrelation may be computed using a
    **biased** or **unbiased** estimation. In practice, the biased estimate of
    the autocorrelation is used for the unknown true autocorrelation. Indeed,
    an unbiased estimate may result in nonpositive-definite autocorrelation
    matrix.
    So, a biased estimate leads to a stable AR filter.
    The following matrix form represents the Yule-Walker equations. The are
    solved by means of the Levinson-Durbin recursion:

     .. math::

        \left( \begin{array}{cccc}
        r(1) & r(2)^* & \dots & r(n)^*\\
        r(2) & r(1)^* & \dots & r(n-1)^*\\
        \dots & \dots & \dots & \dots\\
        r(n) & \dots & r(2) & r(1) \end{array} \right)
        \left( \begin{array}{cccc}
        a(2)\\
        a(3) \\
        \dots \\
        a(n+1)  \end{array} \right)
        =
        \left( \begin{array}{cccc}
        -r(2)\\
        -r(3) \\
        \dots \\
        -r(n+1)  \end{array} \right)

    The outputs consists of the AR coefficients, the estimated variance of the
    white noise process, and the reflection coefficients. These outputs can be
    used to estimate the optimal order by using :mod:`~spectrum.criteria`.

    .. rubric:: Examples:

    From a known AR process or order 4, we estimate those AR parameters using
    the aryule function.

    .. doctest::

        >>> from scipy.signal import lfilter
        >>> from spectrum import *
        >>> from numpy.random import randn
        >>> A  =[1, -2.7607, 3.8106, -2.6535, 0.9238]
        >>> noise = randn(1, 1024)
        >>> y = lfilter([1], A, noise);
        >>> #filter a white noise input to create AR(4) process
        >>> [ar, var, reflec] = aryule(y[0], 4)
        >>> # ar should contains values similar to A

    The PSD estimate of a data samples is computed and plotted as follows:

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import *
        from pylab import *

        ar, P, k = aryule(marple_data, 15, norm='biased')
        psd = arma2psd(ar)
        plot(linspace(-0.5, 0.5, 4096), 10 * log10(psd/max(psd)))
        axis([-0.5, 0.5, -60, 0])

    .. note:: The outputs have been double checked against (1) octave outputs
        (octave has norm='biased' by default) and (2) Marple test code.

    .. seealso:: This function uses :func:`~spectrum.levinson.LEVINSON` and
        :func:`~spectrum.correlation.CORRELATION`. See the :mod:`~spectrum.criteria`
        module for criteria to automatically select the AR order.

    :References: [Marple]_

r Compute AR coefficients using Yule - Walker method


def Func(arg_0):
        """
        Construct the Discord JSON payload. All relevant parameters are combined here
        to a valid Discord JSON payload.

        :return: Discord payload (str) to send
        """
        arg_1 = {}

        if arg_0.username:
            arg_1['username'] = arg_0.username
        if arg_0.avatar_url:
            arg_1['avatar_url'] = arg_0.avatar_url

        arg_1['tts'] = arg_0.tts

        if len(arg_0.message) <= 2000:
            arg_1['content'] = arg_0.message
        else:
            raise AirflowException('Discord message length must be 2000 or fewer '
                                   'characters.')

        return json.dumps(arg_1)

Construct the Discord JSON payload . All relevant parameters are combined here to a valid Discord JSON payload .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . extensions_by_name for arg_3 , arg_4 in arg_2 . items ( ) : arg_5 = arg_3 . upper ( ) + "_FIELD_NUMBER" setattr ( arg_1 , arg_5 , arg_4 . number )

def Func(arg_0, arg_1):
  """Adds properties for all fields in this protocol message type."""
  arg_2 = arg_0.extensions_by_name
  for arg_3, arg_4 in arg_2.items():
    arg_5 = arg_3.upper() + "_FIELD_NUMBER"
    setattr(arg_1, arg_5, arg_4.number)

Adds properties for all fields in this protocol message type .


return session.query(DagRun).filter(
            DagRun.dag_id == self.dag_id,
            DagRun.execution_date == dag.previous_schedule(self.execution_date)
        ).first()

def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . get_dag ( ) return arg_1 . query ( DagRun ) . filter ( DagRun . dag_id == arg_0 . dag_id , DagRun . execution_date == arg_2 . previous_schedule ( arg_0 . execution_date ) ) . first ( )

def Func(arg_0, arg_1=None):
        """The previous, SCHEDULED DagRun, if there is one"""
        arg_2 = arg_0.get_dag()

        return arg_1.query(DagRun).filter(
            DagRun.dag_id == arg_0.dag_id,
            DagRun.execution_date == arg_2.previous_schedule(arg_0.execution_date)
        ).first()

The previous SCHEDULED DagRun if there is one


def Func ( arg_0 ) : if arg_0 . _control . textInteractionFlags ( ) & QtCore . Qt . TextEditable : return bool ( QtGui . QApplication . clipboard ( ) . text ( ) ) return False

def Func(arg_0):
        """ Returns whether text can be pasted from the clipboard.
        """
        if arg_0._control.textInteractionFlags() & QtCore.Qt.TextEditable:
            return bool(QtGui.QApplication.clipboard().text())
        return False

Returns whether text can be pasted from the clipboard .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = writes_base64 ( arg_1 ) with arg_0 . engine . begin ( ) as db : return save_remote_checkpoint ( db , arg_0 . user_id , arg_2 , arg_3 , arg_0 . crypto . encrypt , arg_0 . max_file_size_bytes , )

def Func(arg_0, arg_1, arg_2):
        """Create a checkpoint of the current state of a notebook

        Returns a checkpoint_id for the new checkpoint.
        """
        arg_3 = writes_base64(arg_1)
        with arg_0.engine.begin() as db:
            return save_remote_checkpoint(
                db,
                arg_0.user_id,
                arg_2,
                arg_3,
                arg_0.crypto.encrypt,
                arg_0.max_file_size_bytes,
            )


def Func ( arg_0 ) : try : arg_1 , arg_1 , arg_2 = split_phonemes ( arg_0 , onset = False , nucleus = False , arg_2 = True ) except ValueError : return None else : return arg_2

def Func(arg_0):
    """Picks only a coda from a Hangul letter.  It returns ``None`` if the
    given letter is not Hangul.
    """
    try:
        arg_1, arg_1, arg_2 = \
            split_phonemes(arg_0, onset=False, nucleus=False, arg_2=True)
    except ValueError:
        return None
    else:
        return arg_2

Picks only a coda from a Hangul letter . It returns None if the given letter is not Hangul .


return src[i_longest - longest : i_longest]

def Func(arg_0, arg_1, arg_2):
        """Return the longest common substring of two strings.

        Longest common substring (LCSstr).

        Based on the code from
        https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
        :cite:`Wikibooks:2018`.
        This is licensed Creative Commons: Attribution-ShareAlike 3.0.

        Modifications include:

            - conversion to a numpy array in place of a list of lists
            - conversion to Python 2/3-safe range from xrange via six

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        str
            The longest common substring

        Examples
        --------
        >>> sstr = LCSstr()
        >>> sstr.Func('cat', 'hat')
        'at'
        >>> sstr.Func('Niall', 'Neil')
        'N'
        >>> sstr.Func('aluminum', 'Catalan')
        'al'
        >>> sstr.Func('ATCG', 'TAGC')
        'A'

        """
        arg_3 = np_zeros((len(arg_1) + 1, len(arg_2) + 1), dtype=np_int)
        arg_4, arg_5 = 0, 0
        for arg_6 in range(1, len(arg_1) + 1):
            for arg_7 in range(1, len(arg_2) + 1):
                if arg_1[arg_6 - 1] == arg_2[arg_7 - 1]:
                    arg_3[arg_6, arg_7] = arg_3[arg_6 - 1, arg_7 - 1] + 1
                    if arg_3[arg_6, arg_7] > arg_4:
                        arg_4 = arg_3[arg_6, arg_7]
                        arg_5 = arg_6
                else:
                    arg_3[arg_6, arg_7] = 0
        return arg_1[arg_5 - arg_4 : arg_5]

Return the longest common substring of two strings.

        Longest common substring (LCSstr).

        Based on the code from
        https://en.wikibooks.org/wiki/Algorithm_Implementation/Strings/Longest_common_substring
        :cite:`Wikibooks:2018`.
        This is licensed Creative Commons: Attribution-ShareAlike 3.0.

        Modifications include:

            - conversion to a numpy array in place of a list of lists
            - conversion to Python 2/3-safe range from xrange via six

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        str
            The longest common substring

        Examples
        --------
        >>> sstr = LCSstr()
        >>> sstr.lcsstr('cat', 'hat')
        'at'
        >>> sstr.lcsstr('Niall', 'Neil')
        'N'
        >>> sstr.lcsstr('aluminum', 'Catalan')
        'al'
        >>> sstr.lcsstr('ATCG', 'TAGC')
        'A'

Return the longest common substring of two strings .


def Func ( arg_0 ) : arg_0 . mutex . release ( ) arg_0 . turnstile . release ( ) arg_0 . mutex . release ( ) arg_0 . turnstile2 . release ( )

def Func(arg_0):
        """ ensure the master exit from Barrier """
        arg_0.mutex.release()
        arg_0.turnstile.release()
        arg_0.mutex.release()
        arg_0.turnstile2.release()


def Func ( arg_0 , arg_1 = None ) : arg_2 = { "prefix" : arg_1 } return arg_0 . request ( method = "get" , arg_2 = arg_2 ) . json ( )

def Func(arg_0, arg_1=None):
        """ Lists all the jobs registered with Nomad.

           https://www.nomadproject.io/docs/http/jobs.html
            arguments:
              - prefix :(str) optional, specifies a string to filter jobs on based on an prefix.
                        This is specified as a querystring parameter.
            returns: list
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"prefix": arg_1}
        return arg_0.request(method="get", arg_2=arg_2).json()

Lists all the jobs registered with Nomad .


(self, channel_name, datatype, channel_type, data_url,
                     file_format, file_type, exceptions, resolution,
                     windowrange, readonly)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_9 , arg_10 ) : Func = { } Func [ 'channel_name' ] = arg_1 Func [ 'datatype' ] = arg_2 Func [ 'channel_type' ] = arg_3 if arg_7 is not None : Func [ 'exceptions' ] = arg_7 if arg_8 is not None : Func [ 'resolution' ] = arg_8 if arg_9 is not None : Func [ 'windowrange' ] = arg_9 if arg_10 is not None : Func [ 'readonly' ] = arg_10 Func [ 'data_url' ] = arg_4 Func [ 'file_format' ] = arg_5 Func [ 'file_type' ] = arg_6 return Func

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                     arg_5, arg_6, arg_7, arg_8,
                     arg_9, arg_10):
        """
        Generate the project dictionary.
        """
        Func = {}
        Func['channel_name'] = arg_1
        Func['datatype'] = arg_2
        Func['channel_type'] = arg_3
        if arg_7 is not None:
            Func['exceptions'] = arg_7
        if arg_8 is not None:
            Func['resolution'] = arg_8
        if arg_9 is not None:
            Func['windowrange'] = arg_9
        if arg_10 is not None:
            Func['readonly'] = arg_10
        Func['data_url'] = arg_4
        Func['file_format'] = arg_5
        Func['file_type'] = arg_6
        return Func


def Func(arg_0, arg_1):
        """
        Return the updated course data dictionary.

        Arguments:
            instance (dict): The course data.

        Returns:
            dict: The updated course data.
        """
        arg_2 = copy.deepcopy(arg_1)
        arg_3 = arg_0.context['enterprise_customer_catalog']
        arg_2['enrollment_url'] = arg_3.get_course_enrollment_url(
            arg_2['key']
        )
        for arg_4 in arg_2['course_runs']:
            arg_4['enrollment_url'] = arg_3.get_course_run_enrollment_url(
                arg_4['key']
            )
        return arg_2

Return the updated course data dictionary .


def Func ( arg_0 , arg_1 ) : global g_build_success global g_build_success_tests global arg_4 global arg_3 global g_build_failed_message for arg_2 in range ( 0 , len ( g_build_failed_message ) ) : if g_build_failed_message [ arg_2 ] in arg_0 . lower ( ) : if ( ( arg_2 == 0 ) and ( len ( g_failed_jobs ) > 0 ) ) : continue else : arg_3 = True arg_4 [ "7.build_failure" ] = 'Yes' arg_1 . remove ( Func ) return False return True

def Func(arg_0,arg_1):
    """
    Find if a Jenkins job has failed to build.  It will save this
    information in g_failed_test_info_dict.  In addition, it will delete this particular
    function handle off the temp_func_list as we do not need to perform this action again.

    Parameters
    ----------

    each_line :  str
        contains a line read in from jenkins console
    temp_func_list :  list of Python function handles
        contains a list of functions that we want to invoke to extract information from
        the Jenkins console text.

    :return: bool to determine if text mining should continue on the jenkins console text
    """
    global g_build_success
    global g_build_success_tests
    global arg_4
    global arg_3
    global g_build_failed_message

    for arg_2 in range(0,len(g_build_failed_message)):
        if g_build_failed_message[arg_2] in arg_0.lower():
            if ((arg_2 == 0) and (len(g_failed_jobs) > 0)):
                continue
            else:
                arg_3 = True
                arg_4["7.build_failure"] = 'Yes'
                arg_1.remove(Func)
                return False

    return True

Find if a Jenkins job has failed to build . It will save this information in g_failed_test_info_dict . In addition it will delete this particular function handle off the temp_func_list as we do not need to perform this action again .


Performs a bruteforce for the given users, password, domain on the given host.

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
CredentialSearch
(
use_pipe
=
False
)
print_notification
(
"Connecting to {}"
.
format
(
arg_3
)
)
arg_5
=
Server
(
arg_3
)
arg_6
=
Connection
(
arg_5
)
for
arg_7
in
arg_0
:
if
arg_6
.
rebind
(
arg_7
=
"{}\\{}"
.
format
(
arg_1
,
arg_7
.
username
)
,
arg_2
=
arg_2
,
authentication
=
NTLM
)
:
print_success
(
'Success for: {}:{}'
.
format
(
arg_7
.
username
,
arg_2
)
)
arg_8
=
arg_4
.
find_object
(
arg_7
.
username
,
arg_2
,
arg_1
=
arg_1
,
host_ip
=
arg_3
)
if
not
arg_8
:
arg_8
=
Credential
(
username
=
arg_7
.
username
,
secret
=
arg_2
,
arg_1
=
arg_1
,
host_ip
=
arg_3
,
type
=
"plaintext"
,
port
=
389
)
arg_8
.
add_tag
(
tag
)
arg_8
.
save
(
)
arg_7
.
add_tag
(
tag
)
arg_7
.
save
(
)
else
:
print_error
(
"Fail for: {}:{}"
.
format
(
arg_7
.
username
,
arg_2
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
        Performs a Func for the given users, password, domain on the given host.
    """
    arg_4 = CredentialSearch(use_pipe=False)

    print_notification("Connecting to {}".format(arg_3))

    arg_5 = Server(arg_3)
    arg_6 = Connection(arg_5)

    for arg_7 in arg_0:
        if arg_6.rebind(arg_7="{}\\{}".format(arg_1, arg_7.username), arg_2=arg_2, authentication=NTLM):
            print_success('Success for: {}:{}'.format(arg_7.username, arg_2))
            arg_8 = arg_4.find_object(
                arg_7.username, arg_2, arg_1=arg_1, host_ip=arg_3)
            if not arg_8:
                arg_8 = Credential(username=arg_7.username, secret=arg_2,
                                        arg_1=arg_1, host_ip=arg_3, type="plaintext", port=389)
            arg_8.add_tag(tag)
            arg_8.save()

            # Add a tag to the user object, so we dont have to Func it again.
            arg_7.add_tag(tag)
            arg_7.save()
        else:
            print_error("Fail for: {}:{}".format(arg_7.username, arg_2))

Performs a bruteforce for the given users password domain on the given host .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
import
gevent
import
gevent
.
monkey
gevent
.
monkey
.
patch_all
(
)
from
gevent
.
pywsgi
import
WSGIServer
arg_3
=
{
"bind_addr"
:
(
arg_1
[
"host"
]
,
arg_1
[
"port"
]
)
,
"wsgi_app"
:
arg_0
,
"keyfile"
:
,
"certfile"
:
,
}
arg_4
=
"http"
arg_3
.
update
(
arg_1
.
get
(
"server_args"
,
{
}
)
)
arg_5
=
WSGIServer
(
arg_3
[
"bind_addr"
]
,
arg_0
)
_logger
.
info
(
"Running {}"
.
format
(
arg_5
)
)
_logger
.
info
(
"Serving on {}://{}:{} ..."
.
format
(
arg_4
,
arg_1
[
"host"
]
,
arg_1
[
"port"
]
)
)
try
:
gevent
.
spawn
(
arg_5
.
serve_forever
(
)
)
except
KeyboardInterrupt
:
_logger
.
warning
(
"Caught Ctrl-C, shutting down..."
)
return

def Func(arg_0, arg_1, arg_2):
    """Run WsgiDAV using gevent if gevent is installed.

    See
      https://github.com/gevent/gevent/blob/master/src/gevent/pywsgi.py#L1356
      https://github.com/gevent/gevent/blob/master/src/gevent/server.py#L38
     for more options
    """
    import gevent
    import gevent.monkey

    gevent.monkey.patch_all()
    from gevent.pywsgi import WSGIServer

    arg_3 = {
        "bind_addr": (arg_1["host"], arg_1["port"]),
        "wsgi_app": arg_0,
        # TODO: SSL support
        "keyfile": None,
        "certfile": None,
    }
    arg_4 = "http"
    # Override or add custom args
    arg_3.update(arg_1.get("server_args", {}))

    arg_5 = WSGIServer(arg_3["bind_addr"], arg_0)
    _logger.info("Running {}".format(arg_5))
    _logger.info(
        "Serving on {}://{}:{} ...".format(arg_4, arg_1["host"], arg_1["port"])
    )
    try:
        gevent.spawn(arg_5.serve_forever())
    except KeyboardInterrupt:
        _logger.warning("Caught Ctrl-C, shutting down...")
    return

Run WsgiDAV using gevent if gevent is installed .


def Func ( arg_0 ) -> List [ 'Section' ] : Func = [ ] arg_2 = Func . append arg_3 = arg_0 . _type_to_spans arg_4 = arg_0 . _lststr arg_5 , arg_6 = _span = arg_0 . _span arg_7 = arg_3 . setdefault ( 'Section' , [ ] ) arg_8 = SECTIONS_FULLMATCH ( arg_0 . _shadow ) arg_9 = arg_8 . spans ( 'section' ) Func0 = [ len ( eq ) for eq in arg_8 . captures ( 'equals' ) ] if not arg_7 : Func1 = arg_7 . append for Func2 , ( Func3 , ( Func4 , Func5 ) ) in enumerate ( zip ( Func0 , arg_9 ) , 1 ) : for Func6 , Func7 in enumerate ( Func0 [ Func2 : ] , Func2 ) : if Func3 and Func7 > Func3 : Func5 = arg_9 [ Func6 ] [ 1 ] else : break Func8 = [ arg_5 + Func4 , arg_5 + Func5 ] Func1 ( Func8 ) arg_2 ( Section ( arg_4 , arg_3 , Func8 , 'Section' ) ) return Func Func9 = { ( Func4 [ 0 ] , Func4 [ 1 ] ) : Func4 for Func4 in arg_7 } . get for Func2 , ( Func3 , ( Func4 , Func5 ) ) in enumerate ( zip ( Func0 , arg_9 ) , 1 ) : for Func6 , Func7 in enumerate ( Func0 [ Func2 : ] , Func2 ) : if Func3 and Func7 > Func3 : Func5 = arg_9 [ Func6 ] [ 1 ] else : break Func4 , Func5 = arg_5 + Func4 , arg_5 + Func5 arg_20 = Func9 ( ( Func4 , Func5 ) ) if arg_20 is None : Func8 = [ Func4 , Func5 ] insort ( arg_7 , Func8 ) else : Func8 = arg_20 arg_2 ( Section ( arg_4 , arg_3 , Func8 , 'Section' ) ) return Func

def Func(arg_0) -> List['Section']:
        """Return a list of section in current wikitext.

        The first section will always be the lead section, even if it is an
        empty string.
        """
        Func = []  # type: List['Section']
        arg_2 = Func.append
        arg_3 = arg_0._type_to_spans
        arg_4 = arg_0._lststr
        arg_5, arg_6 = _span = arg_0._span
        arg_7 = arg_3.setdefault('Section', [])
        arg_8 = SECTIONS_FULLMATCH(arg_0._shadow)
        arg_9 = arg_8.spans('section')
        Func0 = [len(eq) for eq in arg_8.captures('equals')]
        if not arg_7:
            # All spans are new
            Func1 = arg_7.append
            for Func2, (Func3, (Func4, Func5)) in enumerate(
                zip(Func0, arg_9), 1
            ):
                # Add text of the current_section to any parent section.
                # Note that section 0 is not a parent for any subsection.
                for Func6, Func7 in enumerate(
                    Func0[Func2:], Func2
                ):
                    if Func3 and Func7 > Func3:
                        Func5 = arg_9[Func6][1]
                    else:
                        break
                Func8 = [arg_5 + Func4, arg_5 + Func5]
                Func1(Func8)
                arg_2(
                    Section(arg_4, arg_3, Func8, 'Section'))
            return Func
        # There are already some spans. Instead of appending new spans
        # use them when the detected span already exists.
        Func9 = {(Func4[0], Func4[1]): Func4 for Func4 in arg_7}.get
        for Func2, (Func3, (Func4, Func5)) in enumerate(
            zip(Func0, arg_9), 1
        ):
            # Add text of the current_section to any parent section.
            # Note that section 0 is not a parent for any subsection.
            for Func6, Func7 in enumerate(
                Func0[Func2:], Func2
            ):
                if Func3 and Func7 > Func3:
                    Func5 = arg_9[Func6][1]
                else:
                    break
            Func4, Func5 = arg_5 + Func4, arg_5 + Func5
            arg_20 = Func9((Func4, Func5))
            if arg_20 is None:
                Func8 = [Func4, Func5]
                insort(arg_7, Func8)
            else:
                Func8 = arg_20
            arg_2(Section(arg_4, arg_3, Func8, 'Section'))
        return Func

Return a list of section in current wikitext .


return variant_obj['position'] + (num_bases - 1)

def Func ( arg_0 ) : arg_1 = len ( arg_0 [ 'alternative' ] ) arg_2 = max ( len ( arg_0 [ 'reference' ] ) , arg_1 ) return arg_0 [ 'position' ] + ( arg_2 - 1 )

def Func(arg_0):
    """Calculate end position for a variant."""
    arg_1 = len(arg_0['alternative'])
    arg_2 = max(len(arg_0['reference']), arg_1)
    return arg_0['position'] + (arg_2 - 1)


return modelmags, phase, ptimes, pmags, perrs

def Func(arg_0, arg_1, arg_2, arg_3):
    '''This generates a sinusoidal light curve using a Fourier cosine series.

    Parameters
    ----------

    fourierparams : list
        This MUST be a list of the following form like so::

            [period,
             epoch,
             [amplitude_1, amplitude_2, amplitude_3, ..., amplitude_X],
             [phase_1, phase_2, phase_3, ..., phase_X]]

        where X is the Fourier order.

    times,mags,errs : np.array
        The input time-series of measurements and associated errors for which
        the model will be generated. The times will be used to generate model
        mags, and the input `times`, `mags`, and `errs` will be resorted by
        model phase and returned.

    Returns
    -------

    (modelmags, phase, ptimes, pmags, perrs) : tuple
        Returns the model mags and phase values. Also returns the input `times`,
        `mags`, and `errs` sorted by the model's phase.

    '''

    arg_4, arg_5, arg_6, arg_7 = arg_0

    # figure out the order from the length of the Fourier param list
    arg_8 = len(arg_6)

    # phase the times with this period
    arg_9 = (arg_1 - arg_5)/arg_4
    arg_9 = arg_9 - np.floor(arg_9)

    arg_10 = np.argsort(arg_9)
    arg_11 = arg_9[arg_10]
    arg_12 = arg_1[arg_10]
    arg_13 = arg_2[arg_10]
    arg_14 = arg_3[arg_10]

    # calculate all the individual terms of the series
    arg_15 = [arg_6[x]*np.cos(2.0*np.pi*x*arg_11 + arg_7[x])
               for x in range(arg_8)]

    # this is the zeroth order coefficient - a constant equal to median mag
    arg_16 = np.median(arg_2)

    # sum the series
    for arg_17 in arg_15:
        arg_16 += arg_17

    return arg_16, arg_11, arg_12, arg_13, arg_14

This generates a sinusoidal light curve using a Fourier cosine series .


async
def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
,
arg_3
)
:
try
:
try
:
arg_4
,
arg_5
=
await
asyncio
.
open_connection
(
arg_1
,
arg_2
,
arg_3
=
arg_3
)
except
OSError
:
logging
.
error
(
"worker could not connect to server"
)
return
while
True
:
try
:
arg_6
=
await
arg_4
.
readuntil
(
b"\n"
)
except
(
asyncio
.
IncompleteReadError
,
ConnectionResetError
)
:
break
logging
.
debug
(
"worker got call"
)
arg_7
=
arg_6
.
decode
(
"utf-8"
)
arg_8
=
json
.
loads
(
arg_7
)
arg_9
=
arg_0
(
arg_8
)
arg_10
=
json
.
dumps
(
arg_9
)
+
"\n"
arg_11
=
arg_10
.
encode
(
"utf-8"
)
arg_5
.
write
(
arg_11
)
logging
.
debug
(
"worker returned response"
)
except
KeyboardInterrupt
:
pass

async def Func(arg_0, arg_1, arg_2, *, arg_3):
    """
    Connects to the remote master and continuously receives calls, executes
    them, then returns a response until interrupted.
    """

    try:

        try:
            arg_4, arg_5 = await asyncio.open_connection(arg_1, arg_2, arg_3=arg_3)
        except OSError:
            logging.error("worker could not connect to server")
            return

        while True:

            try:
                arg_6 = await arg_4.readuntil(b"\n")
            except (asyncio.IncompleteReadError, ConnectionResetError):
                break
            logging.debug("worker got call")
            arg_7 = arg_6.decode("utf-8")
            arg_8 = json.loads(arg_7)

            arg_9 = arg_0(arg_8)

            arg_10 = json.dumps(arg_9) + "\n"
            arg_11 = arg_10.encode("utf-8")
            arg_5.write(arg_11)
            logging.debug("worker returned response")

    except KeyboardInterrupt:

        pass

Connects to the remote master and continuously receives calls executes them then returns a response until interrupted .


def Func(arg_0, arg_1):
        """Starts a single run carried out by a NetworkRunner.

        Called from the public function :func:`~pypet.brian2.network.NetworkManger.run_network`.

        :param traj: Trajectory container

        """
        arg_0.build(arg_1)

        arg_0._pretty_print_explored_parameters(arg_1)

        # We need to construct a network object in case one was not pre-run
        if not arg_0._pre_run:

            arg_0._network = arg_0._network_constructor(*arg_0._brian_list)

        # Start the experimental run
        arg_0.network_runner.execute_network_run(arg_1, arg_0._network, arg_0._network_dict,
                                                arg_0.components, arg_0.analysers)

        arg_0._logger.info('\n-----------------------------\n'
                          'Network Simulation successful\n'
                          '-----------------------------')

Starts a single run carried out by a NetworkRunner .


(server=None, url=None, ip=None, port=None, https=None, verify_ssl_certificates=None, auth=None,
            proxy=None, cookies=None, verbose=True, config=None)

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=None, arg_5=None, arg_6=None,
            arg_7=None, arg_8=None, arg_9=True, arg_10=None):
    """
    Connect to an existing H2O server, remote or local.

    There are two ways to Func to a server: either pass a `server` parameter containing an instance of
    an H2OLocalServer, or specify `ip` and `port` of the server that you want to Func to.

    :param server: An H2OLocalServer instance to Func to (optional).
    :param url: Full URL of the server to Func to (can be used instead of `ip` + `port` + `https`).
    :param ip: The ip address (or host name) of the server where H2O is running.
    :param port: Port number that H2O service is listening to.
    :param https: Set to True to Func via https:// instead of http://.
    :param verify_ssl_certificates: When using https, setting this to False will disable SSL certificates verification.
    :param auth: Either a (username, password) pair for basic authentication, an instance of h2o.auth.SpnegoAuth
                 or one of the requests.auth authenticator objects.
    :param proxy: Proxy server address.
    :param cookies: Cookie (or list of) to add to request
    :param verbose: Set to False to disable printing Funcion status messages.
    :param Funcion_conf: Connection configuration object encapsulating Funcion parameters.
    :returns: the new :class:`H2OConnection` object.
    """
    global arg_11
    if arg_10:
        if "Func_params" in arg_10:
            arg_11 = _Func_with_conf(arg_10["Func_params"])
        else:
            arg_11 = _Func_with_conf(arg_10)
    else:
        arg_11 = H2OConnection.open(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
                                     arg_6=arg_6, arg_5=arg_5,
                                     arg_7=arg_7, arg_8=arg_8,
                                     arg_9=arg_9)
        if arg_9:
            arg_11.cluster.show_status()
    return arg_11

Connect to an existing H2O server, remote or local.

    There are two ways to connect to a server: either pass a `server` parameter containing an instance of
    an H2OLocalServer, or specify `ip` and `port` of the server that you want to connect to.

    :param server: An H2OLocalServer instance to connect to (optional).
    :param url: Full URL of the server to connect to (can be used instead of `ip` + `port` + `https`).
    :param ip: The ip address (or host name) of the server where H2O is running.
    :param port: Port number that H2O service is listening to.
    :param https: Set to True to connect via https:// instead of http://.
    :param verify_ssl_certificates: When using https, setting this to False will disable SSL certificates verification.
    :param auth: Either a (username, password) pair for basic authentication, an instance of h2o.auth.SpnegoAuth
                 or one of the requests.auth authenticator objects.
    :param proxy: Proxy server address.
    :param cookies: Cookie (or list of) to add to request
    :param verbose: Set to False to disable printing connection status messages.
    :param connection_conf: Connection configuration object encapsulating connection parameters.
    :returns: the new :class:`H2OConnection` object.

Connect to an existing H2O server remote or local .


(errmsg, arg, default=None, print_error=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
    """Return True if arg is 'on' or 1 and False arg is 'off' or 0.
    Any other value is raises ValueError."""
    if not arg_1:
        if arg_2 is None:
            if arg_3:
                arg_0("Expecting 'on', 1, 'off', or 0. Got nothing.")
                pass
            raise ValueError
        return arg_2
    if arg_1 == '1' or arg_1 == 'on': return True
    if arg_1 == '0' or arg_1 =='off': return False

    if arg_3:
        arg_0("Expecting 'on', 1, 'off', or 0. Got: %s." % str(arg_1))
    raise ValueError

Return True if arg is on or 1 and False arg is off or 0 . Any other value is raises ValueError .


def Func ( arg_0 = 'DEFAULT' ) : arg_1 , arg_2 = read_latoolscfg ( ) if arg_0 == 'DEFAULT' : arg_0 = arg_2 [ 'DEFAULT' ] [ 'config' ] arg_2 = dict ( arg_2 [ arg_0 ] ) arg_2 [ 'config' ] = arg_0 return arg_2

def Func(arg_0='DEFAULT'):
    """
    Read LAtools configuration file, and return parameters as dict.
    """
    # read configuration file
    arg_1, arg_2 = read_latoolscfg()
    # if 'DEFAULT', check which is the default configuration
    if arg_0 == 'DEFAULT':
        arg_0 = arg_2['DEFAULT']['config']

    # grab the chosen configuration
    arg_2 = dict(arg_2[arg_0])
    # update config name with chosen
    arg_2['config'] = arg_0
    return arg_2

Read LAtools configuration file and return parameters as dict .


(times, t0, per, rp, a, inc, ecc, w, u, limb_dark,
                   exp_time_minutes=2, supersample_factor=7)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9,
                   arg_10=2, arg_11=7):
    '''This returns a BATMAN planetary transit model.

    Parameters
    ----------

    times : np.array
        The times at which the model will be evaluated.

    t0 : float
        The time of periastron for the transit.

    per : float
        The orbital period of the planet.

    rp : float
        The stellar radius of the planet's star (in Rsun).

    a : float
        The semi-major axis of the planet's orbit (in Rsun).

    inc : float
        The orbital inclination (in degrees).

    ecc : float
        The eccentricity of the orbit.

    w : float
        The longitude of periastron (in degrees).

    u : list of floats
        The limb darkening coefficients specific to the limb darkening model
        used.

    limb_dark : {"uniform", "linear", "quadratic", "square-root", "logarithmic", "exponential", "power2", "custom"}
        The type of limb darkening model to use. See the full list here:

        https://www.cfa.harvard.edu/~lkreidberg/batman/tutorial.html#limb-darkening-options

    exp_time_minutes : float
        The amount of time to 'smear' the transit LC points over to simulate a
        long exposure time.

    supersample_factor: int
        The number of supersampled time data points to average the lightcurve
        model over.

    Returns
    -------

    (params, batman_model) : tuple
        The returned tuple contains the params list and the generated
        `batman.TransitModel` object.

    '''
    arg_12 = batman.TransitParams()  # object to store transit parameters
    arg_12.t0 = arg_1                   # time of periastron
    arg_12.per = arg_2                 # orbital period
    arg_12.rp = arg_3                   # planet radius (in stellar radii)
    arg_12.a = arg_4                     # semi-major axis (in stellar radii)
    arg_12.inc = arg_5                 # orbital inclination (in degrees)
    arg_12.ecc = arg_6                 # the eccentricity of the orbit
    arg_12.w = arg_7                     # longitude of periastron (in degrees)
    arg_12.u = arg_8                     # limb darkening coefficient list
    arg_12.limb_dark = arg_9     # limb darkening model to use

    arg_13 = arg_0
    arg_14 = batman.TransitModel(arg_12, arg_13, exp_time=arg_10/60./24.,
                            arg_11=arg_11)

    return arg_12, arg_14

This returns a BATMAN planetary transit model .


(text, encoding='utf-8', handler=None, **defaults)

def Func ( arg_0 , arg_1 = 'utf-8' , arg_2 = None , ** arg_3 ) : arg_0 = u ( arg_0 , arg_1 ) . strip ( ) arg_4 = arg_3 . copy ( ) arg_2 = arg_2 or detect_format ( arg_0 , handlers ) if arg_2 is None : return arg_4 , arg_0 try : arg_5 , arg_6 = arg_2 . split ( arg_0 ) except ValueError : return arg_4 , arg_0 arg_5 = arg_2 . load ( arg_5 ) if isinstance ( arg_5 , dict ) : arg_4 . update ( arg_5 ) return arg_4 , arg_6 . strip ( )

def Func(arg_0, arg_1='utf-8', arg_2=None, **arg_3):
    """
    Parse text with frontmatter, return metadata and content.
    Pass in optional metadata defaults as keyword args.

    If frontmatter is not found, returns an empty metadata dictionary
    (or defaults) and original text content.

    ::

        >>> with open('tests/hello-world.markdown') as f:
        ...     metadata, content = frontmatter.Func(f.read())
        >>> print(metadata['title'])
        Hello, world!

    """
    # ensure unicode first
    arg_0 = u(arg_0, arg_1).strip()

    # metadata starts with defaults
    arg_4 = arg_3.copy()

    # this will only run if a handler hasn't been set higher up
    arg_2 = arg_2 or detect_format(arg_0, handlers)
    if arg_2 is None:
        return arg_4, arg_0

    # split on the delimiters
    try:
        arg_5, arg_6 = arg_2.split(arg_0)
    except ValueError:
        # if we can't split, bail
        return arg_4, arg_0

    # Func, now that we have frontmatter
    arg_5 = arg_2.load(arg_5)
    if isinstance(arg_5, dict):
        arg_4.update(arg_5)

    return arg_4, arg_6.strip()

Parse text with frontmatter, return metadata and content.
    Pass in optional metadata defaults as keyword args.

    If frontmatter is not found, returns an empty metadata dictionary
    (or defaults) and original text content.

    ::

        >>> with open('tests/hello-world.markdown') as f:
        ...     metadata, content = frontmatter.parse(f.read())
        >>> print(metadata['title'])
        Hello, world!

Parse text with frontmatter return metadata and content . Pass in optional metadata defaults as keyword args .


def Func(arg_0, arg_1, arg_2):
        """Pushes a new token for continued indentation on the stack.

        Tokens that can modify continued indentation offsets are:
          * opening brackets
          * 'lambda'
          * : inside dictionaries

        Func relies on the caller to filter out those
        interesting tokens.

        :param int token: The concrete token
        :param int position: The position of the token in the stream.
        """
        if _token_followed_by_eol(arg_0._tokens, arg_2):
            arg_0._cont_stack.append(arg_0._hanging_indent_after_bracket(arg_1, arg_2))
        else:
            arg_0._cont_stack.append(arg_0._continuation_inside_bracket(arg_1, arg_2))

Pushes a new token for continued indentation on the stack.

        Tokens that can modify continued indentation offsets are:
          * opening brackets
          * 'lambda'
          * : inside dictionaries

        push_token relies on the caller to filter out those
        interesting tokens.

        :param int token: The concrete token
        :param int position: The position of the token in the stream.

Pushes a new token for continued indentation on the stack .


(doc_id, db_name, server_url='http://127.0.0.1:5984/', rev=None)

def Func ( arg_0 , arg_1 , arg_2 = 'http://127.0.0.1:5984/' , arg_3 = None ) : arg_4 = get_server ( arg_2 ) [ arg_1 ] if arg_3 : arg_5 , arg_6 = arg_4 . resource . get ( arg_0 , arg_3 = arg_3 ) return couchdb . client . Document ( arg_6 ) return arg_4 [ arg_0 ]

def Func(arg_0, arg_1, arg_2='http://127.0.0.1:5984/', arg_3=None):
    """Return a CouchDB document, given its ID, revision and database name."""
    arg_4 = get_server(arg_2)[arg_1]
    if arg_3:
        arg_5, arg_6 = arg_4.resource.get(arg_0, arg_3=arg_3)
        return couchdb.client.Document(arg_6)
    return arg_4[arg_0]

Return a CouchDB document given its ID revision and database name .


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func the molar volume of a solid at tempearture `T`
        with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vms : float
            Molar volume of the solid at T, [m^3/mol]
        '''
        if arg_2 == CRC_INORG_S:
            arg_3 = arg_0.CRC_INORG_S_Vm
#        elif method == GOODMAN:
#            Vms = Goodman(T, self.Tt, self.rhol_Tt)
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3

r'''Method to calculate the molar volume of a solid at tempearture `T`
        with a given method.

        This method has no exception handling; see `T_dependent_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate molar volume, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Vms : float
            Molar volume of the solid at T, [m^3/mol]

r Method to calculate the molar volume of a solid at tempearture T with a given method .


def Func(arg_0):
    '''
    Decodes an UTF-8 string from an encoded MQTT bytearray.
    Returns the decoded string and renaining bytearray to be parsed
    '''
    arg_1 = arg_0[0]*256 + arg_0[1]
    return (arg_0[2:2+arg_1].decode('utf-8'), arg_0[2+arg_1:])

Decodes an UTF - 8 string from an encoded MQTT bytearray . Returns the decoded string and renaining bytearray to be parsed


(self, old_table_name, new_table_name,
                              old_field, new_field, keys)

def Func(arg_0, arg_1, arg_2,
                              arg_3, arg_4, arg_5):
        """Renames an existing UNIQUE constraint for the specified
        hstore keys."""

        arg_6 = arg_0._unique_constraint_name(
            arg_1, arg_3, arg_5)
        arg_7 = arg_0._unique_constraint_name(
            arg_2, arg_4, arg_5)

        arg_8 = arg_0.sql_hstore_unique_rename.format(
            arg_6=arg_0.quote_name(arg_6),
            arg_7=arg_0.quote_name(arg_7)
        )
        arg_0.execute(arg_8)

Renames an existing UNIQUE constraint for the specified hstore keys .


(self, name, metric, time_bucket_in_sec)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Registers a given metric

    :param name: name of the metric
    :param metric: IMetric object to be registered
    :param time_bucket_in_sec: time interval for update to the metrics manager
    """
    if arg_1 in arg_0.metrics_map:
      raise RuntimeError("Another metric has already been registered with name: %s" % arg_1)

    Log.debug("Register metric: %s, with interval: %s", arg_1, str(arg_3))
    arg_0.metrics_map[arg_1] = arg_2

    if arg_3 in arg_0.time_bucket_in_sec_to_metrics_name:
      arg_0.time_bucket_in_sec_to_metrics_name[arg_3].append(arg_1)
    else:
      arg_0.time_bucket_in_sec_to_metrics_name[arg_3] = [arg_1]
      arg_0._register_timer_task(arg_3)


def Func ( arg_0 , arg_1 ) : for arg_2 in range ( MAXMOVES ) : if arg_1 . finished : break arg_1 . move ( arg_1 . random_move ( ) )

def Func(arg_0, arg_1):
        """ random play until both players pass """
        for arg_2 in range(MAXMOVES):  # XXX while not self.finished?
            if arg_1.finished:
                break
            arg_1.move(arg_1.random_move())


(hass, config, add_entities, discovery_info=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """Set up the Vizio media player platform."""
    arg_4 = arg_1.get(CONF_HOST)
    arg_5 = arg_1.get(CONF_ACCESS_TOKEN)
    arg_6 = arg_1.get(CONF_NAME)
    arg_7 = arg_1.get(CONF_VOLUME_STEP)
    arg_8 = arg_1.get(CONF_DEVICE_CLASS)
    arg_9 = VizioDevice(arg_4, arg_5, arg_6, arg_7, arg_8)
    if arg_9.validate_setup() is False:
        _LOGGER.error("Failed to set up Vizio platform, "
                      "please check if host and API key are correct")
        return
    elif (arg_5 is None or arg_5 == "") and arg_8 == "tv":
        _LOGGER.error("Failed to set up Vizio platform, "
                      "if device_class is 'tv' then an auth_token needs "
                      "to be provided, otherwise if device_class is "
                      "'soundbar' then add the right device_class to config")
        return

    if arg_1.get(CONF_SUPPRESS_WARNING):
        from requests.packages import urllib3
        _LOGGER.warning("InsecureRequestWarning is disabled "
                        "because of Vizio platform configuration")
        urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
    arg_2([arg_9], True)

Set up the Vizio media player platform .


return default if item is default else item[0]

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

Get successor to key raises KeyError if key is max key or key does not exist .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
.
natural_sort
or
arg_1
.
source
:
arg_0
=
sorted
(
arg_0
,
key
=
lambda
c
:
(
c
.
filename
,
c
.
lineno
)
)
else
:
arg_0
=
sorted
(
arg_0
,
key
=
lambda
c
:
c
.
key
)
arg_2
=
[
]
if
arg_1
.
only_keys
:
arg_3
=
set
(
)
for
arg_4
in
arg_0
:
if
arg_4
.
key
in
arg_3
:
continue
arg_2
.
append
(
_format_call
(
arg_4
,
arg_1
)
)
arg_3
.
add
(
arg_4
.
key
)
arg_2
=
'\n'
.
join
(
arg_2
)
if
arg_1
.
color
:
arg_2
=
_colorize
(
arg_2
)
print
(
arg_2
,
end
=
' '
)
return
arg_3
=
set
(
)
for
arg_4
in
arg_0
:
if
arg_4
.
default
:
arg_3
.
add
(
arg_4
.
key
)
for
arg_4
in
arg_0
:
if
not
arg_1
.
all
and
not
arg_4
.
default
and
arg_4
.
key
in
arg_3
:
continue
arg_2
.
append
(
_format_call
(
arg_4
,
arg_1
)
)
arg_2
=
'\n'
.
join
(
arg_2
)
if
arg_1
.
color
:
arg_2
=
_colorize
(
arg_2
)
print
(
arg_2
,
end
=
' '
)

def Func(arg_0, arg_1):
    """
    Outputs `calls`.

    :param calls: List of :class:`_PyconfigCall` instances
    :param args: :class:`~argparse.ArgumentParser` instance
    :type calls: list
    :type args: argparse.ArgumentParser

    """
    # Sort the keys appropriately
    if arg_1.natural_sort or arg_1.source:
        arg_0 = sorted(arg_0, key=lambda c: (c.filename, c.lineno))
    else:
        arg_0 = sorted(arg_0, key=lambda c: c.key)

    arg_2 = []

    # Handle displaying only the list of keys
    if arg_1.only_keys:
        arg_3 = set()
        for arg_4 in arg_0:
            if arg_4.key in arg_3:
                continue
            arg_2.append(_format_call(arg_4, arg_1))
            arg_3.add(arg_4.key)

        arg_2 = '\n'.join(arg_2)
        if arg_1.color:
            arg_2 = _colorize(arg_2)
        print(arg_2, end=' ')

        # We're done here
        return

    # Build a list of keys which have default values available, so that we can
    # toggle between displaying only those keys with defaults and all keys
    arg_3 = set()
    for arg_4 in arg_0:
        if arg_4.default:
            arg_3.add(arg_4.key)

    for arg_4 in arg_0:
        if not arg_1.all and not arg_4.default and arg_4.key in arg_3:
            continue
        arg_2.append(_format_call(arg_4, arg_1))

    arg_2 = '\n'.join(arg_2)
    if arg_1.color:
        arg_2 = _colorize(arg_2)
    print(arg_2, end=' ')


return any([fieldname_error for fieldname_error in form.errors.keys()
                    if fieldname_error in self])

def Func ( arg_0 , arg_1 ) : return any ( [ arg_2 for arg_2 in arg_1 . errors . keys ( ) if arg_2 in arg_0 ] )

def Func(arg_0, arg_1):
        """
        Find tab fields listed as invalid
        """
        return any([arg_2 for arg_2 in arg_1.errors.keys()
                    if arg_2 in arg_0])


(self, name, shape=None, dtype=None, data=None,
                       sparse_format=None, indptr_dtype=np.int64, indices_dtype=np.int32,
                       **kwargs)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None,
                       arg_5=None, arg_6=arg_7.int64, arg_9=arg_7.int32,
                       **arg_11):
        """Create 3 datasets in a group to represent the sparse array.

        Parameters
        ----------
        sparse_format:
        """
        if isinstance(arg_4, Dataset):
            assert arg_5 is None
            arg_12 = arg_0.create_group(arg_1)
            arg_12.attrs['h5sparse_format'] = arg_4.attrs['h5sparse_format']
            arg_12.attrs['h5sparse_shape'] = arg_4.attrs['h5sparse_shape']
            arg_12.Func('data', arg_4=arg_4.h5py_group['data'],
                                 arg_3=arg_3, **arg_11)
            arg_12.Func('indices', arg_4=arg_4.h5py_group['indices'],
                                 arg_3=arg_9, **arg_11)
            arg_12.Func('indptr', arg_4=arg_4.h5py_group['indptr'],
                                 arg_3=arg_6, **arg_11)
        elif ss.issparse(arg_4):
            if arg_5 is not None:
                arg_14 = get_format_class(arg_5)
                arg_4 = arg_14(arg_4)
            arg_12 = arg_0.create_group(arg_1)
            arg_12.attrs['h5sparse_format'] = get_format_str(arg_4)
            arg_12.attrs['h5sparse_shape'] = arg_4.shape
            arg_12.Func('data', arg_4=arg_4.data, arg_3=arg_3, **arg_11)
            arg_12.Func('indices', arg_4=arg_4.indices, arg_3=arg_9, **arg_11)
            arg_12.Func('indptr', arg_4=arg_4.indptr, arg_3=arg_6, **arg_11)
        elif arg_4 is None and arg_5 is not None:
            arg_14 = get_format_class(arg_5)
            if arg_3 is None:
                arg_3 = arg_7.float64
            if arg_2 is None:
                arg_2 = (0, 0)
            arg_4 = arg_14(arg_2, arg_3=arg_3)
            arg_12 = arg_0.create_group(arg_1)
            arg_12.attrs['h5sparse_format'] = get_format_str(arg_4)
            arg_12.attrs['h5sparse_shape'] = arg_4.shape
            arg_12.Func('data', arg_4=arg_4.data, arg_3=arg_3, **arg_11)
            arg_12.Func('indices', arg_4=arg_4.indices, arg_3=arg_9, **arg_11)
            arg_12.Func('indptr', arg_4=arg_4.indptr, arg_3=arg_6, **arg_11)
        else:
            # forward the arguments to h5py
            assert arg_5 is None
            return super(Group, arg_0).Func(
                arg_1, arg_4=arg_4, arg_2=arg_2, arg_3=arg_3, **arg_11)
        return Dataset(arg_12)

Create 3 datasets in a group to represent the sparse array .


def Func(arg_0, arg_1=0.7, arg_2=0.2):
        """
        Total propulsion power of the ship.

        :param propulsion_eff: Shaft efficiency of the ship
        :param sea_margin: Sea margin take account of interaction between ship and the sea, e.g. wave
        :return: Watts shaft propulsion power of the ship
        """
        arg_3 = (1 + arg_2) * arg_0.resistance() * arg_0.speed/arg_1
        return arg_3


Parse command line arguments, and run rflint

def Func(arg_0, arg_1):
        """Parse command line arguments, and Func rflint"""

        arg_0.args = arg_0.parse_and_process_args(arg_1)

        if arg_0.args.version:
            print(__version__)
            return 0

        if arg_0.args.rulefile:
            for arg_2 in arg_0.args.rulefile:
                arg_0._load_rule_file(arg_2)

        if arg_0.args.list:
            arg_0.list_rules()
            return 0

        if arg_0.args.describe:
            arg_0._describe_rules(arg_0.args.args)
            return 0

        arg_0.counts = { ERROR: 0, WARNING: 0, "other": 0}

        for arg_2 in arg_0.args.args:
            if not (os.path.exists(arg_2)):
                sys.stderr.write("rflint: %s: No such file or directory\n" % arg_2)
                continue
            if os.path.isdir(arg_2):
                arg_0._process_folder(arg_2)
            else:
                arg_0._process_file(arg_2)

        if arg_0.counts[ERROR] > 0:
            return arg_0.counts[ERROR] if arg_0.counts[ERROR] < 254 else 255

        return 0

Parse command line arguments and run rflint


def Func ( arg_0 , arg_1 : arg_2 ) : if arg_1 in arg_0 . GATED_IMPORTS : arg_0 . DEFAULT_IMPORTS . swap ( lambda s : s . cons ( sym . symbol ( arg_1 ) ) )

def Func(arg_0, arg_1: arg_2):
        """Add a gated default import to the default imports.

        In particular, we need to avoid importing 'basilisp.core' before we have
        finished macro-expanding."""
        if arg_1 in arg_0.GATED_IMPORTS:
            arg_0.DEFAULT_IMPORTS.swap(lambda s: s.cons(sym.symbol(arg_1)))

Add a gated default import to the default imports .