(
    ctx: GeneratorContext, node: VarRef, is_assigning: bool = False
)

return __var_find_to_py_ast(var_name, ns_name, py_var_ctx)

def Func(
    arg_0: arg_1, arg_2: arg_3, arg_4: arg_5 = False
) -> GeneratedPyAST:
    """Generate a Python AST node for accessing a Var.

    If the Var is marked as :dynamic or :redef or the compiler option
    USE_VAR_INDIRECTION is active, do not compile to a direct access.
    If the corresponding function name is not defined in a Python module,
    no direct variable access is possible and Var.find indirection must be
    used."""
    assert arg_2.op == NodeOp.VAR

    arg_6 = arg_2.var
    arg_7 = arg_6.ns
    arg_8 = arg_7.name
    arg_9 = arg_7.module
    arg_10 = munge(arg_8)
    arg_11 = arg_6.name.name
    arg_12 = ast.Store() if arg_4 else ast.Load()

    # Return the actual var, rather than its value if requested
    if arg_2.return_var:
        return GeneratedPyAST(
            arg_2=ast.Call(
                func=_FIND_VAR_FN_NAME,
                args=[
                    ast.Call(
                        func=_NEW_SYM_FN_NAME,
                        args=[ast.Str(arg_11)],
                        keywords=[ast.keyword(arg="ns", value=ast.Str(arg_8))],
                    )
                ],
                keywords=[],
            )
        )

    # Check if we should use Var indirection
    if arg_0.use_var_indirection or _is_dynamic(arg_6) or _is_redefable(arg_6):
        return __var_find_to_py_ast(arg_11, arg_8, arg_12)

    # Otherwise, try to direct-link it like a Python variable
    # Try without allowing builtins first
    arg_13 = munge(arg_11)
    if arg_13 not in arg_9.__dict__:
        # Try allowing builtins
        arg_13 = munge(arg_11, allow_builtins=True)

    if arg_13 in arg_9.__dict__:
        if arg_7 is arg_0.current_ns:
            return GeneratedPyAST(arg_2=ast.Name(id=arg_13, arg_0=arg_12))
        return GeneratedPyAST(arg_2=_load_attr(f"{safe_ns}.{safe_name}", arg_0=arg_12))

    if arg_0.warn_on_var_indirection:
        logger.warning(f"could not resolve a direct link to Var '{var_name}'")

    return __var_find_to_py_ast(arg_11, arg_8, arg_12)

Generate a Python AST node for accessing a Var .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = dtoolcore . ProtoDataSet . from_uri ( arg_0 , config_path = CONFIG_PATH ) if arg_2 == "" : arg_2 = os . path . basename ( arg_1 ) arg_3 . put_Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Add a file to the proto dataset."""
    arg_3 = dtoolcore.ProtoDataSet.from_uri(
        arg_0,
        config_path=CONFIG_PATH)
    if arg_2 == "":
        arg_2 = os.path.basename(arg_1)
    arg_3.put_Func(arg_1, arg_2)


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
[
]
arg_0
.
summary_info
[
"ncontigs"
]
=
len
(
arg_0
.
contigs
)
for
arg_4
,
arg_5
in
arg_0
.
contigs
.
items
(
)
:
logger
.
debug
(
"Processing contig: {}"
.
format
(
arg_4
)
)
arg_6
=
len
(
arg_5
)
arg_2
.
append
(
arg_6
)
arg_0
.
summary_info
[
"total_len"
]
+=
arg_6
arg_0
.
summary_info
[
"avg_gc"
]
.
append
(
sum
(
map
(
arg_5
.
count
,
[
"G"
,
"C"
]
)
)
/
arg_6
)
arg_0
.
summary_info
[
"missing_data"
]
+=
arg_5
.
count
(
"N"
)
logger
.
debug
(
"Getting average contig size"
)
arg_0
.
summary_info
[
"avg_contig_size"
]
=
sum
(
arg_2
)
/
len
(
arg_2
)
logger
.
debug
(
"Getting average GC content"
)
arg_0
.
summary_info
[
"avg_gc"
]
=
sum
(
arg_0
.
summary_info
[
"avg_gc"
]
)
/
len
(
arg_0
.
summary_info
[
"avg_gc"
]
)
logger
.
debug
(
"Getting N50"
)
arg_7
=
0
for
arg_8
in
sorted
(
arg_2
,
reverse
=
True
)
:
arg_7
+=
arg_8
if
arg_7
>=
arg_0
.
summary_info
[
"total_len"
]
/
2
:
arg_0
.
summary_info
[
"n50"
]
=
arg_8
break
if
arg_1
:
logger
.
debug
(
"Writing report to csv"
)
with
open
(
arg_1
,
"w"
)
as
fh
:
arg_9
=
"{}, {}\\n"
.
format
(
arg_0
.
sample
,
","
.
join
(
[
str
(
x
)
for
x
in
arg_0
.
summary_info
.
values
(
)
]
)
)
fh
.
write
(
arg_9
)

def Func(arg_0, arg_1=None):
        """Generates a CSV report with summary statistics about the assembly

        The calculated statistics are:

            - Number of contigs
            - Average contig size
            - N50
            - Total assembly length
            - Average GC content
            - Amount of missing data

        Parameters
        ----------
        output_csv: str
            Name of the output CSV file.
        """

        arg_2 = []

        arg_0.summary_info["ncontigs"] = len(arg_0.contigs)

        for arg_4, arg_5 in arg_0.contigs.items():

            logger.debug("Processing contig: {}".format(arg_4))

            # Get contig sequence size
            arg_6 = len(arg_5)

            # Add size for average contig size
            arg_2.append(arg_6)

            # Add to total assembly length
            arg_0.summary_info["total_len"] += arg_6

            # Add to average gc
            arg_0.summary_info["avg_gc"].append(
                sum(map(arg_5.count, ["G", "C"])) / arg_6
            )

            # Add to missing data
            arg_0.summary_info["missing_data"] += arg_5.count("N")

        # Get average contig size
        logger.debug("Getting average contig size")
        arg_0.summary_info["avg_contig_size"] = \
            sum(arg_2) / len(arg_2)

        # Get average gc content
        logger.debug("Getting average GC content")
        arg_0.summary_info["avg_gc"] = \
            sum(arg_0.summary_info["avg_gc"]) / len(arg_0.summary_info["avg_gc"])

        # Get N50
        logger.debug("Getting N50")
        arg_7 = 0
        for arg_8 in sorted(arg_2, reverse=True):
            arg_7 += arg_8
            if arg_7 >= arg_0.summary_info["total_len"] / 2:
                arg_0.summary_info["n50"] = arg_8
                break

        if arg_1:
            logger.debug("Writing report to csv")
            # Write summary info to CSV
            with open(arg_1, "w") as fh:
                arg_9 = "{}, {}\\n".format(
                    arg_0.sample, ",".join(
                        [str(x) for x in arg_0.summary_info.values()]))
                fh.write(arg_9)


def Func ( arg_0 , arg_1 = None ) : arg_2 = { 'state' : 'all' , 'per_page' : PER_PAGE , 'direction' : 'asc' , 'sort' : 'updated' } if arg_1 : arg_2 [ 'since' ] = arg_1 . isoformat ( ) arg_3 = urijoin ( "Func" ) return arg_0 . fetch_items ( arg_3 , arg_2 )

def Func(arg_0, arg_1=None):
        """Fetch the Func from the repository.

        The method retrieves, from a GitHub repository, the Func
        updated since the given date.

        :param from_date: obtain Func updated since this date

        :returns: a generator of Func
        """
        arg_2 = {
            'state': 'all',
            'per_page': PER_PAGE,
            'direction': 'asc',
            'sort': 'updated'}

        if arg_1:
            arg_2['since'] = arg_1.isoformat()

        arg_3 = urijoin("Func")
        return arg_0.fetch_items(arg_3, arg_2)

Fetch the issues from the repository.

        The method retrieves, from a GitHub repository, the issues
        updated since the given date.

        :param from_date: obtain issues updated since this date

        :returns: a generator of issues


def Func ( arg_0 ) : arg_1 = dict ( arg_0 . settings [ "extra_Func" ] ) if arg_0 . transport : arg_1 . update ( arg_0 . transport . Func ) arg_1 [ "local-jid" ] = arg_0 . me arg_1 [ "service-type" ] = "xmpp" return arg_1

def Func(arg_0):
        """Authentication properties of the stream.

        Derived from the transport with 'local-jid' and 'service-type' added.
        """
        arg_1 = dict(arg_0.settings["extra_Func"])
        if arg_0.transport:
            arg_1.update(arg_0.transport.Func)
        arg_1["local-jid"] = arg_0.me
        arg_1["service-type"] = "xmpp"
        return arg_1

Authentication properties of the stream .


def Func(arg_0):
        """
        Request the stepper library version from the Arduino.
        To retrieve the version after this command is called, call
        get_stepper_version
        """
        arg_1 = [arg_0.STEPPER_LIBRARY_VERSION]
        arg_0._command_handler.send_sysex(arg_0._command_handler.STEPPER_DATA, arg_1)

Request the stepper library version from the Arduino . To retrieve the version after this command is called call get_stepper_version


def
Func
(
arg_0
,
arg_1
)
:
def
_to_regex
(
arg_2
,
arg_3
=
True
)
:
arg_4
=
''
arg_5
=
{
'#'
:
'[AEIOU]+'
,
':'
:
'[BCDFGHJKLMNPQRSTVWXYZ]*'
,
'^'
:
'[BCDFGHJKLMNPQRSTVWXYZ]'
,
'.'
:
'[BDVGJLMNTWZ]'
,
'%'
:
'(ER|E|ES|ED|ING|ELY)'
,
'+'
:
'[EIY]'
,
' '
:
'^'
,
}
for
arg_6
in
arg_2
:
arg_4
+=
(
arg_5
[
arg_6
]
if
arg_6
in
arg_5
else
arg_6
)
if
arg_3
:
arg_4
+=
'$'
if
'^'
not
in
arg_2
:
arg_4
=
'^.*'
+
arg_4
else
:
arg_4
=
'^'
+
arg_4
.
replace
(
'^'
,
'$'
)
if
'$'
not
in
arg_4
:
arg_4
+=
'.*$'
return
arg_4
arg_1
=
arg_1
.
upper
(
)
arg_7
=
''
arg_8
=
0
while
arg_8
<
len
(
arg_1
)
:
arg_9
=
arg_1
[
:
arg_8
]
arg_10
=
arg_1
[
arg_8
:
]
arg_11
=
arg_1
[
arg_8
]
if
arg_1
[
arg_8
]
in
arg_0
.
_rules
else
' '
for
arg_12
in
arg_0
.
_rules
[
arg_11
]
:
left
,
match
,
right
,
out
=
arg_12
if
arg_10
.
startswith
(
match
)
:
if
left
:
l_pattern
=
_to_regex
(
left
,
arg_3
=
True
)
if
right
:
r_pattern
=
_to_regex
(
right
,
arg_3
=
False
)
if
(
not
left
or
re_match
(
l_pattern
,
arg_9
)
)
and
(
not
right
or
re_match
(
r_pattern
,
arg_10
[
len
(
match
)
:
]
)
)
:
arg_7
+=
out
arg_8
+=
len
(
match
)
break
else
:
arg_7
+=
arg_1
[
arg_8
]
arg_8
+=
1
return
arg_7

def Func(arg_0, arg_1):
        """Return the Naval Research Laboratory phonetic encoding of a word.

        Parameters
        ----------
        word : str
            The word to transform

        Returns
        -------
        str
            The NRL phonetic encoding

        Examples
        --------
        >>> pe = NRL()
        >>> pe.Func('the')
        'DHAX'
        >>> pe.Func('round')
        'rAWnd'
        >>> pe.Func('quick')
        'kwIHk'
        >>> pe.Func('eaten')
        'IYtEHn'
        >>> pe.Func('Smith')
        'smIHTH'
        >>> pe.Func('Larsen')
        'lAArsEHn'

        """

        def _to_regex(arg_2, arg_3=True):
            arg_4 = ''
            arg_5 = {
                '#': '[AEIOU]+',
                ':': '[BCDFGHJKLMNPQRSTVWXYZ]*',
                '^': '[BCDFGHJKLMNPQRSTVWXYZ]',
                '.': '[BDVGJLMNTWZ]',
                '%': '(ER|E|ES|ED|ING|ELY)',
                '+': '[EIY]',
                ' ': '^',
            }
            for arg_6 in arg_2:
                arg_4 += (
                    arg_5[arg_6] if arg_6 in arg_5 else arg_6
                )

            if arg_3:
                arg_4 += '$'
                if '^' not in arg_2:
                    arg_4 = '^.*' + arg_4
            else:
                arg_4 = '^' + arg_4.replace('^', '$')
                if '$' not in arg_4:
                    arg_4 += '.*$'

            return arg_4

        arg_1 = arg_1.upper()

        arg_7 = ''
        arg_8 = 0
        while arg_8 < len(arg_1):
            arg_9 = arg_1[:arg_8]
            arg_10 = arg_1[arg_8:]
            arg_11 = arg_1[arg_8] if arg_1[arg_8] in arg_0._rules else ' '
            for arg_12 in arg_0._rules[arg_11]:
                left, match, right, out = arg_12
                if arg_10.startswith(match):
                    if left:
                        l_pattern = _to_regex(left, arg_3=True)
                    if right:
                        r_pattern = _to_regex(right, arg_3=False)
                    if (not left or re_match(l_pattern, arg_9)) and (
                        not right
                        or re_match(r_pattern, arg_10[len(match) :])
                    ):
                        arg_7 += out
                        arg_8 += len(match)
                        break
            else:
                arg_7 += arg_1[arg_8]
                arg_8 += 1

        return arg_7

Return the Naval Research Laboratory phonetic encoding of a word.

        Parameters
        ----------
        word : str
            The word to transform

        Returns
        -------
        str
            The NRL phonetic encoding

        Examples
        --------
        >>> pe = NRL()
        >>> pe.encode('the')
        'DHAX'
        >>> pe.encode('round')
        'rAWnd'
        >>> pe.encode('quick')
        'kwIHk'
        >>> pe.encode('eaten')
        'IYtEHn'
        >>> pe.encode('Smith')
        'smIHTH'
        >>> pe.encode('Larsen')
        'lAArsEHn'

Return the Naval Research Laboratory phonetic encoding of a word .


return math.ceil((self.device.sample_rate * integration_time) / bins)

def Func ( arg_0 , arg_1 , arg_2 ) : return math . ceil ( ( arg_0 . device . sample_rate * arg_2 ) / arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Convert integration time to number of repeats"""
        return math.ceil((arg_0.device.sample_rate * arg_2) / arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = len ( arg_0 ) list . extend ( arg_0 , arg_1 ) arg_3 = arg_0 . _dict if arg_2 is 0 : arg_0 . _generate_index ( ) return for arg_4 , arg_5 in enumerate ( islice ( arg_0 , arg_2 , None ) , arg_2 ) : arg_3 [ arg_5 . id ] = arg_4

def Func(arg_0, arg_1):
        """extends without checking for uniqueness

        This function should only be used internally by DictList when it
        can guarantee elements are already unique (as in when coming from
        self or other DictList). It will be faster because it skips these
        checks.

        """
        arg_2 = len(arg_0)
        list.extend(arg_0, arg_1)
        arg_3 = arg_0._dict
        if arg_2 is 0:
            arg_0._generate_index()
            return
        for arg_4, arg_5 in enumerate(islice(arg_0, arg_2, None),
                                arg_2):
            arg_3[arg_5.id] = arg_4


(self, dataframe, data_type_id=None, name=None,
                              description=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                              arg_4=None):
        """
        Serialize the specified DataFrame and replace the existing dataset.

        Parameters
        ----------
        dataframe : pandas.DataFrame
            Data to serialize.
        data_type_id : str, optional
            Format to serialize to.
            If None, the existing format is preserved.
            Supported formats are:
                'PlainText'
                'GenericCSV'
                'GenericTSV'
                'GenericCSVNoHeader'
                'GenericTSVNoHeader'
            See the azureml.DataTypeIds class for constants.
        name : str, optional
            Name for the dataset.
            If None, the name of the existing dataset is used.
        description : str, optional
            Description for the dataset.
            If None, the name of the existing dataset is used.
        """
        _not_none('dataframe', arg_1)

        if arg_2 is None:
            arg_2 = arg_0.data_type_id
        if arg_3 is None:
            arg_3 = arg_0.name
        if arg_4 is None:
            arg_4 = arg_0.description

        try:
            arg_5 = BytesIO()
            serialize_dataframe(arg_5, arg_2, arg_1)
            arg_6 = arg_5.getvalue()
        finally:
            arg_5.close()

        arg_0._upload_and_refresh(arg_6, arg_2, arg_3, arg_4)

Serialize the specified DataFrame and replace the existing dataset .


return [
            Snapshot(token=self.token, **snapshot)
            for snapshot in data['snapshots']
        ]

def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "snapshots?resource_type=droplet" ) return [ Snapshot ( token = arg_0 . token , ** arg_2 ) for arg_2 in arg_1 [ 'snapshots' ] ]

