def Func ( arg_0 , arg_1 ) : arg_1 . files . clusters = os . path . join ( arg_0 . dirs . clusts , arg_1 . name + ".clustS.gz" ) arg_4 = arg_0 . samples [ arg_1 . name ] . files . clusters arg_3 = gzip . open ( arg_4 , 'r' ) arg_5 = itertools . izip ( * [ iter ( arg_3 ) ] * 2 ) arg_6 = [ ] arg_7 = [ ] arg_8 = 0 arg_9 = 0 while 1 : try : arg_10 , arg_11 = arg_5 . next ( ) except StopIteration : break if arg_10 . strip ( ) == arg_11 . strip ( ) : arg_6 . append ( arg_8 ) arg_7 . append ( arg_9 ) arg_9 = 0 arg_8 = 0 else : arg_8 += int ( arg_10 . split ( ";" ) [ - 2 ] [ 5 : ] ) arg_9 = len ( arg_11 ) arg_3 . close ( ) return np . array ( arg_7 ) , np . array ( arg_6 )

def Func(arg_0, arg_1):
    """ iterate over clustS files to get data """

    ## use existing sample cluster path if it exists, since this
    ## func can be used in step 4 and that can occur after merging
    ## assemblies after step3, and if we then referenced by data.dirs.clusts
    ## the path would be broken.
    ##
    ## If branching at step 3 to test different clust thresholds, the
    ## branched samples will retain the samples.files.clusters of the
    ## parent (which have the clust_threshold value of the parent), so
    ## it will look like nothing has changed. If we call this func
    ## from step 3 then it indicates we are in a branch and should
    ## reset the sample.files.clusters handle to point to the correct
    ## data.dirs.clusts directory. See issue #229.
    ## Easier to just always trust that samples.files.clusters is right,
    ## no matter what step?
    #if sample.files.clusters and not sample.stats.state == 3:
    #    pass
    #else:
    #    ## set cluster file handles
    arg_1.files.clusters = os.path.join(
         arg_0.dirs.clusts, arg_1.name+".clustS.gz")

    ## get new clustered loci
    arg_4 = arg_0.samples[arg_1.name].files.clusters
    arg_3 = gzip.open(arg_4, 'r')
    arg_5 = itertools.izip(*[iter(arg_3)]*2)

    ## storage
    arg_6 = []
    arg_7 = []

    ## start with cluster 0
    arg_8 = 0
    arg_9 = 0

    ## iterate until empty
    while 1:
        ## grab next
        try:
            arg_10, arg_11 = arg_5.next()
        except StopIteration:
            break

        ## if not the end of a cluster
        #print name.strip(), seq.strip()
        if arg_10.strip() == arg_11.strip():
            arg_6.append(arg_8)
            arg_7.append(arg_9)
            arg_9 = 0
            arg_8 = 0

        else:
            arg_8 += int(arg_10.split(";")[-2][5:])
            arg_9 = len(arg_11)

    ## return
    arg_3.close()
    return np.array(arg_7), np.array(arg_6)


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Locate request payload and decode it into
        its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidKmipEncoding: Raised if the attributes structure is missing
                from the encoded payload for KMIP 2.0+ encodings.
        """
        super(LocateRequestPayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.MAXIMUM_ITEMS, arg_6):
            arg_0._maximum_items = primitives.Integer(
                tag=arg_3.Tags.MAXIMUM_ITEMS
            )
            arg_0._maximum_items.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.OFFSET_ITEMS, arg_6):
            arg_0._offset_items = primitives.Integer(
                tag=arg_3.Tags.OFFSET_ITEMS
            )
            arg_0._offset_items.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.STORAGE_STATUS_MASK, arg_6):
            arg_0._storage_status_mask = primitives.Integer(
                tag=arg_3.Tags.STORAGE_STATUS_MASK
            )
            arg_0._storage_status_mask.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_0.is_tag_next(arg_3.Tags.OBJECT_GROUP_MEMBER, arg_6):
            arg_0._object_group_member = primitives.Enumeration(
                arg_3.ObjectGroupMember,
                tag=arg_3.Tags.OBJECT_GROUP_MEMBER
            )
            arg_0._object_group_member.Func(
                arg_6,
                arg_2=arg_2
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            while arg_0.is_tag_next(arg_3.Tags.ATTRIBUTE, arg_6):
                arg_11 = objects.Attribute()
                arg_11.Func(arg_6, arg_2=arg_2)
                arg_0._attributes.append(arg_11)
        else:
            if arg_0.is_tag_next(arg_3.Tags.ATTRIBUTES, arg_6):
                arg_12 = objects.Attributes()
                arg_12.Func(arg_6, arg_2=arg_2)
                # TODO (ph) Add a new utility to avoid using TemplateAttributes
                arg_13 = objects.convert_attributes_to_template_attribute(
                    arg_12
                )
                arg_0._attributes = arg_13.attributes
            else:
                raise exceptions.InvalidKmipEncoding(
                    "The Locate request payload encoding is missing the "
                    "attributes structure."
                )

Read the data encoding the Locate request payload and decode it into
        its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a read method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidKmipEncoding: Raised if the attributes structure is missing
                from the encoded payload for KMIP 2.0+ encodings.

Read the data encoding the Locate request payload and decode it into its constituent parts .


(recordParams, spatialParams=_SP_PARAMS,
                          temporalParams=_TM_PARAMS,
                          verbosity=_VERBOSITY)

def Func ( arg_0 , arg_1 = arg_2 , arg_3 = arg_4 , arg_5 = arg_6 ) : arg_7 = arg_0 [ "inputFilePath" ] arg_8 = arg_0 [ "scalarEncoderArgs" ] arg_9 = arg_0 [ "dateEncoderArgs" ] arg_10 = ScalarEncoder ( ** arg_8 ) arg_11 = DateEncoder ( ** arg_9 ) arg_12 = MultiEncoder ( ) arg_12 . addEncoder ( arg_8 [ "name" ] , arg_10 ) arg_12 . addEncoder ( arg_9 [ "name" ] , arg_11 ) arg_13 = Network ( ) arg_13 . addRegion ( "sensor" , "py.RecordSensor" , json . dumps ( { "verbosity" : arg_5 } ) ) arg_14 = arg_13 . regions [ "sensor" ] . getSelf ( ) arg_14 . encoder = arg_12 arg_14 . dataSource = FileRecordStream ( streamID = arg_7 ) arg_1 [ "inputWidth" ] = arg_14 . encoder . getWidth ( ) arg_13 . addRegion ( "spatialPoolerRegion" , "py.SPRegion" , json . dumps ( arg_1 ) ) arg_13 . link ( "sensor" , "spatialPoolerRegion" , "UniformLink" , "" ) arg_13 . link ( "sensor" , "spatialPoolerRegion" , "UniformLink" , "" , srcOutput = "resetOut" , destInput = "resetIn" ) arg_13 . link ( "spatialPoolerRegion" , "sensor" , "UniformLink" , "" , srcOutput = "spatialTopDownOut" , destInput = "spatialTopDownIn" ) arg_13 . link ( "spatialPoolerRegion" , "sensor" , "UniformLink" , "" , srcOutput = "temporalTopDownOut" , destInput = "temporalTopDownIn" ) arg_13 . addRegion ( "temporalPoolerRegion" , "py.TMRegion" , json . dumps ( arg_3 ) ) arg_13 . link ( "spatialPoolerRegion" , "temporalPoolerRegion" , "UniformLink" , "" ) arg_13 . link ( "temporalPoolerRegion" , "spatialPoolerRegion" , "UniformLink" , "" , srcOutput = "topDownOut" , destInput = "topDownIn" ) arg_16 = arg_13 . regions [ "spatialPoolerRegion" ] arg_16 . setParameter ( "learningMode" , True ) arg_16 . setParameter ( "anomalyMode" , False ) arg_17 = arg_13 . regions [ "temporalPoolerRegion" ] arg_17 . setParameter ( "topDownMode" , True ) arg_17 . setParameter ( "learningMode" , True ) arg_17 . setParameter ( "inferenceMode" , True ) arg_17 . setParameter ( "anomalyMode" , True ) return arg_13

def Func(arg_0, arg_1=arg_2,
                          arg_3=arg_4,
                          arg_5=arg_6):

  """Generates a Network with connected RecordSensor, SP, TM.

  This function takes care of generating regions and the canonical links.
  The network has a sensor region reading data from a specified input and
  passing the encoded representation to an SPRegion.
  The SPRegion output is passed to a TMRegion.

  Note: this function returns a network that needs to be initialized. This
  allows the user to extend the network by adding further regions and
  connections.

  :param recordParams: a dict with parameters for creating RecordSensor region.
  :param spatialParams: a dict with parameters for creating SPRegion.
  :param temporalParams: a dict with parameters for creating TMRegion.
  :param verbosity: an integer representing how chatty the network will be.
  """
  arg_7 = arg_0["inputFilePath"]
  arg_8 = arg_0["scalarEncoderArgs"]
  arg_9 = arg_0["dateEncoderArgs"]

  arg_10 = ScalarEncoder(**arg_8)
  arg_11 = DateEncoder(**arg_9)

  arg_12 = MultiEncoder()
  arg_12.addEncoder(arg_8["name"], arg_10)
  arg_12.addEncoder(arg_9["name"], arg_11)

  arg_13 = Network()

  arg_13.addRegion("sensor", "py.RecordSensor",
                    json.dumps({"verbosity": arg_5}))

  arg_14 = arg_13.regions["sensor"].getSelf()
  arg_14.encoder = arg_12
  arg_14.dataSource = FileRecordStream(streamID=arg_7)

  # Create the spatial pooler region
  arg_1["inputWidth"] = arg_14.encoder.getWidth()
  arg_13.addRegion("spatialPoolerRegion", "py.SPRegion",
                    json.dumps(arg_1))

  # Link the SP region to the sensor input
  arg_13.link("sensor", "spatialPoolerRegion", "UniformLink", "")
  arg_13.link("sensor", "spatialPoolerRegion", "UniformLink", "",
               srcOutput="resetOut", destInput="resetIn")
  arg_13.link("spatialPoolerRegion", "sensor", "UniformLink", "",
               srcOutput="spatialTopDownOut", destInput="spatialTopDownIn")
  arg_13.link("spatialPoolerRegion", "sensor", "UniformLink", "",
               srcOutput="temporalTopDownOut", destInput="temporalTopDownIn")

  # Add the TPRegion on top of the SPRegion
  arg_13.addRegion("temporalPoolerRegion", "py.TMRegion",
                    json.dumps(arg_3))

  arg_13.link("spatialPoolerRegion", "temporalPoolerRegion", "UniformLink", "")
  arg_13.link("temporalPoolerRegion", "spatialPoolerRegion", "UniformLink", "",
               srcOutput="topDownOut", destInput="topDownIn")

  arg_16 = arg_13.regions["spatialPoolerRegion"]

  # Make sure learning is enabled
  arg_16.setParameter("learningMode", True)
  # We want temporal anomalies so disable anomalyMode in the SP. This mode is
  # used for computing anomalies in a non-temporal model.
  arg_16.setParameter("anomalyMode", False)

  arg_17 = arg_13.regions["temporalPoolerRegion"]

  # Enable topDownMode to get the predicted columns output
  arg_17.setParameter("topDownMode", True)
  # Make sure learning is enabled (this is the default)
  arg_17.setParameter("learningMode", True)
  # Enable inference mode so we get predictions
  arg_17.setParameter("inferenceMode", True)
  # Enable anomalyMode to compute the anomaly score.
  arg_17.setParameter("anomalyMode", True)

  return arg_13

Generates a Network with connected RecordSensor SP TM .


def Func(arg_0, **arg_1):
    """Read a .py notebook from a string and return the NotebookNode object."""
    arg_2, arg_3, arg_0 = parse_py(arg_0, **arg_1)
    if arg_2 == 2:
        arg_4 = v2.to_notebook_py(arg_0, **arg_1)
    elif arg_2 == 3:
        arg_4 = v3.to_notebook_py(arg_0, **arg_1)
    else:
        raise NBFormatError('Unsupported PY nbformat version: %i' % arg_2)
    return arg_4

Read a . py notebook from a string and return the NotebookNode object .


(parser: argparse.ArgumentParser, args: argparse.Namespace)

def Func(arg_0: arg_1.ArgumentParser, arg_3: arg_1.Namespace):
    """
    Bring in provided config values to the args parser, and import entries to the config
    from all arguments that were actually passed on the command line

    :param parser: The arg parser
    :param args: The value that parser.parse_args returned
    """
    # First, load a local config file, if passed or look for one in pwd if it wasn't.
    load_overrides(arg_3.config)

    # Get a list of defined config vals. If these are passed on the command line,
    # update them in their correct group, not in the cli group
    arg_5 = list(get_config_keys())

    arg_6 = vars(arg_3)

    # Bring in the options keys into args
    arg_7 = get_group('cli')

    # Place all command line args into the cli group (for saving in the workspace). If
    # the value is set on command line, then it takes precedence; otherwise we try to
    # read it from the config file's cli group.
    for arg_8 in arg_6:
        arg_9 = arg_0.get_default(arg_8)
        arg_10 = getattr(arg_3, arg_8)
        if arg_9 is not arg_10:
            if arg_8 not in arg_5:
                arg_7.update(arg_8, value=arg_10)
            else:
                # Update a var's native group
                arg_11, arg_12 = arg_8.split('.')
                arg_13 = get_group(arg_11)
                setattr(arg_13, arg_12, arg_10)
        else:
            if arg_8 in arg_7:
                setattr(arg_3, arg_8, getattr(arg_7, arg_8))

Bring in provided config values to the args parser and import entries to the config from all arguments that were actually passed on the command line


(output, target, epsilon=1e-8, name='bce_loss')

return tf.reduce_mean(
        tf.reduce_sum(-(target * tf.log(output + epsilon) + (1. - target) * tf.log(1. - output + epsilon)), axis=1),
        name=name
    )

def Func ( arg_0 , arg_1 , arg_2 = 1e-8 , arg_3 = 'bce_loss' ) : return tf . reduce_mean ( tf . reduce_sum ( - ( arg_1 * tf . log ( arg_0 + arg_2 ) + ( 1. - arg_1 ) * tf . log ( 1. - arg_0 + arg_2 ) ) , axis = 1 ) , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=1e-8, arg_3='bce_loss'):
    """Binary cross entropy operation.

    Parameters
    ----------
    output : Tensor
        Tensor with type of `float32` or `float64`.
    target : Tensor
        The target distribution, format the same with `output`.
    epsilon : float
        A small value to avoid output to be zero.
    name : str
        An optional name to attach to this function.

    References
    -----------
    - `ericjang-DRAW <https://github.com/ericjang/draw/blob/master/draw.py#L73>`__

    """
    #     with ops.op_scope([output, target], name, "bce_loss") as name:
    #         output = ops.convert_to_tensor(output, name="preds")
    #         target = ops.convert_to_tensor(targets, name="target")

    # with tf.name_scope(name):
    return tf.reduce_mean(
        tf.reduce_sum(-(arg_1 * tf.log(arg_0 + arg_2) + (1. - arg_1) * tf.log(1. - arg_0 + arg_2)), axis=1),
        arg_3=arg_3
    )


(course_id, course_url, sailthru_client, site_code, config)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Get course information using the Sailthru content api or from cache.

    If there is an error, just return with an empty response.

    Arguments:
        course_id (str): course key of the course
        course_url (str): LMS url for course info page.
        sailthru_client (object): SailthruClient
        site_code (str): site code
        config (dict): config options

    Returns:
        course information from Sailthru
    """
    # check cache first
    arg_5 = "{}:{}".format(arg_3, arg_1)
    arg_6 = cache.get(arg_5)
    if not arg_6:
        try:
            arg_7 = arg_2.api_get("content", {"id": arg_1})
            if not arg_7.is_ok():
                arg_6 = {}
            else:
                arg_6 = arg_7.json
                cache.set(arg_5, arg_6, arg_4.get('SAILTHRU_CACHE_TTL_SECONDS'))

        except SailthruClientError:
            arg_6 = {}

        if not arg_6:
            logger.error('Could not get course data from Sailthru on enroll/purchase event. '
                         'Calling Ecommerce Course API to get course info for enrollment confirmation email')
            arg_6 = Func_from_ecommerce(arg_0, arg_3=arg_3)
            if arg_6:
                cache.set(arg_5, arg_6, arg_4.get('SAILTHRU_CACHE_TTL_SECONDS'))

    return arg_6

