def Func(arg_0, arg_1, arg_2):
        '''
        Run transforms on stream item.
        Item may be discarded by some transform.
        Writes successful items out to current self.t_chunk
        Returns transformed item or None.
        '''
        ## operate each transform on this one StreamItem
        for arg_3 in arg_2:
            try:
                arg_4 = arg_1.stream_id
                arg_5 = arg_3(arg_1, context=arg_0.context)

                if arg_5 is None:
                    logger.warn('transform %r deleted %s abs_url=%r',
                                 arg_3, arg_4, arg_1 and arg_1.abs_url)
                    return None
                arg_1 = arg_5

            except TransformGivingUp:
                ## do nothing
                logger.info('transform %r giving up on %r',
                            arg_3, arg_1.stream_id)

            except Exception, exc:
                logger.critical(
                    'transform %r failed on %r from i_str=%r abs_url=%r',
                    arg_3, arg_1 and arg_1.stream_id, arg_0.context.get('i_str'),
                    arg_1 and arg_1.abs_url, exc_info=True)

        assert arg_1 is not None

        ## expect to always have a stream_time
        if not arg_1.stream_time:
            raise InvalidStreamItem('empty stream_time: %s' % arg_1)

        if arg_1.stream_id is None:
            raise InvalidStreamItem('empty stream_id: %r' % arg_1)

        ## put the StreamItem into the output
        if type(arg_1) != streamcorpus.StreamItem_v0_3_0:
            raise InvalidStreamItem('incorrect stream item object %r' %
                                    type(arg_1))
        arg_0.t_chunk.add(arg_1)
        return arg_1

Run transforms on stream item . Item may be discarded by some transform . Writes successful items out to current self . t_chunk Returns transformed item or None .


(filename, file_extension, lines, error,
                    extra_check_functions=None)

def Func(arg_0, arg_1, arg_2, arg_3,
                    arg_4=None):
  """Performs lint checks and reports any errors to the given error function.

  Args:
    filename: Filename of the file that is being processed.
    file_extension: The extension (dot not included) of the file.
    lines: An array of strings, each representing a line of the file, with the
           last element being empty if the file is terminated with a newline.
    error: A callable to which errors are reported, which takes 4 arguments:
           filename, line number, error level, and message
    extra_check_functions: An array of additional check functions that will be
                           run on each source line. Each function takes 4
                           arguments: filename, clean_lines, line, error
  """
  arg_2 = (['// marker so line numbers and indices both start at 1'] + arg_2 +
           ['// marker so line numbers end in a known way'])

  arg_5 = _IncludeState()
  arg_6 = _FunctionState()
  arg_7 = NestingState()

  ResetNolintSuppressions()

  CheckForCopyright(arg_0, arg_2, arg_3)
  ProcessGlobalSuppresions(arg_2)
  RemoveMultiLineComments(arg_0, arg_2, arg_3)
  arg_8 = CleansedLines(arg_2)

  if arg_1 in GetHeaderExtensions():
    CheckForHeaderGuard(arg_0, arg_8, arg_3)

  for arg_9 in range(arg_8.NumLines()):
    ProcessLine(arg_0, arg_1, arg_8, arg_9,
                arg_5, arg_6, arg_7, arg_3,
                arg_4)
    FlagCxx11Features(arg_0, arg_8, arg_9, arg_3)
  arg_7.CheckCompletedBlocks(arg_0, arg_3)

  CheckForIncludeWhatYouUse(arg_0, arg_8, arg_5, arg_3)

  # Check that the .cc file has included its header if it exists.
  if _IsSourceExtension(arg_1):
    CheckHeaderFileIncluded(arg_0, arg_5, arg_3)

  # We check here rather than inside ProcessLine so that we see raw
  # lines rather than "cleaned" lines.
  CheckForBadCharacters(arg_0, arg_2, arg_3)

  CheckForNewlineAtEOF(arg_0, arg_2, arg_3)

Performs lint checks and reports any errors to the given error function .


def Func ( arg_0 ) : arg_1 = re . sub ( r"_" , r"\\" , snakecase ( arg_0 ) ) return arg_1

def Func(arg_0):
    """Convert string into spinal case.
    Join punctuation with backslash.

    Args:
        string: String to convert.

    Returns:
        string: Spinal cased string.

    """
    arg_1 = re.sub(r"_", r"\\", snakecase(arg_0))

    return arg_1

Convert string into spinal case . Join punctuation with backslash .


def Func ( arg_0 , arg_1 , arg_2 ) : ( arg_3 , arg_4 ) = arg_0 . get_or_create ( arg_1 = arg_1 ) try : arg_5 = json . loads ( arg_3 . settings ) except ValueError : arg_5 = { } arg_5 . update ( arg_2 ) arg_3 . settings = json . dumps ( arg_5 ) arg_3 . save ( )

def Func(arg_0, arg_1, arg_2):
        """Updates settings for given integration."""

        (arg_3, arg_4) = arg_0.get_or_create(arg_1=arg_1)

        try:
            arg_5 = json.loads(arg_3.settings)
        except ValueError:
            arg_5 = {}

        arg_5.update(arg_2)

        arg_3.settings = json.dumps(arg_5)

        arg_3.save()

Updates settings for given integration .


def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . nodelist_to_text ( latexwalker . LatexWalker ( arg_1 , ** arg_2 ) . get_latex_nodes ( ) [ 0 ] )

def Func(arg_0, arg_1, **arg_2):
        """
        Parses the given `latex` code and returns its textual representation.

        The `parse_flags` are the flags to give on to the
        :py:class:`pylatexenc.latexwalker.LatexWalker` constructor.
        """
        return arg_0.nodelist_to_text(latexwalker.LatexWalker(arg_1, **arg_2).get_latex_nodes()[0])

Parses the given latex code and returns its textual representation .


(self, task_id, backend, category, backend_args,
                 archive_args=None, sched_args=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                 arg_5=None, arg_6=None):
        """Add and schedule a task.

        :param task_id: id of the task
        :param backend: name of the backend
        :param category: category of the items to fecth
        :param backend_args: args needed to initialize the backend
        :param archive_args: args needed to initialize the archive
        :param sched_args: scheduling args for this task

        :returns: the task created
        """
        try:
            arg_7 = arg_0.__parse_archive_args(arg_5)
            arg_8 = arg_0.__parse_schedule_args(arg_6)
            arg_0.__validate_args(arg_1, arg_2, arg_3, arg_4)
        except ValueError as e:
            raise e

        try:
            arg_9 = arg_0._tasks.add(arg_1, arg_2, arg_3, arg_4,
                                   arg_7=arg_7,
                                   arg_8=arg_8)
        except AlreadyExistsError as e:
            raise e

        arg_0._scheduler.schedule_task(arg_9.task_id)

        return arg_9


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 . bases : arg_3 = safe_infer ( arg_2 ) if arg_3 in ( astroid . Uninferable , None ) : continue if isinstance ( arg_3 , astroid . Instance ) and arg_3 . is_subtype_of ( "%s.type" % ( BUILTINS , ) ) : continue if not isinstance ( arg_3 , astroid . ClassDef ) or _is_invalid_base_class ( arg_3 ) : arg_0 . add_message ( "inherit-non-class" , args = arg_2 . as_string ( ) , arg_1 = arg_1 ) if arg_3 . name == object . __name__ : arg_0 . add_message ( "useless-object-inheritance" , args = arg_1 . name , arg_1 = arg_1 )

def Func(arg_0, arg_1):
        """
        Detect that a class inherits something which is not
        a class or a type.
        """
        for arg_2 in arg_1.bases:
            arg_3 = safe_infer(arg_2)
            if arg_3 in (astroid.Uninferable, None):
                continue
            if isinstance(arg_3, astroid.Instance) and arg_3.is_subtype_of(
                "%s.type" % (BUILTINS,)
            ):
                continue

            if not isinstance(arg_3, astroid.ClassDef) or _is_invalid_base_class(
                arg_3
            ):
                arg_0.add_message("inherit-non-class", args=arg_2.as_string(), arg_1=arg_1)

            if arg_3.name == object.__name__:
                arg_0.add_message(
                    "useless-object-inheritance", args=arg_1.name, arg_1=arg_1
                )

Detect that a class inherits something which is not a class or a type .


def Func(arg_0, arg_1):
        """Set volume level of the device. Accepts integer values 0-200."""
        if 0 <= arg_1 <= 200:
            arg_1 = format(arg_1, "02x")  # Convert to hex
            arg_0._send(arg_0.CMD_VOLUME + arg_1)

Set volume level of the device . Accepts integer values 0 - 200 .


return "{status}: {output}\n".format(**{
        "status": status.upper(),
        "output": text,
    }), code

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
{
}
arg_3
=
map
(
strip
,
arg_1
.
programs
.
strip
(
)
.
split
(
","
)
)
if
arg_1
.
programs
else
map
(
lambda
x
:
x
[
"name"
]
,
arg_0
)
for
arg_4
in
arg_3
:
try
:
arg_5
=
filter
(
lambda
x
:
x
[
"name"
]
==
arg_4
,
arg_0
)
[
0
]
arg_2
.
update
(
{
arg_4
:
{
"name"
:
arg_4
,
"template"
:
STATE2TEMPLATE
[
arg_5
[
"statename"
]
]
,
"status"
:
arg_5
[
"spawnerr"
]
if
arg_5
[
"spawnerr"
]
else
arg_5
[
"statename"
]
,
}
}
)
except
IndexError
:
arg_2
.
update
(
{
arg_4
:
{
"name"
:
arg_4
,
"template"
:
"unknown"
,
"status"
:
""
,
}
}
)
arg_6
=
[
arg_7
[
0
]
for
arg_7
in
sorted
(
[
(
arg_7
,
OUTPUT_TEMPLATES
[
arg_7
]
[
"priority"
]
)
for
arg_7
in
list
(
set
(
[
arg_2
[
d
]
[
"template"
]
for
d
in
arg_2
.
keys
(
)
]
)
)
]
,
key
=
lambda
x
:
x
[
1
]
)
]
arg_7
=
arg_6
[
0
]
if
arg_6
else
EXIT_CODE_OK
arg_8
=
", "
.
join
(
[
OUTPUT_TEMPLATES
[
arg_2
[
arg_4
]
[
"template"
]
]
[
"text"
]
.
format
(
**
arg_2
[
arg_4
]
)
for
arg_4
in
sorted
(
arg_2
.
keys
(
)
,
key
=
lambda
x
:
OUTPUT_TEMPLATES
[
arg_2
[
x
]
[
"template"
]
]
[
"priority"
]
)
]
)
if
arg_6
else
"No program configured/found"
arg_9
=
EXIT_CODES
.
get
(
arg_7
,
EXIT_CODE_UNKNOWN
)
return
"{status}: {output}\n"
.
format
(
**
{
"status"
:
arg_7
.
upper
(
)
,
"output"
:
arg_8
,
}
)
,
arg_9

def Func(arg_0, arg_1):
    """
    Create Nagios and human readable supervisord statuses.

    :param data: supervisord XML-RPC call result.
    :type data: dict.
    :param options: parsed commandline arguments.
    :type options: optparse.Values.
    :return: Nagios and human readable supervisord statuses and exit code.
    :rtype: (str, int).
    """

    arg_2 = {}
    arg_3 = map(strip, arg_1.programs.strip().split(",")) if arg_1.programs else map(lambda x: x["name"], arg_0)

    for arg_4 in arg_3:
        try:
            arg_5 = filter(lambda x: x["name"] == arg_4, arg_0)[0]
            arg_2.update({
                arg_4: {
                    "name": arg_4,
                    "template": STATE2TEMPLATE[arg_5["statename"]],
                    "status": arg_5["spawnerr"] if arg_5["spawnerr"] else arg_5["statename"],
                }
            })
        except IndexError:
            arg_2.update({
                arg_4: {
                    "name": arg_4,
                    "template": "unknown",
                    "status": "",
                }
            })

    # getting main status for check (for multiple check need to get main status by priority)
    arg_6 = [arg_7[0] for arg_7 in sorted([(arg_7, OUTPUT_TEMPLATES[arg_7]["priority"]) for arg_7 in list(set([arg_2[d]["template"] for d in arg_2.keys()]))], key=lambda x: x[1])]
    # if no programs found or configured by supervisord set status ok and custom message
    arg_7 = arg_6[0] if arg_6 else EXIT_CODE_OK
    arg_8 = ", ".join([OUTPUT_TEMPLATES[arg_2[arg_4]["template"]]["text"].format(**arg_2[arg_4]) for arg_4 in sorted(arg_2.keys(), key=lambda x: OUTPUT_TEMPLATES[arg_2[x]["template"]]["priority"])]) if arg_6 else "No program configured/found"

    # create exit code (unknown if something happened wrong)
    arg_9 = EXIT_CODES.get(arg_7, EXIT_CODE_UNKNOWN)

    # return full status string with main status for multiple programs and all programs states
    return "{status}: {output}\n".format(**{
        "status": arg_7.upper(),
        "output": arg_8,
    }), arg_9

