return _ETreeXmlToObject.convert_response_to_feeds(
            response, _convert_etree_element_to_rule)

def Func(arg_0, arg_1, arg_2):
        '''
        Retrieves the rules that exist under the specified subscription.

        topic_name:
            Name of the topic.
        subscription_name:
            Name of the subscription.
        '''
        _validate_not_none('topic_name', arg_1)
        _validate_not_none('subscription_name', arg_2)
        arg_3 = HTTPRequest()
        arg_3.method = 'GET'
        arg_3.host = arg_0._get_host()
        arg_3.path = '/' + \
            _str(arg_1) + '/subscriptions/' + \
            _str(arg_2) + '/rules/'
        arg_3.path, arg_3.query = arg_0._httpclient._update_request_uri_query(arg_3)  # pylint: disable=protected-access
        arg_3.headers = arg_0._update_service_bus_header(arg_3)
        arg_9 = arg_0._perform_request(arg_3)

        return _ETreeXmlToObject.convert_response_to_feeds(
            arg_9, _convert_etree_element_to_rule)

Retrieves the rules that exist under the specified subscription .


def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Register interface object on interface level object
        """
        nameAvailabilityCheck(arg_0, arg_1, arg_2)
        assert arg_2._parent is None
        arg_2._parent = arg_0
        arg_2._name = arg_1
        arg_2._ctx = arg_0._ctx

        if arg_3:
            arg_0._private_interfaces.append(arg_2)
            arg_2._isExtern = False
        else:
            arg_0._interfaces.append(arg_2)
            arg_2._isExtern = True


(self, gitquery, gitvars={}, verbose=False, rest=False)

return {'statusNum': statusNum, 'headDict': headDict, 'linkDict': linkDict, 'result': result}

def Func(arg_0, arg_1, arg_2={}, arg_3=False, arg_4=False):
        """Send a curl request to GitHub.

        Args:
            gitquery (str): The query or endpoint itself.
                Examples:
                       query: 'query { viewer { login } }'
                    endpoint: '/user'
            gitvars (Optional[Dict]): All query variables.
                Defaults to empty.
            verbose (Optional[bool]): If False, stderr prints will be
                suppressed. Defaults to False.
            rest (Optional[bool]): If True, uses the REST API instead
                of GraphQL. Defaults to False.

        Returns:
            {
                'statusNum' (int): The HTTP status code.
                'headDict' (Dict[str]): The response headers.
                'linkDict' (Dict[int]): Link based pagination data.
                'result' (str): The body of the response.
            }

        """
        arg_5 = DEVNULL if not arg_3 else None
        arg_6 = 'Authorization: bearer ' + arg_0.__githubApiToken

        arg_7 = 'curl -iH TMPauthhead -X POST -d TMPgitquery https://api.github.com/graphql' if not arg_4 \
            else 'curl -iH TMPauthhead https://api.github.com' + arg_1
        arg_8 = arg_7.split()
        arg_8[2] = arg_6
        if not arg_4:
            arg_9 = json.dumps({'query': arg_1, 'variables': json.dumps(arg_2)})
            arg_8[6] = arg_9

        arg_10 = check_output(arg_8, stderr=arg_5).decode()
        _vPrint(arg_3, "\n" + arg_10)
        arg_10 = arg_10.split('\r\n\r\n')
        arg_11 = arg_10[0].split('\r\n')
        if len(arg_10) > 1:
            arg_12 = arg_10[1]
        else:
            arg_12 = ""
        arg_13 = arg_11[0].split()
        arg_14 = int(arg_13[1])

        # Parse headers into a useful dictionary
        arg_15 = {}
        arg_15["http"] = arg_11[0]
        for arg_16 in arg_11[1:]:
            arg_17 = arg_16.split(': ')
            arg_15[arg_17[0]] = arg_17[1]

        # Parse any Link headers even further
        arg_18 = None
        if "Link" in arg_15:
            arg_19 = arg_15["Link"].split(', ')
            arg_20 = {}
            for arg_21 in arg_19:
                arg_22 = re.split(r'<https://api.github.com|>; rel="|"', arg_21)
                arg_20[arg_22[2]] = arg_22[1]
            arg_18 = arg_20

        return {'statusNum': arg_14, 'headDict': arg_15, 'linkDict': arg_18, 'result': arg_12}


return (self.knots[self.degree - 1],
                self.knots[len(self.knots) - self.degree])

def Func ( arg_0 ) : return ( arg_0 . knots [ arg_0 . degree - 1 ] , arg_0 . knots [ len ( arg_0 . knots ) - arg_0 . degree ] )

def Func(arg_0):
        """Returns the domain of the B-Spline"""
        return (arg_0.knots[arg_0.degree - 1],
                arg_0.knots[len(arg_0.knots) - arg_0.degree])


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 if arg_0 . joined and arg_0 . handler : arg_0 . handler . user_left ( arg_0 . me , None ) arg_0 . joined = False

def Func(arg_0,arg_1):
        """
        Called when current stream changes.

        Mark the room not joined and inform `self.handler` that it was left.

        :Parameters:
            - `stream`: the new stream.
        :Types:
            - `stream`: `pyxmpp.stream.Stream`
        """
        arg_2 = arg_1
        if arg_0.joined and arg_0.handler:
            arg_0.handler.user_left(arg_0.me,None)
        arg_0.joined=False


def Func(arg_0, arg_1):
        """Update the size of the chunk"""
        arg_0.__fileobj.seek(arg_0.offset + 4)
        arg_0.__fileobj.write(pack('>I', arg_1))
        if arg_0.parent_chunk is not None:
            arg_2 = arg_0.data_size - arg_1
            arg_0.parent_chunk.Func(arg_0.parent_chunk.data_size - arg_2)
        arg_0.data_size = arg_1
        arg_0.size = arg_1 + arg_0.HEADER_SIZE


def Func ( arg_0 ) : arg_1 = arg_0 . _get_max_fd ( ) for arg_2 in reversed ( range ( arg_1 ) ) : if arg_2 not in arg_0 . exclude_fds : arg_0 . _close_fd ( arg_2 )

def Func(arg_0):
        """Close open file descriptors."""
        arg_1 = arg_0._get_max_fd()
        for arg_2 in reversed(range(arg_1)):
            if arg_2 not in arg_0.exclude_fds:
                arg_0._close_fd(arg_2)


(self, column=-1, method="mean", combine_method="interpolate", by=None, group_by_frame=None, values=None)

def Func(arg_0, arg_1=-1, arg_2="mean", arg_3="interpolate", arg_4=None, arg_5=None, arg_6=None):
        """
        Impute missing values into the frame, modifying it in-place.

        :param int column: Index of the column to Func, or -1 to Func the entire frame.
        :param str method: The method of imputation: ``"mean"``, ``"median"``, or ``"mode"``.
        :param str combine_method: When the method is ``"median"``, this setting dictates how to combine quantiles
            for even samples. One of ``"interpolate"``, ``"average"``, ``"low"``, ``"high"``.
        :param by: The list of columns to group on.
        :param H2OFrame group_by_frame: Impute the values with this pre-computed grouped frame.
        :param List values: The list of Func values, one per column. None indicates to skip the column.

        :returns: A list of values used in the imputation or the group-by result used in imputation.
        """
        if is_type(arg_1, str): arg_1 = arg_0.names.index(arg_1)
        if is_type(arg_4, str):     arg_4 = arg_0.names.index(arg_4)

        if arg_6 is None:
            arg_6 = "_"
        else:
            assert len(arg_6) == len(arg_0.columns), "Length of values does not match length of columns"
            # convert string values to categorical num values
            arg_7 = []
            for arg_8 in range(0,len(arg_6)):
                if arg_0.type(arg_8) == "enum":
                    try:
                        arg_7.append(arg_0.levels()[arg_8].index(arg_6[arg_8]))
                    except:
                        raise H2OValueError("Impute value of: " + arg_6[arg_8] + " not found in existing levels of"
                                            " column: " + arg_0.col_names[arg_8])
                else:
                    arg_7.append(arg_6[arg_8])
            arg_6 = arg_7
        if arg_5 is None: arg_5 = "_"

        # This code below is needed to ensure the frame (self) exists on the server. Without it, self._ex._cache.fill()
        # fails with an assertion that ._id is None.
        # This code should be removed / reworked once we have a more consistent strategy of dealing with frames.
        arg_0._ex._eager_frame()

        if arg_4 is not None or arg_5 is not "_":
            arg_9 = H2OFrame._expr(
                expr=ExprNode("h2o.Func", arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6))._frame()
        else:
            arg_9 = ExprNode("h2o.Func", arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                           arg_6)._eager_scalar()

        arg_0._ex._cache.flush()
        arg_0._ex._cache.fill(10)
        return arg_9

Impute missing values into the frame, modifying it in-place.

        :param int column: Index of the column to impute, or -1 to impute the entire frame.
        :param str method: The method of imputation: ``"mean"``, ``"median"``, or ``"mode"``.
        :param str combine_method: When the method is ``"median"``, this setting dictates how to combine quantiles
            for even samples. One of ``"interpolate"``, ``"average"``, ``"low"``, ``"high"``.
        :param by: The list of columns to group on.
        :param H2OFrame group_by_frame: Impute the values with this pre-computed grouped frame.
        :param List values: The list of impute values, one per column. None indicates to skip the column.

        :returns: A list of values used in the imputation or the group-by result used in imputation.

Impute missing values into the frame modifying it in - place .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . drop ( 'cash' , axis = 'columns' ) arg_3 = arg_2 . abs ( ) . sum ( axis = 'columns' ) arg_4 = arg_2 . multiply ( arg_1 ) . divide ( arg_3 , axis = 'index' ) arg_5 = arg_4 . sum ( axis = 'columns' , skipna = True ) return arg_5

def Func(arg_0, arg_1):
    """
    Returns style factor exposure of an algorithm's positions

    Parameters
    ----------
    positions : pd.DataFrame
        Daily equity positions of algorithm, in dollars.
        - See full explanation in create_risk_tear_sheet

    risk_factor : pd.DataFrame
        Daily risk factor per asset.
        - DataFrame with dates as index and equities as columns
        - Example:
                         Equity(24   Equity(62
                           [AAPL])      [ABT])
        2017-04-03	  -0.51284     1.39173
        2017-04-04	  -0.73381     0.98149
        2017-04-05	  -0.90132     1.13981
    """

    arg_2 = arg_0.drop('cash', axis='columns')
    arg_3 = arg_2.abs().sum(axis='columns')

    arg_4 = arg_2.multiply(arg_1) \
        .divide(arg_3, axis='index')
    arg_5 = arg_4.sum(axis='columns',
                                                          skipna=True)

    return arg_5

Returns style factor exposure of an algorithm s positions


(self, tensor_type, last_dim=0, test_shape=None)

return var(tensor_type, last_dim=last_dim, test_shape=test_shape)

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = None ) : from deepy . tensor import Func return Func ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2=0, arg_3=None):
        """
        An alias of deepy.tensor.Func.
        """
        from deepy.tensor import Func
        return Func(arg_1, arg_2=arg_2, arg_3=arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_1 . func , astroid . Attribute ) and not isinstance ( arg_1 . func . expr , astroid . Const ) : return if arg_1 . starargs or arg_1 . kwargs : return try : arg_3 = next ( arg_2 . bound . infer ( ) ) except astroid . InferenceError : return if not ( isinstance ( arg_3 , astroid . Const ) and isinstance ( arg_3 . value , str ) ) : return try : arg_4 = CallSite . from_call ( arg_1 ) except astroid . InferenceError : return try : arg_5 , arg_6 , arg_7 = utils . parse_format_method_string ( arg_3 . value ) except utils . IncompleteFormatString : arg_0 . add_message ( "bad-format-string" , arg_1 = arg_1 ) return arg_8 = arg_4 . positional_arguments arg_9 = arg_4 . keyword_arguments arg_10 = { arg_12 [ 0 ] for arg_12 in arg_5 if isinstance ( arg_12 [ 0 ] , str ) } if arg_6 and arg_7 : arg_0 . add_message ( "format-combined-specification" , arg_1 = arg_1 ) return arg_11 = False arg_6 += sum ( 1 for arg_12 in arg_10 if arg_12 == "" ) if arg_10 : for arg_12 in arg_10 : if arg_12 and arg_12 not in arg_9 : arg_0 . add_message ( "missing-format-argument-key" , arg_1 = arg_1 , args = ( arg_12 , ) ) for arg_12 in arg_9 : if arg_12 not in arg_10 : arg_0 . add_message ( "unused-format-string-argument" , arg_1 = arg_1 , args = ( arg_12 , ) ) arg_6 = arg_6 or arg_7 if arg_8 or arg_6 : arg_13 = any ( True for arg_12 in arg_10 if arg_12 == "" ) if arg_9 or arg_13 : arg_11 = True else : arg_11 = True if arg_11 : arg_6 = arg_6 or arg_7 if len ( arg_8 ) > arg_6 : arg_0 . add_message ( "too-many-format-args" , arg_1 = arg_1 ) elif len ( arg_8 ) < arg_6 : arg_0 . add_message ( "too-few-format-args" , arg_1 = arg_1 ) arg_0 . _detect_vacuous_formatting ( arg_1 , arg_8 ) arg_0 . Func_specifiers ( arg_1 , arg_5 , arg_9 )

def Func(arg_0, arg_1, arg_2):
        """ Check the new string formatting. """
        # TODO: skip (for now) format nodes which don't have
        #       an explicit string on the left side of the format operation.
        #       We do this because our inference engine can't properly handle
        #       redefinitions of the original string.
        #       For more details, see issue 287.
        #
        # Note that there may not be any left side at all, if the format method
        # has been assigned to another variable. See issue 351. For example:
        #
        #    fmt = 'some string {}'.format
        #    fmt('arg')
        if isinstance(arg_1.func, astroid.Attribute) and not isinstance(
            arg_1.func.expr, astroid.Const
        ):
            return
        if arg_1.starargs or arg_1.kwargs:
            return
        try:
            arg_3 = next(arg_2.bound.infer())
        except astroid.InferenceError:
            return
        if not (isinstance(arg_3, astroid.Const) and isinstance(arg_3.value, str)):
            return
        try:
            arg_4 = CallSite.from_call(arg_1)
        except astroid.InferenceError:
            return

        try:
            arg_5, arg_6, arg_7 = utils.parse_format_method_string(
                arg_3.value
            )
        except utils.IncompleteFormatString:
            arg_0.add_message("bad-format-string", arg_1=arg_1)
            return

        arg_8 = arg_4.positional_arguments
        arg_9 = arg_4.keyword_arguments
        arg_10 = {arg_12[0] for arg_12 in arg_5 if isinstance(arg_12[0], str)}
        if arg_6 and arg_7:
            arg_0.add_message("format-combined-specification", arg_1=arg_1)
            return

        arg_11 = False
        # Consider "{[0]} {[1]}" as num_args.
        arg_6 += sum(1 for arg_12 in arg_10 if arg_12 == "")
        if arg_10:
            for arg_12 in arg_10:
                if arg_12 and arg_12 not in arg_9:
                    arg_0.add_message(
                        "missing-format-argument-key", arg_1=arg_1, args=(arg_12,)
                    )
            for arg_12 in arg_9:
                if arg_12 not in arg_10:
                    arg_0.add_message(
                        "unused-format-string-argument", arg_1=arg_1, args=(arg_12,)
                    )
            # num_args can be 0 if manual_pos is not.
            arg_6 = arg_6 or arg_7
            if arg_8 or arg_6:
                arg_13 = any(True for arg_12 in arg_10 if arg_12 == "")
                if arg_9 or arg_13:
                    # Verify the required number of positional arguments
                    # only if the .format got at least one keyword argument.
                    # This means that the format strings accepts both
                    # positional and named fields and we should warn
                    # when one of the them is missing or is extra.
                    arg_11 = True
        else:
            arg_11 = True
        if arg_11:
            # num_args can be 0 if manual_pos is not.
            arg_6 = arg_6 or arg_7
            if len(arg_8) > arg_6:
                arg_0.add_message("too-many-format-args", arg_1=arg_1)
            elif len(arg_8) < arg_6:
                arg_0.add_message("too-few-format-args", arg_1=arg_1)

        arg_0._detect_vacuous_formatting(arg_1, arg_8)
        arg_0.Func_specifiers(arg_1, arg_5, arg_9)


return 2.0*len(self.edges) / (len(self.nodes) * (len(self.nodes)-1))

def Func ( arg_0 ) : return 2.0 * len ( arg_0 . edges ) / ( len ( arg_0 . nodes ) * ( len ( arg_0 . nodes ) - 1 ) )

def Func(arg_0):
        """ The number of edges in relation to the total number of possible edges.
        """
        return 2.0*len(arg_0.edges) / (len(arg_0.nodes) * (len(arg_0.nodes)-1))

The number of edges in relation to the total number of possible edges .


def Func(arg_0, arg_1=False):
        """Stop and remove the service

        Consider using Func/start when Docker adds support
        """
        arg_0.log.info(
            "Stopping and removing Docker service %s (id: %s)",
            arg_0.service_name, arg_0.service_id[:7])
        yield arg_0.docker('remove_service', arg_0.service_id[:7])
        arg_0.log.info(
            "Docker service %s (id: %s) removed",
            arg_0.service_name, arg_0.service_id[:7])

        arg_0.clear_state()

Stop and remove the service

        Consider using stop/start when Docker adds support


return self._mc_client._patch(url=self._build_path(list_id, 'members', subscriber_hash), data=data)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update information for a specific list member.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
            list member’s email address.
        :type subscriber_hash: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        """
        arg_2 = check_subscriber_hash(arg_2)
        arg_0.list_id = arg_1
        arg_0.subscriber_hash = arg_2
        return arg_0._mc_client._patch(url=arg_0._build_path(arg_1, 'members', arg_2), arg_3=arg_3)

