def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
)
:
if
not
isinstance
(
arg_0
,
_strings
)
:
raise
TypeError
(
'string required'
)
if
arg_2
is
:
arg_2
=
html_parser
return
arg_2
.
parse
(
arg_0
,
useChardet
=
arg_1
)
.
getroot
(
)

def Func(arg_0, arg_1=True, arg_2=None):
    """Parse a whole document into a string."""
    if not isinstance(arg_0, _strings):
        raise TypeError('string required')

    if arg_2 is None:
        arg_2 = html_parser

    return arg_2.parse(arg_0, useChardet=arg_1).getroot()


def Func(arg_0, arg_1=True):
        """
        Get the shapes of all routes.

        Parameters
        ----------
        use_shapes : bool, optional
            by default True (i.e. use shapes as the name of the function indicates)
            if False (fall back to lats and longitudes)

        Returns
        -------
        routeShapes: list of dicts that should have the following keys
            name, type, agency, lats, lons
            with types
            list, list, str, list, list
        """
        arg_2 = arg_0.conn.cursor()

        # all shape_id:s corresponding to a route_I:
        # query = "SELECT DISTINCT name, shape_id, trips.route_I, route_type
        #          FROM trips LEFT JOIN routes USING(route_I)"
        # data1 = pd.read_sql_query(query, self.conn)
        # one (arbitrary) shape_id per route_I ("one direction") -> less than half of the routes
        arg_3 = "SELECT routes.name as name, shape_id, route_I, trip_I, routes.type, " \
                "        agency_id, agencies.name as agency_name, max(end_time_ds-start_time_ds) as trip_duration " \
                "FROM trips " \
                "LEFT JOIN routes " \
                "USING(route_I) " \
                "LEFT JOIN agencies " \
                "USING(agency_I) " \
                "GROUP BY routes.route_I"
        arg_4 = pd.read_sql_query(arg_3, arg_0.conn)

        arg_5 = []
        for arg_6, arg_7 in enumerate(arg_4.itertuples()):
            arg_8 = {"name": str(arg_7.name), "type": int(arg_7.type), "route_I": arg_7.route_I, "agency": str(arg_7.agency_id),
                     "agency_name": str(arg_7.agency_name)}
            # this function should be made also non-shape friendly (at this point)
            if arg_1 and arg_7.shape_id:
                arg_9 = shapes.get_shape_points2(arg_2, arg_7.shape_id)
                arg_10 = arg_9['lats']
                arg_11 = arg_9['lons']
            else:
                arg_12 = arg_0.get_trip_stop_coordinates(arg_7.trip_I)
                arg_10 = list(arg_12['lat'])
                arg_11 = list(arg_12['lon'])
            arg_8['lats'] = [float(lat) for lat in arg_10]
            arg_8['lons'] = [float(lon) for lon in arg_11]
            arg_5.append(arg_8)
        return arg_5


return render(request, "registrasion/reports_list.html", ctx)

def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in get_all_reports ( ) : arg_1 . append ( { "name" : arg_2 . __name__ , "url" : reverse ( arg_2 ) , "description" : arg_2 . __doc__ , } ) arg_1 . sort ( key = lambda arg_2 : arg_2 [ "name" ] ) arg_3 = { "reports" : arg_1 , } return render ( arg_0 , "registrasion/Func.html" , arg_3 )

def Func(arg_0):
    ''' Lists all of the reports currently available. '''

    arg_1 = []

    for arg_2 in get_all_reports():
        arg_1.append({
            "name": arg_2.__name__,
            "url": reverse(arg_2),
            "description": arg_2.__doc__,
        })

    arg_1.sort(key=lambda arg_2: arg_2["name"])

    arg_3 = {
        "reports": arg_1,
    }

    return render(arg_0, "registrasion/Func.html", arg_3)

Lists all of the reports currently available .


def Func(arg_0):
        """Build choices list runtime using 'sitetree_tree' tag"""
        arg_1 = u'sitetree_tree from "%s" template "%s"' % (arg_0.tree, arg_0.template)

        arg_2 = {'current_app': 'admin'}
        arg_3 = template.Context(arg_2) if VERSION >= (1, 8) else template.Context(**arg_2)
        arg_3.update({'request': object()})

        arg_4 = sitetree_tree(
            Parser(None), Token(token_type=TOKEN_BLOCK, contents=arg_1)
        ).render(arg_3)

        arg_5 = [(ITEMS_FIELD_ROOT_ID, arg_0.root_title)]

        for arg_6 in arg_4.splitlines():
            if arg_6.strip():
                arg_7 = arg_6.split(':::')
                arg_5.append((arg_7[0], mark_safe(arg_7[1])))

        return arg_5

Build choices list runtime using sitetree_tree tag


(self, keychr, modFlags=0, globally=False)

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = False ) : arg_4 = { '\n' : AXKeyCodeConstants . RETURN , '\r' : AXKeyCodeConstants . RETURN , '\t' : AXKeyCodeConstants . TAB , } if arg_1 in arg_4 : arg_1 = arg_4 [ arg_1 ] arg_0 . _addKeyToQueue ( arg_1 , arg_2 , arg_3 = arg_3 ) arg_0 . _postQueuedEvents ( )

def Func(arg_0, arg_1, arg_2=0, arg_3=False):
        """Send one character with no modifiers.

        Parameters: key character or constant referring to a non-alpha-numeric
                    key (e.g. RETURN or TAB)
                    modifier flags,
                    global or app specific
        Returns: None or raise ValueError exception
        """
        arg_4 = {
            '\n': AXKeyCodeConstants.RETURN,
            '\r': AXKeyCodeConstants.RETURN,
            '\t': AXKeyCodeConstants.TAB,
        }
        if arg_1 in arg_4:
            arg_1 = arg_4[arg_1]

        arg_0._addKeyToQueue(arg_1, arg_2, arg_3=arg_3)
        arg_0._postQueuedEvents()


def Func(arg_0, arg_1):
        """Implementation of 'coverage debug'."""

        if not arg_1:
            arg_0.help_fn("What information would you like: data, sys?")
            return ERR
        for arg_2 in arg_1:
            if arg_2 == 'sys':
                print("-- sys ----------------------------------------")
                for arg_3 in info_formatter(arg_0.coverage.sysinfo()):
                    print(" %s" % arg_3)
            elif arg_2 == 'data':
                print("-- data ---------------------------------------")
                arg_0.coverage.load()
                print("path: %s" % arg_0.coverage.data.filename)
                print("has_arcs: %r" % arg_0.coverage.data.has_arcs())
                arg_4 = arg_0.coverage.data.summary(fullpath=True)
                if arg_4:
                    arg_5 = sorted(arg_4.keys())
                    print("\n%d files:" % len(arg_5))
                    for arg_6 in arg_5:
                        print("%s: %d lines" % (arg_6, arg_4[arg_6]))
                else:
                    print("No data collected")
            else:
                arg_0.help_fn("Don't know what you mean by %r" % arg_2)
                return ERR
        return OK


(self, xfield, yfield, time_unit=None,
                       scale=Scale(zero=False))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = arg_5 ( arg_6 = False ) ) : if arg_4 is None : arg_4 = arg_5 ( ) arg_7 = arg_1 [ 1 ] arg_8 = arg_2 [ 1 ] arg_9 = None if len ( arg_1 ) > 2 : arg_9 = arg_1 [ 2 ] arg_10 = None if len ( arg_2 ) > 2 : arg_10 = arg_2 [ 2 ] if arg_3 is not None : if arg_9 is None : arg_11 = X ( arg_7 , timeUnit = arg_3 ) else : arg_11 = X ( arg_7 , axis = Axis ( ** arg_9 ) , timeUnit = arg_3 , arg_4 = arg_4 ) else : if arg_9 is None : arg_11 = X ( arg_7 ) else : arg_11 = X ( arg_7 , axis = Axis ( ** arg_9 ) , arg_4 = arg_4 ) if arg_10 is None : arg_12 = Y ( arg_8 , arg_4 = arg_4 ) else : arg_12 = Y ( arg_8 , axis = Axis ( ** arg_10 ) , arg_4 = arg_4 ) return arg_11 , arg_12

def Func(arg_0, arg_1, arg_2, arg_3=None,
                       arg_4=arg_5(arg_6=False)):
        """
        Encode the fields in Altair format
        """
        if arg_4 is None:
            arg_4 = arg_5()
        arg_7 = arg_1[1]
        arg_8 = arg_2[1]
        arg_9 = None
        if len(arg_1) > 2:
            arg_9 = arg_1[2]
        arg_10 = None
        if len(arg_2) > 2:
            arg_10 = arg_2[2]
        if arg_3 is not None:
            if arg_9 is None:
                arg_11 = X(arg_7, timeUnit=arg_3)
            else:
                arg_11 = X(
                    arg_7,
                    axis=Axis(**arg_9),
                    timeUnit=arg_3,
                    arg_4=arg_4
                )
        else:
            if arg_9 is None:
                arg_11 = X(arg_7)
            else:
                arg_11 = X(
                    arg_7,
                    axis=Axis(**arg_9),
                    arg_4=arg_4
                )
        if arg_10 is None:
            arg_12 = Y(arg_8, arg_4=arg_4)
        else:
            arg_12 = Y(
                arg_8,
                axis=Axis(**arg_10),
                arg_4=arg_4
            )
        return arg_11, arg_12


def Func ( arg_0 , arg_1 ) : if arg_0 : if arg_1 : arg_0 = b"" . join ( [ arg_1 , arg_0 ] ) arg_1 = None if b"\n" not in arg_0 : arg_1 = arg_0 arg_0 = None elif not arg_0 . endswith ( b"\n" ) : arg_2 = arg_0 . rindex ( b"\n" ) + 1 arg_1 = arg_0 [ arg_2 : ] arg_0 = arg_0 [ : arg_2 ] return ( arg_0 , arg_1 )

def Func(arg_0, arg_1):
    """It is possible for some of gdb's output to be read before it completely finished its response.
    In that case, a partial mi response was read, which cannot be parsed into structured data.
    We want to ALWAYS parse complete mi records. To do this, we store a buffer of gdb's
    output if the output did not end in a newline.

    Args:
        raw_output: Contents of the gdb mi output
        buf (str): Buffered gdb response from the past. This is incomplete and needs to be prepended to
        gdb's next output.

    Returns:
        (raw_output, buf)
    """

    if arg_0:
        if arg_1:
            # concatenate buffer and new output
            arg_0 = b"".join([arg_1, arg_0])
            arg_1 = None

        if b"\n" not in arg_0:
            # newline was not found, so assume output is incomplete and store in buffer
            arg_1 = arg_0
            arg_0 = None

        elif not arg_0.endswith(b"\n"):
            # raw output doesn't end in a newline, so store everything after the last newline (if anything)
            # in the buffer, and parse everything before it
            arg_2 = arg_0.rindex(b"\n") + 1
            arg_1 = arg_0[arg_2:]
            arg_0 = arg_0[:arg_2]

    return (arg_0, arg_1)

It is possible for some of gdb s output to be read before it completely finished its response . In that case a partial mi response was read which cannot be parsed into structured data . We want to ALWAYS parse complete mi records . To do this we store a buffer of gdb s output if the output did not end in a newline .


def Func(arg_0, **arg_1):
        '''
        Get the Organisation for this board. Returns Organisation object.

        Returns:
            list(Organisation): The organisation attached to this board
        '''
        arg_2 = arg_0.Funcs_json(
            arg_0.base_uri, arg_1=arg_1)

        return arg_0.create_organisation(arg_2)

Get the Organisation for this board . Returns Organisation object .


def Func(arg_0):
        """
        Socket connection.
        """
        if not arg_0._Func:
            arg_0._Func = socket.create_connection(
                (arg_0.host, arg_0.port), arg_0.timeout)
            arg_0.logger.debug('Client connected with guacd server (%s, %s, %s)'
                              % (arg_0.host, arg_0.port, arg_0.timeout))

        return arg_0._Func


def Func(arg_0, arg_1):
        """
        Return an ExtractedLicense object to represent a license object.
        But does not add it to the SPDXDocument model.
        Return None if failed.
        """
        # Grab all possible values
        arg_2 = arg_0.get_extr_license_ident(arg_1)
        arg_3 = arg_0.get_extr_license_text(arg_1)
        arg_4 = arg_0.get_extr_lics_comment(arg_1)
        arg_5 = arg_0.get_extr_lics_xref(arg_1)
        arg_6 = arg_0.get_extr_lic_name(arg_1)

        if not arg_2:
            # Must have identifier
            return

        # Set fields
        # FIXME: the constructor of the license should alwas accept a name
        arg_7 = document.ExtractedLicense(arg_2)
        if arg_3 is not None:
            arg_7.text = arg_3
        if arg_6 is not None:
            arg_7.full_name = arg_6
        if arg_4 is not None:
            arg_7.comment = arg_4
        arg_7.cross_ref = map(lambda x: six.text_type(x), arg_5)
        return arg_7