Create Nagios and human readable supervisord statuses .


def Func ( arg_0 ) : arg_1 = arg_0 . dfk . task_count arg_2 = len ( [ x for x in arg_0 . dfk . config . executors if x . managed ] ) arg_3 = len ( [ t for t in arg_0 . dfk . tasks if arg_0 . dfk . tasks [ t ] [ 'status' ] in FINAL_FAILURE_STATES ] ) arg_4 = { 'uuid' : arg_0 . uuid , 'end' : time . time ( ) , 't_apps' : arg_1 , 'sites' : arg_2 , 'c_time' : None , 'failed' : arg_3 , 'test' : arg_0 . test_mode , } return json . dumps ( arg_4 )

def Func(arg_0):
        """Collect the final run information at the time of DFK cleanup.

        Returns:
             - Message dict dumped as json string, ready for UDP
        """
        arg_1 = arg_0.dfk.task_count

        arg_2 = len([x for x in arg_0.dfk.config.executors if x.managed])

        arg_3 = len([t for t in arg_0.dfk.tasks if
                         arg_0.dfk.tasks[t]['status'] in FINAL_FAILURE_STATES])

        arg_4 = {'uuid': arg_0.uuid,
                   'end': time.time(),
                   't_apps': arg_1,
                   'sites': arg_2,
                   'c_time': None,
                   'failed': arg_3,
                   'test': arg_0.test_mode,
                   }

        return json.dumps(arg_4)

Collect the final run information at the time of DFK cleanup .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
_anything_done
=
True
logger
.
debug
(
"Func() called for: {0!r}"
.
format
(
arg_1
)
)
arg_3
=
arg_1
(
)
arg_4
=
arg_1
.
_pyxmpp_recurring
if
arg_4
:
arg_0
.
_prepare_pending
(
)
return
True
if
arg_4
is
and
arg_3
is
not
:
logger
.
debug
(
" auto-recurring, restarting in {0} s"
.
format
(
arg_3
)
)
arg_5
=
glib
.
timeout_add
(
int
(
arg_3
*
1000
)
,
arg_0
.
Func
,
arg_1
)
arg_0
.
_timer_sources
[
arg_1
]
=
arg_5
else
:
arg_0
.
_timer_sources
.
pop
(
arg_1
,
)
arg_0
.
_prepare_pending
(
)
return
False

def Func(arg_0, arg_1):
        """Call the timeout handler due.
        """
        arg_0._anything_done = True
        logger.debug("Func() called for: {0!r}".format(arg_1))
        arg_3 = arg_1()
        # pylint: disable=W0212
        arg_4 = arg_1._pyxmpp_recurring
        if arg_4:
            arg_0._prepare_pending()
            return True

        if arg_4 is None and arg_3 is not None:
            logger.debug(" auto-recurring, restarting in {0} s"
                                                            .format(arg_3))
            arg_5 = glib.timeout_add(int(arg_3 * 1000), arg_0.Func, arg_1)
            arg_0._timer_sources[arg_1] = arg_5
        else:
            arg_0._timer_sources.pop(arg_1, None)
        arg_0._prepare_pending()
        return False


async def Func ( arg_0 ) : arg_1 = await arg_0 . api . account . settings . get ( ) arg_2 = arg_1 . time_zone . tzinfo_name arg_3 . environ [ 'TZ' ] = arg_2 time . tzset ( )

async def Func(arg_0):
        """
            set the environment timezone to the timezone
            set in your twitter settings
        """
        arg_1 = await arg_0.api.account.settings.get()

        arg_2 = arg_1.time_zone.tzinfo_name

        arg_3.environ['TZ'] = arg_2
        time.tzset()


def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . value : arg_0 . value [ arg_1 ] = ReducedMetric ( arg_0 . reducer )

def Func(arg_0, arg_1):
    """Adds a new key to this metric"""
    if arg_1 not in arg_0.value:
      arg_0.value[arg_1] = ReducedMetric(arg_0.reducer)


Puts a value into a queue but aborts if this thread is closed.

def Func ( arg_0 , arg_1 , arg_2 ) : while not arg_0 . closed : try : arg_1 . put ( arg_2 , block = True , timeout = 1 ) return except Func . Full : continue

def Func(arg_0, arg_1, arg_2):
        """Puts a value into a Func but aborts if this thread is closed."""
        while not arg_0.closed:
            try:
                arg_1.put(arg_2, block=True, timeout=1)
                return
            except Func.Full:
                continue

Puts a value into a queue but aborts if this thread is closed .


def Func ( arg_0 , arg_1 = False , arg_2 = None ) : if type ( arg_0 ) != list : arg_0 = [ arg_0 ] arg_3 = { "hosts" : arg_0 , "timeout" : 20 } if arg_1 : arg_3 [ 'use_ssl' ] = True if arg_2 : arg_3 [ 'verify_certs' ] = True arg_3 [ 'ca_certs' ] = arg_2 else : arg_3 [ 'verify_certs' ] = False connections . create_connection ( ** arg_3 )

def Func(arg_0, arg_1=False, arg_2=None):
    """
    Sets the Elasticsearch hosts to use

    Args:
        hosts (str): A single hostname or URL, or list of hostnames or URLs
        use_ssl (bool): Use a HTTPS connection to the server
        ssl_cert_path (str): Path to the certificate chain
    """
    if type(arg_0) != list:
        arg_0 = [arg_0]
    arg_3 = {
        "hosts": arg_0,
        "timeout": 20
    }
    if arg_1:
        arg_3['use_ssl'] = True
        if arg_2:
            arg_3['verify_certs'] = True
            arg_3['ca_certs'] = arg_2
        else:
            arg_3['verify_certs'] = False
    connections.create_connection(**arg_3)


def Func ( arg_0 ) : if isinstance ( arg_0 , _BASESTRING_TYPES ) : return arg_0 assert isinstance ( arg_0 , bytes ) return arg_0 . decode ( "utf-8" )

def Func(arg_0):
    """Converts a string argument to a subclass of basestring.

    In python2, byte and unicode strings are mostly interchangeable,
    so functions that deal with a user-supplied argument in combination
    with ascii string constants can use either and should return the type
    the user supplied.  In python3, the two types are not interchangeable,
    so this method is needed to convert byte strings to unicode.
    """
    if isinstance(arg_0, _BASESTRING_TYPES):
        return arg_0
    assert isinstance(arg_0, bytes)
    return arg_0.decode("utf-8")

Converts a string argument to a subclass of basestring .


return [
            dict(zip(columns, row))
            for row in cursor.fetchall()
        ]

def Func ( arg_0 , arg_1 ) : arg_2 = [ col [ 0 ] for col in arg_1 . description ] return [ dict ( zip ( arg_2 , arg_3 ) ) for arg_3 in arg_1 . fetchall ( ) ]

def Func(arg_0, arg_1):
        """ Return all rows from a cursor as a dict. """
        arg_2 = [col[0] for col in arg_1.description]
        return [
            dict(zip(arg_2, arg_3))
            for arg_3 in arg_1.fetchall()
        ]

Return all rows from a cursor as a dict .


