def Func(arg_0, arg_1, arg_2="mix"):
        """General method for setting the input channels for the status process

        Given a list of status channels that are gathered during the pipeline
        construction, this method will automatically set the input channel
        for the status process. This makes use of the ``mix`` channel operator
        of nextflow for multiple channels::

            STATUS_1.mix(STATUS_2,STATUS_3,...)

        This will set the ``status_channels`` key for the ``_context``
        attribute of the process.

        Parameters
        ----------
        channel_list : list
            List of strings with the final name of the status channels
        operator : str
            Specifies the operator used to join the compiler channels.
            Available options are 'mix'and 'join'.
        """

        if not arg_1:
            raise eh.ProcessError("At least one status channel must be "
                                  "provided to include this process in the "
                                  "pipeline")

        if len(arg_1) == 1:
            logger.debug("Setting only one status channel: {}".format(
                arg_1[0]))
            arg_0._context = {"compile_channels": arg_1[0]}

        else:

            arg_4 = arg_1[0]

            if arg_2 == "mix":
                arg_5 = ",".join(arg_1[1:])

                arg_6 = "{}.mix({})".format(arg_4, arg_5)

            elif arg_2 == "join":

                arg_6 = arg_4
                for arg_7 in arg_1[1:]:
                    arg_6 += ".join({})".format(arg_7)

                arg_6 += ".map{ ot -> [ ot[0], ot[1..-1] ] }"

            logger.debug("Status channel string: {}".format(arg_6))

            arg_0._context = {"compile_channels": arg_6}


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """ Returns coordinates for point at t on the line.
            Calculates the coordinates of x and y for a point at t on a straight line.
            The t parameter is a number between 0.0 and 1.0,
            x0 and y0 define the starting point of the line,
            x1 and y1 the ending point of the line.
        """
        # Originally from nodebox-gl
        arg_6 = arg_2 + arg_1 * (arg_4 - arg_2)
        arg_7 = arg_3 + arg_1 * (arg_5 - arg_3)
        return (arg_6, arg_7)

Returns coordinates for point at t on the line . Calculates the coordinates of x and y for a point at t on a straight line . The t parameter is a number between 0 . 0 and 1 . 0 x0 and y0 define the starting point of the line x1 and y1 the ending point of the line .


def Func ( arg_0 ) : if arg_0 . async_mode : arg_0 . _Funcr . start ( ) arg_0 . _listener . start ( ) else : arg_0 . _Funcr . Func ( )

def Func(arg_0):
        """Start scheduling jobs."""

        if arg_0.async_mode:
            arg_0._Funcr.start()
            arg_0._listener.start()
        else:
            arg_0._Funcr.Func()


def Func ( arg_0 ) : try : arg_0 = arg_0 . getroot ( ) except AttributeError : pass arg_1 = "{%s}" % XHTML_NAMESPACE for arg_2 in arg_0 . iter ( etree . Element ) : arg_3 = arg_2 . tag if arg_3 [ 0 ] != '{' : arg_2 . tag = arg_1 + arg_3

def Func(arg_0):
    """Convert all tags in an HTML tree to XHTML by moving them to the
    XHTML namespace.
    """
    try:
        arg_0 = arg_0.getroot()
    except AttributeError:
        pass
    arg_1 = "{%s}" % XHTML_NAMESPACE
    for arg_2 in arg_0.iter(etree.Element):
        arg_3 = arg_2.tag
        if arg_3[0] != '{':
            arg_2.tag = arg_1 + arg_3

Convert all tags in an HTML tree to XHTML by moving them to the XHTML namespace .


def Func ( arg_0 , arg_1 = 1e-10 ) : arg_2 = np . array ( arg_0 ) if np . isrealobj ( arg_2 ) : arg_2 [ arg_3 ( arg_2 ) < arg_1 ] = 0.0 else : arg_2 . real [ arg_3 ( arg_2 . real ) < arg_1 ] = 0.0 arg_2 . imag [ arg_3 ( arg_2 . imag ) < arg_1 ] = 0.0 return arg_2

def Func(arg_0, arg_1=1e-10):
    """
    Truncate small values of a complex array.

    Args:
        array (array_like): array to truncte small values.
        epsilon (float): threshold.

    Returns:
        np.array: A new operator with small values set to zero.
    """
    arg_2 = np.array(arg_0)

    if np.isrealobj(arg_2):
        arg_2[arg_3(arg_2) < arg_1] = 0.0
    else:
        arg_2.real[arg_3(arg_2.real) < arg_1] = 0.0
        arg_2.imag[arg_3(arg_2.imag) < arg_1] = 0.0
    return arg_2

Truncate small values of a complex array .


(annotation, sr=22050, length=None, **kwargs)

def Func(arg_0, arg_1=22050, arg_2=None, **arg_3):
    '''Sonify multi-level segmentations'''

    # Pentatonic scale, because why not
    arg_4 = [1, 32./27, 4./3, 3./2, 16./9]
    arg_5 = 0.1

    arg_6, arg_7 = hierarchy_flatten(arg_0)

    if arg_2 is None:
        arg_2 = int(arg_1 * (max(np.max(arg_7) for arg_7 in arg_6) + 1. / arg_5) + 1)

    arg_8 = 0.0
    for arg_9, (arg_10, arg_11) in zip(arg_6, product(range(3, 3 + len(arg_6)),
                                                arg_4)):
        arg_12 = mkclick(440.0 * arg_11 * arg_10, arg_1=arg_1, duration=arg_5)
        arg_8 = arg_8 + filter_kwargs(mir_eval.sonify.clicks,
                              np.unique(arg_9),
                              fs=arg_1, arg_2=arg_2,
                              arg_12=arg_12)
    return arg_8


(tag='sky', path="data", n_threads=50, printable=False)

def Func(arg_0='sky', arg_1="data", arg_2=50, arg_3=False):
    """Load Flickr25K dataset.

    Returns a list of images by a given tag from Flick25k dataset,
    it will download Flickr25k from `the official website <http://press.liacs.nl/mirflickr/mirdownload.html>`__
    at the first time you use it.

    Parameters
    ------------
    tag : str or None
        What images to return.
            - If you want to get images with tag, use string like 'dog', 'red', see `Flickr Search <https://www.flickr.com/search/>`__.
            - If you want to get all images, set to ``None``.

    path : str
        The path that the data is downloaded to, defaults is ``data/flickr25k/``.
    n_threads : int
        The number of thread to read image.
    printable : boolean
        Whether to print infomation when reading images, default is ``False``.

    Examples
    -----------
    Get images with tag of sky

    >>> images = tl.files.Func(tag='sky')

    Get all images

    >>> images = tl.files.Func(tag=None, n_threads=100, printable=True)

    """
    arg_1 = os.path.join(arg_1, 'flickr25k')

    arg_4 = 'mirflickr25k.zip'
    arg_5 = 'http://press.liacs.nl/mirflickr/mirflickr25k/'

    # download dataset
    if folder_exists(os.path.join(arg_1, "mirflickr")) is False:
        logging.info("[*] Flickr25k is nonexistent in {}".format(arg_1))
        maybe_download_and_extract(arg_4, arg_1, arg_5, extract=True)
        del_file(os.path.join(arg_1, arg_4))

    # return images by the given tag.
    # 1. image path list
    arg_6 = os.path.join(arg_1, "mirflickr")
    arg_7 = load_file_list(arg_1=arg_6, regx='\\.jpg', arg_3=False)
    arg_7.sort(key=natural_keys)

    # 2. tag path list
    arg_8 = os.path.join(arg_1, "mirflickr", "meta", "tags")
    arg_9 = load_file_list(arg_1=arg_8, regx='\\.txt', arg_3=False)
    arg_9.sort(key=natural_keys)

    # 3. select images
    if arg_0 is None:
        logging.info("[Flickr25k] reading all images")
    else:
        logging.info("[Flickr25k] reading images with tag: {}".format(arg_0))
    arg_10 = []
    for arg_11, arg_12 in enumerate(arg_9):
        arg_13 = read_file(os.path.join(arg_8, arg_9[arg_11])).split('\n')
        # logging.info(idx+1, tags)
        if arg_0 is None or arg_0 in arg_13:
            arg_10.append(arg_7[arg_11])

    arg_14 = visualize.read_images(arg_10, arg_6, arg_2=arg_2, arg_3=arg_3)
    return arg_14

Load Flickr25K dataset.

    Returns a list of images by a given tag from Flick25k dataset,
    it will download Flickr25k from `the official website <http://press.liacs.nl/mirflickr/mirdownload.html>`__
    at the first time you use it.

    Parameters
    ------------
    tag : str or None
        What images to return.
            - If you want to get images with tag, use string like 'dog', 'red', see `Flickr Search <https://www.flickr.com/search/>`__.
            - If you want to get all images, set to ``None``.

    path : str
        The path that the data is downloaded to, defaults is ``data/flickr25k/``.
    n_threads : int
        The number of thread to read image.
    printable : boolean
        Whether to print infomation when reading images, default is ``False``.

    Examples
    -----------
    Get images with tag of sky

    >>> images = tl.files.load_flickr25k_dataset(tag='sky')

    Get all images

    >>> images = tl.files.load_flickr25k_dataset(tag=None, n_threads=100, printable=True)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
99
)
:
try
:
return
Funcs_by_level
[
arg_0
]
[
arg_1
]
except
KeyError
:
pass
if
arg_1
.
count
(
'"'
)
==
2
and
' "'
in
arg_1
and
arg_1
.
endswith
(
'".'
)
:
arg_3
=
arg_1
[
:
arg_1
.
index
(
' "'
)
]
return
Funcs_by_level
[
arg_0
]
.
get
(
arg_3
,
arg_2
)
return
arg_2

def Func(arg_0, arg_1, arg_2=99):
    """Return an error code between 0 and 99."""
    try:
        return Funcs_by_level[arg_0][arg_1]
    except KeyError:
        pass
    # Following assumes any variable messages take the format
    # of 'Fixed text "variable text".' only:
    # e.g. 'Unknown directive type "req".'
    # ---> 'Unknown directive type'
    # e.g. 'Unknown interpreted text role "need".'
    # ---> 'Unknown interpreted text role'
    if arg_1.count('"') == 2 and ' "' in arg_1 and arg_1.endswith('".'):
        arg_3 = arg_1[: arg_1.index(' "')]
        return Funcs_by_level[arg_0].get(arg_3, arg_2)
    return arg_2


def
Func
(
arg_0
,
*
arg_1
)
:
if
not
(
sys
.
stdout
.
isatty
(
)
and
sys
.
stderr
.
isatty
(
)
)
:
return
arg_2
=
(
arg_0
%
arg_1
)
if
Func
.
prev_message
:
sys
.
stderr
.
write
(
' '
*
len
(
Func
.
prev_message
)
+
'\r'
)
sys
.
stderr
.
write
(
arg_2
+
'\r'
)
Func
.
prev_message
=
arg_2

def Func(arg_0, *arg_1):
  '''Show current progress message to stderr.
     This function will remember the previous message so that next time,
     it will clear the previous message before showing next one.
  '''
  # Don't show any progress if the output is directed to a file.
  if not (sys.stdout.isatty() and sys.stderr.isatty()):
    return

  arg_2 = (arg_0 % arg_1)
  if Func.prev_message:
    sys.stderr.write(' ' * len(Func.prev_message) + '\r')
  sys.stderr.write(arg_2 + '\r')
  Func.prev_message = arg_2

Show current progress message to stderr . This function will remember the previous message so that next time it will clear the previous message before showing next one .


(annotations: Mapping, partial_match: bool = True)

def Func(arg_0: arg_1, arg_2: arg_3 = True) -> EdgePredicate: # noqa: D202
    """Build a filter that keeps edges whose data dictionaries are super-dictionaries to the given dictionary.

    :param annotations: The annotation query dict to match
    :param partial_match: Should the query values be used as partial or exact matches? Defaults to :code:`True`.
    """

    @edge_predicate
    def annotation_dict_filter(arg_4: arg_5) -> arg_3:
        """A filter that matches edges with the given dictionary as a sub-dictionary."""
        return subdict_matches(arg_4, arg_0, arg_2=arg_2)

    return annotation_dict_filter