Return an ExtractedLicense object to represent a license object . But does not add it to the SPDXDocument model . Return None if failed .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , int ) : del ( arg_0 . tiers [ arg_1 - 1 ] ) else : arg_0 . tiers = [ i for i in arg_0 . tiers if i . name != arg_1 ]

def Func(arg_0, arg_1):
        """Remove a tier, when multiple tiers exist with that name only the
        first is removed.

        :param name_num: Name or number of the tier to remove.
        :type name_num: int or str
        :raises IndexError: If there is no tier with that number.
        """
        if isinstance(arg_1, int):
            del(arg_0.tiers[arg_1-1])
        else:
            arg_0.tiers = [i for i in arg_0.tiers if i.name != arg_1]

Remove a tier when multiple tiers exist with that name only the first is removed .


return self._authenticated_request \
            .to_endpoint('folder/{}/'.format(folder)) \
            .return_body() \
            .get()

def
Func
(
arg_0
,
arg_1
)
:
if
not
is_valid_uuid
(
arg_1
)
:
raise
StorageArgumentException
(
'Invalid UUID for folder: {0}'
.
format
(
arg_1
)
)
return
arg_0
.
_authenticated_request
.
to_endpoint
(
'folder/{}/'
.
format
(
arg_1
)
)
.
return_body
(
)
.
get
(
)

def Func(arg_0, arg_1):
        '''Get information on a given folder.

        Args:
            folder (str): The UUID of the requested folder.

        Returns:
            A dictionary of the folder details if found::

                {
                    u'created_by': u'303447',
                    u'created_on': u'2017-03-21T14:06:32.293902Z',
                    u'description': u'',
                    u'entity_type': u'folder',
                    u'modified_by': u'303447',
                    u'modified_on': u'2017-03-21T14:06:32.293967Z',
                    u'name': u'myfolder',
                    u'parent': u'3abd8742-d069-44cf-a66b-2370df74a682',
                    u'uuid': u'2516442e-1e26-4de1-8ed8-94523224cc40'
                }

        Raises:
            StorageArgumentException: Invalid arguments
            StorageForbiddenException: Server response code 403
            StorageNotFoundException: Server response code 404
            StorageException: other 400-600 error codes
        '''
        if not is_valid_uuid(arg_1):
            raise StorageArgumentException(
                'Invalid UUID for folder: {0}'.format(arg_1))
        return arg_0._authenticated_request \
            .to_endpoint('folder/{}/'.format(arg_1)) \
            .return_body() \
            .get()


def Func(arg_0):
    """
    Connectivity builder using Numba for speed boost.
    """
    arg_0 = np.array(arg_0)
    arg_1 = arg_0.prod()
    if len(arg_0) == 2:
        arg_2, arg_3 = np.array(arg_0) +1
        arg_4 = np.zeros((arg_1, 4), dtype = np.int32)
        arg_5 = 0
        arg_6 = np.array([0,1,1+arg_2,arg_2])
        for arg_7 in range(arg_0[1]):
            for arg_8 in range(arg_0[0]):
                arg_4[arg_5] = arg_6 + 1 + arg_8 + arg_7*arg_2
                arg_5 += 1

    if len(arg_0) == 3:
        arg_2, arg_3, arg_9  = np.array(arg_0) +1
        arg_4 = np.zeros((arg_1, 8), dtype = np.int32)
        arg_5 = 0
        arg_6 = np.array([0,1,1+arg_2,arg_2,arg_2*arg_3,1+arg_2*arg_3,1+(arg_2+1)*arg_3,(arg_2+1)*arg_3])
        for arg_10 in range(arg_0[2]):
            for arg_7 in range(arg_0[1]):
                for arg_8 in range(arg_0[0]):
                    arg_4[arg_5] = arg_6 + 1 + arg_8 + arg_7*arg_2+ arg_10*arg_2*arg_3
                    arg_5 += 1
    return arg_4

Connectivity builder using Numba for speed boost .


def Func ( arg_0 ) -> List [ str ] : Func = [ ] arg_2 = Func . append arg_3 = arg_0 . string arg_4 = arg_0 . _match arg_5 = arg_4 . start ( ) for arg_6 , arg_7 in arg_4 . spans ( 'item' ) : arg_2 ( arg_3 [ arg_6 - arg_5 : arg_7 - arg_5 ] ) return Func

def Func(arg_0) -> List[str]:
        """Return items as a list of strings.

        Don't include sub-items and the start pattern.
        """
        Func = []  # type: List[str]
        arg_2 = Func.append
        arg_3 = arg_0.string
        arg_4 = arg_0._match
        arg_5 = arg_4.start()
        for arg_6, arg_7 in arg_4.spans('item'):
            arg_2(arg_3[arg_6 - arg_5:arg_7 - arg_5])
        return Func


(self, username=None, use_config=True, config_filename=None)