Get course information using the Sailthru content api or from cache .


(self, where, tablename, description, expectedrows=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """Creates a new table, or if the table already exists, returns it."""
        arg_5 = arg_0._hdf5file.get_node(arg_1)

        if not arg_2 in arg_5:
            if not arg_4 is None:
                arg_6 = arg_0._hdf5file.create_table(arg_1=arg_5, name=arg_2,
                                              arg_3=arg_3, title=arg_2,
                                              arg_4=arg_4,
                                              filters=arg_0._all_get_filters())
            else:
                arg_6 = arg_0._hdf5file.create_table(arg_1=arg_5, name=arg_2,
                                              arg_3=arg_3, title=arg_2,
                                              filters=arg_0._all_get_filters())
        else:
            arg_6 = arg_5._f_get_child(arg_2)

        return arg_6

Creates a new table or if the table already exists returns it .


def Func(arg_0, arg_1, arg_2=None):
    '''An endpoint is required here to list files within. Optionally, we can
       take a path relative to the endpoint root.

       Parameters
       ==========
       endpoint: a single endpoint ID or an endpoint id and relative path.
                 If no path is provided, we use '', which defaults to scratch.

       query: if defined, limit files to those that have query match

    '''
    if not hasattr(arg_0, 'transfer_client'):
        arg_0._init_transfer_client()

    # Separate endpoint id from the desired path

    arg_1, arg_3 = arg_0._parse_endpoint_name(arg_1)

    # Get a list of files at endpoint, under specific path
    try:
        arg_4 = arg_0.transfer_client.operation_ls(arg_1, arg_3=arg_3)
    except TransferAPIError as err:

        # Tell the user what went wrong!
        bot.custom(prefix='ERROR', message=err, color='RED')
        sys.exit(1)

    arg_5 = []

    for arg_6 in arg_4:

        # Highlight container contenders with purple
        arg_7 = arg_6['name']
        if arg_2 is None or arg_2 in arg_7:
            if arg_7.endswith('img'):
                arg_7 = bot.addColor('PURPLE',arg_7)

            arg_5.append([arg_6['type'],
                         arg_6['permissions'],
                         str(arg_6['size']),
                         arg_7 ])

    if len(arg_5) > 0:
        arg_5 = [["type","[perm]","[size]","[name]"]] + arg_5
        bot.custom(prefix="Endpoint Listing %s" %arg_3, message='', color="CYAN")
        bot.table(arg_5)
    else:
        bot.info('No content was found at the selected endpoint.')
    return arg_5

An endpoint is required here to list files within . Optionally we can take a path relative to the endpoint root .


def Func(arg_0, **arg_1):
        '''
        Get the labels attached to this board. Returns a label of Label
        objects.

        Returns:
            list(Label): The labels attached to this board
        '''
        arg_2 = arg_0.Func_json(arg_0.base_uri, arg_1=arg_1)

        arg_3 = []
        for arg_4 in arg_2:
            arg_3.append(arg_0.create_label(arg_4))

        return arg_3

Get the labels attached to this board . Returns a label of Label objects .


def Func ( arg_0 ) : arg_0 . _open_image ( ) arg_1 , arg_2 , arg_3 = arg_0 . image . size [ 0 ] , arg_0 . image . size [ 1 ] // arg_0 . layers , arg_0 . layers arg_4 , arg_5 = image_data ( arg_0 . image ) arg_6 = arg_0 . ctx . texture_array ( ( arg_1 , arg_2 , arg_3 ) , arg_4 , arg_5 , ) arg_6 . extra = { 'meta' : arg_0 . meta } if arg_0 . meta . mipmap : arg_6 . build_mipmaps ( ) arg_0 . _close_image ( ) return arg_6

def Func(arg_0):
        """Load a texture array"""
        arg_0._open_image()

        arg_1, arg_2, arg_3 = arg_0.image.size[0], arg_0.image.size[1] // arg_0.layers, arg_0.layers
        arg_4, arg_5 = image_data(arg_0.image)

        arg_6 = arg_0.ctx.texture_array(
            (arg_1, arg_2, arg_3),
            arg_4,
            arg_5,
        )
        arg_6.extra = {'meta': arg_0.meta}

        if arg_0.meta.mipmap:
            arg_6.build_mipmaps()

        arg_0._close_image()

        return arg_6


(self, newstate, treenode=None, user_data=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : if arg_1 is None : return arg_0 if isinstance ( arg_1 , State ) and id ( arg_1 ) != id ( arg_0 ) : return arg_1 elif isinstance ( arg_1 , StateEvent ) : arg_0 . state_register . named_events [ arg_1 . name ] = True return arg_1 . st elif isinstance ( arg_1 , StatePrecond ) : return arg_1 . st elif isinstance ( arg_1 , StateHook ) : arg_1 . call ( arg_2 , arg_3 ) return arg_1 . st return arg_0

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Manage transition of state.
        """
        if arg_1 is None:
            return arg_0
        if isinstance(arg_1, State) and id(arg_1) != id(arg_0):
            return arg_1
        elif isinstance(arg_1, StateEvent):
            arg_0.state_register.named_events[arg_1.name] = True
            return arg_1.st
        elif isinstance(arg_1, StatePrecond):
            return arg_1.st
        elif isinstance(arg_1, StateHook):
            # final API using PSL
            arg_1.call(arg_2, arg_3)
            return arg_1.st
        return arg_0


def
Func
(
arg_0
)
:
with
arg_0
.
settings
(
warn_only
=
True
)
:
arg_1
=
arg_0
.
run_or_local
(
'which virtualenv'
)
.
strip
(
)
return
bool
(
arg_1
)

def Func(arg_0):
        """
        Returns true if the virtualenv tool is installed.
        """
        with arg_0.settings(warn_only=True):
            arg_1 = arg_0.run_or_local('which virtualenv').strip()
            return bool(arg_1)

Returns true if the virtualenv tool is installed .


def Func(arg_0, arg_1, arg_2):
        """find similarities in the two given linesets"""
        arg_3 = arg_1.enumerate_stripped
        arg_4 = arg_2.enumerate_stripped
        arg_5 = arg_2.find
        arg_6 = 0
        arg_7 = arg_0.min_lines
        while arg_6 < len(arg_1):
            arg_8 = 1
            arg_9 = 0
            for arg_10 in arg_5(arg_1[arg_6]):
                arg_11 = 0
                for arg_9, ((arg_12, arg_13), (arg_12, arg_14)) in enumerate(
                    zip(arg_3(arg_6), arg_4(arg_10))
                ):
                    if arg_13 != arg_14:
                        if arg_11 > arg_7:
                            yield arg_9, arg_1, arg_6, arg_2, arg_10
                        arg_8 = max(arg_8, arg_9)
                        break
                    if arg_13:
                        arg_11 += 1
                else:
                    # we may have reach the end
                    arg_9 += 1
                    if arg_11 > arg_7:
                        yield arg_9, arg_1, arg_6, arg_2, arg_10
                    arg_8 = max(arg_8, arg_9)
            arg_6 += arg_8


def Func(arg_0, arg_1=True, arg_2=0.1):
        """Convert the object to an pympi.Elan.Eaf object

        :param int pointlength: Length of respective interval from points in
                                seconds
        :param bool skipempty: Skip the empty annotations
        :returns: :class:`pympi.Elan.Eaf` object
        :raises ImportError: If the Eaf module can't be loaded.
        :raises ValueError: If the pointlength is not strictly positive.
        """
        from pympi.Elan import Eaf
        arg_3 = Eaf()
        if arg_2 <= 0:
            raise ValueError('Pointlength should be strictly positive')
        for arg_4 in arg_0.get_tiers():
            arg_3.add_tier(arg_4.name)
            for arg_5 in arg_4.get_intervals(True):
                if arg_4.tier_type == 'TextTier':
                    arg_5 = (arg_5[0], arg_5[0]+arg_2, arg_5[1])
                if arg_5[2].strip() or not arg_1:
                    arg_3.add_annotation(arg_4.name, int(round(arg_5[0]*1000)),
                                           int(round(arg_5[1]*1000)), arg_5[2])
        return arg_3

Convert the object to an pympi . Elan . Eaf object


def Func(arg_0):
        """
        Verify that the contents of the PublicKey object are valid.

        Raises:
            TypeError: if the types of any PublicKey attributes are invalid.
        """
        if not isinstance(arg_0.value, bytes):
            raise TypeError("key value must be bytes")
        elif not isinstance(arg_0.cryptographic_algorithm,
                            enums.CryptographicAlgorithm):
            raise TypeError("key algorithm must be a CryptographicAlgorithm "
                            "enumeration")
        elif not isinstance(arg_0.cryptographic_length, six.integer_types):
            raise TypeError("key length must be an integer")
        elif not isinstance(arg_0.key_format_type, enums.KeyFormatType):
            raise TypeError("key format type must be a KeyFormatType "
                            "enumeration")
        elif arg_0.key_format_type not in arg_0._valid_formats:
            raise ValueError("key format type must be one of {0}".format(
                arg_0._valid_formats))

        # TODO (peter-hamilton) Verify that the key bytes match the key format

        arg_1 = len(arg_0.cryptographic_usage_masks)
        for arg_2 in range(arg_1):
            arg_3 = arg_0.cryptographic_usage_masks[arg_2]
            if not isinstance(arg_3, enums.CryptographicUsageMask):
                arg_4 = "({0} in list)".format(arg_2)
                raise TypeError(
                    "key mask {0} must be a CryptographicUsageMask "
                    "enumeration".format(arg_4))

        arg_5 = len(arg_0.names)
        for arg_2 in range(arg_5):
            arg_6 = arg_0.names[arg_2]
            if not isinstance(arg_6, six.string_types):
                arg_4 = "({0} in list)".format(arg_2)
                raise TypeError("key name {0} must be a string".format(
                    arg_4))

Verify that the contents of the PublicKey object are valid .


def Func(arg_0, arg_1, arg_2):
    """Decode repeated field."""
    if arg_1.type == FieldDescriptor.TYPE_MESSAGE:
        for arg_3 in arg_2:
            decode(getattr(arg_0, arg_1.name).add(), arg_3)
    else:
        try:
            for arg_3 in arg_2:
                if arg_1.type == FieldDescriptor.TYPE_BYTES:
                    arg_3 = base64.b64decode(arg_3)
                getattr(arg_0, arg_1.name).append(arg_3)
        except (ValueError, TypeError) as e:
            # ValueError: invalid enum value, negative unsigned int value, or
            # invalid base64
            # TypeError: mismatched type
            logger.warning('Message %r ignoring repeated field %s: %s',
                           arg_0.__class__.__name__, arg_1.name, e)
            # Ignore any values already decoded by clearing list
            arg_0.ClearField(arg_1.name)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Load `program` and establish program state, such as stack and arguments.

        :param program str: The ELF binary to load
        :param argv list: argv array
        :param envp list: envp array
        """
        arg_2 = [] if arg_2 is None else arg_2
        arg_3 = [] if arg_3 is None else arg_3

        logger.debug(f"Loading {program} as a {self.arch} elf")

        arg_0.load(arg_1, arg_3)
        arg_0._arch_specific_init()

        arg_0._stack_top = arg_0.current.STACK
        arg_0.setup_stack([arg_1] + arg_2, arg_3)

        arg_5 = len(arg_0.procs)
        arg_6 = len(arg_0.files)
        assert arg_5 > 0
        arg_0.running = list(range(arg_5))

        # Each process can wait for one timeout
        arg_0.timers = [None] * arg_5
        # each fd has a waitlist
        arg_0.rwait = [set() for _ in range(arg_6)]
        arg_0.twait = [set() for _ in range(arg_6)]

        # Install event forwarders
        for arg_11 in arg_0.procs:
            arg_0.forward_events_from(arg_11)

Load program and establish program state such as stack and arguments .


(self, topic_name, subscription_name, rule_name, rule=None,
                    fail_on_exist=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = None , arg_5 = False ) : _validate_not_none ( 'topic_name' , arg_1 ) _validate_not_none ( 'subscription_name' , arg_2 ) _validate_not_none ( 'rule_name' , arg_3 ) arg_6 = HTTPRequest ( ) arg_6 . method = 'PUT' arg_6 . host = arg_0 . _get_host ( ) arg_6 . path = '/' + _str ( arg_1 ) + '/subscriptions/' + _str ( arg_2 ) + '/rules/' + _str ( arg_3 ) + '' arg_6 . body = _get_request_body ( _convert_rule_to_xml ( arg_4 ) ) arg_6 . path , arg_6 . query = arg_0 . _httpclient . _update_request_uri_query ( arg_6 ) arg_6 . headers = arg_0 . _update_service_bus_header ( arg_6 ) if not arg_5 : try : arg_0 . _perform_request ( arg_6 ) return True except AzureHttpError as ex : _dont_fail_on_exist ( ex ) return False else : arg_0 . _perform_request ( arg_6 ) return True

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None,
                    arg_5=False):
        '''
        Creates a new rule. Once created, this rule's resource manifest is
        immutable.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        rule_name:
            Name of the rule.
        fail_on_exist:
            Specify whether to throw an exception when the rule exists.
        '''
        _validate_not_none('topic_name', arg_1)
        _validate_not_none('subscription_name', arg_2)
        _validate_not_none('rule_name', arg_3)
        arg_6 = HTTPRequest()
        arg_6.method = 'PUT'
        arg_6.host = arg_0._get_host()
        arg_6.path = '/' + _str(arg_1) + '/subscriptions/' + \
            _str(arg_2) + \
            '/rules/' + _str(arg_3) + ''
        arg_6.body = _get_request_body(_convert_rule_to_xml(arg_4))
        arg_6.path, arg_6.query = arg_0._httpclient._update_request_uri_query(arg_6)  # pylint: disable=protected-access
        arg_6.headers = arg_0._update_service_bus_header(arg_6)
        if not arg_5:
            try:
                arg_0._perform_request(arg_6)
                return True
            except AzureHttpError as ex:
                _dont_fail_on_exist(ex)
                return False
        else:
            arg_0._perform_request(arg_6)
            return True

Creates a new rule . Once created this rule s resource manifest is immutable .


def Func ( arg_0 , arg_1 ) : with open ( os . path . join ( arg_1 , "icon.png" ) , "wb" ) as f : f . write ( arg_0 )

def Func(arg_0, arg_1):
    """
    Add icon to docset
    """
    with open(os.path.join(arg_1, "icon.png"), "wb") as f:
        f.write(arg_0)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 . type ( arg_1 ) != b ( "set" ) : return arg_0 . smove ( arg_1 + "{" + arg_1 + "}" , arg_2 , arg_3 ) if arg_0 . type ( arg_2 ) != b ( "set" ) : return arg_0 . smove ( arg_2 + "{" + arg_2 + "}" , arg_1 , arg_3 ) if arg_0 . srem ( arg_1 , arg_3 ) : return 1 if arg_0 . sadd ( arg_2 , arg_3 ) else 0 return 0

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Move ``value`` from set ``src`` to set ``dst``
        not atomic
        """
        if arg_0.type(arg_1) != b("set"):
            return arg_0.smove(arg_1 + "{" + arg_1 + "}", arg_2, arg_3)
        if arg_0.type(arg_2) != b("set"):
            return arg_0.smove(arg_2 + "{" + arg_2 + "}", arg_1, arg_3)
        if arg_0.srem(arg_1, arg_3):
            return 1 if arg_0.sadd(arg_2, arg_3) else 0
        return 0

Move value from set src to set dst not atomic


def Func ( arg_0 , arg_1 ) : assert arg_1 . ndim == 1 arg_1 = arg_1 - np . max ( arg_1 ) arg_2 = np . exp ( arg_1 ) arg_3 = np . sum ( arg_2 ) arg_4 = np . log ( arg_3 ) - arg_1 [ arg_0 ] return arg_4

def Func(arg_0, arg_1):
    """Calculates the cross-entropy.

    Parameters
    ----------
    logits : array_like
        The logits predicted by the model.
    label : int
        The label describing the target distribution.

    Returns
    -------
    float
        The cross-entropy between softmax(logits) and onehot(label).

    """

    assert arg_1.ndim == 1

    # for numerical reasons we subtract the max logit
    # (mathematically it doesn't matter!)
    # otherwise exp(logits) might become too large or too small
    arg_1 = arg_1 - np.max(arg_1)
    arg_2 = np.exp(arg_1)
    arg_3 = np.sum(arg_2)
    arg_4 = np.log(arg_3) - arg_1[arg_0]
    return arg_4


def Func ( arg_0 , arg_1 ) : arg_2 = Func_to_timestamp ( arg_0 ) arg_3 = Func_to_timestamp ( arg_1 ) arg_4 = arg_2 + random . random ( ) * ( arg_3 - arg_2 ) return Functime . Func . fromtimestamp ( arg_4 )

def Func(arg_0, arg_1):
    """Get a random Func between two Funcs"""

    arg_2 = Func_to_timestamp(arg_0)
    arg_3 = Func_to_timestamp(arg_1)

    arg_4 = arg_2 + random.random() * (arg_3 - arg_2)

    return Functime.Func.fromtimestamp(arg_4)


def Func(arg_0, arg_1):
    '''HPSS beat tracking

    :parameters:
      - input_file : str
          Path to input audio file (wav, mp3, m4a, flac, etc.)

      - output_file : str
          Path to save beat event timestamps as a CSV file
    '''

    # Load the file
    print('Loading  ', arg_0)
    arg_2, arg_3 = librosa.load(arg_0)

    # Do HPSS
    print('Harmonic-percussive separation ... ')
    arg_2 = librosa.effects.percussive(arg_2)

    # Construct onset envelope from percussive component
    print('Tracking beats on percussive component')
    arg_4 = librosa.onset.onset_strength(arg_2=arg_2,
                                             arg_3=arg_3,
                                             hop_length=HOP_LENGTH,
                                             n_fft=N_FFT,
                                             aggregate=np.median)

    # Track the beats
    arg_5, arg_6 = librosa.beat.beat_track(onset_envelope=arg_4,
                                           arg_3=arg_3,
                                           hop_length=HOP_LENGTH)

    arg_7 = librosa.frames_to_time(arg_6,
                                        arg_3=arg_3,
                                        hop_length=HOP_LENGTH)

    # Save the output
    print('Saving beats to ', arg_1)
    librosa.output.times_csv(arg_1, arg_7)


async
def
Func
(
arg_0
)
:
if
not
arg_0
.
_consumer
:
arg_1
=
arg_0
.
_waiter
=
asyncio
.
Future
(
)
try
:
arg_2
=
arg_0
.
_websocket_host
(
)
arg_0
.
logger
.
info
(
'Connect to %s'
,
arg_2
)
arg_0
.
_consumer
=
await
arg_0
.
http
.
get
(
arg_2
)
if
arg_0
.
_consumer
.
status_code
!=
101
:
raise
PusherError
(
"Could not Func to websocket"
)
except
Exception
as
exc
:
arg_1
.
set_exception
(
exc
)
raise
else
:
await
arg_1
return
arg_0
.
_consumer

async def Func(arg_0):
        '''Connect to a Pusher websocket
        '''
        if not arg_0._consumer:
            arg_1 = arg_0._waiter = asyncio.Future()
            try:
                arg_2 = arg_0._websocket_host()
                arg_0.logger.info('Connect to %s', arg_2)
                arg_0._consumer = await arg_0.http.get(arg_2)
                if arg_0._consumer.status_code != 101:
                    raise PusherError("Could not Func to websocket")
            except Exception as exc:
                arg_1.set_exception(exc)
                raise
            else:
                await arg_1
        return arg_0._consumer


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = numpy . zeros ( arg_0 . _numInputs , dtype = realDType ) for arg_4 in xrange ( arg_0 . _numInputs ) : if ( arg_1 [ arg_4 ] < 1 ) : continue if ( arg_0 . _random . getReal64 ( ) <= arg_2 ) : arg_3 [ arg_4 ] = arg_0 . _initPermConnected ( ) else : arg_3 [ arg_4 ] = arg_0 . _initPermNonConnected ( ) arg_3 [ arg_3 < arg_0 . _synPermTrimThreshold ] = 0 return arg_3

def Func(arg_0, arg_1, arg_2):
    """
    Initializes the permanences of a column. The method
    returns a 1-D array the size of the input, where each entry in the
    array represents the initial permanence value between the input bit
    at the particular index in the array, and the column represented by
    the 'index' parameter.

    Parameters:
    ----------------------------
    :param potential: A numpy array specifying the potential pool of the column.
                    Permanence values will only be generated for input bits
                    corresponding to indices for which the mask value is 1.
    :param connectedPct: A value between 0 or 1 governing the chance, for each
                         permanence, that the initial permanence value will
                         be a value that is considered connected.
    """
    # Determine which inputs bits will start out as connected
    # to the inputs. Initially a subset of the input bits in a
    # column's potential pool will be connected. This number is
    # given by the parameter "connectedPct"
    arg_3 = numpy.zeros(arg_0._numInputs, dtype=realDType)
    for arg_4 in xrange(arg_0._numInputs):
      if (arg_1[arg_4] < 1):
        continue

      if (arg_0._random.getReal64() <= arg_2):
        arg_3[arg_4] = arg_0._initPermConnected()
      else:
        arg_3[arg_4] = arg_0._initPermNonConnected()

    # Clip off low values. Since we use a sparse representation
    # to store the permanence values this helps reduce memory
    # requirements.
    arg_3[arg_3 < arg_0._synPermTrimThreshold] = 0

    return arg_3

Initializes the permanences of a column . The method returns a 1 - D array the size of the input where each entry in the array represents the initial permanence value between the input bit at the particular index in the array and the column represented by the index parameter .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_file_name_set : arg_0 . package_file_name_set = True arg_1 . package . file_name = arg_2 return True else : raise CardinalityError ( 'Package::FileName' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package file name, if not already set.
        name - Any string.
        Raises CardinalityError if already has a file_name.
        Raises OrderError if no pacakge previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_file_name_set:
            arg_0.package_file_name_set = True
            arg_1.package.file_name = arg_2
            return True
        else:
            raise CardinalityError('Package::FileName')

Sets the package file name if not already set . name - Any string . Raises CardinalityError if already has a file_name . Raises OrderError if no pacakge previously defined .


(estimate, returns, positions, transactions)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Logic for checking if a strategy is intraday and processing it.

    Parameters
    ----------
    estimate: boolean or str, optional
        Approximate returns for intraday strategies.
        See description in tears.create_full_tear_sheet.
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in create_full_tear_sheet.

    Returns
    -------
    pd.DataFrame
        Daily net position values, adjusted for intraday movement.
    """

    if arg_0 == 'infer':
        if arg_2 is not None and arg_3 is not None:
            if detect_intraday(arg_2, arg_3):
                warnings.warn('Detected intraday strategy; inferring positi' +
                              'ons from transactions. Set estimate_intraday' +
                              '=False to disable.')
                return estimate_intraday(arg_1, arg_2, arg_3)
            else:
                return arg_2
        else:
            return arg_2

    elif arg_0:
        if arg_2 is not None and arg_3 is not None:
            return estimate_intraday(arg_1, arg_2, arg_3)
        else:
            raise ValueError('Positions and txns needed to estimate intraday')
    else:
        return arg_2

Logic for checking if a strategy is intraday and processing it .


(infile, outfile, ipf_ms1_scoring, ipf_ms2_scoring, ipf_h0, ipf_grouped_fdr, ipf_max_precursor_pep, ipf_max_peakgroup_pep, ipf_max_precursor_peakgroup_pep, ipf_max_transition_pep)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9):
    """
    Infer peptidoforms after scoring of MS1, MS2 and transition-level data.
    """

    if arg_1 is None:
        arg_1 = arg_0
    else:
        arg_1 = arg_1

    infer_peptidoforms(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, arg_9)