(self, phonetic, final_rules, language_arg, strip)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Apply a set of final rules to the phonetic encoding.

        Parameters
        ----------
        phonetic : str
            The term to which to apply the final rules
        final_rules : tuple
            The set of final phonetic transform regexps
        language_arg : int
            An integer representing the target language of the phonetic
            encoding
        strip : bool
            Flag to indicate whether to normalize the language attributes

        Returns
        -------
        str
            A Beider-Morse phonetic code

        """
        # optimization to save time
        if not arg_2:
            return arg_1

        # expand the result
        arg_1 = arg_0._expand_alternates(arg_1)
        arg_5 = arg_1.split('|')

        for arg_6 in range(len(arg_5)):
            arg_1 = arg_5[arg_6]
            arg_7 = ''
            arg_8 = arg_0._normalize_lang_attrs(arg_1, True)

            arg_9 = 0
            while arg_9 < len(arg_1):
                arg_10 = False

                if arg_1[arg_9] == '[':  # skip over language attribute
                    arg_11 = arg_9
                    arg_9 += 1
                    while True:
                        if arg_1[arg_9] == ']':
                            arg_9 += 1
                            arg_7 += arg_1[arg_11:arg_9]
                            break
                        arg_9 += 1
                    continue

                for arg_12 in arg_2:
                    arg_13 = arg_12[_PATTERN_POS]
                    arg_14 = len(arg_13)
                    arg_15 = arg_12[_LCONTEXT_POS]
                    arg_16 = arg_12[_RCONTEXT_POS]

                    arg_17 = '^' + arg_16
                    arg_18 = arg_15 + '$'

                    # check to see if next sequence in phonetic matches the
                    # string in the rule
                    if (arg_14 > len(arg_8) - arg_9) or arg_8[
                        arg_9 : arg_9 + arg_14
                    ] != arg_13:
                        continue

                    # check that right context is satisfied
                    if arg_16 != '':
                        if not search(arg_17, arg_8[arg_9 + arg_14 :]):
                            continue

                    # check that left context is satisfied
                    if arg_15 != '':
                        if not search(arg_18, arg_8[:arg_9]):
                            continue

                    # check for incompatible attributes
                    arg_19 = arg_0._apply_rule_if_compat(
                        arg_7, arg_12[_PHONETIC_POS], arg_3
                    )
                    # The below condition shouldn't ever be false
                    if arg_19 is not None:  # pragma: no branch
                        arg_7 = arg_19
                        arg_10 = True
                        break

                if not arg_10:
                    # character in name for which there is no substitution in
                    # the table
                    arg_7 += arg_1[arg_9]
                    arg_14 = 1

                arg_9 += arg_14

            arg_5[arg_6] = arg_0._expand_alternates(arg_7)

        arg_1 = '|'.join(arg_5)
        if arg_4:
            arg_1 = arg_0._normalize_lang_attrs(arg_1, True)

        if '|' in arg_1:
            arg_1 = '(' + arg_0._remove_dupes(arg_1) + ')'

        return arg_1

Apply a set of final rules to the phonetic encoding .


def Func(arg_0):
        """
        Retrieves the path to the MySQL configuration file.
        """
        from burlap.system import distrib_id, distrib_release
        arg_1 = arg_0.current_hostname
        if arg_1 not in arg_0._conf_cache:
            arg_0.env.conf_specifics[arg_1] = arg_0.env.conf_default
            arg_4 = distrib_id()
            arg_5 = distrib_release()
            for arg_6 in ((arg_4, arg_5), (arg_4,)):
                if arg_6 in arg_0.env.conf_specifics:
                    arg_0._conf_cache[arg_1] = arg_0.env.conf_specifics[arg_6]
        return arg_0._conf_cache[arg_1]

Retrieves the path to the MySQL configuration file .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . model ( ** arg_1 ) arg_3 = [ ] arg_4 = [ ] for arg_5 in arg_2 . _meta . local_concrete_fields : arg_6 = arg_5 . default != NOT_PROVIDED if ( arg_5 . name in arg_1 or arg_5 . column in arg_1 ) : arg_3 . append ( arg_5 ) arg_4 . append ( arg_5 ) continue elif arg_6 : arg_3 . append ( arg_5 ) continue if arg_5 . primary_key is True and 'pk' in arg_1 : arg_3 . append ( arg_5 ) arg_4 . append ( arg_5 ) continue if arg_0 . _is_magical_field ( arg_2 , arg_5 , is_insert = True ) : arg_3 . append ( arg_5 ) if arg_0 . _is_magical_field ( arg_2 , arg_5 , is_insert = False ) : arg_4 . append ( arg_5 ) return arg_3 , arg_4

def Func(arg_0, arg_1):
        """Gets the fields to use in an upsert.

        This some nice magic. We'll split the fields into
        a group of "insert fields" and "update fields":

        INSERT INTO bla ("val1", "val2") ON CONFLICT DO UPDATE SET val1 = EXCLUDED.val1

                         ^^^^^^^^^^^^^^                            ^^^^^^^^^^^^^^^^^^^^
                         insert_fields                                 update_fields

        Often, fields appear in both lists. But, for example,
        a :see:DateTime field with `auto_now_add=True` set, will
        only appear in "insert_fields", since it won't be set
        on existing rows.

        Other than that, the user specificies a list of fields
        in the upsert() call. That migt not be all fields. The
        user could decide to leave out optional fields. If we
        end up doing an update, we don't want to overwrite
        those non-specified fields.

        We cannot just take the list of fields the user
        specifies, because as mentioned, some fields
        make modifications to the model on their own.

        We'll have to detect which fields make modifications
        and include them in the list of insert/update fields.
        """

        arg_2 = arg_0.model(**arg_1)
        arg_3 = []
        arg_4 = []

        for arg_5 in arg_2._meta.local_concrete_fields:
            arg_6 = arg_5.default != NOT_PROVIDED
            if (arg_5.name in arg_1 or arg_5.column in arg_1):
                arg_3.append(arg_5)
                arg_4.append(arg_5)
                continue
            elif arg_6:
                arg_3.append(arg_5)
                continue

            # special handling for 'pk' which always refers to
            # the primary key, so if we the user specifies `pk`
            # instead of a concrete field, we have to handle that
            if arg_5.primary_key is True and 'pk' in arg_1:
                arg_3.append(arg_5)
                arg_4.append(arg_5)
                continue

            if arg_0._is_magical_field(arg_2, arg_5, is_insert=True):
                arg_3.append(arg_5)

            if arg_0._is_magical_field(arg_2, arg_5, is_insert=False):
                arg_4.append(arg_5)

        return arg_3, arg_4


(self, epoch, train_set, train_size=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """
        Run one training iteration.
        """
        arg_0.network.train_logger.record_epoch(arg_1 + 1)
        arg_4 = arg_0.train_step(arg_2, arg_3)
        if not arg_1 % arg_0.config.monitor_frequency:
            arg_0.report(dict(arg_4), "train", arg_1)
        arg_0.last_run_costs = arg_4
        return arg_4


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
mapping
[
arg_1
]
except
KeyError
:
raise
web
.
HTTPError
(
404
,
u'Notebook does not exist: %s'
%
arg_1
)
return
arg_0
.
get_path_by_name
(
arg_2
)

def Func(arg_0, arg_1):
        """Return a full path to a notebook given its notebook_id."""
        try:
            arg_2 = arg_0.mapping[arg_1]
        except KeyError:
            raise web.HTTPError(404, u'Notebook does not exist: %s' % arg_1)
        return arg_0.get_path_by_name(arg_2)

Return a full path to a notebook given its notebook_id .


def Func(arg_0):
        """
        Stop the server.

        Halt server client connections and clean up any existing connection
        threads.

        Raises:
            NetworkingError: Raised if a failure occurs while sutting down
                or closing the TLS server socket.
        """
        arg_0._logger.info("Cleaning up remaining connection threads.")

        for arg_1 in threading.enumerate():
            if arg_1 is not threading.current_thread():
                try:
                    arg_1.join(10.0)
                except Exception as e:
                    arg_0._logger.info(
                        "Error occurred while attempting to cleanup thread: "
                        "{0}".format(arg_1.name)
                    )
                    arg_0._logger.exception(e)
                else:
                    if arg_1.is_alive():
                        arg_0._logger.warning(
                            "Cleanup failed for thread: {0}. Thread is "
                            "still alive".format(arg_1.name)
                        )
                    else:
                        arg_0._logger.info(
                            "Cleanup succeeded for thread: {0}".format(
                                arg_1.name
                            )
                        )

        arg_0._logger.info("Shutting down server socket handler.")
        try:
            arg_0._socket.shutdown(socket.SHUT_RDWR)
            arg_0._socket.close()
        except Exception as e:
            arg_0._logger.exception(e)
            raise exceptions.NetworkingError(
                "Server failed to shutdown socket handler."
            )

        if hasattr(arg_0, "policy_monitor"):
            try:
                arg_0.policy_monitor.Func()
                arg_0.policy_monitor.join()
            except Exception as e:
                arg_0._logger.exception(e)
                raise exceptions.ShutdownError(
                    "Server failed to clean up the policy monitor."
                )


return {k: v for (k, v) in self._jsondata.items() if k in self._valid_keys}

def Func ( arg_0 ) : arg_0 . _jsondata [ "items" ] = [ ] for arg_2 in arg_0 . items : arg_0 . _jsondata [ "items" ] . append ( arg_2 . Func ( ) ) arg_0 . _jsondata [ "issue_date" ] = arg_0 . issue_date . isoformat ( ) arg_0 . _jsondata [ "due_date" ] = arg_0 . due_date . isoformat ( ) arg_0 . _jsondata [ "receiver" ] = arg_0 . receiver . Func ( ) return { arg_3 : arg_4 for ( arg_3 , arg_4 ) in arg_0 . _jsondata . items ( ) if arg_3 in arg_0 . _valid_keys }

def Func(arg_0):
        """Convert our Python object to JSON acceptable to Holvi API"""
        arg_0._jsondata["items"] = []
        for arg_2 in arg_0.items:
            arg_0._jsondata["items"].append(arg_2.Func())
        arg_0._jsondata["issue_date"] = arg_0.issue_date.isoformat()
        arg_0._jsondata["due_date"] = arg_0.due_date.isoformat()
        arg_0._jsondata["receiver"] = arg_0.receiver.Func()
        return {arg_3: arg_4 for (arg_3, arg_4) in arg_0._jsondata.items() if arg_3 in arg_0._valid_keys}


def Func ( ) : arg_0 = _request_ctx_stack . top arg_1 = _app_ctx_stack . top arg_2 = { } if arg_1 is not None : arg_2 [ 'g' ] = arg_1 . g if arg_0 is not None : arg_2 [ 'request' ] = arg_0 . request arg_2 [ 'session' ] = arg_0 . session return arg_2

def Func():
    """Default template context processor.  Injects `request`,
    `session` and `g`.
    """
    arg_0 = _request_ctx_stack.top
    arg_1 = _app_ctx_stack.top
    arg_2 = {}
    if arg_1 is not None:
        arg_2['g'] = arg_1.g
    if arg_0 is not None:
        arg_2['request'] = arg_0.request
        arg_2['session'] = arg_0.session
    return arg_2

Default template context processor . Injects request session and g .


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , arg_0 . ZF , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if zero.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, arg_0.ZF, arg_1.read(), arg_0.PC)


def Func(arg_0, arg_1):
        """Get the parameter type information by name.

        Args:
            name (str): The full name of a parameter.

        Returns:
            str: The type name or None if no type information is given.
        """

        arg_0._ensure_loaded()

        if arg_1 not in arg_0.annotated_params:
            return None

        return arg_0.annotated_params[arg_1].type_name

Get the parameter type information by name .


def Func ( arg_0 : arg_1 ) -> bytes : if PY36 : return arg_0 . to_bytes ( 1 , byteorder = "little" ) else : return arg_0 . to_bytes ( 2 , byteorder = "little" )

def Func(arg_0: arg_1) -> bytes:
    """
    Small helper value to pack an index value into bytecode.

    This is used for version compat between 3.5- and 3.6+

    :param index: The item to pack.
    :return: The packed item.
    """
    if PY36:
        return arg_0.to_bytes(1, byteorder="little")
    else:
        return arg_0.to_bytes(2, byteorder="little")

Small helper value to pack an index value into bytecode .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 . func , astroid . Attribute ) : return arg_2 = arg_1 . func . expr arg_3 = safe_infer ( arg_2 ) if ( arg_3 is None or arg_3 is astroid . Uninferable or not isinstance ( arg_3 , astroid . Instance ) ) : return try : arg_4 = arg_3 . _proxied . getattr ( arg_1 . func . attrname ) except exceptions . NotFoundError : return for arg_5 in arg_4 : if arg_5 is astroid . Uninferable : continue if not isinstance ( arg_5 , astroid . FunctionDef ) : continue if decorated_with_property ( arg_5 ) : try : arg_6 = all ( return_node . callable ( ) or return_node is astroid . Uninferable for return_node in arg_5 . infer_call_result ( arg_1 ) ) except astroid . InferenceError : continue if not arg_6 : arg_0 . add_message ( "not-callable" , arg_1 = arg_1 , args = arg_1 . func . as_string ( ) ) break

def Func(arg_0, arg_1):
        """
        Check that the given uninferable Call node does not
        call an actual function.
        """
        if not isinstance(arg_1.func, astroid.Attribute):
            return

        # Look for properties. First, obtain
        # the lhs of the Attribute node and search the attribute
        # there. If that attribute is a property or a subclass of properties,
        # then most likely it's not callable.

        # TODO: since astroid doesn't understand descriptors very well
        # we will not handle them here, right now.

        arg_2 = arg_1.func.expr
        arg_3 = safe_infer(arg_2)
        if (
            arg_3 is None
            or arg_3 is astroid.Uninferable
            or not isinstance(arg_3, astroid.Instance)
        ):
            return

        try:
            arg_4 = arg_3._proxied.getattr(arg_1.func.attrname)
        except exceptions.NotFoundError:
            return

        for arg_5 in arg_4:
            if arg_5 is astroid.Uninferable:
                continue
            if not isinstance(arg_5, astroid.FunctionDef):
                continue

            # Decorated, see if it is decorated with a property.
            # Also, check the returns and see if they are callable.
            if decorated_with_property(arg_5):

                try:
                    arg_6 = all(
                        return_node.callable() or return_node is astroid.Uninferable
                        for return_node in arg_5.infer_call_result(arg_1)
                    )
                except astroid.InferenceError:
                    continue

                if not arg_6:
                    arg_0.add_message(
                        "not-callable", arg_1=arg_1, args=arg_1.func.as_string()
                    )
                    break

Check that the given uninferable Call node does not call an actual function .


(word: str, to_lower: bool = False,
                 append_case: Optional[str] = None)

def Func ( arg_0 : arg_1 , arg_2 : arg_3 = False , arg_4 : arg_5 [ arg_1 ] = None ) -> Tuple [ arg_1 ] : if all ( arg_6 . isupper ( ) for arg_6 in arg_0 ) and len ( arg_0 ) > 1 : arg_7 = "<ALL_UPPER>" elif arg_0 [ 0 ] . isupper ( ) : arg_7 = "<FIRST_UPPER>" else : arg_7 = None if arg_2 : arg_0 = arg_0 . lower ( ) if arg_0 . isdigit ( ) : arg_8 = [ "<DIGIT>" ] elif arg_0 . startswith ( "http://" ) or arg_0 . startswith ( "www." ) : arg_8 = [ "<HTTP>" ] else : arg_8 = list ( arg_0 ) if arg_2 and arg_7 is not None : if arg_4 == "first" : arg_8 = [ arg_7 ] + arg_8 elif arg_4 == "last" : arg_8 = arg_8 + [ arg_7 ] return tuple ( arg_8 )

def Func(arg_0: arg_1, arg_2: arg_3 = False,
                 arg_4: arg_5[arg_1] = None) -> Tuple[arg_1]:
    """Converts word to a tuple of symbols, optionally converts it to lowercase
    and adds capitalization label.

    Args:
        word: input word
        to_lower: whether to lowercase
        append_case: whether to add case mark
            ('<FIRST_UPPER>' for first capital and '<ALL_UPPER>' for all caps)

    Returns:
        a preprocessed word
    """
    if all(arg_6.isupper() for arg_6 in arg_0) and len(arg_0) > 1:
        arg_7 = "<ALL_UPPER>"
    elif arg_0[0].isupper():
        arg_7 = "<FIRST_UPPER>"
    else:
        arg_7 = None
    if arg_2:
        arg_0 = arg_0.lower()
    if arg_0.isdigit():
        arg_8 = ["<DIGIT>"]
    elif arg_0.startswith("http://") or arg_0.startswith("www."):
        arg_8 = ["<HTTP>"]
    else:
        arg_8 = list(arg_0)
    if arg_2 and arg_7 is not None:
        if arg_4 == "first":
            arg_8 = [arg_7] + arg_8
        elif arg_4 == "last":
            arg_8 = arg_8 + [arg_7]
    return tuple(arg_8)

Converts word to a tuple of symbols optionally converts it to lowercase and adds capitalization label .


Draw a 70-char-wide divider, with label in the middle.

Draw a 70 - char - wide divider with label in the middle .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in arg_0 . processes [ : : - 1 ] : if arg_3 . lane not in arg_2 : continue if arg_3 . template == arg_1 : return True return False

def Func(arg_0, arg_1, arg_2):
        """Searches the process tree backwards in search of a provided process

        The search takes into consideration the provided parent lanes and
        searches only those

        Parameters
        ----------
        template : str
            Name of the process template attribute being searched
        parent_lanes : list
            List of integers with the parent lanes to be searched

        Returns
        -------
        bool
            Returns True when the template is found. Otherwise returns False.
        """

        for arg_3 in arg_0.processes[::-1]:

            # Ignore process in different lanes
            if arg_3.lane not in arg_2:
                continue

            # template found
            if arg_3.template == arg_1:
                return True

        return False


(st, rad, invert='guess', minmass=None, use_tp=False,
                  trim_edge=False, **kwargs)

return _feature_guess(im, rad, minmass=minmass, use_tp=use_tp,
                          trim_edge=trim_edge)

def Func(arg_0, arg_1, arg_2='guess', arg_3=None, arg_4=False,
                  arg_5=False, **arg_6):
    """
    Makes a guess at particle positions using heuristic centroid methods.

    Parameters
    ----------
    st : :class:`peri.states.State`
        The state to check adding particles to.
    rad : Float
        The feature size for featuring.
    invert : {'guess', True, False}, optional
        Whether to invert the image; set to True for there are dark
        particles on a bright background, False for bright particles.
        The default is to guess from the state's current particles.
    minmass : Float or None, optional
        The minimum mass/masscut of a particle. Default is ``None`` =
        calculated internally.
    use_tp : Bool, optional
        Whether or not to use trackpy. Default is ``False``, since trackpy
        cuts out particles at the edge.
    trim_edge : Bool, optional
        Whether to trim particles at the edge pixels of the image. Can be
        useful for initial featuring but is bad for adding missing particles
        as they are frequently at the edge. Default is ``False``.

    Returns
    -------
    guess : [N,3] numpy.ndarray
        The featured positions of the particles, sorted in order of decreasing
        feature mass.
    npart : Int
        The number of added particles.
    """
    # FIXME does not use the **kwargs, but needs b/c called with wrong kwargs
    if arg_2 == 'guess':
        arg_2 = guess_invert(arg_0)
    if arg_2:
        arg_7 = 1 - arg_0.residuals
    else:
        arg_7 = arg_0.residuals
    return _Func(arg_7, arg_1, arg_3=arg_3, arg_4=arg_4,
                          arg_5=arg_5)

Makes a guess at particle positions using heuristic centroid methods .


def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
)
:
if
arg_1
is
:
arg_1
=
model_stoch_vol
(
arg_0
)
if
arg_2
is
:
arg_3
,
arg_2
=
plt
.
subplots
(
figsize
=
(
15
,
8
)
)
arg_0
.
abs
(
)
.
plot
(
arg_2
=
arg_2
)
arg_2
.
plot
(
arg_0
.
index
,
np
.
exp
(
arg_1
[
's'
,
:
:
30
]
.
T
)
,
'r'
,
alpha
=
.03
)
arg_2
.
set
(
title
=
'Stochastic volatility'
,
xlabel
=
'Time'
,
ylabel
=
'Volatility'
)
arg_2
.
legend
(
[
'Abs returns'
,
'Stochastic volatility process'
]
,
frameon
=
True
,
framealpha
=
0.5
)
return
arg_2

def Func(arg_0, arg_1=None, arg_2=None):
    """
    Generate plot for stochastic volatility model.

    Parameters
    ----------
    data : pandas.Series
        Returns to model.
    trace : pymc3.sampling.BaseTrace object, optional
        trace as returned by model_stoch_vol
        If not passed, sample from model.
    ax : matplotlib.axes object, optional
        Plot into axes object

    Returns
    -------
    ax object

    See Also
    --------
    model_stoch_vol : run stochastic volatility model
    """

    if arg_1 is None:
        arg_1 = model_stoch_vol(arg_0)

    if arg_2 is None:
        arg_3, arg_2 = plt.subplots(figsize=(15, 8))

    arg_0.abs().plot(arg_2=arg_2)
    arg_2.plot(arg_0.index, np.exp(arg_1['s', ::30].T), 'r', alpha=.03)
    arg_2.set(title='Stochastic volatility', xlabel='Time', ylabel='Volatility')
    arg_2.legend(['Abs returns', 'Stochastic volatility process'],
              frameon=True, framealpha=0.5)

    return arg_2

Generate plot for stochastic volatility model .


def Func ( arg_0 , arg_1 ) : if arg_1 in arg_0 . active_ns : del arg_0 . active_ns [ arg_1 ] if len ( arg_0 . active_ns ) == 0 and arg_0 . connected : arg_0 . kill ( detach = True )

def Func(arg_0, arg_1):
        """This removes a Namespace object from the socket.

        This is usually called by
        :meth:`~socketio.namespace.BaseNamespace.disconnect`.

        """
        if arg_1 in arg_0.active_ns:
            del arg_0.active_ns[arg_1]

        if len(arg_0.active_ns) == 0 and arg_0.connected:
            arg_0.kill(detach=True)

This removes a Namespace object from the socket .


def Func(arg_0):
    """Build the Application Default Credentials from file."""
    # read the credentials from the file
    with open(arg_0) as file_obj:
        arg_1 = json.load(file_obj)

    arg_2 = arg_1.get('type')
    if arg_2 == AUTHORIZED_USER:
        arg_3 = set(['client_id', 'client_secret', 'refresh_token'])
    elif arg_2 == SERVICE_ACCOUNT:
        arg_3 = set(['client_id', 'client_email', 'private_key_id',
                               'private_key'])
    else:
        raise ApplicationDefaultCredentialsError(
            "'type' field should be defined (and have one of the '" +
            AUTHORIZED_USER + "' or '" + SERVICE_ACCOUNT + "' values)")

    arg_4 = arg_3.difference(arg_1.keys())

    if arg_4:
        _raise_exception_for_missing_fields(arg_4)

    if arg_1['type'] == AUTHORIZED_USER:
        return GoogleCredentials(
            access_token=None,
            client_id=arg_1['client_id'],
            client_secret=arg_1['client_secret'],
            refresh_token=arg_1['refresh_token'],
            token_expiry=None,
            token_uri=oauth2client.GOOGLE_TOKEN_URI,
            user_agent='Python client library')
    else:  # client_credentials['type'] == SERVICE_ACCOUNT
        from oauth2client import service_account
        return service_account._JWTAccessCredentials.from_json_keyfile_dict(
            arg_1)

Build the Application Default Credentials from file .


def Func ( arg_0 ) : arg_0 = tf . as_dtype ( arg_0 ) if hasattr ( arg_0 , 'Func' ) : return arg_0 . Func return np . issubdtype ( np . dtype ( arg_0 ) , np . complex )

def Func(arg_0):
  """Returns whether this is a complex floating point type."""
  arg_0 = tf.as_dtype(arg_0)
  if hasattr(arg_0, 'Func'):
    return arg_0.Func
  return np.issubdtype(np.dtype(arg_0), np.complex)

Returns whether this is a complex floating point type .


return self.dist_abs(src, tar) / max_length

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 == arg_1 : return 0.0 if not arg_1 or not arg_2 : return 1.0 arg_3 = max ( len ( arg_1 ) , len ( arg_2 ) ) return arg_0 . Func_abs ( arg_1 , arg_2 ) / arg_3

def Func(arg_0, arg_1, arg_2):
        """Return the normalized bag Funcance between two strings.

        Bag Funcance is normalized by dividing by :math:`max( |src|, |tar| )`.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Normalized bag Funcance

        Examples
        --------
        >>> cmp = Bag()
        >>> cmp.Func('cat', 'hat')
        0.3333333333333333
        >>> cmp.Func('Niall', 'Neil')
        0.4
        >>> cmp.Func('aluminum', 'Catalan')
        0.625
        >>> cmp.Func('ATCG', 'TAGC')
        0.0

        """
        if arg_2 == arg_1:
            return 0.0
        if not arg_1 or not arg_2:
            return 1.0

        arg_3 = max(len(arg_1), len(arg_2))

        return arg_0.Func_abs(arg_1, arg_2) / arg_3

Return the normalized bag distance between two strings.

        Bag distance is normalized by dividing by :math:`max( |src|, |tar| )`.

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            Normalized bag distance

        Examples
        --------
        >>> cmp = Bag()
        >>> cmp.dist('cat', 'hat')
        0.3333333333333333
        >>> cmp.dist('Niall', 'Neil')
        0.4
        >>> cmp.dist('aluminum', 'Catalan')
        0.625
        >>> cmp.dist('ATCG', 'TAGC')
        0.0

Return the normalized bag distance between two strings .


def Func ( arg_0 ) : if inspect . isclass ( arg_0 ) : arg_0 = arg_0 . __init__ if not inspect . isfunction ( arg_0 ) : return [ ] , False arg_1 = inspect . signature ( arg_0 ) . parameters arg_2 = [ ] arg_3 = False for arg_4 in arg_1 . values ( ) : if ( arg_4 . kind == inspect . Parameter . POSITIONAL_OR_KEYWORD or arg_4 . kind == inspect . Parameter . KEYWORD_ONLY ) : arg_2 . append ( arg_4 . name ) elif arg_4 . kind == inspect . Parameter . VAR_KEYWORD : arg_3 = True return arg_2 , arg_3

def Func(arg_0):
    """Helper function to support both Python versions"""
    if inspect.isclass(arg_0):
        arg_0 = arg_0.__init__
    if not inspect.isfunction(arg_0):
        # Init function not existing
        return [], False
    arg_1 = inspect.signature(arg_0).parameters
    arg_2 = []
    arg_3 = False
    for arg_4 in arg_1.values():
        if (arg_4.kind == inspect.Parameter.POSITIONAL_OR_KEYWORD or
                    arg_4.kind == inspect.Parameter.KEYWORD_ONLY):
            arg_2.append(arg_4.name)
        elif arg_4.kind == inspect.Parameter.VAR_KEYWORD:
            arg_3 = True
    return arg_2, arg_3


def Func ( arg_0 ) : arg_1 = record_get_field_instances ( arg_0 . record , '024' , ind1 = "7" ) arg_2 = { } for arg_3 in arg_1 : arg_4 = field_get_subfield_instances ( arg_3 ) arg_5 = dict ( arg_4 ) if arg_5 . get ( 'a' ) : if arg_5 [ 'a' ] in arg_2 : record_delete_field ( arg_0 . record , tag = '024' , ind1 = '7' , field_position_global = arg_3 [ 4 ] ) continue arg_2 [ arg_5 [ 'a' ] ] = arg_3

def Func(arg_0):
        """Remove duplicate BibMatch DOIs."""
        arg_1 = record_get_field_instances(arg_0.record, '024', ind1="7")
        arg_2 = {}
        for arg_3 in arg_1:
            arg_4 = field_get_subfield_instances(arg_3)
            arg_5 = dict(arg_4)
            if arg_5.get('a'):
                if arg_5['a'] in arg_2:
                    record_delete_field(arg_0.record, tag='024', ind1='7', field_position_global=arg_3[4])
                    continue
                arg_2[arg_5['a']] = arg_3


def Func(arg_0, arg_1):
        """
        target record must have been set
        """
        for arg_2 in arg_1.keys:
            if arg_2 in arg_0._record_hooks:
                arg_3 = arg_1.target_record.get_field_descriptor(arg_1.target_index)
                raise FieldValidationError(
                    f"Reference key already exists, can't create: {key}. "
                    f"{field_descriptor.get_error_location_message(hook.target_value, hook.target_index)}"
                )
            arg_0._record_hooks[arg_2] = arg_1


(self, referrers_file_path='', views_file_path='',
        clones_file_path='', date=(datetime.date.today()), organization='llnl',
        views_row_count=0, clones_row_count=0)

def Func ( arg_0 , arg_1 = '' , arg_2 = '' , arg_3 = '' , arg_4 = ( arg_5 . date . today ( ) ) , arg_7 = 'llnl' , arg_8 = 0 , arg_9 = 0 ) : arg_0 . write_referrers_to_file ( file_path = arg_1 ) arg_0 . write_data_to_file ( file_path = arg_2 , dict_to_write = arg_0 . views , name = 'views' , row_count = arg_8 ) arg_0 . write_data_to_file ( file_path = arg_3 , dict_to_write = arg_0 . clones , name = 'clones' , row_count = arg_9 )

def Func(arg_0, arg_1='', arg_2='',
        arg_3='', arg_4=(arg_5.date.today()), arg_7='llnl',
        arg_8=0, arg_9=0):
        """
        Writes all traffic data to file.
        """
        arg_0.write_referrers_to_file(file_path=arg_1)
        arg_0.write_data_to_file(file_path=arg_2,
            dict_to_write=arg_0.views, name='views',
            row_count=arg_8)
        arg_0.write_data_to_file(file_path=arg_3,
            dict_to_write=arg_0.clones, name='clones',
            row_count=arg_9)


def Func ( arg_0 , arg_1 ) : try : return True if arg_1 in arg_0 . cache else False except TypeError : return False

def Func(arg_0, arg_1):
        """Checks if specified URL is cached."""
        try:
            return True if arg_1 in arg_0.cache else False
        except TypeError:
            return False


(self, filename, destination, context=None, use_jinja=False,
                        template_dir=None, use_sudo=False, backup=True,
                        mirror_local_mode=False, mode=None,
                        mkdir=False, chown=False, user=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
,
arg_4
=
False
,
arg_5
=
,
arg_6
=
False
,
arg_7
=
True
,
arg_8
=
False
,
arg_9
=
,
arg_10
=
False
,
arg_11
=
False
,
arg_12
=
)
:
if
arg_10
:
arg_13
=
os
.
path
.
dirname
(
arg_2
)
if
arg_6
:
arg_0
.
sudo
(
'mkdir -p %s'
%
quote
(
arg_13
)
,
arg_12
=
arg_12
)
else
:
arg_0
.
run
(
'mkdir -p %s'
%
quote
(
arg_13
)
)
if
not
arg_0
.
dryrun
:
_Func
(
arg_1
=
arg_1
,
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
,
arg_6
=
arg_6
,
arg_7
=
arg_7
,
arg_8
=
arg_8
,
arg_9
=
arg_9
,
)
if
arg_11
:
if
arg_12
is
:
arg_12
=
arg_0
.
genv
.
user
run_as_root
(
'chown %s: %s'
%
(
arg_12
,
quote
(
arg_2
)
)
)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False,
                        arg_5=None, arg_6=False, arg_7=True,
                        arg_8=False, arg_9=None,
                        arg_10=False, arg_11=False, arg_12=None):
        """
        Upload a template file.

        This is a wrapper around :func:`fabric.contrib.files.Func`
        that adds some extra parameters.

        If ``mkdir`` is True, then the remote directory will be created, as
        the current user or as ``user`` if specified.

        If ``chown`` is True, then it will ensure that the current user (or
        ``user`` if specified) is the owner of the remote file.
        """

        if arg_10:
            arg_13 = os.path.dirname(arg_2)
            if arg_6:
                arg_0.sudo('mkdir -p %s' % quote(arg_13), arg_12=arg_12)
            else:
                arg_0.run('mkdir -p %s' % quote(arg_13))

        if not arg_0.dryrun:
            _Func(
                arg_1=arg_1,
                arg_2=arg_2,
                arg_3=arg_3,
                arg_4=arg_4,
                arg_5=arg_5,
                arg_6=arg_6,
                arg_7=arg_7,
                arg_8=arg_8,
                arg_9=arg_9,
            )

        if arg_11:
            if arg_12 is None:
                arg_12 = arg_0.genv.user
            run_as_root('chown %s: %s' % (arg_12, quote(arg_2)))

Upload a template file.

        This is a wrapper around :func:`fabric.contrib.files.upload_template`
        that adds some extra parameters.

        If ``mkdir`` is True, then the remote directory will be created, as
        the current user or as ``user`` if specified.

        If ``chown`` is True, then it will ensure that the current user (or
        ``user`` if specified) is the owner of the remote file.


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = int ( environ . get ( 'TERMINAL_COLOR_MIDPOINT' , None ) ) except : pass if not arg_3 : arg_4 = environ . get ( 'TERM' , None ) print ( "midpoint" , arg_3 , 'vs' , ( 16 * 5 + 16 * arg_1 + 16 * arg_2 ) ) arg_3 = 383 if arg_4 and arg_4 == 'xterm-256color' else 117963 if ( ( 16 * 5 + 16 * arg_1 + 16 * arg_2 ) < arg_3 ) : return True else : return False

def Func(arg_0, arg_1, arg_2):
    """Pass as parameters R G B values in hex
    On return, variable is_dark_bg is set
    """

    try:
        arg_3 = int(environ.get('TERMINAL_COLOR_MIDPOINT', None))
    except:
        pass
    if not arg_3:
        arg_4 = environ.get('TERM', None)
        # 117963 = (* .6 (+ 65535 65535 65535))
        # 382.5 = (* .6 (+ 65535 65535 65535))
        print("midpoint", arg_3, 'vs',  (16*5 + 16*arg_1 + 16*arg_2))
        arg_3 = 383 if arg_4 and arg_4 == 'xterm-256color' else 117963

    if ( (16*5 + 16*arg_1 + 16*arg_2) < arg_3 ):
        return True
    else:
        return False

Pass as parameters R G B values in hex On return variable is_dark_bg is set


def Func(arg_0=arg_1.path.curdir, arg_4=None):
    """Find vdwradii.dat and add special entries for lipids.

    See :data:`gromacs.setup.vdw_lipid_resnames` for lipid
    resnames. Add more if necessary.
    """
    arg_5 = arg_1.path.join(arg_0, "vdwradii.dat")

    if arg_4 is not None:
        arg_6 = arg_1.path.join(arg_4, 'vdwradii.dat')  # canonical name
        if not arg_1.path.exists(arg_6):
            arg_7 = 'No VDW database file found in {filename!r}.'.format(**vars())
            logger.exception(arg_7)
            raise OSError(arg_7, errno.ENOENT)
    else:
        try:
            arg_6 = arg_1.path.join(arg_1.environ['GMXLIB'], 'vdwradii.dat')
        except KeyError:
            try:
                arg_6 = arg_1.path.join(arg_1.environ['GMXDATA'], 'top', 'vdwradii.dat')
            except KeyError:
                arg_7 = "Cannot find vdwradii.dat. Set GMXLIB (point to 'top') or GMXDATA ('share/gromacs')."
                logger.exception(arg_7)
                raise OSError(arg_7, errno.ENOENT)
    if not arg_1.path.exists(arg_6):
        arg_7 = "Cannot find {filename!r}; something is wrong with the Gromacs installation.".format(**vars())
        logger.exception(arg_7, errno.ENOENT)
        raise OSError(arg_7)

    # make sure to catch 3 and 4 letter resnames
    arg_8 = vdw_lipid_resnames + list({x[:3] for x in vdw_lipid_resnames})
    # TODO: should do a tempfile...
    with open(arg_5, 'w') as outfile:
        # write lipid stuff before general
        outfile.write('; Special larger vdw radii for solvating lipid membranes\n')
        for arg_9 in arg_8:
            for arg_10,arg_11 in vdw_lipid_atom_radii.items():
                outfile.write('{resname:4!s} {atom:<5!s} {radius:5.3f}\n'.format(**vars()))
        with open(arg_6, 'r') as infile:
            for arg_12 in infile:
                outfile.write(arg_12)
    logger.debug('Created lipid vdW radii file {vdwradii_dat!r}.'.format(**vars()))
    return realpath(arg_5)

Find vdwradii . dat and add special entries for lipids .


def
Func
(
)
:
arg_0
=
Config
(
)
arg_1
=
HostSearch
(
)
arg_2
=
arg_1
.
get_hosts
(
tags
=
[
'!nessus'
]
,
up
=
True
)
arg_2
=
[
arg_10
for
arg_10
in
arg_2
]
arg_3
=
","
.
join
(
[
str
(
arg_10
.
address
)
for
arg_10
in
arg_2
]
)
arg_4
=
arg_0
.
get
(
'nessus'
,
'host'
)
arg_5
=
arg_0
.
get
(
'nessus'
,
'access_key'
)
arg_6
=
arg_0
.
get
(
'nessus'
,
'secret_key'
)
arg_7
=
arg_0
.
get
(
'nessus'
,
'template_name'
)
arg_8
=
Nessus
(
arg_5
,
arg_6
,
arg_4
,
arg_7
)
arg_9
=
arg_8
.
create_scan
(
arg_3
)
arg_8
.
start_scan
(
arg_9
)
for
arg_10
in
arg_2
:
arg_10
.
add_tag
(
'nessus'
)
arg_10
.
save
(
)
Logger
(
)
.
log
(
"nessus"
,
"Nessus scan started on {} hosts"
.
format
(
len
(
arg_2
)
)
,
{
'scanned_hosts'
:
len
(
arg_2
)
}
)

def Func():
    """
        This function obtains hosts from core and starts a nessus scan on these hosts.
        The nessus tag is appended to the host tags.
    """
    arg_0 = Config()
    arg_1 = HostSearch()
    arg_2 = arg_1.get_hosts(tags=['!nessus'], up=True)
    arg_2 = [arg_10 for arg_10 in arg_2]
    arg_3 = ",".join([str(arg_10.address) for arg_10 in arg_2])

    arg_4 = arg_0.get('nessus', 'host')
    arg_5 = arg_0.get('nessus', 'access_key')
    arg_6 = arg_0.get('nessus', 'secret_key')
    arg_7 = arg_0.get('nessus', 'template_name')

    arg_8 = Nessus(arg_5, arg_6, arg_4, arg_7)

    arg_9 = arg_8.create_scan(arg_3)
    arg_8.start_scan(arg_9)

    for arg_10 in arg_2:
        arg_10.add_tag('nessus')
        arg_10.save()

    Logger().log("nessus", "Nessus scan started on {} hosts".format(len(arg_2)), {'scanned_hosts': len(arg_2)})

This function obtains hosts from core and starts a nessus scan on these hosts . The nessus tag is appended to the host tags .


def Func(arg_0, arg_1):
        """
        Update information in this object from another H2OCluster instance.

        :param H2OCluster other: source of the new information for this object.
        """
        arg_0._props = arg_1._props
        arg_0._retrieved_at = arg_1._retrieved_at
        arg_1._props = {}
        arg_1._retrieved_at = None

Update information in this object from another H2OCluster instance .


def Func ( arg_0 , arg_1 = False ) : try : if not check_if_file_exists ( arg_0 , arg_1 = arg_1 ) : return [ ] with codecs . open ( arg_0 , "r" , encoding = "utf-8" ) as f : arg_2 = f . readlines ( ) if sys . version_info [ 0 ] < 3 : arg_2 = [ str ( item . encode ( 'utf8' ) ) for item in arg_2 ] arg_2 = [ item . strip ( ) for item in arg_2 ] return [ arg_3 for arg_3 in arg_2 if arg_3 ] except Exception as exception : print ( str ( exception ) ) return [ ]

def Func(arg_0, arg_1=False):
    """
        Reads list from file. One line - one item.
        Returns the list if file items.
    """
    try:
        if not check_if_file_exists(arg_0, arg_1=arg_1):
            return []
        with codecs.open(arg_0, "r", encoding="utf-8") as f:
            arg_2 = f.readlines()
            if sys.version_info[0] < 3:
                arg_2 = [str(item.encode('utf8')) for item in arg_2]
            arg_2 = [item.strip() for item in arg_2]
            return [arg_3 for arg_3 in arg_2 if arg_3]
    except Exception as exception:
        print(str(exception))
        return []

Reads list from file . One line - one item . Returns the list if file items .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
u'json'
)
:
arg_2
=
unicode
(
arg_2
)
if
arg_2
not
in
arg_0
.
allowed_formats
:
raise
web
.
HTTPError
(
415
,
u'Invalid notebook format: %s'
%
arg_2
)
arg_3
,
arg_4
=
arg_0
.
Func_object
(
arg_1
)
arg_5
=
{
}
if
arg_2
==
'json'
:
arg_5
[
'split_lines'
]
=
False
arg_6
=
current
.
writes
(
arg_4
,
arg_2
,
**
arg_5
)
arg_7
=
arg_4
.
metadata
.
get
(
'name'
,
'notebook'
)
return
arg_3
,
arg_7
,
arg_6

def Func(arg_0, arg_1, arg_2=u'json'):
        """Get the representation of a notebook in format by notebook_id."""
        arg_2 = unicode(arg_2)
        if arg_2 not in arg_0.allowed_formats:
            raise web.HTTPError(415, u'Invalid notebook format: %s' % arg_2)
        arg_3, arg_4 = arg_0.Func_object(arg_1)
        arg_5 = {}
        if arg_2 == 'json':
            # don't split lines for sending over the wire, because it
            # should match the Python in-memory format.
            arg_5['split_lines'] = False
        arg_6 = current.writes(arg_4, arg_2, **arg_5)
        arg_7 = arg_4.metadata.get('name','notebook')
        return arg_3, arg_7, arg_6

Get the representation of a notebook in format by notebook_id .


return [None if not utils.hasDoc(entry) else
                utils.parseProtobufObj(entry.doc)
                for entry in response.entry]

def Func ( arg_0 , arg_1 ) : arg_2 = { 'au' : '1' } arg_3 = googleplay_pb2 . BulkDetailsRequest ( ) arg_3 . docid . extend ( arg_1 ) arg_4 = arg_3 . SerializeToString ( ) arg_5 = arg_0 . executeRequestApi2 ( BULK_URL , post_data = arg_4 . decode ( "utf-8" ) , content_type = CONTENT_TYPE_PROTO , arg_2 = arg_2 ) arg_6 = arg_5 . payload . FuncResponse return [ None if not utils . hasDoc ( arg_7 ) else utils . parseProtobufObj ( arg_7 . doc ) for arg_7 in arg_6 . entry ]

def Func(arg_0, arg_1):
        """Get several apps details from a list of package names.

        This is much more efficient than calling N times details() since it
        requires only one request. If an item is not found it returns an empty object
        instead of throwing a RequestError('Item not found') like the details() function

        Args:
            packageNames (list): a list of app IDs (usually starting with 'com.').

        Returns:
            a list of dictionaries containing docv2 data, or None
            if the app doesn't exist"""

        arg_2 = {'au': '1'}
        arg_3 = googleplay_pb2.BulkDetailsRequest()
        arg_3.docid.extend(arg_1)
        arg_4 = arg_3.SerializeToString()
        arg_5 = arg_0.executeRequestApi2(BULK_URL,
                                          post_data=arg_4.decode("utf-8"),
                                          content_type=CONTENT_TYPE_PROTO,
                                          arg_2=arg_2)
        arg_6 = arg_5.payload.FuncResponse
        return [None if not utils.hasDoc(arg_7) else
                utils.parseProtobufObj(arg_7.doc)
                for arg_7 in arg_6.entry]