def Func(arg_0, arg_1=None, arg_2=True, arg_3=None):
        """Determine the username

        If a username is given, this name is used. Otherwise the configuration
        file will be consulted if `use_config` is set to True. The user is asked
        for the username if the username is not available. Then the username is
        stored in the configuration file.

        :param      username: Username (used directly if given)
        :type       username: ``str``

        :param      use_config: Whether to read username from configuration file
        :type       use_config: ``bool``

        :param      config_filename: Path to the configuration file
        :type       config_filename: ``str``

        """
        if not arg_1 and arg_2:
            if arg_0._config is None:
                arg_0._read_config(arg_3)
            arg_1 = arg_0._config.get("credentials", "username", fallback=None)

        if not arg_1:
            arg_1 = input("Please enter your username: ").strip()
            while not arg_1:
                arg_1 = input("No username specified. Please enter your username: ").strip()
            if 'credendials' not in arg_0._config:
                arg_0._config.add_section('credentials')
            arg_0._config.set("credentials", "username", arg_1)
            arg_0._save_config()

        return arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . size arg_1 . write ( arg_2 . read ( ) ) arg_4 = arg_1 . mem . base arg_5 = Operators . ITEBV ( { 'RDI' : 64 , 'EDI' : 32 , 'DI' : 16 } [ arg_4 ] , arg_0 . DF , - arg_3 // 8 , arg_3 // 8 ) arg_0 . write_register ( arg_4 , arg_0 . read_register ( arg_4 ) + arg_5 )

def Func(arg_0, arg_1, arg_2):
        """
        Stores String.

        Stores a byte, word, or doubleword from the AL, AX, or EAX register,
        respectively, into the destination operand. The destination operand is
        a memory location, the address of which is read from either the ES:EDI
        or the ES:DI registers (depending on the address-size attribute of the
        instruction, 32 or 16, respectively). The ES segment cannot be overridden
        with a segment override prefix.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_3 = arg_2.size
        arg_1.write(arg_2.read())
        arg_4 = arg_1.mem.base
        arg_5 = Operators.ITEBV({'RDI': 64, 'EDI': 32, 'DI': 16}[arg_4], arg_0.DF, -arg_3 // 8, arg_3 // 8)
        arg_0.write_register(arg_4, arg_0.read_register(arg_4) + arg_5)


return {
            key: value for key, value in all_types.items() if key in duplicated_objects
        }

def Func ( arg_0 ) : arg_1 = set ( ) arg_2 = collections . defaultdict ( set ) for arg_3 in arg_0 . values : if not isinstance ( arg_3 , astroid . Call ) or len ( arg_3 . args ) != 2 : continue arg_4 = utils . safe_infer ( arg_3 . func ) if not arg_4 or not utils . is_builtin_object ( arg_4 ) : continue if arg_4 . name != "isinstance" : continue arg_5 = arg_3 . args [ 0 ] . as_string ( ) arg_6 = arg_3 . args [ 1 ] if arg_5 in arg_2 : arg_1 . add ( arg_5 ) if isinstance ( arg_6 , astroid . Tuple ) : arg_7 = [ class_type . as_string ( ) for class_type in arg_6 . itered ( ) ] else : arg_7 = [ arg_6 . as_string ( ) ] arg_2 [ arg_5 ] . update ( arg_7 ) return { arg_8 : arg_9 for arg_8 , arg_9 in arg_2 . items ( ) if arg_8 in arg_1 }

def Func(arg_0):
        """Get the duplicated types from the underlying isinstance calls.

        :param astroid.BoolOp node: Node which should contain a bunch of isinstance calls.
        :returns: Dictionary of the comparison objects from the isinstance calls,
                  to duplicate values from consecutive calls.
        :rtype: dict
        """
        arg_1 = set()
        arg_2 = collections.defaultdict(set)

        for arg_3 in arg_0.values:
            if not isinstance(arg_3, astroid.Call) or len(arg_3.args) != 2:
                continue

            arg_4 = utils.safe_infer(arg_3.func)
            if not arg_4 or not utils.is_builtin_object(arg_4):
                continue

            if arg_4.name != "isinstance":
                continue

            arg_5 = arg_3.args[0].as_string()
            arg_6 = arg_3.args[1]

            if arg_5 in arg_2:
                arg_1.add(arg_5)

            if isinstance(arg_6, astroid.Tuple):
                arg_7 = [
                    class_type.as_string() for class_type in arg_6.itered()
                ]
            else:
                arg_7 = [arg_6.as_string()]
            arg_2[arg_5].update(arg_7)

        # Remove all keys which not duplicated
        return {
            arg_8: arg_9 for arg_8, arg_9 in arg_2.items() if arg_8 in arg_1
        }

Get the duplicated types from the underlying isinstance calls .


def
Func
(
arg_0
,
arg_1
)
:
import
random
import
ejson
arg_1
(
'200 OK'
,
[
(
'Content-Type'
,
'application/json; charset=UTF-8'
)
,
]
+
common_headers
(
arg_0
)
,
)
yield
ejson
.
dumps
(
collections
.
OrderedDict
(
[
(
'websocket'
,
True
)
,
(
'origins'
,
[
'*:*'
,
]
)
,
(
'cookie_needed'
,
False
)
,
(
'entropy'
,
random
.
getrandbits
(
32
)
)
,
]
)
)

def Func(arg_0, arg_1):
    """Inform client that WebSocket service is available."""
    import random
    import ejson

    arg_1(
        '200 OK',
        [
            ('Content-Type', 'application/json; charset=UTF-8'),
        ] + common_headers(arg_0),
    )
    yield ejson.dumps(collections.OrderedDict([
        ('websocket', True),
        ('origins', [
            '*:*',
        ]),
        ('cookie_needed', False),
        ('entropy', random.getrandbits(32)),
    ]))

Inform client that WebSocket service is available .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if not arg_0 . file_license_comment_set : arg_0 . file_license_comment_set = True if validations . validate_file_lics_comment ( arg_2 ) : arg_0 . file ( arg_1 ) . license_comment = str_from_text ( arg_2 ) else : raise SPDXValueError ( 'File::LicenseComment' ) else : raise CardinalityError ( 'File::LicenseComment' ) else : raise OrderError ( 'File::LicenseComment' )

def Func(arg_0, arg_1, arg_2):
        """
        Raises OrderError if no package or file defined.
        Raises SPDXValueError if text is not free form text.
        Raises CardinalityError if more than one per file.
        """
        if arg_0.has_package(arg_1) and arg_0.has_file(arg_1):
            if not arg_0.file_license_comment_set:
                arg_0.file_license_comment_set = True
                if validations.validate_file_lics_comment(arg_2):
                    arg_0.file(arg_1).license_comment = str_from_text(arg_2)
                else:
                    raise SPDXValueError('File::LicenseComment')
            else:
                raise CardinalityError('File::LicenseComment')
        else:
            raise OrderError('File::LicenseComment')

Raises OrderError if no package or file defined . Raises SPDXValueError if text is not free form text . Raises CardinalityError if more than one per file .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
1
)
:
tl
.
logging
.
info
(
"Creating vocabulary."
)
arg_3
=
Counter
(
)
for
arg_4
in
arg_0
:
arg_3
.
update
(
arg_4
)
tl
.
logging
.
info
(
"    Total words: %d"
%
len
(
arg_3
)
)
arg_5
=
[
x
for
x
in
arg_3
.
items
(
)
if
x
[
1
]
>=
arg_2
]
arg_5
.
sort
(
key
=
lambda
x
:
x
[
1
]
,
reverse
=
True
)
arg_5
=
[
(
"<PAD>"
,
0
)
]
+
arg_5
tl
.
logging
.
info
(
"    Words in vocabulary: %d"
%
len
(
arg_5
)
)
with
tf
.
gfile
.
FastGFile
(
arg_1
,
"w"
)
as
f
:
f
.
write
(
"\n"
.
join
(
[
"%s %d"
%
(
arg_6
,
arg_4
)
for
arg_6
,
arg_4
in
arg_5
]
)
)
tl
.
logging
.
info
(
"    Wrote vocabulary file: %s"
%
arg_1
)
arg_7
=
[
x
[
0
]
for
x
in
arg_5
]
arg_8
=
len
(
arg_7
)
arg_9
=
dict
(
[
(
x
,
y
)
for
(
y
,
x
)
in
enumerate
(
arg_7
)
]
)
arg_10
=
SimpleVocabulary
(
arg_9
,
arg_8
)
return
arg_10

def Func(arg_0, arg_1, arg_2=1):
    """Creates the vocabulary of word to word_id.

    See ``tutorial_tfrecord3.py``.

    The vocabulary is saved to disk in a text file of word counts. The id of each
    word in the file is its corresponding 0-based line number.

    Parameters
    ------------
    sentences : list of list of str
        All sentences for creating the vocabulary.
    word_counts_output_file : str
        The file name.
    min_word_count : int
        Minimum number of occurrences for a word.

    Returns
    --------
    :class:`SimpleVocabulary`
        The simple vocabulary object, see :class:`Vocabulary` for more.

    Examples
    --------
    Pre-process sentences

    >>> captions = ["one two , three", "four five five"]
    >>> processed_capts = []
    >>> for c in captions:
    >>>     c = tl.nlp.process_sentence(c, start_word="<S>", end_word="</S>")
    >>>     processed_capts.append(c)
    >>> print(processed_capts)
    ...[['<S>', 'one', 'two', ',', 'three', '</S>'], ['<S>', 'four', 'five', 'five', '</S>']]

    Create vocabulary

    >>> tl.nlp.Func(processed_capts, word_counts_output_file='vocab.txt', min_word_count=1)
    Creating vocabulary.
      Total words: 8
      Words in vocabulary: 8
      Wrote vocabulary file: vocab.txt

    Get vocabulary object

    >>> vocab = tl.nlp.Vocabulary('vocab.txt', start_word="<S>", end_word="</S>", unk_word="<UNK>")
    INFO:tensorflow:Initializing vocabulary from file: vocab.txt
    [TL] Vocabulary from vocab.txt : <S> </S> <UNK>
    vocabulary with 10 words (includes start_word, end_word, unk_word)
        start_id: 2
        end_id: 3
        unk_id: 9
        pad_id: 0

    """
    tl.logging.info("Creating vocabulary.")

    arg_3 = Counter()

    for arg_4 in arg_0:
        arg_3.update(arg_4)
        # tl.logging.info('c',c)
    tl.logging.info("    Total words: %d" % len(arg_3))

    # Filter uncommon words and sort by descending count.
    arg_5 = [x for x in arg_3.items() if x[1] >= arg_2]
    arg_5.sort(key=lambda x: x[1], reverse=True)
    arg_5 = [("<PAD>", 0)] + arg_5  # 1st id should be reserved for padding
    # tl.logging.info(word_counts)
    tl.logging.info("    Words in vocabulary: %d" % len(arg_5))

    # Write out the word counts file.
    with tf.gfile.FastGFile(arg_1, "w") as f:
        f.write("\n".join(["%s %d" % (arg_6, arg_4) for arg_6, arg_4 in arg_5]))
    tl.logging.info("    Wrote vocabulary file: %s" % arg_1)

    # Create the vocabulary dictionary.
    arg_7 = [x[0] for x in arg_5]
    arg_8 = len(arg_7)
    arg_9 = dict([(x, y) for (y, x) in enumerate(arg_7)])
    arg_10 = SimpleVocabulary(arg_9, arg_8)

    return arg_10

Creates the vocabulary of word to word_id.

    See ``tutorial_tfrecord3.py``.

    The vocabulary is saved to disk in a text file of word counts. The id of each
    word in the file is its corresponding 0-based line number.

    Parameters
    ------------
    sentences : list of list of str
        All sentences for creating the vocabulary.
    word_counts_output_file : str
        The file name.
    min_word_count : int
        Minimum number of occurrences for a word.

    Returns
    --------
    :class:`SimpleVocabulary`
        The simple vocabulary object, see :class:`Vocabulary` for more.

    Examples
    --------
    Pre-process sentences

    >>> captions = ["one two , three", "four five five"]
    >>> processed_capts = []
    >>> for c in captions:
    >>>     c = tl.nlp.process_sentence(c, start_word="<S>", end_word="</S>")
    >>>     processed_capts.append(c)
    >>> print(processed_capts)
    ...[['<S>', 'one', 'two', ',', 'three', '</S>'], ['<S>', 'four', 'five', 'five', '</S>']]

    Create vocabulary

    >>> tl.nlp.create_vocab(processed_capts, word_counts_output_file='vocab.txt', min_word_count=1)
    Creating vocabulary.
      Total words: 8
      Words in vocabulary: 8
      Wrote vocabulary file: vocab.txt

    Get vocabulary object

    >>> vocab = tl.nlp.Vocabulary('vocab.txt', start_word="<S>", end_word="</S>", unk_word="<UNK>")
    INFO:tensorflow:Initializing vocabulary from file: vocab.txt
    [TL] Vocabulary from vocab.txt : <S> </S> <UNK>
    vocabulary with 10 words (includes start_word, end_word, unk_word)
        start_id: 2
        end_id: 3
        unk_id: 9
        pad_id: 0

Creates the vocabulary of word to word_id .


def Func(arg_0, arg_1, arg_2):
    """ Takes a hls color and converts to proper hue
        Bulbs use a BGR order instead of RGB """
    if arg_1 > 0.95: #too bright, let's just switch to white
        return 256
    elif arg_1 < 0.05: #too dark, let's shut it off
        return -1
    else:
        arg_0 = (-arg_0 + 1 + 2.0/3.0) % 1 # invert and translate by 2/3
        return int(floor(arg_0 * 256))


(sequence, batch_size, mod = 0, randomize = False)

return [sequence[x:x + batch_size] for x in xrange(0, len(sequence)-mod, batch_size)]

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = False ) : if arg_3 : arg_0 = random . sample ( arg_0 , len ( arg_0 ) ) return [ arg_0 [ arg_4 : arg_4 + arg_1 ] for arg_4 in xrange ( 0 , len ( arg_0 ) - arg_2 , arg_1 ) ]

def Func(arg_0, arg_1, arg_2 = 0, arg_3 = False):
    '''
    Converts a list into a list of lists with equal batch_size.

    Parameters
    ----------
    sequence : list
        list of items to be placed in batches
    batch_size : int
        length of each sub list
    mod : int
        remainder of list length devided by batch_size
        mod = len(sequence) % batch_size
    randomize = bool
        should the initial sequence be randomized before being batched

    '''

    if arg_3:
        arg_0 = random.sample(arg_0, len(arg_0))

    return [arg_0[arg_4:arg_4 + arg_1] for arg_4 in xrange(0, len(arg_0)-arg_2, arg_1)]

Converts a list into a list of lists with equal batch_size .


def Func ( arg_0 , arg_1 ) : arg_2 = parse_qs ( urlsplit ( arg_1 ) . query ) return arg_2 . get ( 'q' )

def Func(arg_0, arg_1):
        """
        Extract "real" URL from Google redirected url by getting `q`
        querystring parameter.
        """
        arg_2 = parse_qs(urlsplit(arg_1).query)
        return arg_2.get('q')

Extract real URL from Google redirected url by getting q querystring parameter .


def Func ( arg_0 , arg_1 = False , arg_2 = 8 ) : if not arg_1 and '.' in arg_0 : arg_0 , arg_3 = arg_0 . rsplit ( '.' ) arg_3 = '.{}' . format ( arg_3 ) else : arg_3 = '' for arg_4 , arg_5 in reversed ( list ( enumerate ( arg_0 ) ) ) : if arg_5 not in string . digits : break arg_6 , arg_7 = arg_0 [ : arg_4 + 1 ] , arg_0 [ arg_4 + 1 : ] arg_7 = str ( int ( arg_7 or 0 ) + 1 ) if len ( arg_7 ) + len ( arg_6 ) > arg_2 : arg_6 = arg_6 [ : arg_2 - len ( arg_7 ) ] return '' . join ( [ arg_6 , arg_7 , arg_3 ] )

def Func(arg_0, arg_1=False, arg_2=8):
    """Increment an ISO name to avoid name collision.

    Example:
        >>> Func('foo.txt')
        'foo1.txt'
        >>> Func('bar10')
        'bar11'
        >>> Func('bar99', max_length=5)
        'ba100'
    """
    # Split the extension if needed
    if not arg_1 and '.' in arg_0:
        arg_0, arg_3 = arg_0.rsplit('.')
        arg_3 = '.{}'.format(arg_3)
    else:
        arg_3 = ''

    # Find the position of the last letter
    for arg_4, arg_5 in reversed(list(enumerate(arg_0))):
        if arg_5 not in string.digits:
            break

    # Extract the numbers and the text from the name
    arg_6, arg_7 = arg_0[:arg_4+1], arg_0[arg_4+1:]
    arg_7 = str(int(arg_7 or 0) + 1)

    # Crop the text if the numbers are too long
    if len(arg_7) + len(arg_6) > arg_2:
        arg_6 = arg_6[:arg_2 - len(arg_7)]

    # Return the name with the extension
    return ''.join([arg_6, arg_7, arg_3])

Increment an ISO name to avoid name collision.

    Example:
        >>> iso_name_increment('foo.txt')
        'foo1.txt'
        >>> iso_name_increment('bar10')
        'bar11'
        >>> iso_name_increment('bar99', max_length=5)
        'ba100'

Increment an ISO name to avoid name collision .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
0
)
:
arg_0
.
log
.
debug
(
"creating overlayed sweeps plot"
)
arg_0
.
figure
(
)
for
arg_3
in
range
(
arg_0
.
abf
.
sweeps
)
:
arg_0
.
abf
.
setsweep
(
arg_3
)
arg_0
.
setColorBySweep
(
)
plt
.
plot
(
arg_0
.
abf
.
sweepX2
+
arg_3
*
arg_1
,
arg_0
.
abf
.
sweepY
+
arg_3
*
arg_2
,
**
arg_0
.
kwargs
)
if
arg_1
:
arg_0
.
marginX
=
.05
arg_0
.
decorate
(
)

def Func(arg_0, arg_1=0, arg_2=0):
        """plot every sweep of an ABF file."""
        arg_0.log.debug("creating overlayed sweeps plot")
        arg_0.figure()
        for arg_3 in range(arg_0.abf.sweeps):
            arg_0.abf.setsweep(arg_3)
            arg_0.setColorBySweep()
            plt.plot(arg_0.abf.sweepX2+arg_3*arg_1,
                     arg_0.abf.sweepY+arg_3*arg_2,
                     **arg_0.kwargs)
        if arg_1:
            arg_0.marginX=.05
        arg_0.decorate()


def Func(arg_0):
        """Asserts that val is an existing path to a file."""
        arg_0.exists()
        if not os.path.isfile(arg_0.val):
            arg_0._err('Expected <%s> to be a file, but was not.' % arg_0.val)
        return arg_0

Asserts that val is an existing path to a file .


def Func(arg_0):
    """A decorator to simplify the context management of simple object
    attributes. Gets the value of the attribute prior to setting it, and stores
    a function to set the value to the old value in the HistoryManager.
    """

    def wrapper(arg_1, arg_2):
        arg_3 = get_context(arg_1)
        if arg_3:
            arg_4 = getattr(arg_1, arg_0.__name__)
            # Don't clutter the context with unchanged variables
            if arg_4 == arg_2:
                return
            arg_3(partial(arg_0, arg_1, arg_4))

        arg_0(arg_1, arg_2)

    return wrapper

A decorator to simplify the context management of simple object attributes . Gets the value of the attribute prior to setting it and stores a function to set the value to the old value in the HistoryManager .


def
Func
(
arg_0
)
:
arg_1
,
arg_2
,
arg_3
=
Func_project_group_or_local
(
arg_0
.
obj
.
Func
(
'project'
)
,
arg_0
.
obj
.
Func
(
'group'
)
)
try
:
arg_4
=
PolyaxonClient
(
)
.
experiment_group
.
Func_experiment_group
(
arg_1
,
arg_2
,
arg_3
)
cache
.
cache
(
config_manager
=
GroupManager
,
arg_4
=
arg_4
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not Func experiment group `{}`.'
.
format
(
arg_3
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
Func_group_details
(
arg_4
)

def Func(arg_0):
    """Get experiment group by uuid.

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

    Examples:

    \b
    ```bash
    $ polyaxon group -g 13 Func
    ```
    """
    arg_1, arg_2, arg_3 = Func_project_group_or_local(arg_0.obj.Func('project'),
                                                            arg_0.obj.Func('group'))
    try:
        arg_4 = PolyaxonClient().experiment_group.Func_experiment_group(
            arg_1, arg_2, arg_3)
        cache.cache(config_manager=GroupManager, arg_4=arg_4)
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func experiment group `{}`.'.format(arg_3))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    Func_group_details(arg_4)

Get experiment group by uuid.

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

    Examples:

    \b
    ```bash
    $ polyaxon group -g 13 get
    ```


def Func ( arg_0 : arg_1 [ arg_2 , arg_3 , arg_4 ] ) -> None : arg_5 = build_model ( arg_0 ) while True : arg_6 = [ ] for arg_7 in arg_5 . in_x : arg_6 . append ( ( input ( '{}::' . format ( arg_7 ) ) , ) ) if arg_6 [ - 1 ] [ 0 ] in { 'exit' , 'stop' , 'quit' , 'q' } : return arg_8 = arg_5 ( * arg_6 ) if len ( arg_5 . out_params ) > 1 : arg_8 = zip ( * arg_8 ) print ( '>>' , * arg_8 )

def Func(arg_0: arg_1[arg_2, arg_3, arg_4]) -> None:
    """Start interaction with the model described in corresponding configuration file."""
    arg_5 = build_model(arg_0)

    while True:
        arg_6 = []
        for arg_7 in arg_5.in_x:
            arg_6.append((input('{}::'.format(arg_7)),))
            # check for exit command
            if arg_6[-1][0] in {'exit', 'stop', 'quit', 'q'}:
                return

        arg_8 = arg_5(*arg_6)
        if len(arg_5.out_params) > 1:
            arg_8 = zip(*arg_8)

        print('>>', *arg_8)

Start interaction with the model described in corresponding configuration file .


(data, eps=None, min_samples=None,
                   n_clusters=None, maxiter=200, **kwargs)

def Func(arg_0, arg_1=None, arg_2=None,
                   arg_3=None, arg_4=200, **arg_5):
    """
    Identify clusters using DBSCAN algorithm.

    Parameters
    ----------
    data : array_like
        array of size [n_samples, n_features].
    eps : float
        The minimum 'distance' points must be apart for them to be in the
        same cluster. Defaults to 0.3. Note: If the data are normalised
        (they should be for DBSCAN) this is in terms of total sample
        variance.  Normalised data have a mean of 0 and a variance of 1.
    min_samples : int
        The minimum number of samples within distance `eps` required
        to be considered as an independent cluster.
    n_clusters : int
        The number of clusters expected. If specified, `eps` will be
        incrementally reduced until the expected number of clusters is
        found.
    maxiter : int
        The maximum number of iterations DBSCAN will run.

    Returns
    -------
    dict
        boolean array for each identified cluster and core samples.
    """
    if arg_3 is None:
        if arg_1 is None:
            arg_1 = 0.3
        arg_6 = cl.DBSCAN(arg_1=arg_1, arg_2=arg_2, **arg_5).fit(arg_0)
    else:
        arg_7 = 0
        arg_8 = 1 / .95
        arg_9 = 0
        while arg_7 < arg_3:
            arg_10 = arg_7
            arg_8 *= 0.95
            arg_6 = cl.DBSCAN(arg_1=arg_8, arg_2=arg_2, **arg_5).fit(arg_0)
            arg_7 = (len(set(arg_6.labels_)) -
                        (1 if -1 in arg_6.labels_ else 0))
            if arg_7 < arg_10:
                arg_8 *= 1 / 0.95
                arg_6 = cl.DBSCAN(arg_1=arg_8, arg_2=arg_2, **arg_5).fit(arg_0)
                arg_7 = (len(set(arg_6.labels_)) -
                            (1 if -1 in arg_6.labels_ else 0))
                warnings.warn(('\n\n***Unable to find {:.0f} clusters in '
                                'data. Found {:.0f} with an eps of {:.2e}'
                                '').format(arg_3, arg_7, arg_8))
                break
            arg_9 += 1
            if arg_9 == arg_4:
                warnings.warn(('\n\n***Maximum iterations ({:.0f}) reached'
                                ', {:.0f} clusters not found.\nDeacrease '
                                'min_samples or n_clusters (or increase '
                                'maxiter).').format(arg_4, arg_3))
                break

    arg_11 = arg_6.labels_

    arg_12 = np.zeros_like(arg_11)
    arg_12[arg_6.core_sample_indices_] = True

    return arg_11, arg_12

Identify clusters using DBSCAN algorithm .


(
    var_name: str, ns_name: str, py_var_ctx: ast.AST
)

return GeneratedPyAST(
        node=ast.Attribute(
            value=ast.Call(
                func=_FIND_VAR_FN_NAME,
                args=[
                    ast.Call(
                        func=_NEW_SYM_FN_NAME,
                        args=[ast.Str(var_name)],
                        keywords=[ast.keyword(arg="ns", value=ast.Str(ns_name))],
                    )
                ],
                keywords=[],
            ),
            attr="value",
            ctx=py_var_ctx,
        )
    )

def Func ( arg_0 : arg_1 , arg_2 : arg_1 , arg_3 : arg_4 . AST ) -> GeneratedPyAST : return GeneratedPyAST ( node = arg_4 . Attribute ( value = arg_4 . Call ( func = _FIND_VAR_FN_NAME , args = [ arg_4 . Call ( func = _NEW_SYM_FN_NAME , args = [ arg_4 . Str ( arg_0 ) ] , keywords = [ arg_4 . keyword ( arg = "ns" , value = arg_4 . Str ( arg_2 ) ) ] , ) ] , keywords = [ ] , ) , attr = "value" , ctx = arg_3 , ) )

def Func(
    arg_0: arg_1, arg_2: arg_1, arg_3: arg_4.AST
) -> GeneratedPyAST:
    """Generate Var.find calls for the named symbol."""
    return GeneratedPyAST(
        node=arg_4.Attribute(
            value=arg_4.Call(
                func=_FIND_VAR_FN_NAME,
                args=[
                    arg_4.Call(
                        func=_NEW_SYM_FN_NAME,
                        args=[arg_4.Str(arg_0)],
                        keywords=[arg_4.keyword(arg="ns", value=arg_4.Str(arg_2))],
                    )
                ],
                keywords=[],
            ),
            attr="value",
            ctx=arg_3,
        )
    )

Generate Var . find calls for the named symbol .


def Func ( arg_0 ) : if not arg_0 : return False arg_1 = arg_0 . splitlines ( ) [ - 1 ] return ( arg_1 == '' ) or arg_1 . isspace ( )

def Func(arg_0):
    """Determine if the input source ends in a blank.

    A blank is either a newline or a line consisting of whitespace.

    Parameters
    ----------
    src : string
      A single or multiline string.
    """
    if not arg_0: return False
    arg_1  = arg_0.splitlines()[-1]
    return (arg_1 == '') or arg_1.isspace()

Determine if the input source ends in a blank .


def Func ( arg_0 , ** arg_1 ) : arg_2 = { } try : arg_3 = describe_vpc_classic_link ( VpcIds = [ arg_0 [ "id" ] ] , ** arg_1 ) [ 0 ] arg_2 [ "Enabled" ] = arg_3 [ "ClassicLinkEnabled" ] arg_4 = describe_vpc_classic_link_dns_support ( VpcIds = [ arg_0 [ "id" ] ] , ** arg_1 ) [ 0 ] arg_2 [ "DnsEnabled" ] = arg_4 [ "ClassicLinkDnsSupported" ] except ClientError as e : if 'UnsupportedOperation' not in str ( e ) : raise e return arg_2

def Func(arg_0, **arg_1):
    """Gets the Classic Link details about a VPC"""
    arg_2 = {}

    try:
        arg_3 = describe_vpc_classic_link(VpcIds=[arg_0["id"]], **arg_1)[0]
        arg_2["Enabled"] = arg_3["ClassicLinkEnabled"]

        # Check for DNS as well:
        arg_4 = describe_vpc_classic_link_dns_support(VpcIds=[arg_0["id"]], **arg_1)[0]
        arg_2["DnsEnabled"] = arg_4["ClassicLinkDnsSupported"]
    except ClientError as e:
        # This is not supported for all regions.
        if 'UnsupportedOperation' not in str(e):
            raise e

    return arg_2


def Func(arg_0, arg_1=None):
        """Acquire a write lock for the current thread, waiting at most
        timeout seconds or doing a non-blocking check in case timeout is <= 0.

        In case the write lock cannot be serviced due to the deadlock
        condition mentioned above, a ValueError is raised.

        In case timeout is None, the call to Func blocks until the
        lock request can be serviced.

        In case the timeout expires before the lock could be serviced, a
        RuntimeError is thrown."""

        if arg_1 is not None:
            arg_2 = time() + arg_1
        arg_3, arg_4 = currentThread(), False
        arg_0.__condition.acquire()
        try:
            if arg_0.__writer is arg_3:
                # If we are the writer, grant a new write lock, always.
                arg_0.__writercount += 1
                return
            elif arg_3 in arg_0.__readers:
                # If we are a reader, no need to add us to pendingwriters,
                # we get the upgradewriter slot.
                if arg_0.__upgradewritercount:
                    # If we are a reader and want to upgrade, and someone
                    # else also wants to upgrade, there is no way we can do
                    # this except if one of us releases all his read locks.
                    # Signal this to user.
                    raise ValueError("Inevitable dead lock, denying write lock")
                arg_4 = True
                arg_0.__upgradewritercount = arg_0.__readers.pop(arg_3)
            else:
                # We aren't a reader, so add us to the pending writers queue
                # for synchronization with the readers.
                arg_0.__pendingwriters.append(arg_3)
            while True:
                if not arg_0.__readers and arg_0.__writer is None:
                    # Only test anything if there are no readers and writers.
                    if arg_0.__upgradewritercount:
                        if arg_4:
                            # There is a writer to upgrade, and it's us. Take
                            # the write lock.
                            arg_0.__writer = arg_3
                            arg_0.__writercount = arg_0.__upgradewritercount + 1
                            arg_0.__upgradewritercount = 0
                            return
                        # There is a writer to upgrade, but it's not us.
                        # Always leave the upgrade writer the advance slot,
                        # because he presumes he'll get a write lock directly
                        # from a previously held read lock.
                    elif arg_0.__pendingwriters[0] is arg_3:
                        # If there are no readers and writers, it's always
                        # fine for us to take the writer slot, removing us
                        # from the pending writers queue.
                        # This might mean starvation for readers, though.
                        arg_0.__writer = arg_3
                        arg_0.__writercount = 1
                        arg_0.__pendingwriters = arg_0.__pendingwriters[1:]
                        return
                if arg_1 is not None:
                    arg_9 = arg_2 - time()
                    if arg_9 <= 0:
                        # Timeout has expired, signal caller of this.
                        if arg_4:
                            # Put us back on the reader queue. No need to
                            # signal anyone of this change, because no other
                            # writer could've taken our spot before we got
                            # here (because of remaining readers), as the test
                            # for proper conditions is at the start of the
                            # loop, not at the end.
                            arg_0.__readers[arg_3] = arg_0.__upgradewritercount
                            arg_0.__upgradewritercount = 0
                        else:
                            # We were a simple pending writer, just remove us
                            # from the FIFO list.
                            arg_0.__pendingwriters.remove(arg_3)
                        raise RuntimeError("Acquiring write lock timed out")
                    arg_0.__condition.wait(arg_9)
                else:
                    arg_0.__condition.wait()
        finally:
            arg_0.__condition.release()

Acquire a write lock for the current thread, waiting at most
        timeout seconds or doing a non-blocking check in case timeout is <= 0.

        In case the write lock cannot be serviced due to the deadlock
        condition mentioned above, a ValueError is raised.

        In case timeout is None, the call to acquire_write blocks until the
        lock request can be serviced.

        In case the timeout expires before the lock could be serviced, a
        RuntimeError is thrown.

Acquire a write lock for the current thread waiting at most timeout seconds or doing a non - blocking check in case timeout is < = 0 .


def Func(arg_0):
        """Authenticate with the Bitfinex API.

        :return:
        """
        if not arg_0.key and not arg_0.secret:
            raise ValueError("Must supply both key and secret key for API!")
        arg_0.channel_configs['auth'] = {'api_key': arg_0.key, 'secret': arg_0.secret}
        arg_0.conn.send(api_key=arg_0.key, secret=arg_0.secret, auth=True)


def Func(arg_0, **arg_1):
        """
        Get the external ids that we have stored for a TV season by season
        number.

        Args:
            language: (optional) ISO 639 code.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_series_id_season_number_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the external ids that we have stored for a TV season by season number .


def Func ( arg_0 ) : assert not arg_0 . _has_responded arg_0 . trigger ( event . TOUCH , message = arg_0 )

def Func(arg_0):
        """
        Respond to ``nsqd`` that you need more time to process the message.
        """
        assert not arg_0._has_responded
        arg_0.trigger(event.TOUCH, message=arg_0)

Respond to nsqd that you need more time to process the message .


def Func(arg_0, arg_1):
        """Prepares the trajectory to explore the parameter space.

        To explore the parameter space you need to provide a dictionary with the names of the
        parameters to explore as keys and iterables specifying the exploration ranges as values.

        All iterables need to have the same length otherwise a ValueError is raised.
        A ValueError is also raised if the names from the dictionary map to groups or results
        and not parameters.

        If your trajectory is already explored but not stored yet and your parameters are
        not locked you can add new explored parameters to the current ones if their
        iterables match the current length of the trajectory.

        Raises an AttributeError if the names from the dictionary are not found at all in
        the trajectory and NotUniqueNodeError if the keys not unambiguously map
        to single parameters.

        Raises a TypeError if the trajectory has been stored already, please use
        :func:`~pypet.trajectory.Trajectory.f_expand` then instead.

        Example usage:

        >>> traj.Func({'groupA.param1' : [1,2,3,4,5], 'groupA.param2':['a','b','c','d','e']})

        Could also be called consecutively:

        >>> traj.Func({'groupA.param1' : [1,2,3,4,5]})
        >>> traj.Func({'groupA.param2':['a','b','c','d','e']})

        NOTE:

        Since parameters are very conservative regarding the data they accept
        (see :ref:`type_conservation`), you sometimes won't be able to use Numpy arrays
        for exploration as iterables.

        For instance, the following code snippet won't work:

        ::

            import numpy a np
            from pypet.trajectory import Trajectory
            traj = Trajectory()
            traj.f_add_parameter('my_float_parameter', 42.4,
                                 comment='My value is a standard python float')

            traj.Func( { 'my_float_parameter': np.arange(42.0, 44.876, 0.23) } )

        This will result in a `TypeError` because your exploration iterable
        `np.arange(42.0, 44.876, 0.23)` contains `numpy.float64` values
        whereas you parameter is supposed to use standard python floats.

        Yet, you can use Numpys `tolist()` function to overcome this problem:

        ::

            traj.Func( { 'my_float_parameter': np.arange(42.0, 44.876, 0.23).tolist() } )

        Or you could specify your parameter directly as a numpy float:

        ::

            traj.f_add_parameter('my_float_parameter', np.float64(42.4),
                                   comment='My value is a numpy 64 bit float')

        """
        for arg_2 in range(len(arg_0)):
            if arg_0.f_is_completed(arg_2):
                raise TypeError('You cannot explore a trajectory which has been explored before, '
                                'please use `f_expand` instead.')

        arg_3 = []
        try:
            arg_4 = len(arg_0)
            for arg_5, arg_6 in arg_1.items():
                arg_7 = arg_0.f_get(arg_5)
                if not arg_7.v_is_leaf or not arg_7.v_is_parameter:
                    raise ValueError('%s is not an appropriate search string for a parameter.' % arg_5)

                arg_7.f_unlock()

                arg_7._explore(arg_6)
                arg_3.append(arg_7)

                arg_8 = arg_7.v_full_name
                arg_0._explored_parameters[arg_8] = arg_7

                arg_7._explored = True

                # Compare the length of two consecutive parameters in the `build_dict`
                if len(arg_0._explored_parameters) == 1:
                    arg_4 = arg_7.f_get_range_length()
                elif not arg_4 == arg_7.f_get_range_length():
                    raise ValueError('The parameters to explore have not the same size!')

            for arg_11 in range(arg_4):
                arg_0._add_run_info(arg_11)
            arg_0._test_run_addition(arg_4)

        except Exception:
            # Remove the added parameters again
            for arg_12 in arg_3:
                arg_12.f_unlock()
                arg_12._shrink()
                arg_12._explored = False
                arg_8 = arg_12.v_full_name
                del arg_0._explored_parameters[arg_8]
            if len(arg_0._explored_parameters) == 0:
                arg_0.f_shrink(force=True)
            raise

Prepares the trajectory to explore the parameter space.

        To explore the parameter space you need to provide a dictionary with the names of the
        parameters to explore as keys and iterables specifying the exploration ranges as values.

        All iterables need to have the same length otherwise a ValueError is raised.
        A ValueError is also raised if the names from the dictionary map to groups or results
        and not parameters.

        If your trajectory is already explored but not stored yet and your parameters are
        not locked you can add new explored parameters to the current ones if their
        iterables match the current length of the trajectory.

        Raises an AttributeError if the names from the dictionary are not found at all in
        the trajectory and NotUniqueNodeError if the keys not unambiguously map
        to single parameters.

        Raises a TypeError if the trajectory has been stored already, please use
        :func:`~pypet.trajectory.Trajectory.f_expand` then instead.

        Example usage:

        >>> traj.f_explore({'groupA.param1' : [1,2,3,4,5], 'groupA.param2':['a','b','c','d','e']})

        Could also be called consecutively:

        >>> traj.f_explore({'groupA.param1' : [1,2,3,4,5]})
        >>> traj.f_explore({'groupA.param2':['a','b','c','d','e']})

        NOTE:

        Since parameters are very conservative regarding the data they accept
        (see :ref:`type_conservation`), you sometimes won't be able to use Numpy arrays
        for exploration as iterables.

        For instance, the following code snippet won't work:

        ::

            import numpy a np
            from pypet.trajectory import Trajectory
            traj = Trajectory()
            traj.f_add_parameter('my_float_parameter', 42.4,
                                 comment='My value is a standard python float')

            traj.f_explore( { 'my_float_parameter': np.arange(42.0, 44.876, 0.23) } )

        This will result in a `TypeError` because your exploration iterable
        `np.arange(42.0, 44.876, 0.23)` contains `numpy.float64` values
        whereas you parameter is supposed to use standard python floats.

        Yet, you can use Numpys `tolist()` function to overcome this problem:

        ::

            traj.f_explore( { 'my_float_parameter': np.arange(42.0, 44.876, 0.23).tolist() } )

        Or you could specify your parameter directly as a numpy float:

        ::

            traj.f_add_parameter('my_float_parameter', np.float64(42.4),
                                   comment='My value is a numpy 64 bit float')

Prepares the trajectory to explore the parameter space .


def
Func
(
arg_0
,
arg_1
)
:
def
weighted_choice
(
arg_2
)
:
arg_3
=
sum
(
arg_7
for
arg_6
,
arg_7
in
arg_2
)
arg_4
=
random
.
uniform
(
0
,
arg_3
)
arg_5
=
0
for
arg_6
,
arg_7
in
arg_2
:
if
arg_5
+
arg_7
>=
arg_4
:
return
arg_6
arg_5
+=
arg_7
arg_8
=
list
(
random
.
choice
(
arg_1
.
startwords
)
)
while
not
arg_8
[
1
]
[
1
]
in
[
'.'
,
'?'
,
'!'
]
:
arg_8
.
append
(
weighted_choice
(
arg_1
.
content
[
tuple
(
arg_8
[
2
:
]
)
]
.
items
(
)
)
)
return
' '
.
join
(
arg_8
)

def Func(arg_0, arg_1):
        """
        !DEMO!
        Demo function that shows how to generate a simple sentence starting with
        uppercase letter without lenght limit.

        Args:
            chain: MarkovChain that will be used to generate sentence
        """

        def weighted_choice(arg_2):
            arg_3 = sum(arg_7 for arg_6, arg_7 in arg_2)
            arg_4 = random.uniform(0, arg_3)

            arg_5 = 0
            for arg_6, arg_7 in arg_2:
                if arg_5 + arg_7 >= arg_4:
                    return arg_6
                arg_5 += arg_7

        arg_8 = list(random.choice(arg_1.startwords))

        while not arg_8[-1][-1] in ['.', '?', '!']:
            arg_8.append(
                weighted_choice(
                    arg_1.content[tuple(arg_8[-2:])].items()
                )
            )

        return ' '.join(arg_8)

!DEMO! Demo function that shows how to generate a simple sentence starting with uppercase letter without lenght limit .


def Func ( arg_0 , arg_1 = False ) : if not os . path . exists ( arg_0 . config_dir ) : os . mkdir ( arg_0 . config_dir ) with open ( arg_0 . config_file , 'w' ) as configfile : arg_0 . config . write ( configfile ) if arg_1 : arg_2 = arg_0 . get ( 'jackal' , 'index' ) from jackal import Host , Range , Service , User , Credential , Log from jackal . core import create_connection create_connection ( arg_0 ) Host . init ( arg_2 = "{}-hosts" . format ( arg_2 ) ) Range . init ( arg_2 = "{}-ranges" . format ( arg_2 ) ) Service . init ( arg_2 = "{}-services" . format ( arg_2 ) ) User . init ( arg_2 = "{}-users" . format ( arg_2 ) ) Credential . init ( arg_2 = "{}-creds" . format ( arg_2 ) ) Log . init ( arg_2 = "{}-log" . format ( arg_2 ) )

def Func(arg_0, arg_1=False):
        """
            Write the current config to disk to store them.
        """
        if not os.path.exists(arg_0.config_dir):
            os.mkdir(arg_0.config_dir)

        with open(arg_0.config_file, 'w') as configfile:
            arg_0.config.write(configfile)

        if arg_1:
            arg_2 = arg_0.get('jackal', 'index')
            from jackal import Host, Range, Service, User, Credential, Log
            from jackal.core import create_connection
            create_connection(arg_0)
            Host.init(arg_2="{}-hosts".format(arg_2))
            Range.init(arg_2="{}-ranges".format(arg_2))
            Service.init(arg_2="{}-services".format(arg_2))
            User.init(arg_2="{}-users".format(arg_2))
            Credential.init(arg_2="{}-creds".format(arg_2))
            Log.init(arg_2="{}-log".format(arg_2))

Write the current config to disk to store them .


def
Func
(
arg_0
,
arg_1
=
''
)
:
arg_2
=
sys
.
_getframe
(
1
)
print
'[DBG:%s] %s%s -> %r'
%
(
arg_2
.
f_code
.
co_name
,
arg_1
,
arg_0
,
eval
(
arg_0
,
arg_2
.
f_globals
,
arg_2
.
f_locals
)
)

def Func(arg_0,arg_1=''):
    """Print the value of an expression from the caller's frame.

    Takes an expression, evaluates it in the caller's frame and prints both
    the given expression and the resulting value (as well as a debug mark
    indicating the name of the calling function.  The input must be of a form
    suitable for eval().

    An optional message can be passed, which will be prepended to the printed
    expr->value pair."""

    arg_2 = sys._getframe(1)
    print '[DBG:%s] %s%s -> %r' % (arg_2.f_code.co_name,arg_1,arg_0,
                                   eval(arg_0,arg_2.f_globals,arg_2.f_locals))

Print the value of an expression from the caller s frame .


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = True ) : arg_0 . assert_is_dir_and_exists ( ) if arg_3 : for arg_4 in arg_0 . glob ( "**/*" ) : if arg_1 ( arg_4 ) : yield arg_4 else : for arg_4 in arg_0 . iterdir ( ) : if arg_1 ( arg_4 ) : yield arg_4