Update information for a specific list member .


(
            self, set_conversation_notification_level_request
    )

async def Func(
            arg_0, arg_1
    ):
        """Set the notification level of a conversation."""
        arg_2 = hangouts_pb2.SetConversationNotificationLevelResponse()
        await arg_0._pb_request(
            'conversations/setconversationnotificationlevel',
            arg_1, arg_2
        )
        return arg_2

Set the notification level of a conversation .


def Func ( arg_0 ) : arg_1 = 0 arg_2 = 0 for arg_3 in arg_0 . fields : arg_1 = max ( arg_1 , len ( arg_3 [ 'title' ] ) ) arg_2 = max ( arg_2 , len ( arg_3 [ 'description' ] ) ) return ( arg_1 , arg_2 )

def Func(arg_0):
        """
        Gets the maximum length of each column in the field table
        """
        arg_1 = 0
        arg_2 = 0
        for arg_3 in arg_0.fields:
            arg_1 = max(arg_1, len(arg_3['title']))
            arg_2 = max(arg_2, len(arg_3['description']))
        return (arg_1, arg_2)


return self._storage_service.store(pypetconstants.ACCESS_DATA,
                                           self.parent.v_full_name,
                                           self.name,
                                           request, args, kwargs,
                                           trajectory_name=self.traj.v_name)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : return arg_0 . _storage_service . store ( pypetconstants . ACCESS_DATA , arg_0 . parent . v_full_name , arg_0 . name , arg_1 , arg_2 , arg_3 , trajectory_name = arg_0 . traj . v_name )

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Interface with the underlying storage.

        Passes request to the StorageService that performs the appropriate action.
        For example, given a shared table ``t``.
        ``t.remove_row(4)`` is parsed into ``request='remove_row', args=(4,)`` and
        passed onto the storage service. In case of the HDF5StorageService,
        this is again translated back into ``hdf5_table_node.remove_row(4)``.

        """
        return arg_0._storage_service.store(pypetconstants.ACCESS_DATA,
                                           arg_0.parent.v_full_name,
                                           arg_0.name,
                                           arg_1, arg_2, arg_3,
                                           trajectory_name=arg_0.traj.v_name)


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : arg_2 = arg_0 . get_recid ( ) if not arg_0 . hidden and arg_2 : record_add_field ( arg_0 . record , tag = '035' , subfields = [ ( '9' , arg_1 ) , ( 'a' , arg_2 ) ] )

def Func(arg_0, arg_1, arg_2=None):
        """Add 035 number from 001 recid with given source."""
        if not arg_2:
            arg_2 = arg_0.get_recid()
        if not arg_0.hidden and arg_2:
            record_add_field(
                arg_0.record,
                tag='035',
                subfields=[('9', arg_1), ('a', arg_2)]
            )

Add 035 number from 001 recid with given source .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
True
if
hasattr
(
arg_0
,
'headers'
)
:
if
arg_0
.
headers
is
not
:
arg_2
=
False
if
arg_2
is
True
:
arg_0
.
_reset_headers
(
)
if
arg_1
is
not
:
for
arg_3
,
arg_4
in
arg_1
.
items
(
)
:
arg_0
.
headers
[
arg_3
]
=
arg_4
arg_6
=
","
.
join
(
list
(
arg_0
.
headers
.
keys
(
)
)
)
bot
.
debug
(
"Headers found: %s"
%
arg_6
)

def Func(arg_0,arg_1=None):
    '''update headers with a token & other fields
    '''
    arg_2 = True
    if hasattr(arg_0, 'headers'):
        if arg_0.headers is not None:
            arg_2 = False

    if arg_2 is True:
        arg_0._reset_headers()

    if arg_1 is not None:
        for arg_3,arg_4 in arg_1.items():
            arg_0.headers[arg_3] = arg_4

    arg_6 = ",".join(list(arg_0.headers.keys()))
    bot.debug("Headers found: %s" %arg_6)


(self,
                url: str,
                method: str = 'GET',
                *,
                callback=None,
                encoding: typing.Optional[str] = None,
                headers: dict = None,
                metadata: dict = None,
                request_config: dict = None,
                request_session=None,
                **kwargs)

return Request(
            url=url,
            method=method,
            callback=callback,
            encoding=encoding,
            headers=headers,
            metadata=metadata,
            request_config=request_config,
            request_session=request_session,
            **kwargs)

def Func(arg_0,
                arg_1: arg_2,
                arg_3: arg_2 = 'GET',
                *,
                arg_4=None,
                arg_5: arg_6.Optional[arg_2] = None,
                arg_8: arg_9 = None,
                arg_10: arg_9 = None,
                arg_11: arg_9 = None,
                arg_12=None,
                **arg_13):
        """Init a Request class for crawling html"""
        arg_8 = arg_8 or {}
        arg_10 = arg_10 or {}
        arg_11 = arg_11 or {}
        arg_12 = arg_12 or arg_0.Func_session

        arg_8.update(arg_0.headers.copy())
        arg_11.update(arg_0.Func_config.copy())
        arg_13.update(arg_0.kwargs.copy())

        return Request(
            arg_1=arg_1,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5,
            arg_8=arg_8,
            arg_10=arg_10,
            arg_11=arg_11,
            arg_12=arg_12,
            **arg_13)


def Func ( arg_0 , arg_1 ) : arg_2 = minidom . parseString ( arg_1 ) return arg_0 . parse_dom ( arg_2 )

def Func(arg_0, arg_1):
        """Parse a string into a Graph.

        :param string: String that is to be passed into Grapg
        :return: Graph
        """
        arg_2 = minidom.parseString(arg_1)
        return arg_0.parse_dom(arg_2)


def Func():
    """Load a keyring using the config file in the config root."""

    arg_0 = 'keyringrc.cfg'

    arg_1 = os.path.join(platform.config_root(), arg_0)

    if not os.path.exists(arg_1):
        return

    arg_2 = configparser.RawConfigParser()
    arg_2.read(arg_1)
    _load_keyring_path(arg_2)

    # load the keyring class name, and then load this keyring
    try:
        if arg_2.has_section("backend"):
            arg_3 = arg_2.get("backend", "default-keyring").strip()
        else:
            raise configparser.NoOptionError('backend', 'default-keyring')

    except (configparser.NoOptionError, ImportError):
        arg_4 = logging.getLogger('keyring')
        arg_4.warning("Keyring config file contains incorrect values.\n"
                       + "Config file: %s" % arg_1)
        return

    return load_keyring(arg_3)

Load a keyring using the config file in the config root .


(self, table_name, sample, unique_fields=None)

return search_unique(table=self.table(table_name),
                             sample=sample,
                             unique_fields=unique_fields)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : return Func ( table = arg_0 . table ( arg_1 ) , arg_2 = arg_2 , arg_3 = arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """ Search in `table` an item with the value of the `unique_fields` in the `data` sample.
        Check if the the obtained result is unique. If nothing is found will return an empty list,
        if there is more than one item found, will raise an IndexError.

        Parameters
        ----------
        table_name: str

        sample: dict
            Sample data

        unique_fields: list of str
            Name of fields (keys) from `data` which are going to be used to build
            a sample to look for exactly the same values in the database.
            If None, will use every key in `data`.

        Returns
        -------
        eid: int
            Id of the object found with same `unique_fields`.
            None if none is found.

        Raises
        ------
        MoreThanOneItemError
            If more than one example is found.
        """
        return Func(table=arg_0.table(arg_1),
                             arg_2=arg_2,
                             arg_3=arg_3)

Search in table an item with the value of the unique_fields in the data sample . Check if the the obtained result is unique . If nothing is found will return an empty list if there is more than one item found will raise an IndexError .


return time(self.hour, self.minute, self.second, self.microsecond,
                    self._tzinfo)

def Func ( arg_0 ) : return time ( arg_0 . hour , arg_0 . minute , arg_0 . second , arg_0 . microsecond , arg_0 . _tzinfo )

def Func(arg_0):
        "Return the time part, with same tzinfo."
        return time(arg_0.hour, arg_0.minute, arg_0.second, arg_0.microsecond,
                    arg_0._tzinfo)


def Func ( arg_0 ) : arg_1 = dict ( ) for arg_2 in arg_0 . _unique_checks : arg_3 = arg_2 [ 0 ] arg_1 [ arg_3 ] = set ( ) return arg_1

def Func(arg_0):
        """Initialise sets used for uniqueness checking."""

        arg_1 = dict()
        for arg_2 in arg_0._unique_checks:
            arg_3 = arg_2[0]
            arg_1[arg_3] = set() # empty set
        return arg_1

Initialise sets used for uniqueness checking .


def Func(arg_0):
    """
    Load crs object from epsg code, via spatialreference.org.
    Parses based on the proj4 representation.

    Arguments:

    - *code*: The EPSG code as an integer.

    Returns:

    - A CS instance of the indicated type.
    """
    # must go online (or look up local table) to get crs details
    arg_0 = str(arg_0)
    arg_1 = utils.crscode_to_string("epsg", arg_0, "proj4")
    arg_2 = from_proj4(arg_1)
    return arg_2

Load crs object from epsg code via spatialreference . org . Parses based on the proj4 representation .


(self, stream_id, source_component, latency_in_ns)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Apply updates to the deserialization metrics"""
    arg_0.update_count(arg_0.TUPLE_DESERIALIZATION_TIME_NS, incr_by=arg_3, key=arg_1)
    arg_4 = arg_2 + "/" + arg_1
    arg_0.update_count(arg_0.TUPLE_DESERIALIZATION_TIME_NS, incr_by=arg_3,
                      key=arg_4)


