def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . pids : try : PersistentIdentifier . get ( arg_2 . pid_type , arg_2 . pid_value ) except PIDDoesNotExistError : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
        """Filter persistent identifiers."""
        arg_1 = []
        for arg_2 in arg_0.pids:
            try:
                PersistentIdentifier.get(arg_2.pid_type, arg_2.pid_value)
            except PIDDoesNotExistError:
                arg_1.append(arg_2)
        return arg_1


(self, path, params, method, parser_func,
        next_marker_xpath, next_marker_param_name,
        next_type_xpath=None, parser_kwargs=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
        arg_5, arg_6,
        arg_7=None, arg_8=None):
        """
        Given an API method, the arguments passed to it, and a function to
        hand parsing off to, loop through the record sets in the API call
        until all records have been yielded.

        :param str method: The API method on the endpoint.
        :param dict params: The kwargs from the top-level API method.
        :param callable parser_func: A callable that is used for parsing the
            output from the API call.
        :param str next_marker_param_name: The XPath to the marker tag that
            will determine whether we continue paginating.
        :param str next_marker_param_name: The parameter name to manipulate
            in the request data to bring up the next page on the next
            request loop.
        :keyword str next_type_xpath: For the
            py:meth:`list_resource_record_sets_by_zone_id` method, there's
            an additional paginator token. Specifying this XPath looks for it.
        :keyword dict parser_kwargs: Optional dict of additional kwargs to pass
            on to the parser function.
        :rtype: generator
        :returns: Returns a generator that may be returned by the top-level
            API method.
        """

        if not arg_8:
            arg_8 = {}

        # We loop indefinitely since we have no idea how many "pages" of
        # results we're going to have to go through.
        while True:
            # An lxml Element node.
            arg_9 = arg_0._send_request(arg_1, arg_2, arg_3)

            # Individually yield HostedZone instances after parsing/instantiating.
            for arg_10 in arg_4(arg_9, connection=arg_0, **arg_8):
                yield arg_10

            # This will determine at what offset we start the next query.
            arg_11 = arg_9.find(arg_5)
            if arg_11 is None:
                # If the NextMarker tag is absent, we know we've hit the
                # last page.
                break

            # if NextMarker is present, we'll adjust our API request params
            # and query again for the next page.
            arg_2[arg_6] = arg_11.text

            if arg_7:
                # This is a _list_resource_record_sets_by_zone_id call. Look
                # for the given tag via XPath and adjust our type arg for
                # the next request. Without specifying this, we loop
                # infinitely.
                arg_12 = arg_9.find(arg_7)
                arg_2['type'] = arg_12.text

Given an API method the arguments passed to it and a function to hand parsing off to loop through the record sets in the API call until all records have been yielded .


def Func(arg_0, arg_1):
        'assemble Sentence and Token objects'
        arg_0.make_label_index(arg_1)
        arg_2 = []
        arg_3 = 0
        arg_4 = 0
        for arg_5, arg_6, arg_7 in arg_0._sentences(
                arg_1.body.clean_visible):
            assert isinstance(arg_7, unicode)
            arg_8 = Sentence()
            arg_9 = 0
            for arg_10, arg_11 in arg_0.word_tokenizer.span_tokenize(arg_7):
                arg_12 = arg_7[arg_10:arg_11].encode('utf8')
                arg_13 = Token(
                    arg_3=arg_3,
                    token=arg_12,
                    arg_9=arg_9,
                )
                arg_13.offsets[arg_15.CHARS] = Offset(
                    type=arg_15.CHARS,
                    first=arg_5 + arg_10,
                    length=arg_11 - arg_10,
                )
                # whitespace tokenizer will never get a token
                # boundary in the middle of an 'author' label
                try:
                    arg_17 = arg_0.label_index.find_le(arg_5 + arg_10)
                except ValueError:
                    arg_17 = None
                if arg_17:
                    arg_18 = arg_17.offsets[arg_15.CHARS]
                    if arg_18.first + arg_18.length > arg_5 + arg_10:
                        streamcorpus.add_annotation(arg_13, arg_17)
                        logger.debug('adding label to tok: %r has %r',
                                     arg_13.token, arg_17.target.target_id)

                        if arg_17 in arg_0.label_to_mention_id:
                            arg_19 = arg_0.label_to_mention_id[arg_17]
                        else:
                            arg_19 = arg_4
                            arg_4 += 1
                            arg_0.label_to_mention_id[arg_17] = arg_19

                        arg_13.mention_id = arg_19

                arg_3 += 1
                arg_9 += 1
                arg_8.tokens.append(arg_13)
            arg_2.append(arg_8)
        return arg_2


def
Func
(
arg_0
,
arg_1
=
'treetime_tmp'
)
:
if
arg_0
.
tree
is
:
arg_0
.
tree
=
os
.
path
.
basename
(
arg_0
.
aln
)
+
'.nwk'
print
(
"No tree given: inferring tree"
)
utils
.
tree_inference
(
arg_0
.
aln
,
arg_0
.
tree
,
arg_1
=
arg_1
)
if
os
.
path
.
isdir
(
arg_1
)
:
shutil
.
rmtree
(
arg_1
)
try
:
arg_3
=
TreeAnc
(
arg_0
.
tree
)
except
:
print
(
"Tree loading/building failed."
)
return
1
return
0

def Func(arg_0, arg_1='treetime_tmp'):
    """
    Function that attempts to load a tree and build it from the alignment
    if no tree is provided.
    """
    if arg_0.tree is None:
        arg_0.tree = os.path.basename(arg_0.aln)+'.nwk'
        print("No tree given: inferring tree")
        utils.tree_inference(arg_0.aln, arg_0.tree, arg_1 = arg_1)

    if os.path.isdir(arg_1):
        shutil.rmtree(arg_1)

    try:
        arg_3 = TreeAnc(arg_0.tree)
    except:
        print("Tree loading/building failed.")
        return 1
    return 0

Function that attempts to load a tree and build it from the alignment if no tree is provided .


def Func ( arg_0 , arg_1 ) : arg_1 . endlexpos = arg_1 . lexpos + len ( arg_1 . value ) return arg_1

def Func(arg_0, arg_1):
        r"\["
        arg_1.endlexpos = arg_1.lexpos + len(arg_1.value)
        return arg_1


def Func ( arg_0 , arg_1 = None ) : arg_2 = [ ] for arg_3 , arg_4 in iter_files_distros ( arg_1 = arg_1 ) : if arg_0 in arg_3 : for arg_5 , arg_6 in arg_3 [ arg_0 ] . items ( ) : with BadEntryPoint . err_to_warnings ( ) : arg_2 . append ( EntryPoint . from_string ( arg_6 , arg_5 , arg_4 ) ) return arg_2

def Func(arg_0, arg_1=None):
    """Find all entry points in a group.

    Returns a list of :class:`EntryPoint` objects.
    """
    arg_2 = []
    for arg_3, arg_4 in iter_files_distros(arg_1=arg_1):
        if arg_0 in arg_3:
            for arg_5, arg_6 in arg_3[arg_0].items():
                with BadEntryPoint.err_to_warnings():
                    arg_2.append(EntryPoint.from_string(arg_6, arg_5, arg_4))

    return arg_2


(self, service_name, deployment_name, role_name)

return self._perform_get(
            self._get_role_path(service_name, deployment_name, role_name),
            PersistentVMRole)