def Func(arg_0):
        """
            This method returns a list of all Snapshots based on Droplets.
        """
        arg_1 = arg_0.get_data("snapshots?resource_type=droplet")
        return [
            Snapshot(token=arg_0.token, **arg_2)
            for arg_2 in arg_1['snapshots']
        ]

This method returns a list of all Snapshots based on Droplets .


def Func ( arg_0 , arg_1 ) : arg_2 = ASSIGNMENTS_API . format ( arg_1 . course_id ) + "/{}" . format ( arg_1 . assignment_id ) arg_3 = arg_0 . _put_resource ( arg_2 , arg_1 . json_data ( ) ) return Assignment ( arg_3 = arg_3 )

def Func(arg_0, arg_1):
        """
        Modify an existing assignment.

        https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.update
        """
        arg_2 = ASSIGNMENTS_API.format(arg_1.course_id) + "/{}".format(
            arg_1.assignment_id)

        arg_3 = arg_0._put_resource(arg_2, arg_1.json_data())
        return Assignment(arg_3=arg_3)


def Func(arg_0):
    """ Clear all custom configuration settings and delete the persistent
    custom configuration store.
    """
    _getLogger().info("Resetting all custom configuration properties; "
                      "caller=%r", traceback.format_stack())

    # Clear the in-memory settings cache, forcing reload upon subsequent "get"
    # request.
    super(Configuration, arg_0).clear()

    # Delete the persistent custom configuration store and reset in-memory
    # custom configuration info
    _CustomConfigurationFileWrapper.clear(persistent=True)

Clear all custom configuration settings and delete the persistent custom configuration store .


def
Func
(
arg_0
)
:
for
arg_1
in
xrange
(
3
)
:
arg_2
=
arg_0
.
_dmpaft_cmd
(
arg_0
.
_archive_time
)
if
arg_2
is
not
:
break
time
.
sleep
(
1
)
if
arg_2
is
:
raise
NoDeviceException
(
'Can not access weather station'
)
arg_3
=
for
arg_4
in
arg_2
:
arg_5
=
(
arg_4
[
'DateStamp'
]
,
arg_4
[
'TimeStamp'
]
)
if
arg_0
.
_archive_time
<
arg_5
:
arg_0
.
_archive_time
=
arg_5
arg_3
=
arg_4
return
arg_3

def Func(arg_0):
        '''
        returns a dictionary of fields from the newest archive record in the
        device. return None when no records are new.
        '''
        for arg_1 in xrange(3):
            arg_2 = arg_0._dmpaft_cmd(arg_0._archive_time)
            if arg_2 is not None: break
            time.sleep(1)

        if arg_2 is None:
            raise NoDeviceException('Can not access weather station')

        # find the newest record
        arg_3 = None
        for arg_4 in arg_2:
            arg_5 = (arg_4['DateStamp'], arg_4['TimeStamp'])
            if arg_0._archive_time < arg_5:
                arg_0._archive_time = arg_5
                arg_3 = arg_4

        return arg_3

returns a dictionary of fields from the newest archive record in the device . return None when no records are new .


(self, segments, image_file=None, image_id=None,
                           image_user_id=None)

async
def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
async
with
arg_0
.
_Func_lock
:
if
arg_2
:
try
:
arg_5
=
await
arg_0
.
_client
.
upload_image
(
arg_2
,
return_uploaded_image
=
True
)
except
exceptions
.
NetworkError
as
e
:
logger
.
warning
(
'Failed to upload image: {}'
.
format
(
e
)
)
raise
arg_3
=
arg_5
.
image_id
try
:
arg_6
=
hangouts_pb2
.
SendChatMessageRequest
(
request_header
=
arg_0
.
_client
.
get_request_header
(
)
,
event_request_header
=
arg_0
.
_get_event_request_header
(
)
,
message_content
=
hangouts_pb2
.
MessageContent
(
segment
=
[
seg
.
serialize
(
)
for
seg
in
arg_1
]
,
)
,
)
if
arg_3
is
not
:
arg_6
.
existing_media
.
photo
.
photo_id
=
arg_3
if
arg_4
is
not
:
arg_6
.
existing_media
.
photo
.
user_id
=
arg_4
arg_6
.
existing_media
.
photo
.
is_custom_user_id
=
True
await
arg_0
.
_client
.
send_chat_message
(
arg_6
)
except
exceptions
.
NetworkError
as
e
:
logger
.
warning
(
'Failed to send message: {}'
.
format
(
e
)
)
raise

async def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                           arg_4=None):
        """Send a message to this conversation.

        A per-conversation lock is acquired to ensure that messages are sent in
        the correct order when this method is called multiple times
        asynchronously.

        Args:
            segments: List of :class:`.ChatMessageSegment` objects to include
                in the message.
            image_file: (optional) File-like object containing an image to be
                attached to the message.
            image_id: (optional) ID of an Picasa photo to be attached to the
                message. If you specify both ``image_file`` and ``image_id``
                together, ``image_file`` takes precedence and ``image_id`` will
                be ignored.
            image_user_id: (optional) Picasa user ID, required only if
                ``image_id`` refers to an image from a different Picasa user,
                such as Google's sticker user.

        Raises:
            .NetworkError: If the message cannot be sent.
        """
        async with arg_0._Func_lock:
            if arg_2:
                try:
                    arg_5 = await arg_0._client.upload_image(
                        arg_2, return_uploaded_image=True
                    )
                except exceptions.NetworkError as e:
                    logger.warning('Failed to upload image: {}'.format(e))
                    raise
                arg_3 = arg_5.image_id
            try:
                arg_6 = hangouts_pb2.SendChatMessageRequest(
                    request_header=arg_0._client.get_request_header(),
                    event_request_header=arg_0._get_event_request_header(),
                    message_content=hangouts_pb2.MessageContent(
                        segment=[seg.serialize() for seg in arg_1],
                    ),
                )
                if arg_3 is not None:
                    arg_6.existing_media.photo.photo_id = arg_3
                if arg_4 is not None:
                    arg_6.existing_media.photo.user_id = arg_4
                    arg_6.existing_media.photo.is_custom_user_id = True
                await arg_0._client.send_chat_message(arg_6)
            except exceptions.NetworkError as e:
                logger.warning('Failed to send message: {}'.format(e))
                raise


return self._mc_client._post(url=self._build_path(workflow_id, 'emails', email_id, 'actions/pause'))

def Func(arg_0, arg_1, arg_2):
        """
        Pause an automated email.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        """
        arg_0.workflow_id = arg_1
        arg_0.email_id = arg_2
        return arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'emails', arg_2, 'actions/Func'))


(session, github_api_token, ltd_product_data,
                                  mongo_collection=None)