Infer peptidoforms after scoring of MS1 MS2 and transition - level data .


def Func ( arg_0 , arg_1 ) : arg_2 . token = verify_credentials ( ) arg_4 = arg_2 . communicator . folder_children ( arg_2 . token , arg_1 ) for arg_5 in arg_4 [ 'folders' ] : if arg_5 [ 'name' ] == arg_0 : return False , arg_5 [ 'folder_id' ] for arg_6 in arg_4 [ 'items' ] : if arg_6 [ 'name' ] == arg_0 : return True , arg_6 [ 'item_id' ] return False , - 1

def Func(arg_0, arg_1):
    """
    Find an item or folder matching the name. A folder will be found first if
    both are present.

    :param name: The name of the resource
    :type name: string
    :param folder_id: The folder to search within
    :type folder_id: int | long
    :returns: A tuple indicating whether the resource is an item an the id of
        said resource. i.e. (True, item_id) or (False, folder_id). Note that in
        the event that we do not find a result return (False, -1)
    :rtype: (bool, int | long)
    """
    arg_2.token = verify_credentials()

    arg_4 = arg_2.communicator.folder_children(arg_2.token, arg_1)
    for arg_5 in arg_4['folders']:
        if arg_5['name'] == arg_0:
            return False, arg_5['folder_id']  # Found a folder
    for arg_6 in arg_4['items']:
        if arg_6['name'] == arg_0:
            return True, arg_6['item_id']  # Found an item
    return False, -1

