def Func ( arg_0 , arg_1 ) : arg_2 = { } if arg_0 . _inferenceBuffer is None : arg_3 = InferenceElement . getMaxDelay ( arg_1 . inferences ) arg_0 . _inferenceBuffer = collections . deque ( maxlen = arg_3 + 1 ) arg_0 . _inferenceBuffer . appendleft ( copy . deepcopy ( arg_1 . inferences ) ) for arg_5 , arg_6 in arg_1 . inferences . iteritems ( ) : if isinstance ( arg_6 , dict ) : arg_2 [ arg_5 ] = { } for arg_7 , arg_8 in arg_6 . iteritems ( ) : arg_9 = InferenceElement . getTemporalDelay ( arg_5 , arg_7 ) if len ( arg_0 . _inferenceBuffer ) > arg_9 : arg_10 = arg_0 . _inferenceBuffer [ arg_9 ] [ arg_5 ] [ arg_7 ] arg_2 [ arg_5 ] [ arg_7 ] = arg_10 else : arg_2 [ arg_5 ] [ arg_7 ] = None else : arg_9 = InferenceElement . getTemporalDelay ( arg_5 ) if len ( arg_0 . _inferenceBuffer ) > arg_9 : arg_2 [ arg_5 ] = ( arg_0 . _inferenceBuffer [ arg_9 ] [ arg_5 ] ) else : if type ( arg_6 ) in ( list , tuple ) : arg_2 [ arg_5 ] = [ None ] * len ( arg_6 ) else : arg_2 [ arg_5 ] = None arg_11 = ModelResult ( rawInput = arg_1 . rawInput , sensorInput = arg_1 . sensorInput , inferences = arg_2 , metrics = arg_1 . metrics , predictedFieldIdx = arg_1 . predictedFieldIdx , predictedFieldName = arg_1 . predictedFieldName ) return arg_11

def Func(arg_0, arg_1):
    """Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to Func.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been Funced
    """
    arg_2 = {}

    if arg_0._inferenceBuffer is None:
      arg_3 = InferenceElement.getMaxDelay(arg_1.inferences)
      arg_0._inferenceBuffer = collections.deque(maxlen=arg_3 + 1)

    arg_0._inferenceBuffer.appendleft(copy.deepcopy(arg_1.inferences))

    for arg_5, arg_6 in arg_1.inferences.iteritems():
      if isinstance(arg_6, dict):
        arg_2[arg_5] = {}
        for arg_7, arg_8 in arg_6.iteritems():
          arg_9 = InferenceElement.getTemporalDelay(arg_5, arg_7)
          if len(arg_0._inferenceBuffer) > arg_9:
            arg_10 = arg_0._inferenceBuffer[arg_9][arg_5][arg_7]
            arg_2[arg_5][arg_7] = arg_10
          else:
            arg_2[arg_5][arg_7] = None
      else:
        arg_9 = InferenceElement.getTemporalDelay(arg_5)
        if len(arg_0._inferenceBuffer) > arg_9:
          arg_2[arg_5] = (
              arg_0._inferenceBuffer[arg_9][arg_5])
        else:
          if type(arg_6) in (list, tuple):
            arg_2[arg_5] = [None] * len(arg_6)
          else:
            arg_2[arg_5] = None

    arg_11 = ModelResult(rawInput=arg_1.rawInput,
                                sensorInput=arg_1.sensorInput,
                                inferences=arg_2,
                                metrics=arg_1.metrics,
                                predictedFieldIdx=arg_1.predictedFieldIdx,
                                predictedFieldName=arg_1.predictedFieldName)
    return arg_11