async def Func(arg_0, arg_1, arg_2,
                                  arg_3=None):
    """Extract, transform, and load Sphinx-based technote metadata.

    Parameters
    ----------
    session : `aiohttp.ClientSession`
        Your application's aiohttp client session.
        See http://aiohttp.readthedocs.io/en/stable/client.html.
    github_api_token : `str`
        A GitHub personal API token. See the `GitHub personal access token
        guide`_.
    ltd_product_data : `dict`
        Contents of ``metadata.yaml``, obtained via `download_metadata_yaml`.
        Data for this technote from the LTD Keeper API
        (``GET /products/<slug>``). Usually obtained via
        `lsstprojectmeta.ltd.get_ltd_product`.
    mongo_collection : `motor.motor_asyncio.AsyncIOMotorCollection`, optional
        MongoDB collection. This should be the common MongoDB collection for
        LSST projectmeta JSON-LD records. If provided, ths JSON-LD is upserted
        into the MongoDB collection.

    Returns
    -------
    metadata : `dict`
        JSON-LD-formatted dictionary.

    Raises
    ------
    NotSphinxTechnoteError
        Raised when the LTD product cannot be interpreted as a Sphinx-based
        technote project because it's missing a metadata.yaml file in its
        GitHub repository. This implies that the LTD product *could* be of a
        different format.

    .. `GitHub personal access token guide`: https://ls.st/41d
    """
    arg_4 = logging.getLogger(__name__)

    arg_5 = arg_2['doc_repo']
    arg_5 = normalize_repo_root_url(arg_5)
    arg_6 = parse_repo_slug_from_url(arg_5)

    try:
        arg_7 = await download_metadata_yaml(arg_0, arg_5)
    except aiohttp.ClientResponseError as err:
        # metadata.yaml not found; probably not a Sphinx technote
        arg_4.debug('Tried to download %s\'s metadata.yaml, got status %d',
                     arg_2['slug'], err.code)
        raise NotSphinxTechnoteError()

    # Extract data from the GitHub API
    arg_8 = GitHubQuery.load('technote_repo')
    arg_9 = {
        "orgName": arg_6.owner,
        "repoName": arg_6.repo
    }
    arg_10 = await github_request(arg_0, arg_1,
                                       query=arg_8,
                                       variables=arg_9)

    try:
        arg_11 = reduce_technote_metadata(
            arg_5, arg_7, arg_10, arg_2)
    except Exception as exception:
        arg_12 = "Issue building JSON-LD for technote %s"
        arg_4.exception(arg_12, arg_5, exception)
        raise

    if arg_3 is not None:
        await _upload_to_mongodb(arg_3, arg_11)

    arg_4.info('Ingested technote %s into MongoDB', arg_5)

    return arg_11

Extract transform and load Sphinx - based technote metadata .


(graph: BELGraph,
                          genes: List[Gene],
                          annotation: str = 'Subgraph',
                          ora_weight: Optional[float] = None,
                          hub_weight: Optional[float] = None,
                          top_percent: Optional[float] = None,
                          topology_weight: Optional[float] = None,
                          preprocess: bool = False
                          )

return get_neurommsig_scores_prestratified(
        subgraphs=subgraphs,
        genes=genes,
        ora_weight=ora_weight,
        hub_weight=hub_weight,
        top_percent=top_percent,
        topology_weight=topology_weight,
    )

def Func(arg_0: arg_1,
                          arg_2: arg_3[arg_4],
                          arg_5: arg_6 = 'Subgraph',
                          arg_7: arg_8[arg_9] = None,
                          arg_10: arg_8[arg_9] = None,
                          arg_11: arg_8[arg_9] = None,
                          arg_12: arg_8[arg_9] = None,
                          arg_13: arg_14 = False
                          ) -> arg_8[Mapping[arg_6, arg_9]]:
    """Preprocess the graph, stratify by the given annotation, then run the NeuroMMSig algorithm on each.

    :param graph: A BEL graph
    :param genes: A list of gene nodes
    :param annotation: The annotation to use to stratify the graph to subgraphs
    :param ora_weight: The relative weight of the over-enrichment analysis score from
     :py:func:`neurommsig_gene_ora`. Defaults to 1.0.
    :param hub_weight: The relative weight of the hub analysis score from :py:func:`neurommsig_hubs`.
     Defaults to 1.0.
    :param top_percent: The percentage of top genes to use as hubs. Defaults to 5% (0.05).
    :param topology_weight: The relative weight of the topolgical analysis core from
     :py:func:`neurommsig_topology`. Defaults to 1.0.
    :param preprocess: If true, preprocess the graph.
    :return: A dictionary from {annotation value: NeuroMMSig composite score}

    Pre-processing steps:

    1. Infer the central dogma with :func:``
    2. Collapse all proteins, RNAs and miRNAs to genes with :func:``
    3. Collapse variants to genes with :func:``
    """
    if arg_13:
        arg_0 = neurommsig_graph_preprocessor.run(arg_0)

    if not any(arg_15 in arg_0 for arg_15 in arg_2):
        logger.debug('no genes mapping to graph')
        return

    arg_16 = get_subgraphs_by_annotation(arg_0, arg_5=arg_5)

    return Func_prestratified(
        arg_16=arg_16,
        arg_2=arg_2,
        arg_7=arg_7,
        arg_10=arg_10,
        arg_11=arg_11,
        arg_12=arg_12,
    )

Preprocess the graph stratify by the given annotation then run the NeuroMMSig algorithm on each .


def Func(arg_0, arg_1):
    '''This is a decorator which can be used to mark functions
    as Func.

    It will result in a warning being emitted when the function is used.'''

    def __wrapper(arg_2, *arg_3, **arg_4):
        '''Warn the user, and then proceed.'''
        arg_5 = six.get_function_code(arg_2)
        warnings.warn_explicit(
            "{:s}.{:s}\n\tDeprecated as of JAMS version {:s}."
            "\n\tIt will be removed in JAMS version {:s}."
            .format(arg_2.__module__, arg_2.__name__,
                    arg_0, arg_1),
            category=DeprecationWarning,
            filename=arg_5.co_filename,
            lineno=arg_5.co_firstlineno + 1
        )
        return arg_2(*arg_3, **arg_4)

    return decorator(__wrapper)

This is a decorator which can be used to mark functions
    as deprecated.

    It will result in a warning being emitted when the function is used.

This is a decorator which can be used to mark functions as deprecated .


def Func ( arg_0 ) : while True : try : arg_0 . ioloop . start ( ) except ZMQError as e : if e . errno == errno . EINTR : continue else : raise except Exception : if arg_0 . _exiting : break else : raise else : break

def Func(arg_0):
        """Run my loop, ignoring EINTR events in the poller"""
        while True:
            try:
                arg_0.ioloop.start()
            except ZMQError as e:
                if e.errno == errno.EINTR:
                    continue
                else:
                    raise
            except Exception:
                if arg_0._exiting:
                    break
                else:
                    raise
            else:
                break

Run my loop ignoring EINTR events in the poller


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 : arg_4 , arg_5 , arg_6 = arg_3 . split ( "\t" ) arg_7 = int ( float ( arg_4 ) ) if arg_0 . __last_ts < arg_7 : arg_0 . __last_ts = arg_7 arg_2 . append ( arg_0 . stats_item ( arg_0 . __last_ts , float ( arg_5 ) , float ( arg_6 ) ) ) return arg_2

def Func(arg_0, arg_1):
        """
        Parse lines and return stats
        """

        arg_2 = []
        for arg_3 in arg_1:
            arg_4, arg_5, arg_6 = arg_3.split("\t")
            arg_7 = int(float(arg_4))  # We allow floats here, but tank expects only seconds
            if arg_0.__last_ts < arg_7:
                arg_0.__last_ts = arg_7
                arg_2.append(arg_0.stats_item(arg_0.__last_ts, float(arg_5), float(arg_6)))
        return arg_2


def Func ( arg_0 , arg_1 ) : arg_1 = normalize ( 'NFC' , text_type ( arg_1 . lower ( ) ) ) for arg_2 in range ( 11 , 0 , - 1 ) : arg_3 = arg_1 [ - arg_2 : ] if ( arg_3 in arg_0 . _suffix and len ( arg_1 ) - arg_2 >= 2 and ( arg_0 . _suffix [ arg_3 ] is None or arg_0 . _suffix [ arg_3 ] ( arg_1 , arg_2 ) ) ) : arg_1 = arg_1 [ : - arg_2 ] break if arg_1 [ - 2 : ] in { 'bb' , 'dd' , 'gg' , 'll' , 'mm' , 'nn' , 'pp' , 'rr' , 'ss' , 'tt' , } : arg_1 = arg_1 [ : - 1 ] for arg_3 , arg_4 in arg_0 . _recode : if arg_1 . endswith ( arg_3 ) : if callable ( arg_4 ) : arg_1 = arg_4 ( arg_1 ) else : arg_1 = arg_1 [ : - len ( arg_3 ) ] + arg_4 return arg_1

def Func(arg_0, arg_1):
        """Return Lovins Func.

        Parameters
        ----------
        word : str
            The word to Func

        Returns
        -------
        str
            Word Func

        Examples
        --------
        >>> stmr = Lovins()
        >>> stmr.Func('reading')
        'read'
        >>> stmr.Func('suspension')
        'suspens'
        >>> stmr.Func('elusiveness')
        'elus'

        """
        # lowercase, normalize, and compose
        arg_1 = normalize('NFC', text_type(arg_1.lower()))

        for arg_2 in range(11, 0, -1):
            arg_3 = arg_1[-arg_2:]
            if (
                arg_3 in arg_0._suffix
                and len(arg_1) - arg_2 >= 2
                and (
                    arg_0._suffix[arg_3] is None
                    or arg_0._suffix[arg_3](arg_1, arg_2)
                )
            ):
                arg_1 = arg_1[:-arg_2]
                break

        if arg_1[-2:] in {
            'bb',
            'dd',
            'gg',
            'll',
            'mm',
            'nn',
            'pp',
            'rr',
            'ss',
            'tt',
        }:
            arg_1 = arg_1[:-1]

        for arg_3, arg_4 in arg_0._recode:
            if arg_1.endswith(arg_3):
                if callable(arg_4):
                    arg_1 = arg_4(arg_1)
                else:
                    arg_1 = arg_1[: -len(arg_3)] + arg_4

        return arg_1

Return Lovins stem.

        Parameters
        ----------
        word : str
            The word to stem

        Returns
        -------
        str
            Word stem

        Examples
        --------
        >>> stmr = Lovins()
        >>> stmr.stem('reading')
        'read'
        >>> stmr.stem('suspension')
        'suspens'
        >>> stmr.stem('elusiveness')
        'elus'


async def Func(arg_0, *arg_1):
        """Update home info async."""
        arg_2 = gql(
            """
        {
          viewer {
            name
            homes {
              subscriptions {
                status
              }
              id
            }
          }
        }
        """
        )

        arg_3 = await arg_0._execute(arg_2)
        if arg_3 is None:
            return
        arg_4 = arg_3.get("errors", [])
        if arg_4:
            arg_5 = arg_4[0].get("message", "failed to login")
            _LOGGER.error(arg_5)
            raise InvalidLogin(arg_5)

        arg_6 = arg_3.get("data")
        if not arg_6:
            return
        arg_7 = arg_6.get("viewer")
        if not arg_7:
            return
        arg_0._name = arg_7.get("name")
        arg_9 = arg_7.get("homes", [])
        arg_0._home_ids = []
        for arg_11 in arg_9:
            arg_12 = arg_11.get("id")
            arg_0._all_home_ids += [arg_12]
            arg_13 = arg_11.get("subscriptions")
            if arg_13:
                arg_14 = arg_13[0].get("status", "ended").lower()
                if not arg_12 or arg_14 != "running":
                    continue
            arg_0._home_ids += [arg_12]


def Func ( arg_0 , arg_1 ) : if arg_1 . value [ 1 ] == '"' : arg_1 . lexer . push_state ( 'escapequotes' ) elif arg_1 . value [ 1 ] == '\'' : arg_1 . lexer . push_state ( 'escapeapostrophe' ) return arg_1

def Func(arg_0, arg_1):
        r'~"|~\''
        if arg_1.value[1] == '"':
            arg_1.lexer.push_state('escapequotes')
        elif arg_1.value[1] == '\'':
            arg_1.lexer.push_state('escapeapostrophe')
        return arg_1


def Func ( arg_0 = None , arg_1 = None ) : from imgaug . augmentables . segmaps import SegmentationMapOnImage with open ( QUOKKA_ANNOTATIONS_FP , "r" ) as f : arg_2 = json . load ( f ) arg_3 = [ ] arg_4 = [ ] for arg_5 in arg_2 [ "polygons" ] [ 0 ] [ "keypoints" ] : arg_6 = arg_5 [ "x" ] arg_7 = arg_5 [ "y" ] arg_3 . append ( arg_6 ) arg_4 . append ( arg_7 ) arg_8 = np . zeros ( ( 643 , 960 , 1 ) , dtype = np . float32 ) arg_9 , arg_10 = skimage . draw . polygon ( np . array ( arg_4 ) , np . array ( arg_3 ) , arg_14 = arg_8 . shape ) arg_8 [ arg_9 , arg_10 ] = 1.0 if arg_1 is not None : arg_11 = _quokka_normalize_extract ( arg_1 ) arg_8 = arg_11 . extract_from_image ( arg_8 ) arg_12 = SegmentationMapOnImage ( arg_8 , arg_14 = arg_8 . shape [ 0 : 2 ] + ( 3 , ) ) if arg_0 is not None : arg_13 = _compute_resized_shape ( arg_8 . shape , arg_0 ) arg_12 = arg_12 . resize ( arg_13 [ 0 : 2 ] ) arg_12 . shape = tuple ( arg_13 [ 0 : 2 ] ) + ( 3 , ) return arg_12