Get several apps details from a list of package names .


def Func():
    """Cleans up temporary resources

    Tries to Func up:

    1. The temporary update branch used during ``temple update``
    2. The primary update branch used during ``temple update``
    """
    temple.check.in_git_repo()

    arg_0 = _get_current_branch()
    arg_1 = temple.constants.UPDATE_BRANCH_NAME
    arg_2 = temple.constants.TEMP_UPDATE_BRANCH_NAME

    if arg_0 in (arg_1, arg_2):
        arg_3 = (
            'You must change from the "{}" branch since it will be deleted during Funcup'
        ).format(arg_0)
        raise temple.exceptions.InvalidCurrentBranchError(arg_3)

    if temple.check._has_branch(arg_1):
        temple.utils.shell('git branch -D {}'.format(arg_1))
    if temple.check._has_branch(arg_2):
        temple.utils.shell('git branch -D {}'.format(arg_2))

Cleans up temporary resources

    Tries to clean up:

    1. The temporary update branch used during ``temple update``
    2. The primary update branch used during ``temple update``


def Func(arg_0):
        """
        load declaratoins from _declr method
        This function is called first for parent and then for children
        """
        if not hasattr(arg_0, "_interfaces"):
            arg_0._interfaces = []
        arg_0._setAttrListener = arg_0._declrCollector
        arg_0._declr()
        arg_0._setAttrListener = None

        for arg_3 in arg_0._interfaces:
            arg_3._isExtern = arg_0._isExtern
            arg_3.Func()

        for arg_5 in arg_0._params:
            arg_5.setReadOnly()

        if arg_0._isExtern:
            # direction from inside of unit (reverset compared to outside direction)
            if arg_0._direction == INTF_DIRECTION.UNKNOWN:
                arg_0._direction = INTF_DIRECTION.MASTER
            arg_0._setDirectionsLikeIn(arg_0._direction)