Find an item or folder matching the name . A folder will be found first if both are present .


def Func(arg_0, arg_1):
        "a heart just beat"
        arg_2 = str_to_bytes(str(arg_0.lifetime))
        arg_3 = str_to_bytes(str(arg_0.last_ping))
        if arg_1[1] == arg_2:
            arg_4 = time.time()-arg_0.tic
            # self.log.debug("heartbeat::heart %r took %.2f ms to respond"%(msg[0], 1000*delta))
            arg_0.responses.add(arg_1[0])
        elif arg_1[1] == arg_3:
            arg_4 = time.time()-arg_0.tic + (arg_0.lifetime-arg_0.last_ping)
            arg_0.log.warn("heartbeat::heart %r missed a beat, and took %.2f ms to respond", arg_1[0], 1000*arg_4)
            arg_0.responses.add(arg_1[0])
        else:
            arg_0.log.warn("heartbeat::got bad heartbeat (possibly old?): %s (current=%.3f)", arg_1[1], arg_0.lifetime)


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 : arg_0 . insertBefore ( tree . text ( arg_1 ) , arg_2 ) else : arg_0 . xml_append ( tree . text ( arg_1 ) )

def Func(arg_0, arg_1, arg_2=None):
        """Insert data as text in the current node, positioned before the
        start of node insertBefore or to the end of the node's text.
        """
        if arg_2:
            arg_0.insertBefore(tree.text(arg_1), arg_2)
        else:
            arg_0.xml_append(tree.text(arg_1))

Insert data as text in the current node positioned before the start of node insertBefore or to the end of the node s text .


(gen_ticker: str, dt, freq: str, log=logs.LOG_LEVEL)

def Func(arg_0: arg_1, arg_2, arg_3: arg_1, arg_4=arg_5.LOG_LEVEL) -> arg_1:
    """
    Get proper ticker from generic ticker

    Args:
        gen_ticker: generic ticker
        dt: date
        freq: futures contract frequency
        log: level of logs

    Returns:
        str: exact futures ticker
    """
    arg_7 = arg_5.get_logger(Func, level=arg_4)
    arg_2 = pd.Timestamp(arg_2)
    arg_8 = arg_0.split()

    arg_9 = arg_8[-1]
    if arg_9 in ['Index', 'Curncy', 'Comdty']:
        arg_10 = ' '.join(arg_8[:-1])
        arg_11, arg_12, arg_13 = arg_10[:-1], int(arg_10[-1]) - 1, arg_9

    elif arg_9 == 'Equity':
        arg_10 = arg_8[0]
        arg_11, arg_12, arg_13 = arg_10[:-1], int(arg_10[-1]) - 1, ' '.join(arg_8[1:])

    else:
        arg_7.error(f'unkonwn asset type for ticker: {gen_ticker}')
        return ''

    arg_14 = 4 if arg_9 == 'Comdty' else 2
    arg_15 = pd.date_range(start=arg_2, periods=max(arg_12 + arg_14, 3), arg_3=arg_3)
    arg_7.debug(f'pulling expiry dates for months: {months}')

    def to_fut(arg_16):
        return arg_11 + const.Futures[arg_16.strftime('%b')] + \
               arg_16.strftime('%y')[-1] + ' ' + arg_13

    arg_17 = [to_fut(m) for m in arg_15]
    arg_7.debug(f'trying futures: {fut}')
    # noinspection PyBroadException
    try:
        arg_18 = bdp(tickers=arg_17, flds='last_tradeable_dt', cache=True)
    except Exception as e1:
        arg_7.error(f'error downloading futures contracts (1st trial) {e1}:\n{fut}')
        # noinspection PyBroadException
        try:
            arg_17 = arg_17[:-1]
            arg_7.debug(f'trying futures (2nd trial): {fut}')
            arg_18 = bdp(tickers=arg_17, flds='last_tradeable_dt', cache=True)
        except Exception as e2:
            arg_7.error(f'error downloading futures contracts (2nd trial) {e2}:\n{fut}')
            return ''

    arg_19 = arg_18[pd.DatetimeIndex(arg_18.last_tradeable_dt) > arg_2]
    arg_7.debug(f'futures full chain:\n{fut_matu.to_string()}')
    arg_7.debug(f'getting index {idx} from:\n{sub_fut.to_string()}')
    return arg_19.index.values[arg_12]