def Func(arg_0=None, arg_1=None):
    """
    Returns a segmentation map for the standard example quokka image.

    Parameters
    ----------
    size : None or float or tuple of int, optional
        See :func:`imgaug.quokka`.

    extract : None or 'square' or tuple of number or imgaug.BoundingBox or imgaug.BoundingBoxesOnImage
        See :func:`imgaug.quokka`.

    Returns
    -------
    result : imgaug.SegmentationMapOnImage
        Segmentation map object.

    """
    # TODO get rid of this deferred import
    from imgaug.augmentables.segmaps import SegmentationMapOnImage

    with open(QUOKKA_ANNOTATIONS_FP, "r") as f:
        arg_2 = json.load(f)

    arg_3 = []
    arg_4 = []
    for arg_5 in arg_2["polygons"][0]["keypoints"]:
        arg_6 = arg_5["x"]
        arg_7 = arg_5["y"]
        arg_3.append(arg_6)
        arg_4.append(arg_7)

    arg_8 = np.zeros((643, 960, 1), dtype=np.float32)
    arg_9, arg_10 = skimage.draw.polygon(np.array(arg_4), np.array(arg_3), arg_14=arg_8.shape)
    arg_8[arg_9, arg_10] = 1.0

    if arg_1 is not None:
        arg_11 = _quokka_normalize_extract(arg_1)
        arg_8 = arg_11.extract_from_image(arg_8)

    arg_12 = SegmentationMapOnImage(arg_8, arg_14=arg_8.shape[0:2] + (3,))

    if arg_0 is not None:
        arg_13 = _compute_resized_shape(arg_8.shape, arg_0)
        arg_12 = arg_12.resize(arg_13[0:2])
        arg_12.shape = tuple(arg_13[0:2]) + (3,)

    return arg_12

Returns a segmentation map for the standard example quokka image .


return LineString(coords=self.coords if coords is None else coords,
                          label=self.label if label is None else label)