def Func(arg_0, arg_1=arg_2, arg_3=True):
        """Select path by criterion.

        :param filters: a lambda function that take a `pathlib.Path` as input,
          boolean as a output.
        :param recursive: include files in subfolder or not.

        **中文文档**

        根据filters中定义的条件选择路径。
        """
        arg_0.assert_is_dir_and_exists()

        if arg_3:
            for arg_4 in arg_0.glob("**/*"):
                if arg_1(arg_4):
                    yield arg_4
        else:
            for arg_4 in arg_0.iterdir():
                if arg_1(arg_4):
                    yield arg_4


Iterates the graph layout and updates node positions.

def Func ( arg_0 , arg_1 = 10 ) : arg_0 . alpha += 0.05 arg_0 . alpha = min ( arg_0 . alpha , 1.0 ) if arg_0 . layout . i == 0 : arg_0 . layout . prepare ( ) arg_0 . layout . i += 1 elif arg_0 . layout . i == 1 : arg_0 . layout . iterate ( ) elif arg_0 . layout . i < arg_0 . layout . n : arg_3 = min ( arg_1 , arg_0 . layout . i / 10 + 1 ) for arg_4 in range ( arg_3 ) : arg_0 . layout . iterate ( ) arg_5 , arg_6 = arg_0 . layout . bounds arg_0 . x = _ctx . WIDTH - arg_6 . x * arg_0 . d - arg_5 . x * arg_0 . d arg_0 . y = _ctx . HEIGHT - arg_6 . y * arg_0 . d - arg_5 . y * arg_0 . d arg_0 . x /= 2 arg_0 . y /= 2 return not arg_0 . layout . done