def Func ( arg_0 = None , arg_1 = None , ** arg_2 ) : arg_3 = [ ] arg_4 = arg_0 . list ( ** arg_2 ) while arg_4 is not None : arg_5 = arg_4 . execute ( ) if arg_1 and arg_1 in arg_5 : arg_3 . extend ( arg_5 [ arg_1 ] ) else : arg_3 . append ( arg_5 ) if hasattr ( arg_0 , 'list_next' ) : arg_4 = arg_0 . list_next ( previous_request = arg_4 , previous_response = arg_5 ) else : arg_4 = None return arg_3

def Func(arg_0=None, arg_1=None, **arg_2):
    """General list function for Google APIs."""
    arg_3 = []
    arg_4 = arg_0.list(**arg_2)

    while arg_4 is not None:
        arg_5 = arg_4.execute()
        if arg_1 and arg_1 in arg_5:
            arg_3.extend(arg_5[arg_1])
        else:
            arg_3.append(arg_5)
        # Not all list calls have a list_next
        if hasattr(arg_0, 'list_next'):
            arg_4 = arg_0.list_next(previous_request=arg_4,
                                    previous_response=arg_5)
        else:
            arg_4 = None
    return arg_3


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if not arg_0 . condition ( arg_1 ) : return steps . StepResult ( state = steps . SKIPPED ) return None

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        A modifier hook function.  This is called in priority order prior
        to invoking the ``Action`` for the step.  This allows a
        modifier to alter the context, or to take over subsequent
        action invocation.

        :param ctxt: The context object.
        :param pre_mod: A list of the modifiers preceding this
                        modifier in the list of modifiers that is
                        applicable to the action.  This list is in
                        priority order.
        :param post_mod: A list of the modifiers following this
                         modifier in the list of modifiers that is
                         applicable to the action.  This list is in
                         priority order.
        :param action: The action that will be performed.

        :returns: A ``None`` return value indicates that the modifier
                  is taking no action.  A non-``None`` return value
                  should consist of a ``StepResult`` object; this will
                  suspend further ``Func()`` processing and
                  proceed to the ``post_call()`` processing.  This
                  implementation returns a ``StepResult`` with state
                  ``SKIPPED`` if the condition does not evaluate to
                  ``True``.
        """

        # Check the condition
        if not arg_0.condition(arg_1):
            return steps.StepResult(state=steps.SKIPPED)

        return None

A modifier hook function.  This is called in priority order prior
        to invoking the ``Action`` for the step.  This allows a
        modifier to alter the context, or to take over subsequent
        action invocation.

        :param ctxt: The context object.
        :param pre_mod: A list of the modifiers preceding this
                        modifier in the list of modifiers that is
                        applicable to the action.  This list is in
                        priority order.
        :param post_mod: A list of the modifiers following this
                         modifier in the list of modifiers that is
                         applicable to the action.  This list is in
                         priority order.
        :param action: The action that will be performed.

        :returns: A ``None`` return value indicates that the modifier
                  is taking no action.  A non-``None`` return value
                  should consist of a ``StepResult`` object; this will
                  suspend further ``pre_call()`` processing and
                  proceed to the ``post_call()`` processing.  This
                  implementation returns a ``StepResult`` with state
                  ``SKIPPED`` if the condition does not evaluate to
                  ``True``.

A modifier hook function . This is called in priority order prior to invoking the Action for the step . This allows a modifier to alter the context or to take over subsequent action invocation .


def Func(arg_0, arg_1=False):
        """
            Load slug.

            Loads by id, or by slug if id is not present or use slug is True.
        """
        arg_2 = None
        if arg_1 or not arg_0.id:
            arg_2 = arg_0.slug
        else:
            arg_2 = arg_0.id
        if not arg_2:
            raise NotFoundError("One of self.id or self.slug must be set.")
        arg_3 = arg_0.get_data("images/%s" % arg_2)
        arg_4 = arg_3['image']

        # Setting the attribute values
        for arg_5 in arg_4.keys():
            setattr(arg_0, arg_5, arg_4[arg_5])

        return arg_0


def Func(arg_0, arg_1, arg_2=False):
        """
        The file path can be stored in a local file system, HDFS, S3,
        or any Hadoop-supported file system.
        """
        arg_3 = DefinitionLoader.from_json_path(arg_0)
        arg_4 = BCommon.text_from_path(arg_0)
        arg_5 = model_from_json(arg_4)
        WeightLoader.load_weights_from_hdf5(arg_3, arg_5, arg_1, arg_2)
        return arg_3

The file path can be stored in a local file system HDFS S3 or any Hadoop - supported file system .


def Func(arg_0, arg_1, arg_2):
        """Set the input or output mode for a specified pin.  Mode should be
        either OUT or IN."""
        arg_0._Func_pin(arg_1, arg_2)
        arg_0.mpsse_write_gpio()

Set the input or output mode for a specified pin . Mode should be either OUT or IN .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_0 . linter . print_full_documentation ( ) sys . exit ( 0 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """optik callback for printing full documentation"""
        arg_0.linter.print_full_documentation()
        sys.exit(0)


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = yml_fpath ( arg_0 [ "conf" ] [ "OUTPUT" ] ) with open ( arg_1 , 'w' ) as yml_file : arg_2 = yaml . dump ( arg_0 , explicit_start = True , default_flow_style = False ) yml_file . write ( arg_2 )

def Func(arg_0, arg_1=None):
    """Dump the given trun to file"""

    if arg_1 is None:
        arg_1 = yml_fpath(arg_0["conf"]["OUTPUT"])

    with open(arg_1, 'w') as yml_file:
        arg_2 = yaml.dump(arg_0, explicit_start=True, default_flow_style=False)
        yml_file.write(arg_2)


def Func(arg_0, arg_1, arg_2):
        """
        Batch subscribe or unsubscribe list members.

        Only the members array is required in the request body parameters.
        Within the members array, each member requires an email_address
        and either a status or status_if_new. The update_existing parameter
        will also be considered required to help prevent accidental updates
        to existing members and will default to false if not present.

        :param list_id: The unique id for the list.
        :type list_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "members": array*
            [
                {
                    "email_address": string*,
                    "status": string* (Must be one of 'subscribed', 'unsubscribed', 'cleaned', or 'pending'),
                    "status_if_new": string* (Must be one of 'subscribed', 'unsubscribed', 'cleaned', or 'pending')
                }
            ],
            "update_existing": boolean*
        }
        """
        arg_0.list_id = arg_1
        if 'members' not in arg_2:
            raise KeyError('The update must have at least one member')
        else:
            if not len(arg_2['members']) <= 500:
                raise ValueError('You may only batch sub/unsub 500 members at a time')
        for arg_3 in arg_2['members']:
            if 'email_address' not in arg_3:
                raise KeyError('Each list member must have an email_address')
            check_email(arg_3['email_address'])
            if 'status' not in arg_3 and 'status_if_new' not in arg_3:
                raise KeyError('Each list member must have either a status or a status_if_new')
            arg_4 = ['subscribed', 'unsubscribed', 'cleaned', 'pending']
            if 'status' in arg_3 and arg_3['status'] not in arg_4:
                raise ValueError('The list member status must be one of "subscribed", "unsubscribed", "cleaned", or '
                                 '"pending"')
            if 'status_if_new' in arg_3 and arg_3['status_if_new'] not in arg_4:
                raise ValueError('The list member status_if_new must be one of "subscribed", "unsubscribed", '
                                 '"cleaned", or "pending"')
        if 'update_existing' not in arg_2:
            arg_2['update_existing'] = False
        return arg_0._mc_client._post(url=arg_0._build_path(arg_1), arg_2=arg_2)

Batch subscribe or unsubscribe list members .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
network
.
parameters
if
arg_0
.
config
.
fixed_parameters
:
logging
.
info
(
"fixed parameters: %s"
%
", "
.
join
(
map
(
str
,
arg_0
.
config
.
fixed_parameters
)
)
)
arg_1
=
[
p
for
p
in
arg_1
if
p
not
in
arg_0
.
config
.
fixed_parameters
]
return
arg_1

def Func(arg_0):
        """
        Get parameters to be optimized.
        """
        arg_1 = arg_0.network.parameters
        # Freeze parameters
        if arg_0.config.fixed_parameters:
            logging.info("fixed parameters: %s" % ", ".join(map(str, arg_0.config.fixed_parameters)))
            arg_1 = [p for p in arg_1 if p not in arg_0.config.fixed_parameters]
        return arg_1


def Func(arg_0):
    '''
    This is a parallel worker that reforms light curves for TFA.

    task[0] = lcfile
    task[1] = lcformat
    task[2] = lcformatdir
    task[3] = timecol
    task[4] = magcol
    task[5] = errcol
    task[6] = timebase
    task[7] = interpolate_type
    task[8] = sigclip

    '''

    try:

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

        try:
            arg_10 = get_lcformat(arg_2,
                                      use_lcformat_dir=arg_3)
            if arg_10:
                (arg_11, arg_12,
                 arg_13, arg_14, arg_15,
                 arg_16, arg_17) = arg_10
            else:
                LOGERROR("can't figure out the light curve format")
                return None
        except Exception as e:
            LOGEXCEPTION("can't figure out the light curve format")
            return None

        # get the LC into a dict
        arg_18 = arg_12(arg_1)

        # this should handle lists/tuples being returned by readerfunc
        # we assume that the first element is the actual lcdict
        # FIXME: figure out how to not need this assumption
        if ( (isinstance(arg_18, (list, tuple))) and
             (isinstance(arg_18[0], dict)) ):
            arg_18 = arg_18[0]

        arg_19 = {}

        # dereference the columns and get them from the lcdict
        if '.' in arg_4:
            arg_20 = arg_4.split('.')
        else:
            arg_20 = [arg_4]
        arg_21 = _dict_get(arg_18, arg_20)

        if '.' in arg_5:
            arg_22 = arg_5.split('.')
        else:
            arg_22 = [arg_5]
        arg_23 = _dict_get(arg_18, arg_22)

        if '.' in arg_6:
            arg_24 = arg_6.split('.')
        else:
            arg_24 = [arg_6]
        arg_25 = _dict_get(arg_18, arg_24)

        # normalize here if not using special normalization
        if arg_17 is None:
            arg_26, arg_27 = normalize_magseries(
                arg_21, arg_23,
                arg_16=arg_16
            )

        arg_21, arg_23, arg_25 = arg_26, arg_27, arg_25

        #
        # now we'll do: 1. sigclip, 2. reform to timebase, 3. renorm to zero
        #

        # 1. sigclip as requested
        arg_28, arg_29, arg_30 = sigclip_magseries(arg_21,
                                                 arg_23,
                                                 arg_25,
                                                 arg_9=arg_9)

        # 2. now, we'll renorm to the timebase
        arg_31 = spi.interp1d(arg_28, arg_29,
                                         kind=arg_8,
                                         fill_value='extrapolate')
        arg_32 = spi.interp1d(arg_28, arg_30,
                                         kind=arg_8,
                                         fill_value='extrapolate')

        arg_33 = arg_31(arg_7)
        arg_34 = arg_32(arg_7)

        # 3. renorm to zero
        arg_35 = np.median(arg_33)

        arg_36 = arg_33 - arg_35

        # update the dict
        arg_19 = {'mags':arg_36,
                   'errs':arg_34,
                   'origmags':arg_33}

        #
        # done with this magcol
        #
        return arg_19

    except Exception as e:

        LOGEXCEPTION('reform LC task failed: %s' % repr(arg_0))
        return None

This is a parallel worker that reforms light curves for TFA .


def
Func
(
arg_0
,
**
arg_1
)
:
arg_0
.
_fill_project_info
(
arg_1
)
arg_1
.
update
(
{
'time'
:
datetime
.
utcnow
(
)
}
)
arg_2
=
arg_0
.
db
.
ValidLog
.
insert_one
(
arg_1
)
arg_3
=
arg_0
.
_print_dict
(
arg_1
)
logging
.
info
(
"[Database] valid log: "
+
arg_3
)

def Func(arg_0, **arg_1):
        """Saves the validation log, timestamp will be added automatically.

        Parameters
        -----------
        kwargs : logging information
            Events, such as accuracy, loss, step number and etc.

        Examples
        ---------
        >>> db.Func(accuracy=0.33, loss=0.98)

        """

        arg_0._fill_project_info(arg_1)
        arg_1.update({'time': datetime.utcnow()})
        arg_2 = arg_0.db.ValidLog.insert_one(arg_1)
        arg_3 = arg_0._print_dict(arg_1)
        logging.info("[Database] valid log: " + arg_3)

Saves the validation log, timestamp will be added automatically.

        Parameters
        -----------
        kwargs : logging information
            Events, such as accuracy, loss, step number and etc.

        Examples
        ---------
        >>> db.save_validation_log(accuracy=0.33, loss=0.98)

Saves the validation log timestamp will be added automatically .


def Func(arg_0, arg_1):
        ''' append two required tasks to the given output to ingest to VS
        '''
        # append two tasks to self['definition']['tasks']
        arg_2 = Task('IngestItemJsonToVectorServices')
        arg_2.inputs.items = arg_1
        arg_2.impersonation_allowed = True

        arg_6 = Task('StageDataToS3')
        arg_6.inputs.destination = 's3://{vector_ingest_bucket}/{recipe_id}/{run_id}/{task_name}'
        arg_6.inputs.data = arg_2.outputs.result.value

        arg_0.definition['tasks'].append(arg_2.generate_task_workflow_json())
        arg_0.definition['tasks'].append(arg_6.generate_task_workflow_json())


def
Func
(
arg_0
)
:
logger
.
debug
(
'In state: Func'
)
arg_0
.
current_state
=
STATE_Func
if
arg_0
.
script
is
not
:
arg_0
.
script
.
script_init
(
arg_0
.
client
.
lease
,
arg_0
.
current_state
)
arg_0
.
script
.
script_go
(
)
set_net
(
arg_0
.
client
.
lease
)
raise
arg_0
.
INIT
(
)

def Func(arg_0):
        """Func state."""
        logger.debug('In state: Func')
        arg_0.current_state = STATE_Func
        if arg_0.script is not None:
            arg_0.script.script_init(arg_0.client.lease, arg_0.current_state)
            arg_0.script.script_go()
        set_net(arg_0.client.lease)
        raise arg_0.INIT()


def Func(arg_0, arg_1, arg_2):
    """Runs one iteration of Slice Sampler.

    Args:
      current_state: `Tensor` or Python `list` of `Tensor`s representing the
        current state(s) of the Markov chain(s). The first `r` dimensions
        index independent chains,
        `r = tf.rank(target_log_prob_fn(*current_state))`.
      previous_kernel_results: `collections.namedtuple` containing `Tensor`s
        representing values from previous calls to this function (or from the
        `bootstrap_results` function.)

    Returns:
      next_state: Tensor or Python list of `Tensor`s representing the state(s)
        of the Markov chain(s) after taking exactly one step. Has same type and
        shape as `current_state`.
      kernel_results: `collections.namedtuple` of internal calculations used to
        advance the chain.

    Raises:
      ValueError: if there isn't one `step_size` or a list with same length as
        `current_state`.
      TypeError: if `not target_log_prob.dtype.is_floating`.
    """
    with tf.compat.v1.name_scope(
        name=mcmc_util.make_name(arg_0.name, 'slice', 'Func'),
        values=[
            arg_0.step_size, arg_0.max_doublings, arg_0._seed_stream,
            arg_1, arg_2.target_log_prob
        ]):
      with tf.compat.v1.name_scope('initialize'):
        [
            arg_3,
            arg_4,
            arg_5
        ] = _prepare_args(
            arg_0.target_log_prob_fn,
            arg_1,
            arg_0.step_size,
            arg_2.target_log_prob,
            maybe_expand=True)

        arg_6 = tf.convert_to_tensor(
            value=arg_0.max_doublings, dtype=tf.int32, name='max_doublings')

      arg_7 = distribution_util.prefer_static_rank(
          arg_5)

      [
          arg_8,
          arg_9,
          arg_10,
          arg_11,
          arg_12,
          arg_13
      ] = _sample_next(
          arg_0.target_log_prob_fn,
          arg_3,
          arg_4,
          arg_6,
          arg_5,
          arg_7,
          seed=arg_0._seed_stream()
      )

      def maybe_flatten(arg_14):
        return arg_14 if mcmc_util.is_list_like(arg_1) else arg_14[0]

      return [
          maybe_flatten(arg_8),
          SliceSamplerKernelResults(
              target_log_prob=arg_9,
              arg_10=arg_10,
              arg_11=arg_11,
              arg_12=arg_12,
              arg_13=arg_13
          ),
      ]


return self.tiers[name_num - 1] if isinstance(name_num, int) else\
            [i for i in self.tiers if i.name == name_num][0]

def Func ( arg_0 , arg_1 ) : return arg_0 . tiers [ arg_1 - 1 ] if isinstance ( arg_1 , int ) else [ arg_2 for arg_2 in arg_0 . tiers if arg_2 . name == arg_1 ] [ 0 ]

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

        :param name_num: Name or number of the tier to return.
        :type name_num: int or str
        :returns: The tier.
        :raises IndexError: If the tier doesn't exist.
        """
        return arg_0.tiers[arg_1 - 1] if isinstance(arg_1, int) else\
            [arg_2 for arg_2 in arg_0.tiers if arg_2.name == arg_1][0]