return value if self.set(key, value) else None

def Func(arg_0, arg_1, arg_2=1):
        """Increments the value of a key by `delta`.  If the key does
        not yet exist it is initialized with `delta`.

        For supporting caches this is an atomic operation.

        :param key: the key to Funcrement.
        :param delta: the delta to add.
        :returns: The new value or ``None`` for backend errors.
        """
        arg_3 = (arg_0.get(arg_1) or 0) + arg_2
        return arg_3 if arg_0.set(arg_1, arg_3) else None

Increments the value of a key by `delta`.  If the key does
        not yet exist it is initialized with `delta`.

        For supporting caches this is an atomic operation.

        :param key: the key to increment.
        :param delta: the delta to add.
        :returns: The new value or ``None`` for backend errors.

Increments the value of a key by delta . If the key does not yet exist it is initialized with delta .


def Func ( arg_0 , arg_1 ) : arg_2 = '' if arg_1 [ 'content_type' ] in [ 'course' , 'program' ] : arg_2 = arg_1 . get ( 'card_image_url' ) elif arg_1 [ 'content_type' ] == 'courserun' : arg_2 = arg_1 . get ( 'image_url' ) return arg_2

def Func(arg_0, arg_1):
        """
        Return the image URI of the content item.
        """
        arg_2 = ''
        if arg_1['content_type'] in ['course', 'program']:
            arg_2 = arg_1.get('card_image_url')
        elif arg_1['content_type'] == 'courserun':
            arg_2 = arg_1.get('image_url')

        return arg_2