(session, member_ids, context_type, context, message)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = { 'Content-Type' : 'application/x-www-form-urlencoded' } arg_6 = { 'members[]' : arg_1 , 'context_type' : arg_2 , 'context' : arg_3 , 'message' : arg_4 , } arg_7 = make_post_request ( arg_0 , 'threads' , arg_5 , form_data = arg_6 ) arg_8 = arg_7 . json ( ) if arg_7 . status_code == 200 : return Thread ( arg_8 [ 'result' ] ) else : raise ThreadNotCreatedException ( arg_4 = arg_8 [ 'message' ] , error_code = arg_8 [ 'error_code' ] , request_id = arg_8 [ 'request_id' ] )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
    Create a thread
    """
    arg_5 = {
        'Content-Type': 'application/x-www-form-urlencoded'
    }
    arg_6 = {
        'members[]': arg_1,
        'context_type': arg_2,
        'context': arg_3,
        'message': arg_4,
    }

    # POST /api/messages/0.1/threads/
    arg_7 = make_post_request(arg_0, 'threads', arg_5,
                                 form_data=arg_6)
    arg_8 = arg_7.json()
    if arg_7.status_code == 200:
        return Thread(arg_8['result'])
    else:
        raise ThreadNotCreatedException(arg_4=arg_8['message'],
                                        error_code=arg_8['error_code'],
                                        request_id=arg_8['request_id'])


def Func(arg_0):
    """Run the dev server.

    Uses `django_extensions <http://pypi.python.org/pypi/django-extensions/0.5>`, if
    available, to provide `runserver_plus`.

    Set the command to use with `options.paved.django.runserver`
    Set the port to use with `options.paved.django.runserver_port`
    """
    arg_1 = options.paved.django.runserver

    if arg_1 == 'runserver_plus':
        try:
            import django_extensions
        except ImportError:
            arg_0("Could not import django_extensions. Using default runserver.")
            arg_1 = 'runserver'

    arg_2 = options.paved.django.runserver_port
    if arg_2:
        arg_1 = '%s %s' % (arg_1, arg_2)

    call_manage(arg_1)


return _MinidomXmlToObject.parse_service_resources_response(
            response, ServerQuota)

def Func(arg_0, arg_1):
        '''
        Gets quotas for an Azure SQL Database Server.

        server_name:
            Name of the server.
        '''
        _validate_not_none('server_name', arg_1)
        arg_2 = arg_0._perform_get(arg_0._get_quotas_path(arg_1),
                                     None)
        return _MinidomXmlToObject.parse_service_resources_response(
            arg_2, ServerQuota)

Gets quotas for an Azure SQL Database Server .


def Func():
    """
    Run the image server. This is blocking. Will handle user KeyboardInterrupt
    and other exceptions appropriately and return control once the server is
    stopped.
    @return {None}
    """
    # Get the port to run on
    arg_0 = _get_server_port()
    # Configure allow_reuse_address to make re-runs of the script less painful -
    # if this is not True then waiting for the address to be freed after the
    # last run can block a subsequent run
    arg_1.TCPServer.allow_reuse_address = True
    # Create the server instance
    arg_4 = arg_1.TCPServer(
        ('', arg_0),
        SimpleHTTPServer.SimpleHTTPRequestHandler
    )
    # Print out before actually running the server (cheeky / optimistic, however
    # you want to look at it)
    print('Your images are at http://127.0.0.1:%d/%s' % (
        arg_0,
        INDEX_FILE_NAME
    ))
    # Try to run the server
    try:
        # Run it - this call blocks until the server is killed
        arg_4.serve_forever()
    except KeyboardInterrupt:
        # This is the expected way of the server being killed, since imageMe is
        # intended for ad-hoc running from command line
        print('User interrupted, stopping')
    except Exception as exptn:
        # Catch everything else - this will handle shutdowns via other signals
        # and faults actually starting the server in the first place
        print(exptn)
        print('Unhandled exception in server, stopping')

Run the image server . This is blocking . Will handle user KeyboardInterrupt and other exceptions appropriately and return control once the server is stopped .


def Func ( arg_0 ) : arg_1 = '{}/awards/awards_{}.html' . format ( sportsref . nba . BASE_URL , arg_0 . yr ) arg_2 = pq ( sportsref . utils . get_html ( arg_1 ) ) arg_3 = arg_2 ( 'table#roy' ) arg_4 = sportsref . utils . parse_table ( arg_3 ) return arg_4

def Func(arg_0):
        """Returns a DataFrame containing information about ROY voting."""
        arg_1 = '{}/awards/awards_{}.html'.format(sportsref.nba.BASE_URL, arg_0.yr)
        arg_2 = pq(sportsref.utils.get_html(arg_1))
        arg_3 = arg_2('table#roy')
        arg_4 = sportsref.utils.parse_table(arg_3)
        return arg_4

Returns a DataFrame containing information about ROY voting .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_3 is None : return None arg_4 = arg_2 [ '_paramAdditionalUrls' ] arg_5 = { } if isinstance ( arg_3 , str ) : arg_5 [ arg_4 [ 0 ] ] = arg_3 else : for arg_6 , arg_7 in zip ( arg_4 , arg_3 ) : arg_5 [ arg_6 ] = arg_7 return arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """Parse additional url fields and map them to inputs

        Attempt to create a dictionary with keys being user input, and
        response being the returned URL
        """
        if arg_3 is None:
            return None

        arg_4 = arg_2['_paramAdditionalUrls']
        arg_5 = {}
        if isinstance(arg_3, str):
            arg_5[arg_4[0]] = arg_3
        else:
            for arg_6, arg_7 in zip(arg_4, arg_3):
                arg_5[arg_6] = arg_7
        return arg_5


def Func(arg_0, arg_1):
    '''Handler for mv command'''

    arg_0.validate('cmd|s3|s3', arg_1)
    arg_2 = arg_1[1]
    arg_3 = arg_1[2]
    arg_0.s3handler().cp_files(arg_2, arg_3, delete_source=True)


def Func ( arg_0 , arg_1 ) : arg_2 = [ '0' , 'no' , 'n' , 'off' , 'false' , 'f' ] arg_3 = [ 'store_true' , 'store_false' , internal . Switch ] for arg_4 in arg_1 : arg_5 , arg_6 = arg_4 . split ( '=' , 1 ) arg_7 , arg_5 = arg_5 . split ( '.' , 1 ) if arg_7 not in arg_0 : raise error . SectionError ( arg_7 ) if arg_5 not in arg_0 [ arg_7 ] : raise error . OptionError ( arg_5 ) arg_8 = arg_0 [ arg_7 ] . def_ [ arg_5 ] if arg_8 . default is None : if 'type' in arg_8 . cmd_kwargs : arg_9 = arg_8 . cmd_kwargs [ 'type' ] else : arg_10 = arg_8 . cmd_kwargs . get ( 'action' ) arg_9 = bool if arg_10 in arg_3 else str else : arg_9 = type ( arg_8 . default ) if arg_9 is bool and arg_6 . lower ( ) in arg_2 : arg_6 = '' arg_0 [ arg_7 ] [ arg_5 ] = arg_9 ( arg_6 )

def Func(arg_0, arg_1):
    """Set options from a list of section.option=value string.

    Args:
        conf (:class:`~loam.manager.ConfigurationManager`): the conf to update.
        optstrs (list of str): the list of 'section.option=value' formatted
            string.
    """
    arg_2 = ['0', 'no', 'n', 'off', 'false', 'f']
    arg_3 = ['store_true', 'store_false', internal.Switch]
    for arg_4 in arg_1:
        arg_5, arg_6 = arg_4.split('=', 1)
        arg_7, arg_5 = arg_5.split('.', 1)
        if arg_7 not in arg_0:
            raise error.SectionError(arg_7)
        if arg_5 not in arg_0[arg_7]:
            raise error.OptionError(arg_5)
        arg_8 = arg_0[arg_7].def_[arg_5]
        if arg_8.default is None:
            if 'type' in arg_8.cmd_kwargs:
                arg_9 = arg_8.cmd_kwargs['type']
            else:
                arg_10 = arg_8.cmd_kwargs.get('action')
                arg_9 = bool if arg_10 in arg_3 else str
        else:
            arg_9 = type(arg_8.default)
        if arg_9 is bool and arg_6.lower() in arg_2:
            arg_6 = ''
        arg_0[arg_7][arg_5] = arg_9(arg_6)

Set options from a list of section . option = value string .


(self,
                         signing_key,
                         message,
                         signature,
                         padding_method,
                         signing_algorithm=None,
                         hashing_algorithm=None,
                         digital_signature_algorithm=None)

def Func(arg_0,
                         arg_1,
                         arg_2,
                         arg_3,
                         arg_4,
                         arg_5=None,
                         arg_6=None,
                         arg_7=None):
        """
        Verify a message signature.

        Args:
            signing_key (bytes): The bytes of the signing key to use for
                signature verification. Required.
            message (bytes): The bytes of the message that corresponds with
                the signature. Required.
            signature (bytes): The bytes of the signature to be verified.
                Required.
            padding_method (PaddingMethod): An enumeration specifying the
                padding method to use during signature verification. Required.
            signing_algorithm (CryptographicAlgorithm): An enumeration
            specifying the cryptographic algorithm to use for signature
            verification. Only RSA is supported. Optional, must match the
                algorithm specified by the digital signature algorithm if both
                are provided. Defaults to None.
            hashing_algorithm (HashingAlgorithm): An enumeration specifying
                the hashing algorithm to use with the cryptographic algortihm,
                if needed. Optional, must match the algorithm specified by the
                digital signature algorithm if both are provided. Defaults to
                None.
            digital_signature_algorithm (DigitalSignatureAlgorithm): An
                enumeration specifying both the cryptographic and hashing
                algorithms to use for signature verification. Optional, must
                match the cryptographic and hashing algorithms if both are
                provided. Defaults to None.

        Returns:
            boolean: the result of signature verification, True for valid
                signatures, False for invalid signatures

        Raises:
            InvalidField: Raised when various settings or values are invalid.
            CryptographicFailure: Raised when the signing key bytes cannot be
                loaded, or when the signature verification process fails
                unexpectedly.
        """
        arg_8 = default_backend()

        arg_9 = None
        arg_10 = None
        arg_11 = None

        if arg_6:
            arg_9 = arg_0._encryption_hash_algorithms.get(
                arg_6
            )
        if arg_7:
            arg_12 = arg_0._digital_signature_algorithms.get(
                arg_7
            )
            if arg_12:
                arg_10 = arg_12[0]
                arg_11 = arg_12[1]

        if arg_10 and arg_11:
            if arg_9 and (arg_9 != arg_10):
                raise exceptions.InvalidField(
                    "The hashing algorithm does not match the digital "
                    "signature algorithm."
                )
            if (arg_5 and
                    (arg_5 != arg_11)):
                raise exceptions.InvalidField(
                    "The signing algorithm does not match the digital "
                    "signature algorithm."
                )

            arg_5 = arg_11
            arg_9 = arg_10

        if arg_5 == enums.CryptographicAlgorithm.RSA:
            if arg_4 == enums.PaddingMethod.PSS:
                if arg_9:
                    arg_13 = asymmetric_padding.PSS(
                        mgf=asymmetric_padding.MGF1(arg_9()),
                        salt_length=asymmetric_padding.PSS.MAX_LENGTH
                    )
                else:
                    raise exceptions.InvalidField(
                        "A hashing algorithm must be specified for PSS "
                        "padding."
                    )
            elif arg_4 == enums.PaddingMethod.PKCS1v15:
                arg_13 = asymmetric_padding.PKCS1v15()
            else:
                raise exceptions.InvalidField(
                    "The padding method '{0}' is not supported for signature "
                    "verification.".format(arg_4)
                )

            try:
                arg_14 = arg_8.load_der_public_key(arg_1)
            except Exception:
                try:
                    arg_14 = arg_8.load_pem_public_key(arg_1)
                except Exception:
                    raise exceptions.CryptographicFailure(
                        "The signing key bytes could not be loaded."
                    )

            try:
                arg_14.verify(
                    arg_3,
                    arg_2,
                    arg_13,
                    arg_9()
                )
                return True
            except errors.InvalidSignature:
                return False
            except Exception:
                raise exceptions.CryptographicFailure(
                    "The signature verification process failed."
                )
        else:
            raise exceptions.InvalidField(
                "The signing algorithm '{0}' is not supported for "
                "signature verification.".format(arg_5)
            )


return ids['amb'], ids['ann'], ids['bwt'], ids['pac'], ids['sa']

def Func(arg_0, arg_1):
    """
    Use BWA to create reference index files

    :param JobFunctionWrappingJob job: passed automatically by Toil
    :param str ref_id: FileStoreID for the reference genome
    :return: FileStoreIDs for BWA index files
    :rtype: tuple(str, str, str, str, str)
    """
    arg_0.fileStore.logToMaster('Created BWA index files')
    arg_2 = arg_0.fileStore.getLocalTempDir()
    arg_0.fileStore.readGlobalFile(arg_1, os.path.join(arg_2, 'ref.fa'))
    arg_3 = ['index', '/data/ref.fa']
    dockerCall(arg_0=arg_0, workDir=arg_2, parameters=arg_3,
               tool='quay.io/ucsc_cgl/bwa:0.7.12--256539928ea162949d8a65ca5c79a72ef557ce7c')
    arg_4 = {}
    for arg_5 in ['ref.fa.amb', 'ref.fa.ann', 'ref.fa.bwt', 'ref.fa.pac', 'ref.fa.sa']:
        arg_4[arg_5.split('.')[-1]] = (arg_0.fileStore.writeGlobalFile(os.path.join(arg_2, arg_5)))
    return arg_4['amb'], arg_4['ann'], arg_4['bwt'], arg_4['pac'], arg_4['sa']


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if not arg_2 : if pl_true ( arg_0 , arg_3 ) : arg_4 = pl_true ( arg_1 , arg_3 ) assert arg_4 in ( True , False ) return arg_4 else : return True else : arg_5 , arg_6 = arg_2 [ 0 ] , arg_2 [ 1 : ] return ( Func ( arg_0 , arg_1 , arg_6 , extend ( arg_3 , arg_5 , True ) ) and Func ( arg_0 , arg_1 , arg_6 , extend ( arg_3 , arg_5 , False ) ) )

def Func(arg_0, arg_1, arg_2, arg_3):
    "Auxiliary routine to implement tt_entails."
    if not arg_2:
        if pl_true(arg_0, arg_3):
            arg_4 = pl_true(arg_1, arg_3)
            assert arg_4 in (True, False)
            return arg_4
        else:
            return True
    else:
        arg_5, arg_6 = arg_2[0], arg_2[1:]
        return (Func(arg_0, arg_1, arg_6, extend(arg_3, arg_5, True)) and
                Func(arg_0, arg_1, arg_6, extend(arg_3, arg_5, False)))

Auxiliary routine to implement tt_entails .


return getattr(self.nb.metadata, 'code_example', None)

def Func ( arg_0 ) : if arg_0 . _Func is not None : return arg_0 . _Func return getattr ( arg_0 . nb . metadata , 'Func' , None )

def Func(arg_0):
        """The code example out of the notebook metadata"""
        if arg_0._Func is not None:
            return arg_0._Func
        return getattr(arg_0.nb.metadata, 'Func', None)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = None with cd ( arg_1 . rootdir ) : arg_4 = arg_0 . _run ( arg_2 ) try : arg_3 = { 'cmd' : arg_2 , 'status' : 'success' , 'message' : arg_4 , } except Exception as e : arg_3 = { 'cmd' : arg_2 , 'status' : 'error' , 'message' : str ( e ) } return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Run a generic command within the repo. Assumes that you are
        in the repo's root directory
        """

        arg_3 = None
        with cd(arg_1.rootdir):
            # Dont use sh. It is not collecting the stdout of all
            # child processes.
            arg_4 = arg_0._run(arg_2)
            try:
                arg_3 = {
                    'cmd': arg_2,
                    'status': 'success',
                    'message': arg_4,
                }
            except Exception as e:
                arg_3 = {
                    'cmd': arg_2,
                    'status': 'error',
                    'message': str(e)
                }

        return arg_3