Build a filter that keeps edges whose data dictionaries are super - dictionaries to the given dictionary .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Set the red, green, blue color of the bulb."""
        # See more details on the bulb's protocol from this guide:
        #   https://learn.adafruit.com/reverse-engineering-a-bluetooth-low-energy-light-bulb/overview
        arg_4 = '\x58\x01\x03\x01\xFF\x00{0}{1}{2}'.format(chr(arg_1 & 0xFF),
                                                             chr(arg_2 & 0xFF),
                                                             chr(arg_3 & 0xFF))
        arg_0._color.write_value(arg_4)

Set the red green blue color of the bulb .


(self, key, data_to_store, group, fullname, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, **arg_5):
        """Stores a python dictionary as pytable

        :param key:

            Name of data item to store

        :param data_to_store:

            Dictionary to store

        :param group:

            Group node where to store data in hdf5 file

        :param fullname:

            Full name of the `data_to_store`s original container, only needed for throwing errors.

        """
        if arg_1 in arg_3:
            raise ValueError(
                'Dictionary `%s` already exists in `%s`. Appending is not supported (yet).')

        if arg_1 in arg_3:
            raise ValueError('Dict `%s` already exists in `%s`. Appending is not supported (yet).')

        arg_6 = {}
        for arg_7 in arg_2:
            arg_8 = arg_2[arg_7]
            arg_6[arg_7] = [arg_8]

        # Convert dictionary to object table
        arg_9 = ObjectTable(data=arg_6)

        # Then store the object table
        arg_0._prm_write_into_pytable(arg_1, arg_9, arg_3, arg_4, **arg_5)

        arg_10 = arg_3._f_get_child(arg_1)

        # Remember that the Object Table represents a dictionary
        arg_0._all_set_attributes_to_recall_natives(arg_6, arg_10,
                                                   HDF5StorageService.DATA_PREFIX)

        setattr(arg_10._v_attrs, HDF5StorageService.STORAGE_TYPE,
                HDF5StorageService.DICT)

        arg_0._hdf5file.flush()


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_1 . parser_tree = parsing . Range ( arg_0 . value ( arg_2 ) . strip ( "'" ) , arg_0 . value ( arg_3 ) . strip ( "'" ) ) return True

def Func(arg_0, arg_1, arg_2, arg_3):
    """Add a read_range primitive"""
    arg_1.parser_tree = parsing.Range(arg_0.value(arg_2).strip("'"),
                                         arg_0.value(arg_3).strip("'"))
    return True


def Func(arg_0):
    """
    Decrypts file from entered links
    """
    if ENCRYPTION_DISABLED:
        print('For decryption please install gpg')
        exit()
    try:
        arg_1 = re.findall(r'(.*/(.*))#(.{30})', arg_0)[0]
        arg_2 = urllib.request.Request(
            arg_1[0],
            data=None,
            headers={
                'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_3) ' \
                ' AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.47 Safari/537.36'
                }
        )
        #downloads the file using fake useragent
        arg_3 = urllib.request.urlopen(arg_2)
        arg_4 = arg_3.read()
        #decrypts the data using piping to ggp
        arg_5, arg_6 = os.pipe()
        arg_7 = 'gpg --batch --decrypt --passphrase-fd {}'.format(arg_5)
        arg_8 = Popen(shlex.split(arg_7), stdout=PIPE, stdin=PIPE, arg_10=PIPE, \
                         pass_fds=(arg_5,))
        os.close(arg_5)
        open(arg_6, 'w').write(arg_1[2])
        arg_9, arg_10 = arg_8.communicate(arg_4)
        with open(arg_1[1], 'wb') as decrypted_file:
            decrypted_file.write(arg_9)
        return arg_1[1] + ' is decrypted and saved.'
    except IndexError:
        return 'Please enter valid link.'


def Func ( arg_0 , arg_1 ) : if arg_1 . client_id is not None : return arg_1 . client_id , arg_1 . client_secret arg_2 = arg_1 . headers . get ( 'Authorization' ) if isinstance ( arg_2 , dict ) : return arg_2 [ 'username' ] , arg_2 [ 'password' ] return None , None

def Func(arg_0, arg_1):
        """Return client credentials based on the current request.

        According to the rfc6749, client MAY use the HTTP Basic authentication
        scheme as defined in [RFC2617] to authenticate with the authorization
        server. The client identifier is encoded using the
        "application/x-www-form-urlencoded" encoding algorithm per Appendix B,
        and the encoded value is used as the username; the client password is
        encoded using the same algorithm and used as the password. The
        authorization server MUST support the HTTP Basic authentication scheme
        for authenticating clients that were issued a client password.
        See `Section 2.3.1`_.

        .. _`Section 2.3.1`: https://tools.ietf.org/html/rfc6749#section-2.3.1
        """
        if arg_1.client_id is not None:
            return arg_1.client_id, arg_1.client_secret

        arg_2 = arg_1.headers.get('Authorization')
        # If Werkzeug successfully parsed the Authorization header,
        # `extract_params` helper will replace the header with a parsed dict,
        # otherwise, there is nothing useful in the header and we just skip it.
        if isinstance(arg_2, dict):
            return arg_2['username'], arg_2['password']

        return None, None

Return client credentials based on the current request .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
""
)
:
if
arg_0
.
status
==
"disconnected"
or
arg_0
.
status
==
"disconnecting"
or
arg_0
.
status
==
"connecting"
:
arg_0
.
connect
(
)
if
arg_0
.
status
is
not
"connected"
:
return
False
logging
.
debug
(
"Subscribing to %s"
,
arg_1
)
arg_0
.
send
(
{
"cmd"
:
"Func"
,
"arg"
:
arg_1
,
"transform"
:
arg_3
}
)
with
arg_0
.
subscription_lock
:
arg_0
.
subscriptions
[
arg_1
+
":"
+
arg_3
]
=
arg_2
return
True

def Func(arg_0, arg_1, arg_2, arg_3=""):
        """Given a stream, a callback and an optional transform, sets up the subscription"""
        if arg_0.status == "disconnected" or arg_0.status == "disconnecting" or arg_0.status == "connecting":
            arg_0.connect()
        if arg_0.status is not "connected":
            return False
        logging.debug("Subscribing to %s", arg_1)

        arg_0.send({"cmd": "Func", "arg": arg_1, "transform": arg_3})
        with arg_0.subscription_lock:
            arg_0.subscriptions[arg_1 + ":" + arg_3] = arg_2
        return True

Given a stream a callback and an optional transform sets up the subscription


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = controllers . Func ( store , arg_0 , arg_1 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Display a specific structural variant."""
    arg_3 = controllers.Func(store, arg_0, arg_1, arg_2)
    return arg_3


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = cnxepub . Binder ( arg_0 , arg_2 = arg_2 ) for arg_4 in arg_1 [ 'contents' ] : arg_5 = _node_to_model ( arg_4 , parent = arg_3 ) if arg_5 . metadata [ 'title' ] != arg_4 [ 'title' ] : arg_3 . set_title_for_node ( arg_5 , arg_4 [ 'title' ] ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Reassemble a Binder object coming out of the database."""
    arg_3 = cnxepub.Binder(arg_0, arg_2=arg_2)
    for arg_4 in arg_1['contents']:
        arg_5 = _node_to_model(arg_4, parent=arg_3)
        if arg_5.metadata['title'] != arg_4['title']:
            arg_3.set_title_for_node(arg_5, arg_4['title'])
    return arg_3

Reassemble a Binder object coming out of the database .


def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the CreateKeyPair response 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 private key unique identifier or
                the public key unique identifier is missing from the encoded
                payload.
        """
        super(CreateKeyPairResponsePayload, 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.PRIVATE_KEY_UNIQUE_IDENTIFIER,
                arg_6
        ):
            arg_0._private_key_unique_identifier = primitives.TextString(
                tag=arg_3.Tags.PRIVATE_KEY_UNIQUE_IDENTIFIER
            )
            arg_0._private_key_unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The CreateKeyPair response payload encoding is missing the "
                "private key unique identifier."
            )

        if arg_0.is_tag_next(
                arg_3.Tags.PUBLIC_KEY_UNIQUE_IDENTIFIER,
                arg_6
        ):
            arg_0._public_key_unique_identifier = primitives.TextString(
                tag=arg_3.Tags.PUBLIC_KEY_UNIQUE_IDENTIFIER
            )
            arg_0._public_key_unique_identifier.Func(
                arg_6,
                arg_2=arg_2
            )
        else:
            raise exceptions.InvalidKmipEncoding(
                "The CreateKeyPair response payload encoding is missing the "
                "public key unique identifier."
            )

        if arg_2 < arg_3.KMIPVersion.KMIP_2_0:
            if arg_0.is_tag_next(
                    arg_3.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE,
                    arg_6
            ):
                arg_0._private_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=arg_3.Tags.PRIVATE_KEY_TEMPLATE_ATTRIBUTE
                    )
                arg_0._private_key_template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )

            if arg_0.is_tag_next(
                    arg_3.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE,
                    arg_6
            ):
                arg_0._public_key_template_attribute = \
                    objects.TemplateAttribute(
                        tag=arg_3.Tags.PUBLIC_KEY_TEMPLATE_ATTRIBUTE
                    )
                arg_0._public_key_template_attribute.Func(
                    arg_6,
                    arg_2=arg_2
                )

        arg_0.is_oversized(arg_6)

Read the data encoding the CreateKeyPair response 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 private key unique identifier or
                the public key unique identifier is missing from the encoded
                payload.

Read the data encoding the CreateKeyPair response payload and decode it into its constituent parts .


def
Func
(
arg_0
)
:
arg_1
=
io
.
AxonIO
(
filename
=
arg_0
)
arg_2
=
arg_1
.
read_block
(
lazy
=
False
,
cascade
=
True
)
print
(
arg_0
+
"\nplotting %d sweeps..."
%
len
(
arg_2
.
segments
)
)
plt
.
figure
(
figsize
=
(
12
,
10
)
)
plt
.
title
(
arg_0
)
for
arg_3
in
range
(
len
(
arg_2
.
segments
)
)
:
arg_4
=
arg_2
.
segments
[
arg_3
]
.
analogsignals
[
0
]
plt
.
plot
(
arg_4
.
times
arg_4
.
times
[
0
]
,
arg_4
.
magnitude
,
alpha
=
.5
)
plt
.
ylabel
(
arg_4
.
dimensionality
)
plt
.
xlabel
(
"seconds"
)
plt
.
show
(
)
plt
.
close
(
)

def Func(arg_0):
    """simple example how to load an ABF file and plot every sweep."""
    arg_1 = io.AxonIO(filename=arg_0)
    arg_2 = arg_1.read_block(lazy=False, cascade=True)
    print(arg_0+"\nplotting %d sweeps..."%len(arg_2.segments))
    plt.figure(figsize=(12,10))
    plt.title(arg_0)
    for arg_3 in range(len(arg_2.segments)):
        arg_4 = arg_2.segments[arg_3].analogsignals[0]
        plt.plot(arg_4.times-arg_4.times[0],arg_4.magnitude,alpha=.5)
    plt.ylabel(arg_4.dimensionality)
    plt.xlabel("seconds")
    plt.show()
    plt.close()

simple example how to load an ABF file and plot every sweep .


return err_df.pvalue.iloc[ix].values, err_df.svalue.iloc[ix].values, err_df.pep.iloc[ix].values, err_df.qvalue.iloc[ix].values

def Func ( arg_0 , arg_1 ) : arg_2 = find_nearest_matches ( np . float32 ( arg_1 . cutoff . values ) , np . float32 ( arg_0 ) ) return arg_1 . pvalue . iloc [ arg_2 ] . values , arg_1 . svalue . iloc [ arg_2 ] . values , arg_1 . pep . iloc [ arg_2 ] . values , arg_1 . qvalue . iloc [ arg_2 ] . values

def Func(arg_0, arg_1):
    """ Find matching q-value for each score in 'scores' """
    arg_2 = find_nearest_matches(np.float32(arg_1.cutoff.values), np.float32(arg_0))
    return arg_1.pvalue.iloc[arg_2].values, arg_1.svalue.iloc[arg_2].values, arg_1.pep.iloc[arg_2].values, arg_1.qvalue.iloc[arg_2].values

Find matching q - value for each score in scores


(file, outdir=None, split_pattern=None, global_header_rows=0, fname_pattern=None, trim_tail_lines=0, trim_head_lines=0)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
0
,
arg_4
=
,
arg_5
=
0
,
arg_6
=
0
)
:
if
arg_1
is
:
arg_1
=
os
.
path
.
join
(
os
.
path
.
dirname
(
arg_0
)
,
'split'
)
if
not
os
.
path
.
exists
(
arg_1
)
:
os
.
mkdir
(
arg_1
)
with
open
(
arg_0
,
'r'
)
as
f
:
arg_7
=
f
.
readlines
(
)
arg_8
=
os
.
path
.
splitext
(
arg_0
)
[
1
]
arg_9
=
arg_7
[
:
arg_3
]
arg_10
=
[
]
for
arg_11
,
arg_12
in
enumerate
(
arg_7
)
:
if
re
.
search
(
arg_2
,
arg_12
)
:
arg_10
.
append
(
arg_11
)
arg_10
.
append
(
len
(
arg_7
)
)
arg_13
=
{
}
for
arg_11
in
range
(
len
(
arg_10
)
1
)
:
arg_14
=
re
.
search
(
arg_4
,
arg_7
[
arg_10
[
arg_11
]
]
)
if
arg_14
:
arg_15
=
arg_14
.
groups
(
)
[
0
]
.
strip
(
)
else
:
arg_15
=
'no_name_{:}'
.
format
(
arg_11
)
arg_13
[
arg_15
]
=
arg_9
+
arg_7
[
arg_10
[
arg_11
]
:
arg_10
[
arg_11
+
1
]
]
[
arg_6
:
arg_5
]
print
(
'Writing files to: {:}'
.
format
(
arg_1
)
)
for
arg_16
,
arg_17
in
arg_13
.
items
(
)
:
arg_15
=
(
arg_16
+
arg_8
)
.
replace
(
' '
,
'_'
)
with
open
(
os
.
path
.
join
(
arg_1
,
arg_15
)
,
'w'
)
as
f
:
f
.
writelines
(
arg_17
)
print
(
'  {:}'
.
format
(
arg_15
)
)
print
(
'Done.'
)
return
arg_1