Return the image URI of the content item .


(obj, ignore_auto=True, ignore_relations=True,
        exclude=[])

def Func ( arg_0 , arg_1 = True , arg_2 = True , arg_3 = [ ] ) : from django . db . models import ( AutoField , ForeignKey , ManyToManyField , ManyToOneRel , OneToOneField , OneToOneRel ) for arg_4 in arg_0 . _meta . get_fields ( ) : if arg_1 and isinstance ( arg_4 , AutoField ) : continue if arg_2 and ( isinstance ( arg_4 , ForeignKey ) or isinstance ( arg_4 , ManyToManyField ) or isinstance ( arg_4 , ManyToOneRel ) or isinstance ( arg_4 , OneToOneRel ) or isinstance ( arg_4 , OneToOneField ) ) : arg_5 = 1 arg_5 continue if arg_4 . name in arg_3 : continue yield arg_4 . name

def Func(arg_0, arg_1=True, arg_2=True,
        arg_3=[]):
    """Returns the field names of a Django model object.

    :param obj: the Django model class or object instance to get the fields
        from
    :param ignore_auto: ignore any fields of type AutoField. Defaults to True
    :param ignore_relations: ignore any fields that involve relations such as
        the ForeignKey or ManyToManyField
    :param exclude: exclude anything in this list from the results

    :returns: generator of found field names
    """

    from django.db.models import (AutoField, ForeignKey, ManyToManyField,
        ManyToOneRel, OneToOneField, OneToOneRel)

    for arg_4 in arg_0._meta.get_fields():
        if arg_1 and isinstance(arg_4, AutoField):
            continue

        if arg_2 and (isinstance(arg_4, ForeignKey) or
                isinstance(arg_4, ManyToManyField) or
                isinstance(arg_4, ManyToOneRel) or
                isinstance(arg_4, OneToOneRel) or
                isinstance(arg_4, OneToOneField)):
            # optimization is killing coverage measure, have to put no-op that
            # does something
            arg_5 = 1; arg_5
            continue

        if arg_4.name in arg_3:
            continue

        yield arg_4.name

Returns the field names of a Django model object .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_model ( 'consent' , 'DataSharingConsent' ) arg_3 = arg_0 . get_model ( 'enterprise' , 'EnterpriseCourseEnrollment' ) arg_4 = arg_0 . get_model ( 'auth' , 'User' ) for arg_5 in arg_3 . objects . all ( ) : arg_6 = arg_4 . objects . get ( pk = arg_5 . enterprise_customer_user . user_id ) arg_7 , arg_8 = arg_2 . objects . get_or_create ( username = arg_6 . username , enterprise_customer = arg_5 . enterprise_customer_user . enterprise_customer , course_id = arg_5 . course_id , ) if arg_5 . consent_granted is not None : arg_7 . granted = arg_5 . consent_granted else : arg_10 = arg_5 . enterprise_customer_user . data_sharing_consent . first ( ) if arg_10 is not None : arg_7 . granted = arg_10 . state in [ 'enabled' , 'external' ] else : arg_7 . granted = False arg_7 . save ( )

def Func(arg_0, arg_1):
    """
    Populates the ``DataSharingConsent`` model with the ``enterprise`` application's consent data.

    Consent data from the ``enterprise`` application come from the ``EnterpriseCourseEnrollment`` model.
    """
    arg_2 = arg_0.get_model('consent', 'DataSharingConsent')
    arg_3 = arg_0.get_model('enterprise', 'EnterpriseCourseEnrollment')
    arg_4 = arg_0.get_model('auth', 'User')
    for arg_5 in arg_3.objects.all():
        arg_6 = arg_4.objects.get(pk=arg_5.enterprise_customer_user.user_id)
        arg_7, arg_8 = arg_2.objects.get_or_create(
            username=arg_6.username,
            enterprise_customer=arg_5.enterprise_customer_user.enterprise_customer,
            course_id=arg_5.course_id,
        )
        if arg_5.consent_granted is not None:
            arg_7.granted = arg_5.consent_granted
        else:
            # Check UDSCA instead.
            arg_10 = arg_5.enterprise_customer_user.data_sharing_consent.first()
            if arg_10 is not None:
                arg_7.granted = arg_10.state in ['enabled', 'external']
            else:
                arg_7.granted = False
        arg_7.save()

Populates the DataSharingConsent model with the enterprise application s consent data .


def Func(arg_0, arg_1):
  """
  Translate coordinates into an index, using the given coordinate system.

  Similar to ``numpy.ravel_multi_index``.

  :param coordinates: (list of ints) A list of coordinates of length
         ``dimensions.size()``.

  :param dimensions: (list of ints) The coordinate system.

  :returns: (int) The index of the point. The coordinates are expressed as a
            single index by using the dimensions as a mixed radix definition.
            For example, in dimensions 42x10, the point [1, 4] is index
            1*420 + 4*10 = 460.
  """
  arg_2 = 0
  for arg_3, arg_4 in enumerate(arg_1):
    arg_2 *= arg_4
    arg_2 += arg_0[arg_3]

  return arg_2

Translate coordinates into an index using the given coordinate system .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_0 . _state [ 'swarms' ] . iteritems ( ) : if arg_4 [ 'sprintIdx' ] == arg_1 : arg_2 . append ( arg_3 ) return arg_2

def Func(arg_0, arg_1):
    """Return the list of all swarms in the given sprint.

    Parameters:
    ---------------------------------------------------------------------
    retval:   list of active swarm Ids in the given sprint
    """
    arg_2 = []
    for arg_3, arg_4 in arg_0._state['swarms'].iteritems():
      if arg_4['sprintIdx'] == arg_1:
        arg_2.append(arg_3)

    return arg_2

Return the list of all swarms in the given sprint .


return self.deepcopy(self.x + x, self.y + y)

def Func ( arg_0 , arg_1 = 0 , arg_2 = 0 ) : return arg_0 . deepcopy ( arg_0 . x + arg_1 , arg_0 . y + arg_2 )

def Func(arg_0, arg_1=0, arg_2=0):
        """
        Move the keypoint around on an image.

        Parameters
        ----------
        x : number, optional
            Move by this value on the x axis.

        y : number, optional
            Move by this value on the y axis.

        Returns
        -------
        imgaug.Keypoint
            Keypoint object with new coordinates.

        """
        return arg_0.deepcopy(arg_0.x + arg_1, arg_0.y + arg_2)


return str(xunit.any_float(min_value=min_value, max_value=max_value, precision=precision))

def Func ( arg_0 , ** arg_1 ) : arg_2 = 0 arg_3 = 100 from django . core . validators import MinValueValidator , MaxValueValidator for arg_4 in arg_0 . validators : if isinstance ( arg_4 , MinValueValidator ) : arg_2 = arg_4 . limit_value if isinstance ( arg_4 , MaxValueValidator ) : arg_3 = arg_4 . limit_value arg_2 = arg_1 . get ( 'min_value' , arg_2 ) arg_3 = arg_1 . get ( 'max_value' , arg_3 ) arg_5 = arg_1 . get ( 'precision' , 3 ) return str ( xunit . any_float ( arg_2 = arg_2 , arg_3 = arg_3 , arg_5 = arg_5 ) )

def Func(arg_0, **arg_1):
    """
    Return random value for FloatField

    >>> result = any_form_field(forms.FloatField(max_value=200, min_value=100))
    >>> type(result)
    <type 'str'>
    >>> float(result) >=100, float(result) <=200
    (True, True)
    """
    arg_2 = 0
    arg_3 = 100
    from django.core.validators import MinValueValidator, MaxValueValidator
    for arg_4 in arg_0.validators:
        if isinstance(arg_4, MinValueValidator):
            arg_2 = arg_4.limit_value
        if isinstance(arg_4, MaxValueValidator):
            arg_3 = arg_4.limit_value

    arg_2 = arg_1.get('min_value', arg_2)
    arg_3 = arg_1.get('max_value', arg_3)
    arg_5 = arg_1.get('precision', 3)

    return str(xunit.any_float(arg_2=arg_2, arg_3=arg_3, arg_5=arg_5))


(text, out_filepath, color='', box_size=10, pixel_size=1850)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
''
,
arg_3
=
10
,
arg_4
=
1850
)
:
try
:
arg_5
=
qrcode
.
QRCode
(
version
=
1
,
error_correction
=
qrcode
.
constants
.
ERROR_CORRECT_L
,
arg_3
=
arg_3
,
border
=
0
,
)
arg_5
.
add_data
(
arg_0
)
arg_5
.
make
(
fit
=
True
)
except
Exception
as
exc
:
raise
Exception
(
'Error trying to generate QR code '
' from `vcard_string`: {}'
.
format
(
arg_0
)
)
from
exc
else
:
arg_6
=
arg_5
.
make_image
(
image_factory
=
qrcode
.
image
.
svg
.
SvgPathImage
)
arg_7
=
_qrcode_to_file
(
arg_6
,
arg_1
)
if
arg_2
:
replace_file_content
(
arg_1
,
'fill:#000000'
,
'fill:#{}'
.
format
(
arg_2
)
)

def Func(arg_0, arg_1, arg_2='', arg_3=10, arg_4=1850):
    """ Save `text` in a qrcode svg image file.

    Parameters
    ----------
    text: str
        The string to be codified in the QR image.

    out_filepath: str
        Path to the output file

    color: str
        A RGB color expressed in 6 hexadecimal values.

    box_size: scalar
        Size of the QR code boxes.
    """
    try:
        arg_5 = qrcode.QRCode(version=1, error_correction=qrcode.constants.ERROR_CORRECT_L,
                           arg_3=arg_3, border=0, )
        arg_5.add_data(arg_0)
        arg_5.make(fit=True)
    except Exception as exc:
        raise Exception('Error trying to generate QR code '
                        ' from `vcard_string`: {}'.format(arg_0)) from exc
    else:
        arg_6 = arg_5.make_image(image_factory=qrcode.image.svg.SvgPathImage)

    arg_7 = _qrcode_to_file(arg_6, arg_1)

    if arg_2:
        replace_file_content(arg_1, 'fill:#000000', 'fill:#{}'.format(arg_2))