Run a generic command within the repo . Assumes that you are in the repo s root directory


def Func(arg_0, arg_1, arg_2):
    """
    Create event in calendar with sms reminder.
    """

    try:
        arg_3 = arg_2.authorize(httplib2.Http())
        arg_4 = build("calendar", "v3", arg_3=arg_3)

        arg_5 = {
            "summary": arg_0.message,
            "location": "",
            "reminders": {
                "useDefault": False,
                "overrides": [
                    {
                        "method": "sms",
                        "minutes": arg_1["message"],
                    },
                ],
            }
        }
        arg_5.update(Func_datetimes(arg_0, arg_1))

        arg_4.events().insert(calendarId=arg_0.calendar, sendNotifications=True, body=arg_5).execute()
    except Exception, err:
        if not arg_0.quiet:
            sys.stderr.write("ERROR: Creating google calendar event error. {err}\n".format(err=err))
        sys.exit(-1)

Create event in calendar with sms reminder .


(songs, include_filters=None, exclude_filters=None, all_includes=False, all_excludes=False)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False, arg_4=False):
	"""Match a Google Music song dict against a set of metadata filters.

	Parameters:
		songs (list): Google Music song dicts to filter.

		include_filters (list): A list of ``(field, pattern)`` tuples.
			Fields are any valid Google Music metadata field available to the Musicmanager client.
			Patterns are Python regex patterns.
			Google Music songs are filtered out if the given metadata field values don't match any of the given patterns.

		exclude_filters (list): A list of ``(field, pattern)`` tuples.
			Fields are any valid Google Music metadata field available to the Musicmanager client.
			Patterns are Python regex patterns.
			Google Music songs are filtered out if the given metadata field values match any of the given patterns.

		all_includes (bool): If ``True``, all include_filters criteria must match to include a song.

		all_excludes (bool): If ``True``, all exclude_filters criteria must match to exclude a song.

	Returns:
		A list of Google Music song dicts matching criteria and
		a list of Google Music song dicts filtered out using filter criteria.
		::

			(matched, filtered)
	"""

	arg_5 = []
	arg_6 = []

	if arg_1 or arg_2:
		for arg_7 in arg_0:
			if _check_filters(
					arg_7, arg_1=arg_1, arg_2=arg_2,
					arg_3=arg_3, arg_4=arg_4):
				arg_5.append(arg_7)
			else:
				arg_6.append(arg_7)
	else:
		arg_5 += arg_0

	return arg_5, arg_6

Match a Google Music song dict against a set of metadata filters .


def Func(arg_0, arg_1=True, arg_2=None):
        """Print all info of parameters in the network"""
        for arg_3, arg_4 in enumerate(arg_0.all_params):
            if arg_1:
                try:
                    arg_5 = arg_4.eval(arg_2=arg_2)
                    logging.info(
                        "  param {:3}: {:20} {:15}    {} (mean: {:<18}, median: {:<18}, std: {:<18})   ".
                        format(arg_3, arg_4.name, str(arg_5.shape), arg_4.dtype.name, arg_5.mean(), np.median(arg_5), arg_5.std())
                    )
                except Exception as e:
                    logging.info(str(e))
                    raise Exception(
                        "Hint: print params details after tl.layers.initialize_global_variables(sess) "
                        "or use network.Func(False)."
                    )
            else:
                logging.info("  param {:3}: {:20} {:15}    {}".format(arg_3, arg_4.name, str(arg_4.get_shape()), arg_4.dtype.name))
        logging.info("  num of params: %d" % arg_0.count_params())


return [self.stats[cache_level]['HIT_count']/self.first_dim_factor
                for cache_level in range(len(self.machine['memory hierarchy']))]

def
Func
(
arg_0
)
:
return
[
arg_0
.
stats
[
arg_1
]
[
'HIT_count'
]
/
arg_0
.
first_dim_factor
for
arg_1
in
range
(
len
(
arg_0
.
machine
[
'memory hierarchy'
]
)
)
]

def Func(arg_0):
        """Return a list with number of hit cache lines per memory hierarchy level."""
        return [arg_0.stats[arg_1]['HIT_count']/arg_0.first_dim_factor
                for arg_1 in range(len(arg_0.machine['memory hierarchy']))]

Return a list with number of hit cache lines per memory hierarchy level .