def Func(arg_0, arg_1=None, arg_2=None, arg_3=0, arg_4=None, arg_5=0, arg_6=0):
    """
    Split one long analysis file into multiple smaller ones.

    Parameters
    ----------
    file : str
        The path to the file you want to split.
    outdir : str
        The directory to save the split files to.
        If None, files are saved to a new directory
        called 'split', which is created inside the
        data directory.
    split_pattern : regex string
        A regular expression that will match lines in the
        file that mark the start of a new section. Does
        not have to match the whole line, but must provide
        a positive match to the lines containing the pattern.
    global_header_rows : int
        How many rows at the start of the file to include
        in each new sub-file.
    fname_pattern : regex string
        A regular expression that identifies a new file name
        in the lines identified by split_pattern. If none,
        files will be called 'noname_N'. The extension of the
        main file will be used for all sub-files.
    trim_head_lines : int
        If greater than zero, this many lines are removed from the start of each segment
    trim_tail_lines : int
        If greater than zero, this many lines are removed from the end of each segment

    Returns
    -------
    Path to new directory : str
    """
    # create output sirectory
    if arg_1 is None:
        arg_1 = os.path.join(os.path.dirname(arg_0), 'split')
    if not os.path.exists(arg_1):
        os.mkdir(arg_1)

    # read input file
    with open(arg_0, 'r') as f:
        arg_7 = f.readlines()

    # get file extension
    arg_8 = os.path.splitext(arg_0)[-1]

    # grab global header rows
    arg_9 = arg_7[:arg_3]

    # find indices of lines containing split_pattern
    arg_10 = []
    for arg_11, arg_12 in enumerate(arg_7):
        if re.search(arg_2, arg_12):
            arg_10.append(arg_11)
    arg_10.append(len(arg_7))  # get length of lines

    # split lines into segments based on positions of regex
    arg_13 = {}
    for arg_11 in range(len(arg_10) - 1):
        arg_14 = re.search(arg_4, arg_7[arg_10[arg_11]])
        if arg_14:
            arg_15 = arg_14.groups()[0].strip()
        else:
            arg_15 = 'no_name_{:}'.format(arg_11)

        arg_13[arg_15] = arg_9 + arg_7[arg_10[arg_11]:arg_10[arg_11+1]][arg_6:arg_5]

    # write files
    print('Writing files to: {:}'.format(arg_1))
    for arg_16, arg_17 in arg_13.items():
        arg_15 = (arg_16 + arg_8).replace(' ', '_')
        with open(os.path.join(arg_1, arg_15), 'w') as f:
            f.writelines(arg_17)
        print('  {:}'.format(arg_15))

    print('Done.')

    return arg_1

Split one long analysis file into multiple smaller ones .