def Func(arg_0, arg_1, arg_2, arg_3):
        '''
        Retrieves the specified virtual machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_get(
            arg_0._Func_path(arg_1, arg_2, arg_3),
            PersistentVMRole)

Retrieves the specified virtual machine .


(self, username, password, client, request,
                      *args, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      *arg_5, **arg_6):
        """Ensure the username and password is valid.

        Attach user object on request for later using.
        """
        log.debug('Validating username %r and its password', arg_1)
        if arg_0._usergetter is not None:
            arg_7 = arg_0._usergetter(
                arg_1, arg_2, arg_3, arg_4, *arg_5, **arg_6
            )
            if arg_7:
                arg_4.user = arg_7
                return True
            return False
        log.debug('Password credential authorization is disabled.')
        return False

Ensure the username and password is valid .


def Func ( arg_0 , arg_1 ) : arg_0 . wlabel_main = text . Label ( "label_main" , arg_0 , arg_0 . window , arg_0 . peng , pos = lambda sw , sh , bw , bh : ( sw / 2 - bw / 2 , sh / 2 - bh / 2 ) , arg_3 = [ 0 , 0 ] , label = arg_1 , ) arg_0 . wlabel_main . size = lambda sw , sh : ( sw , arg_0 . wlabel_main . _label . font_size ) arg_0 . addWidget ( arg_0 . wlabel_main )

def Func(arg_0,arg_1):
        """
        Adds the main label of the dialog.

        This widget can be triggered by setting the label ``label_main`` to a string.

        This widget will be centered on the screen.
        """
        # Main Label
        arg_0.wlabel_main = text.Label("label_main",arg_0,arg_0.window,arg_0.peng,
                        pos=lambda sw,sh, bw,bh: (sw/2-bw/2,sh/2-bh/2),
                        arg_3=[0,0],
                        label=arg_1,
                        #multiline=True, # TODO: implement multine dialog
                        )
        arg_0.wlabel_main.size = lambda sw,sh: (sw,arg_0.wlabel_main._label.font_size)
        arg_0.addWidget(arg_0.wlabel_main)

Adds the main label of the dialog . This widget can be triggered by setting the label label_main to a string . This widget will be centered on the screen .


def Func ( arg_0 ) : arg_1 = { } for arg_2 in DEF_PATTERN . finditer ( arg_0 ) : arg_1 [ arg_2 . group ( 'name' ) ] = arg_2 . group ( 'content' ) return arg_1

def Func(arg_0):
    r"""Get all ``\def`` macro definition from TeX source.

    Parameters
    ----------
    tex_source : `str`
        TeX source content.

    Returns
    -------
    macros : `dict`
        Keys are macro names (including leading ``\``) and values are the
        content (as `str`) of the macros.

    Notes
    -----
    ``\def`` macros with arguments are not supported.
    """
    arg_1 = {}
    for arg_2 in DEF_PATTERN.finditer(arg_0):
        arg_1[arg_2.group('name')] = arg_2.group('content')
    return arg_1

r Get all \ def macro definition from TeX source .


def Func(arg_0, arg_1 = "form"):
        """Return Data Form for the `Register` object.

        Convert legacy fields to a data form if `self.form` is `None`, return `self.form` otherwise.

        :Parameters:
            - `form_type`: If "form", then a form to fill-in should be
              returned. If "sumbit", then a form with submitted data.
        :Types:
            - `form_type`: `unicode`

        :return: `self.form` or a form created from the legacy fields
        :returntype: `pyxmpp.jabber.dataforms.Form`"""

        if arg_0.form:
            if arg_0.form.type != arg_1:
                raise ValueError("Bad form type in the jabber:iq:register element")
            return arg_0.form

        arg_2 = Form(arg_1, instructions = arg_0.instructions)
        arg_2.add_field("FORM_TYPE", [u"jabber:iq:register"], "hidden")
        for arg_3 in legacy_fields:
            arg_4, arg_5 = legacy_fields[arg_3]
            arg_6 = getattr(arg_0, arg_3)
            if arg_6 is None:
                continue
            if arg_1 == "form":
                if not arg_6:
                    arg_6 = None
                arg_2.add_field(name = arg_3, arg_4 = arg_4, label = arg_5,
                        arg_6 = arg_6, required = True)
            else:
                arg_2.add_field(name = arg_3, arg_6 = arg_6)
        return arg_2

Return Data Form for the Register object .


(
        self,
        rm_namespaces=('Template',),
        capital_links=False,
        _code: str = None,
        *,
        code: str = None,
        capitalize=False
    )

def Func(
        arg_0,
        arg_1=('Template',),
        arg_2=False,
        arg_3: arg_4 = None,
        *,
        arg_5: arg_4 = None,
        arg_6=False
    ) -> arg_4:
        """Return normal form of self.name.

        - Remove comments.
        - Remove language code.
        - Remove namespace ("template:" or any of `localized_namespaces`.
        - Use space instead of underscore.
        - Remove consecutive spaces.
        - Use uppercase for the first letter if `capitalize`.
        - Remove #anchor.

        :param rm_namespaces: is used to provide additional localized
            namespaces for the template namespace. They will be removed from
            the result. Default is ('Template',).
        :param capitalize: If True, convert the first letter of the
            template's name to a capital letter. See
            [[mw:Manual:$wgCapitalLinks]] for more info.
        :param code: is the language code.
        :param capital_links: deprecated.
        :param _code: deprecated.

        Example:
            >>> Template(
            ...     '{{ eN : tEmPlAtE : <!-- c --> t_1 # b | a }}'
            ... ).Func(code='en')
            'T 1'
        """
        if arg_2:
            warn('`capital_links` argument is deprecated,'
                 ' use `capitalize` instead', DeprecationWarning)
            arg_6 = arg_2
        if arg_3:
            warn('`positional_code` argument is deprecated,'
                 ' use `code` instead', DeprecationWarning)
            arg_5 = arg_3
        # Remove comments
        arg_7 = COMMENT_SUB('', arg_0.name).strip(WS)
        # Remove code
        if arg_5:
            arg_8, arg_9, arg_10 = arg_7.partition(':')
            if not arg_8 and arg_9:
                arg_7 = arg_10.strip(' ')
                arg_8, arg_9, arg_10 = arg_7.partition(':')
            if arg_5.lower() == arg_8.strip(' ').lower():
                arg_7 = arg_10.strip(' ')
        # Remove namespace
        arg_8, arg_9, arg_10 = arg_7.partition(':')
        if not arg_8 and arg_9:
            arg_7 = arg_10.strip(' ')
            arg_8, arg_9, arg_10 = arg_7.partition(':')
        if arg_8:
            arg_11 = arg_8.strip(' ').lower()
            for arg_12 in arg_1:
                if arg_12.lower() == arg_11:
                    arg_7 = arg_10.strip(' ')
                    break
        # Use space instead of underscore
        arg_7 = arg_7.replace('_', ' ')
        if arg_6:
            # Use uppercase for the first letter
            arg_13 = arg_7[0]
            if arg_13.islower():
                arg_7 = arg_13.upper() + arg_7[1:]
        # Remove #anchor
        arg_7, arg_9, arg_10 = arg_7.partition('#')
        return ' '.join(arg_7.split())

Return normal form of self.name.

        - Remove comments.
        - Remove language code.
        - Remove namespace ("template:" or any of `localized_namespaces`.
        - Use space instead of underscore.
        - Remove consecutive spaces.
        - Use uppercase for the first letter if `capitalize`.
        - Remove #anchor.

        :param rm_namespaces: is used to provide additional localized
            namespaces for the template namespace. They will be removed from
            the result. Default is ('Template',).
        :param capitalize: If True, convert the first letter of the
            template's name to a capital letter. See
            [[mw:Manual:$wgCapitalLinks]] for more info.
        :param code: is the language code.
        :param capital_links: deprecated.
        :param _code: deprecated.

        Example:
            >>> Template(
            ...     '{{ eN : tEmPlAtE : <!-- c --> t_1 # b | a }}'
            ... ).normal_name(code='en')
            'T 1'


(self, image, alpha=0.75, resize="segmentation_map", background_threshold=0.01,
                      background_class_id=None, colors=None, draw_background=False)

def Func ( arg_0 , arg_1 , arg_2 = 0.75 , arg_3 = "segmentation_map" , arg_4 = 0.01 , arg_5 = None , arg_6 = None , arg_7 = False ) : ia . do_assert ( arg_1 . ndim == 3 ) ia . do_assert ( arg_1 . shape [ 2 ] == 3 ) ia . do_assert ( arg_1 . dtype . type == np . uint8 ) ia . do_assert ( 0 - 1e-8 <= arg_2 <= 1.0 + 1e-8 ) ia . do_assert ( arg_3 in [ "segmentation_map" , "image" ] ) if arg_3 == "image" : arg_1 = ia . imresize_single_image ( arg_1 , arg_0 . arr . shape [ 0 : 2 ] , interpolation = "cubic" ) arg_8 , arg_9 = arg_0 . draw ( arg_4 = arg_4 , arg_5 = arg_5 , size = arg_1 . shape [ 0 : 2 ] if arg_3 == "segmentation_map" else None , arg_6 = arg_6 , return_foreground_mask = True ) if arg_7 : arg_10 = np . clip ( ( 1 - arg_2 ) * arg_1 + arg_2 * arg_8 , 0 , 255 ) . astype ( np . uint8 ) else : arg_9 = arg_9 [ ... , np . newaxis ] arg_10 = np . zeros_like ( arg_1 ) arg_10 += ( ~ arg_9 ) . astype ( np . uint8 ) * arg_1 arg_10 += arg_9 . astype ( np . uint8 ) * np . clip ( ( 1 - arg_2 ) * arg_1 + arg_2 * arg_8 , 0 , 255 ) . astype ( np . uint8 ) return arg_10

def Func(arg_0, arg_1, arg_2=0.75, arg_3="segmentation_map", arg_4=0.01,
                      arg_5=None, arg_6=None, arg_7=False):
        """
        Draw the segmentation map as an overlay over an image.

        Parameters
        ----------
        image : (H,W,3) ndarray
            Image onto which to draw the segmentation map. Dtype is expected to be uint8.

        alpha : float, optional
            Alpha/opacity value to use for the mixing of image and segmentation map.
            Higher values mean that the segmentation map will be more visible and the image less visible.

        resize : {'segmentation_map', 'image'}, optional
            In case of size differences between the image and segmentation map, either the image or
            the segmentation map can be resized. This parameter controls which of the two will be
            resized to the other's size.

        background_threshold : float, optional
            See :func:`imgaug.SegmentationMapOnImage.get_arr_int`.

        background_class_id : None or int, optional
            See :func:`imgaug.SegmentationMapOnImage.get_arr_int`.

        colors : None or list of tuple of int, optional
            Colors to use. One for each class to draw. If None, then default colors will be used.

        draw_background : bool, optional
            If True, the background will be drawn like any other class.
            If False, the background will not be drawn, i.e. the respective background pixels
            will be identical with the image's RGB color at the corresponding spatial location
            and no color overlay will be applied.

        Returns
        -------
        mix : (H,W,3) ndarray
            Rendered overlays (dtype is uint8).

        """
        # assert RGB image
        ia.do_assert(arg_1.ndim == 3)
        ia.do_assert(arg_1.shape[2] == 3)
        ia.do_assert(arg_1.dtype.type == np.uint8)

        ia.do_assert(0 - 1e-8 <= arg_2 <= 1.0 + 1e-8)
        ia.do_assert(arg_3 in ["segmentation_map", "image"])

        if arg_3 == "image":
            arg_1 = ia.imresize_single_image(arg_1, arg_0.arr.shape[0:2], interpolation="cubic")

        arg_8, arg_9 = arg_0.draw(
            arg_4=arg_4,
            arg_5=arg_5,
            size=arg_1.shape[0:2] if arg_3 == "segmentation_map" else None,
            arg_6=arg_6,
            return_foreground_mask=True
        )

        if arg_7:
            arg_10 = np.clip(
                (1-arg_2) * arg_1 + arg_2 * arg_8,
                0,
                255
            ).astype(np.uint8)
        else:
            arg_9 = arg_9[..., np.newaxis]
            arg_10 = np.zeros_like(arg_1)
            arg_10 += (~arg_9).astype(np.uint8) * arg_1
            arg_10 += arg_9.astype(np.uint8) * np.clip(
                (1-arg_2) * arg_1 + arg_2 * arg_8,
                0,
                255
            ).astype(np.uint8)
        return arg_10

Draw the segmentation map as an overlay over an image .


def Func ( arg_0 , arg_1 ) : arg_0 . _spec_log += arg_1 arg_2 = os . path . join ( arg_0 . root_directory , ( "%s.log" % arg_0 . batch_name ) ) core . Log . write_log ( arg_2 , [ arg_4 for ( arg_3 , arg_4 ) in arg_1 ] , allow_append = True )

def Func(arg_0, arg_1):
        """
        The log contains the tids and corresponding specifications
        used during launch with the specifications in JSON format.
        """
        arg_0._spec_log += arg_1 # This should be removed
        arg_2 = os.path.join(arg_0.root_directory, ("%s.log" % arg_0.batch_name))
        core.Log.write_log(arg_2, [arg_4 for (arg_3, arg_4) in arg_1], allow_append=True)

The log contains the tids and corresponding specifications used during launch with the specifications in JSON format .


def Func(arg_0, arg_1):
        """dump a knitting pattern to a file."""
        arg_2 = arg_0.__on_dump()
        arg_3 = arg_2.patterns.at(0)
        arg_4 = GridLayout(arg_3)
        arg_5 = AYABPNGBuilder(*arg_4.bounding_box)
        arg_5.set_colors_in_grid(arg_4.walk_instructions())
        arg_5.write_to_file(arg_1)


def Func(arg_0):
        """
        ARM kernel helpers

        https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt
        """

        arg_1 = bytearray(b'\xf1\xde\xfd\xe7' * 1024)

        # Extracted from a RPi2
        arg_2 = binascii.unhexlify(
            'ff0300ea' +
            '650400ea' +
            'f0ff9fe5' +
            '430400ea' +
            '220400ea' +
            '810400ea' +
            '000400ea' +
            '870400ea'
        )

        # XXX(yan): The following implementations of cmpxchg and cmpxchg64 were
        # handwritten to not use any exclusive instructions (e.g. ldrexd) or
        # locking. For actual implementations, refer to
        # arch/arm64/kernel/kuser32.S in the Linux source code.
        arg_3 = binascii.unhexlify(
            '30002de9' +  # push    {r4, r5}
            '08c09de5' +  # ldr     ip, [sp, #8]
            '30009ce8' +  # ldm     ip, {r4, r5}
            '010055e1' +  # cmp     r5, r1
            '00005401' +  # cmpeq   r4, r0
            '0100a013' +  # movne   r0, #1
            '0000a003' +  # moveq   r0, #0
            '0c008c08' +  # stmeq   ip, {r2, r3}
            '3000bde8' +  # pop     {r4, r5}
            '1eff2fe1'   # bx      lr
        )

        arg_4 = binascii.unhexlify(
            '5bf07ff5' +  # dmb ish
            '1eff2fe1'   # bx lr
        )

        arg_5 = binascii.unhexlify(
            '003092e5' +  # ldr     r3, [r2]
            '000053e1' +  # cmp     r3, r0
            '0000a003' +  # moveq   r0, #0
            '00108205' +  # streq   r1, [r2]
            '0100a013' +  # movne   r0, #1
            '1eff2fe1'   # bx      lr
        )

        # Map a TLS segment
        arg_0._arm_tls_memory = arg_0.current.memory.mmap(None, 4, 'rw ')

        arg_7 = binascii.unhexlify(
            '04009FE5' +  # ldr r0, [pc, #4]
            '010090e8' +  # ldm r0, {r0}
            '1eff2fe1'   # bx lr
        ) + struct.pack('<I', arg_0._arm_tls_memory)

        arg_8 = b'\x00' * 12

        arg_9 = struct.pack('<I', 5)

        def update(arg_10, arg_11):
            arg_1[arg_10:arg_10 + arg_12(arg_11)] = arg_11

        # Offsets from Documentation/arm/kernel_user_helpers.txt in Linux
        update(0x000, arg_2)
        update(0xf60, arg_3)
        update(0xfa0, arg_4)
        update(0xfc0, arg_5)
        update(0xfe0, arg_7)
        update(0xff0, arg_8)
        update(0xffc, arg_9)

        arg_0.current.memory.mmap(0xffff0000, arg_12(arg_1), 'r x', arg_1)


def Func(arg_0, arg_1):
        """
        Handle a base case.

        :param type klass: the class constructor
        :param str symbol: the type code
        """

        def the_func(arg_2, arg_3=0):
            """
            Base case.

            :param int variant: variant level for this object
            :returns: a tuple of a dbus object and the variant level
            :rtype: dbus object * int
            """
            (arg_4, arg_5) = _ToDbusXformer._variant_levels(
                0, arg_3)
            return (arg_0(arg_2, variant_level=arg_4), arg_5)

        return lambda: (the_func, arg_1)


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , RDD ) : arg_1 = _to_java_object_rdd ( arg_1 ) elif isinstance ( arg_1 , DataFrame ) : arg_1 = arg_1 . _jdf elif isinstance ( arg_1 , SparkContext ) : arg_1 = arg_1 . _jsc elif isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = ListConverter ( ) . convert ( [ Func ( arg_0 , x ) for x in arg_1 ] , arg_0 . _gateway_client ) elif isinstance ( arg_1 , dict ) : arg_2 = { } for ( arg_3 , arg_4 ) in arg_1 . items ( ) : arg_2 [ arg_3 ] = Func ( arg_0 , arg_4 ) arg_1 = MapConverter ( ) . convert ( arg_2 , arg_0 . _gateway_client ) elif isinstance ( arg_1 , JavaValue ) : arg_1 = arg_1 . value elif isinstance ( arg_1 , JavaObject ) : pass elif isinstance ( arg_1 , ( int , long , float , bool , bytes , unicode ) ) : pass else : arg_5 = bytearray ( PickleSerializer ( ) . dumps ( arg_1 ) ) arg_1 = arg_0 . jvm . org . apache . spark . bigdl . api . python . BigDLSerDe . loads ( arg_5 ) return arg_1

def Func(arg_0, arg_1):
    """ Convert Python object into Java """
    if isinstance(arg_1, RDD):
        arg_1 = _to_java_object_rdd(arg_1)
    elif isinstance(arg_1, DataFrame):
        arg_1 = arg_1._jdf
    elif isinstance(arg_1, SparkContext):
        arg_1 = arg_1._jsc
    elif isinstance(arg_1, (list, tuple)):
        arg_1 = ListConverter().convert([Func(arg_0, x) for x in arg_1],
                                      arg_0._gateway_client)
    elif isinstance(arg_1, dict):
        arg_2 = {}
        for (arg_3, arg_4) in arg_1.items():
            arg_2[arg_3] = Func(arg_0, arg_4)
        arg_1 = MapConverter().convert(arg_2, arg_0._gateway_client)
    elif isinstance(arg_1, JavaValue):
        arg_1 = arg_1.value
    elif isinstance(arg_1, JavaObject):
        pass
    elif isinstance(arg_1, (int, long, float, bool, bytes, unicode)):
        pass
    else:
        arg_5 = bytearray(PickleSerializer().dumps(arg_1))
        arg_1 = arg_0.jvm.org.apache.spark.bigdl.api.python.BigDLSerDe.loads(arg_5)
    return arg_1


def
Func
(
arg_0
)
:
with
arg_0
.
_lock
:
logger
.
debug
(
"Func()"
)
if
arg_0
.
_socket
is
:
return
while
True
:
try
:
arg_1
,
arg_2
=
arg_0
.
_socket
.
accept
(
)
except
socket
.
error
,
err
:
if
err
.
args
[
0
]
in
BLOCKING_ERRORS
:
break
else
:
raise
logger
.
debug
(
"Accepted connection from: {0!r}"
.
format
(
arg_2
)
)
arg_0
.
_target
(
arg_1
,
arg_2
)

def Func(arg_0):
        """
        Accept any incoming connections.
        """
        with arg_0._lock:
            logger.debug("Func()")
            if arg_0._socket is None:
                return
            while True:
                try:
                    arg_1, arg_2 = arg_0._socket.accept()
                except socket.error, err:
                    if err.args[0] in BLOCKING_ERRORS:
                        break
                    else:
                        raise
                logger.debug("Accepted connection from: {0!r}".format(arg_2))
                arg_0._target(arg_1, arg_2)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
if
six
.
callable
(
arg_0
)
:
return
arg_0
(
arg_1
)
elif
(
isinstance
(
arg_0
,
(
six
.
string_types
,
tuple
)
)
or
np
.
isscalar
(
arg_0
)
)
:
return
scipy
.
signal
.
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_2
)
elif
isinstance
(
arg_0
,
(
np
.
ndarray
,
list
)
)
:
if
len
(
arg_0
)
==
arg_1
:
return
np
.
asarray
(
arg_0
)
raise
ParameterError
(
'Window size mismatch: '
'{:d} != {:d}'
.
format
(
len
(
arg_0
)
,
arg_1
)
)
else
:
raise
ParameterError
(
'Invalid window specification: {}'
.
format
(
arg_0
)
)

def Func(arg_0, arg_1, arg_2=True):
    '''Compute a window function.

    This is a wrapper for `scipy.signal.Func` that additionally
    supports callable or pre-computed windows.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        The window specification:

        - If string, it's the name of the window function (e.g., `'hann'`)
        - If tuple, it's the name of the window function and any parameters
          (e.g., `('kaiser', 4.0)`)
        - If numeric, it is treated as the beta parameter of the `'kaiser'`
          window, as in `scipy.signal.Func`.
        - If callable, it's a function that accepts one integer argument
          (the window length)
        - If list-like, it's a pre-computed window of the correct length `Nx`

    Nx : int > 0
        The length of the window

    fftbins : bool, optional
        If True (default), create a periodic window for use with FFT
        If False, create a symmetric window for filter design applications.

    Returns
    -------
    Func : np.ndarray
        A window of length `Nx` and type `window`

    See Also
    --------
    scipy.signal.Func

    Notes
    -----
    This function caches at level 10.

    Raises
    ------
    ParameterError
        If `window` is supplied as a vector of length != `n_fft`,
        or is otherwise mis-specified.
    '''
    if six.callable(arg_0):
        return arg_0(arg_1)

    elif (isinstance(arg_0, (six.string_types, tuple)) or
          np.isscalar(arg_0)):
        # TODO: if we add custom window functions in librosa, call them here

        return scipy.signal.Func(arg_0, arg_1, arg_2=arg_2)

    elif isinstance(arg_0, (np.ndarray, list)):
        if len(arg_0) == arg_1:
            return np.asarray(arg_0)

        raise ParameterError('Window size mismatch: '
                             '{:d} != {:d}'.format(len(arg_0), arg_1))
    else:
        raise ParameterError('Invalid window specification: {}'.format(arg_0))

Compute a window function.

    This is a wrapper for `scipy.signal.get_window` that additionally
    supports callable or pre-computed windows.

    Parameters
    ----------
    window : string, tuple, number, callable, or list-like
        The window specification:

        - If string, it's the name of the window function (e.g., `'hann'`)
        - If tuple, it's the name of the window function and any parameters
          (e.g., `('kaiser', 4.0)`)
        - If numeric, it is treated as the beta parameter of the `'kaiser'`
          window, as in `scipy.signal.get_window`.
        - If callable, it's a function that accepts one integer argument
          (the window length)
        - If list-like, it's a pre-computed window of the correct length `Nx`

    Nx : int > 0
        The length of the window

    fftbins : bool, optional
        If True (default), create a periodic window for use with FFT
        If False, create a symmetric window for filter design applications.

    Returns
    -------
    get_window : np.ndarray
        A window of length `Nx` and type `window`

    See Also
    --------
    scipy.signal.get_window

    Notes
    -----
    This function caches at level 10.

    Raises
    ------
    ParameterError
        If `window` is supplied as a vector of length != `n_fft`,
        or is otherwise mis-specified.


return {
            'merged_config_include': self.config_include_file,
               'merged_config_json': self.config_json_file,
               'build_info_include': self.build_info_include_file
        }

def Func(arg_0, arg_1, arg_2):
        ''' Ensure all config-time files have been generated. Return a
            dictionary of generated items.
        '''
        arg_3 = {}

        arg_4 = arg_0.buildroot

        # only dependencies which are actually valid can contribute to the
        # config data (which includes the versions of all dependencies in its
        # build info) if the dependencies aren't available we can't tell what
        # version they are. Anything missing here should always be a test
        # dependency that isn't going to be used, otherwise the yotta build
        # command will fail before we get here
        arg_5 = OrderedDict((k, v) for k, v in arg_2.items() if v)

        arg_0.set_toplevel_definitions = ''
        if arg_0.build_info_include_file is None:
            arg_0.build_info_include_file, arg_8 = arg_0.getBuildInfo(arg_1.path, arg_4)
            arg_0.set_toplevel_definitions += arg_8

        if arg_0.config_include_file is None:
            arg_0.config_include_file, arg_10, arg_0.config_json_file = arg_0._getConfigData(arg_5, arg_1, arg_4, arg_0.build_info_include_file)
            arg_0.set_toplevel_definitions += arg_10

        arg_0.Funcd = True
        return {
            'merged_config_include': arg_0.config_include_file,
               'merged_config_json': arg_0.config_json_file,
               'build_info_include': arg_0.build_info_include_file
        }

Ensure all config - time files have been generated . Return a dictionary of generated items .


def Func(arg_0, arg_1):
    """Clone a repository."""
    arg_2 = None
    if arg_0[:4] == "git@" or arg_0[-4:] == ".git":
        arg_2 = Git(arg_1)
    if arg_0[:6] == "svn://":
        arg_2 = Svn(arg_1)
    if arg_0[:6] == "bzr://":
        arg_2 = Bzr(arg_1)
    if arg_0[:9] == "ssh://hg@":
        arg_2 = Hg(arg_1)

    if arg_2 is None:
        raise RepositoryAdapterNotFound(
            "Can't find adapter for `%s` repository url" % arg_0)

    return arg_2.Func(arg_0)


def Func ( arg_0 , arg_1 ) : arg_2 = getattr ( hashlib , arg_1 ) ( ) arg_2 . update ( arg_0 . data ) return arg_2 . hexdigest ( )

def Func(arg_0, arg_1):
        """
        Get hash of the given data.

        :param algo: The algorithm to use.
        :type algo: str
        """

        # We het the algorithm function.
        arg_2 = getattr(hashlib, arg_1)()

        # We set the data into our hashlib.
        arg_2.update(arg_0.data)

        # And we extract and return the hash.
        return arg_2.hexdigest()


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
regularizers
.
from_kwargs
(
arg_0
,
**
arg_2
)
arg_4
=
arg_0
.
_hash
(
arg_3
)
if
arg_4
not
in
arg_0
.
_functions
:
arg_5
,
arg_6
=
arg_0
.
build_graph
(
arg_3
)
arg_7
,
arg_8
=
list
(
arg_5
.
keys
(
)
)
,
list
(
arg_5
.
values
(
)
)
util
.
log
(
'compiling Func function'
)
arg_0
.
_functions
[
arg_4
]
=
(
arg_7
,
theano
.
function
(
arg_0
.
inputs
,
arg_8
,
arg_6
=
arg_6
)
)
arg_7
,
arg_10
=
arg_0
.
_functions
[
arg_4
]
return
dict
(
zip
(
arg_7
,
arg_10
(
arg_1
)
)
)

def Func(arg_0, arg_1, **arg_2):
        '''Compute a forward pass of all layers from the given input.

        All keyword arguments are passed directly to :func:`build_graph`.

        Parameters
        ----------
        x : ndarray (num-examples, num-variables)
            An array containing data to be fed into the network. Multiple
            examples are arranged as rows in this array, with columns containing
            the variables for each example.

        Returns
        -------
        layers : list of ndarray (num-examples, num-units)
            The activation values of each layer in the the network when given
            input `x`. For each of the hidden layers, an array is returned
            containing one row per input example; the columns of each array
            correspond to units in the respective layer. The "output" of the
            network is the last element of this list.
        '''
        arg_3 = regularizers.from_kwargs(arg_0, **arg_2)
        arg_4 = arg_0._hash(arg_3)
        if arg_4 not in arg_0._functions:
            arg_5, arg_6 = arg_0.build_graph(arg_3)
            arg_7, arg_8 = list(arg_5.keys()), list(arg_5.values())
            util.log('compiling Func function')
            arg_0._functions[arg_4] = (arg_7, theano.function(
                arg_0.inputs, arg_8, arg_6=arg_6))
        arg_7, arg_10 = arg_0._functions[arg_4]
        return dict(zip(arg_7, arg_10(arg_1)))

Compute a forward pass of all layers from the given input .


def Func ( arg_0 ) : from invenio_records_ui . views import create_url_rule arg_1 = Blueprint ( 'invenio_deposit_ui' , __name__ , static_folder = '../static' , template_folder = '../templates' , url_prefix = '' , ) @ arg_1 . errorhandler ( PIDDeletedError ) def tombstone_errorhandler ( arg_2 ) : return render_template ( current_app . config [ 'DEPOSIT_UI_TOMBSTONE_TEMPLATE' ] , pid = arg_2 . pid , record = arg_2 . record or { } , ) , 410 for arg_3 , arg_4 in ( arg_0 or { } ) . items ( ) : arg_4 = deepcopy ( arg_4 ) arg_4 . pop ( 'jsonschema' , None ) arg_4 . pop ( 'schemaform' , None ) arg_1 . add_url_rule ( ** create_url_rule ( arg_3 , ** arg_4 ) ) @ arg_1 . route ( '/deposit' ) @ login_required def index ( ) : return render_template ( current_app . config [ 'DEPOSIT_UI_INDEX_TEMPLATE' ] ) @ arg_1 . route ( '/deposit/new' ) @ login_required def new ( ) : arg_5 = request . values . get ( 'type' ) return render_template ( current_app . config [ 'DEPOSIT_UI_NEW_TEMPLATE' ] , record = { '_deposit' : { 'id' : None } } , jsonschema = current_deposit . jsonschemas [ arg_5 ] , schemaform = current_deposit . schemaforms [ arg_5 ] , ) return arg_1

def Func(arg_0):
    """Create Invenio-Deposit-UI blueprint.

    See: :data:`invenio_deposit.config.DEPOSIT_RECORDS_UI_ENDPOINTS`.

    :param endpoints: List of endpoints configuration.
    :returns: The configured blueprint.
    """
    from invenio_records_ui.views import create_url_rule

    arg_1 = Blueprint(
        'invenio_deposit_ui',
        __name__,
        static_folder='../static',
        template_folder='../templates',
        url_prefix='',
    )

    @arg_1.errorhandler(PIDDeletedError)
    def tombstone_errorhandler(arg_2):
        """Render tombstone page."""
        return render_template(
            current_app.config['DEPOSIT_UI_TOMBSTONE_TEMPLATE'],
            pid=arg_2.pid,
            record=arg_2.record or {},
        ), 410

    for arg_3, arg_4 in (arg_0 or {}).items():
        arg_4 = deepcopy(arg_4)
        arg_4.pop('jsonschema', None)
        arg_4.pop('schemaform', None)
        arg_1.add_url_rule(**create_url_rule(arg_3, **arg_4))

    @arg_1.route('/deposit')
    @login_required
    def index():
        """List user deposits."""
        return render_template(current_app.config['DEPOSIT_UI_INDEX_TEMPLATE'])

    @arg_1.route('/deposit/new')
    @login_required
    def new():
        """Create new deposit."""
        arg_5 = request.values.get('type')
        return render_template(
            current_app.config['DEPOSIT_UI_NEW_TEMPLATE'],
            record={'_deposit': {'id': None}},
            jsonschema=current_deposit.jsonschemas[arg_5],
            schemaform=current_deposit.schemaforms[arg_5],
        )

    return arg_1

Create Invenio - Deposit - UI blueprint .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_0 . get_key ( arg_1 , arg_2 ) return arg_3 . get ( ) [ 'Body' ] . read ( ) . decode ( 'utf-8' )

def Func(arg_0, arg_1, arg_2=None):
        """
        Reads a key from S3

        :param key: S3 key that will point to the file
        :type key: str
        :param bucket_name: Name of the bucket in which the file is stored
        :type bucket_name: str
        """

        arg_3 = arg_0.get_key(arg_1, arg_2)
        return arg_3.get()['Body'].read().decode('utf-8')


Create a new version under this service.

def Func ( arg_0 ) : arg_1 = Version ( ) arg_1 . conn = arg_0 . conn arg_1 . attrs = { 'service_id' : arg_0 . attrs [ 'id' ] , } arg_1 . save ( ) return arg_1

def Func(arg_0):
        """ Create a new Func under this service. """
        arg_1 = Version()
        arg_1.conn = arg_0.conn

        arg_1.attrs = {
            # Parent params
            'service_id': arg_0.attrs['id'],
        }

        arg_1.save()

        return arg_1

Create a new version under this service .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 . Funcor is None : return arg_1 else : return arg_0 . Funcor ( arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        A function to be called after the augmentation of images was
        performed.

        Returns
        -------
        (N,H,W,C) ndarray or (N,H,W) ndarray or list of (H,W,C) ndarray or list of (H,W) ndarray
            The input images, optionally modified.

        """
        if arg_0.Funcor is None:
            return arg_1
        else:
            return arg_0.Funcor(arg_1, arg_2, arg_3)

A function to be called after the augmentation of images was performed .


def Func(arg_0):
    """
    Tries to read the file using dicom.read_file,
    if the file exists and dicom.read_file does not raise
    and Exception returns True. False otherwise.

    :param filepath: str
     Path to DICOM file

    :return: bool
    """
    if not os.path.exists(arg_0):
        raise IOError('File {} not found.'.format(arg_0))

    arg_1 = os.path.basename(arg_0)
    if arg_1 == 'DICOMDIR':
        return False

    try:
        arg_2 = dicom.read_file(arg_0)
    except Exception as exc:
        log.debug('Checking if {0} was a DICOM, but returned '
                  'False.'.format(arg_0))
        return False

    return True

Tries to read the file using dicom . read_file if the file exists and dicom . read_file does not raise and Exception returns True . False otherwise .


def Func ( arg_0 ) : if arg_0 . connection : with arg_0 . wrap_database_errors : arg_0 . connection . client . close ( )

def Func(arg_0):
        """
        Closes the client connection to the database.
        """
        if arg_0.connection:
            with arg_0.wrap_database_errors:
                arg_0.connection.client.close()

Closes the client connection to the database .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . problem for arg_3 in arg_0 . metabolites : arg_4 = arg_2 . Variable ( "s_plus_" + arg_3 . id , lb = 0 ) arg_5 = arg_2 . Variable ( "s_minus_" + arg_3 . id , lb = 0 ) arg_0 . add_cons_vars ( [ arg_4 , arg_5 ] ) arg_0 . constraints [ arg_3 . id ] . set_linear_coefficients ( { arg_4 : 1.0 , arg_5 : - 1.0 } ) arg_1 . append ( arg_4 ) arg_1 . append ( arg_5 ) arg_0 . objective = arg_2 . Objective ( Zero , sloppy = True , direction = "min" ) arg_0 . objective . set_linear_coefficients ( { arg_7 : 1.0 for arg_7 in arg_1 } )

def Func(arg_0):
    """
    Add a new objective and variables to ensure a feasible solution.

    The optimized objective will be zero for a feasible solution and otherwise
    represent the distance from feasibility (please see [1]_ for more
    information).

    Parameters
    ----------
    model : cobra.Model
        The model whose feasibility is to be tested.

    References
    ----------
    .. [1] Gomez, Jose A., Kai Höffner, and Paul I. Barton.
    “DFBAlab: A Fast and Reliable MATLAB Code for Dynamic Flux Balance
    Analysis.” BMC Bioinformatics 15, no. 1 (December 18, 2014): 409.
    https://doi.org/10.1186/s12859-014-0409-8.

    """

    arg_1 = []
    arg_2 = arg_0.problem
    for arg_3 in arg_0.metabolites:
        arg_4 = arg_2.Variable("s_plus_" + arg_3.id, lb=0)
        arg_5 = arg_2.Variable("s_minus_" + arg_3.id, lb=0)

        arg_0.add_cons_vars([arg_4, arg_5])
        arg_0.constraints[arg_3.id].set_linear_coefficients(
            {arg_4: 1.0, arg_5: -1.0})
        arg_1.append(arg_4)
        arg_1.append(arg_5)

    arg_0.objective = arg_2.Objective(Zero, sloppy=True, direction="min")
    arg_0.objective.set_linear_coefficients({arg_7: 1.0 for arg_7 in arg_1})

Add a new objective and variables to ensure a feasible solution .


def Func(arg_0, arg_1=arg_2.GA_ReadOnly):
    """Returns a Raster instance.

    Arguments:
    path -- local or remote path as str or file-like object
    Keyword args:
    mode -- gdal constant representing access mode
    """
    arg_0 = getattr(arg_0, 'name', arg_0)
    try:
        return Raster(vsiprefix(arg_0), arg_1)
    except AttributeError:
        try:
            arg_4 = arg_0.read()
        except AttributeError:
            raise TypeError('Not a file-like object providing read()')
        else:
            arg_5 = MemFileIO(delete=False)
            gdal.FileFromMemBuffer(arg_5.name, arg_4)
            return Raster(arg_5, arg_1)
    raise ValueError('Failed to Func raster from "%r"' % arg_0)


(self, datacenter_id, server_id,
                             nic_id, firewall_rule_id, **kwargs)

def Func(arg_0, arg_1, arg_2,
                             arg_3, arg_4, **arg_5):
        """
        Updates a firewall rule.

        :param      datacenter_id: The unique ID of the data center.
        :type       datacenter_id: ``str``

        :param      server_id: The unique ID of the server.
        :type       server_id: ``str``

        :param      nic_id: The unique ID of the NIC.
        :type       nic_id: ``str``

        :param      firewall_rule_id: The unique ID of the firewall rule.
        :type       firewall_rule_id: ``str``

        """
        arg_6 = {}

        for arg_7, arg_8 in arg_5.items():
            arg_6[arg_0._underscore_to_camelcase(arg_7)] = arg_8

            if arg_7 == 'source_mac':
                arg_6['sourceMac'] = arg_8
            elif arg_7 == 'source_ip':
                arg_6['sourceIp'] = arg_8
            elif arg_7 == 'target_ip':
                arg_6['targetIp'] = arg_8
            elif arg_7 == 'port_range_start':
                arg_6['portRangeStart'] = arg_8
            elif arg_7 == 'port_range_end':
                arg_6['portRangeEnd'] = arg_8
            elif arg_7 == 'icmp_type':
                arg_6['icmpType'] = arg_8
            elif arg_7 == 'icmp_code':
                arg_6['icmpCode'] = arg_8
            else:
                arg_6[arg_0._underscore_to_camelcase(arg_7)] = arg_8

        arg_10 = arg_0._perform_request(
            url='/datacenters/%s/servers/%s/nics/%s/firewallrules/%s' % (
                arg_1,
                arg_2,
                arg_3,
                arg_4),
            method='PATCH',
            arg_6=json.dumps(arg_6))

        return arg_10


Return a list of UUIDs for services that are advertised by this
        device.

return [uuid.UUID(str(x)) for x in uuids]

def Func(arg_0):
        """Return a list of UUIDs for services that are Func by this
        device.
        """
        arg_1 = []
        # Get UUIDs property but wrap it in a try/except to catch if the property
        # doesn't exist as it is optional.
        try:
            arg_1 = arg_0._props.Get(_INTERFACE, 'UUIDs')
        except dbus.exceptions.DBusException as ex:
            # Ignore error if device has no UUIDs property (i.e. might not be
            # a BLE device).
            if ex.get_dbus_name() != 'org.freedesktop.DBus.Error.InvalidArgs':
                raise ex
        return [uuid.UUID(str(arg_2)) for arg_2 in arg_1]

Return a list of UUIDs for services that are advertised by this device .


def Func(arg_0, arg_1):
    """
    Adds a new segment on a cell.

    :param cell: (int) Cell index
    :returns: (int) New segment index
    """
    arg_2 = arg_0._cells[arg_1]

    if len(arg_0._freeFlatIdxs) > 0:
      arg_3 = arg_0._freeFlatIdxs.pop()
    else:
      arg_3 = arg_0._nextFlatIdx
      arg_0._segmentForFlatIdx.append(None)
      arg_0._nextFlatIdx += 1

    arg_4 = arg_0._nextSegmentOrdinal
    arg_0._nextSegmentOrdinal += 1

    arg_5 = Segment(arg_1, arg_3, arg_4)
    arg_2._segments.append(arg_5)
    arg_0._segmentForFlatIdx[arg_3] = arg_5

    return arg_5


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = TitleQuery ( arg_1 , ** arg_2 ) @ arg_0 . synchronize ( wait = arg_3 . wait ) def Func ( ) : if arg_3 . resolves_for ( arg_0 ) : raise ExpectationNotMet ( arg_3 . negative_failure_message ) return True return Func ( )

def Func(arg_0, arg_1, **arg_2):
        """
        Asserts that the page doesn't have the given title.

        Args:
            title (str | RegexObject): The string that the title should include.
            **kwargs: Arbitrary keyword arguments for :class:`TitleQuery`.

        Returns:
            True

        Raises:
            ExpectationNotMet: If the assertion hasn't succeeded during the wait time.
        """

        arg_3 = TitleQuery(arg_1, **arg_2)

        @arg_0.synchronize(wait=arg_3.wait)
        def Func():
            if arg_3.resolves_for(arg_0):
                raise ExpectationNotMet(arg_3.negative_failure_message)

            return True

        return Func()

Asserts that the page doesn t have the given title .


def Func ( arg_0 ) : arg_1 , arg_2 = zip ( * arg_0 . items ( ) ) return dict ( zip ( arg_2 , arg_1 ) )

def Func(arg_0):
	"""
	For every key, value pair, return the mapping for the
	equivalent value, key pair

	>>> Func({'a': 'b'}) == {'b': 'a'}
	True
	"""
	arg_1, arg_2 = zip(*arg_0.items())
	return dict(zip(arg_2, arg_1))

For every key, value pair, return the mapping for the
	equivalent value, key pair

	>>> reverse_mapping({'a': 'b'}) == {'b': 'a'}
	True

For every key value pair return the mapping for the equivalent value key pair


def
Func
(
arg_0
,
arg_1
=
True
)
:
if
arg_0
.
_context
is
:
arg_0
.
_logger
.
debug
(
'Starting Client'
)
arg_0
.
_context
=
zmq
.
Context
(
)
arg_0
.
_poll
=
zmq
.
Poller
(
)
arg_0
.
_Func_socket
(
)
if
arg_1
:
arg_0
.
test_ping
(
)

def Func(arg_0, arg_1=True):
        """Starts connection to server if not existent.

        NO-OP if connection is already established.
        Makes ping-pong test as well if desired.

        """
        if arg_0._context is None:
            arg_0._logger.debug('Starting Client')
            arg_0._context = zmq.Context()
            arg_0._poll = zmq.Poller()
            arg_0._Func_socket()
            if arg_1:
                arg_0.test_ping()

Starts connection to server if not existent .


def Func ( arg_0 , arg_1 ) -> List [ str ] : arg_2 = [ ] arg_2 = read_lines_from_file ( arg_1 ) return arg_2

def Func(arg_0, arg_1) -> List[str]:
        """ Loads the content of the text file """
        arg_2 = []
        arg_2 = read_lines_from_file(arg_1)
        return arg_2


return {k: self.decode_date(v) for k, v in val.iteritems()}

def Func ( arg_0 , arg_1 ) : return { arg_2 : arg_0 . decode_date ( arg_3 ) for arg_2 , arg_3 in arg_1 . iteritems ( ) }

def Func(arg_0, arg_1):
    """Handles decoding of nested date strings."""
    return {arg_2: arg_0.decode_date(arg_3) for arg_2, arg_3 in arg_1.iteritems()}

Handles decoding of nested date strings .


def Func ( arg_0 ) : arg_1 = itertools . chain ( [ arg_0 . opcode ] , arg_0 . args ) arg_2 = ARG_SEP . join ( arg_0 . Func_arg ( arg ) for arg in arg_1 ) return arg_2 + INST_TERM

def Func(arg_0):
        """
        Prepare the instruction to be sent over the wire.

        :return: str
        """
        arg_1 = itertools.chain([arg_0.opcode], arg_0.args)

        arg_2 = ARG_SEP.join(arg_0.Func_arg(arg) for arg in arg_1)

        return arg_2 + INST_TERM

Prepare the instruction to be sent over the wire .


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in arg_0 . items ( ) : if arg_3 in arg_1 : arg_2 [ arg_3 ] = arg_4 elif isinstance ( arg_4 , int ) or arg_4 : arg_2 [ arg_3 ] = arg_4 return arg_2

def Func(arg_0, arg_1):
  """Return a new dict with any empty items removed.

  Note that this is not a deep check. If d contains a dictionary which
  itself contains empty items, those are never checked.

  This method exists to make to_serializable() functions cleaner.
  We could revisit this some day, but for now, the serialized objects are
  stripped of empty values to keep the output YAML more compact.

  Args:
    d: a dictionary
    required: list of required keys (for example, TaskDescriptors always emit
      the "task-id", even if None)

  Returns:
    A dictionary with empty items removed.
  """

  arg_2 = {}
  for arg_3, arg_4 in arg_0.items():
    if arg_3 in arg_1:
      arg_2[arg_3] = arg_4
    elif isinstance(arg_4, int) or arg_4:
      # "if v" would suppress emitting int(0)
      arg_2[arg_3] = arg_4

  return arg_2

Return a new dict with any empty items removed .


async def Func ( arg_0 ) : arg_1 = arg_0 . get_tasks ( ) arg_0 . _gathered_tasks = asyncio . gather ( * arg_1 , loop = arg_0 . loop ) try : await arg_0 . _gathered_tasks except CancelledError : pass

async def Func(arg_0):
        """ Run the tasks attached to the instance """
        arg_1 = arg_0.get_tasks()
        arg_0._gathered_tasks = asyncio.gather(*arg_1, loop=arg_0.loop)
        try:
            await arg_0._gathered_tasks
        except CancelledError:
            pass


def Func ( arg_0 ) : if re . match ( r'^(\d+)$' , arg_0 ) is not None : return ( "0.0.0.0" , int ( arg_0 ) ) if re . match ( r'^(\w+)://' , arg_0 ) is None : arg_0 = "//" + arg_0 arg_1 = parse . urlparse ( arg_0 ) arg_2 = arg_1 . hostname or "0.0.0.0" arg_3 = arg_1 . port or 0 return ( arg_2 , arg_3 )

def Func(arg_0):
    """Parses host name and port number from a string.
    """
    if re.match(r'^(\d+)$', arg_0) is not None:
        return ("0.0.0.0", int(arg_0))
    if re.match(r'^(\w+)://', arg_0) is None:
        arg_0 = "//" + arg_0
    arg_1 = parse.urlparse(arg_0)
    arg_2 = arg_1.hostname or "0.0.0.0"
    arg_3 = arg_1.port or 0
    return (arg_2, arg_3)

Parses host name and port number from a string .


def Func ( ) : arg_0 = False arg_1 = get_counts ( ) if arg_1 [ "classes" ] < 1 and arg_1 [ "modules" ] < 1 : arg_0 = arg_1 [ "tests" ] > 0 else : arg_0 = arg_1 [ "classes" ] <= 1 and arg_1 [ "modules" ] <= 1 return arg_0

def Func():
    """Returns True if only a single class is being run or some tests within a single class"""
    arg_0 = False
    arg_1 = get_counts()
    if arg_1["classes"] < 1 and arg_1["modules"] < 1:
        arg_0 = arg_1["tests"] > 0
    else:
        arg_0 = arg_1["classes"] <= 1 and arg_1["modules"] <= 1
    return arg_0


def Func ( arg_0 , arg_1 = True ) : if arg_0 is None : if arg_1 : return "" else : return None elif isinstance ( arg_0 , text_type ) : return arg_0 else : return text_type ( arg_0 )

def Func(arg_0, arg_1=True):
    """Wrapper around six.text_type to convert None to empty string"""
    if arg_0 is None:
        if arg_1:
            return ""
        else:
            return None
    elif isinstance(arg_0, text_type):
        return arg_0
    else:
        return text_type(arg_0)

Wrapper around six . text_type to convert None to empty string


def
Func
(
arg_0
)
:
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
>
1
:
cij
.
emph
(
"rnr:CONF {"
)
for
arg_1
in
sorted
(
arg_0
[
"conf"
]
.
keys
(
)
)
:
cij
.
emph
(
"  % 16s: %r"
%
(
arg_1
,
arg_0
[
"conf"
]
[
arg_1
]
)
)
cij
.
emph
(
"}"
)
if
arg_0
[
"conf"
]
[
"VERBOSE"
]
:
cij
.
emph
(
"rnr:INFO {"
)
cij
.
emph
(
"  OUTPUT: %r"
%
arg_0
[
"conf"
]
[
"OUTPUT"
]
)
cij
.
emph
(
"  yml_fpath: %r"
%
yml_fpath
(
arg_0
[
"conf"
]
[
"OUTPUT"
]
)
)
cij
.
emph
(
"}"
)

def Func(arg_0):
    """Print essential info on"""

    if arg_0["conf"]["VERBOSE"] > 1:               # Print environment variables
        cij.emph("rnr:CONF {")
        for arg_1 in sorted(arg_0["conf"].keys()):
            cij.emph("  % 16s: %r" % (arg_1, arg_0["conf"][arg_1]))
        cij.emph("}")

    if arg_0["conf"]["VERBOSE"]:
        cij.emph("rnr:INFO {")
        cij.emph("  OUTPUT: %r" % arg_0["conf"]["OUTPUT"])
        cij.emph("  yml_fpath: %r" % yml_fpath(arg_0["conf"]["OUTPUT"]))
        cij.emph("}")


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'raw' , False ) if arg_2 : for arg_3 in arg_0 : publish_json ( arg_3 ) else : display ( * arg_0 , include = [ 'text/plain' , 'application/json' ] )

def Func(*arg_0, **arg_1):
    """Display the JSON representation of an object.

    Note that not many frontends support displaying JSON.

    Parameters
    ----------
    objs : tuple of objects
        The Python objects to display, or if raw=True raw json data to
        display.
    raw : bool
        Are the data objects raw data or Python objects that need to be
        formatted before display? [default: False]
    """
    arg_2 = arg_1.pop('raw',False)
    if arg_2:
        for arg_3 in arg_0:
            publish_json(arg_3)
    else:
        display(*arg_0, include=['text/plain','application/json'])

Display the JSON representation of an object .


def Func ( arg_0 , arg_1 ) : if len ( arg_1 ) == 0 : return if ( arg_1 [ 0 ] != "" and ( not arg_1 [ 0 ] . lstrip ( ) . startswith ( "#" ) ) ) : arg_0 . _children . Func ( arg_0 . _childClass ( arg_0 . parent , arg_1 . linenumber , arg_1 [ 0 ] ) ) if len ( arg_1 . cells ) > 1 : arg_1 [ 0 ] = "" arg_0 . _children [ - 1 ] . Func ( arg_1 . linenumber , arg_1 . raw_text , arg_1 . cells ) elif len ( arg_0 . _children ) == 0 : arg_0 . comments . Func ( arg_1 ) else : if len ( arg_1 . cells ) > 0 : arg_0 . _children [ - 1 ] . Func ( arg_1 . linenumber , arg_1 . raw_text , arg_1 . cells )

def Func(arg_0, arg_1):
        '''
        The idea is, we recognize when we have a new testcase by
        checking the first cell. If it's not empty and not a comment,
        we have a new test case.

        '''
        if len(arg_1) == 0:
            # blank line. Should we throw it away, or Func a BlankLine object?
            return

        if (arg_1[0] != "" and
            (not arg_1[0].lstrip().startswith("#"))):
            # we have a new child table
            arg_0._children.Func(arg_0._childClass(arg_0.parent, arg_1.linenumber, arg_1[0]))
            if len(arg_1.cells) > 1:
                # It appears the first row -- which contains the test case or
                # keyword name -- also has the first logical row of cells.
                # We'll create a Row, but we'll make the first cell empty instead
                # of leaving the name in it, since other code always assumes the
                # first cell is empty.
                #
                # To be honest, I'm not sure this is the Right Thing To Do, but
                # I'm too lazy to audit the code to see if it matters if we keep
                # the first cell intact. Sorry if this ends up causing you grief
                # some day...
                arg_1[0] = ""
                arg_0._children[-1].Func(arg_1.linenumber, arg_1.raw_text, arg_1.cells)

        elif len(arg_0._children) == 0:
            # something before the first test case
            # For now, Func it to self.comments; eventually we should flag
            # an error if it's NOT a comment
            arg_0.comments.Func(arg_1)

        else:
            # another row for the testcase
            if len(arg_1.cells) > 0:
                arg_0._children[-1].Func(arg_1.linenumber, arg_1.raw_text, arg_1.cells)

The idea is we recognize when we have a new testcase by checking the first cell . If it s not empty and not a comment we have a new test case .


(self, path, name, remote_url, use_sudo=False, user=None, fetch=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False, arg_5=None, arg_6=True):
        """
        Add a remote Git repository into a directory.

        :param path: Path of the working copy directory.  This directory must exist
                     and be a Git working copy with a default remote to fetch from.
        :type path: str

        :param use_sudo: If ``True`` execute ``git`` with
                         :func:`fabric.operations.sudo`, else with
                         :func:`fabric.operations.run`.
        :type use_sudo: bool

        :param user: If ``use_sudo is True``, run :func:`fabric.operations.sudo`
                     with the given user.  If ``use_sudo is False`` this parameter
                     has no effect.
        :type user: str

        :param name: name for the remote repository
        :type name: str

        :param remote_url: URL of the remote repository
        :type remote_url: str

        :param fetch: If ``True`` execute ``git remote add -f``
        :type fetch: bool
        """
        if arg_1 is None:
            raise ValueError("Path to the working copy is needed to add a remote")

        if arg_6:
            arg_7 = 'git remote add -f %s %s' % (arg_2, arg_3)
        else:
            arg_7 = 'git remote add %s %s' % (arg_2, arg_3)

        with cd(arg_1):
            if arg_4 and arg_5 is None:
                run_as_root(arg_7)
            elif arg_4:
                sudo(arg_7, arg_5=arg_5)
            else:
                run(arg_7)

Add a remote Git repository into a directory .


def Func ( arg_0 ) : arg_1 = [ ] arg_0 . ignore_unknown_dtypes = True for arg_3 in sorted ( arg_0 . meta_params ) : arg_4 = arg_0 . convert_data_to_string ( arg_0 . meta_params [ arg_3 ] ) if len ( arg_4 ) == 0 : continue if isinstance ( arg_4 , str ) : arg_1 . append ( tf . contrib . summary . generic ( name = arg_3 , tensor = tf . convert_to_tensor ( str ( arg_4 ) ) ) ) else : arg_1 . append ( tf . contrib . summary . generic ( name = arg_3 , tensor = tf . as_string ( tf . convert_to_tensor ( arg_4 ) ) ) ) return arg_1

def Func(arg_0):
        """
        Convert MetaParams into TF Summary Format and create summary_op.

        Returns:
            Merged TF Op for TEXT summary elements, should only be executed once to reduce data duplication.

        """
        arg_1 = []

        arg_0.ignore_unknown_dtypes = True
        for arg_3 in sorted(arg_0.meta_params):
            arg_4 = arg_0.convert_data_to_string(arg_0.meta_params[arg_3])

            if len(arg_4) == 0:
                continue
            if isinstance(arg_4, str):
                arg_1.append(tf.contrib.summary.generic(name=arg_3, tensor=tf.convert_to_tensor(str(arg_4))))
            else:
                arg_1.append(tf.contrib.summary.generic(name=arg_3, tensor=tf.as_string(tf.convert_to_tensor(arg_4))))

        return arg_1

Convert MetaParams into TF Summary Format and create summary_op .


(self, keys, read_consistency=None, transaction=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : arg_4 = arg_0 . get_conn ( ) arg_5 = { 'keys' : arg_1 } if arg_2 : arg_5 [ 'readConsistency' ] = arg_2 if arg_3 : arg_5 [ 'transaction' ] = arg_3 arg_6 = ( arg_4 . projects ( ) . Func ( projectId = arg_0 . project_id , arg_5 = arg_5 ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_6

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Lookup some entities by key.

        .. seealso::
            https://cloud.google.com/datastore/docs/reference/rest/v1/projects/Func

        :param keys: the keys to Func.
        :type keys: list
        :param read_consistency: the read consistency to use. default, strong or eventual.
                                 Cannot be used with a transaction.
        :type read_consistency: str
        :param transaction: the transaction to use, if any.
        :type transaction: str
        :return: the response body of the Func request.
        :rtype: dict
        """
        arg_4 = arg_0.get_conn()

        arg_5 = {'keys': arg_1}
        if arg_2:
            arg_5['readConsistency'] = arg_2
        if arg_3:
            arg_5['transaction'] = arg_3
        arg_6 = (arg_4
                .projects()
                .Func(projectId=arg_0.project_id, arg_5=arg_5)
                .execute(num_retries=arg_0.num_retries))

        return arg_6

Lookup some entities by key.

        .. seealso::
            https://cloud.google.com/datastore/docs/reference/rest/v1/projects/lookup

        :param keys: the keys to lookup.
        :type keys: list
        :param read_consistency: the read consistency to use. default, strong or eventual.
                                 Cannot be used with a transaction.
        :type read_consistency: str
        :param transaction: the transaction to use, if any.
        :type transaction: str
        :return: the response body of the lookup request.
        :rtype: dict


(self, enterprise_customer, course_container_key='results', **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = 'results' , ** arg_3 ) : arg_4 = { 'tpa_hint' : arg_1 and arg_1 . identity_provider , 'enterprise_id' : arg_1 and str ( arg_1 . uuid ) , } arg_4 . update ( ** arg_3 ) arg_5 = [ ] for arg_6 in arg_0 . data [ arg_2 ] : arg_5 . append ( arg_0 . update_course ( arg_6 , arg_1 , arg_4 ) ) arg_0 . data [ arg_2 ] = arg_5

def Func(arg_0, arg_1, arg_2='results', **arg_3):
        """
        This method adds enterprise-specific metadata for each course.

        We are adding following field in all the courses.
            tpa_hint: a string for identifying Identity Provider.
            enterprise_id: the UUID of the enterprise
            **kwargs: any additional data one would like to add on a per-use basis.

        Arguments:
            enterprise_customer: The customer whose data will be used to fill the enterprise context.
            course_container_key: The key used to find the container for courses in the serializer's data dictionary.
        """
        arg_4 = {
            'tpa_hint': arg_1 and arg_1.identity_provider,
            'enterprise_id': arg_1 and str(arg_1.uuid),
        }
        arg_4.update(**arg_3)

        arg_5 = []
        for arg_6 in arg_0.data[arg_2]:
            arg_5.append(
                arg_0.update_course(arg_6, arg_1, arg_4)
            )
        arg_0.data[arg_2] = arg_5

This method adds enterprise - specific metadata for each course .


def Func ( arg_0 ) : arg_0 = parse_str ( arg_0 = arg_0 ) if arg_0 . startswith ( "0" ) : return int ( arg_0 . lstrip ( "0o" ) , 8 ) else : return int ( arg_0 )

def Func(arg_0):
    """
    Parse numeric string to int. Supports oct formatted string.

    :param str value: String value to parse as int
    :return int:
    """
    arg_0 = parse_str(arg_0=arg_0)
    if arg_0.startswith("0"):
        return int(arg_0.lstrip("0o"), 8)
    else:
        return int(arg_0)

Parse numeric string to int . Supports oct formatted string .


def
Func
(
arg_0
)
:
arg_1
=
[
"# Configuration file for %s."
%
arg_0
.
name
]
arg_1
.
append
(
''
)
arg_1
.
append
(
'c = get_config()'
)
arg_1
.
append
(
''
)
for
arg_2
in
arg_0
.
classes
:
arg_1
.
append
(
arg_2
.
class_config_section
(
)
)
return
'\n'
.
join
(
arg_1
)

def Func(arg_0):
        """generate default config file from Configurables"""
        arg_1 = ["# Configuration file for %s."%arg_0.name]
        arg_1.append('')
        arg_1.append('c = get_config()')
        arg_1.append('')
        for arg_2 in arg_0.classes:
            arg_1.append(arg_2.class_config_section())
        return '\n'.join(arg_1)


def Func(arg_0, arg_1):
        """Returns list of the successors of a node that are
        connected by a quantum edge as DAGNodes."""
        if isinstance(arg_1, int):
            warnings.warn('Calling Func() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            arg_1 = arg_0._id_to_node[arg_1]

        arg_2 = []
        for arg_3 in arg_0.successors(arg_1):
            if isinstance(arg_0._multi_graph.get_edge_data(
                    arg_1, arg_3, key=0)['wire'][0],
                          QuantumRegister):
                arg_2.append(arg_3)
        return arg_2

Returns list of the successors of a node that are connected by a quantum edge as DAGNodes .


def Func ( ** arg_0 ) : arg_1 = dict ( Func . config ) Func . config . update ( arg_0 ) return arg_1

def Func(**arg_0):
    """
    Updates the active resource configuration to the passed
    keyword arguments.

    Invoking this method without passing arguments will just return the
    active resource configuration.

    @returns
        The previous configuration.
    """
    arg_1 = dict(Func.config)
    Func.config.update(arg_0)
    return arg_1

Updates the active resource configuration to the passed keyword arguments .


def Func(arg_0, arg_1):
        """
        Takes a SlackEvent, parses it for a command, and runs against registered plugin
        """
        if arg_0._ignore_event(arg_1):
            return None, None
        arg_2 = arg_0._parse_message(arg_1)
        arg_0.log.debug("Searching for command using chunks: %s", arg_2)
        arg_3, arg_4 = arg_0._find_longest_prefix_command(arg_2)
        if arg_3 is not None:
            if arg_1.user is None:
                arg_0.log.debug("Discarded message with no originating user: %s", arg_1)
                return None, None
            arg_5 = arg_1.user.username
            if arg_1.channel is not None:
                arg_5 = "#%s/%s" % (arg_1.channel.name, arg_5)
            arg_0.log.info("Received from %s: %s, args %s", arg_5, arg_3, arg_4)
            arg_6 = arg_0._get_command(arg_3, arg_1.user)
            if arg_6:
                if arg_0._is_channel_ignored(arg_6, arg_1.channel):
                    arg_0.log.info("Channel %s is ignored, discarding command %s", arg_1.channel, arg_3)
                    return '_ignored_', ""
                return arg_3, arg_6.execute(arg_1, arg_4)
            return '_unauthorized_', "Sorry, you are not authorized to run %s" % arg_3
        return None, None

Takes a SlackEvent parses it for a command and runs against registered plugin


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_2
in
arg_0
.
builtins
:
return
arg_0
.
builtins
[
arg_2
]
arg_3
=
if
isinstance
(
arg_1
,
dict
)
:
if
arg_2
in
arg_1
:
arg_3
=
arg_1
[
arg_2
]
if
isinstance
(
arg_3
,
str
)
:
arg_3
=
arg_0
.
_deferred_add
(
arg_3
)
arg_1
[
arg_2
]
=
arg_3
elif
hasattr
(
arg_1
,
arg_2
)
:
arg_3
=
getattr
(
arg_1
,
arg_2
)
if
arg_3
is
:
raise
NotFoundError
(
"Function not found"
,
function
=
arg_2
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """Find a function in the given context by name.

        This function will first search the list of builtins and if the
        desired function is not a builtin, it will continue to search
        the given context.

        Args:
            context (object): A dict or class that is a typedargs context
            funname (str): The name of the function to find

        Returns:
            callable: The found function.
        """

        if arg_2 in arg_0.builtins:
            return arg_0.builtins[arg_2]

        arg_3 = None
        if isinstance(arg_1, dict):
            if arg_2 in arg_1:
                arg_3 = arg_1[arg_2]

                #Allowed lazy loading of functions
                if isinstance(arg_3, str):
                    arg_3 = arg_0._deferred_add(arg_3)
                    arg_1[arg_2] = arg_3
        elif hasattr(arg_1, arg_2):
            arg_3 = getattr(arg_1, arg_2)

        if arg_3 is None:
            raise NotFoundError("Function not found", function=arg_2)

        return arg_3

Find a function in the given context by name .


def Func ( arg_0 , arg_1 = ( ) ) : if not arg_1 : arg_1 = list ( arg_0 ) else : arg_1 = list ( arg_1 ) for arg_2 , arg_3 in enumerate ( arg_1 ) : if isinstance ( arg_3 , str ) : arg_1 [ arg_2 ] = ( arg_3 , ) arg_4 = [ ] for arg_5 in arg_1 : arg_6 = [ arg_0 [ arg_9 ] for arg_9 in arg_5 ] arg_7 = zip ( * arg_6 ) arg_4 . append ( arg_7 ) arg_8 = { } for arg_9 in arg_0 : arg_8 [ arg_9 ] = [ ] arg_10 = itools . product ( * arg_4 ) for arg_11 in arg_10 : for arg_2 , arg_5 in enumerate ( arg_1 ) : for arg_12 , arg_9 in enumerate ( arg_5 ) : arg_8 [ arg_9 ] . append ( arg_11 [ arg_2 ] [ arg_12 ] ) return arg_8

def Func(arg_0, arg_1=()):
    """ Generates a Cartesian product of the input parameter dictionary.

    For example:

    >>> print Func({'param1':[1,2,3], 'param2':[42.0, 52.5]})
    {'param1':[1,1,2,2,3,3],'param2': [42.0,52.5,42.0,52.5,42.0,52.5]}

    :param parameter_dict:

        Dictionary containing parameter names as keys and iterables of data to explore.

    :param combined_parameters:

        Tuple of tuples. Defines the order of the parameters and parameters that are
        linked together.
        If an inner tuple contains only a single item, you can spare the
        inner tuple brackets.

        For example:

        >>> print Func( {'param1': [42.0, 52.5], 'param2':['a', 'b'], 'param3' : [1,2,3]}, ('param3',('param1', 'param2')))
        {param3':[1,1,2,2,3,3],'param1' : [42.0,52.5,42.0,52.5,42.0,52.5], 'param2':['a','b','a','b','a','b']}

    :returns: Dictionary with cartesian product lists.

    """
    if not arg_1:
        arg_1 = list(arg_0)
    else:
        arg_1 = list(arg_1)

    for arg_2, arg_3 in enumerate(arg_1):
        if isinstance(arg_3, str):
            arg_1[arg_2] = (arg_3,)

    arg_4 = []
    for arg_5 in arg_1:
        arg_6 = [arg_0[arg_9] for arg_9 in arg_5]
        arg_7 = zip(*arg_6)
        arg_4.append(arg_7)

    arg_8 = {}
    for arg_9 in arg_0:
        arg_8[arg_9] = []

    arg_10 = itools.product(*arg_4)

    for arg_11 in arg_10:
        for arg_2, arg_5 in enumerate(arg_1):
            for arg_12, arg_9 in enumerate(arg_5):
                arg_8[arg_9].append(arg_11[arg_2][arg_12])

    return arg_8

Generates a Cartesian product of the input parameter dictionary.

    For example:

    >>> print cartesian_product({'param1':[1,2,3], 'param2':[42.0, 52.5]})
    {'param1':[1,1,2,2,3,3],'param2': [42.0,52.5,42.0,52.5,42.0,52.5]}

    :param parameter_dict:

        Dictionary containing parameter names as keys and iterables of data to explore.

    :param combined_parameters:

        Tuple of tuples. Defines the order of the parameters and parameters that are
        linked together.
        If an inner tuple contains only a single item, you can spare the
        inner tuple brackets.

        For example:

        >>> print cartesian_product( {'param1': [42.0, 52.5], 'param2':['a', 'b'], 'param3' : [1,2,3]}, ('param3',('param1', 'param2')))
        {param3':[1,1,2,2,3,3],'param1' : [42.0,52.5,42.0,52.5,42.0,52.5], 'param2':['a','b','a','b','a','b']}

    :returns: Dictionary with cartesian product lists.

Generates a Cartesian product of the input parameter dictionary .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . lazy_init : arg_2 ( ) for arg_3 , arg_2 in arg_0 . func_registry . items ( ) : if isinstance ( arg_1 , arg_3 ) : return arg_2

def Func(arg_0, arg_1):
        """
        Returns an appropriate function to format `data` if one has been
        registered.
        """
        for arg_2 in arg_0.lazy_init:
            arg_2()

        for arg_3, arg_2 in arg_0.func_registry.items():
            if isinstance(arg_1, arg_3):
                return arg_2

Returns an appropriate function to format data if one has been registered .


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . named_tensors : return True , arg_0 . named_tensors [ arg_1 ] else : return False , None

def Func(arg_0, arg_1):
        """
        Returns a named tensor if available.

        Returns:
            valid: True if named tensor found, False otherwise
            tensor: If valid, will be a tensor, otherwise None
        """
        if arg_1 in arg_0.named_tensors:
            return True, arg_0.named_tensors[arg_1]
        else:
            return False, None


def Func ( arg_0 ) : try : arg_1 = arg_0 [ - 1 ] arg_0 = arg_0 [ : : - 1 ] [ 1 : ] arg_2 = 0 arg_3 = 1 for arg_4 in arg_0 : if arg_4 == '-' : pass else : arg_2 += arg_3 * int ( arg_4 ) arg_3 += 1 return ( arg_2 % 10 == int ( arg_1 ) ) except : return False

def Func(arg_0):
    '''Checks if a CAS number is valid. Returns False if the parser cannot
    parse the given string..

    Parameters
    ----------
    CASRN : string
        A three-piece, dash-separated set of numbers

    Returns
    -------
    result : bool
        Boolean value if CASRN was valid. If parsing fails, return False also.

    Notes
    -----
    Check method is according to Chemical Abstract Society. However, no lookup
    to their service is performed; therefore, this function cannot detect
    false positives.

    Function also does not support additional separators, apart from '-'.

    CAS numbers up to the series 1 XXX XXX-XX-X are now being issued.

    A long can hold CAS numbers up to 2 147 483-64-7

    Examples
    --------
    >>> Func('7732-18-5')
    True
    >>> Func('77332-18-5')
    False
    '''
    try:
        arg_1 = arg_0[-1]
        arg_0 = arg_0[::-1][1:]
        arg_2 = 0
        arg_3 = 1
        for arg_4 in arg_0:
            if arg_4 == '-':
                pass
            else:
                arg_2 += arg_3*int(arg_4)
                arg_3 += 1
        return (arg_2 % 10 == int(arg_1))
    except:
        return False

Checks if a CAS number is valid. Returns False if the parser cannot
    parse the given string..

    Parameters
    ----------
    CASRN : string
        A three-piece, dash-separated set of numbers

    Returns
    -------
    result : bool
        Boolean value if CASRN was valid. If parsing fails, return False also.

    Notes
    -----
    Check method is according to Chemical Abstract Society. However, no lookup
    to their service is performed; therefore, this function cannot detect
    false positives.

    Function also does not support additional separators, apart from '-'.

    CAS numbers up to the series 1 XXX XXX-XX-X are now being issued.

    A long can hold CAS numbers up to 2 147 483-64-7

    Examples
    --------
    >>> checkCAS('7732-18-5')
    True
    >>> checkCAS('77332-18-5')
    False

Checks if a CAS number is valid . Returns False if the parser cannot parse the given string ..


def Func ( arg_0 , arg_1 , arg_2 = False ) : if not arg_2 : arg_1 = arg_0 . standardize ( arg_1 ) else : arg_1 = copy . deepcopy ( arg_1 ) for arg_3 in arg_1 . GetAtoms ( ) : arg_3 . SetIsotope ( 0 ) return arg_1

def Func(arg_0, arg_1, arg_2=False):
        """Return the isotope parent of a given molecule.

        The isotope parent has all atoms replaced with the most abundant isotope for that element.

        :param mol: The input molecule.
        :type mol: rdkit.Chem.rdchem.Mol
        :param bool skip_standardize: Set to True if mol has already been standardized.
        :returns: The isotope parent molecule.
        :rtype: rdkit.Chem.rdchem.Mol
        """
        if not arg_2:
            arg_1 = arg_0.standardize(arg_1)
        else:
            arg_1 = copy.deepcopy(arg_1)
        # Replace isotopes with common weight
        for arg_3 in arg_1.GetAtoms():
            arg_3.SetIsotope(0)
        return arg_1

Return the isotope parent of a given molecule .


def Func ( arg_0 ) : from numpy_sugar . linalg import ddot arg_1 = arg_0 . _X [ "tX" ] arg_2 = concatenate ( arg_0 . _QS [ 0 ] , axis = 1 ) arg_3 = arg_0 . _QS [ 1 ] arg_4 = arg_0 . v0 * arg_3 + arg_0 . v1 arg_4 = arg_4 . tolist ( ) + [ arg_0 . v1 ] * ( len ( arg_0 . _y ) - len ( arg_4 ) ) arg_4 = asarray ( arg_4 ) arg_5 = inv ( arg_1 . T @ ( arg_2 @ ddot ( 1 / arg_4 , arg_2 . T @ arg_1 ) ) ) arg_6 = arg_0 . _X [ "VT" ] arg_7 = lstsq ( arg_6 , arg_5 , rcond = None ) [ 0 ] return lstsq ( arg_6 , arg_7 . T , rcond = None ) [ 0 ]

def Func(arg_0):
        """
        Estimates the covariance-matrix of the optimal beta.

        Returns
        -------
        beta-covariance : ndarray
            (Xᵀ(s((1-𝛿)K + 𝛿I))⁻¹X)⁻¹.

        References
        ----------
        .. Rencher, A. C., & Schaalje, G. B. (2008). Linear models in statistics. John
           Wiley & Sons.
        """
        from numpy_sugar.linalg import ddot

        arg_1 = arg_0._X["tX"]
        arg_2 = concatenate(arg_0._QS[0], axis=1)
        arg_3 = arg_0._QS[1]
        arg_4 = arg_0.v0 * arg_3 + arg_0.v1
        arg_4 = arg_4.tolist() + [arg_0.v1] * (len(arg_0._y) - len(arg_4))
        arg_4 = asarray(arg_4)
        arg_5 = inv(arg_1.T @ (arg_2 @ ddot(1 / arg_4, arg_2.T @ arg_1)))
        arg_6 = arg_0._X["VT"]
        arg_7 = lstsq(arg_6, arg_5, rcond=None)[0]
        return lstsq(arg_6, arg_7.T, rcond=None)[0]

Estimates the covariance - matrix of the optimal beta .


def Func(arg_0, arg_1, **arg_2):
        """Run when a task starts."""
        arg_0.last_task_name = arg_1.get_name()
        arg_0.printed_last_task = False


def Func(arg_0, arg_1):
  """Maybe add `ndims` ones to `x.shape` on the right.

  If `ndims` is zero, this is a no-op; otherwise, we will create and return a
  new `Tensor` whose shape is that of `x` with `ndims` ones concatenated on the
  right side. If the shape of `x` is known statically, the shape of the return
  value will be as well.

  Args:
    x: The `Tensor` we'll return a reshaping of.
    ndims: Python `integer` number of ones to pad onto `x.shape`.
  Returns:
    If `ndims` is zero, `x`; otherwise, a `Tensor` whose shape is that of `x`
    with `ndims` ones concatenated on the right side. If possible, returns a
    `Tensor` whose shape is known statically.
  Raises:
    ValueError: if `ndims` is not a Python `integer` greater than or equal to
    zero.
  """
  if not (isinstance(arg_1, int) and arg_1 >= 0):
    raise ValueError(
        '`ndims` must be a Python `integer` greater than zero. Got: {}'
        .format(arg_1))
  if arg_1 == 0:
    return arg_0
  arg_0 = tf.convert_to_tensor(value=arg_0)
  arg_2 = arg_0.shape
  arg_3 = distribution_util.pad(
      tf.shape(input=arg_0), axis=0, back=True, value=1, count=arg_1)
  arg_0 = tf.reshape(arg_0, arg_3)
  arg_0.set_shape(arg_2.concatenate([1]*arg_1))
  return arg_0

Maybe add ndims ones to x . shape on the right .


return self._nn_interface._add_generic(self,
                                                type_name=GROUP,
                                                group_type_name=GROUP,
                                                args=args,
                                                kwargs=kwargs,
                                                add_prefix=False,
                                                check_naming=False)

def Func(arg_0, arg_1, arg_2):
        """Can be called from storage service to create a new group to bypass name checking"""
        return arg_0._nn_interface._add_generic(arg_0,
                                                type_name=GROUP,
                                                group_type_name=GROUP,
                                                arg_1=arg_1,
                                                arg_2=arg_2,
                                                add_prefix=False,
                                                check_naming=False)


(
            self, latitude: float, longitude: float, radius: int,
            fuel_type: str, brands: Optional[List[str]] = None
    )

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_2 , arg_4 : arg_5 , arg_6 : arg_7 , arg_8 : arg_9 [ arg_10 [ arg_7 ] ] = None ) -> arg_10 [ StationPrice ] : if arg_8 is None : arg_8 = [ ] arg_11 = requests . post ( '{}/prices/nearby' . format ( API_URL_BASE ) , json = { 'fueltype' : arg_6 , 'latitude' : arg_1 , 'longitude' : arg_3 , 'radius' : arg_4 , 'brand' : arg_8 , } , headers = arg_0 . _get_headers ( ) , timeout = arg_0 . _timeout , ) if not arg_11 . ok : raise FuelCheckError . create ( arg_11 ) arg_12 = arg_11 . json ( ) arg_13 = { station [ 'code' ] : Station . deserialize ( station ) for station in arg_12 [ 'stations' ] } arg_14 = [ ] for arg_15 in arg_12 [ 'prices' ] : arg_16 = Price . deserialize ( arg_15 ) arg_14 . append ( StationPrice ( arg_16 = arg_16 , station = arg_13 [ arg_16 . station_code ] ) ) return arg_14

def Func(
            arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_5,
            arg_6: arg_7, arg_8: arg_9[arg_10[arg_7]] = None
    ) -> arg_10[StationPrice]:
        """Gets all the fuel prices within the specified radius."""

        if arg_8 is None:
            arg_8 = []
        arg_11 = requests.post(
            '{}/prices/nearby'.format(API_URL_BASE),
            json={
                'fueltype': arg_6,
                'latitude': arg_1,
                'longitude': arg_3,
                'radius': arg_4,
                'brand': arg_8,
            },
            headers=arg_0._get_headers(),
            timeout=arg_0._timeout,
        )

        if not arg_11.ok:
            raise FuelCheckError.create(arg_11)

        arg_12 = arg_11.json()
        arg_13 = {
            station['code']: Station.deserialize(station)
            for station in arg_12['stations']
        }
        arg_14 = []  # type: List[StationPrice]
        for arg_15 in arg_12['prices']:
            arg_16 = Price.deserialize(arg_15)
            arg_14.append(StationPrice(
                arg_16=arg_16,
                station=arg_13[arg_16.station_code]
            ))

        return arg_14

Gets all the fuel prices within the specified radius .


def Func(arg_0, arg_1):
        """ Draws the component bounds for testing purposes """

        arg_2, arg_3 = arg_0.bounds
        arg_4, arg_5 = arg_0.position
        arg_1.rect(arg_4, arg_5, arg_2, arg_3)
        arg_1.stroke_path()


def Func ( arg_0 ) : arg_1 = set ( [ ] ) for arg_2 in misc . __all__ : arg_1 . add ( arg_2 ) return sorted ( arg_1 )

def Func(arg_0):
        """Returns a list of global commands, realted to CLI
        configuration or system management in general.
        """
        arg_1 = set([])
        for arg_2 in misc.__all__:
            arg_1.add(arg_2)
        return sorted(arg_1)

Returns a list of global commands realted to CLI configuration or system management in general .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : super ( QtKernelManager , arg_0 ) . Func ( * arg_1 , ** arg_2 ) arg_0 . started_channels . emit ( )

def Func(arg_0, *arg_1, **arg_2):
        """ Reimplemented to emit signal.
        """
        super(QtKernelManager, arg_0).Func(*arg_1, **arg_2)
        arg_0.started_channels.emit()


def
Func
(
arg_0
,
arg_1
)
:
with
arg_0
.
lock
:
if
arg_0
.
_eof
or
arg_0
.
_socket
is
or
not
arg_0
.
_serializer
:
logger
.
debug
(
"Dropping element: {0}"
.
format
(
element_to_unicode
(
arg_1
)
)
)
return
arg_2
=
arg_0
.
_serializer
.
emit_stanza
(
arg_1
)
arg_0
.
_write
(
arg_2
.
encode
(
"utf-8"
)
)

def Func(arg_0, arg_1):
        """
        Send an element via the transport.
        """
        with arg_0.lock:
            if arg_0._eof or arg_0._socket is None or not arg_0._serializer:
                logger.debug("Dropping element: {0}".format(
                                                element_to_unicode(arg_1)))
                return
            arg_2 = arg_0._serializer.emit_stanza(arg_1)
            arg_0._write(arg_2.encode("utf-8"))


def Func(arg_0, arg_1, arg_2):
    """
    Updates the duty cycles for each column. The OVERLAP duty cycle is a moving
    average of the number of inputs which overlapped with the each column. The
    ACTIVITY duty cycles is a moving average of the frequency of activation for
    each column.

    Parameters:
    ----------------------------
    :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 activeColumns:
                    An array containing the indices of the active columns,
                    the sparse set of columns which survived inhibition
    """
    arg_3 = numpy.zeros(arg_0._numColumns, dtype=realDType)
    arg_4 = numpy.zeros(arg_0._numColumns, dtype=realDType)
    arg_3[arg_1 > 0] = 1
    arg_4[arg_2] = 1

    arg_5 = arg_0._dutyCyclePeriod
    if (arg_5 > arg_0._iterationNum):
      arg_5 = arg_0._iterationNum

    arg_0._overlapDutyCycles = arg_0.FuncHelper(
                                arg_0._overlapDutyCycles,
                                arg_3,
                                arg_5
                              )

    arg_0._activeDutyCycles = arg_0.FuncHelper(
                                arg_0._activeDutyCycles,
                                arg_4,
                                arg_5
                              )

Updates the duty cycles for each column . The OVERLAP duty cycle is a moving average of the number of inputs which overlapped with the each column . The ACTIVITY duty cycles is a moving average of the frequency of activation for each column .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Update all the class traits having ``config=True`` as metadata.

        For any class trait with a ``config`` metadata attribute that is
        ``True``, we update the trait with the value of the corresponding
        config entry.
        """
        # Get all traits with a config metadata entry that is True
        arg_4 = arg_0.traits(config=True)

        # We auto-load config section for this class as well as any parent
        # classes that are Configurable subclasses.  This starts with Configurable
        # and works down the mro loading the config for each section.
        arg_5 = [cls.__name__ for cls in \
            reversed(arg_0.__class__.__mro__) if
            issubclass(cls, Configurable) and issubclass(arg_0.__class__, cls)]

        for arg_6 in arg_5:
            # Don't do a blind getattr as that would cause the config to
            # dynamically create the section with name self.__class__.__name__.
            if arg_3._has_section(arg_6):
                arg_7 = arg_3[arg_6]
                for arg_8, arg_9 in arg_4.iteritems():
                    # Don't allow traitlets with config=True to start with
                    # uppercase.  Otherwise, they are confused with Config
                    # subsections.  But, developers shouldn't have uppercase
                    # attributes anyways! (PEP 6)
                    if arg_8[0].upper()==arg_8[0] and not arg_8.startswith('_'):
                        raise ConfigurableError('Configurable traitlets with '
                        'config=True must start with a lowercase so they are '
                        'not confused with Config subsections: %s.%s' % \
                        (arg_0.__class__.__name__, arg_8))
                    try:
                        # Here we grab the value from the config
                        # If k has the naming convention of a config
                        # section, it will be auto created.
                        arg_10 = arg_7[arg_8]
                    except KeyError:
                        pass
                    else:
                        # print "Setting %s.%s from %s.%s=%r" % \
                        #     (self.__class__.__name__,k,sname,k,config_value)
                        # We have to do a deepcopy here if we don't deepcopy the entire
                        # config object. If we don't, a mutable config_value will be
                        # shared by all instances, effectively making it a class attribute.
                        setattr(arg_0, arg_8, deepcopy(arg_10))

Update all the class traits having config = True as metadata .


(times: np.ndarray, amp: complex, center: float, sigma: float,
                   ret_gaussian: bool = False)

def Func(arg_0: arg_1.ndarray, arg_3: arg_4, arg_5: arg_6, arg_7: arg_6,
                   arg_8: arg_9 = False) -> arg_1.ndarray:
    """Continuous unnormalized gaussian derivative pulse.

    Args:
        times: Times to output pulse for.
        amp: Pulse amplitude at `center`.
        center: Center (mean) of pulse.
        sigma: Width (standard deviation) of pulse.
        ret_gaussian: Return gaussian with which derivative was taken with.
    """
    arg_10, arg_11 = gaussian(arg_0, arg_3=arg_3, arg_5=arg_5, arg_7=arg_7, ret_x=True)
    arg_12 = -arg_11/arg_7*arg_10
    if arg_8:
        return arg_12, arg_10
    return arg_12

Continuous unnormalized gaussian derivative pulse .


(self, filename, table=None, delimiter='|', null='NULL',
            panic=True, quotechar='"', parse_dates=False)

def Func(arg_0, arg_1, arg_2=None, arg_3='|', arg_4='NULL',
            arg_5=True, arg_6='"', arg_7=False):
        """
        Load from a file into the target table, handling each step of the
        load process.

        Can load from text files, and properly formatted giraffez archive
        files. In both cases, if Gzip compression is detected the file will be
        decompressed while reading and handled appropriately. The encoding is
        determined automatically by the contents of the file.

        It is not necessary to set the columns in use prior to loading from a file.
        In the case of a text file, the header is used to determine column names
        and their order. Valid delimiters include '|', ',', and '\\t' (tab). When
        loading an archive file, the column information is decoded alongside the data.

        :param str filename: The location of the file to be loaded
        :param str table: The name of the target table, if it was not specified
            to the constructor for the isntance
        :param str null: The string that indicates a null value in the rows being
            inserted from a file. Defaults to 'NULL'
        :param str delimiter: When loading a file, indicates that fields are
            separated by this delimiter. Defaults to :code:`None`, which causes the
            delimiter to be determined from the header of the file. In most
            cases, this behavior is sufficient
        :param str quotechar: The character used to quote fields containing special characters,
            like the delimiter.
        :param bool panic: If :code:`True`, when an error is encountered it will be
            raised. Otherwise, the error will be logged and :code:`self.error_count`
            is incremented.
        :return: The output of the call to
            :meth:`~giraffez.load.TeradataBulkLoad.finish`
        :raises `giraffez.errors.GiraffeError`: if table was not set and :code:`table`
            is :code:`None`, or if a Teradata error ocurred while retrieving table info.
        :raises `giraffez.errors.GiraffeEncodeError`: if :code:`panic` is :code:`True` and there
            are format errors in the row values.
        """
        if not arg_0.table:
            if not arg_2:
                raise GiraffeError("Table must be set or specified to load a file.")
            arg_0.table = arg_2
        if not isinstance(arg_4, basestring):
            raise GiraffeError("Expected 'null' to be str, received {}".format(type(arg_4)))
        with Reader(arg_1, arg_3=arg_3, arg_6=arg_6) as f:
            if not isinstance(f.delimiter, basestring):
                raise GiraffeError("Expected 'delimiter' to be str, received {}".format(type(arg_3)))
            arg_0.columns = f.header
            if isinstance(f, ArchiveFileReader):
                arg_0.mload.set_encoding(ROW_ENCODING_RAW)
                arg_0.preprocessor = lambda s: s
            if arg_7:
                arg_0.preprocessor = DateHandler(arg_0.columns)
            arg_0._initiate()
            arg_0.mload.set_null(arg_4)
            arg_0.mload.set_delimiter(arg_3)
            arg_10 = 0
            for arg_10, arg_11 in enumerate(f, 1):
                arg_0.put(arg_11, arg_5=arg_5)
                if arg_10 % arg_0.checkpoint_interval == 1:
                    log.info("\rBulkLoad", "Processed {} rows".format(arg_10), console=True)
                    arg_12 = arg_0.checkpoint()
                    arg_0.exit_code = arg_0._exit_code()
                    if arg_0.exit_code != 0:
                        return arg_0.exit_code
            log.info("\rBulkLoad", "Processed {} rows".format(arg_10))
            return arg_0.finish()

Load from a file into the target table handling each step of the load process .


Searches the string for the pattern, caching the compiled regexp.

def Func ( arg_0 , arg_1 ) : if arg_0 not in arg_2 : arg_2 [ arg_0 ] = sre_compile . compile ( arg_0 ) return arg_2 [ arg_0 ] . search ( arg_1 )

def Func(arg_0, arg_1):
  """Funces the string for the pattern, caching the compiled regexp."""
  if arg_0 not in arg_2:
    arg_2[arg_0] = sre_compile.compile(arg_0)
  return arg_2[arg_0].search(arg_1)

Searches the string for the pattern caching the compiled regexp .


return self._tp, self._tn, self._fp, self._fn

def Func(arg_0):
        """Cast to tuple.

        Returns
        -------
        tuple
            The confusion table as a 4-tuple (tp, tn, fp, fn)

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        (120, 60, 20, 30)

        """
        return arg_0._tp, arg_0._tn, arg_0._fp, arg_0._fn

Cast to tuple.

        Returns
        -------
        tuple
            The confusion table as a 4-tuple (tp, tn, fp, fn)

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.to_tuple()
        (120, 60, 20, 30)


def Func(arg_0, arg_1):
        """"Get the max date in unixtime format from reviews."""
        arg_2 = 0
        for arg_3 in arg_1:
            arg_4 = str_to_datetime(arg_3['timestamp'])
            arg_4 = datetime_to_utc(arg_4)
            if arg_4.timestamp() > arg_2:
                arg_2 = arg_4.timestamp()
        return arg_2

Get the max date in unixtime format from reviews .


def Func(arg_0):
    """
    Perform an internal optimization step that speeds up inference if we know
    learning will not be performed anymore. This call may, for example, remove
    all potential inputs to each column.
    """
    if arg_0._tfdr is None:
      raise RuntimeError("Temporal memory has not been initialized")

    if hasattr(arg_0._tfdr, 'Func'):
      arg_0.resetSequenceStates()
      arg_0._tfdr.Func()

Perform an internal optimization step that speeds up inference if we know learning will not be performed anymore . This call may for example remove all potential inputs to each column .


def Func(arg_0, arg_1=False):
    """Convert Hz to Mels

    Examples
    --------
    >>> librosa.Func(60)
    0.9
    >>> librosa.Func([110, 220, 440])
    array([ 1.65,  3.3 ,  6.6 ])

    Parameters
    ----------
    frequencies   : number or np.ndarray [shape=(n,)] , float
        scalar or array of frequencies
    htk           : bool
        use HTK formula instead of Slaney

    Returns
    -------
    mels        : number or np.ndarray [shape=(n,)]
        input frequencies in Mels

    See Also
    --------
    mel_to_hz
    """

    arg_0 = np.asanyarray(arg_0)

    if arg_1:
        return 2595.0 * np.log10(1.0 + arg_0 / 700.0)

    # Fill in the linear part
    arg_2 = 0.0
    arg_3 = 200.0 / 3

    arg_4 = (arg_0 - arg_2) / arg_3

    # Fill in the log-scale part

    arg_5 = 1000.0                         # beginning of log region (Hz)
    arg_6 = (arg_5 - arg_2) / arg_3   # same (Mels)
    arg_7 = np.log(6.4) / 27.0                # step size for log region

    if arg_0.ndim:
        # If we have array data, vectorize
        arg_8 = (arg_0 >= arg_5)
        arg_4[arg_8] = arg_6 + np.log(arg_0[arg_8]/arg_5) / arg_7
    elif arg_0 >= arg_5:
        # If we have scalar data, heck directly
        arg_4 = arg_6 + np.log(arg_0 / arg_5) / arg_7

    return arg_4

Convert Hz to Mels

    Examples
    --------
    >>> librosa.hz_to_mel(60)
    0.9
    >>> librosa.hz_to_mel([110, 220, 440])
    array([ 1.65,  3.3 ,  6.6 ])

    Parameters
    ----------
    frequencies   : number or np.ndarray [shape=(n,)] , float
        scalar or array of frequencies
    htk           : bool
        use HTK formula instead of Slaney

    Returns
    -------
    mels        : number or np.ndarray [shape=(n,)]
        input frequencies in Mels

    See Also
    --------
    mel_to_hz