Gives a tier when multiple tiers exist with that name only the first is returned .


def Func ( arg_0 : arg_1 . ExceptHandler , arg_3 ) -> bool : def stringify_error ( arg_4 ) : if not isinstance ( arg_4 , str ) : return arg_4 . __name__ return arg_4 if not isinstance ( arg_3 , tuple ) : arg_3 = ( arg_3 , ) arg_5 = { stringify_error ( arg_4 ) for arg_4 in arg_3 } if not arg_0 . type : return True return arg_0 . catch ( arg_5 )

def Func(arg_0: arg_1.ExceptHandler, arg_3) -> bool:
    """
    Check if the given exception handler catches
    the given error_type.

    The *handler* parameter is a node, representing an ExceptHandler node.
    The *error_type* can be an exception, such as AttributeError,
    the name of an exception, or it can be a tuple of errors.
    The function will return True if the handler catches any of the
    given errors.
    """

    def stringify_error(arg_4):
        if not isinstance(arg_4, str):
            return arg_4.__name__
        return arg_4

    if not isinstance(arg_3, tuple):
        arg_3 = (arg_3,)  # type: ignore
    arg_5 = {stringify_error(arg_4) for arg_4 in arg_3}  # type: ignore
    if not arg_0.type:
        return True
    return arg_0.catch(arg_5)

Check if the given exception handler catches the given error_type .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_0 = list ( arg_0 ) arg_1 = max ( arg_0 ) + 1 arg_2 = [ False ] * arg_1 for arg_3 in arg_0 : arg_2 [ arg_3 ] = True return arg_2

def Func(arg_0, arg_1=None):
    """
    Constructs a list of booleans where an item is True if its position is in
    `indices` otherwise it is False.

    Args:
        indices (list): list of integer indices

        maxval (int): length of the returned list. If not specified
            this is inferred from `indices`

    Note:
        In the future the arg `maxval` may change its name to `shape`

    Returns:
        list: mask: list of booleans. mask[idx] is True if idx in indices

    Example:
        >>> import ubelt as ub
        >>> indices = [0, 1, 4]
        >>> mask = ub.Func(indices, maxval=6)
        >>> assert mask == [True, True, False, False, True, False]
        >>> mask = ub.Func(indices)
        >>> assert mask == [True, True, False, False, True]
    """
    if arg_1 is None:
        arg_0 = list(arg_0)
        arg_1 = max(arg_0) + 1
    arg_2 = [False] * arg_1
    for arg_3 in arg_0:
        arg_2[arg_3] = True
    return arg_2

Constructs a list of booleans where an item is True if its position is in
    `indices` otherwise it is False.

    Args:
        indices (list): list of integer indices

        maxval (int): length of the returned list. If not specified
            this is inferred from `indices`

    Note:
        In the future the arg `maxval` may change its name to `shape`

    Returns:
        list: mask: list of booleans. mask[idx] is True if idx in indices

    Example:
        >>> import ubelt as ub
        >>> indices = [0, 1, 4]
        >>> mask = ub.boolmask(indices, maxval=6)
        >>> assert mask == [True, True, False, False, True, False]
        >>> mask = ub.boolmask(indices)
        >>> assert mask == [True, True, False, False, True]

Constructs a list of booleans where an item is True if its position is in indices otherwise it is False .


def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) : arg_3 = get_object ( arg_0 ) arg_2 = ast . literal_eval ( arg_2 ) if not isinstance ( arg_2 , tuple ) : arg_2 = ( arg_2 , ) return arg_3 . node ( * arg_2 )

def Func(arg_0: arg_1, arg_2: arg_1):
    """Get node from object name and arg string

    Not Used. Left for future reference purpose.
    """
    arg_3 = get_object(arg_0)
    arg_2 = ast.literal_eval(arg_2)
    if not isinstance(arg_2, tuple):
        arg_2 = (arg_2,)

    return arg_3.node(*arg_2)


def Func ( arg_0 , arg_1 = False ) : arg_2 = get_attrs ( arg_0 , arg_1 ) if hasattr ( arg_0 , "max_length" ) and not arg_0 . max_length : return forms . Textarea ( arg_2 = arg_2 ) elif isinstance ( arg_0 , DateTimeField ) : return forms . DateTimeInput ( arg_2 = arg_2 ) elif isinstance ( arg_0 , BooleanField ) : return forms . CheckboxInput ( arg_2 = arg_2 ) elif isinstance ( arg_0 , ReferenceField ) or arg_0 . choices : return forms . Select ( arg_2 = arg_2 ) elif ( isinstance ( arg_0 , ListField ) or isinstance ( arg_0 , EmbeddedDocumentField ) or isinstance ( arg_0 , GeoPointField ) ) : return None else : return forms . TextInput ( arg_2 = arg_2 )