return librosa.util.normalize(X, norm=norm_type, axis=1)

def Func ( arg_0 , arg_1 , arg_2 = 0.0 , arg_3 = - 80 ) : if isinstance ( arg_1 , six . string_types ) : if arg_1 == "min_max" : return min_max_Func ( arg_0 , arg_2 = arg_2 ) if arg_1 == "log" : return logFunc ( arg_0 , arg_2 = arg_2 , arg_3 = arg_3 ) return librosa . util . Func ( arg_0 , norm = arg_1 , axis = 1 )

def Func(arg_0, arg_1, arg_2=0.0, arg_3=-80):
    """Normalizes the given matrix of features.

    Parameters
    ----------
    X: np.array
        Each row represents a feature vector.
    norm_type: {"min_max", "log", np.inf, -np.inf, 0, float > 0, None}
        - `"min_max"`: Min/max scaling is performed
        - `"log"`: Logarithmic scaling is performed
        - `np.inf`: Maximum absolute value
        - `-np.inf`: Mininum absolute value
        - `0`: Number of non-zeros
        - float: Corresponding l_p norm.
        - None : No normalization is performed

    Returns
    -------
    norm_X: np.array
        Normalized `X` according the the input parameters.
    """
    if isinstance(arg_1, six.string_types):
        if arg_1 == "min_max":
            return min_max_Func(arg_0, arg_2=arg_2)
        if arg_1 == "log":
            return logFunc(arg_0, arg_2=arg_2, arg_3=arg_3)
    return librosa.util.Func(arg_0, norm=arg_1, axis=1)

Normalizes the given matrix of features .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"%s %d"
%
(
str
(
arg_0
)
,
arg_1
)
arg_3
=
bytes
(
arg_2
,
"ascii"
)
arg_4
=
hashlib
.
sha256
(
hashlib
.
sha512
(
arg_3
)
.
digest
(
)
)
.
digest
(
)
return
PrivateKey
(
hexlify
(
arg_4
)
.
decode
(
"ascii"
)
,
prefix
=
arg_0
.
pubkey
.
prefix
)

def Func(arg_0, arg_1):
        """ Derive new private key from this private key and an arbitrary
            sequence number
        """
        arg_2 = "%s %d" % (str(arg_0), arg_1)
        arg_3 = bytes(arg_2, "ascii")
        arg_4 = hashlib.sha256(hashlib.sha512(arg_3).digest()).digest()
        return PrivateKey(hexlify(arg_4).decode("ascii"), prefix=arg_0.pubkey.prefix)


(data: pd.DataFrame, source, col_maps=None)

return res.rename(
        columns=lambda vv: col_maps.get(
            vv, vv.lower().replace(' ', '_').replace('-', '_')
        )
    ).apply(pd.to_numeric, errors='ignore', downcast='float')

def
Func
(
arg_0
:
arg_1
.
DataFrame
,
arg_3
,
arg_4
=
)
->
arg_1
.
DataFrame
:
if
arg_0
.
empty
:
return
arg_1
.
DataFrame
(
)
if
arg_3
==
'bdp'
:
arg_5
=
[
'ticker'
,
'field'
,
'value'
]
else
:
arg_5
=
[
'ticker'
,
'field'
,
'name'
,
'value'
,
'position'
]
if
any
(
arg_6
not
in
arg_0
for
arg_6
in
arg_5
)
:
return
arg_1
.
DataFrame
(
)
if
arg_0
.
dropna
(
subset
=
[
'value'
]
)
.
empty
:
return
arg_1
.
DataFrame
(
)
if
arg_3
==
'bdp'
:
arg_7
=
arg_1
.
DataFrame
(
arg_1
.
concat
(
[
arg_1
.
Series
(
{
**
{
'ticker'
:
t
}
,
**
grp
.
set_index
(
'field'
)
.
value
.
to_dict
(
)
}
)
for
t
,
grp
in
arg_0
.
groupby
(
'ticker'
)
]
,
axis
=
1
,
sort
=
False
)
)
.
transpose
(
)
.
set_index
(
'ticker'
)
else
:
arg_7
=
arg_1
.
DataFrame
(
arg_1
.
concat
(
[
grp
.
loc
[
:
,
[
'name'
,
'value'
]
]
.
set_index
(
'name'
)
.
transpose
(
)
.
reset_index
(
drop
=
True
)
.
assign
(
ticker
=
t
)
for
(
t
,
_
)
,
grp
in
arg_0
.
groupby
(
[
'ticker'
,
'position'
]
)
]
,
sort
=
False
)
)
.
reset_index
(
drop
=
True
)
.
set_index
(
'ticker'
)
arg_7
.
columns
.
name
=
if
arg_4
is
:
arg_4
=
dict
(
)
return
arg_7
.
rename
(
arg_8
=
lambda
vv
:
arg_4
.
get
(
vv
,
vv
.
lower
(
)
.
replace
(
' '
,
'_'
)
.
replace
(
'-'
,
'_'
)
)
)
.
apply
(
arg_1
.
to_numeric
,
errors
=
'ignore'
,
downcast
=
'float'
)

def Func(arg_0: arg_1.DataFrame, arg_3, arg_4=None) -> arg_1.DataFrame:
    """
    Format `pdblp` outputs to column-based results

    Args:
        data: `pdblp` result
        source: `bdp` or `bds`
        col_maps: rename columns with these mappings

    Returns:
        pd.DataFrame

    Examples:
        >>> Func(
        ...     data=pd.read_pickle('xbbg/tests/data/sample_bdp.pkl'),
        ...     source='bdp'
        ... ).reset_index()
                  ticker                        name
        0  QQQ US Equity  INVESCO QQQ TRUST SERIES 1
        1  SPY US Equity      SPDR S&P 500 ETF TRUST
        >>> Func(
        ...     data=pd.read_pickle('xbbg/tests/data/sample_dvd.pkl'),
        ...     source='bds', col_maps={'Dividend Frequency': 'dvd_freq'}
        ... ).loc[:, ['ex_date', 'dividend_amount', 'dvd_freq']].reset_index()
                ticker     ex_date  dividend_amount dvd_freq
        0  C US Equity  2018-02-02             0.32  Quarter
    """
    if arg_0.empty: return arg_1.DataFrame()
    if arg_3 == 'bdp': arg_5 = ['ticker', 'field', 'value']
    else: arg_5 = ['ticker', 'field', 'name', 'value', 'position']
    if any(arg_6 not in arg_0 for arg_6 in arg_5): return arg_1.DataFrame()
    if arg_0.dropna(subset=['value']).empty: return arg_1.DataFrame()

    if arg_3 == 'bdp':
        arg_7 = arg_1.DataFrame(arg_1.concat([
            arg_1.Series({**{'ticker': t}, **grp.set_index('field').value.to_dict()})
            for t, grp in arg_0.groupby('ticker')
        ], axis=1, sort=False)).transpose().set_index('ticker')
    else:
        arg_7 = arg_1.DataFrame(arg_1.concat([
            grp.loc[:, ['name', 'value']].set_index('name')
            .transpose().reset_index(drop=True).assign(ticker=t)
            for (t, _), grp in arg_0.groupby(['ticker', 'position'])
        ], sort=False)).reset_index(drop=True).set_index('ticker')
        arg_7.columns.name = None

    if arg_4 is None: arg_4 = dict()
    return arg_7.rename(
        arg_8=lambda vv: arg_4.get(
            vv, vv.lower().replace(' ', '_').replace('-', '_')
        )
    ).apply(arg_1.to_numeric, errors='ignore', downcast='float')

Format `pdblp` outputs to column-based results

    Args:
        data: `pdblp` result
        source: `bdp` or `bds`
        col_maps: rename columns with these mappings

    Returns:
        pd.DataFrame

    Examples:
        >>> format_output(
        ...     data=pd.read_pickle('xbbg/tests/data/sample_bdp.pkl'),
        ...     source='bdp'
        ... ).reset_index()
                  ticker                        name
        0  QQQ US Equity  INVESCO QQQ TRUST SERIES 1
        1  SPY US Equity      SPDR S&P 500 ETF TRUST
        >>> format_output(
        ...     data=pd.read_pickle('xbbg/tests/data/sample_dvd.pkl'),
        ...     source='bds', col_maps={'Dividend Frequency': 'dvd_freq'}
        ... ).loc[:, ['ex_date', 'dividend_amount', 'dvd_freq']].reset_index()
                ticker     ex_date  dividend_amount dvd_freq
        0  C US Equity  2018-02-02             0.32  Quarter

Format pdblp outputs to column - based results


def Func ( arg_0 , arg_1 ) : if arg_0 . _isIrNull ( arg_1 ) : arg_2 = IR_NULL_STR else : arg_2 = arg_0 . _Func ( arg_1 ) if arg_0 . isIndexHashed is False : return arg_2 return md5 ( tobytes ( arg_2 ) ) . hexdigest ( )

def Func(arg_0, arg_1):
		'''
			Func - An optional method which will return the value prepped for index.

			By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
			the field will be md5summed for indexing purposes. This is useful for large strings, etc.
		'''
		if arg_0._isIrNull(arg_1):
			arg_2 = IR_NULL_STR
		else:
			arg_2 = arg_0._Func(arg_1)

		if arg_0.isIndexHashed is False:
			return arg_2

		return md5(tobytes(arg_2)).hexdigest()

toIndex - An optional method which will return the value prepped for index.

			By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
			the field will be md5summed for indexing purposes. This is useful for large strings, etc.

toIndex - An optional method which will return the value prepped for index .


def Func(arg_0, arg_1, arg_2=True, arg_3=False):
        """Get a code string from history, file, url, or a string or macro.

        This is mainly used by magic functions.

        Parameters
        ----------

        target : str

          A string specifying code to retrieve. This will be tried respectively
          as: ranges of input history (see %history for syntax), url,
          correspnding .py file, filename, or an expression evaluating to a
          string or Macro in the user namespace.

        raw : bool
          If true (default), retrieve raw history. Has no effect on the other
          retrieval mechanisms.

        py_only : bool (default False)
          Only try to fetch python code, do not try alternative methods to decode file
          if unicode fails.

        Returns
        -------
        A string of code.

        ValueError is raised if nothing is found, and TypeError if it evaluates
        to an object of another type. In each case, .args[0] is a printable
        message.
        """
        arg_4 = arg_0.extract_input_lines(arg_1, arg_2=arg_2)  # Grab history
        if arg_4:
            return arg_4
        arg_5 = unquote_filename(arg_1)
        try:
            if arg_5.startswith(('http://', 'https://')):
                return openpy.read_py_url(arg_5, skip_encoding_cookie=True)
        except UnicodeDecodeError:
            if not arg_3 :
                arg_6 = urllib.urlopen(arg_1)
                return arg_6.read().decode('latin1')
            raise ValueError(("'%s' seem to be unreadable.") % arg_5)

        arg_7 = [arg_1]
        try :
            arg_7.insert(0,get_py_filename(arg_1))
        except IOError:
            pass

        for arg_8 in arg_7 :
            if os.path.isfile(arg_8):                        # Read file
                try :
                    return openpy.read_py_file(arg_8, skip_encoding_cookie=True)
                except UnicodeDecodeError :
                    if not arg_3 :
                        with io_open(arg_8,'r', encoding='latin1') as f :
                            return f.read()
                    raise ValueError(("'%s' seem to be unreadable.") % arg_1)

        try:                                              # User namespace
            arg_9 = eval(arg_1, arg_0.user_ns)
        except Exception:
            raise ValueError(("'%s' was not found in history, as a file, url, "
                                "nor in the user namespace.") % arg_1)
        if isinstance(arg_9, basestring):
            return arg_9
        elif isinstance(arg_9, Macro):
            return arg_9.value

        raise TypeError("%s is neither a string nor a macro." % arg_1,
                        arg_9)

Get a code string from history file url or a string or macro .


def Func ( arg_0 ) : if arg_0 . __num_processes > 1 : return [ arg_1 . get ( ) for arg_1 in arg_0 . __Func ] else : return arg_0 . __Func

def Func(arg_0):
        '''Returns Member objects of population'''

        if arg_0.__num_processes > 1:
            return [arg_1.get() for arg_1 in arg_0.__Func]
        else:
            return arg_0.__Func


return '{proto}://{host}:{port}{url_path}'.format(
            proto=self.protocol,
            host=self.host,
            port=self.port,
            url_path=self.url_path,
        )