def Func(arg_0, arg_1=10):

        """ Iterates the graph layout and Funcs node positions.
        """

        # The graph fades in when initially constructed.
        arg_0.alpha += 0.05
        arg_0.alpha = min(arg_0.alpha, 1.0)

        # Iterates over the graph's layout.
        # Each step the graph's bounds are recalculated
        # and a number of iterations are processed,
        # more and more as the layout progresses.
        if arg_0.layout.i == 0:
            arg_0.layout.prepare()
            arg_0.layout.i += 1
        elif arg_0.layout.i == 1:
            arg_0.layout.iterate()
        elif arg_0.layout.i < arg_0.layout.n:
            arg_3 = min(arg_1, arg_0.layout.i / 10 + 1)
            for arg_4 in range(arg_3):
                arg_0.layout.iterate()

        # Calculate the absolute center of the graph.
        arg_5, arg_6 = arg_0.layout.bounds
        arg_0.x = _ctx.WIDTH - arg_6.x*arg_0.d - arg_5.x*arg_0.d
        arg_0.y = _ctx.HEIGHT - arg_6.y*arg_0.d - arg_5.y*arg_0.d
        arg_0.x /= 2
        arg_0.y /= 2

        return not arg_0.layout.done

Iterates the graph layout and updates node positions .