def Func ( arg_0 , arg_1 = None , arg_2 = None ) : return LineString ( arg_1 = arg_0 . coords if arg_1 is None else arg_1 , arg_2 = arg_0 . label if arg_2 is None else arg_2 )

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

        Parameters
        ----------
        coords : None or iterable of tuple of number or ndarray
            If not ``None``, then the coords of the copied object will be set
            to this value.

        label : None or str
            If not ``None``, then the label of the copied object will be set to
            this value.

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

        """
        return LineString(arg_1=arg_0.coords if arg_1 is None else arg_1,
                          arg_2=arg_0.label if arg_2 is None else arg_2)

Create a shallow copy of the LineString object.

        Parameters
        ----------
        coords : None or iterable of tuple of number or ndarray
            If not ``None``, then the coords of the copied object will be set
            to this value.

        label : None or str
            If not ``None``, then the label of the copied object will be set to
            this value.

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

Create a shallow copy of the LineString object .


def Func ( arg_0 , arg_1 , * arg_2 ) : arg_0 . tape . append ( OP_CODES [ arg_1 ] ( * arg_2 ) )

def Func(arg_0, arg_1, *arg_2):
        ''' Adds op_code with specified args to tape '''
        arg_0.tape.append(OP_CODES[arg_1](*arg_2))


Yields one string, concatenation of argument strings

def Func ( arg_0 , * arg_1 ) : arg_1 = flatten ( [ ( s . compute ( arg_0 ) if callable ( s ) else s ) for s in arg_1 ] ) arg_1 = ( next ( string_arg ( arg_0 , s ) , '' ) for s in arg_1 ) yield '' . join ( arg_1 )

def Func(arg_0, *arg_1):
    '''
    Yields one string, Funcenation of argument strings
    '''
    arg_1 = flatten([ (s.compute(arg_0) if callable(s) else s) for s in arg_1 ])
    arg_1 = (next(string_arg(arg_0, s), '') for s in arg_1)
    #assert(all(map(lambda x: isinstance(x, str), strings)))
    #FIXME: Check arg types
    yield ''.join(arg_1)

Yields one string concatenation of argument strings


(self, angles, start=0, end=1e100, states=None, max_force=100)

def Func(arg_0, arg_1, arg_2=0, arg_3=1e100, arg_4=None, arg_5=100):
        '''Follow a set of angle data, yielding dynamic joint torques.

        Parameters
        ----------
        angles : ndarray (num-frames x num-dofs)
            Follow angle data provided by this array of angle values.
        start : int, optional
            Start following angle data after this frame. Defaults to the start
            of the angle data.
        end : int, optional
            Stop following angle data after this frame. Defaults to the end of
            the angle data.
        states : list of body states, optional
            If given, set the states of the skeleton bodies to these values
            before starting to follow the marker data.
        max_force : float, optional
            Allow each degree of freedom in the skeleton to exert at most this
            force when attempting to follow the given joint angles. Defaults to
            100N. Setting this value to be large results in more accurate
            following but can cause oscillations in the PID controllers,
            resulting in noisy torques.

        Returns
        -------
        torques : sequence of torque frames
            Returns a generator of joint torque data for the skeleton. One set
            of joint torques will be generated for each frame of angle data
            between `start` and `end`.
        '''
        if arg_4 is not None:
            arg_0.skeleton.set_body_states(arg_4)

        for arg_6, arg_7 in enumerate(arg_1):
            if arg_6 < arg_2:
                continue
            if arg_6 >= arg_3:
                break

            arg_0.ode_space.collide(None, arg_0.on_collision)

            arg_4 = arg_0.skeleton.get_body_states()
            arg_0.skeleton.set_body_states(arg_4)

            # joseph's stability fix: step to compute torques, then reset the
            # skeleton to the start of the step, and then step using computed
            # torques. thus any numerical errors between the body states after
            # stepping using angle constraints will be removed, because we
            # will be stepping the model using the computed torques.

            arg_0.skeleton.enable_motors(arg_5)
            arg_0.skeleton.set_target_angles(arg_1[arg_6])
            arg_0.ode_world.step(arg_0.dt)
            arg_8 = arg_0.skeleton.joint_torques
            arg_0.skeleton.disable_motors()

            arg_0.skeleton.set_body_states(arg_4)
            arg_0.skeleton.add_torques(arg_8)
            yield arg_8
            arg_0.ode_world.step(arg_0.dt)

            arg_0.ode_contactgroup.empty()

Follow a set of angle data yielding dynamic joint torques .


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_0 . to_dict ( ) arg_2 . update ( arg_1 ) return BindingPrediction ( ** arg_2 )

def Func(arg_0, **arg_1):
        """Returns new BindingPrediction with updated fields"""
        arg_2 = arg_0.to_dict()
        arg_2.update(arg_1)
        return BindingPrediction(**arg_2)


def Func ( arg_0 , arg_1 = None ) : arg_2 = { } for arg_3 in get_group_all ( arg_0 , arg_1 = arg_1 ) : if arg_3 . name not in arg_2 : arg_2 [ arg_3 . name ] = arg_3 return arg_2

def Func(arg_0, arg_1=None):
    """Find a group of entry points with unique names.

    Returns a dictionary of names to :class:`EntryPoint` objects.
    """
    arg_2 = {}
    for arg_3 in get_group_all(arg_0, arg_1=arg_1):
        if arg_3.name not in arg_2:
            arg_2[arg_3.name] = arg_3
    return arg_2

Find a group of entry points with unique names .


return self.get_data(
            "floating_ips/%s/actions/" % self.ip,
            type=POST,
            params={"type": "assign", "droplet_id": droplet_id}
        )

def Func ( arg_0 , arg_1 ) : return arg_0 . get_data ( "floating_ips/%s/actions/" % arg_0 . ip , type = POST , params = { "type" : "Func" , "droplet_id" : arg_1 } )

def Func(arg_0, arg_1):
        """
            Assign a FloatingIP to a Droplet.

            Args:
                droplet_id: int - droplet id
        """
        return arg_0.get_data(
            "floating_ips/%s/actions/" % arg_0.ip,
            type=POST,
            params={"type": "Func", "droplet_id": arg_1}
        )


def Func(arg_0):
  """ Create the parse for the update command """
  arg_1 = arg_0.add_parser(
      'update',
      help='Update a topology',
      usage="%(prog)s [options] cluster/[role]/[env] <topology-name> "
      + "[--component-parallelism <name:value>] "
      + "[--container-number value] "
      + "[--runtime-config [component:]<name:value>]",
      add_help=True)

  args.add_titles(arg_1)
  args.add_cluster_role_env(arg_1)
  args.add_topology(arg_1)

  args.add_config(arg_1)
  args.add_dry_run(arg_1)
  args.add_service_url(arg_1)
  args.add_verbose(arg_1)

  # Special parameters for update command
  def parallelism_type(arg_2):
    arg_3 = re.compile(r"^[\w\.-]+:[\d]+$")
    if not arg_3.match(arg_2):
      raise argparse.ArgumentTypeError(
          "Invalid syntax for component parallelism (<component_name:value>): %s" % arg_2)
    return arg_2

  arg_1.add_argument(
      '--component-parallelism',
      action='append',
      type=parallelism_type,
      required=False,
      help='Component name and the new parallelism value '
      + 'colon-delimited: <component_name>:<parallelism>')

  def runtime_config_type(arg_2):
    arg_3 = re.compile(r"^([\w\.-]+:){1,2}[\w\.-]+$")
    if not arg_3.match(arg_2):
      raise argparse.ArgumentTypeError(
          "Invalid syntax for runtime config ([component:]<name:value>): %s"
          % arg_2)
    return arg_2

  arg_1.add_argument(
      '--runtime-config',
      action='append',
      type=runtime_config_type,
      required=False,
      help='Runtime configurations for topology and components '
      + 'colon-delimited: [component:]<name>:<value>')

  def container_number_type(arg_2):
    arg_3 = re.compile(r"^\d+$")
    if not arg_3.match(arg_2):
      raise argparse.ArgumentTypeError(
          "Invalid syntax for container number (value): %s"
          % arg_2)
    return arg_2

  arg_1.add_argument(
      '--container-number',
      action='append',
      type=container_number_type,
      required=False,
      help='Number of containers <value>')

  arg_1.set_defaults(subcommand='update')
  return arg_1


def Func(arg_0, arg_1):
    '''use blob2oci to handle whiteout files for extraction. Credit for this
       script goes to docker2oci by Olivier Freyermouth, and see script
       folder for license.

       Parameters
       ==========
       archive: the archive to extract
       output_folder the output folder (sandbox) to extract to

    '''
    from .terminal import ( run_command, which )

    arg_2 = which('blob2oci')
    if arg_2['return_code'] != 0:
        bot.error('Cannot find blob2oci script on path, exiting.')
        sys.exit(1)

    arg_3 = arg_2['message']
    arg_4 = ['exec' ,arg_3, '--layer', arg_0, '--extract', arg_1]

    if not bot.is_quiet():
        print("Extracting %s" % arg_0)

    return run_command(arg_4)

use blob2oci to handle whiteout files for extraction . Credit for this script goes to docker2oci by Olivier Freyermouth and see script folder for license .


def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_0
.
client_name
arg_3
=
True
if
not
hasattr
(
arg_0
,
'secrets'
)
:
arg_3
=
False
elif
hasattr
(
arg_0
,
'secrets'
)
:
if
arg_0
.
secrets
is
:
arg_3
=
False
elif
arg_0
.
client_name
not
in
arg_0
.
secrets
:
arg_3
=
False
if
arg_3
is
False
:
arg_4
=
'%s requires client secrets.'
%
arg_2
bot
.
error
(
arg_4
)
sys
.
exit
(
1
)
if
arg_1
is
not
:
if
not
isinstance
(
arg_1
,
list
)
:
arg_1
=
[
arg_1
]
for
arg_5
in
arg_1
:
if
arg_5
not
in
arg_0
.
secrets
[
arg_2
]
:
arg_3
=
False
elif
arg_0
.
secrets
[
arg_2
]
[
arg_5
]
in
[
,
''
]
:
arg_3
=
False
if
arg_3
is
False
:
arg_4
=
'Missing %s in client secrets.'
%
arg_5
bot
.
error
(
arg_4
)
sys
.
exit
(
1
)

def Func(arg_0, arg_1=None):
    '''require secrets ensures that the client has the secrets file, and
       specifically has one or more parameters defined. If params is None,
       only a check is done for the file.

       Parameters
       ==========
       params: a list of keys to lookup in the client secrets, eg:

         secrets[client_name][params1] should not be in [None,''] or not set

    '''
    arg_2 = arg_0.client_name

    # Check 1: the client must have secrets, period
    arg_3 = True

    # Secrets file not asked for (incorrectly) but still wanted
    # The client shouldn't be calling this function if didn't init secrets
    if not hasattr(arg_0,'secrets'):
        arg_3 = False

    # Secret file was not found, period
    elif hasattr(arg_0,'secrets'):
        if arg_0.secrets is None:
            arg_3 = False

    # The client isn't defined in the secrets file
    elif arg_0.client_name not in arg_0.secrets:
        arg_3 = False

    # Missing file or client secrets, fail
    if arg_3 is False:
        arg_4 = '%s requires client secrets.' %arg_2
        bot.error(arg_4)
        sys.exit(1)

    # Check 2: we have secrets and lookup, do we have all needed params?
    if arg_1 is not None:

        # Assume list so we can always parse through
        if not isinstance(arg_1,list):
            arg_1 = [arg_1]

        for arg_5 in arg_1:

            # The parameter is not a key for the client
            if arg_5 not in arg_0.secrets[arg_2]:
                arg_3 = False

            # The parameter is a key, but empty or undefined
            elif arg_0.secrets[arg_2][arg_5] in [None,'']:
                arg_3=False

        # Missing parameter, exit on fail
        if arg_3 is False:
            arg_4 = 'Missing %s in client secrets.' %arg_5
            bot.error(arg_4)
            sys.exit(1)

require secrets ensures that the client has the secrets file and specifically has one or more parameters defined . If params is None only a check is done for the file .


def Func ( * arg_0 , ** arg_1 ) : arg_2 = arg_1 . get ( 'sep' , u"_" ) arg_3 = arg_1 . get ( 'exclude_last_string' , False ) arg_4 = [ ] for arg_5 in arg_0 : if isinstance ( arg_5 , list ) : arg_4 . append ( six . text_type ( arg_2 . join ( arg_5 ) ) ) else : if arg_3 : arg_6 = arg_5 . split ( arg_2 ) [ : - 1 ] if len ( arg_6 ) > 0 : arg_4 . append ( Func ( arg_6 ) ) else : arg_4 . append ( six . text_type ( arg_5 ) ) return arg_2 . join ( arg_4 )

def Func(*arg_0, **arg_1):
    """
    Given any number of lists and strings will join them in order as one
    string separated by the sep kwarg.  sep defaults to u"_".

    Add exclude_last_string=True as a kwarg to exclude the last item in a
    given string after being split by sep.  Note if you only have one word
    in your string you can end up getting an empty string.

    Example uses:

    >>> from mongonaut.forms.form_utils import Func
    >>> Func('hi', 'my', 'firend')
    >>> u'hi_my_firend'

    >>> Func('hi', 'my', 'firend', sep='i')
    >>> 'hiimyifirend'

    >>> Func('hi', 'my', 'firend',['this', 'be', 'what'], sep='i')
    >>> 'hiimyifirendithisibeiwhat'

    >>> Func('hi', 'my', 'firend',['this', 'be', 'what'])
    >>> u'hi_my_firend_this_be_what'

    """
    arg_2 = arg_1.get('sep', u"_")
    arg_3 = arg_1.get('exclude_last_string', False)
    arg_4 = []

    for arg_5 in arg_0:
        if isinstance(arg_5, list):
            arg_4.append(six.text_type(arg_2.join(arg_5)))
        else:
            if arg_3:
                arg_6 = arg_5.split(arg_2)[:-1]
                if len(arg_6) > 0:
                    arg_4.append(Func(arg_6))
            else:
                arg_4.append(six.text_type(arg_5))
    return arg_2.join(arg_4)

Given any number of lists and strings will join them in order as one
    string separated by the sep kwarg.  sep defaults to u"_".

    Add exclude_last_string=True as a kwarg to exclude the last item in a
    given string after being split by sep.  Note if you only have one word
    in your string you can end up getting an empty string.

    Example uses:

    >>> from mongonaut.forms.form_utils import make_key
    >>> make_key('hi', 'my', 'firend')
    >>> u'hi_my_firend'

    >>> make_key('hi', 'my', 'firend', sep='i')
    >>> 'hiimyifirend'

    >>> make_key('hi', 'my', 'firend',['this', 'be', 'what'], sep='i')
    >>> 'hiimyifirendithisibeiwhat'

    >>> make_key('hi', 'my', 'firend',['this', 'be', 'what'])
    >>> u'hi_my_firend_this_be_what'

Given any number of lists and strings will join them in order as one string separated by the sep kwarg . sep defaults to u _ .


def Func ( arg_0 ) : try : return arg_0 . get_argument ( constants . PARAM_ROLE , default = None ) except tornado . web . MissingArgumentError as e : raise Exception ( e . log_message )

def Func(arg_0):
    """
    Helper function to get request argument.
    Raises exception if argument is missing.
    Returns the role argument.
    """
    try:
      return arg_0.get_argument(constants.PARAM_ROLE, default=None)
    except tornado.web.MissingArgumentError as e:
      raise Exception(e.log_message)

Helper function to get request argument . Raises exception if argument is missing . Returns the role argument .


def Func ( arg_0 , arg_1 ) : arg_0 = [ arg_6 for arg_6 in arg_0 if isinstance ( arg_6 , pyflakes . messages . MultiValueRepeatedKeyLiteral ) ] if arg_0 : arg_2 = create_key_to_messages_dict ( arg_0 ) arg_3 = arg_1 . split ( '\n' ) for ( arg_4 , arg_0 ) in arg_2 . items ( ) : arg_5 = True for arg_6 in arg_0 : arg_7 = arg_3 [ arg_6 . lineno - 1 ] arg_4 = arg_6 . message_args [ 0 ] if not dict_entry_has_key ( arg_7 , arg_4 ) : arg_5 = False if arg_5 : for arg_6 in arg_0 : yield arg_6 . lineno

def Func(arg_0, arg_1):
    """Yield line numbers of duplicate keys."""
    arg_0 = [
        arg_6 for arg_6 in arg_0
        if isinstance(arg_6, pyflakes.messages.MultiValueRepeatedKeyLiteral)]

    if arg_0:
        # Filter out complex cases. We don't want to bother trying to parse
        # this stuff and get it right. We can do it on a key-by-key basis.

        arg_2 = create_key_to_messages_dict(arg_0)

        arg_3 = arg_1.split('\n')

        for (arg_4, arg_0) in arg_2.items():
            arg_5 = True
            for arg_6 in arg_0:
                arg_7 = arg_3[arg_6.lineno - 1]
                arg_4 = arg_6.message_args[0]

                if not dict_entry_has_key(arg_7, arg_4):
                    arg_5 = False

            if arg_5:
                for arg_6 in arg_0:
                    yield arg_6.lineno


(
        use_saved_state=None,
        lightcurve_list=None,
        input_queue=None,
        input_bucket=None,
        result_queue=None,
        result_bucket=None,
        pfresult_list=None,
        runcp_kwargs=None,
        process_list_slice=None,
        download_when_done=True,
        purge_queues_when_done=True,
        save_state_when_done=True,
        delete_queues_when_done=False,
        s3_client=None,
        sqs_client=None
)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = True , arg_10 = True , arg_11 = True , arg_12 = False , arg_13 = None , arg_14 = None ) : if arg_0 is not None and os . path . exists ( arg_0 ) : with open ( arg_0 , 'rb' ) as infd : arg_15 = pickle . load ( infd ) return runcp_producer_loop ( arg_15 [ 'in_progress' ] , arg_15 [ 'args' ] [ 1 ] , arg_15 [ 'args' ] [ 2 ] , arg_15 [ 'args' ] [ 3 ] , arg_15 [ 'args' ] [ 4 ] , ** arg_15 [ 'kwargs' ] ) else : return runcp_producer_loop ( arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 , arg_11 = arg_11 , arg_12 = arg_12 , arg_13 = arg_13 , arg_14 = arg_14 )

def Func(
        arg_0=None,
        arg_1=None,
        arg_2=None,
        arg_3=None,
        arg_4=None,
        arg_5=None,
        arg_6=None,
        arg_7=None,
        arg_8=None,
        arg_9=True,
        arg_10=True,
        arg_11=True,
        arg_12=False,
        arg_13=None,
        arg_14=None
):
    """This wraps the function above to allow for loading previous state from a
    file.

    Parameters
    ----------

    use_saved_state : str or None
        This is the path to the saved state pickle file produced by a previous
        run of `runcp_producer_loop`. Will get all of the arguments to run
        another instance of the loop from that pickle file. If this is None, you
        MUST provide all of the appropriate arguments to that function.

    lightcurve_list : str or list of str or None
        This is either a string pointing to a file containing a list of light
        curves filenames to process or the list itself. The names must
        correspond to the full filenames of files stored on S3, including all
        prefixes, but not include the 's3://<bucket name>/' bit (these will be
        added automatically).

    input_queue : str or None
        This is the name of the SQS queue which will receive processing tasks
        generated by this function. The queue URL will automatically be obtained
        from AWS.

    input_bucket : str or None
        The name of the S3 bucket containing the light curve files to process.

    result_queue : str or None
        This is the name of the SQS queue that this function will listen to for
        messages from the workers as they complete processing on their input
        elements. This function will attempt to match input sent to the
        `input_queue` with results coming into the `result_queue` so it knows
        how many objects have been successfully processed. If this function
        receives task results that aren't in its own input queue, it will
        acknowledge them so they complete successfully, but not download them
        automatically. This handles leftover tasks completing from a previous
        run of this function.

    result_bucket : str or None
        The name of the S3 bucket which will receive the results from the
        workers.

    pfresult_list : list of str or None
        This is a list of periodfinder result pickle S3 URLs associated with
        each light curve. If provided, this will be used to add in phased light
        curve plots to each checkplot pickle. If this is None, the worker loop
        will produce checkplot pickles that only contain object information,
        neighbor information, and unphased light curves.

    runcp_kwargs : dict or None
        This is a dict used to pass any extra keyword arguments to the
        `lcproc.checkplotgen.runcp` function that will be run by the worker
        loop.

    process_list_slice : list or None
        This is used to index into the input light curve list so a subset of the
        full list can be processed in this specific run of this function.

        Use None for a slice index elem to emulate single slice spec behavior:

        process_list_slice = [10, None]  -> lightcurve_list[10:]
        process_list_slice = [None, 500] -> lightcurve_list[:500]

    purge_queues_when_done : bool or None
        If this is True, and this function exits (either when all done, or when
        it is interrupted with a Ctrl+C), all outstanding elements in the
        input/output queues that have not yet been acknowledged by workers or by
        this function will be purged. This effectively cancels all outstanding
        work.

    delete_queues_when_done : bool or None
        If this is True, and this function exits (either when all done, or when
        it is interrupted with a Ctrl+C'), all outstanding work items will be
        purged from the input/queues and the queues themselves will be deleted.

    download_when_done : bool or None
        If this is True, the generated checkplot pickle for each input work item
        will be downloaded immediately to the current working directory when the
        worker functions report they're done with it.

    save_state_when_done : bool or None
        If this is True, will save the current state of the work item queue and
        the work items acknowledged as completed to a pickle in the current
        working directory. Call the `Func` function
        below to resume processing from this saved state later.

    s3_client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its S3 download operations. Alternatively, pass in an existing
        `boto3.Client` instance to re-use it here.

    sqs_client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its SQS operations. Alternatively, pass in an existing
        `boto3.Client` instance to re-use it here.

    Returns
    -------

    dict or str
        Returns the current work state as a dict or str path to the generated
        work state pickle depending on if `save_state_when_done` is True.

    """

    if arg_0 is not None and os.path.exists(arg_0):

        with open(arg_0,'rb') as infd:
            arg_15 = pickle.load(infd)

        # run the producer loop using the saved state's todo list
        return runcp_producer_loop(
            arg_15['in_progress'],
            arg_15['args'][1],
            arg_15['args'][2],
            arg_15['args'][3],
            arg_15['args'][4],
            **arg_15['kwargs']
        )

    else:

        return runcp_producer_loop(
            arg_1,
            arg_2,
            arg_3,
            arg_4,
            arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_8=arg_8,
            arg_9=arg_9,
            arg_10=arg_10,
            arg_11=arg_11,
            arg_12=arg_12,
            arg_13=arg_13,
            arg_14=arg_14
        )

This wraps the function above to allow for loading previous state from a
    file.

    Parameters
    ----------

    use_saved_state : str or None
        This is the path to the saved state pickle file produced by a previous
        run of `runcp_producer_loop`. Will get all of the arguments to run
        another instance of the loop from that pickle file. If this is None, you
        MUST provide all of the appropriate arguments to that function.

    lightcurve_list : str or list of str or None
        This is either a string pointing to a file containing a list of light
        curves filenames to process or the list itself. The names must
        correspond to the full filenames of files stored on S3, including all
        prefixes, but not include the 's3://<bucket name>/' bit (these will be
        added automatically).

    input_queue : str or None
        This is the name of the SQS queue which will receive processing tasks
        generated by this function. The queue URL will automatically be obtained
        from AWS.

    input_bucket : str or None
        The name of the S3 bucket containing the light curve files to process.

    result_queue : str or None
        This is the name of the SQS queue that this function will listen to for
        messages from the workers as they complete processing on their input
        elements. This function will attempt to match input sent to the
        `input_queue` with results coming into the `result_queue` so it knows
        how many objects have been successfully processed. If this function
        receives task results that aren't in its own input queue, it will
        acknowledge them so they complete successfully, but not download them
        automatically. This handles leftover tasks completing from a previous
        run of this function.

    result_bucket : str or None
        The name of the S3 bucket which will receive the results from the
        workers.

    pfresult_list : list of str or None
        This is a list of periodfinder result pickle S3 URLs associated with
        each light curve. If provided, this will be used to add in phased light
        curve plots to each checkplot pickle. If this is None, the worker loop
        will produce checkplot pickles that only contain object information,
        neighbor information, and unphased light curves.

    runcp_kwargs : dict or None
        This is a dict used to pass any extra keyword arguments to the
        `lcproc.checkplotgen.runcp` function that will be run by the worker
        loop.

    process_list_slice : list or None
        This is used to index into the input light curve list so a subset of the
        full list can be processed in this specific run of this function.

        Use None for a slice index elem to emulate single slice spec behavior:

        process_list_slice = [10, None]  -> lightcurve_list[10:]
        process_list_slice = [None, 500] -> lightcurve_list[:500]

    purge_queues_when_done : bool or None
        If this is True, and this function exits (either when all done, or when
        it is interrupted with a Ctrl+C), all outstanding elements in the
        input/output queues that have not yet been acknowledged by workers or by
        this function will be purged. This effectively cancels all outstanding
        work.

    delete_queues_when_done : bool or None
        If this is True, and this function exits (either when all done, or when
        it is interrupted with a Ctrl+C'), all outstanding work items will be
        purged from the input/queues and the queues themselves will be deleted.

    download_when_done : bool or None
        If this is True, the generated checkplot pickle for each input work item
        will be downloaded immediately to the current working directory when the
        worker functions report they're done with it.

    save_state_when_done : bool or None
        If this is True, will save the current state of the work item queue and
        the work items acknowledged as completed to a pickle in the current
        working directory. Call the `runcp_producer_loop_savedstate` function
        below to resume processing from this saved state later.

    s3_client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its S3 download operations. Alternatively, pass in an existing
        `boto3.Client` instance to re-use it here.

    sqs_client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its SQS operations. Alternatively, pass in an existing
        `boto3.Client` instance to re-use it here.

    Returns
    -------

    dict or str
        Returns the current work state as a dict or str path to the generated
        work state pickle depending on if `save_state_when_done` is True.

This wraps the function above to allow for loading previous state from a file .


def
Func
(
arg_0
)
:
if
arg_0
in
arg_2
:
return
arg_2
[
arg_0
]
arg_1
=
subprocess
.
check_output
(
'which {}'
.
format
(
arg_0
)
,
shell
=
True
)
arg_2
[
arg_0
]
=
arg_1
.
decode
(
"utf-8"
)
.
strip
(
)
return
arg_2
[
arg_0
]

def Func(arg_0):
    """Queries bash to find the path to a commmand on the system."""
    if arg_0 in arg_2:
        return arg_2[arg_0]
    arg_1 = subprocess.check_output('which {}'.format(arg_0), shell=True)
    arg_2[arg_0] = arg_1.decode("utf-8").strip()
    return arg_2[arg_0]

Queries bash to find the path to a commmand on the system .


return [{
            'providerID': self.enterprise_configuration.provider_id,
            'launchURL': content_metadata_item['enrollment_url'],
            'contentTitle': content_metadata_item['title'],
            'contentID': self.get_content_id(content_metadata_item),
            'launchType': 3,  # This tells SAPSF to launch the course in a new browser window.
            'mobileEnabled': True,  # Always return True per ENT-1401
            'mobileLaunchURL': content_metadata_item['enrollment_url'],
        }]

def Func ( arg_0 , arg_1 ) : return [ { 'providerID' : arg_0 . enterprise_configuration . provider_id , 'launchURL' : arg_1 [ 'enrollment_url' ] , 'contentTitle' : arg_1 [ 'title' ] , 'contentID' : arg_0 . get_content_id ( arg_1 ) , 'launchType' : 3 , 'mobileEnabled' : True , 'mobileLaunchURL' : arg_1 [ 'enrollment_url' ] , } ]

def Func(arg_0, arg_1):
        """
        Return the content metadata item launch points.

        SAPSF allows you to transmit an arry of content launch points which
        are meant to represent sections of a content item which a learner can
        launch into from SAPSF. Currently, we only provide a single launch
        point for a content item.
        """
        return [{
            'providerID': arg_0.enterprise_configuration.provider_id,
            'launchURL': arg_1['enrollment_url'],
            'contentTitle': arg_1['title'],
            'contentID': arg_0.get_content_id(arg_1),
            'launchType': 3,  # This tells SAPSF to launch the course in a new browser window.
            'mobileEnabled': True,  # Always return True per ENT-1401
            'mobileLaunchURL': arg_1['enrollment_url'],
        }]

Return the content metadata item launch points .


def Func ( arg_0 , arg_1 ) : if not arg_1 : return if not db_loaded : load_db ( ) arg_2 = arg_1 . session . get ( 'django_timezone' ) if not arg_2 : arg_2 = timezone . get_default_timezone ( ) arg_3 = get_ip_address_from_request ( arg_1 ) arg_4 = arg_3 . split ( ',' ) for arg_5 in arg_4 : if is_valid_ip ( arg_5 ) and not is_local_ip ( arg_5 ) : if ':' in arg_5 : arg_2 = db_v6 . time_zone_by_addr ( arg_5 ) break else : arg_2 = db . time_zone_by_addr ( arg_5 ) break if arg_2 : timezone . activate ( arg_2 ) arg_1 . session [ 'django_timezone' ] = str ( arg_2 ) if getattr ( settings , 'AUTH_USER_MODEL' , None ) and getattr ( arg_1 , 'user' , None ) : detected_timezone . send ( sender = get_user_model ( ) , instance = arg_1 . user , timezone = arg_2 ) else : timezone . deactivate ( )

def Func(arg_0, arg_1):
        """
        If we can get a valid IP from the request,
        look up that address in the database to get the appropriate timezone
        and activate it.

        Else, use the default.

        """

        if not arg_1:
            return

        if not db_loaded:
            load_db()

        arg_2 = arg_1.session.get('django_timezone')

        if not arg_2:
            # use the default timezone (settings.TIME_ZONE) for localhost
            arg_2 = timezone.get_default_timezone()

            arg_3 = get_ip_address_from_request(arg_1)
            arg_4 = arg_3.split(',')
            for arg_5 in arg_4:
                if is_valid_ip(arg_5) and not is_local_ip(arg_5):
                    if ':' in arg_5:
                        arg_2 = db_v6.time_zone_by_addr(arg_5)
                        break
                    else:
                        arg_2 = db.time_zone_by_addr(arg_5)
                        break

        if arg_2:
            timezone.activate(arg_2)
            arg_1.session['django_timezone'] = str(arg_2)
            if getattr(settings, 'AUTH_USER_MODEL', None) and getattr(arg_1, 'user', None):
                detected_timezone.send(sender=get_user_model(), instance=arg_1.user, timezone=arg_2)
        else:
            timezone.deactivate()

If we can get a valid IP from the request look up that address in the database to get the appropriate timezone and activate it .


(self, key, df, range_values, loop_multiindex=False,
                          unstack=False, fill_value=0, fill_method=None)

return self._push_dfblock(key, vals, ds_name, range_values)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=False,
                          arg_5=False, arg_6=0, arg_7=None):
        """Returns a PyTables HDF Array from df in the shape given by its index columns range values.

        :param key: string object

        :param df: pandas DataFrame

        :param range_values: dict or array-like
        Must contain for each index column of df an entry with all the values
        within the range of the column.

        :param loop_multiindex: bool
        Will loop through the first index in a multiindex dataframe, extract a
        dataframe only for one value, complete and fill the missing values and
        store in the HDF.
        If this is True, it will not use unstack.
        This is as fast as unstacking.

        :param unstack: bool
        Unstack means that this will use the first index name to
        unfold the DataFrame, and will create a group with as many datasets
        as valus has this first index.
        Use this if you think the filled dataframe won't fit in your RAM memory.
        If set to False, this will transform the dataframe in memory first
        and only then save it.

        :param fill_value: scalar or 'nearest', default 0
        Value to use for missing values. Defaults to 0, but can be any
        "compatible" value, e.g., NaN.
        The 'nearest' mode will fill the missing value with the nearest value in
         the column.

        :param fill_method:  {'backfill', 'bfill', 'pad', 'ffill', None}, default None
        Method to use for filling holes in reindexed DataFrame
        'pad' / 'ffill': propagate last valid observation forward to next valid
        'backfill' / 'bfill': use NEXT valid observation to fill gap

        :return: PyTables data node
        """
        arg_8 = arg_2.index.names
        #idx_colranges = [range_values[x] for x in idx_colnames]

        #dataset group name if not given
        if arg_1 is None:
            arg_1 = arg_8[0]

        if arg_4:
            arg_9 = arg_2.index.get_level_values(0).unique()

            for arg_10 in arg_9:
                arg_11, arg_12 = arg_0._fill_missing_values(arg_2.xs((arg_10,), level=arg_8[0]),
                                                    arg_3,
                                                    arg_6=arg_6,
                                                    arg_7=arg_7)

                arg_13 = str(arg_10) + '_' + '_'.join(arg_11.columns)

                arg_0._push_dfblock(arg_1, arg_11, arg_13, arg_3)

            return arg_0._handle.get_node('/' + str(arg_1))

        #separate the dataframe into blocks, only with the first index
        else:
            if arg_5:
                arg_2 = arg_2.unstack(arg_8[0])
                for arg_10 in arg_2:
                    arg_11, arg_12 = arg_0._fill_missing_values(arg_2[arg_10], arg_3,
                                                        arg_6=arg_6,
                                                        arg_7=arg_7)
                    arg_11 = np.nan_to_num(arg_11)

                    arg_13 = '_'.join([str(x) for x in arg_11.name])

                    arg_0._push_dfblock(arg_1, arg_11, arg_13, arg_3)

                return arg_0._handle.get_node('/' + str(arg_1))

        #not separate the data
        arg_11, arg_12 = arg_0._fill_missing_values(arg_2, arg_3,
                                            arg_6=arg_6,
                                            arg_7=arg_7)

        arg_13 = arg_0._array_dsname

        return arg_0._push_dfblock(arg_1, arg_11, arg_13, arg_3)

Returns a PyTables HDF Array from df in the shape given by its index columns range values .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
has_output
if
arg_2
<=
0
:
return
arg_2
arg_3
=
arg_0
.
output_data
(
)
if
not
arg_3
:
return
Connection
.
EOS
while
True
:
try
:
arg_2
=
arg_1
.
send
(
arg_3
)
break
except
socket
.
timeout
as
e
:
LOG
.
debug
(
"Socket timeout exception %s"
,
str
(
e
)
)
raise
except
socket
.
error
as
e
:
arg_4
=
e
.
errno
if
arg_4
in
[
errno
.
EAGAIN
,
errno
.
EWOULDBLOCK
,
errno
.
EINTR
]
:
return
0
LOG
.
debug
(
"Socket error exception %s"
,
str
(
e
)
)
raise
except
Exception
as
e
:
LOG
.
debug
(
"unknown socket exception %s"
,
str
(
e
)
)
raise
if
arg_2
>
0
:
arg_0
.
output_written
(
arg_2
)
elif
arg_3
:
LOG
.
debug
(
"Socket closed"
)
arg_2
=
Connection
.
EOS
arg_0
.
close_output
(
)
arg_0
.
close_input
(
)
return
arg_2

def Func(arg_0, arg_1):
    """Write data to the network layer.  Can support both blocking and
    non-blocking sockets.
    Returns the number of output bytes sent, or EOS if output processing
    is done.  Any exceptions raised by the socket are re-raised.
    """
    arg_2 = arg_0.has_output
    if arg_2 <= 0:
        return arg_2  # 0 or EOS

    arg_3 = arg_0.output_data()
    if not arg_3:
        # error - has_output > 0, but no data?
        return Connection.EOS

    while True:
        try:
            arg_2 = arg_1.send(arg_3)
            break
        except socket.timeout as e:
            LOG.debug("Socket timeout exception %s", str(e))
            raise  # caller must handle
        except socket.error as e:
            arg_4 = e.errno
            if arg_4 in [errno.EAGAIN,
                       errno.EWOULDBLOCK,
                       errno.EINTR]:
                # try again later
                return 0
            # else assume fatal let caller handle it:
            LOG.debug("Socket error exception %s", str(e))
            raise
        except Exception as e:  # beats me... assume fatal
            LOG.debug("unknown socket exception %s", str(e))
            raise

    if arg_2 > 0:
        arg_0.output_written(arg_2)
    elif arg_3:
        LOG.debug("Socket closed")
        arg_2 = Connection.EOS
        arg_0.close_output()
        arg_0.close_input()
    return arg_2

Write data to the network layer . Can support both blocking and non - blocking sockets . Returns the number of output bytes sent or EOS if output processing is done . Any exceptions raised by the socket are re - raised .


def Func ( * arg_0 ) : for arg_1 , arg_2 in zip ( arg_0 [ : - 1 ] , arg_0 [ 1 : ] ) : arg_1 . set_downstream ( arg_2 )

def Func(*arg_0):
    """
    Given a number of tasks, builds a dependency Func.

    Func(task_1, task_2, task_3, task_4)

    is equivalent to

    task_1.set_downstream(task_2)
    task_2.set_downstream(task_3)
    task_3.set_downstream(task_4)
    """
    for arg_1, arg_2 in zip(arg_0[:-1], arg_0[1:]):
        arg_1.set_downstream(arg_2)

Given a number of tasks, builds a dependency chain.

    chain(task_1, task_2, task_3, task_4)

    is equivalent to

    task_1.set_downstream(task_2)
    task_2.set_downstream(task_3)
    task_3.set_downstream(task_4)

Given a number of tasks builds a dependency chain .


def Func ( arg_0 ) : from . import types arg_1 = types . get ( arg_0 . task_type . split ( '.' ) [ 1 ] ) return arg_1 . retrieve ( arg_0 . task_id , client = arg_0 . _client )

def Func(arg_0):
        """ Get Task child object class """
        from . import types
        arg_1 = types.get(arg_0.task_type.split('.')[1])
        return arg_1.retrieve(arg_0.task_id, client=arg_0._client)


(series, ndigits=None, left=False, right=False)

def Func(arg_0, arg_1=None, arg_2=False, arg_3=False):
    """Count cycles in the series.

    Parameters
    ----------
    series : iterable sequence of numbers
    ndigits : int, optional
        Round cycle magnitudes to the given number of digits before counting.
    left: bool, optional
        If True, treat the first point in the series as a reversal.
    right: bool, optional
        If True, treat the last point in the series as a reversal.

    Returns
    -------
    A sorted list containing pairs of cycle magnitude and count.
    One-half cycles are counted as 0.5, so the returned counts may not be
    whole numbers.
    """
    arg_4 = defaultdict(float)
    arg_5 = _get_round_function(arg_1)

    for arg_6, arg_7, arg_8 in extract_cycles(arg_0, arg_2=arg_2, arg_3=arg_3):
        arg_9 = arg_5(abs(arg_7 - arg_6))
        arg_4[arg_9] += arg_8
    return sorted(arg_4.items())


(state, value_and_gradients_function, search_direction,
                     grad_tolerance, f_relative_tolerance, x_tolerance,
                     stopping_condition)

return prefer_static.cond(
      stopping_condition(state.converged, state.failed),
      true_fn=lambda: state_after_ls,
      false_fn=_do_update_position)

def Func(arg_0, arg_1, arg_2,
                     arg_3, arg_4, arg_5,
                     arg_6):
  """Performs the line search step of the BFGS search procedure.

  Uses hager_zhang line search procedure to compute a suitable step size
  to advance the current `state.position` along the given `search_direction`.
  Also, if the line search is successful, updates the `state.position` by
  taking the corresponding step.

  Args:
    state: A namedtuple instance holding values for the current state of the
      search procedure. The state must include the fields: `position`,
      `objective_value`, `objective_gradient`, `num_iterations`,
      `num_objective_evaluations`, `converged` and `failed`.
    value_and_gradients_function: A Python callable that accepts a point as a
      real `Tensor` of shape `[..., n]` and returns a tuple of two tensors of
      the same dtype: the objective function value, a real `Tensor` of shape
      `[...]`, and its derivative, another real `Tensor` of shape `[..., n]`.
    search_direction: A real `Tensor` of shape `[..., n]`. The direction along
      which to perform line search.
    grad_tolerance: Scalar `Tensor` of real dtype. Specifies the gradient
      tolerance for the procedure.
    f_relative_tolerance: Scalar `Tensor` of real dtype. Specifies the
      tolerance for the relative change in the objective value.
    x_tolerance: Scalar `Tensor` of real dtype. Specifies the tolerance for the
      change in the position.
    stopping_condition: A Python function that takes as input two Boolean
      tensors of shape `[...]`, and returns a Boolean scalar tensor. The input
      tensors are `converged` and `failed`, indicating the current status of
      each respective batch member; the return value states whether the
      algorithm should stop.
  Returns:
    A copy of the input state with the following fields updated:
      converged: a Boolean `Tensor` of shape `[...]` indicating whether the
        convergence criteria has been met.
      failed: a Boolean `Tensor` of shape `[...]` indicating whether the line
        search procedure failed to converge, or if either the updated gradient
        or objective function are no longer finite.
      num_iterations: Increased by 1.
      num_objective_evaluations: Increased by the number of times that the
        objective function got evaluated.
      position, objective_value, objective_gradient: If line search succeeded,
        updated by computing the new position and evaluating the objective
        function at that position.
  """
  arg_7 = _restrict_along_direction(
      arg_1, arg_0.position, arg_2)
  arg_8 = tf.reduce_sum(
      input_tensor=arg_0.objective_gradient * arg_2, axis=-1)
  arg_9 = ValueAndGradient(x=_broadcast(0, arg_0.position),
                           f=arg_0.objective_value,
                           df=arg_8,
                           full_gradient=arg_0.objective_gradient)
  arg_10 = arg_0.failed | arg_0.converged
  arg_11 = linesearch.hager_zhang(
      arg_7,
      initial_step_size=_broadcast(1, arg_0.position),
      value_at_zero=arg_9,
      converged=arg_10)  # No search needed for these.

  arg_12 = update_fields(
      arg_0,
      failed=arg_0.failed | ~arg_11.converged,
      num_iterations=arg_0.num_iterations + 1,
      num_objective_evaluations=(
          arg_0.num_objective_evaluations + arg_11.func_evals))

  def _do_update_position():
    # For inactive batch members `left.x` is zero. However, their
    # `search_direction` might also be undefined, so we can't rely on
    # multiplication by zero to produce a `position_delta` of zero.
    arg_13 = tf.where(
        arg_10,
        tf.zeros_like(arg_2),
        arg_2 * tf.expand_dims(arg_11.left.x, axis=-1))
    return _update_position(
        arg_12,
        arg_13,
        arg_11.left.f,
        arg_11.left.full_gradient,
        arg_3, arg_4, arg_5)

  return prefer_static.cond(
      arg_6(arg_0.converged, arg_0.failed),
      true_fn=lambda: arg_12,
      false_fn=_do_update_position)

Performs the line search step of the BFGS search procedure .


def Func ( arg_0 ) : arg_1 = arg_0 . _rdd . map ( lambda x : x . Func ( ) ) return np . concatenate ( arg_1 . collect ( ) )

def Func(arg_0):
        """Returns the data as numpy.array from each partition."""
        arg_1 = arg_0._rdd.map(lambda x: x.Func())
        return np.concatenate(arg_1.collect())

Returns the data as numpy . array from each partition .


def Func ( arg_0 , arg_1 ) : arg_0 . _C0 . Func ( arg_1 ) arg_0 . _C1 . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        Listen to parameters change.

        Parameters
        ----------
        func : callable
            Function to be called when a parameter changes.
        """
        arg_0._C0.Func(arg_1)
        arg_0._C1.Func(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
if
not
all
(
isinstance
(
arg_2
,
tuple
)
and
isinstance
(
arg_2
[
0
]
,
QuantumRegister
)
and
isinstance
(
arg_2
[
1
]
,
int
)
for
arg_2
in
arg_1
)
:
raise
QiskitError
(
"qarg not (QuantumRegister, int) tuple"
)
if
not
all
(
arg_0
.
has_register
(
arg_2
[
0
]
)
for
arg_2
in
arg_1
)
:
raise
QiskitError
(
"register not in this circuit"
)
for
arg_3
in
arg_1
:
arg_3
[
0
]
.
check_range
(
arg_3
[
1
]
)

def Func(arg_0, arg_1):
        """Raise exception if a qarg is not in this circuit or bad format."""
        if not all(isinstance(arg_2, tuple) and
                   isinstance(arg_2[0], QuantumRegister) and
                   isinstance(arg_2[1], int) for arg_2 in arg_1):
            raise QiskitError("qarg not (QuantumRegister, int) tuple")
        if not all(arg_0.has_register(arg_2[0]) for arg_2 in arg_1):
            raise QiskitError("register not in this circuit")
        for arg_3 in arg_1:
            arg_3[0].check_range(arg_3[1])

Raise exception if a qarg is not in this circuit or bad format .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . serializers . get ( arg_1 , None ) if arg_3 is None : return arg_4 = arg_3 . get_id ( arg_2 ) if arg_1 not in arg_0 . ids : arg_0 . ids [ arg_1 ] = [ ] arg_0 . ids [ arg_1 ] . append ( arg_4 )

def Func(arg_0, arg_1, arg_2):
        """Queue an instance to be fetched from the database."""

        arg_3 = arg_0.serializers.get(arg_1, None)

        if arg_3 is None:
            return

        arg_4 = arg_3.get_id(arg_2)

        if arg_1 not in arg_0.ids:
            arg_0.ids[arg_1] = []

        arg_0.ids[arg_1].append(arg_4)

Queue an instance to be fetched from the database .


def Func(arg_0, arg_1):
    """Use the access token to get session cookies.

    Raises GoogleAuthError if session cookies could not be loaded.

    Returns dict of cookies.
    """
    arg_2 = {'Authorization': 'Bearer {}'.format(arg_1)}

    try:
        arg_3 = arg_0.get(('https://accounts.google.com/accounts/OAuthLogin'
                         '?source=hangups&issueuberauth=1'), arg_2=arg_2)
        arg_3.raise_for_status()
    except requests.RequestException as e:
        raise GoogleAuthError('OAuthLogin request failed: {}'.format(e))
    arg_4 = arg_3.text

    try:
        arg_3 = arg_0.get(('https://accounts.google.com/MergeSession?'
                         'service=mail&'
                         'continue=http://www.google.com&uberauth={}')
                        .format(arg_4), arg_2=arg_2)
        arg_3.raise_for_status()
    except requests.RequestException as e:
        raise GoogleAuthError('MergeSession request failed: {}'.format(e))

    arg_5 = arg_0.cookies.get_dict(domain='.google.com')
    if arg_5 == {}:
        raise GoogleAuthError('Failed to find session cookies')
    return arg_5

Use the access token to get session cookies .


(
            self, topic_name, subscription_name,
            lock_duration=30, requires_session=None,
            default_message_time_to_live=None,
            dead_lettering_on_message_expiration=None,
            dead_lettering_on_filter_evaluation_exceptions=None,
            enable_batched_operations=None, max_delivery_count=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
30
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
,
arg_8
=
,
arg_9
=
)
:
arg_10
=
Subscription
(
arg_3
=
"PT{}S"
.
format
(
int
(
arg_3
)
)
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_9
=
arg_9
,
arg_8
=
arg_8
)
try
:
return
arg_0
.
mgmt_client
.
Func
(
arg_1
,
arg_2
,
subscription
=
arg_10
,
fail_on_exist
=
True
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
raise
ServiceBusConnectionError
(
"Namespace: {} not found"
.
format
(
arg_0
.
service_namespace
)
,
e
)

def Func(
            arg_0, arg_1, arg_2,
            arg_3=30, arg_4=None,
            arg_5=None,
            arg_6=None,
            arg_7=None,
            arg_8=None, arg_9=None):
        """Create a subscription entity.

        :param topic_name: The name of the topic under which to create the subscription.
        :param subscription_name: The name of the new subscription.
        :type subscription_name: str
        :param lock_duration: The lock durection in seconds for each message in the subscription.
        :type lock_duration: int
        :param requires_session: Whether the subscription will be sessionful, and therefore require all
         message to have a Session ID and be received by a sessionful receiver.
         Default value is False.
        :type requires_session: bool
        :param default_message_time_to_live: The length of time a message will remain in the subscription
         before it is either discarded or moved to the dead letter queue.
        :type default_message_time_to_live: ~datetime.timedelta
        :param dead_lettering_on_message_expiration: Whether to move expired messages to the
         dead letter queue. Default value is False.
        :type dead_lettering_on_message_expiration: bool
        :param dead_lettering_on_filter_evaluation_exceptions: Whether to move messages that error on
         filtering into the dead letter queue. Default is False, and the messages will be discarded.
        :type dead_lettering_on_filter_evaluation_exceptions: bool
        :param max_delivery_count: The maximum number of times a message will attempt to be delivered
         before it is moved to the dead letter queue.
        :type max_delivery_count: int
        :param enable_batched_operations:
        :type: enable_batched_operations: bool
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namespace is not found.
        :raises: ~azure.common.AzureConflictHttpError if a queue of the same name already exists.
        """
        arg_10 = Subscription(
            arg_3="PT{}S".format(int(arg_3)),
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            arg_9=arg_9,
            arg_8=arg_8)
        try:
            return arg_0.mgmt_client.Func(
                arg_1, arg_2,
                subscription=arg_10, fail_on_exist=True)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)


def Func(arg_0, arg_1=None):
        """
        vfuncs can be any callable that accepts a single argument, the
        Variable object, and returns a dictionary of new attributes to
        set. These will overwrite existing attributes
        """

        arg_1 = arg_1 or []

        arg_2 = {'global': {}}

        for arg_3 in arg_0.ncattrs():
            arg_2['global'][arg_3] = arg_0.getncattr(arg_3)

        for arg_4, arg_5 in arg_0.variables.items():
            arg_2[arg_4] = {}
            for arg_3 in arg_5.ncattrs():
                arg_6 = arg_5.getncattr(arg_3)
                try:
                    assert not np.isnan(arg_6).all()
                    arg_2[arg_4][arg_3] = arg_6
                except AssertionError:
                    arg_2[arg_4][arg_3] = None
                except TypeError:
                    arg_2[arg_4][arg_3] = arg_6

            for arg_7 in arg_1:
                try:
                    arg_2[arg_4].update(arg_1(arg_5))
                except BaseException:
                    logger.exception("Could not apply custom variable attribue function")

        return json.loads(json.dumps(arg_2, cls=BasicNumpyEncoder))

vfuncs can be any callable that accepts a single argument the Variable object and returns a dictionary of new attributes to set . These will overwrite existing attributes


return DataSharingConsent.objects.proxied_get(
        username=username,
        course_id=course_id,
        enterprise_customer__uuid=enterprise_customer_uuid
    )

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = apps . get_model ( 'consent' , 'DataSharingConsent' ) return arg_3 . objects . proxied_get ( arg_0 = arg_0 , arg_1 = arg_1 , enterprise_customer__uuid = arg_2 )

def Func(arg_0, arg_1, arg_2):
    """
    Get the data sharing consent object associated with a certain user of a customer for a course.

    :param username: The user that grants consent.
    :param course_id: The course for which consent is granted.
    :param enterprise_customer_uuid: The consent requester.
    :return: The data sharing consent object
    """
    # Prevent circular imports.
    arg_3 = apps.get_model('consent', 'DataSharingConsent')  # pylint: disable=invalid-name
    return arg_3.objects.proxied_get(
        arg_0=arg_0,
        arg_1=arg_1,
        enterprise_customer__uuid=arg_2
    )

Get the data sharing consent object associated with a certain user of a customer for a course .


def
Func
(
arg_0
)
:
def
timed
(
*
arg_1
,
**
arg_2
)
:
arg_3
=
time
.
time
(
)
arg_4
=
arg_0
(
*
arg_1
,
**
arg_2
)
arg_5
=
time
.
time
(
)
print
(
'Func: %r %2.2f sec (%r, %r) '
%
(
arg_0
.
__name__
,
arg_5
arg_3
,
str
(
arg_1
)
[
:
20
]
,
arg_2
)
)
return
arg_4
return
timed

def Func(arg_0):
    """
    A Python decorator for printing out the execution time for a function.

    Adapted from:
    www.andreas-jung.com/contents/a-python-decorator-for-measuring-the-execution-time-of-methods
    """
    def timed(*arg_1, **arg_2):
        arg_3 = time.time()
        arg_4 = arg_0(*arg_1, **arg_2)
        arg_5 = time.time()
        print('Func: %r %2.2f sec (%r, %r) ' % (arg_0.__name__, arg_5-arg_3, str(arg_1)[:20], arg_2))
        return arg_4

    return timed

A Python decorator for printing out the execution time for a function .


(self,
                              tops,
                              values,
                              basis,
                              components,
                              field=None,
                              ignore_nan=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = None , arg_6 = True ) : arg_7 = float ( arg_3 . size ) arg_8 , arg_9 = arg_3 [ 0 ] , arg_3 [ - 1 ] arg_1 = [ arg_8 + ( p / ( arg_7 - 1 ) ) * ( arg_9 - arg_8 ) for p in arg_1 ] arg_10 = arg_1 [ 1 : ] + [ arg_9 ] arg_11 = [ ] for arg_12 , arg_13 in enumerate ( arg_1 ) : arg_14 , arg_15 , arg_16 = arg_2 [ arg_12 ] , [ ] , { } if arg_6 and np . isnan ( arg_14 ) : continue if ( arg_5 is not None ) : arg_16 = { arg_5 : arg_14 } if arg_4 is not None : try : arg_15 = [ deepcopy ( arg_4 [ int ( arg_14 ) ] ) ] except IndexError : arg_15 = [ ] if arg_15 and ( arg_15 [ 0 ] is None ) : arg_15 = [ ] arg_17 = Interval ( arg_13 , arg_10 [ arg_12 ] , data = arg_16 , arg_4 = arg_15 ) arg_11 . append ( arg_17 ) return arg_11

def Func(arg_0,
                              arg_1,
                              arg_2,
                              arg_3,
                              arg_4,
                              arg_5=None,
                              arg_6=True):
        """
        Private method. Take a sequence of tops in an arbitrary dimension,
        and provide a list of intervals from which a striplog can be made.

        This is only intended to be used by ``from_image()``.

        Args:
            tops (iterable). A list of floats.
            values (iterable). A list of values to look up.
            basis (iterable). A list of components.
            components (iterable). A list of Components.

        Returns:
            List. A list of Intervals.
        """
        # Scale tops to actual depths.
        arg_7 = float(arg_3.size)
        arg_8, arg_9 = arg_3[0], arg_3[-1]
        arg_1 = [arg_8 + (p/(arg_7-1)) * (arg_9-arg_8) for p in arg_1]
        arg_10 = arg_1[1:] + [arg_9]

        arg_11 = []
        for arg_12, arg_13 in enumerate(arg_1):

            arg_14, arg_15, arg_16 = arg_2[arg_12], [], {}

            if arg_6 and np.isnan(arg_14):
                continue

            if (arg_5 is not None):
                arg_16 = {arg_5: arg_14}

            if arg_4 is not None:
                try:
                    arg_15 = [deepcopy(arg_4[int(arg_14)])]
                except IndexError:
                    arg_15 = []

                if arg_15 and (arg_15[0] is None):
                    arg_15 = []

            arg_17 = Interval(arg_13, arg_10[arg_12], data=arg_16, arg_4=arg_15)
            arg_11.append(arg_17)

        return arg_11

Private method . Take a sequence of tops in an arbitrary dimension and provide a list of intervals from which a striplog can be made .


def Func ( arg_0 ) : _flush ( ) sys . stdout . write ( arg_0 + '\n' ) sys . stdout . flush ( )

def Func(arg_0):
    """Emit a normal message."""
    _flush()
    sys.stdout.write(arg_0 + '\n')
    sys.stdout.flush()


(namespace, type_pattern, filter, ignore_case=False, show_all=False)

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=False):
    """Return dictionary of all objects in a namespace dictionary that match
    type_pattern and filter."""
    arg_5=arg_2.split(".")
    if len(arg_5) == 1:
       return filter_ns(arg_0, name_pattern=arg_5[0],
                        arg_1=arg_1,
                        arg_3=arg_3, arg_4=arg_4)
    else:
        # This is where we can change if all objects should be searched or
        # only modules. Just change the type_pattern to module to search only
        # modules
        arg_6 = filter_ns(arg_0, name_pattern=arg_5[0],
                            arg_1="all",
                            arg_3=arg_3, arg_4=arg_4)
        arg_7 = {}
        for arg_8, arg_9 in arg_6.iteritems():
            arg_10 = Func(dict_dir(arg_9), arg_1,
                                ".".join(arg_5[1:]),
                                arg_3=arg_3, arg_4=arg_4)
            for arg_11, arg_12 in arg_10.iteritems():
                arg_7["%s.%s"%(arg_8,arg_11)] = arg_12
        return arg_7

Return dictionary of all objects in a namespace dictionary that match type_pattern and filter .


def Func(arg_0, arg_1, arg_2):
        """Fetch NNTP data from the server or from the archive

        :param method: the name of the command to execute
        :param args: the arguments required by the command
        """
        if arg_0.from_archive:
            arg_3 = arg_0.Func_from_archive(arg_1, arg_2)
        else:
            arg_3 = arg_0.Func_from_remote(arg_1, arg_2)

        return arg_3


def
Func
(
arg_0
,
arg_1
=
'UTC'
)
:
arg_2
=
arg_0
if
arg_0
.
tzinfo
is
:
arg_3
=
pytz
.
timezone
(
'UTC'
)
arg_4
=
arg_3
.
localize
(
arg_0
)
arg_5
=
pytz
.
timezone
(
arg_1
)
arg_2
=
arg_4
.
astimezone
(
arg_5
)
else
:
logger
.
warn
(
'tzinfo already set'
)
return
arg_2

def Func(arg_0, arg_1='UTC'):
    """Provide a timzeone-aware object for a given datetime and timezone name
    """
    arg_2 = arg_0
    if arg_0.tzinfo is None:
        arg_3 = pytz.timezone('UTC')
        arg_4 = arg_3.localize(arg_0)
        arg_5 = pytz.timezone(arg_1)
        arg_2 = arg_4.astimezone(arg_5)
    else:
        logger.warn('tzinfo already set')
    return arg_2

Provide a timzeone - aware object for a given datetime and timezone name