def Func(arg_0, arg_1=False):
    """Choose which widget to display for a field."""

    arg_2 = get_attrs(arg_0, arg_1)

    if hasattr(arg_0, "max_length") and not arg_0.max_length:
        return forms.Textarea(arg_2=arg_2)

    elif isinstance(arg_0, DateTimeField):
        return forms.DateTimeInput(arg_2=arg_2)

    elif isinstance(arg_0, BooleanField):
        return forms.CheckboxInput(arg_2=arg_2)

    elif isinstance(arg_0, ReferenceField) or arg_0.choices:
        return forms.Select(arg_2=arg_2)

    elif (isinstance(arg_0, ListField) or
          isinstance(arg_0, EmbeddedDocumentField) or
          isinstance(arg_0, GeoPointField)):
        return None

    else:
        return forms.TextInput(arg_2=arg_2)

Choose which widget to display for a field .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
"graph.dot"
)
:
arg_3
=
Digraph
(
)
for
arg_4
in
arg_0
.
nodes
(
)
:
arg_3
.
node
(
arg_4
,
"%s %0.3f"
%
(
arg_4
,
arg_1
[
arg_4
]
)
)
for
arg_5
in
arg_0
.
edges
(
)
:
arg_3
.
edge
(
arg_5
[
0
]
,
arg_5
[
1
]
,
constraint
=
"false"
)
with
open
(
arg_2
,
'w'
)
as
f
:
f
.
write
(
arg_3
.
source
)

def Func (arg_0, arg_1, arg_2="graph.dot"):
    """
    output the graph in Dot file format
    """
    arg_3 = Digraph()

    for arg_4 in arg_0.nodes():
        arg_3.node(arg_4, "%s %0.3f" % (arg_4, arg_1[arg_4]))

    for arg_5 in arg_0.edges():
        arg_3.edge(arg_5[0], arg_5[1], constraint="false")

    with open(arg_2, 'w') as f:
        f.write(arg_3.source)


def
Func
(
arg_0
,
**
arg_1
)
:
arg_2
=
arg_0
.
_make
(
map
(
arg_1
.
pop
,
(
'scheme'
,
'netloc'
,
'path'
,
'query'
,
'fragment'
)
,
arg_0
)
)
if
arg_1
:
raise
ValueError
(
'Got unexpected field names: %r'
%
arg_1
.
keys
(
)
)
return
arg_2

def Func(arg_0, **arg_1):
        'Return a new SplitResult object replacing specified fields with new values'
        arg_2 = arg_0._make(map(arg_1.pop, ('scheme', 'netloc', 'path', 'query', 'fragment'), arg_0))
        if arg_1:
            raise ValueError('Got unexpected field names: %r' % arg_1.keys())
        return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