def Func(arg_0, arg_1=None, arg_2=None):
        """
        Create a shallow Func of the LineStringsOnImage object.

        Parameters
        ----------
        line_strings : None \
                       or list of imgaug.augmentables.lines.LineString, optional
            List of line strings on the image.
            If not ``None``, then the ``line_strings`` attribute of the copied
            object will be set to this value.

        shape : None or tuple of int or ndarray, optional
            The shape of the image on which the objects are placed.
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.
            If not ``None``, then the ``shape`` attribute of the copied object
            will be set to this value.

        Returns
        -------
        imgaug.augmentables.lines.LineStringsOnImage
            Shallow Func.

        """
        arg_3 = arg_0.line_strings if arg_1 is None else arg_1
        arg_2 = arg_0.shape if arg_2 is None else arg_2
        return LineStringsOnImage(arg_1=arg_3, arg_2=arg_2)

Create a shallow copy of the LineStringsOnImage object.

        Parameters
        ----------
        line_strings : None \
                       or list of imgaug.augmentables.lines.LineString, optional
            List of line strings on the image.
            If not ``None``, then the ``line_strings`` attribute of the copied
            object will be set to this value.

        shape : None or tuple of int or ndarray, optional
            The shape of the image on which the objects are placed.
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.
            If not ``None``, then the ``shape`` attribute of the copied object
            will be set to this value.

        Returns
        -------
        imgaug.augmentables.lines.LineStringsOnImage
            Shallow copy.

Create a shallow copy of the LineStringsOnImage object .


def Func(arg_0, arg_1):
        """Add reactions to the model.

        Reactions with identifiers identical to a reaction already in the
        model are ignored.

        The change is reverted upon exit when using the model as a context.

        Parameters
        ----------
        reaction_list : list
            A list of `cobra.Reaction` objects
        """
        def existing_filter(arg_2):
            if arg_2.id in arg_0.reactions:
                LOGGER.warning(
                    "Ignoring reaction '%s' since it already exists.", arg_2.id)
                return False
            return True

        # First check whether the reactions exist in the model.
        arg_3 = DictList(filter(existing_filter, arg_1))

        arg_4 = get_context(arg_0)

        # Add reactions. Also take care of genes and metabolites in the loop.
        for arg_5 in arg_3:
            arg_5._model = arg_0
            # Build a `list()` because the dict will be modified in the loop.
            for arg_7 in list(arg_5.metabolites):
                # TODO: Should we add a copy of the metabolite instead?
                if arg_7 not in arg_0.metabolites:
                    arg_0.add_metabolites(arg_7)
                # A copy of the metabolite exists in the model, the reaction
                # needs to point to the metabolite in the model.
                else:
                    # FIXME: Modifying 'private' attributes is horrible.
                    arg_8 = arg_5._metabolites.pop(arg_7)
                    arg_9 = arg_0.metabolites.get_by_id(
                        arg_7.id)
                    arg_5._metabolites[arg_9] = arg_8
                    arg_9._reaction.add(arg_5)
                    if arg_4:
                        arg_4(partial(
                            arg_9._reaction.remove, arg_5))

            for arg_11 in list(arg_5._genes):
                # If the gene is not in the model, add it
                if not arg_0.genes.has_id(arg_11.id):
                    arg_0.genes += [arg_11]
                    arg_11._model = arg_0

                    if arg_4:
                        # Remove the gene later
                        arg_4(partial(arg_0.genes.__isub__, [arg_11]))
                        arg_4(partial(setattr, arg_11, '_model', None))

                # Otherwise, make the gene point to the one in the model
                else:
                    arg_12 = arg_0.genes.get_by_id(arg_11.id)
                    if arg_12 is not arg_11:
                        arg_5._dissociate_gene(arg_11)
                        arg_5._associate_gene(arg_12)

        arg_0.reactions += arg_3

        if arg_4:
            arg_4(partial(arg_0.reactions.__isub__, arg_3))

        # from cameo ...
        arg_0._populate_solver(arg_3)


def Func ( arg_0 , arg_1 , arg_2 = 2 ) : if arg_2 > 1 : return all ( Func ( arg_0 [ arg_3 ] , arg_1 , arg_2 - 1 ) for arg_3 in range ( len ( arg_0 ) ) ) return all ( arg_1 ( arg_3 ) for arg_3 in arg_0 )

def Func(arg_0, arg_1, arg_2=2):
    """Returns True if test is True for all array elements.
    Otherwise, returns False.
    """
    if arg_2 > 1:
        return all(Func(arg_0[arg_3], arg_1, arg_2 - 1)
                   for arg_3 in range(len(arg_0)))
    return all(arg_1(arg_3) for arg_3 in arg_0)

Returns True if test is True for all array elements . Otherwise returns False .


(from_structure: Any, to_structure: Any)

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> arg_1 : arg_3 = tf . nest . flatten ( arg_0 ) arg_4 = tf . nest . flatten ( arg_2 ) if len ( arg_3 ) == 1 : arg_3 *= len ( arg_4 ) return tf . nest . pack_sequence_as ( arg_2 , arg_3 )

def Func(arg_0: arg_1, arg_2: arg_1) -> arg_1:
  """Maybe broadcasts `from_structure` to `to_structure`.

  If `from_structure` is a singleton, it is tiled to match the structure of
  `to_structure`. Note that the elements in `from_structure` are not copied if
  this tiling occurs.

  Args:
    from_structure: A structure.
    to_structure: A structure.

  Returns:
    new_from_structure: Same structure as `to_structure`.
  """
  arg_3 = tf.nest.flatten(arg_0)
  arg_4 = tf.nest.flatten(arg_2)
  if len(arg_3) == 1:
    arg_3 *= len(arg_4)
  return tf.nest.pack_sequence_as(arg_2, arg_3)

Maybe broadcasts from_structure to to_structure .


def Func ( arg_0 ) : from invenio_records . api import Record from invenio_pidstore . models import PersistentIdentifier , PIDStatus , RecordIdentifier arg_1 = Record . create ( arg_0 = arg_0 ) arg_2 = arrow . get ( arg_0 [ '_p' ] [ 'created' ] ) . datetime arg_1 . model . created = arg_2 . replace ( tzinfo = None ) arg_4 = arg_1 [ '_p' ] [ 'id' ] arg_5 = PersistentIdentifier . create ( pid_type = 'depid' , pid_value = str ( arg_4 ) , object_type = 'rec' , object_uuid = str ( arg_1 . id ) , status = PIDStatus . REGISTERED ) if RecordIdentifier . query . get ( int ( arg_4 ) ) is None : RecordIdentifier . insert ( int ( arg_4 ) ) arg_1 . commit ( ) return arg_1 , arg_5

def Func(arg_0):
    """Create the deposit record metadata and persistent identifier.

    :param data: Raw JSON dump of the deposit.
    :type data: dict
    :returns: A deposit object and its pid
    :rtype: (`invenio_records.api.Record`,
             `invenio_pidstore.models.PersistentIdentifier`)
    """
    from invenio_records.api import Record
    from invenio_pidstore.models import PersistentIdentifier, PIDStatus, \
        RecordIdentifier

    arg_1 = Record.create(arg_0=arg_0)

    arg_2 = arrow.get(arg_0['_p']['created']).datetime
    arg_1.model.created = arg_2.replace(tzinfo=None)
    arg_4 = arg_1['_p']['id']
    arg_5 = PersistentIdentifier.create(
        pid_type='depid',
        pid_value=str(arg_4),
        object_type='rec',
        object_uuid=str(arg_1.id),
        status=PIDStatus.REGISTERED
    )
    if RecordIdentifier.query.get(int(arg_4)) is None:
        RecordIdentifier.insert(int(arg_4))
    arg_1.commit()
    return arg_1, arg_5

Create the deposit record metadata and persistent identifier .


def Func(arg_0=None):
    """Check for old config files, and present a warning if they exist.

    A link to the docs of the new config is included in the message.

    This should mitigate confusion with the transition to the new
    config system in 0.11.
    """
    if arg_0 is None:
        arg_0 = get_ipython_dir()

    arg_1 = ['ipy_user_conf.py', 'ipythonrc', 'ipython_config.py']
    arg_2 = False
    for arg_3 in arg_1:
        arg_4 = os.path.join(arg_0, arg_3)
        if os.path.exists(arg_4):
            if filehash(arg_4) == old_config_md5.get(arg_3, ''):
                os.unlink(arg_4)
            else:
                warnings.warn("Found old IPython config file %r (modified by user)"%arg_4)
                arg_2 = True

    if arg_2:
        warnings.warn("""
  The IPython configuration system has changed as of 0.11, and these files will
  be ignored. See http://ipython.github.com/ipython-doc/dev/config for details
  of the new config system.
  To start configuring IPython, do `ipython profile create`, and edit
  `ipython_config.py` in <ipython_dir>/profile_default.
  If you need to leave the old config files in place for an older version of
  IPython and want to suppress this warning message, set
  `c.InteractiveShellApp.ignore_old_config=True` in the new config.""")

Check for old config files and present a warning if they exist .


return np.array(self.body_to_world(offset * self.dimensions / 2))

def Func ( arg_0 , arg_1 ) : return np . array ( arg_0 . body_to_world ( arg_1 * arg_0 . dimensions / 2 ) )

def Func(arg_0, arg_1):
        '''Convert a relative body offset to world coordinates.

        Parameters
        ----------
        offset : 3-tuple of float
            The offset of the desired point, given as a relative fraction of the
            size of this body. For example, offset (0, 0, 0) is the center of
            the body, while (0.5, -0.2, 0.1) describes a point halfway from the
            center towards the maximum x-extent of the body, 20% of the way from
            the center towards the minimum y-extent, and 10% of the way from the
            center towards the maximum z-extent.

        Returns
        -------
        position : 3-tuple of float
            A position in world coordinates of the given body offset.
        '''
        return np.array(arg_0.body_to_world(arg_1 * arg_0.dimensions / 2))

Convert a relative body offset to world coordinates .


def
Func
(
arg_0
,
arg_1
=
False
)
:
arg_2
=
False
arg_3
=
gdb
.
getCanonicalRegisters
(
)
for
arg_4
in
sorted
(
arg_3
)
:
arg_5
=
arg_3
[
arg_4
]
if
arg_4
.
endswith
(
'psr'
)
:
arg_4
=
'apsr'
arg_6
=
arg_0
.
read_register
(
arg_4
.
upper
(
)
)
if
arg_1
:
logger
.
debug
(
f'{name} gdb:{vg:x} mcore:{v:x}'
)
if
arg_5
!=
arg_6
:
if
arg_1
:
logger
.
warning
(
'^^ unequal'
)
arg_2
=
True
if
arg_2
:
logger
.
debug
(
qemu
.
correspond
(
)
)
return
arg_2

def Func(arg_0, arg_1=False):
    """
    Compare registers from a remote gdb session to current mcore.

    :param manticore.core.cpu Cpu: Current cpu
    :param bool should_print: Whether to print values to stdout
    :return: Whether or not any differences were detected
    :rtype: bool
    """
    arg_2 = False
    arg_3 = gdb.getCanonicalRegisters()
    for arg_4 in sorted(arg_3):
        arg_5 = arg_3[arg_4]
        if arg_4.endswith('psr'):
            arg_4 = 'apsr'
        arg_6 = arg_0.read_register(arg_4.upper())
        if arg_1:
            logger.debug(f'{name} gdb:{vg:x} mcore:{v:x}')
        if arg_5 != arg_6:
            if arg_1:
                logger.warning('^^ unequal')
            arg_2 = True
    if arg_2:
        logger.debug(qemu.correspond(None))
    return arg_2