(self, join_streamlet, window_config, join_function)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : from heronpy . streamlet . impl . joinbolt import JoinStreamlet , JoinBolt arg_4 = JoinStreamlet ( JoinBolt . OUTER_RIGHT , arg_2 , arg_3 , arg_0 , arg_1 ) arg_0 . _add_child ( arg_4 ) arg_1 . _add_child ( arg_4 ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
    """Return a new Streamlet by outer right join_streamlet with this streamlet
    """
    from heronpy.streamlet.impl.joinbolt import JoinStreamlet, JoinBolt
    arg_4 = JoinStreamlet(JoinBolt.OUTER_RIGHT, arg_2,
                                          arg_3, arg_0, arg_1)
    arg_0._add_child(arg_4)
    arg_1._add_child(arg_4)
    return arg_4


return (
            self.get_conn()
            .transferJobs()
            .patch(
                jobName=job_name,
                body={
                    PROJECT_ID: project_id,
                    TRANSFER_JOB: {STATUS1: GcpTransferJobsStatus.DELETED},
                    TRANSFER_JOB_FIELD_MASK: STATUS1,
                },
            )
            .execute(num_retries=self.num_retries)
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return ( arg_0 . get_conn ( ) . transferJobs ( ) . patch ( jobName = arg_1 , body = { PROJECT_ID : arg_2 , TRANSFER_JOB : { STATUS1 : GcpTransferJobsStatus . DELETED } , TRANSFER_JOB_FIELD_MASK : STATUS1 , } , ) . execute ( num_retries = arg_0 . num_retries ) )

def Func(arg_0, arg_1, arg_2):
        """
        Deletes a transfer job. This is a soft delete. After a transfer job is
        deleted, the job and all the transfer executions are subject to garbage
        collection. Transfer jobs become eligible for garbage collection
        30 days after soft delete.

        :param job_name: (Required) Name of the job to be deleted
        :type job_name: str
        :param project_id: (Optional) the ID of the project that owns the Transfer
            Job. If set to None or missing, the default project_id from the GCP
            connection is used.
        :type project_id: str
        :rtype: None
        """

        return (
            arg_0.get_conn()
            .transferJobs()
            .patch(
                jobName=arg_1,
                body={
                    PROJECT_ID: arg_2,
                    TRANSFER_JOB: {STATUS1: GcpTransferJobsStatus.DELETED},
                    TRANSFER_JOB_FIELD_MASK: STATUS1,
                },
            )
            .execute(num_retries=arg_0.num_retries)
        )

Deletes a transfer job . This is a soft delete . After a transfer job is deleted the job and all the transfer executions are subject to garbage collection . Transfer jobs become eligible for garbage collection 30 days after soft delete .


def Func(arg_0):
        """write connection info to JSON dict in self.connection_file"""
        if arg_0._connection_file_written:
            return
        arg_0.connection_file,arg_2 = Func(arg_0.connection_file,
            ip=arg_0.ip, key=arg_0.session.key,
            arg_4=arg_0.stdin_port, arg_5=arg_0.iopub_port,
            arg_3=arg_0.shell_port, arg_6=arg_0.hb_port)
        # Func also sets default ports:
        arg_0.shell_port = arg_2['shell_port']
        arg_0.stdin_port = arg_2['stdin_port']
        arg_0.iopub_port = arg_2['iopub_port']
        arg_0.hb_port = arg_2['hb_port']

        arg_0._connection_file_written = True

write connection info to JSON dict in self . connection_file


def Func ( arg_0 , arg_1 ) : if is_type ( arg_0 . _logging_dest , str ) : with open ( arg_0 . _logging_dest , "at" , encoding = "utf-8" ) as f : f . write ( arg_1 ) else : arg_0 . _logging_dest . write ( arg_1 )

def Func(arg_0, arg_1):
        """
        Log the message `msg` to the destination `self._logging_dest`.

        If this destination is a file name, then we append the message to the file and then close the file
        immediately. If the destination is an open file handle, then we simply write the message there and do not
        attempt to close it.
        """
        if is_type(arg_0._logging_dest, str):
            with open(arg_0._logging_dest, "at", encoding="utf-8") as f:
                f.write(arg_1)
        else:
            arg_0._logging_dest.write(arg_1)

Log the message msg to the destination self . _logging_dest .


def Func ( arg_0 , arg_1 ) : arg_2 = json . dumps ( { 'messageType' : 'propertyStatus' , 'data' : { arg_1 . name : arg_1 . get_value ( ) , } } ) for arg_3 in list ( arg_0 . subscribers ) : try : arg_3 . write_message ( arg_2 ) except tornado . websocket . WebSocketClosedError : pass

def Func(arg_0, arg_1):
        """
        Notify all subscribers of a property change.

        property_ -- the property that changed
        """
        arg_2 = json.dumps({
            'messageType': 'propertyStatus',
            'data': {
                arg_1.name: arg_1.get_value(),
            }
        })

        for arg_3 in list(arg_0.subscribers):
            try:
                arg_3.write_message(arg_2)
            except tornado.websocket.WebSocketClosedError:
                pass

Notify all subscribers of a property change .


def Func ( arg_0 ) : if arg_0 . is_initial : return True if arg_0 . before : if arg_0 . before_cursor : return True else : return False else : if arg_0 . after_cursor : return True else : return False

def Func(arg_0):
    """Checks if a next message is possible.

    :returns: True if a next message is possible, otherwise False
    :rtype: bool

    """
    if arg_0.is_initial:
      return True
    if arg_0.before:
      if arg_0.before_cursor:
        return True
      else:
        return False
    else:
      if arg_0.after_cursor:
        return True
      else:
        return False


def Func ( arg_0 , arg_1 ) : arg_0 . _resultsPerChoice = [ [ ] ] * len ( arg_0 . choices ) for ( arg_3 , arg_4 ) in arg_1 : arg_5 = arg_0 . choices . index ( arg_3 ) arg_0 . _resultsPerChoice [ arg_5 ] = list ( arg_4 )

def Func(arg_0, arg_1):
    """Setup our resultsPerChoice history based on the passed in
    resultsPerChoice.

    For example, if this variable has the following choices:
      ['a', 'b', 'c']

    resultsPerChoice will have up to 3 elements, each element is a tuple
    containing (choiceValue, errors) where errors is the list of errors
    received from models that used the specific choice:
    retval:
      [('a', [0.1, 0.2, 0.3]), ('b', [0.5, 0.1, 0.6]), ('c', [0.2])]
    """
    # Keep track of the results obtained for each choice.
    arg_0._resultsPerChoice = [[]] * len(arg_0.choices)
    for (arg_3, arg_4) in arg_1:
      arg_5 = arg_0.choices.index(arg_3)
      arg_0._resultsPerChoice[arg_5] = list(arg_4)

Setup our resultsPerChoice history based on the passed in resultsPerChoice .


def Func ( arg_0 , arg_1 ) : if tf . executing_eagerly ( ) : with tf . GradientTape ( ) as tape : tape . watch ( arg_1 ) arg_2 = arg_0 ( arg_1 ) arg_3 = tape . batch_jacobian ( arg_2 , arg_1 ) else : arg_2 = arg_0 ( arg_1 ) arg_3 = gradients . batch_jacobian ( arg_2 , arg_1 ) return arg_2 , arg_3

def Func(arg_0, arg_1):
  """Enables uniform interface to value and batch jacobian calculation.

  Works in both eager and graph modes.

  Arguments:
    f: The scalar function to evaluate.
    x: The value at which to compute the value and the batch jacobian.

  Returns:
    A tuple (f(x), J(x)), where J(x) is the batch jacobian.
  """
  if tf.executing_eagerly():
    with tf.GradientTape() as tape:
      tape.watch(arg_1)
      arg_2 = arg_0(arg_1)
    arg_3 = tape.batch_jacobian(arg_2, arg_1)
  else:
    arg_2 = arg_0(arg_1)
    arg_3 = gradients.batch_jacobian(arg_2, arg_1)
  return arg_2, arg_3

Enables uniform interface to value and batch jacobian calculation .


return {key.upper(): val for key, val in parse_database_url(url)._asdict().items()}

def Func ( arg_0 ) : return { arg_1 . upper ( ) : arg_2 for arg_1 , arg_2 in parse_database_url ( arg_0 ) . _asdict ( ) . items ( ) }

def Func(arg_0):
    """
    Return a django-style database configuration based on ``url``.

    :param url: Database URL
    :return: Django-style database configuration dict

    Example:
    >>> conf = Func(
    ...     'pgsql://joar:hunter2@5monkeys.se:4242/tweets/tweetschema'
    ...     '?hello=world')
    >>> sorted(conf.items())  # doctest: +NORMALIZE_WHITESPACE
    [('ENGINE', 'django.db.backends.postgresql_psycopg2'),
     ('HOST', '5monkeys.se'),
     ('NAME', 'tweets'),
     ('PARAMS', {'hello': 'world'}),
     ('PASSWORD', 'hunter2'),
     ('PORT', 4242),
     ('SCHEMA', 'tweetschema'),
     ('USER', 'joar')]
    """
    return {arg_1.upper(): arg_2 for arg_1, arg_2 in parse_database_url(arg_0)._asdict().items()}

Return a django-style database configuration based on ``url``.

    :param url: Database URL
    :return: Django-style database configuration dict

    Example:
    >>> conf = database_conf_from_url(
    ...     'pgsql://joar:hunter2@5monkeys.se:4242/tweets/tweetschema'
    ...     '?hello=world')
    >>> sorted(conf.items())  # doctest: +NORMALIZE_WHITESPACE
    [('ENGINE', 'django.db.backends.postgresql_psycopg2'),
     ('HOST', '5monkeys.se'),
     ('NAME', 'tweets'),
     ('PARAMS', {'hello': 'world'}),
     ('PASSWORD', 'hunter2'),
     ('PORT', 4242),
     ('SCHEMA', 'tweetschema'),
     ('USER', 'joar')]

Return a django - style database configuration based on url .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
serial_asyncio
.
open_serial_connection
(
**
arg_0
.
serial_settings
)
arg_3
,
arg_4
=
yield
from
arg_2
while
True
:
arg_5
=
yield
from
arg_3
.
Funcline
(
)
arg_0
.
telegram_buffer
.
append
(
arg_5
.
decode
(
'ascii'
)
)
for
arg_6
in
arg_0
.
telegram_buffer
.
get_all
(
)
:
try
:
arg_1
.
put_nowait
(
arg_0
.
telegram_parser
.
parse
(
arg_6
)
)
except
ParseError
as
e
:
logger
.
warning
(
'Failed to parse telegram: %s'
,
e
)

def Func(arg_0, arg_1):
        """
        Read complete DSMR telegram's from the serial interface and parse it
        into CosemObject's and MbusObject's.

        Instead of being a generator, values are pushed to provided queue for
        asynchronous processing.

        :rtype: None
        """
        # create Serial StreamReader
        arg_2 = serial_asyncio.open_serial_connection(**arg_0.serial_settings)
        arg_3, arg_4 = yield from arg_2

        while True:
            # Read line if available or give control back to loop until new
            # data has arrived.
            arg_5 = yield from arg_3.Funcline()
            arg_0.telegram_buffer.append(arg_5.decode('ascii'))

            for arg_6 in arg_0.telegram_buffer.get_all():
                try:
                    # Push new parsed telegram onto queue.
                    arg_1.put_nowait(
                        arg_0.telegram_parser.parse(arg_6)
                    )
                except ParseError as e:
                    logger.warning('Failed to parse telegram: %s', e)

Read complete DSMR telegram s from the serial interface and parse it into CosemObject s and MbusObject s .


return {name: vals_dict[name] for name in names if name in vals_dict}

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_1 [ 'request' ] [ 'ephemeralPipeline' ] [ 'inputParameters' ] arg_4 = arg_1 [ 'request' ] [ 'pipelineArgs' ] [ 'inputs' ] arg_5 = [ arg [ 'name' ] for arg in arg_3 if ( 'localCopy' in arg ) == arg_2 ] return { arg_6 : arg_4 [ arg_6 ] for arg_6 in arg_5 if arg_6 in arg_4 }

def Func(arg_0, arg_1, arg_2):
    """Returns a dictionary of envs or file inputs for an operation.

    Args:
      metadata: operation metadata field
      file_input: True to return a dict of file inputs, False to return envs.

    Returns:
      A dictionary of input field name value pairs
    """

    # To determine input parameter type, we iterate through the
    # pipeline inputParameters.
    # The values come from the pipelineArgs inputs.
    arg_3 = arg_1['request']['ephemeralPipeline']['inputParameters']
    arg_4 = arg_1['request']['pipelineArgs']['inputs']

    # Get the names for files or envs
    arg_5 = [
        arg['name'] for arg in arg_3 if ('localCopy' in arg) == arg_2
    ]

    # Build the return dict
    return {arg_6: arg_4[arg_6] for arg_6 in arg_5 if arg_6 in arg_4}

Returns a dictionary of envs or file inputs for an operation .


def Func ( arg_0 , arg_1 ) : if arg_0 . word_dropout > 0.0 : arg_2 = kl . Dropout ( arg_0 . word_dropout ) ( arg_1 ) else : arg_2 = arg_1 for arg_3 in range ( arg_0 . word_lstm_layers - 1 ) : arg_2 = kl . Bidirectional ( kl . LSTM ( arg_0 . word_lstm_units [ arg_3 ] , return_sequences = True , dropout = arg_0 . lstm_dropout ) ) ( arg_2 ) arg_2 = kl . Bidirectional ( kl . LSTM ( arg_0 . word_lstm_units [ - 1 ] , return_sequences = True , dropout = arg_0 . lstm_dropout ) ) ( arg_2 ) arg_4 = kl . TimeDistributed ( kl . Dense ( arg_0 . tags_number_ , activation = "softmax" , activity_regularizer = arg_0 . regularizer ) , name = "p" ) ( arg_2 ) return arg_4 , arg_2

def Func(arg_0, arg_1):
        """
        Creates the basic network architecture,
        transforming word embeddings to intermediate outputs
        """
        if arg_0.word_dropout > 0.0:
            arg_2 = kl.Dropout(arg_0.word_dropout)(arg_1)
        else:
            arg_2 = arg_1
        for arg_3 in range(arg_0.word_lstm_layers-1):
            arg_2 = kl.Bidirectional(
                kl.LSTM(arg_0.word_lstm_units[arg_3], return_sequences=True,
                        dropout=arg_0.lstm_dropout))(arg_2)
        arg_2 = kl.Bidirectional(
                kl.LSTM(arg_0.word_lstm_units[-1], return_sequences=True,
                        dropout=arg_0.lstm_dropout))(arg_2)
        arg_4 = kl.TimeDistributed(
                kl.Dense(arg_0.tags_number_, activation="softmax",
                         activity_regularizer=arg_0.regularizer),
                name="p")(arg_2)
        return arg_4, arg_2

Creates the basic network architecture transforming word embeddings to intermediate outputs


def Func(arg_0):
    """
    These arguments are redundant with just using a project, and we should
    encouraging that as you don't have to learn any dumb flags!

    For example, instead of

       bp foo.yml --animation=wombat --numbers=float

    use

       bp foo.yml + '{animation: wombat, numbers: float}'

    """
    arg_0.add_argument(
        '-a', '--animation', default=None,
        help='Default animation type if no animation is specified')

    if deprecated.allowed():  # pragma: no cover
        arg_0.add_argument(
            '--dimensions', '--dim', default=None,
            help='DEPRECATED: x, (x, y) or (x, y, z) dimensions for project')

    arg_0.add_argument(
        '--shape', default=None,
        help='x, (x, y) or (x, y, z) dimensions for project')

    arg_0.add_argument(
        '-l', '--layout', default=None,
        help='Default layout class if no layout is specified')

    arg_0.add_argument(
        '--numbers', '-n', default='python', choices=NUMBER_TYPES,
        help=NUMBERS_HELP)

    arg_0.add_argument('-p', '--path', default=None, help=PATH_HELP)

These arguments are redundant with just using a project and we should encouraging that as you don t have to learn any dumb flags!


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
sys
.
platform
==
'win32'
:
arg_1
=
os
.
path
.
normpath
(
arg_1
)
.
replace
(
'\\'
,
'/'
)
if
' '
in
arg_1
or
"'"
in
arg_1
or
'"'
in
arg_1
:
arg_1
=
'"%s"'
%
arg_1
.
replace
(
'"'
,
'\\"'
)
arg_0
.
execute
(
'%%run %s'
%
arg_1
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1, arg_2=False):
        """ Reimplemented to use the 'run' magic.
        """
        # Use forward slashes on Windows to avoid escaping each separator.
        if sys.platform == 'win32':
            arg_1 = os.path.normpath(arg_1).replace('\\', '/')

        # Perhaps we should not be using %run directly, but while we
        # are, it is necessary to quote or escape filenames containing spaces
        # or quotes.

        # In earlier code here, to minimize escaping, we sometimes quoted the
        # filename with single quotes. But to do this, this code must be
        # platform-aware, because run uses shlex rather than python string
        # parsing, so that:
        # * In Win: single quotes can be used in the filename without quoting,
        #   and we cannot use single quotes to quote the filename.
        # * In *nix: we can escape double quotes in a double quoted filename,
        #   but can't escape single quotes in a single quoted filename.

        # So to keep this code non-platform-specific and simple, we now only
        # use double quotes to quote filenames, and escape when needed:
        if ' ' in arg_1 or "'" in arg_1 or '"' in arg_1:
            arg_1 = '"%s"' % arg_1.replace('"', '\\"')
        arg_0.execute('%%run %s' % arg_1, arg_2=arg_2)


def Func ( arg_0 , arg_1 = None ) : arg_2 , arg_3 = _get_properties ( arg_1 ) if not arg_0 . is_method ( ) : return "function" if arg_0 . decorators : arg_4 = arg_0 . decorators . nodes else : arg_4 = [ ] for arg_5 in arg_4 : if isinstance ( arg_5 , astroid . Name ) or ( isinstance ( arg_5 , astroid . Attribute ) and arg_5 . attrname in arg_3 ) : arg_6 = utils . safe_infer ( arg_5 ) if arg_6 and arg_6 . qname ( ) in arg_2 : return "attr" elif isinstance ( arg_5 , astroid . Attribute ) and arg_5 . attrname in ( "setter" , "deleter" , ) : return "attr" return "method"

def Func(arg_0, arg_1=None):
    """Determine the name type whose regex the a function's name should match.

    :param node: A function node.
    :type node: astroid.node_classes.NodeNG
    :param config: Configuration from which to pull additional property classes.
    :type config: :class:`optparse.Values`

    :returns: One of ('function', 'method', 'attr')
    :rtype: str
    """
    arg_2, arg_3 = _get_properties(arg_1)
    if not arg_0.is_method():
        return "function"
    if arg_0.decorators:
        arg_4 = arg_0.decorators.nodes
    else:
        arg_4 = []
    for arg_5 in arg_4:
        # If the function is a property (decorated with @property
        # or @abc.abstractproperty), the name type is 'attr'.
        if isinstance(arg_5, astroid.Name) or (
            isinstance(arg_5, astroid.Attribute)
            and arg_5.attrname in arg_3
        ):
            arg_6 = utils.safe_infer(arg_5)
            if arg_6 and arg_6.qname() in arg_2:
                return "attr"
        # If the function is decorated using the prop_method.{setter,getter}
        # form, treat it like an attribute as well.
        elif isinstance(arg_5, astroid.Attribute) and arg_5.attrname in (
            "setter",
            "deleter",
        ):
            return "attr"
    return "method"

Determine the name type whose regex the a function s name should match .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = int ( arg_2 * arg_0 . _numColumns ) arg_4 = numpy . argsort ( arg_1 , kind = 'mergesort' ) arg_5 = len ( arg_4 ) - arg_3 while arg_5 < len ( arg_4 ) : arg_6 = arg_4 [ arg_5 ] if arg_1 [ arg_6 ] >= arg_0 . _stimulusThreshold : break else : arg_5 += 1 return arg_4 [ arg_5 : ] [ : : - 1 ]

def Func(arg_0, arg_1, arg_2):
    """
    Perform global inhibition. Performing global inhibition entails picking the
    top 'numActive' columns with the highest overlap score in the entire
    region. At most half of the columns in a local neighborhood are allowed to
    be active. Columns with an overlap score below the 'stimulusThreshold' are
    always inhibited.

    :param overlaps: an array containing the overlap score for each  column.
                    The overlap score for a column is defined as the number
                    of synapses in a "connected state" (connected synapses)
                    that are connected to input bits which are turned on.
    :param density: The fraction of columns to survive inhibition.
    @return list with indices of the winning columns
    """
    #calculate num active per inhibition area
    arg_3 = int(arg_2 * arg_0._numColumns)

    # Calculate winners using stable sort algorithm (mergesort)
    # for compatibility with C++
    arg_4 = numpy.argsort(arg_1, kind='mergesort')

    # Enforce the stimulus threshold
    arg_5 = len(arg_4) - arg_3
    while arg_5 < len(arg_4):
      arg_6 = arg_4[arg_5]
      if arg_1[arg_6] >= arg_0._stimulusThreshold:
        break
      else:
        arg_5 += 1

    return arg_4[arg_5:][::-1]

Perform global inhibition . Performing global inhibition entails picking the top numActive columns with the highest overlap score in the entire region . At most half of the columns in a local neighborhood are allowed to be active . Columns with an overlap score below the stimulusThreshold are always inhibited .


def Func(arg_0):
        """
        Run all parsing functions.
        """
        for arg_1 in arg_0.soup.findAll('span'):
            arg_0.create_italic(arg_1)
            arg_0.create_strong(arg_1)
            arg_0.create_underline(arg_1)
            arg_0.unwrap_span(arg_1)

        for arg_1 in arg_0.soup.findAll('a'):
            arg_0.remove_comments(arg_1)
            arg_0.check_next(arg_1)

        if arg_0.soup.body:
            for arg_1 in arg_0.soup.body.findAll():
                arg_0.remove_empty(arg_1)
                arg_0.remove_inline_comment(arg_1)
                arg_0.Func_attrs(arg_1)
                for arg_2, arg_3 in arg_0.tokens:
                    arg_0.find_token(arg_1, arg_2, arg_3)

                arg_0.remove_blacklisted_tags(arg_1)


def Func(arg_0, arg_1: arg_2) -> arg_2:
        """ Remove values common with another Set """
        arg_3 = list(arg_0._hsig.keys())
        for arg_4 in arg_3:
            if arg_4 in arg_1:
                del arg_0._hsig[arg_4]
        return arg_0


def Func ( arg_0 ) : if len ( arg_0 . rows ) == 0 : return [ ] arg_1 = Statement ( arg_0 . rows [ 0 ] ) arg_1 . startline = arg_0 . rows [ 0 ] . linenumber arg_1 . endline = arg_0 . rows [ 0 ] . linenumber Func = [ ] for arg_5 in arg_0 . rows [ 1 : ] : if len ( arg_5 ) > 0 and arg_5 [ 0 ] == "..." : arg_1 += arg_5 [ 1 : ] arg_1 . endline = arg_5 . linenumber else : if len ( arg_1 ) > 0 : Func . append ( arg_1 ) arg_1 = Statement ( arg_5 ) arg_1 . startline = arg_5 . linenumber arg_1 . endline = arg_5 . linenumber if len ( arg_1 ) > 0 : Func . append ( arg_1 ) while ( len ( Func [ - 1 ] ) == 0 or ( ( len ( Func [ - 1 ] ) == 1 ) and len ( Func [ - 1 ] [ 0 ] ) == 0 ) ) : Func . pop ( ) return Func

def Func(arg_0):
        '''Return a list of statements

        This is done by joining together any rows that
        have continuations
        '''
        # FIXME: no need to do this every time; we should cache the
        # result
        if len(arg_0.rows) == 0:
            return []

        arg_1 = Statement(arg_0.rows[0])
        arg_1.startline = arg_0.rows[0].linenumber
        arg_1.endline = arg_0.rows[0].linenumber
        Func = []
        for arg_5 in arg_0.rows[1:]:
            if len(arg_5) > 0 and arg_5[0] == "...":
                # we found a continuation
                arg_1 += arg_5[1:]
                arg_1.endline = arg_5.linenumber
            else:
                if len(arg_1) > 0:
                    # append current statement to the list of statements...
                    Func.append(arg_1)
                # start a new statement
                arg_1 = Statement(arg_5)
                arg_1.startline = arg_5.linenumber
                arg_1.endline = arg_5.linenumber

        if len(arg_1) > 0:
            Func.append(arg_1)

        # trim trailing blank statements
        while (len(Func[-1]) == 0 or
               ((len(Func[-1]) == 1) and len(Func[-1][0]) == 0)):
            Func.pop()
        return Func


(self, stream, interpolator="closest", t1=None, t2=None, dt=None, limit=None, i1=None, i2=None, transform=None,colname=None)

def Func(arg_0, arg_1, arg_2="closest", arg_3=None, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=None, arg_9=None,arg_10=None):
        """Adds the given stream to the query construction. Additionally, you can choose the interpolator to use for this stream, as well as a special name
        for the column in the returned dataset. If no column name is given, the full stream path will be used.

        Func also supports Merge queries. You can insert a merge query instead of a stream, but be sure to name the column::

            d = Dataset(cdb, t1=time.time()-1000,t2=time.time(),dt=10.)
            d.Func("temperature","average")
            d.Func("steps","sum")

            m = Merge(cdb)
            m.Func("mystream")
            m.Func("mystream2")
            d.Func(m,colname="mycolumn")

            result = d.run()
        """

        arg_11 = query_maker(arg_3, arg_4, arg_6, arg_7, arg_8, arg_9)
        param_stream(arg_0.cdb, arg_11, arg_1)

        arg_11["interpolator"] = arg_2

        if arg_10 is None:
            # What do we call this column?
            if isinstance(arg_1, six.string_types):
                arg_10 = arg_1
            elif isinstance(arg_1, Stream):
                arg_10 = arg_1.path
            else:
                raise Exception(
                    "Could not find a name for the column! use the 'colname' parameter.")

        if arg_10 in arg_0.query["dataset"] or arg_10 is "x":
            raise Exception(
                "The column name either exists, or is labeled 'x'. Use the colname parameter to change the column name.")

        arg_0.query["dataset"][arg_10] = arg_11

Adds the given stream to the query construction. Additionally, you can choose the interpolator to use for this stream, as well as a special name
        for the column in the returned dataset. If no column name is given, the full stream path will be used.

        addStream also supports Merge queries. You can insert a merge query instead of a stream, but be sure to name the column::

            d = Dataset(cdb, t1=time.time()-1000,t2=time.time(),dt=10.)
            d.addStream("temperature","average")
            d.addStream("steps","sum")

            m = Merge(cdb)
            m.addStream("mystream")
            m.addStream("mystream2")
            d.addStream(m,colname="mycolumn")

            result = d.run()

Adds the given stream to the query construction . Additionally you can choose the interpolator to use for this stream as well as a special name for the column in the returned dataset . If no column name is given the full stream path will be used .


def Func ( arg_0 ) : arg_1 = re . compile ( '<text>((.|\n)+)</text>' , re . UNICODE ) arg_2 = arg_1 . match ( arg_0 ) if arg_2 : return arg_2 . group ( 1 ) else : return None

def Func(arg_0):
    """
    Return content of a free form text block as a string.
    """
    arg_1 = re.compile('<text>((.|\n)+)</text>', re.UNICODE)
    arg_2 = arg_1.match(arg_0)
    if arg_2:
        return arg_2.group(1)
    else:
        return None

Return content of a free form text block as a string .


def Func ( arg_0 , arg_1 = None ) : arg_2 = Funcs_dir ( ) arg_3 = os . path . join ( arg_2 , arg_0 ) try : with open ( arg_3 , "r" ) as secret_file : return secret_file . read ( ) except OSError : return arg_1

def Func(arg_0, arg_1=None):
    """
    Gets contents of secret file

    :param secret_name: The name of the secret present in BANANAS_SECRETS_DIR
    :param default: Default value to return if no secret was found
    :return: The secret or default if not found
    """
    arg_2 = Funcs_dir()
    arg_3 = os.path.join(arg_2, arg_0)
    try:
        with open(arg_3, "r") as secret_file:
            return secret_file.read()
    except OSError:
        return arg_1


def Func ( arg_0 ) : arg_1 = list ( arg_5 . path ) arg_2 = [ ] for arg_3 in arg_0 : arg_4 = _get_python_path ( arg_3 ) if arg_4 in arg_2 : continue else : arg_2 . append ( arg_4 ) arg_5 . path [ : ] = arg_2 + [ "." ] + arg_5 . path try : yield finally : arg_5 . path [ : ] = arg_1

def Func(arg_0):
    """Prepare sys.path for running the linter checks.

    Within this context, each of the given arguments is importable.
    Paths are added to sys.path in corresponding order to the arguments.
    We avoid adding duplicate directories to sys.path.
    `sys.path` is reset to its original value upon exiting this context.
    """
    arg_1 = list(arg_5.path)
    arg_2 = []
    for arg_3 in arg_0:
        arg_4 = _get_python_path(arg_3)
        if arg_4 in arg_2:
            continue
        else:
            arg_2.append(arg_4)
    arg_5.path[:] = arg_2 + ["."] + arg_5.path
    try:
        yield
    finally:
        arg_5.path[:] = arg_1

Prepare sys . path for running the linter checks .


def Func ( arg_0 ) : def wrapper ( arg_1 , * arg_2 , ** arg_3 ) : if not arg_1 . savedsearch : arg_1 . savedsearch = SavedSearch ( arg_1 ) return arg_0 ( arg_1 , * arg_2 , ** arg_3 ) return wrapper

def Func(arg_0):
    """ ensure that a SavedSearch object exists """

    def wrapper(arg_1, *arg_2, **arg_3):
        if not arg_1.savedsearch:
            arg_1.savedsearch = SavedSearch(arg_1)
        return arg_0(arg_1, *arg_2, **arg_3)

    return wrapper


Provides an overview of the duplicate credentials.

def
Func
(
)
:
arg_0
=
Credential
.
search
(
)
arg_0
.
aggs
.
bucket
(
'password_count'
,
'terms'
,
field
=
'secret'
,
order
=
{
'_count'
:
'desc'
}
,
size
=
20
)
.
metric
(
'username_count'
,
'cardinality'
,
field
=
'username'
)
.
metric
(
'host_count'
,
'cardinality'
,
field
=
'host_ip'
)
.
metric
(
'top_hits'
,
'top_hits'
,
docvalue_fields
=
[
'username'
]
,
size
=
100
)
arg_1
=
arg_0
.
execute
(
)
print_line
(
"{0:65} {1:5} {2:5} {3:5} {4}"
.
format
(
"Secret"
,
"Count"
,
"Hosts"
,
"Users"
,
"Usernames"
)
)
print_line
(
"-"
*
100
)
for
arg_2
in
arg_1
.
aggregations
.
password_count
.
buckets
:
arg_3
=
[
]
for
arg_4
in
arg_2
.
top_hits
:
arg_3
.
append
(
arg_4
.
username
[
0
]
)
arg_3
=
list
(
set
(
arg_3
)
)
print_line
(
"{0:65} {1:5} {2:5} {3:5} {4}"
.
format
(
arg_2
.
key
,
arg_2
.
doc_count
,
arg_2
.
host_count
.
value
,
arg_2
.
username_count
.
value
,
arg_3
)
)

def Func():
    """
        Provides an Func of the duplicate credentials.
    """
    arg_0 = Credential.search()
    arg_0.aggs.bucket('password_count', 'terms', field='secret', order={'_count': 'desc'}, size=20)\
        .metric('username_count', 'cardinality', field='username') \
        .metric('host_count', 'cardinality', field='host_ip') \
        .metric('top_hits', 'top_hits', docvalue_fields=['username'], size=100)
    arg_1 = arg_0.execute()
    print_line("{0:65} {1:5} {2:5} {3:5} {4}".format("Secret", "Count", "Hosts", "Users", "Usernames"))
    print_line("-"*100)
    for arg_2 in arg_1.aggregations.password_count.buckets:
        arg_3 = []
        for arg_4 in arg_2.top_hits:
            arg_3.append(arg_4.username[0])
        arg_3 = list(set(arg_3))
        print_line("{0:65} {1:5} {2:5} {3:5} {4}".format(arg_2.key, arg_2.doc_count, arg_2.host_count.value, arg_2.username_count.value, arg_3))

Provides an overview of the duplicate credentials .


def Func(arg_0):
    """
    Perform the stringprep mapping step of SASLprep. Operates in-place on a
    list of unicode characters provided in `chars`.
    """
    arg_1 = 0
    while arg_1 < len(arg_0):
        arg_2 = arg_0[arg_1]
        if stringprep.in_table_c12(arg_2):
            arg_0[arg_1] = "\u0020"
        elif stringprep.in_table_b1(arg_2):
            del arg_0[arg_1]
            continue
        arg_1 += 1

Perform the stringprep mapping step of SASLprep . Operates in - place on a list of unicode characters provided in chars .


def Func():
    """Re-enable the FTDI drivers for the current platform."""
    logger.debug('Enabling FTDI driver.')
    if sys.platform == 'darwin':
        logger.debug('Detected Mac OSX')
        # Mac OS commands to enable FTDI driver.
        _check_running_as_root()
        subprocess.check_call('kextload -b com.apple.driver.AppleUSBFTDI', shell=True)
        subprocess.check_call('kextload /System/Library/Extensions/FTDIUSBSerialDriver.kext', shell=True)
    elif sys.platform.startswith('linux'):
        logger.debug('Detected Linux')
        # Linux commands to enable FTDI driver.
        _check_running_as_root()
        subprocess.check_call('modprobe -q ftdi_sio', shell=True)
        subprocess.check_call('modprobe -q usbserial', shell=True)

Re - enable the FTDI drivers for the current platform .


def Func(arg_0, arg_1):
    """
    Add a message to the Django messages store indicating that we failed to retrieve price information about an item.

    :param request: The current request.
    :param item: The item for which price information is missing. Example: a program title, or a course.
    """
    messages.warning(
        arg_0,
        _(
            '{strong_start}We could not gather price information for {em_start}{item}{em_end}.{strong_end} '
            '{span_start}If you continue to have these issues, please contact '
            '{link_start}{platform_name} support{link_end}.{span_end}'
        ).format(
            arg_1=arg_1,
            em_start='',
            em_end='',
            link_start=''.format(
                support_link=get_configuration_value('ENTERPRISE_SUPPORT_URL', settings.ENTERPRISE_SUPPORT_URL),
            ),
            platform_name=get_configuration_value('PLATFORM_NAME', settings.PLATFORM_NAME),
            link_end='',
            span_start='',
            span_end='',
            strong_start='',
            strong_end='',
        )
    )

Add a message to the Django messages store indicating that we failed to retrieve price information about an item .


Returns the state of a TaskInstance at the command line.
    >>> airflow task_state tutorial sleep 2015-01-01
    success

def Func(arg_0):
    """
    Returns the state of a TaskInstance at the command line.
    >>> airflow Func tutorial sleep 2015-01-01
    success
    """
    arg_1 = get_dag(arg_0)
    arg_2 = arg_1.get_task(task_id=arg_0.task_id)
    arg_3 = TaskInstance(arg_2, arg_0.execution_date)
    print(arg_3.current_state())

Returns the state of a TaskInstance at the command line . >>> airflow task_state tutorial sleep 2015 - 01 - 01 success


def Func(arg_0, arg_1, arg_2, arg_3):
  """Check if line contains a redundant "override" or "final" virt-specifier.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  # Look for closing parenthesis nearby.  We need one to confirm where
  # the declarator ends and where the virt-specifier starts to avoid
  # false positives.
  arg_4 = arg_1.elided[arg_2]
  arg_5 = arg_4.rfind(')')
  if arg_5 >= 0:
    arg_6 = arg_4[arg_5:]
  else:
    if arg_2 > 1 and arg_1.elided[arg_2 - 1].rfind(')') >= 0:
      arg_6 = arg_4
    else:
      return

  # Check that at most one of "override" or "final" is present, not both
  if Search(r'\boverride\b', arg_6) and Search(r'\bfinal\b', arg_6):
    arg_3(arg_0, arg_2, 'readability/inheritance', 4,
          ('"override" is redundant since function is '
           'already declared as "final"'))

Check if line contains a redundant override or final virt - specifier .


def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( arg_0 , 'render_' + nativeString ( arg_1 . method ) , None ) if arg_2 is None : try : arg_3 = arg_0 . allowedMethods except AttributeError : arg_3 = _computeAllowedMethods ( arg_0 ) raise UnsupportedMethod ( arg_3 ) return arg_2 ( arg_1 )

def Func(arg_0, arg_1):
    """
    Render a given resource.

    See `IResource.render <twisted:twisted.web.resource.IResource.render>`.
    """
    arg_2 = getattr(arg_0, 'render_' + nativeString(arg_1.method), None)
    if arg_2 is None:
        try:
            arg_3 = arg_0.allowedMethods
        except AttributeError:
            arg_3 = _computeAllowedMethods(arg_0)
        raise UnsupportedMethod(arg_3)
    return arg_2(arg_1)


def Func ( arg_0 , arg_1 ) : arg_0 . lock . acquire ( ) try : arg_0 . __register = Register ( arg_1 . get_query ( ) ) arg_0 . registration_callback ( arg_1 , arg_0 . __register . get_form ( ) ) finally : arg_0 . lock . release ( )

def Func(arg_0, arg_1):
        """Handle registration form received.

        [client only]

        Call self.registration_callback with the registration form received
        as the argument. Use the value returned by the callback will be a
        filled-in form.

        :Parameters:
            - `stanza`: the stanza received.
        :Types:
            - `stanza`: `pyxmpp.iq.Iq`"""
        arg_0.lock.acquire()
        try:
            arg_0.__register = Register(arg_1.get_query())
            arg_0.registration_callback(arg_1, arg_0.__register.get_form())
        finally:
            arg_0.lock.release()


def Func ( arg_0 ) : arg_1 = arg_0 . bus arg_2 = arg_0 . address for arg_3 in os . listdir ( USB_SYS_PREFIX ) : arg_4 = re . match ( USB_PORTS_STR + '$' , arg_3 ) if arg_4 : arg_5 = readattr ( arg_3 , 'busnum' ) if arg_5 : arg_6 = float ( arg_5 ) else : arg_6 = None arg_7 = readattr ( arg_3 , 'devnum' ) if arg_7 : arg_8 = float ( arg_7 ) else : arg_8 = None if arg_6 == arg_1 and arg_8 == arg_2 : return str ( arg_4 . groups ( ) [ 1 ] )

def Func(arg_0):
    """
    Find the port chain a device is plugged on.

    This is done by searching sysfs for a device that matches the device
    bus/address combination.

    Useful when the underlying usb lib does not return device.port_number for
    whatever reason.
    """
    arg_1 = arg_0.bus
    arg_2 = arg_0.address
    for arg_3 in os.listdir(USB_SYS_PREFIX):
        arg_4 = re.match(USB_PORTS_STR + '$', arg_3)
        if arg_4:
            arg_5 = readattr(arg_3, 'busnum')
            if arg_5:
                arg_6 = float(arg_5)
            else:
                arg_6 = None
            arg_7 = readattr(arg_3, 'devnum')
            if arg_7:
                arg_8 = float(arg_7)
            else:
                arg_8 = None
            if arg_6 == arg_1 and arg_8 == arg_2:
                return str(arg_4.groups()[1])

Find the port chain a device is plugged on .


def Func ( arg_0 ) : arg_1 , arg_2 = min ( [ ( i , i * 8 / math . log ( arg_0 , 2 ) ) for i in range ( 1 , 7 ) ] , key = lambda k : k [ 1 ] % 1 ) return arg_1 , int ( arg_2 )

def Func(arg_0):
    '''
    computes the ideal conversion ratio for the given alphabet.
    A ratio is considered ideal when the number of bits in one output
    encoding chunk that don't add up to one input encoding chunk is minimal.
    '''
    arg_1, arg_2 = min([
                          (i, i*8 / math.log(arg_0, 2))
                          for i in range(1, 7)
                         ], key=lambda k: k[1] % 1)

    return arg_1, int(arg_2)

computes the ideal conversion ratio for the given alphabet . A ratio is considered ideal when the number of bits in one output encoding chunk that don t add up to one input encoding chunk is minimal .


def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 . instructions ) : arg_0 . instructions [ arg_1 ] = arg_2 . Func ( ) return arg_0

def Func(arg_0):
        """Invert all instructions."""
        for arg_1, arg_2 in enumerate(arg_0.instructions):
            arg_0.instructions[arg_1] = arg_2.Func()
        return arg_0


def Func ( arg_0 ) -> list : arg_1 = [ control . Func ( ) for control in arg_0 . controls ] return arg_1

def Func(arg_0) -> list:
        """Returns list of Func compatible states of the RichMessage instance
        nested controls.

        Returns:
            Func_controls: Json representation of RichMessage instance
                nested controls.
        """
        arg_1 = [control.Func() for control in arg_0.controls]
        return arg_1

Returns list of json compatible states of the RichMessage instance
        nested controls.

        Returns:
            json_controls: Json representation of RichMessage instance
                nested controls.

Returns list of json compatible states of the RichMessage instance nested controls .


def Func ( arg_0 ) -> str : arg_1 = None arg_2 = io . StringIO ( "" ) arg_0 . config . write ( arg_2 ) arg_2 . seek ( 0 ) arg_1 = arg_2 . read ( ) arg_2 . close ( ) return arg_1

def Func(arg_0) -> str:
        """ Reads the contents of the config file """
        arg_1 = None
        # with open(file_path) as cfg_file:
        #     contents = cfg_file.read()

        # Dump the current contents into an in-memory file.
        arg_2 = io.StringIO("")
        arg_0.config.write(arg_2)
        arg_2.seek(0)
        arg_1 = arg_2.read()
        #     log(DEBUG, "config content: %s", content)
        arg_2.close()
        return arg_1


def Func(arg_0, arg_1):
        """
        List all course roles available to an account, for the passed Canvas
        account ID, including course roles inherited from parent accounts.
        """
        arg_2 = []
        arg_3 = {"show_inherited": "1"}
        for arg_4 in arg_0.get_roles_in_account(arg_1, arg_3):
            if arg_4.base_role_type != "AccountMembership":
                arg_2.append(arg_4)
        return arg_2

List all course roles available to an account for the passed Canvas account ID including course roles inherited from parent accounts .


def Func(arg_0,arg_1,arg_2=False,**arg_3):
    '''
    Folds Stokes I noise diode data and integrates along coarse channels

    Parameters
    ----------
    name : str
        Path to noise diode filterbank file
    chan_per_coarse : int
        Number of frequency bins per coarse channel
    fullstokes : boolean
        Use fullstokes=True if data is in IQUV format or just Stokes I, use fullstokes=False if
        it is in cross_pols format
    '''
    #Load data
    arg_4 = Waterfall(arg_0,max_load=150)
    arg_5 = arg_4.data

    #If the data has cross_pols format calculate Stokes I
    if arg_2==False and arg_5.shape[1]>1:
        arg_5 = arg_5[:,0,:]+arg_5[:,1,:]
        arg_5 = np.expand_dims(arg_5,axis=1)
    #If the data has IQUV format get Stokes I
    if arg_2==True:
        arg_5 = arg_5[:,0,:]
        arg_5 = np.expand_dims(arg_5,axis=1)

    arg_6 = arg_4.header['tsamp']

    #Calculate ON and OFF values
    arg_7,arg_8 = foldcal(arg_5,arg_6,**arg_3)

    arg_9 = arg_4.populate_freqs()

    #Find ON and OFF spectra by coarse channel
    arg_10 = integrate_chans(arg_8,arg_9,arg_1)
    arg_11 = integrate_chans(arg_7,arg_9,arg_1)

    #If "ON" is actually "OFF" switch them
    if np.sum(arg_10)<np.sum(arg_11):
        arg_12 = arg_10
        arg_10 = arg_11
        arg_11 = arg_12

    #Return coarse channel spectrum of OFF and ON
    return arg_11,arg_10


def Func ( arg_0 , Func ) : for arg_2 in Func : arg_0 = arg_0 . replace ( * arg_2 ) return arg_0

def Func(arg_0, Func):
    """Replace multiple values in a string"""
    for arg_2 in Func:
        arg_0 = arg_0.replace(*arg_2)
    return arg_0


async
def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
""
if
arg_1
not
in
[
'v'
,
'r'
,
'p'
,
's'
,
'c'
,
'g'
,
'i'
,
'u'
]
:
raise
VNDBBadStype
(
arg_1
)
else
:
if
arg_1
in
[
'v'
,
'p'
,
's'
,
'c'
,
'u'
]
:
arg_3
=
'/{}/all'
.
format
(
arg_1
)
elif
arg_1
in
[
'g'
,
'i'
]
:
arg_3
=
'/{}/list'
.
format
(
arg_1
)
elif
arg_1
==
'r'
:
arg_3
=
'/r'
async
with
arg_0
.
session
.
get
(
arg_0
.
base_url
+
"{}"
.
format
(
arg_3
)
,
params
=
{
"q"
:
arg_2
}
,
headers
=
arg_0
.
headers
)
as
response
:
if
response
.
status
==
404
:
raise
aiohttp
.
HttpBadRequest
(
"VN Not Found"
)
elif
'q='
not
in
response
.
url
:
raise
VNDBOneResult
(
arg_2
,
response
.
url
.
rsplit
(
'/'
,
1
)
[
1
]
)
arg_4
=
await
response
.
text
(
)
if
'No Results'
in
arg_4
:
raise
VNDBNoResults
(
arg_2
)
arg_5
=
BeautifulSoup
(
arg_4
,
'lxml'
)
arg_6
=
await
arg_0
.
parse_search
(
arg_1
,
arg_5
)
if
arg_6
==
[
]
:
raise
VNDBNoResults
(
arg_2
)
return
arg_6

async def Func(arg_0, arg_1, arg_2):
        """
        Search vndb.org for a term and return matching results from type.

        :param stype: type to search for.
            Type should be one of:
                v - Visual Novels
                r - Releases
                p - Producers
                s - Staff
                c - Characters
                g - Tags
                i - traits
                u - Users
        :param term: string to search for
        :return: Results. Result format depends on what you searched for. See the Parsing.py module for more specific documentation.

        Exceptions:
            aiohttp.HttpBadRequest - On 404s
            VNDBOneResult - When you search for something but it instead redirects us to a direct content page
            VNDBNoResults - When nothing was found for that search
            VNDBBadStype - Raised when an incorrect search type is passed
        """
        arg_3 = ""
        if arg_1 not in ['v', 'r', 'p', 's', 'c', 'g', 'i', 'u']:
            raise VNDBBadStype(arg_1)
        else:
            if arg_1 in ['v', 'p', 's', 'c', 'u']:
                arg_3 = '/{}/all'.format(arg_1)
            elif arg_1 in ['g', 'i']:
                arg_3 = '/{}/list'.format(arg_1)
            elif arg_1 == 'r':
                arg_3 = '/r'
        async with arg_0.session.get(arg_0.base_url + "{}".format(arg_3), params={"q": arg_2}, headers=arg_0.headers) as response:
            if response.status == 404:
                raise aiohttp.HttpBadRequest("VN Not Found")
            elif 'q=' not in response.url:
                raise VNDBOneResult(arg_2, response.url.rsplit('/', 1)[1])
            arg_4 = await response.text()
            if 'No Results' in arg_4:
                raise VNDBNoResults(arg_2)
            arg_5 = BeautifulSoup(arg_4, 'lxml')
            arg_6 = await arg_0.parse_search(arg_1, arg_5)
            if arg_6 == []:
                raise VNDBNoResults(arg_2)
            return arg_6

Search vndb . org for a term and return matching results from type .


def Func ( arg_0 ) : arg_1 = { arg_0 . name : { 'href' : arg_0 . href_prefix + arg_0 . href , 'timeRequested' : arg_0 . time_requested , 'status' : arg_0 . status , } , } if arg_0 . input is not None : arg_1 [ arg_0 . name ] [ 'input' ] = arg_0 . input if arg_0 . time_completed is not None : arg_1 [ arg_0 . name ] [ 'timeCompleted' ] = arg_0 . time_completed return arg_1

def Func(arg_0):
        """
        Get the action description.

        Returns a dictionary describing the action.
        """
        arg_1 = {
            arg_0.name: {
                'href': arg_0.href_prefix + arg_0.href,
                'timeRequested': arg_0.time_requested,
                'status': arg_0.status,
            },
        }

        if arg_0.input is not None:
            arg_1[arg_0.name]['input'] = arg_0.input

        if arg_0.time_completed is not None:
            arg_1[arg_0.name]['timeCompleted'] = arg_0.time_completed

        return arg_1


(self, features, class_labels, scoring_function=None, **scoring_function_kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=None, **arg_4):
        """Estimates the accuracy of the predictions from the constructed feature.

        Parameters
        ----------
        features: array-like {n_samples, n_features}
            Feature matrix to predict from
        class_labels: array-like {n_samples}
            List of true class labels

        Returns
        -------
        accuracy_Func: float
            The estimated accuracy based on the constructed feature

        """
        if arg_0.feature_map is None:
            raise ValueError('The MDR model must be fit before Func can be called.')

        arg_5 = arg_0.predict(arg_1)

        if arg_3 is None:
            return accuracy_Func(arg_2, arg_5)
        else:
            return arg_3(arg_2, arg_5, **arg_4)

Estimates the accuracy of the predictions from the constructed feature.

        Parameters
        ----------
        features: array-like {n_samples, n_features}
            Feature matrix to predict from
        class_labels: array-like {n_samples}
            List of true class labels

        Returns
        -------
        accuracy_score: float
            The estimated accuracy based on the constructed feature

Estimates the accuracy of the predictions from the constructed feature .


(cls, connections, random, segment,
                                    nDestroy, excludeCells)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 ) : arg_6 = sorted ( ( arg_10 for arg_10 in arg_1 . synapsesForSegment ( arg_3 ) if arg_10 . presynapticCell not in arg_5 ) , key = lambda s : s . _ordinal ) for arg_7 in xrange ( arg_4 ) : if len ( arg_6 ) == 0 : break arg_8 = None arg_9 = float ( "inf" ) for arg_10 in arg_6 : if arg_10 . permanence < arg_9 - EPSILON : arg_8 = arg_10 arg_9 = arg_10 . permanence arg_1 . destroySynapse ( arg_8 ) arg_6 . remove ( arg_8 )

def Func(arg_0, arg_1, arg_2, arg_3,
                                    arg_4, arg_5):
    """
    Destroy nDestroy synapses on the specified segment, but don't destroy
    synapses to the "excludeCells".
    """

    arg_6 = sorted(
      (arg_10 for arg_10 in arg_1.synapsesForSegment(arg_3)
       if arg_10.presynapticCell not in arg_5),
      key=lambda s: s._ordinal
    )

    for arg_7 in xrange(arg_4):
      if len(arg_6) == 0:
        break

      arg_8 = None
      arg_9 = float("inf")

      for arg_10 in arg_6:
        if arg_10.permanence < arg_9 - EPSILON:
          arg_8 = arg_10
          arg_9 = arg_10.permanence

      arg_1.destroySynapse(arg_8)
      arg_6.remove(arg_8)

Destroy nDestroy synapses on the specified segment but don t destroy synapses to the excludeCells .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_year_info_pq
(
arg_1
,
'Coach'
)
.
text
(
)
arg_3
=
r'(\S+?) \((\d+)-(\d+)-(\d+)\)'
arg_4
=
[
]
arg_5
=
True
while
arg_5
:
arg_5
=
re
.
search
(
arg_3
,
arg_2
)
arg_6
,
arg_7
,
arg_8
,
arg_9
=
arg_5
.
groups
(
)
arg_10
=
arg_5
.
end
(
4
)
+
1
arg_11
=
arg_11
[
arg_10
:
]
arg_12
=
int
(
arg_7
)
+
int
(
arg_8
)
+
int
(
arg_9
)
arg_4
.
append
(
(
arg_6
,
arg_12
)
)
arg_13
=
[
cID
for
cID
,
games
in
arg_4
for
_
in
range
(
games
)
]
return
np
.
array
(
arg_13
[
:
:
1
]
)

def Func(arg_0, arg_1):
        """Returns head coach data by game.

        :year: An int representing the season in question.
        :returns: An array with an entry per game of the season that the team
        played (including playoffs). Each entry is the head coach's ID for that
        game in the season.
        """
        arg_2 = arg_0._year_info_pq(arg_1, 'Coach').text()
        arg_3 = r'(\S+?) \((\d+)-(\d+)-(\d+)\)'
        arg_4 = []
        arg_5 = True
        while arg_5:
            arg_5 = re.search(arg_3, arg_2)
            arg_6, arg_7, arg_8, arg_9 = arg_5.groups()
            arg_10 = arg_5.end(4) + 1
            arg_11 = arg_11[arg_10:]
            arg_12 = int(arg_7) + int(arg_8) + int(arg_9)
            arg_4.append((arg_6, arg_12))

        arg_13 = [
            cID for cID, games in arg_4 for _ in range(games)
        ]
        return np.array(arg_13[::-1])


def Func(arg_0):
    '''
    Decorator for methods that need many retries, because of
    intermittent failures, such as AWS calls via boto, which has a
    non-back-off retry.
    '''
    def retry_func(arg_1, *arg_2, **arg_3):
        arg_4 = 1
        while True:
            # If a handler allows execution to continue, then
            # fall through and do a back-off retry.
            try:
                return arg_0(arg_1, *arg_2, **arg_3)
                break
            except OSError as exc:
                ## OSError: [Errno 24] Too many open files
                logger.error('assuming OSError unrecoverable')
                raise
            except FailedExtraction as exc:
                ## pass through exc to caller
                logger.error('FAIL(%d)', arg_4, exc_info=True)
                raise
            except FailedVerification as exc:
                logger.warn('FAIL(%d)', arg_4, exc_info=True)
                if arg_4 >= arg_1.config['tries']:
                    if arg_1.config.get('suppress_failures'):
                        logger.warn('suppressing failure and breaking out of this loop; data may be corrupt, downstream will have to cope')
                        break
                    else:
                        raise
            except Exception as exc:
                logger.warn('FAIL(%d): having I/O trouble with S3', arg_4, exc_info=True)
                if arg_4 >= arg_1.config['tries']:
                    raise

            logger.warn('RETRYING (%d left)', arg_1.config['tries'] - arg_4)
            time.sleep(3 * arg_4)
            arg_4 += 1

    return retry_func

Decorator for methods that need many retries because of intermittent failures such as AWS calls via boto which has a non - back - off retry .


def Func ( arg_0 ) : if arg_0 is None : return False if 'id' in arg_0 and not arg_0 . get ( 'id' ) : return False if 'name' in arg_0 and not arg_0 . get ( 'name' ) : return False return True

def Func(arg_0):
    """
    Organization data validation
    """
    if arg_0 is None:
        return False
    if 'id' in arg_0 and not arg_0.get('id'):
        return False
    if 'name' in arg_0 and not arg_0.get('name'):
        return False
    return True


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_0 . page = PDFPage ( arg_0 . orientation_default , arg_0 . layout_default , arg_0 . margins ) else : arg_0 . page = arg_1 arg_0 . page . _set_index ( len ( arg_0 . pages ) ) arg_0 . pages . append ( arg_0 . page ) arg_2 = arg_0 . font arg_0 . set_font ( font = arg_2 ) arg_0 . session . _reset_colors ( )

def Func(arg_0, arg_1=None):
        """ May generate and add a PDFPage separately, or use this to generate
            a default page."""
        if arg_1 is None:
            arg_0.page = PDFPage(arg_0.orientation_default, arg_0.layout_default, arg_0.margins)
        else:
            arg_0.page = arg_1
        arg_0.page._set_index(len(arg_0.pages))
        arg_0.pages.append(arg_0.page)
        arg_2 = arg_0.font
        arg_0.set_font(font=arg_2)
        arg_0.session._reset_colors()

May generate and add a PDFPage separately or use this to generate a default page .


def Func ( arg_0 ) -> bool : if arg_0 . read_eof ( ) : return False arg_0 . _stream . incpos ( ) return True

def Func(arg_0) -> bool:
        """Read one byte in stream"""
        if arg_0.read_eof():
            return False
        arg_0._stream.incpos()
        return True


def Func ( arg_0 ) : arg_1 = "" for arg_2 in arg_0 : if arg_2 . isalpha ( ) : arg_1 += arg_2 return arg_1

def Func(arg_0):
    """Get letters from string only."""
    arg_1 = ""
    for arg_2 in arg_0:
        if arg_2.isalpha():
            arg_1 += arg_2
    return arg_1


def Func ( arg_0 ) : arg_1 = arg_0 . _get_input_buffer_cursor_prompt ( ) if arg_1 is None : return - 1 else : arg_2 = arg_0 . _control . textCursor ( ) return arg_2 . columnNumber ( ) - len ( arg_1 )

def Func(arg_0):
        """ Returns the column of the cursor in the input buffer, excluding the
            contribution by the prompt, or -1 if there is no such column.
        """
        arg_1 = arg_0._get_input_buffer_cursor_prompt()
        if arg_1 is None:
            return -1
        else:
            arg_2 = arg_0._control.textCursor()
            return arg_2.columnNumber() - len(arg_1)

Returns the column of the cursor in the input buffer excluding the contribution by the prompt or - 1 if there is no such column .


def Func(arg_0, arg_1, arg_2):
    """Apply a specified mutant to the source code

    :param mutation_pk: mutmut cache primary key of the mutant to apply
    :type mutation_pk: str

    :param dict_synonyms: list of synonym keywords for a python dictionary
    :type dict_synonyms: list[str]

    :param backup: if :obj:`True` create a backup of the source file
        before applying the mutation
    :type backup: bool
    """
    arg_3, arg_4 = filename_and_mutation_id_from_pk(int(arg_0))

    update_line_numbers(arg_3)

    arg_5 = Context(
        arg_4=arg_4,
        arg_3=arg_3,
        arg_1=arg_1,
    )
    mutate_file(
        arg_2=arg_2,
        arg_5=arg_5,
    )
    if arg_5.number_of_performed_mutations == 0:
        raise RuntimeError('No mutations performed.')


return '<link href="{src}" rel="stylesheet">'.format(src=url)

def
Func
(
arg_0
)
:
if
not
arg_0
.
startswith
(
'http://'
)
and
not
arg_0
[
:
1
]
==
'/'
:
arg_0
=
settings
.
STATIC_URL
+
arg_0
return
'<link href="{src}" rel="stylesheet">'
.
format
(
src
=
arg_0
)

def Func(arg_0):
    '''
    Output a link tag to a css stylesheet.
    '''

    if not arg_0.startswith('http://') and not arg_0[:1] == '/':
        #add media_url for relative paths
        arg_0 = settings.STATIC_URL + arg_0

    return '<link href="{src}" rel="stylesheet">'.format(src=arg_0)


def Func(arg_0, arg_1, arg_2):
        """
        Extract arguments for model from the environment and return as a tuple that
        is ready to be passed to the model.

        :param callable model: Python model of the function
        :param tuple prefix_args: Parameters to pass to model before actual ones
        :return: Arguments to be passed to the model
        :rtype: tuple
        """
        arg_3 = inspect.getfullargspec(arg_1)

        if arg_3.varargs:
            logger.warning("ABI: A vararg model must be a unary function.")

        arg_4 = len(arg_3.args) - len(arg_2)

        # If the model is a method, we need to account for `self`
        if inspect.ismethod(arg_1):
            arg_4 -= 1

        def resolve_argument(arg_5):
            if isinstance(arg_5, str):
                return arg_0._cpu.read_register(arg_5)
            else:
                return arg_0._cpu.read_int(arg_5)

        # Create a stream of resolved arguments from argument descriptors
        arg_6 = arg_0.get_arguments()
        arg_7 = map(resolve_argument, arg_6)

        from ..models import isvariadic  # prevent circular imports

        if isvariadic(arg_1):
            arg_8 = arg_2 + (arg_7,)
        else:
            arg_8 = arg_2 + tuple(islice(arg_7, arg_4))

        return arg_8

Extract arguments for model from the environment and return as a tuple that is ready to be passed to the model .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_3 = arg_3 . read ( ) arg_1 . write ( Operators . EXTRACT ( arg_2 . read ( ) , arg_3 * 128 , ( arg_3 + 1 ) * 128 ) )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Extract Packed Floating-Point Values

        Extracts 128-bits of packed floating-point values from the source
        operand (second operand) at an 128-bit offset from imm8[0] into the
        destination operand (first operand). The destination may be either an
        XMM register or an 128-bit memory location.
        """
        arg_3 = arg_3.read()
        arg_1.write(Operators.EXTRACT(arg_2.read(), arg_3 * 128, (arg_3 + 1) * 128))


def Func(arg_0):
    """Calculate the Func.

    Args:
        state (np.array): a quantum state (1x4 array) or a density matrix (4x4
                          array)
    Returns:
        float: Func.
    Raises:
        Exception: if attempted on more than two qubits.
    """
    arg_1 = np.array(arg_0)
    if arg_1.ndim == 1:
        arg_1 = outer(arg_0)
    if len(arg_0) != 4:
        raise Exception("Concurrence is only defined for more than two qubits")

    arg_2 = np.fliplr(np.diag([-1, 1, 1, -1]))
    arg_3 = arg_1.dot(arg_2).dot(arg_1.conj()).dot(arg_2)
    arg_4 = la.eigh(arg_3, eigvals_only=True)
    arg_4 = np.sqrt(np.maximum(arg_4, 0))
    return max(0.0, arg_4[-1] - np.sum(arg_4[0:-1]))

Calculate the concurrence.

    Args:
        state (np.array): a quantum state (1x4 array) or a density matrix (4x4
                          array)
    Returns:
        float: concurrence.
    Raises:
        Exception: if attempted on more than two qubits.


def Func ( arg_0 , arg_1 = None ) : arg_1 = arg_1 or arg_0 . pid with db . session . begin_nested ( ) : before_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) arg_2 , arg_3 = arg_0 . fetch_published ( ) arg_0 . model . json = deepcopy ( arg_3 . model . json ) arg_0 . model . json [ '$schema' ] = arg_0 . build_deposit_schema ( arg_3 ) flag_modified ( arg_0 . model , 'json' ) db . session . merge ( arg_0 . model ) after_record_update . send ( current_app . _get_current_object ( ) , arg_3 = arg_0 ) return arg_0 . __class__ ( arg_0 . model . json , arg_4 = arg_0 . model )

def Func(arg_0, arg_1=None):
        """Discard deposit changes.

        #. The signal :data:`invenio_records.signals.before_record_update` is
            sent before the edit execution.

        #. It restores the last published version.

        #. The following meta information are saved inside the deposit:

        .. code-block:: python

            deposit['$schema'] = deposit_schema_from_record_schema

        #. The signal :data:`invenio_records.signals.after_record_update` is
            sent after the edit execution.

        #. The deposit index is updated.

        Status required: ``'draft'``.

        :param pid: Force a pid object. (Default: ``None``)
        :returns: A new Deposit object.
        """
        arg_1 = arg_1 or arg_0.pid

        with db.session.begin_nested():
            before_record_update.send(
                current_app._get_current_object(), arg_3=arg_0)

            arg_2, arg_3 = arg_0.fetch_published()
            arg_0.model.json = deepcopy(arg_3.model.json)
            arg_0.model.json['$schema'] = arg_0.build_deposit_schema(arg_3)

            flag_modified(arg_0.model, 'json')
            db.session.merge(arg_0.model)

        after_record_update.send(
            current_app._get_current_object(), arg_3=arg_0)
        return arg_0.__class__(arg_0.model.json, arg_4=arg_0.model)


def Func(arg_0, arg_1=22050, **arg_2):
    '''Get the frequencies for FFT bins'''
    arg_3 = 2 * (arg_0 - 1)
    # The following code centers the FFT bins at their frequencies
    # and clips to the non-negative frequency range [0, nyquist]
    arg_4 = core.fft_frequencies(arg_1=arg_1, arg_3=arg_3)
    arg_5 = arg_4[-1]
    arg_4 -= 0.5 * (arg_4[1] - arg_4[0])
    arg_4 = np.append(np.maximum(0, arg_4), [arg_5])
    return arg_4


def Func ( arg_0 ) : arg_1 = { 'heatmap-radius' : VectorStyle . get_style_value ( arg_0 . radius ) , 'heatmap-opacity' : VectorStyle . get_style_value ( arg_0 . opacity ) , 'heatmap-color' : VectorStyle . get_style_value ( arg_0 . color ) , 'heatmap-intensity' : VectorStyle . get_style_value ( arg_0 . intensity ) , 'heatmap-weight' : VectorStyle . get_style_value ( arg_0 . weight ) } return arg_1

def Func(arg_0):
        """
        Renders a javascript snippet suitable for use as a mapbox-gl heatmap Func entry

        Returns:
            A dict that can be converted to a mapbox-gl javascript Func snippet
        """
        arg_1 = {
            'heatmap-radius': VectorStyle.get_style_value(arg_0.radius),
            'heatmap-opacity': VectorStyle.get_style_value(arg_0.opacity),
            'heatmap-color': VectorStyle.get_style_value(arg_0.color),
            'heatmap-intensity': VectorStyle.get_style_value(arg_0.intensity),
            'heatmap-weight': VectorStyle.get_style_value(arg_0.weight)
        }

        return arg_1

Renders a javascript snippet suitable for use as a mapbox-gl heatmap paint entry

        Returns:
            A dict that can be converted to a mapbox-gl javascript paint snippet

Renders a javascript snippet suitable for use as a mapbox - gl heatmap paint entry


def Func ( arg_0 , arg_1 = None ) : if arg_0 is None : return None if isinstance ( arg_0 , datetime ) : return arg_0 . isoformat ( ) return str ( arg_0 )

def Func(arg_0, arg_1=None):
        """
        Returns the SQL literal of the cell as a string.

        :param cell: The cell to insert into the table
        :type cell: object
        :param conn: The database connection
        :type conn: connection object
        :return: The serialized cell
        :rtype: str
        """

        if arg_0 is None:
            return None
        if isinstance(arg_0, datetime):
            return arg_0.isoformat()
        return str(arg_0)

Returns the SQL literal of the cell as a string .


def Func ( arg_0 , arg_1 , arg_2 ) : if not arg_0 . doc_data_lics_set : arg_0 . doc_data_lics_set = True if validations . validate_data_lics ( arg_2 ) : arg_1 . data_license = document . License . from_identifier ( arg_2 ) return True else : raise SPDXValueError ( 'Document::DataLicense' ) else : raise CardinalityError ( 'Document::DataLicense' )

def Func(arg_0, arg_1, arg_2):
        """Sets the document data license.
        Raises value error if malformed value, CardinalityError
        if already defined.
        """
        if not arg_0.doc_data_lics_set:
            arg_0.doc_data_lics_set = True
            if validations.validate_data_lics(arg_2):
                arg_1.data_license = document.License.from_identifier(arg_2)
                return True
            else:
                raise SPDXValueError('Document::DataLicense')
        else:
            raise CardinalityError('Document::DataLicense')

Sets the document data license . Raises value error if malformed value CardinalityError if already defined .


def Func ( arg_0 ) : if os . path . isabs ( arg_0 [ 'build' ] ) : return arg_0 [ 'build' ] return os . path . join ( Repo ( arg_0 [ 'repo' ] ) . local_path , arg_0 [ 'build' ] )

def Func(arg_0):
    """ Given a spec for an app, returns the value of the `build` field for docker-compose.
    If the path is relative, it is expanded and added to the path of the app's repo. """
    if os.path.isabs(arg_0['build']):
        return arg_0['build']
    return os.path.join(Repo(arg_0['repo']).local_path, arg_0['build'])

Given a spec for an app returns the value of the build field for docker - compose . If the path is relative it is expanded and added to the path of the app s repo .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_3
)
:
if
not
arg_11
.
path
.
isdir
(
arg_0
)
:
raise
UnrecognizedFormat
(
"%s is not a directory"
%
(
arg_0
,
)
)
arg_4
=
{
arg_0
:
(
''
,
arg_1
)
}
for
arg_5
,
arg_6
,
arg_7
in
arg_11
.
walk
(
arg_0
)
:
arg_8
,
arg_9
=
arg_4
[
arg_5
]
for
arg_10
in
arg_6
:
arg_4
[
arg_11
.
path
.
join
(
arg_5
,
arg_10
)
]
=
arg_8
+
arg_10
+
'/'
,
arg_11
.
path
.
join
(
arg_9
,
arg_10
)
for
arg_14
in
arg_7
:
arg_15
=
arg_8
+
arg_14
arg_16
=
arg_11
.
path
.
join
(
arg_9
,
arg_14
)
arg_16
=
arg_2
(
arg_8
+
arg_14
,
arg_16
)
if
not
arg_16
:
continue
ensure_directory
(
arg_16
)
arg_14
=
arg_11
.
path
.
join
(
arg_5
,
arg_14
)
shutil
.
copyfile
(
arg_14
,
arg_16
)
shutil
.
copystat
(
arg_14
,
arg_16
)