def Func(arg_0, arg_1):
        # type: (Digest) -> None
        """
        Absorbs a digest into the sponge.

        .. important::
            Keep track of the order that digests are added!

            To spend inputs from a multisig address, you must provide
            the private keys in the same order!

        References:

        - https://github.com/iotaledger/wiki/blob/master/multisigs.md#spending-inputs
        """
        if arg_0._address:
            raise ValueError('Cannot add digests once an address is extracted.')

        arg_0._sponge.absorb(arg_1.as_trits())
        arg_0._digests.append(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
config
.
get_conf
(
)
if
'studies'
not
in
arg_2
[
arg_0
.
backend_section
]
or
not
arg_2
[
arg_0
.
backend_section
]
[
'studies'
]
:
logger
.
debug
(
'No studies for %s'
%
arg_0
.
backend_section
)
return
arg_3
=
[
arg_10
for
arg_10
in
arg_2
[
arg_0
.
backend_section
]
[
'studies'
]
if
arg_10
.
strip
(
)
!=
""
]
if
not
arg_3
:
logger
.
debug
(
'No studies for %s'
%
arg_0
.
backend_section
)
return
logger
.
debug
(
"Executing studies for %s: %s"
%
(
arg_0
.
backend_section
,
arg_3
)
)
time
.
sleep
(
2
)
arg_4
=
arg_0
.
_get_enrich_backend
(
)
arg_5
=
arg_0
.
_get_ocean_backend
(
arg_4
)
arg_6
=
[
]
arg_7
=
arg_4
.
studies
arg_8
=
[
arg_10
.
__name__
for
arg_10
in
arg_4
.
studies
]
logger
.
debug
(
"All studies in %s: %s"
,
arg_0
.
backend_section
,
arg_8
)
logger
.
debug
(
"Configured studies %s"
,
arg_3
)
arg_9
=
[
arg_10
.
split
(
":"
)
[
0
]
for
arg_10
in
arg_3
]
if
not
set
(
arg_9
)
.
issubset
(
set
(
arg_8
)
)
:
logger
.
error
(
'Wrong studies names for %s: %s'
,
arg_0
.
backend_section
,
arg_3
)
raise
RuntimeError
(
'Wrong studies names '
,
arg_0
.
backend_section
,
arg_3
)
for
arg_10
in
arg_4
.
studies
:
if
arg_10
.
__name__
in
arg_9
:
arg_6
.
append
(
arg_10
)
arg_4
.
studies
=
arg_6
print
(
"Executing for %s the studies %s"
%
(
arg_0
.
backend_section
,
[
arg_10
for
arg_10
in
arg_3
]
)
)
arg_11
=
arg_0
.
__load_studies
(
)
do_studies
(
arg_5
,
arg_4
,
arg_11
,
arg_1
=
arg_1
)
arg_4
.
studies
=
arg_7

def Func(arg_0, arg_1):
        """ Execute the studies configured for the current backend """

        arg_2 = arg_0.config.get_conf()
        if 'studies' not in arg_2[arg_0.backend_section] or not \
           arg_2[arg_0.backend_section]['studies']:
            logger.debug('No studies for %s' % arg_0.backend_section)
            return

        arg_3 = [arg_10 for arg_10 in arg_2[arg_0.backend_section]['studies'] if arg_10.strip() != ""]
        if not arg_3:
            logger.debug('No studies for %s' % arg_0.backend_section)
            return

        logger.debug("Executing studies for %s: %s" % (arg_0.backend_section, arg_3))
        time.sleep(2)  # Wait so enrichment has finished in ES
        arg_4 = arg_0._get_enrich_backend()
        arg_5 = arg_0._get_ocean_backend(arg_4)

        arg_6 = []
        arg_7 = arg_4.studies
        arg_8 = [arg_10.__name__ for arg_10 in arg_4.studies]

        # Time to check that configured studies are valid
        logger.debug("All studies in %s: %s", arg_0.backend_section, arg_8)
        logger.debug("Configured studies %s", arg_3)
        arg_9 = [arg_10.split(":")[0] for arg_10 in arg_3]
        if not set(arg_9).issubset(set(arg_8)):
            logger.error('Wrong studies names for %s: %s', arg_0.backend_section, arg_3)
            raise RuntimeError('Wrong studies names ', arg_0.backend_section, arg_3)

        for arg_10 in arg_4.studies:
            if arg_10.__name__ in arg_9:
                arg_6.append(arg_10)

        arg_4.studies = arg_6
        print("Executing for %s the studies %s" % (arg_0.backend_section,
              [arg_10 for arg_10 in arg_3]))

        arg_11 = arg_0.__load_studies()

        do_studies(arg_5, arg_4, arg_11, arg_1=arg_1)
        # Return studies to its original value
        arg_4.studies = arg_7


def Func(arg_0, arg_1, arg_2, arg_3):
      """One more defense for GUI apps that call sys.Func.

      GUI frameworks like wxPython trap exceptions and call
      sys.Func themselves.  I guess this is a feature that
      enables them to keep running after exceptions that would
      otherwise kill their mainloop. This is a bother for IPython
      which excepts to catch all of the program exceptions with a try:
      except: statement.

      Normally, IPython sets sys.Func to a CrashHandler instance, so if
      any app directly invokes sys.Func, it will look to the user like
      IPython crashed.  In order to work around this, we can disable the
      CrashHandler and replace it with this Func instead, which prints a
      regular traceback using our InteractiveTB.  In this fashion, apps which
      call sys.Func will generate a regular-looking exception from
      IPython, and the CrashHandler will only be triggered by real IPython
      crashes.

      This hook should be used sparingly, only in places which are not likely
      to be true IPython errors.
      """
      arg_0.showtraceback((arg_1,arg_2,arg_3),tb_offset=0)

One more defense for GUI apps that call sys.excepthook.

      GUI frameworks like wxPython trap exceptions and call
      sys.excepthook themselves.  I guess this is a feature that
      enables them to keep running after exceptions that would
      otherwise kill their mainloop. This is a bother for IPython
      which excepts to catch all of the program exceptions with a try:
      except: statement.

      Normally, IPython sets sys.excepthook to a CrashHandler instance, so if
      any app directly invokes sys.excepthook, it will look to the user like
      IPython crashed.  In order to work around this, we can disable the
      CrashHandler and replace it with this excepthook instead, which prints a
      regular traceback using our InteractiveTB.  In this fashion, apps which
      call sys.excepthook will generate a regular-looking exception from
      IPython, and the CrashHandler will only be triggered by real IPython
      crashes.

      This hook should be used sparingly, only in places which are not likely
      to be true IPython errors.

One more defense for GUI apps that call sys . excepthook .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
=
_whitespace_only_re
.
sub
(
''
,
arg_0
)
arg_2
=
_leading_whitespace_re
.
findall
(
arg_0
)
for
arg_3
in
arg_2
:
if
arg_1
is
:
arg_1
=
arg_3
elif
arg_3
.
startswith
(
arg_1
)
:
pass
elif
arg_1
.
startswith
(
arg_3
)
:
arg_1
=
arg_3
else
:
for
arg_4
,
(
arg_5
,
arg_6
)
in
enumerate
(
zip
(
arg_1
,
arg_3
)
)
:
if
arg_5
!=
arg_6
:
arg_1
=
arg_1
[
:
arg_4
]
break
else
:
arg_1
=
arg_1
[
:
len
(
arg_3
)
]
if
0
and
arg_1
:
for
arg_7
in
arg_0
.
split
(
"\n"
)
:
assert
not
arg_7
or
arg_7
.
startswith
(
arg_1
)
,
"line = %r, margin = %r"
%
(
arg_7
,
arg_1
)
if
arg_1
:
arg_0
=
re
.
sub
(
r'(?m)^'
+
arg_1
,
''
,
arg_0
)
return
arg_0

def Func(arg_0):
    """Remove any common leading whitespace from every line in `text`.

    This can be used to make triple-quoted strings line up with the left
    edge of the display, while still presenting them in the source code
    in indented form.

    Note that tabs and spaces are both treated as whitespace, but they
    are not equal: the lines "  hello" and "\\thello" are
    considered to have no common leading whitespace.  (This behaviour is
    new in Python 2.5; older versions of this module incorrectly
    expanded tabs before searching for common leading whitespace.)
    """
    # Look for the longest leading string of spaces and tabs common to
    # all lines.
    arg_1 = None
    arg_0 = _whitespace_only_re.sub('', arg_0)
    arg_2 = _leading_whitespace_re.findall(arg_0)
    for arg_3 in arg_2:
        if arg_1 is None:
            arg_1 = arg_3

        # Current line more deeply indented than previous winner:
        # no change (previous winner is still on top).
        elif arg_3.startswith(arg_1):
            pass

        # Current line consistent with and no deeper than previous winner:
        # it's the new winner.
        elif arg_1.startswith(arg_3):
            arg_1 = arg_3

        # Find the largest common whitespace between current line and previous
        # winner.
        else:
            for arg_4, (arg_5, arg_6) in enumerate(zip(arg_1, arg_3)):
                if arg_5 != arg_6:
                    arg_1 = arg_1[:arg_4]
                    break
            else:
                arg_1 = arg_1[:len(arg_3)]

    # sanity check (testing/debugging only)
    if 0 and arg_1:
        for arg_7 in arg_0.split("\n"):
            assert not arg_7 or arg_7.startswith(arg_1), \
                   "line = %r, margin = %r" % (arg_7, arg_1)

    if arg_1:
        arg_0 = re.sub(r'(?m)^' + arg_1, '', arg_0)
    return arg_0

Remove any common leading whitespace from every line in text .


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

def Func(arg_0, arg_1, arg_2,
                                arg_3, arg_4, arg_5):
        """Renames an existing REQUIRED CONSTRAINT for the specified
        hstore key."""

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

        arg_8 = arg_0.sql_hstore_required_rename.format(
            table=arg_0.quote_name(arg_2),
            arg_6=arg_0.quote_name(arg_6),
            arg_7=arg_0.quote_name(arg_7)
        )
        arg_0.execute(arg_8)

Renames an existing REQUIRED CONSTRAINT for the specified hstore key .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
isinstance
(
arg_1
,
basestring
)
:
arg_1
=
[
arg_1
]
arg_3
=
"Func-get install -y %s"
%
(
' '
.
join
(
arg_1
)
)
return
arg_0
.
wait
(
arg_3
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1, arg_2=False):
        """
        Install specified packages using Func-get. -y options are
        automatically used. Waits for command to finish.

        Parameters
        ----------
        package_names: list-like of str
        raise_on_error: bool, default False
            If True then raise ValueError if stderr is not empty
            debconf often gives tty error
        """
        if isinstance(arg_1, basestring):
            arg_1 = [arg_1]
        arg_3 = "Func-get install -y %s" % (' '.join(arg_1))
        return arg_0.wait(arg_3, arg_2=arg_2)

Install specified packages using apt-get. -y options are
        automatically used. Waits for command to finish.

        Parameters
        ----------
        package_names: list-like of str
        raise_on_error: bool, default False
            If True then raise ValueError if stderr is not empty
            debconf often gives tty error

Install specified packages using apt - get . - y options are automatically used . Waits for command to finish .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = None for arg_4 in arg_0 . patterns : if arg_4 . is_dir == arg_2 and arg_4 . matches ( arg_1 ) : arg_3 = arg_4 . inclusive return arg_3

def Func(arg_0, arg_1, arg_2=False):
        """Check patterns in order, last match that includes or excludes `path` wins. Return `None` on undecided."""
        arg_3 = None
        for arg_4 in arg_0.patterns:
            if arg_4.is_dir == arg_2 and arg_4.matches(arg_1):
                arg_3 = arg_4.inclusive

        #print('+++' if inclusive else '---', path, pattern)
        return arg_3

Check patterns in order last match that includes or excludes path wins . Return None on undecided .


def Func(arg_0, arg_1, arg_2='vector-web-s'):
        '''Retrieves a vector.  Not usually necessary because searching is the best way to find & Func stuff.

        Args:
            ID (str): ID of the vector object
            index (str): Optional.  Index the object lives in.  defaults to 'vector-web-s'

        Returns:
            record (dict): A dict object identical to the json representation of the catalog record
        '''

        arg_3 = arg_0.Func_url % arg_2
        arg_4 = arg_0.gbdx_connection.Func(arg_3 + arg_1)
        arg_4.raise_for_status()
        return arg_4.json()

Retrieves a vector.  Not usually necessary because searching is the best way to find & get stuff.

        Args:
            ID (str): ID of the vector object
            index (str): Optional.  Index the object lives in.  defaults to 'vector-web-s'

        Returns:
            record (dict): A dict object identical to the json representation of the catalog record

Retrieves a vector . Not usually necessary because searching is the best way to find & get stuff .


return SubscriptionClient.from_entity(
            self._get_host(), topic_name, subscription,
            shared_access_key_name=self.shared_access_key_name,
            shared_access_key_value=self.shared_access_key_value,
            loop=self.loop,
            debug=self.debug)

def Func(arg_0, arg_1, arg_2):
        """Get an async client for a subscription entity.

        :param topic_name: The name of the topic.
        :type topic_name: str
        :param subscription_name: The name of the subscription.
        :type subscription_name: str
        :rtype: ~azure.servicebus.aio.async_client.SubscriptionClient
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the subscription is not found.

        Example:
            .. literalinclude:: ../examples/async_examples/test_examples_async.py
                :start-after: [START get_async_subscription_client]
                :end-before: [END get_async_subscription_client]
                :language: python
                :dedent: 4
                :caption: Get a TopicClient for the specified topic.

        """
        try:
            arg_3 = arg_0.mgmt_client.Func(arg_1, arg_2)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except AzureServiceBusResourceNotFound:
            raise ServiceBusResourceNotFound("Specificed subscription does not exist.")
        return SubscriptionClient.from_entity(
            arg_0._get_host(), arg_1, arg_3,
            shared_access_key_name=arg_0.shared_access_key_name,
            shared_access_key_value=arg_0.shared_access_key_value,
            loop=arg_0.loop,
            debug=arg_0.debug)

Get an async client for a subscription entity .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Update build.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon build -b 2 Func --description="new description for my build"
    ```
    """
    arg_4, arg_5, arg_6 = get_build_or_local(arg_0.obj.get('project'), arg_0.obj.get('build'))
    arg_7 = {}

    if arg_1:
        arg_7['name'] = arg_1

    if arg_2:
        arg_7['description'] = arg_2

    arg_3 = validate_tags(arg_3)
    if arg_3:
        arg_7['tags'] = arg_3

    if not arg_7:
        Printer.print_warning('No argument was provided to Func the build.')
        sys.exit(0)

    try:
        arg_8 = PolyaxonClient().build_job.Func_build(
            arg_4, arg_5, arg_6, arg_7)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func build `{}`.'.format(arg_6))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Printer.print_success("Build Funcd.")
    get_build_details(arg_8)

Update build.

    Uses [Caching](/references/polyaxon-cli/#caching)

    Example:

    \b
    ```bash
    $ polyaxon build -b 2 update --description="new description for my build"
    ```


def Func(arg_0, arg_1, arg_2=None):
        """
        Set a callback to validate OCSP data stapled to the TLS handshake on
        the client side.

        :param callback: The callback function. It will be invoked with three
            arguments: the Connection, a bytestring containing the stapled OCSP
            assertion, and the optional arbitrary data you have provided. The
            callback must return a boolean that indicates the result of
            validating the OCSP data: ``True`` if the OCSP data is valid and
            the certificate can be trusted, or ``False`` if either the OCSP
            data is invalid or the certificate has been revoked.
        :param data: Some opaque data that will be passed into the callback
            function when called. This can be used to avoid needing to do
            complex data lookups or to keep track of what context is being
            used. This parameter is optional.
        """
        arg_3 = _OCSPClientCallbackHelper(arg_1)
        arg_0._set_ocsp_callback(arg_3, arg_2)

Set a callback to validate OCSP data stapled to the TLS handshake on the client side .


(df, column: str, groups: Union[str, List[str]] = None)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 [ arg_2 , arg_5 [ arg_2 ] ] = None ) : if arg_3 is None : arg_0 = arg_0 [ arg_0 [ arg_1 ] == arg_0 [ arg_1 ] . min ( ) ] . reset_index ( drop = True ) else : arg_6 = arg_0 . groupby ( arg_3 ) [ arg_1 ] . transform ( 'min' ) arg_0 = ( arg_0 . loc [ arg_0 [ arg_1 ] == arg_6 , : ] . drop_duplicates ( ) . reset_index ( drop = True ) ) return arg_0

def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_2, arg_5[arg_2]] = None):
    """
    Keep the row of the data corresponding to the minimal value in a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (str): name of the column containing the value you want to keep the minimum

    *optional :*
    - `groups` (*str or list(str)*): name of the column(s) used for 'groupby' logic
    (the function will return the argmax by group)
    ---

    ### Example

    **Input**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2014    |  300  |
    |   toto   |  wave 1 |  2015    |  250  |
    |   toto   |  wave 1 |  2016    |  450  |

    ```cson
    Func:
      column: 'year'
    ]
    ```

    **Output**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2015    |  250  |
    """
    if arg_3 is None:
        arg_0 = arg_0[arg_0[arg_1] == arg_0[arg_1].min()].reset_index(drop=True)
    else:
        arg_6 = arg_0.groupby(arg_3)[arg_1].transform('min')
        arg_0 = (arg_0
              .loc[arg_0[arg_1] == arg_6, :]
              .drop_duplicates()
              .reset_index(drop=True)
              )
    return arg_0

Keep the row of the data corresponding to the minimal value in a column

    ---

    ### Parameters

    *mandatory :*
    - `column` (str): name of the column containing the value you want to keep the minimum

    *optional :*
    - `groups` (*str or list(str)*): name of the column(s) used for 'groupby' logic
    (the function will return the argmax by group)
    ---

    ### Example

    **Input**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2014    |  300  |
    |   toto   |  wave 1 |  2015    |  250  |
    |   toto   |  wave 1 |  2016    |  450  |

    ```cson
    argmin:
      column: 'year'
    ]
    ```

    **Output**

    | variable |   wave  |  year    | value |
    |:--------:|:-------:|:--------:|:-----:|
    |   toto   |  wave 1 |  2015    |  250  |


Send a string of raw input to the kernel.

def Func ( arg_0 , arg_1 ) : arg_2 = dict ( value = arg_1 ) arg_3 = arg_0 . session . msg ( 'Func_reply' , arg_2 ) arg_0 . _queue_send ( arg_3 )

def Func(arg_0, arg_1):
        """Send a string of raw Func to the kernel."""
        arg_2 = dict(value=arg_1)
        arg_3 = arg_0.session.msg('Func_reply', arg_2)
        arg_0._queue_send(arg_3)

Send a string of raw input to the kernel .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . ModifyOTRStatusResponse ( ) await arg_0 . _pb_request ( 'conversations/modifyotrstatus' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Enable or disable message history in a conversation."""
        arg_2 = hangouts_pb2.ModifyOTRStatusResponse()
        await arg_0._pb_request('conversations/modifyotrstatus',
                               arg_1, arg_2)
        return arg_2

Enable or disable message history in a conversation .


Calculate the covariance matrix for x and y or more expressions, possibly on a grid defined by binby.

(self, x, y=None, binby=[], limits=None, shape=default_shape, selection=False, delay=False, progress=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=[], arg_4=None, arg_5=arg_6, arg_7=False, arg_8=False, arg_9=None):
        """Calculate the Funcariance matrix for x and y or more expressions, possibly on a grid defined by binby.

        Either x and y are expressions, e.g:

        >>> df.Func("x", "y")

        Or only the x argument is given with a list of expressions, e,g.:

        >>> df.Func(["x, "y, "z"])

        Example:

        >>> df.Func("x", "y")
        array([[ 53.54521742,  -3.8123135 ],
        [ -3.8123135 ,  60.62257881]])
        >>> df.Func(["x", "y", "z"])
        array([[ 53.54521742,  -3.8123135 ,  -0.98260511],
        [ -3.8123135 ,  60.62257881,   1.21381057],
        [ -0.98260511,   1.21381057,  25.55517638]])

        >>> df.Func("x", "y", binby="E", shape=2)
        array([[[  9.74852878e+00,  -3.02004780e-02],
        [ -3.02004780e-02,   9.99288215e+00]],
        [[  8.43996546e+01,  -6.51984181e+00],
        [ -6.51984181e+00,   9.68938284e+01]]])

        :param x: {expression}
        :param y: {expression_single}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :return: {return_stat_scalar}, the last dimensions are of shape (2,2)
        """
        arg_7 = _ensure_strings_from_expressions(arg_7)
        if arg_2 is None:
            if not _issequence(arg_1):
                raise ValueError("if y argument is not given, x is expected to be sequence, not %r", arg_1)
            arg_10 = arg_1
        else:
            arg_10 = [arg_1, arg_2]
        arg_11 = len(arg_10)
        arg_3 = _ensure_list(arg_3)
        arg_5 = _expand_shape(arg_5, len(arg_3))
        arg_12 = vaex.utils.progressbars(arg_9)
        arg_4 = arg_0.limits(arg_3, arg_4, arg_7=arg_7, arg_8=True)

        @delayed
        def calculate(arg_10, arg_4):
            # print('limits', limits)
            arg_13 = tasks.TaskStatistic(arg_0, arg_3, arg_5, arg_4, weights=arg_10, op=tasks.OP_COV, arg_7=arg_7)
            arg_0.executor.schedule(arg_13)
            arg_12.add_task(arg_13, "Funcariance values for %r" % arg_10)
            return arg_13

        @delayed
        def finish(arg_14):
            arg_11 = len(arg_10)
            arg_15 = arg_14[..., :arg_11]
            arg_16 = arg_14[..., arg_11:2 * arg_11]
            with np.errstate(divide='ignore', invalid='ignore'):
                arg_17 = arg_16 / arg_15
            # matrix of means * means.T
            arg_18 = arg_17[..., None] * arg_17[..., None, :]

            arg_15 = arg_14[..., 2 * arg_11:2 * arg_11 + arg_11**2]
            arg_16 = arg_14[..., 2 * arg_11 + arg_11**2:]
            arg_5 = arg_15.shape[:-1] + (arg_11, arg_11)
            arg_15 = arg_15.reshape(arg_5)
            arg_16 = arg_16.reshape(arg_5)
            with np.errstate(divide='ignore', invalid='ignore'):
                arg_19 = arg_16 / arg_15
            arg_20 = arg_19 - arg_18
            return arg_20
        arg_12 = vaex.utils.progressbars(arg_9)
        arg_14 = calculate(arg_10, arg_4)
        arg_20 = finish(arg_14)
        return arg_0._delay(arg_8, arg_20)

Calculate the covariance matrix for x and y or more expressions possibly on a grid defined by binby .


(self, headers=None,
                       yes_i_mean_delete_the_account=False, query=None,
                       cdn=False, body=None)

return self.request(
            'DELETE', '', body or '', headers, query=query, cdn=cdn)

def Func(arg_0, arg_1=None,
                       arg_2=False, arg_3=None,
                       arg_4=False, arg_5=None):
        """
        Sends a DELETE request to the account and returns the results.

        With ``query['bulk-delete'] = ''`` this might mean a bulk
        delete request where the body of the request is new-line
        separated, url-encoded list of names to delete. Be careful
        with this! One wrong move and you might mark your account for
        deletion of you have the access to do so!

        For a plain DELETE to the account, on clusters that support
        it and, assuming you have permissions to do so, the account
        will be marked as deleted and immediately begin removing the
        objects from the cluster in the backgound.

        THERE IS NO GOING BACK!

        :param headers: Additional headers to send with the request.
        :param yes_i_mean_delete_the_account: Set to True to verify
            you really mean to delete the entire account. This is
            required unless ``body and 'bulk-delete' in query``.
        :param query: Set to a dict of query values to send on the
            query string of the request.
        :param cdn: If set True, the CDN management interface will be
            used.
        :param body: Some account DELETE requests, like the bulk
            delete request, take a body.
        :returns: A tuple of (status, reason, headers, contents).

            :status: is an int for the HTTP status code.
            :reason: is the str for the HTTP status (ex: "Ok").
            :headers: is a dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be
                a list.
            :contents: is the str for the HTTP body.
        """
        if not arg_2 and (
                not arg_5 or not arg_3 or 'bulk-delete' not in arg_3):
            return (0, 'yes_i_mean_delete_the_account was not set to True', {},
                    '')
        return arg_0.request(
            'DELETE', '', arg_5 or '', arg_1, arg_3=arg_3, arg_4=arg_4)

Sends a DELETE request to the account and returns the results .


def Func ( arg_0 , arg_1 , arg_2 ) : if len ( arg_1 . reviews ) != 0 : if not arg_0 . review_date_set : arg_0 . review_date_set = True arg_4 = utils . datetime_from_iso_format ( arg_2 ) if arg_4 is not None : arg_1 . reviews [ - 1 ] . review_date = arg_4 return True else : raise SPDXValueError ( 'Review::ReviewDate' ) else : raise CardinalityError ( 'Review::ReviewDate' ) else : raise OrderError ( 'Review::ReviewDate' )

def Func(arg_0, arg_1, arg_2):
        """Sets the review date. Raises CardinalityError if
        already set. OrderError if no reviewer defined before.
        Raises SPDXValueError if invalid reviewed value.
        """
        if len(arg_1.reviews) != 0:
            if not arg_0.review_date_set:
                arg_0.review_date_set = True
                arg_4 = utils.datetime_from_iso_format(arg_2)
                if arg_4 is not None:
                    arg_1.reviews[-1].review_date = arg_4
                    return True
                else:
                    raise SPDXValueError('Review::ReviewDate')
            else:
                raise CardinalityError('Review::ReviewDate')
        else:
            raise OrderError('Review::ReviewDate')

Sets the review date . Raises CardinalityError if already set . OrderError if no reviewer defined before . Raises SPDXValueError if invalid reviewed value .


def Func(arg_0, arg_1):
    """
    Query for if date_field is within number of "days" ago.
    """
    arg_2 = None
    arg_0 = get_integer(arg_0)
    if arg_0:
        arg_3 = get_days_ago(arg_0)
        arg_2 = Q(**{"%s__gte" % arg_1: arg_3.isoformat()})
    return arg_2

Query for if date_field is within number of days ago .


(
    node: astroid.node_classes.NodeNG
)

def Func ( arg_0 : arg_1 . node_classes . NodeNG ) -> Union [ arg_1 . ExceptHandler , arg_1 . TryExcept ] : arg_4 = arg_0 arg_5 = ( arg_1 . ExceptHandler , arg_1 . TryExcept ) while arg_4 and not isinstance ( arg_4 . parent , arg_5 ) : arg_4 = arg_4 . parent if arg_4 and isinstance ( arg_4 . parent , arg_5 ) : return arg_4 . parent return None

def Func(
    arg_0: arg_1.node_classes.NodeNG
) -> Union[arg_1.ExceptHandler, arg_1.TryExcept]:
    """Return the ExceptHandler or the TryExcept node in which the node is."""
    arg_4 = arg_0
    arg_5 = (arg_1.ExceptHandler, arg_1.TryExcept)
    while arg_4 and not isinstance(arg_4.parent, arg_5):
        arg_4 = arg_4.parent

    if arg_4 and isinstance(arg_4.parent, arg_5):
        return arg_4.parent
    return None

Return the ExceptHandler or the TryExcept node in which the node is .


def Func ( arg_0 , arg_1 ) : arg_2 = [ arg_0 ( ) ] def inner ( ) : arg_1 ( ) return arg_0 ( ) return arg_2 + many ( tri ( inner ) )

def Func(arg_0, arg_1):
    """Like sep but must consume at least one of parser.
    """
    arg_2 = [arg_0()]
    def inner():
        arg_1()
        return arg_0()
    return arg_2 + many(tri(inner))

Like sep but must consume at least one of parser .


def
Func
(
arg_0
)
:
if
arg_0
.
_future
:
arg_0
.
_job
.
poll_once
(
)
return
if
arg_0
.
_model_json
is
:
print
(
"No model trained yet"
)
return
if
arg_0
.
model_id
is
:
print
(
"This H2OEstimator has been removed."
)
return
arg_1
=
arg_0
.
_model_json
[
"output"
]
print
(
"Model Details"
)
print
(
"============="
)
print
(
arg_0
.
__class__
.
__name__
,
": "
,
arg_0
.
_model_json
[
"algo_full_name"
]
)
print
(
"Model Key: "
,
arg_0
.
_id
)
arg_0
.
summary
(
)
print
(
)
arg_2
=
arg_1
[
"training_metrics"
]
if
arg_2
:
arg_2
.
Func
(
)
arg_3
=
arg_1
[
"validation_metrics"
]
if
arg_3
:
arg_3
.
Func
(
)
arg_4
=
arg_1
[
"cross_validation_metrics"
]
if
arg_4
:
arg_4
.
Func
(
)
arg_5
=
arg_1
[
"cross_validation_metrics_summary"
]
if
arg_5
:
arg_5
.
Func
(
)
if
"scoring_history"
in
arg_1
and
arg_1
[
"scoring_history"
]
:
arg_1
[
"scoring_history"
]
.
Func
(
)
if
"variable_importances"
in
arg_1
and
arg_1
[
"variable_importances"
]
:
arg_1
[
"variable_importances"
]
.
Func
(
)

def Func(arg_0):
        """Print innards of model, without regards to type."""
        if arg_0._future:
            arg_0._job.poll_once()
            return
        if arg_0._model_json is None:
            print("No model trained yet")
            return
        if arg_0.model_id is None:
            print("This H2OEstimator has been removed.")
            return
        arg_1 = arg_0._model_json["output"]
        print("Model Details")
        print("=============")

        print(arg_0.__class__.__name__, ": ", arg_0._model_json["algo_full_name"])
        print("Model Key: ", arg_0._id)

        arg_0.summary()

        print()
        # training metrics
        arg_2 = arg_1["training_metrics"]
        if arg_2: arg_2.Func()
        arg_3 = arg_1["validation_metrics"]
        if arg_3: arg_3.Func()
        arg_4 = arg_1["cross_validation_metrics"]
        if arg_4: arg_4.Func()
        arg_5 = arg_1["cross_validation_metrics_summary"]
        if arg_5: arg_5.Func()

        if "scoring_history" in arg_1 and arg_1["scoring_history"]:
            arg_1["scoring_history"].Func()
        if "variable_importances" in arg_1 and arg_1["variable_importances"]:
            arg_1["variable_importances"].Func()

Print innards of model without regards to type .


def Func ( arg_0 ) : if arg_0 == 'IPython' : return os . path . join ( get_ipython_package_dir ( ) , '__init__.py' ) arg_1 = import_item ( arg_0 ) arg_2 = arg_1 . __file__ . replace ( '.pyc' , '.py' ) arg_2 = arg_2 . replace ( '.pyo' , '.py' ) return py3compat . cast_unicode ( arg_2 , fs_encoding )

def Func(arg_0):
    """Find the path to an IPython module in this version of IPython.

    This will always find the version of the module that is in this importable
    IPython package. This will always return the path to the ``.py``
    version of the module.
    """
    if arg_0 == 'IPython':
        return os.path.join(get_ipython_package_dir(), '__init__.py')
    arg_1 = import_item(arg_0)
    arg_2 = arg_1.__file__.replace('.pyc', '.py')
    arg_2 = arg_2.replace('.pyo', '.py')
    return py3compat.cast_unicode(arg_2, fs_encoding)

Find the path to an IPython module in this version of IPython .