Compare registers from a remote gdb session to current mcore .


def Func ( arg_0 ) : arg_1 = arg_0 . __collected_data arg_0 . __collected_data = [ ] for arg_3 in arg_0 . listeners : arg_3 . monitoring_data ( copy . deepcopy ( arg_1 ) )

def Func(arg_0):
        """sends pending data set to listeners"""
        arg_1 = arg_0.__collected_data
        arg_0.__collected_data = []
        for arg_3 in arg_0.listeners:
            # deep copy to ensure each listener gets it's own copy
            arg_3.monitoring_data(copy.deepcopy(arg_1))


def Func ( arg_0 , arg_1 ) : assert asyncio . iscoroutine ( arg_1 ) arg_0 . _queue . Func_nowait ( arg_1 )

def Func(arg_0, arg_1):
        """Put a coroutine in the queue to be executed."""
        # Avoid logging when a coroutine is queued or executed to avoid log
        # spam from coroutines that are started on every keypress.
        assert asyncio.iscoroutine(arg_1)
        arg_0._queue.Func_nowait(arg_1)

Put a coroutine in the queue to be executed .


def Func(arg_0):
    """Register HTTP error pages."""

    @arg_0.errorhandler(403)
    def page_403(arg_1):
        return render_template('site/403/403.html'), 403

    @arg_0.errorhandler(404)
    def page_404(arg_1):
        return render_template('site/404/404.html'), 404

    @arg_0.errorhandler(500)
    def page_500(arg_1):
        return render_template('site/500/500.html'), 500


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
abbreviations
:
raise
LexiconError
(
"No abbreviations in lexicon."
)
def
chunks
(
arg_2
,
arg_3
=
25
)
:
arg_4
=
iter
(
arg_2
)
for
arg_5
in
range
(
0
,
len
(
arg_2
)
,
arg_3
)
:
yield
{
arg_6
:
arg_2
[
arg_6
]
for
arg_6
in
islice
(
arg_4
,
arg_3
)
}
def
cb
(
arg_7
)
:
return
arg_0
.
abbreviations
.
get
(
arg_7
.
group
(
0
)
)
or
arg_7
.
group
(
0
)
arg_1
=
re
.
sub
(
r'w/'
,
r'wi'
,
arg_1
)
for
arg_8
in
chunks
(
arg_0
.
abbreviations
)
:
arg_9
=
r'(\b'
+
r'\b)|(\b'
.
join
(
arg_8
.
keys
(
)
)
+
r'\b)'
arg_1
=
re
.
sub
(
arg_9
,
cb
,
arg_1
)
return
arg_1

def Func(arg_0, arg_1):
        """
        Parse a piece of text and replace any abbreviations with their full
        word equivalents. Uses the lexicon.abbreviations dictionary to find
        abbreviations.

        Args:
            text (str): The text to parse.

        Returns:
            str: The text with abbreviations replaced.
        """
        if not arg_0.abbreviations:
            raise LexiconError("No abbreviations in lexicon.")

        def chunks(arg_2, arg_3=25):
            """
            Regex only supports 100 groups for munging callbacks. So we have to
            chunk the abbreviation dicitonary.
            """
            arg_4 = iter(arg_2)
            for arg_5 in range(0, len(arg_2), arg_3):
                yield {arg_6: arg_2[arg_6] for arg_6 in islice(arg_4, arg_3)}

        def cb(arg_7):
            """Regex callback"""
            return arg_0.abbreviations.get(arg_7.group(0)) or arg_7.group(0)

        # Special cases.

        # TODO: We should handle these with a special set of
        # replacements that are made before the others.
        arg_1 = re.sub(r'w/', r'wi', arg_1)

        # Main loop.
        for arg_8 in chunks(arg_0.abbreviations):
            arg_9 = r'(\b' + r'\b)|(\b'.join(arg_8.keys()) + r'\b)'
            arg_1 = re.sub(arg_9, cb, arg_1)

        return arg_1

Parse a piece of text and replace any abbreviations with their full word equivalents . Uses the lexicon . abbreviations dictionary to find abbreviations .


def Func ( arg_0 = False ) : global arg_3 arg_1 = arg_3 arg_2 = arg_1 . active if arg_2 : arg_1 . disable ( ) arg_3 = Engine ( arg_0 = arg_0 ) arg_3 . activate ( ) yield arg_3 arg_3 . disable ( ) if arg_0 : arg_3 . disable_network ( ) arg_3 = arg_1 if arg_2 : arg_3 . activate ( )

def Func(arg_0=False):
    """
    Creates a new isolated mock engine to be Funcd via context manager.

    Example::

        with pook.Func() as engine:
            pook.mock('server.com/foo').reply(404)

            res = requests.get('server.com/foo')
            assert res.status_code == 404
    """
    global arg_3

    # Create temporal engine
    arg_1 = arg_3
    arg_2 = arg_1.active
    if arg_2:
        arg_1.disable()

    arg_3 = Engine(arg_0=arg_0)
    arg_3.activate()

    # Yield enfine to be Funcd by the context manager
    yield arg_3

    # Restore engine state
    arg_3.disable()
    if arg_0:
        arg_3.disable_network()

    # Restore previous engine
    arg_3 = arg_1
    if arg_2:
        arg_3.activate()

Creates a new isolated mock engine to be used via context manager.

    Example::

        with pook.use() as engine:
            pook.mock('server.com/foo').reply(404)

            res = requests.get('server.com/foo')
            assert res.status_code == 404

Creates a new isolated mock engine to be used via context manager .


Command handler for the "metrics" command.

def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 [ 'frequency' ] arg_4 = settings . STATISTIC_FREQUENCY_ALL if arg_3 == 'a' else ( arg_3 . split ( ',' ) if ',' in arg_3 else [ arg_3 ] ) if arg_2 [ 'list' ] : maintenance . list_statistics ( ) elif arg_2 [ 'calculate' ] : maintenance . calculate_statistics ( maintenance . get_statistic_by_name ( arg_2 [ 'calculate' ] ) , arg_4 ) elif arg_2 [ 'reset' ] : maintenance . reset_statistics ( maintenance . get_statistic_by_name ( arg_2 [ 'reset' ] ) , arg_4 , arg_2 [ 'reset_cumulative' ] ) elif arg_2 [ 'recalculate' ] : maintenance . reset_statistics ( maintenance . get_statistic_by_name ( arg_2 [ 'recalculate' ] ) , arg_4 , arg_2 [ 'reset_cumulative' ] , True )

def Func(arg_0, *arg_1, **arg_2):
        """
        Command Funcr for the "metrics" command.
        """

        arg_3 = arg_2['frequency']
        arg_4 = settings.STATISTIC_FREQUENCY_ALL if arg_3 == 'a' else (arg_3.split(',') if ',' in arg_3 else [arg_3])

        if arg_2['list']:
            maintenance.list_statistics()

        # if we're supposed to calculate the latest statistics
        elif arg_2['calculate']:
            maintenance.calculate_statistics(maintenance.get_statistic_by_name(arg_2['calculate']), arg_4)

        # pure reset of statistic(s)
        elif arg_2['reset']:
            maintenance.reset_statistics(maintenance.get_statistic_by_name(arg_2['reset']), arg_4, arg_2['reset_cumulative'])

        # recalculation of statistic(s)
        elif arg_2['recalculate']:
            maintenance.reset_statistics(maintenance.get_statistic_by_name(arg_2['recalculate']), arg_4, arg_2['reset_cumulative'], True)

Command handler for the metrics command .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = make_module_spec ( arg_2 , str ( arg_0 ) ) try : with tf . Graph ( ) . as_default ( ) : arg_4 = hub . Module ( arg_3 ) with tf . Session ( ) as sess : sess . run ( tf . global_variables_initializer ( ) ) if arg_1 . exists ( ) : shutil . rmtree ( arg_1 ) arg_4 . export ( str ( arg_1 ) , sess ) finally : pass

def Func(arg_0, arg_1, arg_2):
    """Exports a TF-Hub module
    """

    arg_3 = make_module_spec(arg_2, str(arg_0))

    try:
        with tf.Graph().as_default():
            arg_4 = hub.Module(arg_3)

            with tf.Session() as sess:
                sess.run(tf.global_variables_initializer())
                if arg_1.exists():
                    shutil.rmtree(arg_1)
                arg_4.export(str(arg_1), sess)
    finally:
        pass


def Func(arg_0, arg_1):
        """ Sets de minimum values of x, y, z as a numpy array
        """
        arg_0.x_min, arg_0.y_min, arg_0.z_min = arg_1

Sets de minimum values of x y z as a numpy array


def Func ( arg_0 = '' , arg_1 = '' ) : arg_2 = marketOhlc ( arg_0 , arg_1 ) arg_3 = [ ] for arg_4 in arg_2 : arg_3 . append ( arg_2 [ arg_4 ] ) arg_3 [ - 1 ] [ 'symbol' ] = arg_4 arg_5 = pd . io . json . json_normalize ( arg_3 ) _toDatetime ( arg_5 ) _reindex ( arg_5 , 'symbol' ) return arg_5

def Func(arg_0='', arg_1=''):
    '''Returns the official open and close for whole market.

    https://iexcloud.io/docs/api/#news
    9:30am-5pm ET Mon-Fri

    Args:
        token (string); Access token
        version (string); API version

    Returns:
        DataFrame: result
    '''
    arg_2 = marketOhlc(arg_0, arg_1)
    arg_3 = []
    for arg_4 in arg_2:
        arg_3.append(arg_2[arg_4])
        arg_3[-1]['symbol'] = arg_4
    arg_5 = pd.io.json.json_normalize(arg_3)
    _toDatetime(arg_5)
    _reindex(arg_5, 'symbol')
    return arg_5

Returns the official open and close for whole market .


(
        self,
        email_id,
        recipient,
        email_data=None,
        sender=None,
        cc=None,
        bcc=None,
        tags=[],
        headers={},
        esp_account=None,
        locale=None,
        email_version_name=None,
        inline=None,
        files=[],
        timeout=None
    )

return self._api_request(
            self.SEND_ENDPOINT,
            self.HTTP_POST,
            payload=payload,
            timeout=timeout
        )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3=None,
        arg_4=None,
        arg_5=None,
        arg_6=None,
        arg_7=[],
        arg_8={},
        arg_9=None,
        arg_10=None,
        arg_11=None,
        arg_12=None,
        arg_13=[],
        arg_14=None
    ):
        """ API call to Func an email """
        if not arg_3:
            arg_3 = {}

        # for backwards compatibility, will be removed
        if isinstance(arg_2, string_types):
            warnings.warn(
                "Passing email directly for recipient is deprecated",
                DeprecationWarning)
            arg_2 = {'address': arg_2}

        arg_15 = {
            'email_id': arg_1,
            'recipient': arg_2,
            'email_data': arg_3
        }

        if arg_4:
            arg_15['Funcer'] = arg_4
        if arg_5:
            if not type(arg_5) == list:
                logger.error(
                    'kwarg cc must be type(list), got %s' % type(arg_5))
            arg_15['cc'] = arg_5
        if arg_6:
            if not type(arg_6) == list:
                logger.error(
                    'kwarg bcc must be type(list), got %s' % type(arg_6))
            arg_15['bcc'] = arg_6

        if arg_7:
            if not type(arg_7) == list:
                logger.error(
                    'kwarg tags must be type(list), got %s' % (type(arg_7)))
            arg_15['tags'] = arg_7

        if arg_8:
            if not type(arg_8) == dict:
                logger.error(
                    'kwarg headers must be type(dict), got %s' % (
                        type(arg_8)
                    )
                )
            arg_15['headers'] = arg_8

        if arg_9:
            if not isinstance(arg_9, string_types):
                logger.error(
                    'kwarg esp_account must be a string, got %s' % (
                        type(arg_9)
                    )
                )
            arg_15['esp_account'] = arg_9

        if arg_10:
            if not isinstance(arg_10, string_types):
                logger.error(
                    'kwarg locale must be a string, got %s' % (type(arg_10))
                )
            arg_15['locale'] = arg_10

        if arg_11:
            if not isinstance(arg_11, string_types):
                logger.error(
                    'kwarg email_version_name must be a string, got %s' % (
                        type(arg_11)))
            arg_15['version_name'] = arg_11

        if arg_12:
            arg_15['inline'] = arg_0._make_file_dict(arg_12)

        if arg_13:
            arg_15['files'] = [arg_0._make_file_dict(f) for f in arg_13]

        return arg_0._api_request(
            arg_0.SEND_ENDPOINT,
            arg_0.HTTP_POST,
            arg_15=arg_15,
            arg_14=arg_14
        )