def Func(arg_0, arg_1, arg_2=arg_3):
    """"Unpack" a directory, using the same interface as for archives

    Raises ``UnrecognizedFormat`` if `filename` is not a directory
    """
    if not arg_11.path.isdir(arg_0):
        raise UnrecognizedFormat("%s is not a directory" % (arg_0,))

    arg_4 = {arg_0:('',arg_1)}
    for arg_5, arg_6, arg_7 in arg_11.walk(arg_0):
        arg_8,arg_9 = arg_4[arg_5]
        for arg_10 in arg_6:
            arg_4[arg_11.path.join(arg_5,arg_10)] = arg_8+arg_10+'/', arg_11.path.join(arg_9,arg_10)
        for arg_14 in arg_7:
            arg_15 = arg_8+arg_14
            arg_16 = arg_11.path.join(arg_9,arg_14)
            arg_16 = arg_2(arg_8+arg_14, arg_16)
            if not arg_16:
                continue    # skip non-files
            ensure_directory(arg_16)
            arg_14 = arg_11.path.join(arg_5,arg_14)
            shutil.copyfile(arg_14, arg_16)
            shutil.copystat(arg_14, arg_16)

Unpack a directory using the same interface as for archives


(self, query=None, category='snv', variant_type=['clinical'])

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
'snv'
,
arg_3
=
[
'clinical'
]
)
:
arg_1
=
arg_1
or
{
}
arg_4
=
{
}
LOG
.
debug
(
"Building a mongo query for %s"
%
arg_1
)
if
arg_1
.
get
(
'hgnc_symbols'
)
:
arg_4
[
'hgnc_symbols'
]
=
{
'$in'
:
arg_1
[
'hgnc_symbols'
]
}
arg_4
[
'variant_type'
]
=
{
'$in'
:
arg_3
}
arg_4
[
'category'
]
=
arg_2
arg_5
=
arg_1
.
get
(
'rank_score'
)
or
15
arg_4
[
'rank_score'
]
=
{
'$gte'
:
arg_5
}
LOG
.
debug
(
"Querying %s"
%
arg_4
)
return
arg_4