Shift the model result and return the new instance.

    Queues up the T(i+1) prediction value and emits a T(i)
    input/prediction pair, if possible. E.g., if the previous T(i-1)
    iteration was learn-only, then we would not have a T(i) prediction in our
    FIFO and would not be able to emit a meaningful input/prediction pair.

    :param modelResult: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult`
                        instance to shift.
    :return: A :class:`~.nupic.frameworks.opf.opf_utils.ModelResult` instance that
             has been shifted

Shift the model result and return the new instance .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . actors : arg_2 . on_update_game ( arg_1 ) arg_0 . forum . on_update_game ( ) with arg_0 . world . _unlock_temporarily ( ) : arg_0 . world . on_update_game ( arg_1 ) if arg_0 . world . has_game_ended ( ) : arg_0 . exit_stage ( )

def Func(arg_0, arg_1):
        """
        Sequentially update the actors, the world, and the messaging system.
        The theater terminates once all of the actors indicate that they are done.
        """

        for arg_2 in arg_0.actors:
            arg_2.on_update_game(arg_1)

        arg_0.forum.on_update_game()

        with arg_0.world._unlock_temporarily():
            arg_0.world.on_update_game(arg_1)

        if arg_0.world.has_game_ended():
            arg_0.exit_stage()

Sequentially update the actors the world and the messaging system . The theater terminates once all of the actors indicate that they are done .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . value ( arg_2 ) arg_1 . parser_tree = parsing . Capture ( arg_3 , arg_1 . parser_tree ) return True

def Func(arg_0, arg_1, arg_2):
    """Create a tree.Capture"""
    arg_3 = arg_0.value(arg_2)
    arg_1.parser_tree = parsing.Capture(arg_3, arg_1.parser_tree)
    return True


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . components : arg_3 . Func ( arg_1 , arg_2 ) for arg_4 in arg_0 . activities : arg_4 . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Prepare the component for execution.

        :param clock: The clock containing the execution start time and
          execution period information.
        :param period_count: The total amount of periods this activity will be
          requested to be run for.
        """

        for arg_3 in arg_0.components:
            arg_3.Func(arg_1, arg_2)
        for arg_4 in arg_0.activities:
            arg_4.Func(arg_1, arg_2)


(self, datafield, subfield, roles=["aut"])

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
[
"aut"
]
)
:
arg_4
=
[
]
arg_5
=
arg_0
.
get_subfields
(
arg_1
,
arg_2
)
for
arg_6
in
arg_5
:
arg_7
=
arg_6
.
other_subfields
if
"4"
in
arg_7
and
arg_3
!=
[
"any"
]
:
arg_8
=
arg_7
[
"4"
]
arg_9
=
any
(
map
(
lambda
role
:
role
in
arg_3
,
arg_8
)
)
if
not
arg_9
:
continue
arg_10
=
arg_6
.
i1
arg_11
=
arg_6
.
i2
arg_6
=
arg_6
.
strip
(
)
arg_12
=
""
arg_13
=
""
arg_14
=
""
arg_15
=
""
if
arg_10
==
"1"
and
arg_11
==
" "
:
if
","
in
arg_6
:
arg_14
,
arg_12
=
arg_6
.
split
(
","
,
1
)
elif
" "
in
arg_6
:
arg_14
,
arg_12
=
arg_6
.
split
(
" "
,
1
)
else
:
arg_14
=
arg_6
if
"c"
in
arg_7
:
arg_15
=
","
.
join
(
arg_7
[
"c"
]
)
elif
arg_10
==
"0"
and
arg_11
==
" "
:
arg_12
=
arg_6
.
strip
(
)
if
"b"
in
arg_7
:
arg_13
=
","
.
join
(
arg_7
[
"b"
]
)
if
"c"
in
arg_7
:
arg_14
=
","
.
join
(
arg_7
[
"c"
]
)
elif
arg_10
==
"1"
and
arg_11
==
"0"
or
arg_10
==
"0"
and
arg_11
==
"0"
:
arg_12
=
arg_6
.
strip
(
)
if
"c"
in
arg_7
:
arg_15
=
","
.
join
(
arg_7
[
"c"
]
)
arg_4
.
append
(
Person
(
arg_12
.
strip
(
)
,
arg_13
.
strip
(
)
,
arg_14
.
strip
(
)
,
arg_15
.
strip
(
)
)
)
return
arg_4

def Func(arg_0, arg_1, arg_2, arg_3=["aut"]):
        """
        Parse persons from given datafield.

        Args:
            datafield (str): code of datafield ("010", "730", etc..)
            subfield (char):  code of subfield ("a", "z", "4", etc..)
            role (list of str): set to ["any"] for any role, ["aut"] for
                 authors, etc.. For details see
                 http://www.loc.gov/marc/relators/relaterm.html

        Main records for persons are: "100", "600" and "700", subrecords "c".

        Returns:
            list: Person objects.
        """
        # parse authors
        arg_4 = []
        arg_5 = arg_0.get_subfields(arg_1, arg_2)
        for arg_6 in arg_5:
            # check if person have at least one of the roles specified in
            # 'roles' parameter of function
            arg_7 = arg_6.other_subfields
            if "4" in arg_7 and arg_3 != ["any"]:
                arg_8 = arg_7["4"]  # list of role parameters

                arg_9 = any(map(lambda role: role in arg_3, arg_8))

                # skip non-relevant persons
                if not arg_9:
                    continue

            # result of .strip() is string, so ind1/2 in MARCSubrecord are lost
            arg_10 = arg_6.i1
            arg_11 = arg_6.i2
            arg_6 = arg_6.strip()

            arg_12 = ""
            arg_13 = ""
            arg_14 = ""
            arg_15 = ""

            # here it gets nasty - there is lot of options in ind1/ind2
            # parameters
            if arg_10 == "1" and arg_11 == " ":
                if "," in arg_6:
                    arg_14, arg_12 = arg_6.split(",", 1)
                elif " " in arg_6:
                    arg_14, arg_12 = arg_6.split(" ", 1)
                else:
                    arg_14 = arg_6

                if "c" in arg_7:
                    arg_15 = ",".join(arg_7["c"])
            elif arg_10 == "0" and arg_11 == " ":
                arg_12 = arg_6.strip()

                if "b" in arg_7:
                    arg_13 = ",".join(arg_7["b"])

                if "c" in arg_7:
                    arg_14 = ",".join(arg_7["c"])
            elif arg_10 == "1" and arg_11 == "0" or arg_10 == "0" and arg_11 == "0":
                arg_12 = arg_6.strip()
                if "c" in arg_7:
                    arg_15 = ",".join(arg_7["c"])

            arg_4.append(
                Person(
                    arg_12.strip(),
                    arg_13.strip(),
                    arg_14.strip(),
                    arg_15.strip()
                )
            )

        return arg_4


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
os
.
path
.
expanduser
(
arg_1
)
arg_3
=
Mfile
.
readable
(
arg_2
)
if
arg_3
:
arg_0
.
cmd_queue
.
append
(
'source '
+
arg_2
)
elif
arg_3
is
:
arg_0
.
errmsg
(
"source file '%s' doesn't exist"
%
arg_2
)
else
:
arg_0
.
errmsg
(
"source file '%s' is not readable"
%
arg_2
)
pass
return

def Func(arg_0, arg_1):
        """Arrange for file of debugger commands to get read in the
        process-command loop."""
        arg_2 = os.path.expanduser(arg_1)
        arg_3 = Mfile.readable(arg_2)
        if arg_3:
            arg_0.cmd_queue.append('source ' + arg_2)
        elif arg_3 is None:
            arg_0.errmsg("source file '%s' doesn't exist" % arg_2)
        else:
            arg_0.errmsg("source file '%s' is not readable" %
                        arg_2)
            pass
        return

Arrange for file of debugger commands to get read in the process - command loop .


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . protocol . channel_layer . receive_many ( [ u'slack.send' ] , block = False ) arg_3 = 0.1 if arg_1 : arg_0 . protocols [ 0 ] . sendSlack ( arg_2 ) reactor . callLater ( arg_3 , arg_0 . Func )

def Func(arg_0):
        """
        Get available messages and send through to the protocol
        """
        arg_1, arg_2 = arg_0.protocol.channel_layer.receive_many([u'slack.send'], block=False)
        arg_3 = 0.1
        if arg_1:
            arg_0.protocols[0].sendSlack(arg_2)
        reactor.callLater(arg_3, arg_0.Func)


def Func(arg_0, arg_1):
    '''Expand the wildcards for an S3 path. This emulates the shall expansion
       for wildcards if the input is local path.
    '''
    arg_2 = []

    if not isinstance(arg_1, list):
      arg_1 = [arg_1]

    for arg_3 in arg_1:
      # XXX Hacky: We need to disable recursive when we expand the input
      #            parameters, need to pass this as an override parameter if
      #            provided.
      arg_4 = arg_0.opt.recursive
      arg_0.opt.recursive = False
      arg_2 += [arg_7['name'] for arg_7 in arg_0.s3walk(arg_3, True)]
      arg_0.opt.recursive = arg_4

    if (len(arg_2) == 0) and (not arg_0.opt.ignore_empty_source):
      fail("[Runtime Failure] Source doesn't exist.")

    return arg_2

Expand the wildcards for an S3 path . This emulates the shall expansion for wildcards if the input is local path .


def Func ( arg_0 , arg_1 ) : if arg_0 . parent is None : return False if arg_0 . parent == arg_1 : return True return arg_0 . parent . Func ( arg_1 )

def Func(arg_0, arg_1):
        """
        Returns True if parent is in the list of ancestors, returns False
        otherwise.

        :type  parent: Task
        :param parent: The parent that is searched in the ancestors.
        :rtype:  bool
        :returns: Whether the parent was found.
        """
        if arg_0.parent is None:
            return False
        if arg_0.parent == arg_1:
            return True
        return arg_0.parent.Func(arg_1)

Returns True if parent is in the list of ancestors returns False otherwise .


def
Func
(
arg_0
)
:
if
not
isinstance
(
arg_0
,
list
)
:
raise
TypeError
(
'Parameter bands must be a "list"'
)
arg_1
=
list
(
range
(
1
,
12
)
)
+
[
'BQA'
]
for
arg_2
in
arg_0
:
if
arg_2
not
in
arg_1
:
raise
InvalidBandError
(
'%s is not a valid band'
%
arg_2
)

def Func(arg_0):
        """Validate bands parameter."""
        if not isinstance(arg_0, list):
            raise TypeError('Parameter bands must be a "list"')
        arg_1 = list(range(1, 12)) + ['BQA']
        for arg_2 in arg_0:
            if arg_2 not in arg_1:
                raise InvalidBandError('%s is not a valid band' % arg_2)


def Func(arg_0, arg_1=None, arg_2=None):
    """Assemble a logline prefix using the google2 format."""
    # pylint: disable=global-variable-not-assigned
    global _level_names
    # pylint: enable=global-variable-not-assigned

    # Record current time
    arg_3 = arg_1 or _time.time()
    arg_4 = _time.localtime(arg_3)
    arg_5 = int(1e6 * (arg_3 % 1.0))

    (arg_6, arg_7) = arg_2 or _GetFileAndLine()
    arg_8 = _os.path.basename(arg_6)

    # Severity string
    arg_9 = 'I'
    if arg_0 in _level_names:
        arg_9 = _level_names[arg_0][0]

    arg_10 = '%c%02d%02d %02d: %02d: %02d.%06d %5d %s: %d] ' % (
        arg_9,
        arg_4[1],  # month
        arg_4[2],  # day
        arg_4[3],  # hour
        arg_4[4],  # min
        arg_4[5],  # sec
        arg_5,
        _get_thread_id(),
        arg_8,
        arg_7
    )

    return arg_10

Assemble a logline prefix using the google2 format .


def
Func
(
arg_0
)
:
arg_0
.
_generate_email
(
)
if
arg_0
.
verbose
:
print
(
"Debugging info"
"\n--------------"
"\n{} Message created."
.
format
(
timestamp
(
)
)
)
arg_1
=
[
]
for
arg_2
in
(
arg_0
.
to
,
arg_0
.
cc
,
arg_0
.
bcc
)
:
if
arg_2
:
if
isinstance
(
arg_2
,
MutableSequence
)
:
arg_1
+=
arg_2
else
:
arg_1
.
append
(
arg_2
)
arg_3
=
arg_0
.
_get_session
(
)
if
arg_0
.
verbose
:
print
(
timestamp
(
)
,
"Login successful."
)
arg_3
.
Funcmail
(
arg_0
.
from_
,
arg_1
,
arg_0
.
message
.
as_string
(
)
)
arg_3
.
quit
(
)
if
arg_0
.
verbose
:
print
(
timestamp
(
)
,
"Logged out."
)
if
arg_0
.
verbose
:
print
(
timestamp
(
)
,
type
(
arg_0
)
.
__name__
+
" info:"
,
arg_0
.
__str__
(
indentation
=
"\n * "
)
,
)
print
(
"Message sent."
)

def Func(arg_0):
        """
        Send the message.
        First, a message is constructed, then a session with the email
        servers is created, finally the message is sent and the session
        is stopped.
        """
        arg_0._generate_email()

        if arg_0.verbose:
            print(
                "Debugging info"
                "\n--------------"
                "\n{} Message created.".format(timestamp())
            )

        arg_1 = []
        for arg_2 in (arg_0.to, arg_0.cc, arg_0.bcc):
            if arg_2:
                if isinstance(arg_2, MutableSequence):
                    arg_1 += arg_2
                else:
                    arg_1.append(arg_2)

        arg_3 = arg_0._get_session()
        if arg_0.verbose:
            print(timestamp(), "Login successful.")

        arg_3.Funcmail(arg_0.from_, arg_1, arg_0.message.as_string())
        arg_3.quit()

        if arg_0.verbose:
            print(timestamp(), "Logged out.")

        if arg_0.verbose:
            print(
                timestamp(),
                type(arg_0).__name__ + " info:",
                arg_0.__str__(indentation="\n * "),
            )

        print("Message sent.")

Send the message . First a message is constructed then a session with the email servers is created finally the message is sent and the session is stopped .


(image, annos, mask=None, size=(368, 368))

return pose_crop(image, annos, mask, x, y, target_size[0], target_size[1])

def Func(arg_0, arg_1, arg_2=None, arg_3=(368, 368)):
    """Randomly crop an image and corresponding keypoints without influence scales, given by ``keypoint_random_resize_shortestedge``.

    Parameters
    -----------
    image : 3 channel image
        The given image for augmentation.
    annos : list of list of floats
        The keypoints annotation of people.
    mask : single channel image or None
        The mask if available.
    size : tuple of int
        The size of returned image.

    Returns
    ----------
    preprocessed image, annotation, mask

    """

    arg_4 = arg_3[0]
    arg_5 = arg_3[1]
    arg_6 = (arg_5, arg_4)

    if len(np.shape(arg_0)) == 2:
        arg_0 = cv2.cvtColor(arg_0, cv2.COLOR_GRAY2RGB)
    arg_7, arg_8, arg_9 = np.shape(arg_0)

    for arg_9 in range(50):
        arg_10 = random.randrange(0, arg_8 - arg_6[0]) if arg_8 > arg_6[0] else 0
        arg_11 = random.randrange(0, arg_7 - arg_6[1]) if arg_7 > arg_6[1] else 0

        # check whether any face is inside the box to generate a reasonably-balanced datasets
        for arg_12 in arg_1:
            if arg_10 <= arg_12[0][0] < arg_10 + arg_6[0] and arg_11 <= arg_12[0][1] < arg_11 + arg_6[1]:
                break

    def pose_crop(arg_0, arg_1, arg_2, arg_10, arg_11, arg_13, arg_14):  # TODO : speed up with affine transform
        # adjust image
        arg_6 = (arg_13, arg_14)

        arg_15 = arg_0
        arg_16 = arg_15[arg_11:arg_11 + arg_6[1], arg_10:arg_10 + arg_6[0], :]
        arg_17 = arg_2[arg_11:arg_11 + arg_6[1], arg_10:arg_10 + arg_6[0]]
        # adjust meta data
        arg_18 = []
        for arg_12 in arg_1:
            arg_19 = []
            for arg_20 in arg_12:
                if arg_20[0] < -10 or arg_20[1] < -10:
                    arg_19.append((-1000, -1000))
                    continue
                arg_21, arg_22 = arg_20[0] - arg_10, arg_20[1] - arg_11
                # should not crop outside the image
                if arg_21 > arg_13 - 1 or arg_22 > arg_14 - 1:
                    arg_19.append((-1000, -1000))
                    continue
                arg_19.append((arg_21, arg_22))
            arg_18.append(arg_19)

        return arg_16, arg_18, arg_17

    return pose_crop(arg_0, arg_1, arg_2, arg_10, arg_11, arg_6[0], arg_6[1])

Randomly crop an image and corresponding keypoints without influence scales given by keypoint_random_resize_shortestedge .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
for
arg_3
,
arg_4
in
enumerate
(
arg_1
.
columns
)
:
arg_5
=
hash
(
frozenset
(
arg_4
.
items
(
)
)
)
arg_6
=
arg_0
.
column_types
[
arg_5
]
if
arg_5
in
arg_0
.
column_types
else
arg_0
.
column_type
(
arg_4
)
if
arg_2
[
arg_3
]
==
and
(
'timestamp'
not
in
arg_6
or
not
arg_4
[
'default'
]
)
:
arg_2
[
arg_3
]
=
'\N'
elif
arg_2
[
arg_3
]
==
and
arg_4
[
'default'
]
:
if
arg_0
.
tz
:
arg_2
[
arg_3
]
=
'1970-01-01T00:00:00.000000'
+
arg_0
.
tz_offset
else
:
arg_2
[
arg_3
]
=
'1970-01-01 00:00:00'
elif
'bit'
in
arg_6
:
arg_2
[
arg_3
]
=
bin
(
ord
(
arg_2
[
arg_3
]
)
)
[
2
:
]
elif
isinstance
(
arg_2
[
arg_3
]
,
(
str
,
unicode
,
basestring
)
)
:
if
arg_6
==
'bytea'
:
arg_2
[
arg_3
]
=
Binary
(
arg_2
[
arg_3
]
)
.
getquoted
(
)
[
1
:
8
]
if
arg_2
[
arg_3
]
else
arg_2
[
arg_3
]
elif
'text['
in
arg_6
:
arg_2
[
arg_3
]
=
'{%s}'
%
','
.
join
(
'"%s"'
%
v
.
replace
(
'"'
,
r'\"'
)
for
v
in
arg_2
[
arg_3
]
.
split
(
','
)
)
else
:
arg_2
[
arg_3
]
=
arg_2
[
arg_3
]
.
replace
(
'\\'
,
r'\\'
)
.
replace
(
'\n'
,
r'\n'
)
.
replace
(
'\t'
,
r'\t'
)
.
replace
(
'\r'
,
r'\r'
)
.
replace
(
'\0'
,
''
)
elif
arg_6
==
'boolean'
:
arg_2
[
arg_3
]
=
't'
if
arg_2
[
arg_3
]
not
in
(
,
0
)
else
'f'
if
arg_2
[
arg_3
]
==
0
else
arg_2
[
arg_3
]
elif
isinstance
(
arg_2
[
arg_3
]
,
(
date
,
datetime
)
)
:
if
isinstance
(
arg_2
[
arg_3
]
,
datetime
)
and
arg_0
.
tz
:
try
:
if
arg_2
[
arg_3
]
.
tzinfo
:
arg_2
[
arg_3
]
=
arg_2
[
arg_3
]
.
astimezone
(
arg_0
.
tz
)
.
isoformat
(
)
else
:
arg_2
[
arg_3
]
=
datetime
(
*
arg_2
[
arg_3
]
.
timetuple
(
)
[
:
6
]
,
tzinfo
=
arg_0
.
tz
)
.
isoformat
(
)
except
Exception
as
e
:
print
e
.
message
else
:
arg_2
[
arg_3
]
=
arg_2
[
arg_3
]
.
isoformat
(
)
elif
isinstance
(
arg_2
[
arg_3
]
,
timedelta
)
:
arg_2
[
arg_3
]
=
datetime
.
utcfromtimestamp
(
_get_total_seconds
(
arg_2
[
arg_3
]
)
)
.
time
(
)
.
isoformat
(
)
else
:
arg_2
[
arg_3
]
=
AsIs
(
arg_2
[
arg_3
]
)
.
getquoted
(
)

def Func(arg_0, arg_1, arg_2):
        """Examines row data from MySQL and alters
        the values when necessary to be compatible with
        sending to PostgreSQL via the copy command
        """
        for arg_3, arg_4 in enumerate(arg_1.columns):
            arg_5 = hash(frozenset(arg_4.items()))
            arg_6 = arg_0.column_types[arg_5] if arg_5 in arg_0.column_types else arg_0.column_type(arg_4)
            if arg_2[arg_3] == None and ('timestamp' not in arg_6 or not arg_4['default']):
                arg_2[arg_3] = '\N'
            elif arg_2[arg_3] == None and arg_4['default']:
                if arg_0.tz:
                    arg_2[arg_3] = '1970-01-01T00:00:00.000000' + arg_0.tz_offset
                else:
                    arg_2[arg_3] = '1970-01-01 00:00:00'
            elif 'bit' in arg_6:
                arg_2[arg_3] = bin(ord(arg_2[arg_3]))[2:]
            elif isinstance(arg_2[arg_3], (str, unicode, basestring)):
                if arg_6 == 'bytea':
                    arg_2[arg_3] = Binary(arg_2[arg_3]).getquoted()[1:-8] if arg_2[arg_3] else arg_2[arg_3]
                elif 'text[' in arg_6:
                    arg_2[arg_3] = '{%s}' % ','.join('"%s"' % v.replace('"', r'\"') for v in arg_2[arg_3].split(','))
                else:
                    arg_2[arg_3] = arg_2[arg_3].replace('\\', r'\\').replace('\n', r'\n').replace(
                        '\t', r'\t').replace('\r', r'\r').replace('\0', '')
            elif arg_6 == 'boolean':
                # We got here because you used a tinyint(1), if you didn't want a bool, don't use that type
                arg_2[arg_3] = 't' if arg_2[arg_3] not in (None, 0) else 'f' if arg_2[arg_3] == 0 else arg_2[arg_3]
            elif isinstance(arg_2[arg_3], (date, datetime)):
                if isinstance(arg_2[arg_3], datetime) and arg_0.tz:
                    try:
                        if arg_2[arg_3].tzinfo:
                            arg_2[arg_3] = arg_2[arg_3].astimezone(arg_0.tz).isoformat()
                        else:
                            arg_2[arg_3] = datetime(*arg_2[arg_3].timetuple()[:6], tzinfo=arg_0.tz).isoformat()
                    except Exception as e:
                        print e.message
                else:
                    arg_2[arg_3] = arg_2[arg_3].isoformat()
            elif isinstance(arg_2[arg_3], timedelta):
                arg_2[arg_3] = datetime.utcfromtimestamp(_get_total_seconds(arg_2[arg_3])).time().isoformat()
            else:
                arg_2[arg_3] = AsIs(arg_2[arg_3]).getquoted()


def Func ( arg_0 ) : from _markerlib import compile as compile_marker arg_1 = arg_0 . __dep_map = { None : [ ] } arg_2 = [ ] for arg_3 in arg_0 . _parsed_pkg_info . get_all ( 'Requires-Dist' ) or [ ] : arg_4 , arg_5 = arg_0 . _preparse_requirement ( arg_3 ) arg_6 = parse_requirements ( arg_4 ) . next ( ) arg_6 . marker_fn = compile_marker ( arg_5 ) arg_2 . append ( arg_6 ) def reqs_for_extra ( arg_8 ) : for arg_3 in arg_2 : if arg_3 . marker_fn ( override = { 'extra' : arg_8 } ) : yield arg_3 arg_9 = frozenset ( reqs_for_extra ( None ) ) arg_1 [ None ] . extend ( arg_9 ) for arg_8 in arg_0 . _parsed_pkg_info . get_all ( 'Provides-Extra' ) or [ ] : arg_8 = safe_extra ( arg_8 . strip ( ) ) arg_1 [ arg_8 ] = list ( frozenset ( reqs_for_extra ( arg_8 ) ) - arg_9 ) return arg_1

def Func(arg_0):
        """Recompute this distribution's dependencies."""
        from _markerlib import compile as compile_marker
        arg_1 = arg_0.__dep_map = {None: []}

        arg_2 = []
        # Including any condition expressions
        for arg_3 in arg_0._parsed_pkg_info.get_all('Requires-Dist') or []:
            arg_4, arg_5 = arg_0._preparse_requirement(arg_3)
            arg_6 = parse_requirements(arg_4).next()
            arg_6.marker_fn = compile_marker(arg_5)
            arg_2.append(arg_6)

        def reqs_for_extra(arg_8):
            for arg_3 in arg_2:
                if arg_3.marker_fn(override={'extra':arg_8}):
                    yield arg_3

        arg_9 = frozenset(reqs_for_extra(None))
        arg_1[None].extend(arg_9)

        for arg_8 in arg_0._parsed_pkg_info.get_all('Provides-Extra') or []:
            arg_8 = safe_extra(arg_8.strip())
            arg_1[arg_8] = list(frozenset(reqs_for_extra(arg_8)) - arg_9)

        return arg_1

Recompute this distribution s dependencies .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
not
0
<=
arg_1
<=
1
:
raise
ValueError
(
"prop must be between 0 and 1"
)
arg_3
=
mcolors
.
colorConverter
.
to_rgb
(
arg_0
)
arg_4
,
arg_5
,
arg_6
=
colorsys
.
rgb_to_hls
(
*
arg_3
)
arg_6
*=
arg_1
arg_7
=
colorsys
.
hls_to_rgb
(
arg_4
,
arg_5
,
arg_6
)
arg_8
=
[
arg_0
,
arg_7
]
if
arg_2
:
arg_8
=
arg_8
[
:
:
1
]
return
gradient_n_pal
(
arg_8
,
name
=
'desaturated'
)

def Func(arg_0, arg_1, arg_2=False):
    """
    Create a palette that desaturate a color by some proportion

    Parameters
    ----------
    color : matplotlib color
        hex, rgb-tuple, or html color name
    prop : float
        saturation channel of color will be multiplied by
        this value
    reverse : bool
        Whether to reverse the palette.

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        parameter either a :class:`float` or a sequence
        of floats maps those value(s) onto the palette
        and returns color(s). The float(s) must be
        in the range [0, 1].

    Examples
    --------
    >>> palette = Func('red', .1)
    >>> palette([0, .25, .5, .75, 1])
    ['#ff0000', '#e21d1d', '#c53a3a', '#a95656', '#8c7373']
    """
    if not 0 <= arg_1 <= 1:
        raise ValueError("prop must be between 0 and 1")

    # Get rgb tuple rep
    # Convert to hls
    # Desaturate the saturation channel
    # Convert back to rgb
    arg_3 = mcolors.colorConverter.to_rgb(arg_0)
    arg_4, arg_5, arg_6 = colorsys.rgb_to_hls(*arg_3)
    arg_6 *= arg_1
    arg_7 = colorsys.hls_to_rgb(arg_4, arg_5, arg_6)
    arg_8 = [arg_0, arg_7]
    if arg_2:
        arg_8 = arg_8[::-1]
    return gradient_n_pal(arg_8, name='desaturated')

Create a palette that desaturate a color by some proportion

    Parameters
    ----------
    color : matplotlib color
        hex, rgb-tuple, or html color name
    prop : float
        saturation channel of color will be multiplied by
        this value
    reverse : bool
        Whether to reverse the palette.

    Returns
    -------
    out : function
        Continuous color palette that takes a single
        parameter either a :class:`float` or a sequence
        of floats maps those value(s) onto the palette
        and returns color(s). The float(s) must be
        in the range [0, 1].

    Examples
    --------
    >>> palette = desaturate_pal('red', .1)
    >>> palette([0, .25, .5, .75, 1])
    ['#ff0000', '#e21d1d', '#c53a3a', '#a95656', '#8c7373']


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . _runtime . has_option ( 'general' , arg_1 ) : arg_0 . _runtime = arg_0 . _new_parser ( ) if arg_2 is None : return settings . _runtime . set ( 'general' , arg_1 . replace ( 'tower_' , '' ) , six . text_type ( arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        """Maintains the context of the runtime settings for invoking
        a command.

        This should be called by a click.option callback, and only
        called once for each setting for each command invocation.

        If the setting exists, it follows that the runtime settings are
        stale, so the entire runtime settings are reset.
        """
        if arg_0._runtime.has_option('general', arg_1):
            arg_0._runtime = arg_0._new_parser()

        if arg_2 is None:
            return
        settings._runtime.set('general', arg_1.replace('tower_', ''),
                              six.text_type(arg_2))

Maintains the context of the runtime settings for invoking a command .


def Func ( arg_0 ) : arg_0 . set_fields ( ) if arg_0 . post_data_dict is not None : arg_0 . set_post_data ( ) return arg_0 . form

def Func(arg_0):
        """
        Generate the form for view.
        """
        arg_0.set_fields()
        if arg_0.post_data_dict is not None:
            arg_0.set_post_data()
        return arg_0.form


async def Func ( arg_0 , arg_1 : arg_2 ) -> Artist : arg_3 = await arg_0 . http . artist ( to_id ( arg_1 ) ) return Artist ( arg_0 , arg_3 )

async def Func(arg_0, arg_1: arg_2) -> Artist:
        """Retrive an artist with a spotify ID.

        Parameters
        ----------
        spotify_id : str
            The ID to search for.

        Returns
        -------
        artist : Artist
            The artist from the ID
        """
        arg_3 = await arg_0.http.artist(to_id(arg_1))
        return Artist(arg_0, arg_3)


def Func ( arg_0 ) : for arg_1 in arg_0 . _derived_parameters . values ( ) : if not arg_1 . f_is_empty ( ) : arg_1 . f_lock ( )

def Func(arg_0):
        """Locks all non-empty derived parameters"""
        for arg_1 in arg_0._derived_parameters.values():
            if not arg_1.f_is_empty():
                arg_1.f_lock()

Locks all non - empty derived parameters


return self._perform_get(self._get_sites_details_path(webspace_name,
                                                              website_name),
                                 Site)

def Func(arg_0, arg_1, arg_2):
        '''
        List the web sites defined on this webspace.

        webspace_name:
            The name of the webspace.
        website_name:
            The name of the website.
        '''
        return arg_0._perform_get(arg_0._Funcs_details_path(arg_1,
                                                              arg_2),
                                 Site)

List the web sites defined on this webspace .


def Func ( arg_0 ) : arg_0 . validateModel ( ) if not arg_0 . foreignFields : return for arg_1 in arg_0 . foreignFields : arg_2 = object . __getattribute__ ( arg_0 , arg_1 ) if not arg_2 : setattr ( arg_0 , str ( arg_1 ) , irNull ) continue arg_3 = arg_2 . getObjs ( ) for arg_4 in arg_3 : if isIndexedRedisModel ( arg_4 ) : IndexedRedisQuery . Func ( arg_4 )

def Func(arg_0):
		'''
			Func - Takes an object and performs a cascading fetch on all foreign links, and all theirs, and so on.

			@param obj <IndexedRedisModel> - A fetched model
		'''
		arg_0.validateModel()

		if not arg_0.foreignFields:
			return

		  # NOTE: Currently this fetches using one transaction per object. Implementation for actual resolution is in
		  #   IndexedRedisModel.__getattribute__

		for arg_1 in arg_0.foreignFields:
			arg_2 = object.__getattribute__(arg_0, arg_1)
			if not arg_2:
				setattr(arg_0, str(arg_1), irNull)
				continue
			arg_3 = arg_2.getObjs()

			for arg_4 in arg_3:
				if isIndexedRedisModel(arg_4):
					IndexedRedisQuery.Func(arg_4)

_doCascadeFetch - Takes an object and performs a cascading fetch on all foreign links, and all theirs, and so on.

			@param obj <IndexedRedisModel> - A fetched model

_doCascadeFetch - Takes an object and performs a cascading fetch on all foreign links and all theirs and so on .


def Func(arg_0, arg_1):
        """Upload a single file on the platform.

        File is uploaded in chunks of 1,024 bytes.

        :param fn: File path
        :type fn: string

        """
        arg_2 = os.path.getsize(arg_1)
        arg_3 = 0
        arg_4 = os.path.basename(arg_1)
        arg_5 = str(uuid.uuid4())

        with open(arg_1, 'rb') as f:
            while True:
                arg_6 = None
                arg_7 = f.read(CHUNK_SIZE)
                if not arg_7:
                    break

                for arg_8 in range(5):
                    content_range = 'bytes {}-{}/{}'.format(arg_3 * CHUNK_SIZE,
                                                            arg_3 * CHUNK_SIZE + len(arg_7) - 1, arg_2)
                    if arg_8 > 0 and arg_6 is not None:
                        print("Chunk upload failed (error {}): repeating {}"
                              .format(arg_6.status_code, content_range))

                    arg_6 = requests.post(urlparse.urljoin(arg_0.url, 'upload/'),
                                             auth=arg_0.auth,
                                             data=arg_7,
                                             headers={
                                                 'Content-Disposition': 'attachment; filename="{}"'.format(arg_4),
                                                 'Content-Length': arg_2,
                                                 'Content-Range': content_range,
                                                 'Content-Type': 'application/octet-stream',
                                                 'Session-Id': arg_5})

                    if arg_6.status_code in [200, 201]:
                        break
                else:
                    # Upload of a chunk failed (5 retries)
                    return None

                arg_9 = 100. * (arg_3 * CHUNK_SIZE + len(arg_7)) / arg_2
                sys.stdout.write("\r{:.0f} % Uploading {}".format(arg_9, arg_1))
                sys.stdout.flush()
                arg_3 += 1
        print()
        return arg_5


return {
            "lml": lmls,
            "effsizes0": effsizes0,
            "effsizes0_se": effsizes0_se,
            "effsizes1": effsizes1,
            "effsizes1_se": effsizes1_se,
            "scale": scales,
        }

def Func(arg_0, arg_1, arg_2=True):
        """
        LMLs, fixed-effect sizes, and scales for single-marker scan.

        Parameters
        ----------
        M : array_like
            Matrix of fixed-effects across columns.
        verbose : bool, optional
            ``True`` for progress information; ``False`` otherwise.
            Defaults to ``True``.

        Returns
        -------
        lmls : ndarray
            Log of the marginal likelihoods.
        effsizes0 : ndarray
            Covariate fixed-effect sizes.
        effsizes1 : ndarray
            Candidate set fixed-effect sizes.
        scales : ndarray
            Scales.
        """
        from tqdm import tqdm

        if arg_1.ndim != 2:
            raise ValueError("`M` array must be bidimensional.")
        arg_3 = arg_1.shape[1]

        arg_4 = empty(arg_3)
        arg_5 = empty((arg_3, arg_0._XTQ[0].shape[0]))
        arg_6 = empty((arg_3, arg_0._XTQ[0].shape[0]))
        arg_7 = empty(arg_3)
        arg_8 = empty(arg_3)
        arg_9 = empty(arg_3)

        if arg_2:
            arg_10 = min(arg_3, 30)
        else:
            arg_10 = min(arg_3, 1)

        arg_11 = (arg_3 + arg_10 - 1) // arg_10

        for arg_12 in tqdm(range(arg_10), desc="Scanning", disable=not arg_2):
            arg_13 = arg_12 * arg_11
            arg_14 = min(arg_13 + arg_11, arg_1.shape[1])

            arg_15 = arg_0._Func_chunk(arg_1[:, arg_13:arg_14])

            arg_4[arg_13:arg_14] = arg_15["lml"]
            arg_5[arg_13:arg_14, :] = arg_15["effsizes0"]
            arg_6[arg_13:arg_14, :] = arg_15["effsizes0_se"]
            arg_7[arg_13:arg_14] = arg_15["effsizes1"]
            arg_8[arg_13:arg_14] = arg_15["effsizes1_se"]
            arg_9[arg_13:arg_14] = arg_15["scale"]

        return {
            "lml": arg_4,
            "effsizes0": arg_5,
            "effsizes0_se": arg_6,
            "effsizes1": arg_7,
            "effsizes1_se": arg_8,
            "scale": arg_9,
        }

LMLs fixed - effect sizes and scales for single - marker scan .


def Func ( arg_0 , ** arg_1 ) : arg_2 = FindTransactionsCommand ( arg_0 ) ( ** arg_1 ) arg_3 = arg_2 [ 'hashes' ] if arg_3 : arg_4 = GetTrytesCommand ( arg_0 ) ( arg_3 = arg_3 ) return list ( map ( Transaction . from_tryte_string , arg_4 . get ( 'trytes' ) or [ ] , ) ) return [ ]

def Func(arg_0, **arg_1):
    # type: (BaseAdapter, **Iterable) -> List[Transaction]
    """
    Finds transactions matching the specified criteria, fetches the
    corresponding trytes and converts them into Transaction objects.
    """
    arg_2 = FindTransactionsCommand(arg_0)(**arg_1)

    arg_3 = arg_2['hashes']

    if arg_3:
        arg_4 = GetTrytesCommand(arg_0)(arg_3=arg_3)

        return list(map(
            Transaction.from_tryte_string,
            arg_4.get('trytes') or [],
        ))  # type: List[Transaction]

    return []

Finds transactions matching the specified criteria fetches the corresponding trytes and converts them into Transaction objects .


def Func(arg_0, arg_1, arg_2=None):
        """Read the images, load them into self.items and set the labels."""
        if not isinstance(arg_1, (list, tuple)):
            raise ValueError('Expected an iterable (list or tuple) of strings or img-like objects. '
                             'Got a {}.'.format(type(arg_1)))

        if not len(arg_1) > 0:
            raise ValueError('Expected an iterable (list or tuple) of strings or img-like objects '
                             'of size higher than 0. Got {} items.'.format(len(arg_1)))

        if arg_2 is not None and len(arg_2) != len(arg_1):
            raise ValueError('Expected the same length for image set ({}) and '
                             'labels list ({}).'.format(len(arg_1), len(arg_2)))

        arg_3 = arg_1[0]
        if arg_3:
            arg_4 = NeuroImage(arg_3)
        else:
            raise('Error reading image {}.'.format(repr_imgs(arg_3)))

        for arg_5, arg_6 in enumerate(arg_1):
            try:
                arg_7 = NeuroImage(arg_6)
                arg_0.check_compatibility(arg_7, arg_4)
            except:
                log.exception('Error reading image {}.'.format(repr_imgs(arg_6)))
                raise
            else:
                arg_0.items.append(arg_7)

        arg_0.set_labels(arg_2)

Read the images load them into self . items and set the labels .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = re . findall ( arg_0 . re [ "category" ] , arg_1 ) for arg_4 in arg_3 : arg_4 = arg_4 . split ( "|" ) arg_5 = arg_4 [ 0 ] . strip ( ) arg_6 = u"" if len ( arg_4 ) > 1 : arg_6 = arg_4 [ 1 ] . strip ( ) if not arg_5 in arg_2 : arg_2 . append ( arg_5 ) return arg_2

def Func(arg_0, arg_1):

        """ Returns a list of categories the page belongs to.

        # A Wikipedia category link looks like:
        # [[Category:Computing]]
        # This indicates the page is included in the given category.
        # If "Category" is preceded by ":" this indicates a link to a category.

        """

        arg_2 = []
        arg_3 = re.findall(arg_0.re["category"], arg_1)
        for arg_4 in arg_3:
            arg_4 = arg_4.split("|")
            arg_5 = arg_4[0].strip()
            arg_6 = u""
            if len(arg_4) > 1:
                arg_6 = arg_4[1].strip()
            #if not categories.has_key(page):
            #    categories[page] = WikipediaLink(page, u"", display)
            if not arg_5 in arg_2:
                arg_2.append(arg_5)

        return arg_2

Returns a list of categories the page belongs to .


(self, input_filepath, scale=None, rms=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
False
)
:
arg_4
=
[
'channels'
,
'1'
,
'Func'
]
if
arg_2
is
not
:
if
not
is_number
(
arg_2
)
or
arg_2
<=
0
:
raise
ValueError
(
"scale must be a positive number."
)
arg_4
.
extend
(
[
'-s'
,
'{:f}'
.
format
(
arg_2
)
]
)
if
arg_3
:
arg_4
.
append
(
'-rms'
)
arg_5
,
arg_5
,
arg_6
=
arg_0
.
build
(
arg_1
,
,
extra_args
=
arg_4
,
return_output
=
True
)
arg_7
=
{
}
arg_8
=
arg_6
.
split
(
'\n'
)
for
arg_9
in
arg_8
:
arg_10
=
arg_9
.
split
(
)
if
len
(
arg_10
)
==
0
:
continue
arg_11
=
arg_10
[
1
]
arg_12
=
' '
.
join
(
arg_10
[
:
1
]
)
arg_7
[
arg_12
.
strip
(
':'
)
]
=
arg_11
return
arg_7

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        '''Display time and frequency domain Funcistical information about the
        audio. Audio is passed unmodified through the SoX processing chain.

        Unlike other Transformer methods, this does not modify the transformer
        effects chain. Instead it computes Funcistics on the output file that
        would be created if the build command were invoked.

        Note: The file is downmixed to mono prior to computation.

        Parameters
        ----------
        input_filepath : str
            Path to input file to compute Funcs on.
        scale : float or None, default=None
            If not None, scales the input by the given scale factor.
        rms : bool, default=False
            If True, scales all values by the average rms amplitude.

        Returns
        -------
        Func_dict : dict
            Dictionary of Funcistics.

        See Also
        --------
        Funcs, power_spectrum, sox.file_info
        '''
        arg_4 = ['channels', '1', 'Func']
        if arg_2 is not None:
            if not is_number(arg_2) or arg_2 <= 0:
                raise ValueError("scale must be a positive number.")
            arg_4.extend(['-s', '{:f}'.format(arg_2)])

        if arg_3:
            arg_4.append('-rms')

        arg_5, arg_5, arg_6 = arg_0.build(
            arg_1, None, extra_args=arg_4, return_output=True
        )

        arg_7 = {}
        arg_8 = arg_6.split('\n')
        for arg_9 in arg_8:
            arg_10 = arg_9.split()
            if len(arg_10) == 0:
                continue
            arg_11 = arg_10[-1]
            arg_12 = ' '.join(arg_10[:-1])
            arg_7[arg_12.strip(':')] = arg_11

        return arg_7

Display time and frequency domain statistical information about the
        audio. Audio is passed unmodified through the SoX processing chain.

        Unlike other Transformer methods, this does not modify the transformer
        effects chain. Instead it computes statistics on the output file that
        would be created if the build command were invoked.

        Note: The file is downmixed to mono prior to computation.

        Parameters
        ----------
        input_filepath : str
            Path to input file to compute stats on.
        scale : float or None, default=None
            If not None, scales the input by the given scale factor.
        rms : bool, default=False
            If True, scales all values by the average rms amplitude.

        Returns
        -------
        stat_dict : dict
            Dictionary of statistics.

        See Also
        --------
        stats, power_spectrum, sox.file_info

Display time and frequency domain statistical information about the audio . Audio is passed unmodified through the SoX processing chain .


return amp.AmpList.toStringProto(self, [inObject], proto)

def Func ( arg_0 , arg_1 , arg_2 ) : return amp . AmpList . Func ( arg_0 , [ arg_1 ] , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """
        Wraps the object in a list, and then defers to ``amp.AmpList``.
        """
        return amp.AmpList.Func(arg_0, [arg_1], arg_2)

Wraps the object in a list and then defers to amp . AmpList .


async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . SetPresenceResponse ( ) await arg_0 . _pb_request ( 'presence/setpresence' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0, arg_1):
        """Set the presence status."""
        arg_2 = hangouts_pb2.SetPresenceResponse()
        await arg_0._pb_request('presence/setpresence',
                               arg_1, arg_2)
        return arg_2


(self, input_data, voice, audio_config, retry=None, timeout=None)

return client.synthesize_speech(
            input_=input_data, voice=voice, audio_config=audio_config, retry=retry, timeout=timeout
        )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None):
        """
        Synthesizes text input

        :param input_data: text input to be synthesized. See more:
            https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.SynthesisInput
        :type input_data: dict or google.cloud.texttospeech_v1.types.SynthesisInput
        :param voice: configuration of voice to be used in synthesis. See more:
            https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.VoiceSelectionParams
        :type voice: dict or google.cloud.texttospeech_v1.types.VoiceSelectionParams
        :param audio_config: configuration of the synthesized audio. See more:
            https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.AudioConfig
        :type audio_config: dict or google.cloud.texttospeech_v1.types.AudioConfig
        :return: SynthesizeSpeechResponse See more:
            https://googleapis.github.io/google-cloud-python/latest/texttospeech/gapic/v1/types.html#google.cloud.texttospeech_v1.types.SynthesizeSpeechResponse
        :rtype: object
        :param retry: (Optional) A retry object used to retry requests. If None is specified,
                requests will not be retried.
        :type retry: google.api_core.retry.Retry
        :param timeout: (Optional) The amount of time, in seconds, to wait for the request to complete.
            Note that if retry is specified, the timeout applies to each individual attempt.
        :type timeout: float
        """
        arg_6 = arg_0.get_conn()
        arg_0.log.info("Synthesizing input: %s" % arg_1)
        return arg_6.Func(
            input_=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5
        )


(self, bucket, namespace=None, entity_filter=None, labels=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_5 = arg_0 . get_conn ( ) arg_6 = 'gs://' + '/' . join ( filter ( None , [ arg_1 , arg_2 ] ) ) if not arg_3 : arg_3 = { } if not arg_4 : arg_4 = { } arg_7 = { 'outputUrlPrefix' : arg_6 , 'entityFilter' : arg_3 , 'labels' : arg_4 , } arg_8 = ( arg_5 . projects ( ) . export ( projectId = arg_0 . project_id , arg_7 = arg_7 ) . execute ( num_retries = arg_0 . num_retries ) ) return arg_8

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Export entities from Cloud Datastore to Cloud Storage for backup.

        .. note::
            Keep in mind that this requests the Admin API not the Data API.

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

        :param bucket: The name of the Cloud Storage bucket.
        :type bucket: str
        :param namespace: The Cloud Storage namespace path.
        :type namespace: str
        :param entity_filter: Description of what data from the project is included in the export.
        :type entity_filter: dict
        :param labels: Client-assigned labels.
        :type labels: dict of str
        :return: a resource operation instance.
        :rtype: dict
        """
        arg_5 = arg_0.get_conn()

        arg_6 = 'gs://' + '/'.join(filter(None, [arg_1, arg_2]))
        if not arg_3:
            arg_3 = {}
        if not arg_4:
            arg_4 = {}
        arg_7 = {
            'outputUrlPrefix': arg_6,
            'entityFilter': arg_3,
            'labels': arg_4,
        }
        arg_8 = (arg_5
                .projects()
                .export(projectId=arg_0.project_id, arg_7=arg_7)
                .execute(num_retries=arg_0.num_retries))

        return arg_8

Export entities from Cloud Datastore to Cloud Storage for backup .


return (iso_reference_str2int(cs_source) % 97) == 1

def Func ( arg_0 ) : arg_0 = str ( arg_0 ) arg_1 = arg_0 [ 4 : ] + arg_0 [ : 4 ] return ( iso_reference_str2int ( arg_1 ) % 97 ) == 1

def Func(arg_0):
    """Validates ISO reference number"""
    arg_0 = str(arg_0)
    arg_1 = arg_0[4:] + arg_0[:4]
    return (iso_reference_str2int(arg_1) % 97) == 1


def Func ( arg_0 , arg_1 ) : arg_2 = dict ( ) for arg_3 in sorted ( arg_0 . states_memory ) : arg_2 [ arg_3 ] = tf . gather ( params = arg_0 . states_memory [ arg_3 ] , arg_1 = arg_1 ) arg_4 = dict ( ) for arg_3 in sorted ( arg_0 . internals_memory ) : arg_4 [ arg_3 ] = tf . gather ( params = arg_0 . internals_memory [ arg_3 ] , arg_1 = arg_1 ) arg_5 = dict ( ) for arg_3 in sorted ( arg_0 . actions_memory ) : arg_5 [ arg_3 ] = tf . gather ( params = arg_0 . actions_memory [ arg_3 ] , arg_1 = arg_1 ) arg_6 = tf . gather ( params = arg_0 . terminal_memory , arg_1 = arg_1 ) arg_7 = tf . gather ( params = arg_0 . reward_memory , arg_1 = arg_1 ) if arg_0 . include_next_states : assert util . rank ( arg_1 ) == 1 arg_8 = ( arg_1 + 1 ) % arg_0 . capacity arg_9 = dict ( ) for arg_3 in sorted ( arg_0 . states_memory ) : arg_9 [ arg_3 ] = tf . gather ( params = arg_0 . states_memory [ arg_3 ] , arg_1 = arg_8 ) arg_10 = dict ( ) for arg_3 in sorted ( arg_0 . internals_memory ) : arg_10 [ arg_3 ] = tf . gather ( params = arg_0 . internals_memory [ arg_3 ] , arg_1 = arg_8 ) return dict ( arg_2 = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 , arg_9 = arg_9 , arg_10 = arg_10 ) else : return dict ( arg_2 = arg_2 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_7 = arg_7 )

def Func(arg_0, arg_1):
        """
        Fetches experiences for given indices.

        Args:
            indices: Index tensor

        Returns: Batch of experiences
        """
        arg_2 = dict()
        for arg_3 in sorted(arg_0.states_memory):
            arg_2[arg_3] = tf.gather(params=arg_0.states_memory[arg_3], arg_1=arg_1)

        arg_4 = dict()
        for arg_3 in sorted(arg_0.internals_memory):
            arg_4[arg_3] = tf.gather(params=arg_0.internals_memory[arg_3], arg_1=arg_1)

        arg_5 = dict()
        for arg_3 in sorted(arg_0.actions_memory):
            arg_5[arg_3] = tf.gather(params=arg_0.actions_memory[arg_3], arg_1=arg_1)

        arg_6 = tf.gather(params=arg_0.terminal_memory, arg_1=arg_1)
        arg_7 = tf.gather(params=arg_0.reward_memory, arg_1=arg_1)

        if arg_0.include_next_states:
            assert util.rank(arg_1) == 1
            arg_8 = (arg_1 + 1) % arg_0.capacity

            arg_9 = dict()
            for arg_3 in sorted(arg_0.states_memory):
                arg_9[arg_3] = tf.gather(params=arg_0.states_memory[arg_3], arg_1=arg_8)

            arg_10 = dict()
            for arg_3 in sorted(arg_0.internals_memory):
                arg_10[arg_3] = tf.gather(params=arg_0.internals_memory[arg_3], arg_1=arg_8)

            return dict(
                arg_2=arg_2,
                arg_4=arg_4,
                arg_5=arg_5,
                arg_6=arg_6,
                arg_7=arg_7,
                arg_9=arg_9,
                arg_10=arg_10
            )
        else:
            return dict(
                arg_2=arg_2,
                arg_4=arg_4,
                arg_5=arg_5,
                arg_6=arg_6,
                arg_7=arg_7
            )


return [write_script(template) for template in config.get_templates(templates)]

def Func(arg_0, arg_1, **arg_2):
    """Generate a array job.

    For each ``work_dir`` in *directories*, the array job will
     1. cd into ``work_dir``
     2. run the job as detailed in the template
    It will use all the queuing system directives found in the
    template. If more complicated set ups are required, then this
    function cannot be used.

    :Arguments:
       *templates*
          Basic template for a single job; the job array logic is spliced into
          the position of the line ::
              # JOB_ARRAY_PLACEHOLDER
          The appropriate commands for common queuing systems (Sun Gridengine, PBS)
          are hard coded here. The queuing system is detected from the suffix of
          the template.
       *directories*
          List of directories under *dirname*. One task is set up for each
          directory.
       *dirname*
          The array script will be placed in this directory. The *directories*
          **must** be located under *dirname*.
       *kwargs*
          See :func:`gromacs.setup.generate_submit_script` for details.
    """
    arg_3 = arg_2.setdefault('dirname', os.path.curdir)
    arg_4 = [relpath(p, start=arg_3) for p in asiterable(arg_1)]
    arg_5 = [p for p in (os.path.join(arg_3, subdir) for subdir in arg_4)
               if not os.path.exists(p)]
    if len(arg_5) > 0:
        logger.debug("template=%(template)r: dirname=%(dirname)r reldirs=%(reldirs)r", vars())
        logger.error("Some directories are not accessible from the array script: "
                     "%(missing)r", vars())
    def write_script(arg_6):
        arg_7 = detect_queuing_system(arg_6)
        if arg_7 is None or not arg_7.has_arrays():
            logger.warning("Not known how to make a job array for %(template)r; skipping...", vars())
            return None
        arg_2['jobarray_string'] = arg_7.array(arg_4)
        return generate_submit_scripts(arg_6, **arg_2)[0]   # returns list of length 1

    # must use config.get_templates() because we need to access the file for detecting
    return [write_script(arg_6) for arg_6 in config.get_templates(arg_0)]


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
LOGGER
.
info
(
"writing fullarr %s %s"
,
arg_1
.
name
,
arg_2
)
with
h5py
.
File
(
arg_0
.
clust_database
,
'r+'
)
as
io5
:
arg_3
=
io5
[
"catgs"
]
.
attrs
[
"chunksize"
]
[
0
]
arg_4
=
io5
[
"catgs"
]
arg_5
=
io5
[
"nalleles"
]
arg_6
=
os
.
path
.
join
(
arg_0
.
dirs
.
across
,
arg_1
.
name
+
'.tmp.h5'
)
with
h5py
.
File
(
arg_6
)
as
indat
:
arg_7
=
indat
[
"icatg"
]
arg_8
=
indat
[
"inall"
]
for
arg_9
in
xrange
(
0
,
arg_4
.
shape
[
0
]
,
arg_3
)
:
arg_10
=
arg_9
+
arg_3
arg_4
[
arg_9
:
arg_10
,
arg_2
:
arg_2
+
1
,
:
]
=
np
.
expand_dims
(
arg_7
[
arg_9
:
arg_10
,
:
]
,
axis
=
1
)
arg_5
[
:
,
arg_2
:
arg_2
+
1
]
=
np
.
expand_dims
(
arg_8
,
axis
=
1
)

def Func(arg_0, arg_1, arg_2):
    """ writes arrays to h5 disk """

    ## enter ref data?
    #isref = 'reference' in data.paramsdict["assembly_method"]
    LOGGER.info("writing fullarr %s %s", arg_1.name, arg_2)

    ## save big arrays to disk temporarily
    with h5py.File(arg_0.clust_database, 'r+') as io5:
        ## open views into the arrays we plan to fill
        arg_3 = io5["catgs"].attrs["chunksize"][0]
        arg_4 = io5["catgs"]
        arg_5 = io5["nalleles"]

        ## adding an axis to newcatg makes it write about 1000X faster.
        arg_6 = os.path.join(arg_0.dirs.across, arg_1.name+'.tmp.h5')
        with h5py.File(arg_6) as indat:

            ## grab all of the data from this sample's arrays
            arg_7 = indat["icatg"] #[:]
            arg_8 = indat["inall"]   #[:]

            ## enter it into the full array one chunk at a time
            for arg_9 in xrange(0, arg_4.shape[0], arg_3):
                arg_10 = arg_9 + arg_3
                arg_4[arg_9:arg_10, arg_2:arg_2+1, :] = np.expand_dims(arg_7[arg_9:arg_10, :], axis=1)
                arg_5[:, arg_2:arg_2+1] = np.expand_dims(arg_8, axis=1)


def Func(arg_0, arg_1='blank', arg_2=None):
    """ Rename layer label

    Can be useful for outputting mlp files, as the output file names use
    the labels.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        label (str): new label for the mesh layer
        layer_num (int): layer number to Func. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Renames a layer

    MeshLab versions:
        2016.12
        1.3.4BETA
    """
    arg_3 = ''.join([
        '  <filter name="Rename Current Mesh">\n',
        '    <Param name="newName" ',
        'value="{}" '.format(arg_1),
        'description="New Label" ',
        'type="RichString" ',
        '/>\n',
        '  </filter>\n'])
    if isinstance(arg_0, mlx.FilterScript):
        if (arg_2 is None) or (arg_2 == arg_0.current_layer()):
            util.write_filter(arg_0, arg_3)
            arg_0.layer_stack[arg_0.current_layer()] = arg_1
        else:
            arg_6 = arg_0.current_layer()
            change(arg_0, arg_2)
            util.write_filter(arg_0, arg_3)
            change(arg_0, arg_6)
            arg_0.layer_stack[arg_2] = arg_1
    else:
        util.write_filter(arg_0, arg_3)
    return None

Rename layer label

    Can be useful for outputting mlp files, as the output file names use
    the labels.

    Args:
        script: the mlx.FilterScript object or script filename to write
            the filter to.
        label (str): new label for the mesh layer
        layer_num (int): layer number to rename. Default is the
            current layer. Not supported on the file base API.

    Layer stack:
        Renames a layer

    MeshLab versions:
        2016.12
        1.3.4BETA


(images_val,
                       reconstructed_images_val,
                       random_images_val,
                       log_dir, prefix, viz_n=10)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = 10 ) : save_imgs ( arg_0 [ : arg_5 ] , os . path . join ( arg_3 , "{}_inputs.png" . format ( arg_4 ) ) ) save_imgs ( arg_1 [ : arg_5 ] , os . path . join ( arg_3 , "{}_reconstructions.png" . format ( arg_4 ) ) ) if arg_2 is not None : save_imgs ( arg_2 [ : arg_5 ] , os . path . join ( arg_3 , "{}_prior_samples.png" . format ( arg_4 ) ) )

def Func(arg_0,
                       arg_1,
                       arg_2,
                       arg_3, arg_4, arg_5=10):
  """Helper method to save images visualizing model reconstructions.

  Args:
    images_val: Numpy array containing a batch of input images.
    reconstructed_images_val: Numpy array giving the expected output
      (mean) of the decoder.
    random_images_val: Optionally, a Numpy array giving the expected output
      (mean) of decoding samples from the prior, or `None`.
    log_dir: The directory to write images (Python `str`).
    prefix: A specific label for the saved visualizations, which
      determines their filenames (Python `str`).
    viz_n: The number of images from each batch to visualize (Python `int`).
  """
  save_imgs(arg_0[:arg_5],
            os.path.join(arg_3, "{}_inputs.png".format(arg_4)))
  save_imgs(arg_1[:arg_5],
            os.path.join(arg_3,
                         "{}_reconstructions.png".format(arg_4)))

  if arg_2 is not None:
    save_imgs(arg_2[:arg_5],
              os.path.join(arg_3,
                           "{}_prior_samples.png".format(arg_4)))

Helper method to save images visualizing model reconstructions .


def Func ( arg_0 , arg_1 ) : arg_2 = 0 arg_3 = [ ] while arg_2 < arg_1 : try : arg_4 = itertools . takewhile ( lambda x : x [ 0 ] != "//\n" , arg_0 ) arg_5 = [ "" . join ( arg_4 . next ( ) ) ] except StopIteration : return 1 , arg_3 while 1 : try : arg_5 . append ( "" . join ( arg_4 . next ( ) ) ) except StopIteration : break arg_3 . append ( "" . join ( arg_5 ) ) arg_2 += 1 return 0 , arg_3

def Func(arg_0, arg_1):
    """ return optim clusters given iterators, and whether it got all or not"""
    arg_2 = 0
    arg_3 = []
    while arg_2 < arg_1:
        ## try refreshing taker, else quit
        try:
            arg_4 = itertools.takewhile(lambda x: x[0] != "//\n", arg_0)
            arg_5 = ["".join(arg_4.next())]
        except StopIteration:
            #LOGGER.debug('last chunk %s', chunk)
            return 1, arg_3

        ## load one cluster
        while 1:
            try:
                arg_5.append("".join(arg_4.next()))
            except StopIteration:
                break
        arg_3.append("".join(arg_5))
        arg_2 += 1
    return 0, arg_3

return optim clusters given iterators and whether it got all or not


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_0
!=
0
:
arg_3
=
rt
.
Error_GetLastErrorMsg
(
)
.
decode
(
)
arg_4
=
'LASError in "%s": %s'
%
(
arg_1
.
__name__
,
arg_3
)
rt
.
Error_Reset
(
)
raise
RTreeError
(
arg_4
)
return
True

def Func(arg_0, arg_1, arg_2):
    "Error checking for Error calls"
    if arg_0 != 0:
        arg_3 = rt.Error_GetLastErrorMsg().decode()
        arg_4 = 'LASError in "%s": %s' % \
            (arg_1.__name__, arg_3)
        rt.Error_Reset()
        raise RTreeError(arg_4)
    return True


def Func(arg_0, arg_1, arg_2):
        """Handle the case where the transmission fails."""
        try:
            arg_3 = arg_2.response.content
        except AttributeError:
            arg_3 = 'Not available'
        LOGGER.error(
            (
                'Failed to send completion status call for enterprise enrollment %s'
                'with payload %s'
                '\nError message: %s'
                '\nSystem message: %s'
            ),
            arg_1.enterprise_course_enrollment_id,
            arg_1,
            str(arg_2),
            arg_3
        )

Handle the case where the transmission fails .


(store, institute_obj, case_obj, user_obj, new_synopsis)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Update synopsis."""
    # create event only if synopsis was actually changed
    if arg_2['synopsis'] != arg_4:
        arg_5 = url_for('cases.case', institute_id=arg_1['_id'],
                       case_name=arg_2['display_name'])
        arg_0.Func(arg_1, arg_2, arg_3, arg_5,
                              content=arg_4)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . query ( errors . ImportError ) if arg_0 . _file_paths : arg_2 = arg_2 . filter ( ~ errors . ImportError . filename . in_ ( arg_0 . _file_paths ) ) arg_2 . delete ( synchronize_session = 'fetch' ) arg_1 . commit ( )

def Func(arg_0, arg_1):
        """
        Clears import errors for files that no longer exist.

        :param session: session for ORM operations
        :type session: sqlalchemy.orm.session.Session
        """
        arg_2 = arg_1.query(errors.ImportError)
        if arg_0._file_paths:
            arg_2 = arg_2.filter(
                ~errors.ImportError.filename.in_(arg_0._file_paths)
            )
        arg_2.delete(synchronize_session='fetch')
        arg_1.commit()

Clears import errors for files that no longer exist .


def Func(arg_0, arg_1):
    """
    Removes the specfied course from the specified organization
    """
    _validate_organization_data(arg_0)
    _validate_course_key(arg_1)
    return data.delete_organization_course(arg_1=arg_1, arg_0=arg_0)


Compute the yticks labels of this grid, used for plotting the y-axis ticks when visualizing a regular

return np.linspace(np.min(self[:, 0]), np.max(self[:, 0]), 4)

def Func ( arg_0 ) : return np . linspace ( np . min ( arg_0 [ : , 0 ] ) , np . max ( arg_0 [ : , 0 ] ) , 4 )

def Func(arg_0):
        """Compute the Func labels of this grid, used for plotting the y-axis ticks when visualizing a regular"""
        return np.linspace(np.min(arg_0[:, 0]), np.max(arg_0[:, 0]), 4)

Compute the yticks labels of this grid used for plotting the y - axis ticks when visualizing a regular


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , slice ) : arg_2 = arg_1 . start < arg_1 . stop and arg_1 . start >= arg_0 . start and arg_1 . stop <= arg_0 . end else : arg_2 = arg_1 >= arg_0 . start and arg_1 <= arg_0 . end return arg_2

def Func(arg_0, arg_1):
        """ Returns True if index is in range """
        if isinstance(arg_1, slice):
            arg_2 = arg_1.start < arg_1.stop and \
                arg_1.start >= arg_0.start and \
                arg_1.stop <= arg_0.end
        else:
            arg_2 = arg_1 >= arg_0.start and \
                arg_1 <= arg_0.end
        return arg_2


def Func(arg_0, arg_1, arg_2=None):
        '''Scan for FCs with a given prefix.

        :param str prefix: Identifier prefix.
        :param [str] feature_names:
          A list of feature names to retrieve. When ``None``, all
          features are retrieved. Wildcards are allowed.
        :rtype: Iterable of ``(content_id, FC)``
        '''
        arg_3 = arg_0._Func(arg_1, arg_2=arg_2)
        for arg_4 in arg_3:
            yield did(arg_4['_id']), arg_0.fc_from_dict(arg_4['_source']['fc'])


def Func ( arg_0 ) : arg_1 = record_get_field_instances ( arg_0 . record , tag = "245" ) for arg_2 in arg_1 : arg_3 = field_get_subfields ( arg_2 ) arg_4 = [ ] if "a" in arg_3 : arg_4 . append ( ( "a" , arg_3 [ 'a' ] [ 0 ] ) ) if "b" in arg_3 : arg_4 . append ( ( "c" , arg_3 [ 'b' ] [ 0 ] ) ) record_add_field ( arg_0 . record , tag = "111" , subfields = arg_4 ) record_delete_fields ( arg_0 . record , tag = "245" ) record_delete_fields ( arg_0 . record , tag = "246" )

def Func(arg_0):
        """Move title info from 245 to 111 proceeding style."""
        arg_1 = record_get_field_instances(arg_0.record,
                                            tag="245")
        for arg_2 in arg_1:
            arg_3 = field_get_subfields(arg_2)
            arg_4 = []
            if "a" in arg_3:
                arg_4.append(("a", arg_3['a'][0]))
            if "b" in arg_3:
                arg_4.append(("c", arg_3['b'][0]))
            record_add_field(arg_0.record,
                             tag="111",
                             subfields=arg_4)
        record_delete_fields(arg_0.record, tag="245")
        record_delete_fields(arg_0.record, tag="246")

Move title info from 245 to 111 proceeding style .


return daily_pos.count(axis=1).sum() / txn_count < threshold

def Func ( arg_0 , arg_1 , arg_2 = 0.25 ) : arg_3 = arg_1 . copy ( ) arg_3 . index = arg_3 . index . date arg_5 = arg_3 . groupby ( level = 0 ) . symbol . nunique ( ) . sum ( ) arg_6 = arg_0 . drop ( 'cash' , axis = 1 ) . replace ( 0 , np . nan ) return arg_6 . count ( axis = 1 ) . sum ( ) / arg_5 < arg_2

def Func(arg_0, arg_1, arg_2=0.25):
    """
    Attempt to detect an intraday strategy. Get the number of
    positions held at the end of the day, and divide that by the
    number of unique stocks transacted every day. If the average quotient
    is below a threshold, then an intraday strategy is detected.

    Parameters
    ----------
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in create_full_tear_sheet.

    Returns
    -------
    boolean
        True if an intraday strategy is detected.
    """

    arg_3 = arg_1.copy()
    arg_3.index = arg_3.index.date
    arg_5 = arg_3.groupby(level=0).symbol.nunique().sum()
    arg_6 = arg_0.drop('cash', axis=1).replace(0, np.nan)
    return arg_6.count(axis=1).sum() / arg_5 < arg_2

Attempt to detect an intraday strategy . Get the number of positions held at the end of the day and divide that by the number of unique stocks transacted every day . If the average quotient is below a threshold then an intraday strategy is detected .


return self.request("force-leave", params=params, method="post").status_code

def Func ( arg_0 , arg_1 ) : arg_2 = { "node" : arg_1 } return arg_0 . request ( "force-leave" , arg_2 = arg_2 , method = "post" ) . status_code

def Func(arg_0, arg_1):
        """Force a failed gossip member into the left state.

            https://www.nomadproject.io/docs/http/agent-force-leave.html

            returns: 200 status code
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"node": arg_1}
        return arg_0.request("force-leave", arg_2=arg_2, method="post").status_code

Force a failed gossip member into the left state .


def Func(arg_0, arg_1=None, arg_2=False):
    """Let user interactively select block."""
    print("Blocks found in assembly file:")
    print("      block     | OPs | pck. | AVX || Registers |    ZMM   |    YMM   |    XMM   |    GP   ||ptr.inc|\n"
          "----------------+-----+------+-----++-----------+----------+----------+----------+---------++-------|")
    for arg_3, arg_4 in arg_0:
        print('{:>2} {b[labels]!r:>12} | {b[ops]:>3} | {b[packed_instr]:>4} | {b[avx_instr]:>3} |'
              '| {b[regs][0]:>3} ({b[regs][1]:>3}) | {b[ZMM][0]:>3} ({b[ZMM][1]:>2}) | '
              '{b[YMM][0]:>3} ({b[YMM][1]:>2}) | '
              '{b[XMM][0]:>3} ({b[XMM][1]:>2}) | {b[GP][0]:>2} ({b[GP][1]:>2}) || '
              '{b[pointer_increment]!s:>5} |'.format(arg_3, arg_4=arg_4))

        if arg_2:
            arg_5 = arg_4['first_line']
            print(' '*4 + 'Code:')
            for arg_6 in arg_4['lines']:
                print(' '*8 + '{:>5} | {}'.format(arg_5, arg_6))
                arg_5 += 1
            print(' '*4 + 'Metadata:')
            print(textwrap.indent(
                pformat({arg_7: arg_8 for arg_7,arg_8 in arg_4.items() if arg_7 not in ['lines']}),
                ' '*8))

    # Let user select block:
    arg_9 = -1
    while not (0 <= arg_9 < len(arg_0)):
        arg_9 = input("Choose block to be marked [" + str(arg_1) + "]: ") or arg_1
        try:
            arg_9 = int(arg_9)
        except ValueError:
            arg_9 = -1
    # block = blocks[block_idx][1]

    return arg_9


return dir_+fname_d, dir_+fname_a, name, clk_p, E_sim

def Func(arg_0, arg_1, arg_2, arg_3,
        arg_4='1+2+3+4+5+6', arg_5='480', arg_6='30', arg_7='64',
        arg_8=0.5e-6, arg_9=1.2e-11, arg_10=''):
    """Get filenames for donor and acceptor timestamps for the given parameters
    """

    arg_11 = arg_8/32. # with t_step=0.5us -> 156.25 ns
    arg_12 = 1.*arg_2/(arg_2 + arg_0)

    arg_13 = 100.*arg_12
    print("Simulated FRET value: %.1f%%" % arg_13)

    arg_14 = "%04d" % arg_0
    arg_15 = "%04d" % arg_2
    arg_16 = "%04.1f" % arg_1
    arg_17 = "%04.1f" % arg_3

    print("D: EM %s BG %s " % (arg_14, arg_16))
    print("A: EM %s BG %s " % (arg_15, arg_17))

    arg_18 = ('ph_times_{t_tot}s_D{D}_{np}P_{pM}pM_'
               'step{ts_us}us_ID{ID}_EM{em}kHz_BG{bg}kHz.npy').format(
                       em=arg_14, bg=arg_16, arg_5=arg_5, arg_7=arg_7,
                       np=arg_6, arg_4=arg_4, ts_us=arg_8*1e6, arg_9=arg_9)

    arg_19 = ('ph_times_{t_tot}s_D{D}_{np}P_{pM}pM_'
               'step{ts_us}us_ID{ID}_EM{em}kHz_BG{bg}kHz.npy').format(
                       em=arg_15, bg=arg_17, arg_5=arg_5, arg_7=arg_7,
                       np=arg_6, arg_4=arg_4, ts_us=arg_8*1e6, arg_9=arg_9)
    print(arg_18)
    print(arg_19)

    arg_20 = ('BroSim_E{:.1f}_dBG{:.1f}k_aBG{:.1f}k_'
            'dEM{:.0f}k').format(arg_13, arg_1, arg_3, arg_0)

    return arg_10+arg_18, arg_10+arg_19, arg_20, arg_11, arg_12


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : assert arg_0 . _state == RUN arg_4 = Pool . _get_tasks ( arg_1 , arg_2 , arg_3 ) arg_5 = IMapUnorderedIterator ( arg_0 . _cache ) arg_6 = ( ( arg_5 . _job , i , arg_1 , chunk , { } ) for i , ( _ , chunk ) in enumerate ( arg_4 ) ) arg_0 . _taskqueue . put ( ( arg_6 , arg_5 . _set_length ) ) return arg_5

def Func(arg_0, arg_1, arg_2, arg_3):
        """Customized version of Func.

        Directly send chunks to func, instead of iterating in each process and
        sending one by one.

        Original:
        https://hg.python.org/cpython/file/tip/Lib/multiprocessing/pool.py#l271

        Other tried options:
        - map_async: makes a list(iterable), so it loads all the data for each
          process into RAM
        - apply_async: needs manual chunking
        """
        assert arg_0._state == RUN
        arg_4 = Pool._get_tasks(arg_1, arg_2, arg_3)
        arg_5 = IMapUnorderedIterator(arg_0._cache)
        arg_6 = ((arg_5._job, i, arg_1, chunk, {})
                 for i, (_, chunk) in enumerate(arg_4))
        arg_0._taskqueue.put((arg_6, arg_5._set_length))
        return arg_5

Customized version of imap_unordered.

        Directly send chunks to func, instead of iterating in each process and
        sending one by one.

        Original:
        https://hg.python.org/cpython/file/tip/Lib/multiprocessing/pool.py#l271

        Other tried options:
        - map_async: makes a list(iterable), so it loads all the data for each
          process into RAM
        - apply_async: needs manual chunking


def Func(arg_0):
    """
    Check if we can write to the given file

    Otherwise since we might detach the process to run in the background
    we might never find out that writing failed and get an ugly
    exit message on startup. For example:
    ERROR: Child exited immediately with non-zero exit code 127

    So we catch this error upfront and print a nicer error message
    with a hint on how to fix it.
    """
    try:
        open(arg_0, 'a')
    except IOError:
        print("Can't open file {}. "
              "Please grant write permissions or change the path in your config".format(arg_0))
        sys.exit(1)


def Func ( arg_0 , arg_1 = None ) : if isinstance ( arg_0 , Leaf ) : return Leaf ( arg_0 . type , arg_0 . value , arg_1 = arg_0 . prefix if arg_1 is None else arg_1 ) arg_0 . parent = None if arg_1 is not None : arg_0 . prefix = arg_1 return arg_0

def Func(arg_0, arg_1=None):
    """lib2to3's AST requires unique objects as children."""

    if isinstance(arg_0, Leaf):
        return Leaf(arg_0.type, arg_0.value, arg_1=arg_0.prefix if arg_1 is None else arg_1)

    # this is hacky, we assume complex nodes are just being reused once from the
    # original AST.
    arg_0.parent = None
    if arg_1 is not None:
        arg_0.prefix = arg_1
    return arg_0

lib2to3 s AST requires unique objects as children .


return ListReport("Inventory", headings, data)

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
cleaned_data
[
"product"
]
arg_3
=
arg_1
.
cleaned_data
[
"category"
]
arg_4
=
commerce
.
ProductItem
.
objects
.
filter
(
Q
(
product__in
=
arg_2
)
|
Q
(
product__category__in
=
arg_3
)
,
)
.
select_related
(
"cart"
,
"product"
)
arg_4
=
group_by_cart_status
(
arg_4
,
[
"product__category__order"
,
"product__order"
]
,
[
"product"
,
"product__category__name"
,
"product__name"
]
,
)
arg_5
=
[
"Product"
,
"Paid"
,
"Reserved"
,
"Unreserved"
,
"Refunded"
,
]
arg_6
=
[
]
for
arg_7
in
arg_4
:
arg_6
.
append
(
[
"%s - %s"
%
(
arg_7
[
"product__category__name"
]
,
arg_7
[
"product__name"
]
)
,
arg_7
[
"total_paid"
]
,
arg_7
[
"total_reserved"
]
,
arg_7
[
"total_unreserved"
]
,
arg_7
[
"total_refunded"
]
,
]
)
return
ListReport
(
"Inventory"
,
arg_5
,
arg_6
)

def Func(arg_0, arg_1):
    ''' Summarises the inventory status of the given items, grouping by
    invoice status. '''

    arg_2 = arg_1.cleaned_data["product"]
    arg_3 = arg_1.cleaned_data["category"]

    arg_4 = commerce.ProductItem.objects.filter(
        Q(product__in=arg_2) | Q(product__category__in=arg_3),
    ).select_related("cart", "product")

    arg_4 = group_by_cart_status(
        arg_4,
        ["product__category__order", "product__order"],
        ["product", "product__category__name", "product__name"],
    )

    arg_5 = [
        "Product", "Paid", "Reserved", "Unreserved", "Refunded",
    ]
    arg_6 = []

    for arg_7 in arg_4:
        arg_6.append([
            "%s - %s" % (
                arg_7["product__category__name"], arg_7["product__name"]
            ),
            arg_7["total_paid"],
            arg_7["total_reserved"],
            arg_7["total_unreserved"],
            arg_7["total_refunded"],
        ])

    return ListReport("Inventory", arg_5, arg_6)

Summarises the inventory status of the given items grouping by invoice status .


def Func(arg_0, arg_1):
        """Attaches a bundle object

        :param bundle: :class:`flask_journey.BlueprintBundle` object
        :raises:
            - IncompatibleBundle if the bundle is not of type `BlueprintBundle`
            - ConflictingPath if a bundle already exists at bundle.path
            - MissingBlueprints if the bundle doesn't contain any blueprints
        """

        if not isinstance(arg_1, BlueprintBundle):
            raise IncompatibleBundle('BlueprintBundle object passed to Func must be of type {0}'
                                     .format(BlueprintBundle))
        elif len(arg_1.blueprints) == 0:
            raise MissingBlueprints("Bundles must contain at least one flask.Blueprint")
        elif arg_0._bundle_exists(arg_1.path):
            raise ConflictingPath("Duplicate bundle path {0}".format(arg_1.path))
        elif arg_0._journey_path == arg_1.path == '/':
            raise ConflictingPath("Bundle path and Journey path cannot both be {0}".format(arg_1.path))

        arg_0._attached_bundles.append(arg_1)


(make_proc, stdout=None, stderr=None, backend='auto')

def Func(arg_0, arg_1=None, arg_2=None, arg_3='auto'):
    """
    Simultaneously reports and captures stdout and stderr from a process

    subprocess must be created using (stdout=subprocess.PIPE,
    stderr=subprocess.PIPE)
    """
    arg_4 = []
    arg_5 = []
    if arg_3 == 'auto':
        # backend = 'select' if POSIX else 'thread'
        arg_3 = 'thread'

    if arg_3 == 'select':
        if not POSIX:  # nocover
            raise NotImplementedError('select is only available on posix')
        # the select-based version is stable, but slow
        arg_6 = _proc_iteroutput_select
    elif arg_3 == 'thread':
        # the thread version is fast, but might run into issues.
        arg_6 = _proc_iteroutput_thread
    else:
        raise ValueError('backend must be select, thread, or auto')

    arg_7 = arg_0()
    for arg_8, arg_9 in arg_6(arg_7):
        if arg_8:
            if arg_1:  # pragma: nobranch
                arg_1.write(arg_8)
                arg_1.flush()
            arg_4.append(arg_8)
        if arg_9:
            if arg_2:  # pragma: nobranch
                arg_2.write(arg_9)
                arg_2.flush()
            arg_5.append(arg_9)
    return arg_7, arg_4, arg_5


(self, data,
                 expect_header_row=True,
                 ignore_lines=0,
                 summarize=False,
                 limit=0,
                 context=None,
                 report_unexpected_exceptions=True)

def Func(arg_0, arg_1,
                 arg_2=True,
                 arg_3=0,
                 arg_4=False,
                 arg_5=0,
                 arg_6=None,
                 arg_7=True):
        """
        Validate `data` and return a list of validation problems found.

        Arguments
        ---------

        `data` - any source of row-oriented data, e.g., as provided by a
        `csv.reader`, or a list of lists of strings, or ...

        `expect_header_row` - does the data contain a header row (i.e., the
        first record is a list of field names)? Defaults to True.

        `ignore_lines` - ignore n lines (rows) at the beginning of the data

        `summarize` - only report problem codes, no other details

        `limit` - report at most n problems

        `context` - a dictionary of any additional information to be added to
        any problems found - useful if problems are being aggregated from
        multiple validators

        `report_unexpected_exceptions` - value check function, value predicates,
        record check functions, record predicates, and other user-supplied
        validation functions may raise unexpected exceptions. If this argument
        is true, any unexpected exceptions will be reported as validation
        problems; if False, unexpected exceptions will be handled silently.

        """

        arg_8 = list()
        arg_9 = arg_0.iFunc(arg_1, arg_2,
                                           arg_3, arg_4, arg_6,
                                           arg_7)
        for arg_10, arg_11 in enumerate(arg_9):
            if not arg_5 or arg_10 < arg_5:
                arg_8.append(arg_11)
        return arg_8

Validate data and return a list of validation problems found .


def Func(arg_0):
        """
        The entry point of this script to generate change log
        'ChangelogGeneratorError' Is thrown when one
        of the specified tags was not found in list of tags.
        """
        if not arg_0.options.project or not arg_0.options.user:
            print("Project and/or user missing. "
                  "For help Func:\n  pygcgen --help")
            return

        if not arg_0.options.quiet:
            print("Generating changelog...")

        arg_1 = None
        try:
            arg_1 = arg_0.generator.compound_changelog()
        except ChangelogGeneratorError as err:
            print("\n\033[91m\033[1m{}\x1b[0m".format(err.args[0]))
            exit(1)
        if not arg_1:
            if not arg_0.options.quiet:
                print("Empty changelog generated. {} not written.".format(
                    arg_0.options.output)
                )
            return

        if arg_0.options.no_overwrite:
            arg_2 = checkname(arg_0.options.output)
        else:
            arg_2 = arg_0.options.output

        with codecs.open(arg_2, "w", "utf-8") as fh:
            fh.write(arg_1)

        if not arg_0.options.quiet:
            print("Done!")
            print("Generated changelog written to {}".format(arg_2))

The entry point of this script to generate change log ChangelogGeneratorError Is thrown when one of the specified tags was not found in list of tags .


return '?%s' % self.initial_params.urlencode()

def Func(arg_0, arg_1, arg_2=None):
        """
        If sort_type is None - inverse current sort for field, if no sorted - use asc
        """
        if not arg_2:
            if arg_0.initial_sort == arg_1:
                arg_2 = 'desc' if arg_0.initial_sort_type == 'asc' else 'asc'
            else:
                arg_2 = 'asc'
        arg_0.initial_params[arg_0.sort_param_name] = arg_0.sort_fields[arg_1]
        arg_0.initial_params[arg_0.sort_type_param_name] = arg_2
        return '?%s' % arg_0.initial_params.urlencode()

If sort_type is None - inverse current sort for field if no sorted - use asc


(self, indices=None, paulis=None, pauli_labels=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Insert or append pauli to the targeted indices.

        If indices is None, it means append at the end.

        Args:
            indices (list[int]): the qubit indices to be inserted
            paulis (Pauli): the to-be-inserted or appended pauli
            pauli_labels (list[str]): the to-be-inserted or appended pauli label

        Note:
            the indices refers to the localion of original paulis,
            e.g. if indices = [0, 2], pauli_labels = ['Z', 'I'] and original pauli = 'ZYXI'
            the pauli will be updated to ZY'I'XI'Z'
            'Z' and 'I' are inserted before the qubit at 0 and 2.

        Returns:
            Pauli: self

        Raises:
            QiskitError: provide both `paulis` and `pauli_labels` at the same time
        """
        if arg_3 is not None:
            if arg_2 is not None:
                raise QiskitError("Please only provide either `paulis` or `pauli_labels`")
            if isinstance(arg_3, str):
                arg_3 = list(arg_3)
            # since pauli label is in reversed order.
            arg_2 = Pauli.from_label(arg_3[::-1])

        if arg_1 is None:  # append
            arg_0._z = np.concatenate((arg_0._z, arg_2.z))
            arg_0._x = np.concatenate((arg_0._x, arg_2.x))
        else:
            if not isinstance(arg_1, list):
                arg_1 = [arg_1]
            arg_0._z = np.insert(arg_0._z, arg_1, arg_2.z)
            arg_0._x = np.insert(arg_0._x, arg_1, arg_2.x)

        return arg_0

Insert or append pauli to the targeted indices .


def Func ( arg_0 ) : arg_0 = snakecase ( arg_0 ) if not arg_0 : return arg_0 return re . sub ( r"_" , "/" , arg_0 )

def Func(arg_0):
    """Convert string into path case.
    Join punctuation with slash.

    Args:
        string: String to convert.

    Returns:
        string: Path cased string.

    """
    arg_0 = snakecase(arg_0)
    if not arg_0:
        return arg_0
    return re.sub(r"_", "/", arg_0)

Convert string into path case . Join punctuation with slash .


(self, index, message="Hello from python-ecobee!")

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"Hello from python-ecobee!"
)
:
arg_3
=
{
"selection"
:
{
"selectionType"
:
"thermostats"
,
"selectionMatch"
:
arg_0
.
thermostats
[
arg_1
]
[
'identifier'
]
}
,
"functions"
:
[
{
"type"
:
"sendMessage"
,
"params"
:
{
"text"
:
arg_2
[
0
:
500
]
}
}
]
}
arg_4
=
"send message"
return
arg_0
.
make_request
(
arg_3
,
arg_4
)

def Func(arg_0, arg_1, arg_2="Hello from python-ecobee!"):
        ''' Send a message to the thermostat '''
        arg_3 = {"selection": {
                    "selectionType": "thermostats",
                    "selectionMatch": arg_0.thermostats[arg_1]['identifier']},
                "functions": [{"type": "sendMessage", "params": {
                    "text": arg_2[0:500]
                }}]}

        arg_4 = "send message"
        return arg_0.make_request(arg_3, arg_4)


def Func ( arg_0 ) : if arg_0 . data is None : return "" elif not arg_0 . data : return "=" else : arg_1 = standard_b64Func ( arg_0 . data ) return arg_1 . decode ( "us-ascii" )

def Func(arg_0):
        """Base64-Func the data contained in the reply when appropriate.

        :return: Funcd data.
        :returntype: `unicode`
        """
        if arg_0.data is None:
            return ""
        elif not arg_0.data:
            return "="
        else:
            arg_1 = standard_b64Func(arg_0.data)
            return arg_1.decode("us-ascii")

Base64-encode the data contained in the reply when appropriate.

        :return: encoded data.
        :returntype: `unicode`

Base64 - encode the data contained in the reply when appropriate .


(self,
                       statuses,
                       user_ids=None,
                       job_ids=None,
                       job_names=None,
                       task_ids=None,
                       task_attempts=None,
                       labels=None,
                       create_time_min=None,
                       create_time_max=None,
                       max_tasks=0)

def Func(arg_0,
                       arg_1,
                       arg_2=None,
                       arg_3=None,
                       arg_4=None,
                       arg_5=None,
                       arg_6=None,
                       arg_7=None,
                       arg_8=None,
                       arg_9=None,
                       arg_10=0):
    """Return a list of operations. See base.py for additional detail."""
    arg_1 = None if arg_1 == {'*'} else arg_1
    arg_2 = None if arg_2 == {'*'} else arg_2
    arg_3 = None if arg_3 == {'*'} else arg_3
    arg_4 = None if arg_4 == {'*'} else arg_4
    arg_5 = None if arg_5 == {'*'} else arg_5
    arg_6 = None if arg_6 == {'*'} else arg_6

    if arg_7 or arg_8 or arg_9:
      raise NotImplementedError(
          'Lookup by labels and create_time not yet supported by stub.')

    arg_11 = [
        x for x in arg_0._operations
        if ((not arg_1 or x.get_field('status', (None, None))[0] in arg_1
            ) and (not arg_2 or x.get_field('user', None) in arg_2) and
            (not arg_3 or x.get_field('job-id', None) in arg_3) and
            (not arg_4 or x.get_field('job-name', None) in arg_4) and
            (not arg_5 or x.get_field('task-id', None) in arg_5) and
            (not arg_6 or
             x.get_field('task-attempt', None) in arg_6))
    ]
    if arg_10 > 0:
      arg_11 = arg_11[:arg_10]
    return arg_11

Return a list of operations . See base . py for additional detail .


def Func ( arg_0 ) : arg_1 = platform . node ( ) arg_2 = arg_0 . allgather ( ( arg_0 . Get_rank ( ) , arg_1 ) ) arg_3 = defaultdict ( int ) arg_4 = None for ( arg_5 , arg_6 ) in arg_2 : if arg_5 == arg_0 . Get_rank ( ) : arg_4 = arg_3 [ arg_6 ] arg_3 [ arg_6 ] += 1 assert arg_4 is not None return arg_4 , arg_3 [ arg_1 ]

def Func(arg_0):
    """
    Returns the rank of each process on its machine
    The processes on a given machine will be assigned ranks
        0, 1, 2, ..., N-1,
    where N is the number of processes on this machine.

    Useful if you want to assign one gpu per machine
    """
    arg_1 = platform.node()
    arg_2 = arg_0.allgather((arg_0.Get_rank(), arg_1))
    arg_3 = defaultdict(int)
    arg_4 = None
    for (arg_5, arg_6) in arg_2:
        if arg_5 == arg_0.Get_rank():
            arg_4 = arg_3[arg_6]
        arg_3[arg_6] += 1
    assert arg_4 is not None
    return arg_4, arg_3[arg_1]

Returns the rank of each process on its machine The processes on a given machine will be assigned ranks 0 1 2 ... N - 1 where N is the number of processes on this machine .


def Func ( arg_0 ) : if not arg_0 . __equalisers : arg_0 . __equalisers = yield from arg_0 . handle_list ( arg_0 . API . get ( 'equalisers' ) ) return arg_0 . __equalisers

def Func(arg_0):
        """Get the equaliser modes supported by this device."""
        if not arg_0.__equalisers:
            arg_0.__equalisers = yield from arg_0.handle_list(
                arg_0.API.get('equalisers'))

        return arg_0.__equalisers

Get the equaliser modes supported by this device .


def Func(arg_0, arg_1):
        '''
        Update the current label's name. Returns a new Label object.
        '''
        arg_2 = arg_0.fetch_json(
            uri_path=arg_0.base_uri,
            http_method='PUT',
            query_params={'name': arg_1}
        )

        return arg_0.create_label(arg_2)

Update the current label s name . Returns a new Label object .


def Func ( arg_0 , arg_1 = arg_2 , arg_3 = 'utf-8' ) : if isinstance ( arg_0 , six . binary_type ) : arg_0 = arg_0 . decode ( encoding = arg_3 ) arg_4 = functools . partial ( Func_grid , arg_1 = arg_1 , arg_3 = arg_3 ) if arg_1 == MODE_JSON : if isinstance ( arg_0 , six . string_types ) : arg_5 = json . loads ( arg_0 ) else : arg_5 = arg_0 if isinstance ( arg_5 , dict ) : return arg_4 ( arg_5 ) else : return list ( map ( arg_4 , arg_5 ) ) else : return list ( map ( arg_4 , GRID_SEP . split ( arg_0 . rstrip ( ) ) ) )

def Func(arg_0, arg_1=arg_2, arg_3='utf-8'):
    '''
    Parse the given Zinc text and return the equivalent data.
    '''
    # Decode incoming text (or python3 will whine!)
    if isinstance(arg_0, six.binary_type):
        arg_0 = arg_0.decode(encoding=arg_3)

    # Split the separate grids up, the grammar definition has trouble splitting
    # them up normally.  This will truncate the newline off the end of the last
    # row.
    arg_4 = functools.partial(Func_grid, arg_1=arg_1,
            arg_3=arg_3)
    if arg_1 == MODE_JSON:
        if isinstance(arg_0, six.string_types):
            arg_5 = json.loads(arg_0)
        else:
            arg_5 = arg_0
        if isinstance(arg_5, dict):
            return arg_4(arg_5)
        else:
            return list(map(arg_4, arg_5))
    else:
        return list(map(arg_4, GRID_SEP.split(arg_0.rstrip())))

Parse the given Zinc text and return the equivalent data .


async def Func(arg_0) -> None:
        """
        Perform a one-off configuration check that StaticFiles is actually
        pointed at a directory, so that we can raise loud errors rather than
        just returning 404 responses.
        """
        if arg_0.directory is None:
            return

        try:
            arg_1 = await aio_stat(arg_0.directory)
        except FileNotFoundError:
            raise RuntimeError(
                f"StaticFiles directory '{self.directory}' does not exist."
            )
        if not (stat.S_ISDIR(arg_1.st_mode) or stat.S_ISLNK(arg_1.st_mode)):
            raise RuntimeError(
                f"StaticFiles path '{self.directory}' is not a directory."
            )

Perform a one - off configuration check that StaticFiles is actually pointed at a directory so that we can raise loud errors rather than just returning 404 responses .


(N_taps, f1, f2, fs = 1.0, pass_zero=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 1.0 , arg_4 = False ) : return signal . firwin ( arg_0 , 2 * ( arg_1 , arg_2 ) / arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3 = 1.0, arg_4=False):
    """
    Design a windowed FIR bandpass filter in terms of passband
    critical frequencies f1 < f2 in Hz relative to sampling rate
    fs in Hz. The number of taps must be provided.

    Mark Wickert October 2016
    """
    return signal.firwin(arg_0,2*(arg_1,arg_2)/arg_3,arg_4=arg_4)

Design a windowed FIR bandpass filter in terms of passband critical frequencies f1 < f2 in Hz relative to sampling rate fs in Hz . The number of taps must be provided . Mark Wickert October 2016


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
", "
.
join
(
[
"(%s, %r)"
%
(
dis
.
opname
[
b
[
0
]
]
,
b
[
1
]
)
for
b
in
arg_1
]
)
return
"["
+
arg_2
+
"]"

def Func(arg_0, arg_1):
        """Get a string version of `block_stack`, for debugging."""
        arg_2 = ", ".join(
            ["(%s, %r)" % (dis.opname[b[0]], b[1]) for b in arg_1]
        )
        return "[" + arg_2 + "]"

Get a string version of block_stack for debugging .


(self, id, job, diff=False, policy_override=False)

return self.request(id, "plan", json=json_dict, method="post").json()

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = False ) : arg_5 = { } arg_5 . update ( arg_2 ) arg_5 . setdefault ( 'Diff' , arg_3 ) arg_5 . setdefault ( 'PolicyOverride' , arg_4 ) return arg_0 . request ( arg_1 , "plan" , json = arg_5 , method = "post" ) . json ( )

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=False):
        """ Invoke a dry-run of the scheduler for the job.

           https://www.nomadproject.io/docs/http/job.html

            arguments:
              - id
              - job, dict
              - diff, boolean
              - policy_override, boolean
            returns: dict
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_5 = {}
        arg_5.update(arg_2)
        arg_5.setdefault('Diff', arg_3)
        arg_5.setdefault('PolicyOverride', arg_4)
        return arg_0.request(arg_1, "plan", json=arg_5, method="post").json()

Invoke a dry - run of the scheduler for the job .


def Func ( arg_0 , arg_1 ) : if expand_as_args ( arg_1 ) : return arg_0 ( * arg_1 ) elif _expand_as_kwargs ( arg_1 ) : return arg_0 ( ** arg_1 ) else : return arg_0 ( arg_1 )

def Func(arg_0, arg_1):
  """Calls `fn` with `args`, possibly expanding `args`.

  Use this function when calling a user-provided callable using user-provided
  arguments.

  The expansion rules are as follows:

  `fn(*args)` if `args` is a `list` or a `tuple`, but not a `namedtuple`.
  `fn(**args)` if `args` is a `dict`.
  `fn(args)` otherwise.

  Args:
    fn: A callable that takes either `args` as an argument(s).
    args: Arguments to `fn`.

  Returns:
    result: Return value of `fn`.
  """

  if expand_as_args(arg_1):
    return arg_0(*arg_1)
  elif _expand_as_kwargs(arg_1):
    return arg_0(**arg_1)
  else:
    return arg_0(arg_1)

Calls fn with args possibly expanding args .


(input_file, output_file, export_flag="-A", dpi=90, inkscape_binpath=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
"-A"
,
arg_3
=
90
,
arg_4
=
)
:
if
not
os
.
path
.
exists
(
arg_0
)
:
log
.
error
(
'File {} not found.'
.
format
(
arg_0
)
)
raise
IOError
(
(
0
,
'File not found.'
,
arg_0
)
)
if
'='
not
in
arg_2
:
arg_2
+=
' '
arg_5
=
[
]
arg_5
+=
[
'--without-gui'
]
arg_5
+=
[
'--export-text-to-path'
]
arg_5
+=
[
'{}"{}"'
.
format
(
arg_2
,
arg_1
)
]
arg_5
+=
[
'--export-dpi={}'
.
format
(
arg_3
)
]
arg_5
+=
[
'"{}"'
.
format
(
arg_0
)
]
return
call_inkscape
(
arg_5
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1, arg_2="-A", arg_3=90, arg_4=None):
    """ Call Inkscape to export the input_file to output_file using the
    specific export argument flag for the output file type.

    Parameters
    ----------

    input_file: str
        Path to the input file

    output_file: str
        Path to the output file

    export_flag: str
        Inkscape CLI flag to indicate the type of the output file

    Returns
    -------
    return_value
        Command call return value

    """
    if not os.path.exists(arg_0):
        log.error('File {} not found.'.format(arg_0))
        raise IOError((0, 'File not found.', arg_0))

    if '=' not in arg_2:
        arg_2 += ' '

    arg_5 = []
    arg_5 += ['--without-gui']
    arg_5 += ['--export-text-to-path']
    arg_5 += ['{}"{}"'.format(arg_2, arg_1)]
    arg_5 += ['--export-dpi={}'.format(arg_3)]
    arg_5 += ['"{}"'.format(arg_0)]

    return call_inkscape(arg_5, arg_4=arg_4)

Call Inkscape to export the input_file to output_file using the specific export argument flag for the output file type .


def Func(arg_0, arg_1, arg_2=None, **arg_3):
        '''
        Fit and transform the stacked points.

        Parameters
        ----------
        X : :class:`Features` or list of bag feature arrays
            Data to train on and transform.

        any other keyword argument :
            Passed on as keyword arguments to the transformer's ``transform()``.

        Returns
        -------
        X_new : :class:`Features`
            Transformed features.
        '''
        arg_1 = as_features(arg_1, stack=True)
        arg_4 = arg_0.transformer.Func(arg_1.stacked_features, arg_2, **arg_3)
        return arg_0._gather_outputs(arg_1, arg_4)


def
Func
(
arg_0
)
:
try
:
pyngus
.
write_socket_output
(
arg_0
.
connection
,
arg_0
.
socket
)
except
Exception
as
e
:
LOG
.
error
(
"Exception on socket write: %s"
,
str
(
e
)
)
arg_0
.
connection
.
close_output
(
)
arg_0
.
connection
.
close
(
)
arg_0
.
connection
.
process
(
time
.
time
(
)
)

def Func(arg_0):
        """Called when socket is write-ready"""
        try:
            pyngus.write_socket_output(arg_0.connection,
                                       arg_0.socket)
        except Exception as e:
            LOG.error("Exception on socket write: %s", str(e))
            arg_0.connection.close_output()
            arg_0.connection.close()
        arg_0.connection.process(time.time())


return '{0} {1}.{2}f'.format(value, precision, precision)

def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_2
=
arg_0
.
_change_precision
(
arg_2
,
arg_0
.
settings
[
'number'
]
[
'precision'
]
)
arg_3
=
pow
(
10
,
arg_2
)
arg_3
=
round
(
arg_0
.
parse
(
arg_1
)
*
arg_3
)
/
arg_3
return
'{0} {1}.{2}f'
.
format
(
arg_1
,
arg_2
,
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """Implementation that treats floats more like decimals.

        Fixes binary rounding issues (eg. (0.615).toFixed(2) === "0.61")
        that present problems for accounting and finance-related software.

        """
        arg_2 = arg_0._change_precision(
            arg_2, arg_0.settings['number']['precision'])

        arg_3 = pow(10, arg_2)
        # Multiply up by precision, round accurately, then divide
        arg_3 = round(arg_0.parse(arg_1) * arg_3) / arg_3
        return '{0} {1}.{2}f'.format(arg_1, arg_2, arg_2)

Implementation that treats floats more like decimals .