def Func ( arg_0 ) : return '{proto}://{host}:{port}{url_path}' . format ( proto = arg_0 . protocol , host = arg_0 . host , port = arg_0 . port , url_path = arg_0 . url_path , )

def Func(arg_0):
        """A Func that will be used to construct the final
        URL we're going to query against.

        :returns: A URL of the form: ``proto://host:port``.
        :rtype: :obj:`string`
        """
        return '{proto}://{host}:{port}{url_path}'.format(
            proto=arg_0.protocol,
            host=arg_0.host,
            port=arg_0.port,
            url_path=arg_0.url_path,
        )

A base_url that will be used to construct the final
        URL we're going to query against.

        :returns: A URL of the form: ``proto://host:port``.
        :rtype: :obj:`string`

A base_url that will be used to construct the final URL we re going to query against .


def Func(arg_0, arg_1, arg_2, arg_3=True):
        r'''Method to calculate `T` from a specified `P` and `V` for the PRSV
        EOS. Uses `Tc`, `a`, `b`, `kappa0`  and `kappa` as well, obtained from
        the class's namespace.

        Parameters
        ----------
        P : float
            Pressure, [Pa]
        V : float
            Molar volume, [m^3/mol]
        quick : bool, optional
            Whether to use a SymPy cse-derived expression (somewhat faster) or
            individual formulas.

        Returns
        -------
        T : float
            Temperature, [K]

        Notes
        -----
        Not guaranteed to produce a solution. There are actually two solution,
        one much higher than normally desired; it is possible the solver could
        converge on this.
        '''
        arg_4, arg_5, arg_6, arg_7, arg_8 = arg_0.Tc, arg_0.a, arg_0.b, arg_0.kappa0, arg_0.kappa1
        if arg_3:
            arg_9 = arg_2 - arg_6
            arg_10 = R/arg_9
            arg_11 = (100.*(arg_2*(arg_2 + arg_6) + arg_6*arg_9))
            arg_12 = 10.*arg_7
            arg_13 = arg_8*10.
            arg_14 = arg_8*7.
            def to_solve(arg_15):
                arg_16 = arg_15/arg_4
                arg_17 = arg_16**0.5
                return (arg_15*arg_10 - arg_5*((arg_12 - (arg_13*arg_16 - arg_14)*(arg_17 + 1.))*(arg_17 - 1.) - 10.)**2/arg_11) - arg_1
        else:
            def to_solve(arg_15):
                arg_18 = R*arg_15/(arg_2 - arg_6) - arg_5*((arg_7 + arg_8*(sqrt(arg_15/arg_4) + 1)*(-arg_15/arg_4 + 7/10))*(-sqrt(arg_15/arg_4) + 1) + 1)**2/(arg_2*(arg_2 + arg_6) + arg_6*(arg_2 - arg_6))
                return arg_18 - arg_1
        return newton(to_solve, arg_4*0.5)

r Method to calculate T from a specified P and V for the PRSV EOS . Uses Tc a b kappa0 and kappa as well obtained from the class s namespace .


def Func(arg_0, arg_1, arg_2, arg_3):
        "If X wins with this move, return 1; if O return -1; else return 0."
        if (arg_0.k_in_row(arg_1, arg_2, arg_3, (0, 1)) or
            arg_0.k_in_row(arg_1, arg_2, arg_3, (1, 0)) or
            arg_0.k_in_row(arg_1, arg_2, arg_3, (1, -1)) or
            arg_0.k_in_row(arg_1, arg_2, arg_3, (1, 1))):
            return if_(arg_3 == 'X', +1, -1)
        else:
            return 0

If X wins with this move return 1 ; if O return - 1 ; else return 0 .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = get_stats ( arg_0 ) if arg_2 : os . remove ( arg_1 ) arg_4 = True arg_5 = 'r' if os . path . exists ( arg_1 ) else 'w+' with open ( arg_1 , arg_5 ) as csvfile : for arg_6 in csvfile : if arg_6 : arg_4 = False else : arg_4 = True with open ( arg_1 , 'a' ) as csvfile : if ( sys . version_info > ( 3 , 0 ) ) : arg_7 = u"," else : arg_7 = b"," arg_8 = csv . writer ( csvfile , arg_7 = arg_7 ) if arg_4 : arg_8 . writerow ( [ arg_9 for arg_9 in sorted ( arg_3 . keys ( ) ) ] ) arg_10 = [ ] for arg_9 in sorted ( arg_3 . keys ( ) ) : arg_10 . append ( arg_3 [ arg_9 ] ) arg_8 . writerow ( arg_10 )

def Func(arg_0, arg_1, arg_2=False):
    """
    Writes data from get_stats to csv file

    Parameters
    ----------
    gtfs: GTFS
    path_to_csv: str
        filepath to the csv file to be generated
    re_write:
        insted of appending, create a new one.
    """
    arg_3 = get_stats(arg_0)
    # check if file exist
    if arg_2:
            os.remove(arg_1)

    #if not os.path.isfile(path_to_csv):
     #   is_new = True
    #else:
     #   is_new = False

    arg_4 = True
    arg_5 = 'r' if os.path.exists(arg_1) else 'w+'
    with open(arg_1, arg_5) as csvfile:
        for arg_6 in csvfile:
           if arg_6:
               arg_4 = False
           else:
               arg_4 = True

    with open(arg_1, 'a') as csvfile:
        if (sys.version_info > (3, 0)):
            arg_7 = u","
        else:
            arg_7 = b","
        arg_8 = csv.writer(csvfile, arg_7=arg_7)
        # write column names if
        if arg_4:
            arg_8.writerow([arg_9 for arg_9 in sorted(arg_3.keys())])

        arg_10 = []
        # write stats row sorted by column name
        for arg_9 in sorted(arg_3.keys()):
            arg_10.append(arg_3[arg_9])
        arg_8.writerow(arg_10)


(self, gc, view_bounds=None, mode="default")

def Func(arg_0, arg_1, arg_2=None, arg_3="default"):
        """ Draws the Bezier component """

        if not arg_0.points: return
        arg_1.save_state()
        try:
            arg_1.set_fill_color(arg_0.pen.fill_color_)

            arg_1.set_line_width(arg_0.pen.line_width)
            arg_1.set_stroke_color(arg_0.pen.color_)

            arg_1.begin_path()
            arg_4, arg_5 = arg_0.points[0]
            arg_1.move_to(arg_4, arg_5)
            for arg_6 in nsplit(arg_0.points[1:], 3):
                arg_7, arg_8 = arg_6[0]
                arg_9, arg_10 = arg_6[1]
                arg_11, arg_12 = arg_6[2]
                arg_1.curve_to(arg_7, arg_8, arg_9, arg_10, arg_11, arg_12)
                # One point overlap
                arg_1.move_to(arg_11, arg_12)
            arg_1.stroke_path()
        finally:
            arg_1.restore_state()


def Func ( arg_0 ) : assert is_definite_clause ( arg_0 ) if is_symbol ( arg_0 . op ) : return [ ] , arg_0 else : arg_1 , arg_2 = arg_0 . args return conjuncts ( arg_1 ) , arg_2

def Func(arg_0):
    "Return the antecedents and the consequent of a definite clause."
    assert is_definite_clause(arg_0)
    if is_symbol(arg_0.op):
        return [], arg_0
    else:
        arg_1, arg_2 = arg_0.args
        return conjuncts(arg_1), arg_2

Return the antecedents and the consequent of a definite clause .


(
    node: astroid.node_classes.NodeNG
)

def Func ( arg_0 : arg_1 . node_classes . NodeNG ) -> Iterable [ arg_1 . node_classes . NodeNG ] : if isinstance ( arg_0 , ( arg_1 . Tuple , arg_1 . List ) ) : for arg_4 in arg_0 . elts : for arg_5 in Func ( arg_4 ) : yield arg_5 else : yield arg_0

def Func(
    arg_0: arg_1.node_classes.NodeNG
) -> Iterable[arg_1.node_classes.NodeNG]:
    """Recursively returns all atoms in nested lists and tuples."""
    if isinstance(arg_0, (arg_1.Tuple, arg_1.List)):
        for arg_4 in arg_0.elts:
            for arg_5 in Func(arg_4):
                yield arg_5
    else:
        yield arg_0

Recursively returns all atoms in nested lists and tuples .


(self, sym: sym.Symbol, var: Var, force: bool = False)

def Func ( arg_0 , arg_1 : arg_1 . Symbol , arg_3 : arg_4 , arg_5 : arg_6 = False ) -> arg_4 : arg_7 : lmap . Map = arg_0 . _Funcs . swap ( Namespace . _Func , arg_1 , arg_3 , arg_5 = arg_5 ) return arg_7 . entry ( arg_1 )

def Func(arg_0, arg_1: arg_1.Symbol, arg_3: arg_4, arg_5: arg_6 = False) -> arg_4:
        """Intern the Var given in this namespace mapped by the given Symbol.
        If the Symbol already maps to a Var, this method _will not overwrite_
        the existing Var mapping unless the force keyword argument is given
        and is True."""
        arg_7: lmap.Map = arg_0._Funcs.swap(Namespace._Func, arg_1, arg_3, arg_5=arg_5)
        return arg_7.entry(arg_1)

Intern the Var given in this namespace mapped by the given Symbol . If the Symbol already maps to a Var this method _will not overwrite_ the existing Var mapping unless the force keyword argument is given and is True .


def Func(arg_0, arg_1=False):
        """ Cleanup code after asked to stop producing.

        Kwargs:
            forced (bool): If True, we were forced to stop
        """
        if hasattr(arg_0, "_current_file_handle") and arg_0._current_file_handle:
            arg_0._current_file_handle.close()

        if arg_0._current_deferred:
            arg_0._current_deferred.callback(arg_0._sent)
            arg_0._current_deferred = None

        if not arg_1 and arg_0._deferred:
            arg_0._deferred.callback(arg_0._sent)

Cleanup code after asked to stop producing .


def Func ( arg_0 , arg_1 , arg_2 ) : for arg_3 in range ( arg_2 ) : for arg_4 in range ( arg_3 ) : arg_0 . cu1 ( math . pi / float ( 2 ** ( arg_3 - arg_4 ) ) , arg_1 [ arg_3 ] , arg_1 [ arg_4 ] ) arg_0 . h ( arg_1 [ arg_3 ] )

def Func(arg_0, arg_1, arg_2):
    """n-qubit QFT on q in circ."""
    for arg_3 in range(arg_2):
        for arg_4 in range(arg_3):
            arg_0.cu1(math.pi / float(2**(arg_3 - arg_4)), arg_1[arg_3], arg_1[arg_4])
        arg_0.h(arg_1[arg_3])


def Func ( arg_0 ) : ( arg_1 , arg_2 ) = os . path . split ( arg_0 ) if not arg_1 or ( not arg_2 and arg_1 == arg_0 ) : if arg_1 : yield arg_1 if arg_2 or not arg_1 : yield arg_2 return for arg_3 in Func ( arg_1 ) : yield arg_3 yield arg_2

def Func(arg_0):
    """Iterate over all the parts of a path.

    Splits path recursively with os.path.split().
    """
    (arg_1, arg_2) = os.path.split(arg_0)
    if not arg_1 or (not arg_2 and arg_1 == arg_0):
        if arg_1:
            yield arg_1
        if arg_2 or not arg_1:
            yield arg_2
        return
    for arg_3 in Func(arg_1):
        yield arg_3
    yield arg_2


def
Func
(
arg_0
)
:
if
arg_0
.
ui
.
tabWidget
.
currentIndex
(
)
==
TabWidget
.
NORMAL_MODE
:
arg_0
.
result_file
=
arg_0
.
file_dialog
.
getOpenFileName
(
caption
=
str
(
"Open Report File"
)
,
directory
=
"./outputs"
)
if
not
arg_0
.
result_file
==
''
:
arg_0
.
ui
.
show_all_curves
.
setDisabled
(
False
)
arg_0
.
ui
.
show_grid
.
setDisabled
(
False
)
arg_0
.
data_processing
(
)
arg_0
.
display_the_graphic
(
arg_0
.
num_line
,
arg_0
.
wavelength
,
arg_0
.
data_wanted
,
arg_0
.
information
)
arg_0
.
authorized_display
=
True

def Func(arg_0):
        """
        This function once the file found, display data's file and the graphic associated.
        """
        if arg_0.ui.tabWidget.currentIndex() == TabWidget.NORMAL_MODE:
            arg_0.result_file = arg_0.file_dialog.getOpenFileName(caption=str("Open Report File"), directory="./outputs")
            if not arg_0.result_file == '':
                arg_0.ui.show_all_curves.setDisabled(False)
                arg_0.ui.show_grid.setDisabled(False)
                arg_0.data_processing()
                arg_0.display_the_graphic(arg_0.num_line, arg_0.wavelength, arg_0.data_wanted, arg_0.information)
                arg_0.authorized_display = True

This function once the file found display data s file and the graphic associated .