,
arg_5
,
arg_6
=
get_job_or_local
(
arg_0
.
obj
.
get
(
'project'
)
,
arg_0
.
obj
.
get
(
'job'
)
)
if
arg_1
:
try
:
arg_7
=
PolyaxonClient
(
)
.
job
.
Func
(
arg_4
,
arg_5
,
arg_6
,
stream
=
False
)
get_Func_handler
(
handle_job_info
=
False
,
show_timestamp
=
not
arg_3
,
stream
=
False
)
(
arg_7
.
content
.
decode
(
)
.
split
(
'\n'
)
)
print
(
)
if
not
arg_2
:
return
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
if
not
arg_2
:
Printer
.
print_error
(
'Could not get Func for job `{}`.'
.
format
(
arg_6
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)
try
:
PolyaxonClient
(
)
.
job
.
Func
(
arg_4
,
arg_5
,
arg_6
,
message_handler
=
get_Func_handler
(
handle_job_info
=
False
,
show_timestamp
=
not
arg_3
)
)
except
(
PolyaxonHTTPError
,
PolyaxonShouldExitError
,
PolyaxonClientException
)
as
e
:
Printer
.
print_error
(
'Could not get Func for job `{}`.'
.
format
(
arg_6
)
)
Printer
.
print_error
(
'Error message `{}`.'
.
format
(
e
)
)
sys
.
exit
(
1
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Get job Func.

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

    Examples:

    \b
    ```bash
    $ polyaxon job -j 2 Func
    ```

    \b
    ```bash
    $ polyaxon job Func
    ```
    """
    arg_4, arg_5, arg_6 = get_job_or_local(arg_0.obj.get('project'), arg_0.obj.get('job'))

    if arg_1:
        try:
            arg_7 = PolyaxonClient().job.Func(
                arg_4, arg_5, arg_6, stream=False)
            get_Func_handler(handle_job_info=False,
                             show_timestamp=not arg_3,
                             stream=False)(arg_7.content.decode().split('\n'))
            print()

            if not arg_2:
                return
        except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
            if not arg_2:
                Printer.print_error('Could not get Func for job `{}`.'.format(arg_6))
                Printer.print_error('Error message `{}`.'.format(e))
                sys.exit(1)

    try:
        PolyaxonClient().job.Func(
            arg_4,
            arg_5,
            arg_6,
            message_handler=get_Func_handler(handle_job_info=False, show_timestamp=not arg_3))
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not get Func for job `{}`.'.format(arg_6))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

Get job logs.

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

    Examples:

    \b
    ```bash
    $ polyaxon job -j 2 logs
    ```

    \b
    ```bash
    $ polyaxon job logs
    ```


def Func ( arg_0 ) : _AssertIsLocal ( arg_0 ) if sys . platform != 'win32' : return os . readlink ( arg_0 ) if not IsLink ( arg_0 ) : from . _exceptions import FileNotFoundError raise FileNotFoundError ( arg_0 ) import jaraco . windows . filesystem arg_1 = jaraco . windows . filesystem . readlink ( arg_0 ) if '\\??\\' in arg_1 : arg_1 = arg_1 . split ( '\\??\\' ) [ 1 ] return arg_1

def Func(arg_0):
    '''
    Read the target of the symbolic link at `path`.

    :param unicode path:
        Path to a symbolic link

    :returns unicode:
        Target of a symbolic link
    '''
    _AssertIsLocal(arg_0)

    if sys.platform != 'win32':
        return os.readlink(arg_0)  # @UndefinedVariable

    if not IsLink(arg_0):
        from ._exceptions import FileNotFoundError
        raise FileNotFoundError(arg_0)

    import jaraco.windows.filesystem
    arg_1 = jaraco.windows.filesystem.readlink(arg_0)
    if '\\??\\' in arg_1:
        arg_1 = arg_1.split('\\??\\')[1]
    return arg_1

Read the target of the symbolic link at path .


def Func ( arg_0 ) : arg_1 = arg_0 . zobrist_hash ( ) if arg_0 . transpositions [ arg_1 ] < 4 : return False return True

def Func(arg_0):
        '''
        a game is ended if a position occurs for the fourth time
        on consecutive alternating moves.
        '''
        arg_1 = arg_0.zobrist_hash()

        # A minimum amount of moves must have been played and the position
        # in question must have appeared at least four times.
        if arg_0.transpositions[arg_1] < 4:
            return False

        return True

a game is ended if a position occurs for the fourth time on consecutive alternating moves .


def Func(arg_0, arg_1):
        '''
        Merge the other HyperLogLog with this one, making this the union of the
        two.

        Args:
            other (datasketch.HyperLogLog):
        '''
        if arg_0.m != arg_1.m or arg_0.p != arg_1.p:
            raise ValueError("Cannot Func HyperLogLog with different\
                    precisions.")
        arg_0.reg = np.maximum(arg_0.reg, arg_1.reg)

Merge the other HyperLogLog with this one making this the union of the two .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
getattr
(
styles
,
arg_1
.
upper
(
)
)
except
AttributeError
:
raise
ColorfulError
(
'the style "{0}" is undefined'
.
format
(
arg_1
)
)
else
:
arg_0
.
colorpalette
=
arg_2

def Func(arg_0, arg_1):
        """
        Use a predefined style as color palette

        :param str style_name: the name of the style
        """
        try:
            arg_2 = getattr(styles, arg_1.upper())
        except AttributeError:
            raise ColorfulError('the style "{0}" is undefined'.format(
                arg_1))
        else:
            arg_0.colorpalette = arg_2


def Func ( arg_0 , arg_1 ) : if arg_0 . null_session : return arg_0 . _init ( ) arg_2 = arg_1 . _pk if not arg_2 . endswith ( ':None' ) : arg_0 . known [ arg_2 ] = arg_1 arg_0 . wknown [ arg_2 ] = arg_1

def Func(arg_0, arg_1):
        '''
        Adds an entity to the session.
        '''
        if arg_0.null_session:
            return
        arg_0._init()
        arg_2 = arg_1._pk
        if not arg_2.endswith(':None'):
            arg_0.known[arg_2] = arg_1
            arg_0.wknown[arg_2] = arg_1


def Func(arg_0, arg_1, arg_2):
    """
    Project coordinates from one image shape to another.

    This performs a relative projection, e.g. a point at 60% of the old
    image width will be at 60% of the new image width after projection.

    Parameters
    ----------
    coords : ndarray or tuple of number
        Coordinates to project. Either a ``(N,2)`` numpy array or a tuple
        of `(x,y)` coordinates.

    from_shape : tuple of int or ndarray
        Old image shape.

    to_shape : tuple of int or ndarray
        New image shape.

    Returns
    -------
    ndarray
        Projected coordinates as ``(N,2)`` ``float32`` numpy array.

    """
    arg_1 = normalize_shape(arg_1)
    arg_2 = normalize_shape(arg_2)
    if arg_1[0:2] == arg_2[0:2]:
        return arg_0

    arg_3, arg_4 = arg_1[0:2]
    arg_5, arg_6 = arg_2[0:2]
    assert all([arg_7 > 0 for arg_7 in [arg_3, arg_4, arg_5, arg_6]])

    # make sure to not just call np.float32(coords) here as the following lines
    # perform in-place changes and np.float32(.) only copies if the input
    # was *not* a float32 array
    arg_8 = np.array(arg_0).astype(np.float32)
    arg_8[:, 0] = (arg_8[:, 0] / arg_4) * arg_6
    arg_8[:, 1] = (arg_8[:, 1] / arg_3) * arg_5
    return arg_8

Project coordinates from one image shape to another .


(sr, fmin, n_bins, bins_per_octave, tuning,
                     filter_scale, norm, sparsity, hop_length=None,
                     window='hann')

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 = None , arg_9 = 'hann' ) : arg_10 , arg_11 = filters . constant_q ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , pad_fft = True , arg_9 = arg_9 ) arg_12 = arg_10 . shape [ 1 ] if ( arg_8 is not None and arg_12 < 2.0 ** ( 1 + np . ceil ( np . log2 ( arg_8 ) ) ) ) : arg_12 = int ( 2.0 ** ( 1 + np . ceil ( np . log2 ( arg_8 ) ) ) ) arg_10 *= arg_11 [ : , np . newaxis ] / float ( arg_12 ) arg_13 = get_fftlib ( ) arg_14 = arg_13 . fft ( arg_10 , n = arg_12 , axis = 1 ) [ : , : ( arg_12 // 2 ) + 1 ] arg_14 = util . sparsify_rows ( arg_14 , quantile = arg_7 ) return arg_14 , arg_12 , arg_11

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                     arg_5, arg_6, arg_7, arg_8=None,
                     arg_9='hann'):
    '''Generate the frequency domain constant-Q filter basis.'''

    arg_10, arg_11 = filters.constant_q(arg_0,
                                        arg_1=arg_1,
                                        arg_2=arg_2,
                                        arg_3=arg_3,
                                        arg_4=arg_4,
                                        arg_5=arg_5,
                                        arg_6=arg_6,
                                        pad_fft=True,
                                        arg_9=arg_9)

    # Filters are padded up to the nearest integral power of 2
    arg_12 = arg_10.shape[1]

    if (arg_8 is not None and
            arg_12 < 2.0**(1 + np.ceil(np.log2(arg_8)))):

        arg_12 = int(2.0 ** (1 + np.ceil(np.log2(arg_8))))

    # re-normalize bases with respect to the FFT window length
    arg_10 *= arg_11[:, np.newaxis] / float(arg_12)

    # FFT and retain only the non-negative frequencies
    arg_13 = get_fftlib()
    arg_14 = arg_13.fft(arg_10, n=arg_12, axis=1)[:, :(arg_12 // 2)+1]

    # sparsify the basis
    arg_14 = util.sparsify_rows(arg_14, quantile=arg_7)

    return arg_14, arg_12, arg_11

Generate the frequency domain constant - Q filter basis .


return RootTupleInfo(stream_id=stream_id, tuple_id=tuple_id,
                         insertion_time=time.time(), key=key)

def Func ( arg_0 , arg_1 ) : arg_2 = random . getrandbits ( TupleHelper . MAX_SFIXED64_RAND_BITS ) return RootTupleInfo ( arg_0 = arg_0 , arg_1 = arg_1 , insertion_time = time . time ( ) , arg_2 = arg_2 )

def Func(arg_0, arg_1):
    """Creates a RootTupleInfo"""
    arg_2 = random.getrandbits(TupleHelper.MAX_SFIXED64_RAND_BITS)
    return RootTupleInfo(arg_0=arg_0, arg_1=arg_1,
                         insertion_time=time.time(), arg_2=arg_2)


def Func(arg_0, arg_1=4):
        """Get all arguments of current layer for saving the graph."""
        arg_2 = inspect.stack()

        if len(arg_2) < arg_1 + 1:
            raise ValueError("The length of the inspection stack is shorter than the requested start position.")

        arg_3, arg_4, arg_4, arg_5 = inspect.getargvalues(arg_2[arg_1][0])

        arg_6 = {}

        for arg_7 in arg_3:

            # some args dont need to be saved into the graph. e.g. the input placeholder
            if arg_5[arg_7] is not None and arg_7 not in ['self', 'prev_layer', 'inputs']:

                arg_8 = arg_5[arg_7]

                # change function (e.g. act) into dictionary of module path and function name
                if inspect.isfunction(arg_8):
                    arg_6[arg_7] = {"module_path": arg_8.__module__, "func_name": arg_8.__name__}
                # ignore more args e.g. TF class
                elif arg_7.endswith('init'):
                    continue
                # for other data type, save them directly
                else:
                    arg_6[arg_7] = arg_8

        return arg_6

Get all arguments of current layer for saving the graph .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : Func = arg_0 . tile_pyramid . tile ( arg_1 , arg_2 , arg_3 ) return BufferedTile ( Func , pixelbuffer = arg_0 . pixelbuffer )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Return ``BufferedTile`` object of this ``BufferedTilePyramid``.

        Parameters
        ----------
        zoom : integer
            zoom level
        row : integer
            tile matrix row
        col : integer
            tile matrix column

        Returns
        -------
        buffered tile : ``BufferedTile``
        """
        Func = arg_0.tile_pyramid.tile(arg_1, arg_2, arg_3)
        return BufferedTile(Func, pixelbuffer=arg_0.pixelbuffer)

Return BufferedTile object of this BufferedTilePyramid .


def
Func
(
arg_0
)
:
if
arg_0
.
validate
:
arg_0
.
default_config
=
ConfigObj
(
configspec
=
arg_0
.
default_file
,
list_values
=
False
,
_inspec
=
True
,
encoding
=
'utf8'
)
arg_2
=
arg_0
.
default_config
.
validate
(
Validator
(
)
,
copy
=
True
,
preserve_errors
=
True
)
if
arg_2
is
not
True
:
for
arg_3
,
arg_4
in
arg_2
.
items
(
)
:
if
arg_4
is
True
:
continue
for
arg_5
,
arg_6
in
arg_4
.
items
(
)
:
if
isinstance
(
arg_6
,
ValidateError
)
:
raise
DefaultConfigValidationError
(
'section [{}], key "{}": {}'
.
format
(
arg_3
,
arg_5
,
arg_6
)
)
elif
arg_0
.
default_file
:
arg_0
.
default_config
,
arg_7
=
arg_0
.
read_config_file
(
arg_0
.
default_file
)
arg_0
.
update
(
arg_0
.
default_config
)

def Func(arg_0):
        """Read the default config file.

        :raises DefaultConfigValidationError: There was a validation error with
                                              the *default* file.
        """
        if arg_0.validate:
            arg_0.default_config = ConfigObj(configspec=arg_0.default_file,
                                            list_values=False, _inspec=True,
                                            encoding='utf8')
            arg_2 = arg_0.default_config.validate(Validator(), copy=True,
                                                 preserve_errors=True)
            if arg_2 is not True:
                for arg_3, arg_4 in arg_2.items():
                    if arg_4 is True:
                        continue
                    for arg_5, arg_6 in arg_4.items():
                        if isinstance(arg_6, ValidateError):
                            raise DefaultConfigValidationError(
                                'section [{}], key "{}": {}'.format(
                                    arg_3, arg_5, arg_6))
        elif arg_0.default_file:
            arg_0.default_config, arg_7 = arg_0.read_config_file(arg_0.default_file)

        arg_0.update(arg_0.default_config)


def Func(arg_0, arg_1, arg_2=None):
        """Create and load the OMIM-AUTO panel"""
        arg_3 = arg_0.gene_panel(panel_id='OMIM-AUTO')
        if not arg_3:
            LOG.warning("OMIM-AUTO does not exists in database")
            LOG.info('Creating a first version')
            arg_4 = 1.0

        if arg_3:
            arg_4 = float(math.floor(arg_3['version']) + 1)

        LOG.info("Setting version to %s", arg_4)

        try:
            arg_5 = fetch_mim_files(arg_1=arg_1, genemap2=True, mim2genes=True)
        except Exception as err:
            raise err

        arg_6 = None
        # Get the correct date when omim files where released
        for arg_7 in arg_5['genemap2']:
            if 'Generated' in arg_7:
                arg_6 = arg_7.split(':')[-1].lstrip().rstrip()
        arg_8 = get_date(arg_6)

        if arg_3:
            if arg_3['date'] == arg_8:
                LOG.warning("There is no new version of OMIM")
                return

        arg_9 = {}
        arg_9['path'] = None
        arg_9['type'] = 'clinical'
        arg_9['date'] = arg_8
        arg_9['panel_id'] = 'OMIM-AUTO'
        arg_9['institute'] = arg_2 or 'cust002'
        arg_9['version'] = arg_4
        arg_9['display_name'] = 'OMIM-AUTO'
        arg_9['genes'] = []

        arg_10 = arg_0.genes_by_alias()

        arg_11 = get_omim_panel_genes(
            genemap2_lines = arg_5['genemap2'],
            mim2gene_lines = arg_5['mim2genes'],
            arg_10 = arg_10,
        )

        for arg_12 in arg_11:
            arg_9['genes'].append(arg_12)

        arg_13 = build_panel(arg_9, arg_0)

        if arg_3:

            arg_14 = arg_0.compare_mim_panels(arg_3, arg_13)
            if arg_14:
                arg_0.update_mim_version(arg_14, arg_13, old_version=arg_3['version'])
            else:
                LOG.info("The new version of omim does not differ from the old one")
                LOG.info("No update is added")
                return

        arg_0.add_gene_panel(arg_13)


def Func ( arg_0 , arg_1 = None ) : def do_Func ( arg_2 ) : if hasattr ( arg_2 , '__Funcments__' ) : arg_2 . __Funcments__ . append ( ( arg_0 , arg_1 ) ) else : arg_2 . __Funcments__ = [ ( arg_0 , arg_1 ) ] return arg_2 return do_Func

def Func(arg_0, arg_1 = None):
    """Funces a file to the payload to be uploaded.

If contents is omitted the file is read from disk.
If name is a tuple it specifies the on-disk filename and the destination filename.
"""
    def do_Func(arg_2):
        if hasattr(arg_2, '__Funcments__'):
            arg_2.__Funcments__.append((arg_0, arg_1))
        else:
            arg_2.__Funcments__ = [(arg_0, arg_1)]
        return arg_2
    return do_Func

attaches a file to the payload to be uploaded.

If contents is omitted the file is read from disk.
If name is a tuple it specifies the on-disk filename and the destination filename.

attaches a file to the payload to be uploaded .


return [
            Parameter(_lststr, _type_to_spans, span, 'Parameter')
            for span in self._subspans('Parameter')]

def Func ( arg_0 ) -> List [ 'Parameter' ] : arg_1 = arg_0 . _lststr arg_2 = arg_0 . _type_to_spans return [ Parameter ( arg_1 , arg_2 , arg_3 , 'Parameter' ) for arg_3 in arg_0 . _subspans ( 'Parameter' ) ]

def Func(arg_0) -> List['Parameter']:
        """Return a list of parameter objects."""
        arg_1 = arg_0._lststr
        arg_2 = arg_0._type_to_spans
        return [
            Parameter(arg_1, arg_2, arg_3, 'Parameter')
            for arg_3 in arg_0._subspans('Parameter')]


def Func ( arg_0 , arg_1 ) : import os arg_2 = [ ] try : arg_3 = arg_6 [ arg_1 ] except KeyError : arg_4 = translate ( arg_1 ) if len ( arg_6 ) >= _MAXCACHE : arg_5 ( ) [ '_cache' ] = { } arg_6 [ arg_1 ] = arg_3 = re . compile ( arg_4 ) arg_7 = arg_3 . match if 1 : for arg_8 in arg_0 : if arg_7 ( arg_8 ) : arg_2 . append ( arg_8 ) else : for arg_8 in arg_0 : if arg_7 ( os . path . normcase ( arg_8 ) ) : arg_2 . append ( arg_8 ) return arg_2

def Func(arg_0, arg_1):
    """Return the subset of the list NAMES that match PAT"""
    import os
    # import posixpath
    arg_2=[]
    # pat=os.path.normcase(pat)
    try:
        arg_3 = arg_6[arg_1]
    except KeyError:
        arg_4 = translate(arg_1)
        if len(arg_6) >= _MAXCACHE:
            # _cache.clear()
            arg_5()['_cache'] = {}
        arg_6[arg_1] = arg_3 = re.compile(arg_4)
    arg_7 = arg_3.match
    # if os.path is posixpath:
    if 1:
        # normcase on posix is NOP. Optimize it away from the loop.
        for arg_8 in arg_0:
            if arg_7(arg_8):
                arg_2.append(arg_8)
    else:
        for arg_8 in arg_0:
            if arg_7(os.path.normcase(arg_8)):
                arg_2.append(arg_8)
    return arg_2


def Func(arg_0):
        """
        Input items used for process stored in a dictionary.

        Keys are the hashes of the Func parameters, values the respective
        InputData classes.
        """
        # the delimiters are used by some Func drivers
        arg_1 = dict(
            zoom=arg_0.init_zoom_levels,
            bounds=arg_0.init_bounds,
            process_bounds=arg_0.bounds,
            effective_bounds=arg_0.effective_bounds
        )

        # get Func items only of initialized zoom levels
        arg_2 = {
            # convert Func definition to hash
            get_hash(arg_5): arg_5
            for zoom in arg_0.init_zoom_levels
            if "Func" in arg_0._params_at_zoom[zoom]
            # to preserve file groups, "flatten" the Func tree and use
            # the tree paths as keys
            for key, arg_5 in _flatten_tree(arg_0._params_at_zoom[zoom]["Func"])
            if arg_5 is not None
        }

        arg_3 = {}
        for arg_4, arg_5 in arg_2.items():

            # for files and tile directories
            if isinstance(arg_5, str):
                logger.debug("load Func reader for simple Func %s",  arg_5)
                try:
                    arg_6 = load_Func_reader(
                        dict(
                            path=absolute_path(path=arg_5, base_dir=arg_0.config_dir),
                            pyramid=arg_0.process_pyramid,
                            pixelbuffer=arg_0.process_pyramid.pixelbuffer,
                            arg_1=arg_1
                        ),
                        readonly=arg_0.mode == "readonly")
                except Exception as e:
                    logger.exception(e)
                    raise MapcheteDriverError("error when loading Func %s: %s" % (arg_5, e))
                logger.debug("Func reader for simple Func %s is %s", arg_5, arg_6)

            # for abstract Funcs
            elif isinstance(arg_5, dict):
                logger.debug("load Func reader for abstract Func %s", arg_5)
                try:
                    arg_6 = load_Func_reader(
                        dict(
                            abstract=deepcopy(arg_5),
                            pyramid=arg_0.process_pyramid,
                            pixelbuffer=arg_0.process_pyramid.pixelbuffer,
                            arg_1=arg_1,
                            conf_dir=arg_0.config_dir
                        ),
                        readonly=arg_0.mode == "readonly")
                except Exception as e:
                    logger.exception(e)
                    raise MapcheteDriverError("error when loading Func %s: %s" % (arg_5, e))
                logger.debug("Func reader for abstract Func %s is %s", arg_5, arg_6)
            else:
                raise MapcheteConfigError("invalid Func type %s", type(arg_5))
            # trigger bbox creation
            arg_6.bbox(out_crs=arg_0.process_pyramid.crs)
            arg_3[arg_4] = arg_6

        return arg_3

Input items used for process stored in a dictionary.

        Keys are the hashes of the input parameters, values the respective
        InputData classes.

Input items used for process stored in a dictionary .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = None arg_4 = None if arg_0 . matchstrategy in ( "firstmatch" , "verbmatch" ) : for arg_5 in arg_0 . activepolicies : arg_6 = arg_0 . policies [ arg_5 ] arg_3 = None arg_4 = arg_6 . name if arg_4 == "deny" : break if arg_0 . matchstrategy == "verbmatch" : if arg_6 . methods != "*" and not CORS . matchlist ( arg_2 , arg_6 . methods , case_sensitive = True ) : continue if arg_1 and arg_6 . match : if CORS . matchlist ( arg_1 , arg_6 . match ) : arg_3 = arg_1 elif arg_6 . origin == "copy" : arg_3 = arg_1 elif arg_6 . origin : arg_3 = arg_6 . origin if arg_3 : break return arg_4 , arg_3

def Func(arg_0, arg_1, arg_2=None):
        "Based on the matching strategy and the origin and optionally the requested method a tuple of policyname and origin to pass back is returned."
        arg_3 = None
        arg_4 = None
        if arg_0.matchstrategy in ("firstmatch", "verbmatch"):
            for arg_5 in arg_0.activepolicies:
                arg_6=arg_0.policies[arg_5]
                arg_3 = None
                arg_4 = arg_6.name
                if arg_4 == "deny":
                    break
                if arg_0.matchstrategy == "verbmatch":
                    if arg_6.methods != "*" and not CORS.matchlist(arg_2, arg_6.methods, case_sensitive=True):
                        continue
                if arg_1 and arg_6.match:
                    if CORS.matchlist(arg_1, arg_6.match):
                        arg_3 = arg_1
                elif arg_6.origin == "copy":
                    arg_3 = arg_1
                elif arg_6.origin:
                    arg_3 = arg_6.origin
                if arg_3:
                    break
        return arg_4, arg_3

Based on the matching strategy and the origin and optionally the requested method a tuple of policyname and origin to pass back is returned .


def Func ( arg_0 , arg_1 ) : arg_2 = np . argmax ( arg_0 , axis = 1 ) arg_3 = np . arange ( arg_0 . shape [ 0 ] ) arg_3 = ( arg_3 , arg_2 . flatten ( ) ) arg_0 [ : , : ] = 0 arg_0 [ arg_3 ] = arg_2 + 1 arg_0 = np . sum ( arg_0 , axis = 1 ) arg_0 = median_filter ( arg_0 [ : , np . newaxis ] , arg_1 ) return arg_0 . flatten ( )

def Func(arg_0, arg_1):
    """Filters the activation matrix G, and returns a flattened copy."""

    #import pylab as plt
    #plt.imshow(G, interpolation="nearest", aspect="auto")
    #plt.show()

    arg_2 = np.argmax(arg_0, axis=1)
    arg_3 = np.arange(arg_0.shape[0])
    arg_3 = (arg_3, arg_2.flatten())
    arg_0[:, :] = 0
    arg_0[arg_3] = arg_2 + 1

    # TODO: Order matters?
    arg_0 = np.sum(arg_0, axis=1)
    arg_0 = median_filter(arg_0[:, np.newaxis], arg_1)

    return arg_0.flatten()

Filters the activation matrix G and returns a flattened copy .


def Func(arg_0):
        """Get Func information in XML format."""

        arg_1 = {
            arg_0.PCTYPE: arg_0.CTYPE_XML
        }

        arg_2 = arg_0.call(arg_0.CGI_BUG, arg_1)

        return arg_2

Get metadata information in XML format .


def
Func
(
arg_0
)
:
with
open
(
arg_0
,
"rt"
,
encoding
=
"utf-8"
)
as
f
:
for
arg_1
in
f
:
if
arg_1
.
startswith
(
"#"
)
:
arg_2
=
arg_1
[
1
:
]
.
strip
(
)
if
arg_2
.
startswith
(
"~~~~* "
)
or
arg_2
.
startswith
(
"----* "
)
or
arg_2
.
startswith
(
"====* "
)
:
arg_3
=
arg_2
[
5
:
]
.
strip
(
)
return
tuple
(
arg_3
.
split
(
)
)
else
:
break
return

def Func(arg_0):
    """
    Search the file for any magic incantations.

    :param filename: file to search
    :returns: a tuple containing the spell and then maybe some extra words (or None if no magic present)
    """
    with open(arg_0, "rt", encoding="utf-8") as f:
        for arg_1 in f:
            if arg_1.startswith("#"):
                arg_2 = arg_1[1:].strip()
                if arg_2.startswith("~~~~* ") or arg_2.startswith("----* ") or arg_2.startswith("====* "):
                    arg_3 = arg_2[5:].strip()
                    return tuple(arg_3.split())
            else:
                break
    return None

Search the file for any magic incantations .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Creates a link and checks if names are appropriate
        """

        arg_1._links[arg_2] = arg_3
        arg_1._children[arg_2] = arg_3

        arg_6 = arg_3.v_full_name
        if arg_6 not in arg_0._root_instance._linked_by:
            arg_0._root_instance._linked_by[arg_6] = {}
        arg_9 = arg_0._root_instance._linked_by[arg_6]
        if arg_1.v_full_name not in arg_9:
            arg_9[arg_1.v_full_name] = (arg_1, set())
        arg_9[arg_1.v_full_name][1].add(arg_2)

        if arg_2 not in arg_0._links_count:
            arg_0._links_count[arg_2] = 0
        arg_0._links_count[arg_2] = arg_0._links_count[arg_2] + 1

        arg_0._logger.debug('Added link `%s` under `%s` pointing '
                           'to `%s`.' % (arg_2, arg_1.v_full_name,
                                         arg_3.v_full_name))
        return arg_3


def Func ( arg_0 ) : arg_1 = not arg_0 . _in_buffer ( ) if arg_1 : arg_2 = arg_0 . _control . textCursor ( ) arg_2 . movePosition ( QtGui . QTextCursor . End ) arg_0 . _control . setTextCursor ( arg_2 ) return arg_1

def Func(arg_0):
        """ Ensures that the cursor is inside the editing region. Returns
            whether the cursor was moved.
        """
        arg_1 = not arg_0._in_buffer()
        if arg_1:
            arg_2 = arg_0._control.textCursor()
            arg_2.movePosition(QtGui.QTextCursor.End)
            arg_0._control.setTextCursor(arg_2)
        return arg_1

Ensures that the cursor is inside the editing region . Returns whether the cursor was moved .


def
Func
(
arg_0
)
:
with
arg_0
.
lock
:
if
arg_0
.
_state
==
'connecting'
and
arg_0
.
_dst_addrs
:
arg_0
.
_hup
=
False
arg_0
.
_set_state
(
"connect"
)
return
arg_0
.
_socket
.
close
(
)
arg_0
.
_socket
=
arg_0
.
_set_state
(
"aborted"
)
arg_0
.
_write_queue
.
clear
(
)
arg_0
.
_write_queue_cond
.
notify
(
)
raise
PyXMPPIOError
(
"Unhandled error on socket"
)

def Func(arg_0):
        """
        Handle an error reported.
        """
        with arg_0.lock:
            if arg_0._state == 'connecting' and arg_0._dst_addrs:
                arg_0._hup = False
                arg_0._set_state("connect")
                return
            arg_0._socket.close()
            arg_0._socket = None
            arg_0._set_state("aborted")
            arg_0._write_queue.clear()
            arg_0._write_queue_cond.notify()
        raise PyXMPPIOError("Unhandled error on socket")


def Func(arg_0, arg_1, arg_2):
        """return the absolute position of x,y in user space w.r.t. default user space"""
        (arg_3, arg_4, arg_5, arg_6, arg_7, arg_8) = arg_0._currentMatrix
        arg_9 = arg_3 * arg_1 + arg_5 * arg_2 + arg_7
        arg_10 = arg_4 * arg_1 + arg_6 * arg_2 + arg_8
        return arg_9, arg_10

return the absolute position of x y in user space w . r . t . default user space


def Func(arg_0, arg_1):
        """Remove all of the non-ancestors operation nodes of node."""
        if isinstance(arg_1, int):
            warnings.warn('Calling Func() with a node id is deprecated,'
                          ' use a DAGNode instead',
                          DeprecationWarning, 2)
            arg_1 = arg_0._id_to_node[arg_1]

        arg_2 = nx.ancestors(arg_0._multi_graph, arg_1)
        arg_3 = list(set(arg_0._multi_graph.nodes()) - set(arg_2))
        for arg_4 in arg_3:
            if arg_4.type == "op":
                arg_0.remove_op_node(arg_4)

Remove all of the non - ancestors operation nodes of node .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = [ ] for arg_3 in arg_0 : if arg_3 [ 'type' ] == 'directory' : arg_1 . append ( arg_3 [ 'path' ] ) else : arg_2 . append ( arg_3 [ 'path' ] ) return arg_1 , arg_2

def Func(arg_0):
    """
    Split an iterable of models into a list of file paths and a list of
    directory paths.
    """
    arg_1 = []
    arg_2 = []
    for arg_3 in arg_0:
        if arg_3['type'] == 'directory':
            arg_1.append(arg_3['path'])
        else:
            arg_2.append(arg_3['path'])
    return arg_1, arg_2

Split an iterable of models into a list of file paths and a list of directory paths .


return self.polyglot_attacks[random.choice(self.config.techniques)] % obj

def Func ( arg_0 , arg_1 ) : return arg_0 . polyglot_attacks [ random . choice ( arg_0 . config . techniques ) ] % arg_1

def Func(arg_0, arg_1):
        """
        Return a polyglot attack containing the original object
        """
        return arg_0.polyglot_attacks[random.choice(arg_0.config.techniques)] % arg_1


def
Func
(
arg_0
)
:
arg_0
.
ui
.
error_label
.
setScaledContents
(
True
)
arg_0
.
ui
.
error_text_label
.
show
(
)
arg_0
.
ui
.
error_text_label
.
setStyleSheet
(
'color: red'
)

def Func(arg_0):
        """
        This function displays an error message when a wrong value is typed.
        """
        arg_0.ui.error_label.setScaledContents(True)  # Warning image shown.
        arg_0.ui.error_text_label.show()  # Warning message shown.
        arg_0.ui.error_text_label.setStyleSheet('color: red')

This function displays an error message when a wrong value is typed .


Calls LMParticles.do_internal_run for each group of particles.

def Func(arg_0):
        """Calls LMParticles.Func for each group of particles."""
        if not arg_0.save_J:
            raise RuntimeError('self.save_J=True required for Func()')
        if not np.all(arg_0._has_saved_J):
            raise RuntimeError('J, JTJ have not been pre-computed. Call do_run_1 or do_run_2')
        arg_0._do_run(mode='internal')

Calls LMParticles . do_internal_run for each group of particles .


def Func(arg_0, arg_1=None, arg_2=None):
    """Print up to 'limit' stack trace entries from the traceback 'tb'.

    If 'limit' is omitted or None, all entries are printed.  If 'file'
    is omitted or None, the output goes to sys.stderr; otherwise
    'file' should be an open file or file-like object with a write()
    method.
    """
    if arg_2 is None:
        arg_2 = sys.stderr
    if arg_1 is None:
        if hasattr(sys, 'tracebacklimit'):
            arg_1 = sys.tracebacklimit
    arg_3 = 0
    while arg_0 is not None and (arg_1 is None or arg_3 < arg_1):
        arg_4 = arg_0.tb_frame
        arg_5 = arg_0.tb_lineno
        arg_6 = arg_4.f_code
        arg_7 = arg_6.co_filename
        arg_8 = arg_6.co_name
        _print(arg_2,
               '  File "%s", line %d, in %s' % (arg_7, arg_5, arg_8))
        linecache.checkcache(arg_7)
        arg_9 = linecache.getline(arg_7, arg_5, arg_4.f_globals)
        if arg_9: _print(arg_2, '    ' + arg_9.strip())
        arg_0 = arg_0.tb_next
        arg_3 = arg_3+1

Print up to limit stack trace entries from the traceback tb .


def Func(arg_0, *arg_1, **arg_2):
        """
        Entry point for managment command execution.
        """
        LOGGER.info('Starting assigning enterprise roles to users!')

        arg_3 = arg_2['role']
        if arg_3 == ENTERPRISE_ADMIN_ROLE:
            # Assign admin role to non-staff users with enterprise data api access.
            arg_0._assign_enterprise_role_to_users(arg_0._get_enterprise_admin_users_batch, arg_2)
        elif arg_3 == ENTERPRISE_OPERATOR_ROLE:
            # Assign operator role to staff users with enterprise data api access.
            arg_0._assign_enterprise_role_to_users(arg_0._get_enterprise_operator_users_batch, arg_2)
        elif arg_3 == ENTERPRISE_LEARNER_ROLE:
            # Assign enterprise learner role to enterprise customer users.
            arg_0._assign_enterprise_role_to_users(arg_0._get_enterprise_customer_users_batch, arg_2)
        elif arg_3 == ENTERPRISE_ENROLLMENT_API_ADMIN_ROLE:
            # Assign enterprise enrollment api admin to non-staff users with enterprise data api access.
            arg_0._assign_enterprise_role_to_users(arg_0._get_enterprise_enrollment_api_admin_users_batch, arg_2, True)
        elif arg_3 == ENTERPRISE_CATALOG_ADMIN_ROLE:
            # Assign enterprise catalog admin role to users with having credentials in catalog.
            arg_0._assign_enterprise_role_to_users(arg_0._get_enterprise_catalog_admin_users_batch, arg_2, True)
        else:
            raise CommandError('Please provide a valid role name. Supported roles are {admin} and {learner}'.format(
                admin=ENTERPRISE_ADMIN_ROLE,
                learner=ENTERPRISE_LEARNER_ROLE
            ))

        LOGGER.info('Successfully finished assigning enterprise roles to users!')

Entry point for managment command execution .


def Func ( arg_0 , arg_1 ) : arg_2 = { 'per_page' : PER_PAGE , 'direction' : 'asc' , 'sort' : 'updated' } arg_3 = urijoin ( "issues" , str ( arg_1 ) , "reactions" ) return arg_0 . fetch_items ( arg_3 , arg_2 )

def Func(arg_0, arg_1):
        """Get reactions of an issue"""

        arg_2 = {
            'per_page': PER_PAGE,
            'direction': 'asc',
            'sort': 'updated'
        }

        arg_3 = urijoin("issues", str(arg_1), "reactions")
        return arg_0.fetch_items(arg_3, arg_2)


def
Func
(
arg_0
)
:
try
:
arg_1
=
check_img
(
arg_0
)
except
Exception
as
exc
:
raise
Exception
(
'Error reading file {0}.'
.
format
(
repr_imgs
(
arg_0
)
)
)
from
exc
else
:
return
arg_1
.
get_header
(
)
,
arg_1
.
get_affine
(
)

def Func(arg_0):
    """Return the header and affine matrix from a Nifti file.

    Parameters
    ----------
    image: img-like object or str
        Can either be:
        - a file path to a Nifti image
        - any object with get_data() and get_affine() methods, e.g., nibabel.Nifti1Image.
        If niimg is a string, consider it as a path to Nifti image and
        call nibabel.load on it. If it is an object, check if get_data()
        and get_affine() methods are present, raise TypeError otherwise.

    Returns
    -------
    hdr, aff
    """
    try:
        arg_1 = check_img(arg_0)
    except Exception as exc:
        raise Exception('Error reading file {0}.'.format(repr_imgs(arg_0))) from exc
    else:
        return arg_1.get_header(), arg_1.get_affine()

Return the header and affine matrix from a Nifti file .


Converts analytes in format 'Al27' to '27Al'.

    Parameters
    ----------
    s : str
        of format [0-9]{1,3}[A-z]{1,3}

    Returns
    -------
    str
        Name in format [A-z]{1,3}[0-9]{1,3}

Converts analytes in format Al27 to 27Al .


return Operators.ITEBV(256, size <= 31, result, value)

def Func(arg_0, arg_1, arg_2):
        """Extend length of two's complement signed integer"""
        # FIXME maybe use Operators.SEXTEND
        arg_3 = Operators.ITEBV(256, arg_1 <= 31, arg_1 * 8 + 7, 257)
        arg_4 = (arg_2 | (TT256 - (1 << arg_3)))
        arg_5 = (arg_2 & ((1 << arg_3) - 1))
        arg_6 = Operators.ITEBV(256, (arg_2 & (1 << arg_3)) != 0, arg_4, arg_5)
        return Operators.ITEBV(256, arg_1 <= 31, arg_6, arg_2)

Extend length of two s complement signed integer


def Func ( arg_0 ) : if arg_0 . placeholder_image_name : return arg_1 = None arg_2 = arg_0 . placeholder_image if arg_2 : if isinstance ( arg_2 , OnStoragePlaceholderImage ) : arg_3 = arg_2 . path else : arg_3 = arg_2 . image_data . name arg_1 = os . path . join ( VERSATILEIMAGEFIELD_PLACEHOLDER_DIRNAME , arg_3 ) if not arg_0 . storage . exists ( arg_1 ) : arg_0 . storage . save ( arg_1 , arg_2 . image_data ) arg_0 . placeholder_image_name = arg_1

def Func(arg_0):
        """
        Process the field's placeholder image.

        Ensures the placeholder image has been saved to the same storage class
        as the field in a top level folder with a name specified by
        settings.VERSATILEIMAGEFIELD_SETTINGS['placeholder_directory_name']

        This should be called by the VersatileImageFileDescriptor __get__.
        If self.placeholder_image_name is already set it just returns right away.
        """
        if arg_0.placeholder_image_name:
            return

        arg_1 = None
        arg_2 = arg_0.placeholder_image
        if arg_2:
            if isinstance(arg_2, OnStoragePlaceholderImage):
                arg_3 = arg_2.path
            else:
                arg_3 = arg_2.image_data.name
            arg_1 = os.path.join(
                VERSATILEIMAGEFIELD_PLACEHOLDER_DIRNAME, arg_3
            )
            if not arg_0.storage.exists(arg_1):
                arg_0.storage.save(
                    arg_1,
                    arg_2.image_data
                )
        arg_0.placeholder_image_name = arg_1


def Func(arg_0, arg_1=False):
    """Transfer mesh colors to face colors

    Args:
        script: the FilterScript object or script filename to write
            the filter to.
        all_visible_layers (bool): If true the color mapping is applied to all the meshes
    """
    arg_2 = ''.join([
        '  <filter name="Transfer Color: Mesh to Face">\n',
        '    <Param name="allVisibleMesh" ',
        'value="%s" ' % str(arg_1).lower(),
        'description="Apply to all Meshes" ',
        'type="RichBool" ',
        '/>\n',
        '  </filter>\n'])
    util.write_filter(arg_0, arg_2)
    return None


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

def Func(arg_0, arg_1=None):
        """ Lists all the allocations.

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


def Func(arg_0, arg_1: arg_2, arg_3: arg_2):
        """ Stores custom user data. """
        arg_0._user_data.update({arg_1: arg_3})


def Func(arg_0, arg_1=False):
    """
    Return input class of driver.

    Returns
    -------
    input_params : ``InputData``
        input parameters
    """
    logger.debug("find input reader with params %s", arg_0)
    if not isinstance(arg_0, dict):
        raise TypeError("input_params must be a dictionary")
    if "abstract" in arg_0:
        arg_2 = arg_0["abstract"]["format"]
    elif "path" in arg_0:
        if os.path.splitext(arg_0["path"])[1]:
            arg_3 = arg_0["path"]
            arg_2 = driver_from_file(arg_3)
        else:
            logger.debug("%s is a directory", arg_0["path"])
            arg_2 = "TileDirectory"
    else:
        raise MapcheteDriverError("invalid input parameters %s" % arg_0)
    for arg_4 in pkg_resources.iter_entry_points(DRIVERS_ENTRY_POINT):
        arg_5 = arg_4.load()
        if hasattr(arg_5, "METADATA") and (
            arg_5.METADATA["driver_name"] == arg_2
        ):
            return arg_4.load().InputData(arg_0, arg_1=arg_1)
    raise MapcheteDriverError("no loader for driver '%s' could be found." % arg_2)


def Func ( arg_0 , arg_1 : arg_2 ) -> bool : arg_3 = arg_0 . get_record ( arg_1 ) if isinstance ( arg_3 , NistBeaconValue ) is False : return False arg_4 = arg_0 . get_previous ( arg_3 . timestamp ) arg_5 = arg_0 . get_next ( arg_3 . timestamp ) if arg_4 is None and arg_5 is None : return False if ( isinstance ( arg_4 , NistBeaconValue ) and isinstance ( arg_5 , NistBeaconValue ) ) : return ( arg_3 . valid_signature and arg_4 . valid_signature and arg_5 . valid_signature and arg_3 . previous_output_value == arg_4 . output_value and arg_5 . previous_output_value == arg_3 . output_value ) if ( arg_4 is None and isinstance ( arg_5 , NistBeaconValue ) ) : return ( arg_3 . valid_signature and arg_5 . valid_signature and arg_0 . _INIT_RECORD == arg_3 and arg_5 . previous_output_value == arg_3 . output_value ) if ( isinstance ( arg_4 , NistBeaconValue ) and arg_5 is None ) : return ( arg_3 . valid_signature and arg_4 . valid_signature and arg_3 . previous_output_value == arg_4 . output_value )

def Func(arg_0, arg_1: arg_2) -> bool:
        """
        Given a record timestamp, verify the chain integrity.

        :param timestamp: UNIX time / POSIX time / Epoch time
        :return: 'True' if the timestamp fits the chain. 'False' otherwise.
        """

        # Creation is messy.
        # You want genius, you get madness; two sides of the same coin.
        # ... I'm sure this can be cleaned up. However, let's test it first.

        arg_3 = arg_0.get_record(arg_1)

        if isinstance(arg_3, NistBeaconValue) is False:
            # Don't you dare try to play me
            return False

        arg_4 = arg_0.get_previous(arg_3.timestamp)
        arg_5 = arg_0.get_next(arg_3.timestamp)

        if arg_4 is None and arg_5 is None:
            # Uh, how did you manage to do this?
            # I'm not even mad, that's amazing.
            return False

        if (
                isinstance(arg_4, NistBeaconValue) and
                isinstance(arg_5, NistBeaconValue)
        ):
            # Majority case, somewhere in the middle of the chain
            # True if:
            #   - All three records have proper signatures
            #   - The requested record's previous output equals previous
            #   - The next possible record's previous output equals the record
            return (
                arg_3.valid_signature and
                arg_4.valid_signature and
                arg_5.valid_signature and
                arg_3.previous_output_value == arg_4.output_value and
                arg_5.previous_output_value == arg_3.output_value
            )

        if (
                arg_4 is None and
                isinstance(arg_5, NistBeaconValue)
        ):
            # Edge case, this was potentially the first record of all time
            return (
                arg_3.valid_signature and
                arg_5.valid_signature and
                arg_0._INIT_RECORD == arg_3 and
                arg_5.previous_output_value == arg_3.output_value
            )

        if (
                isinstance(arg_4, NistBeaconValue) and
                arg_5 is None
        ):
            # Edge case, this was potentially the latest and greatest
            return (
                arg_3.valid_signature and
                arg_4.valid_signature and
                arg_3.previous_output_value == arg_4.output_value
            )

Given a record timestamp verify the chain integrity .


def Func(arg_0, arg_1, arg_2):
        """
        Update some or all of the settings for a specific campaign.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "settings": object*
            {
                "subject_line": string*,
                "from_name": string*,
                "reply_to": string*
            },
        }
        """
        arg_0.campaign_id = arg_1
        if 'settings' not in arg_2:
            raise KeyError('The campaign must have settings')
        if 'subject_line' not in arg_2['settings']:
            raise KeyError('The campaign settings must have a subject_line')
        if 'from_name' not in arg_2['settings']:
            raise KeyError('The campaign settings must have a from_name')
        if 'reply_to' not in arg_2['settings']:
            raise KeyError('The campaign settings must have a reply_to')
        check_email(arg_2['settings']['reply_to'])
        return arg_0._mc_client._patch(url=arg_0._build_path(arg_1), arg_2=arg_2)

Update some or all of the settings for a specific campaign .