def Func(arg_0, arg_1=None, arg_2='snv', arg_3=['clinical']):
        """Build a mongo query across multiple cases.
        Translate query options from a form into a complete mongo query dictionary.

        Beware that unindexed queries against a large variant collection will
        be extremely slow.

        Currently indexed query options:
            hgnc_symbols
            rank_score
            variant_type
            category

        Args:
            query(dict): A query dictionary for the database, from a query form.
            category(str): 'snv', 'sv', 'str' or 'cancer'
            variant_type(str): 'clinical' or 'research'

        Returns:
            mongo_query : A dictionary in the mongo query format.
        """

        arg_1 = arg_1 or {}
        arg_4 = {}

        LOG.debug("Building a mongo query for %s" % arg_1)

        if arg_1.get('hgnc_symbols'):
            arg_4['hgnc_symbols'] = {'$in': arg_1['hgnc_symbols']}

        arg_4['variant_type'] = {'$in': arg_3}

        arg_4['category'] = arg_2

        arg_5 = arg_1.get('rank_score') or 15

        arg_4['rank_score'] = {'$gte': arg_5}
        LOG.debug("Querying %s" % arg_4)

        return arg_4

Build a mongo query across multiple cases . Translate query options from a form into a complete mongo query dictionary .


def Func(arg_0):
        """Calculate the mol mass of the compound

        Returns
        -------
        float
            the mol mass
        """
        try:
            return sum([arg_2 * elements_and_molecular_Funcs[arg_1]
                        for arg_1, arg_2 in arg_0.elements.items()])
        except KeyError as e:
            warn("The element %s does not appear in the periodic table" % e)


_rem_id_from_keys - Remove primary key from table
			internal

def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 . _get_connection ( ) arg_2 . srem ( arg_0 . _get_ids_key ( ) , arg_1 )

def Func(arg_0, arg_1, arg_2=None):
		'''
			Func - Remove primary key from table
			internal
		'''
		if arg_2 is None:
			arg_2 = arg_0._get_connection()
		arg_2.srem(arg_0._get_ids_key(), arg_1)