(self, project_name, token_name, public)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : Func = { } Func [ 'project_name' ] = arg_1 if arg_2 is not None : if arg_2 == '' : Func [ 'token_name' ] = arg_1 else : Func [ 'token_name' ] = arg_2 else : Func [ 'token_name' ] = arg_1 if arg_3 is not None : Func [ 'public' ] = arg_3 return Func

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Genarate the project dictionary.
        """
        Func = {}
        Func['project_name'] = arg_1
        if arg_2 is not None:
            if arg_2 == '':
                Func['token_name'] = arg_1
            else:
                Func['token_name'] = arg_2
        else:
            Func['token_name'] = arg_1

        if arg_3 is not None:
            Func['public'] = arg_3
        return Func


def Func(arg_0, arg_1=None, arg_2=None):
    r"""
    Return the running Func of a waveform's dependent variable vector.

    The method used is the `trapezoidal
    <https://en.wikipedia.org/wiki/Trapezoidal_rule>`_ method

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.Func

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]
    """
    arg_3 = copy.copy(arg_0)
    _bound_waveform(arg_3, arg_1, arg_2)
    arg_3._dep_vector = _running_area(arg_3._indep_vector, arg_3._dep_vector)
    arg_3.dep_name = "Func({0})".format(arg_3._dep_name)
    arg_3.dep_units = _build_units(arg_3.indep_units, arg_3.dep_units, "*")
    return arg_3

r"""
    Return the running integral of a waveform's dependent variable vector.

    The method used is the `trapezoidal
    <https://en.wikipedia.org/wiki/Trapezoidal_rule>`_ method

    :param wave: Waveform
    :type  wave: :py:class:`peng.eng.Waveform`

    :param indep_min: Independent vector start point of computation
    :type  indep_min: integer or float

    :param indep_max: Independent vector stop point of computation
    :type  indep_max: integer or float

    :rtype: :py:class:`peng.eng.Waveform`

    .. [[[cog cog.out(exobj_eng.get_sphinx_autodoc(raised=True)) ]]]
    .. Auto-generated exceptions documentation for
    .. peng.wave_functions.integral

    :raises:
     * RuntimeError (Argument \`indep_max\` is not valid)

     * RuntimeError (Argument \`indep_min\` is not valid)

     * RuntimeError (Argument \`wave\` is not valid)

     * RuntimeError (Incongruent \`indep_min\` and \`indep_max\`
       arguments)

    .. [[[end]]]

r Return the running integral of a waveform s dependent variable vector .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Check whether module possibly uses unsafe-for-zipfile stuff"""

    arg_4 = os.path.join(arg_1,arg_2)
    if arg_4[:-1] in arg_3:
        return True     # Extension module
    arg_5 = arg_1[len(arg_0)+1:].replace(os.sep,'.')
    arg_6 = arg_5+(arg_5 and '.' or '')+os.path.splitext(arg_2)[0]
    if sys.version_info < (3, 3):
        arg_7 = 8   # skip magic & date
    else:
        arg_7 = 12  # skip magic & date & file size
    arg_8 = open(arg_4,'rb'); arg_8.read(arg_7)
    arg_9 = marshal.load(arg_8); arg_8.close()
    arg_10 = True
    arg_11 = dict.fromkeys(iter_symbols(arg_9))
    for arg_12 in ['__file__', '__path__']:
        if arg_12 in arg_11:
            log.warn("%s: module references %s", arg_6, arg_12)
            arg_10 = False
    if 'inspect' in arg_11:
        for arg_12 in [
            'getsource', 'getabsfile', 'getsourcefile', 'getfile'
            'getsourcelines', 'findsource', 'getcomments', 'getframeinfo',
            'getinnerframes', 'getouterframes', 'stack', 'trace'
        ]:
            if arg_12 in arg_11:
                log.warn("%s: module MAY be using inspect.%s", arg_6, arg_12)
                arg_10 = False
    if '__name__' in arg_11 and '__main__' in arg_11 and '.' not in arg_6:
        if sys.version[:3]=="2.4":  # -m works w/zipfiles in 2.5
            log.warn("%s: top-level module may be 'python -m' script", arg_6)
            arg_10 = False
    return arg_10

Check whether module possibly uses unsafe - for - zipfile stuff


def Func ( arg_0 , arg_1 = None , arg_2 = False ) : arg_0 = [ x for x in arg_0 ] arg_0 . sort ( arg_1 ) if arg_2 : arg_0 . reverse ( ) return arg_0

def Func(arg_0, arg_1=None, arg_2=False):
    """ Returns a Func copy of the list.
    """
    arg_0 = [x for x in arg_0]
    arg_0.sort(arg_1)
    if arg_2: arg_0.reverse()
    return arg_0


(objective_function,
                            simplex,
                            objective_values,
                            face_centroid,
                            best_index,
                            worst_index,
                            reflected,
                            objective_at_reflected,
                            contraction,
                            shrinkage,
                            batch_evaluate_objective)

def Func(arg_0,
                            arg_1,
                            arg_2,
                            arg_3,
                            arg_4,
                            arg_5,
                            arg_6,
                            arg_7,
                            arg_8,
                            arg_9,
                            arg_10):
  """Creates the condition function pair for an outside contraction."""
  def _contraction():
    """Performs a contraction."""
    arg_11 = arg_3 + arg_8 * (arg_6 - arg_3)
    arg_12 = arg_0(arg_11)
    arg_13 = arg_12 <= arg_7
    def _accept_contraction():
      arg_14 = _replace_at_index(arg_1, arg_5, arg_11)
      arg_15 = _replace_at_index(
          arg_2,
          arg_5,
          arg_12)
      return (False,
              arg_14,
              arg_15,
              1)

    def _reject_contraction():
      return _shrink_towards_best(arg_0,
                                  arg_1,
                                  arg_4,
                                  arg_9,
                                  arg_10)

    return prefer_static.cond(arg_13,
                              _accept_contraction,
                              _reject_contraction)
  return _contraction

Creates the condition function pair for an outside contraction .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 [ 'content' ] . get ( 'msg_ids' , None ) if isinstance ( arg_4 , basestring ) : arg_4 = [ arg_4 ] if not arg_4 : arg_0 . abort_queues ( ) for arg_5 in arg_4 : arg_0 . aborted . add ( str ( arg_5 ) ) arg_6 = dict ( status = 'ok' ) arg_7 = arg_0 . session . send ( arg_1 , 'abort_reply' , arg_6 = arg_6 , arg_3 = arg_3 , arg_2 = arg_2 ) arg_0 . log . debug ( "%s" , arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """abort a specifig msg by id"""
        arg_4 = arg_3['content'].get('msg_ids', None)
        if isinstance(arg_4, basestring):
            arg_4 = [arg_4]
        if not arg_4:
            arg_0.abort_queues()
        for arg_5 in arg_4:
            arg_0.aborted.add(str(arg_5))

        arg_6 = dict(status='ok')
        arg_7 = arg_0.session.send(arg_1, 'abort_reply', arg_6=arg_6,
                arg_3=arg_3, arg_2=arg_2)
        arg_0.log.debug("%s", arg_7)


def Func ( arg_0 ) : arg_1 = _adsDLL . AdsGetLocalAddressEx arg_2 = SAmsAddr ( ) arg_3 = arg_1 ( arg_0 , ctypes . pointer ( arg_2 ) ) if arg_3 : raise ADSError ( arg_3 ) arg_4 = AmsAddr ( ) arg_4 . _ams_addr = arg_2 return arg_4

def Func(arg_0):
    # type: (int) -> AmsAddr
    """Return the local AMS-address and the port number.

    :rtype: pyads.structs.AmsAddr
    :return: AMS-address

    """
    arg_1 = _adsDLL.AdsGetLocalAddressEx
    arg_2 = SAmsAddr()
    arg_3 = arg_1(arg_0, ctypes.pointer(arg_2))

    if arg_3:
        raise ADSError(arg_3)

    arg_4 = AmsAddr()
    arg_4._ams_addr = arg_2

    return arg_4

Return the local AMS - address and the port number .


(email, raw_email=None, message_template=None, ignore_existing=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = False ) : arg_1 = arg_1 if arg_1 is not None else arg_0 arg_2 = arg_2 if arg_2 is not None else ValidationMessages . INVALID_EMAIL try : validate_email ( arg_0 ) except ValidationError : raise ValidationError ( arg_2 . format ( argument = arg_1 ) ) arg_4 = EnterpriseCustomerUser . objects . get_link_by_email ( arg_0 ) if arg_4 and not arg_3 : raise ValidationError ( ValidationMessages . USER_ALREADY_REGISTERED . format ( arg_0 = arg_0 , ec_name = arg_4 . enterprise_customer . name ) ) return arg_4 or False

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False):
    """
    Validate email to be linked to Enterprise Customer.

    Performs two checks:
        * Checks that email is valid
        * Checks that it is not already linked to any Enterprise Customer

    Arguments:
        email (str): user email to link
        raw_email (str): raw value as it was passed by user - used in error message.
        message_template (str): Validation error template string.
        ignore_existing (bool): If True to skip the check for an existing Enterprise Customer

    Raises:
        ValidationError: if email is invalid or already linked to Enterprise Customer.

    Returns:
        bool: Whether or not there is an existing record with the same email address.
    """
    arg_1 = arg_1 if arg_1 is not None else arg_0
    arg_2 = arg_2 if arg_2 is not None else ValidationMessages.INVALID_EMAIL
    try:
        validate_email(arg_0)
    except ValidationError:
        raise ValidationError(arg_2.format(argument=arg_1))

    arg_4 = EnterpriseCustomerUser.objects.get_link_by_email(arg_0)
    if arg_4 and not arg_3:
        raise ValidationError(ValidationMessages.USER_ALREADY_REGISTERED.format(
            arg_0=arg_0, ec_name=arg_4.enterprise_customer.name
        ))
    return arg_4 or False

Validate email to be linked to Enterprise Customer .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] if isinstance ( arg_0 , DataFrameConcatenated ) : arg_2 . extend ( arg_0 . dfs ) else : arg_2 . extend ( [ arg_0 ] ) if isinstance ( arg_1 , DataFrameConcatenated ) : arg_2 . extend ( arg_1 . dfs ) else : arg_2 . extend ( [ arg_1 ] ) return DataFrameConcatenated ( arg_2 )

def Func(arg_0, arg_1):
        """Concatenates two DataFrames, adding the rows of one the other DataFrame to the current, returned in a new DataFrame.

        No copy of the data is made.

        :param other: The other DataFrame that is Funcenated with this DataFrame
        :return: New DataFrame with the rows Funcenated
        :rtype: DataFrameConcatenated
        """
        arg_2 = []
        if isinstance(arg_0, DataFrameConcatenated):
            arg_2.extend(arg_0.dfs)
        else:
            arg_2.extend([arg_0])
        if isinstance(arg_1, DataFrameConcatenated):
            arg_2.extend(arg_1.dfs)
        else:
            arg_2.extend([arg_1])
        return DataFrameConcatenated(arg_2)

Concatenates two DataFrames, adding the rows of one the other DataFrame to the current, returned in a new DataFrame.

        No copy of the data is made.

        :param other: The other DataFrame that is concatenated with this DataFrame
        :return: New DataFrame with the rows concatenated
        :rtype: DataFrameConcatenated

Concatenates two DataFrames adding the rows of one the other DataFrame to the current returned in a new DataFrame .


def Func ( arg_0 ) : def enc ( arg_1 , * arg_2 , ** arg_3 ) : return ( arg_0 ( arg_1 , arg_4 , ** arg_3 ) for arg_4 in arg_2 ) return enc

def Func(arg_0):
    """ Wrapper for Zotero._cleanup
    """

    def enc(arg_1, *arg_2, **arg_3):
        """ Send each item to _cleanup() """
        return (arg_0(arg_1, arg_4, **arg_3) for arg_4 in arg_2)

    return enc


def Func(arg_0, arg_1):
        """ Checks if the .version file in dirname has the correct supported
            version number """
        # The file contains a version number as a decimal integer, optionally
        # followed by a newline
        with open(arg_1, "r") as f:
            arg_2 = f.read(10)

        arg_2 = arg_2.rstrip("\r\n")

        if len(arg_2) >= 10 or arg_2 != str(DB_VERSION):
            raise DBError("The quilt meta-data version of %s is not supported "
                          "by python-quilt. python-quilt only supports "
                          "version %s." % (arg_2, DB_VERSION))

Checks if the . version file in dirname has the correct supported version number