def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_0
.
sanger_ordered
(
arg_1
,
arg_2
)
arg_4
=
[
]
for
arg_5
in
arg_3
:
arg_6
=
arg_5
[
'_id'
]
arg_7
=
arg_0
.
case
(
arg_6
=
arg_6
)
if
not
arg_7
:
continue
arg_8
=
arg_7
.
get
(
'display_name'
)
arg_9
=
arg_5
[
'vars'
]
arg_10
=
{
}
arg_10
[
arg_8
]
=
[
]
for
arg_11
in
arg_9
:
arg_12
=
arg_0
.
variant
(
document_id
=
arg_11
,
arg_6
=
arg_6
)
if
arg_12
is
or
arg_12
.
get
(
'sanger_ordered'
)
is
or
arg_12
.
get
(
'sanger_ordered'
)
is
False
:
continue
arg_13
=
arg_12
.
get
(
'validation'
,
'not_evaluated'
)
if
arg_13
in
[
'True positive'
,
'False positive'
]
:
continue
arg_10
[
arg_8
]
.
append
(
arg_12
[
'_id'
]
)
if
len
(
arg_10
[
arg_8
]
)
>
0
:
arg_4
.
append
(
arg_10
)
return
arg_4

def Func(arg_0, arg_1, arg_2):
    """Get all variants for an institute having Sanger validations ordered but still not evaluated

        Args:
            store(scout.adapter.MongoAdapter)
            institute_id(str)

        Returns:
            unevaluated: a list that looks like this: [ {'case1': [varID_1, varID_2, .., varID_n]}, {'case2' : [varID_1, varID_2, .., varID_n]} ],
                         where the keys are case_ids and the values are lists of variants with Sanger ordered but not yet validated

    """

    # Retrieve a list of ids for variants with Sanger ordered grouped by case from the 'event' collection
    # This way is much faster than querying over all variants in all cases of an institute
    arg_3 = arg_0.sanger_ordered(arg_1, arg_2)
    arg_4 = []

    # for each object where key==case and value==[variant_id with Sanger ordered]
    for arg_5 in arg_3:
        arg_6 = arg_5['_id']
        # Get the case to collect display name
        arg_7 = arg_0.case(arg_6=arg_6)

        if not arg_7: # the case might have been removed
            continue

        arg_8 = arg_7.get('display_name')

        # List of variant document ids
        arg_9 = arg_5['vars']

        arg_10 = {}
        arg_10[arg_8] = []

        for arg_11 in arg_9:
            # For each variant with sanger validation ordered
            arg_12 = arg_0.variant(document_id=arg_11, arg_6=arg_6)

            # Double check that Sanger was ordered (and not canceled) for the variant
            if arg_12 is None or arg_12.get('sanger_ordered') is None or arg_12.get('sanger_ordered') is False:
                continue

            arg_13 = arg_12.get('validation', 'not_evaluated')

            # Check that the variant is not evaluated
            if arg_13 in ['True positive', 'False positive']:
                continue

            arg_10[arg_8].append(arg_12['_id'])

        # If for a case there is at least one Sanger validation to evaluate add the object to the unevaluated objects list
        if len(arg_10[arg_8]) > 0:
            arg_4.append(arg_10)

    return arg_4


def Func ( arg_0 , arg_1 , arg_2 ) : proc . stream_process_stdout ( arg_2 , stdout_log_fn ( arg_1 ) ) arg_2 . wait ( )

def Func(arg_0, arg_1, arg_2):
    ''' Wait for the termination of a process and log its stdout & stderr '''
    proc.stream_process_stdout(arg_2, stdout_log_fn(arg_1))
    arg_2.wait()


return first_name([lang], [g]), last_name([lang]), t, g

def Func ( arg_0 = None , arg_1 = None ) : arg_0 = arg_0 or [ 'en' ] arg_1 = arg_1 or ( GENDER_FEMALE , GENDER_MALE ) arg_2 = random . choice ( arg_0 ) arg_3 = random . choice ( arg_1 ) arg_4 = title ( [ arg_2 ] , [ arg_3 ] ) return first_name ( [ arg_2 ] , [ arg_3 ] ) , last_name ( [ arg_2 ] ) , arg_4 , arg_3

def Func(arg_0=None, arg_1=None):
    """
    returns a random tuple representing Func information

    .. code-block:: python

        >>> d.Func()
        (u'Derren', u'Powell', 'm')
        >>> d.Func(genders=['f'])
        (u'Marge', u'Rodriguez', u'Mrs.', 'f')
        >>> d.Func(['es'],['m'])
        (u'Jacinto', u'Delgado', u'El Sr.', 'm')

    :param language:
    :param genders:
    """
    arg_0 = arg_0 or ['en']
    arg_1 = arg_1 or (GENDER_FEMALE, GENDER_MALE)

    arg_2 = random.choice(arg_0)
    arg_3 = random.choice(arg_1)
    arg_4 = title([arg_2], [arg_3])
    return first_name([arg_2], [arg_3]), last_name([arg_2]), arg_4, arg_3

returns a random tuple representing person information

    .. code-block:: python

        >>> d.person()
        (u'Derren', u'Powell', 'm')
        >>> d.person(genders=['f'])
        (u'Marge', u'Rodriguez', u'Mrs.', 'f')
        >>> d.person(['es'],['m'])
        (u'Jacinto', u'Delgado', u'El Sr.', 'm')

    :param language:
    :param genders:


def Func():
    """
    Prints all currently defined configurations.
    """
    # read configuration file
    arg_0, arg_1 = read_latoolscfg()

    arg_2 = arg_1['DEFAULT']['config']

    arg_3 = '\nCurrently defined LAtools configurations:\n\n'
    for arg_4 in arg_1.sections():
        if arg_4 == arg_2:
            arg_3 += arg_4 + ' [DEFAULT]\n'
        elif arg_4 == 'REPRODUCE':
            arg_3 += arg_4 + ' [DO NOT ALTER]\n'
        else:
            arg_3 += arg_4 + '\n'

        for arg_5, arg_6 in arg_1[arg_4].items():
            if arg_5 != 'config':
                if arg_6[:9] == 'resources':
                    arg_6 = pkgrs.resource_filename('latools', arg_6)
                arg_3 += '   ' + arg_5 + ': ' + arg_6 + '\n'
        arg_3 += '\n'

    print(arg_3)
    return

Prints all currently defined configurations .


def Func ( arg_0 , arg_1 = 'png' ) : if not arg_0 . axes and not arg_0 . lines : return arg_2 = arg_0 . get_facecolor ( ) arg_3 = arg_0 . get_edgecolor ( ) arg_0 . set_facecolor ( 'white' ) arg_0 . set_edgecolor ( 'white' ) try : arg_4 = BytesIO ( ) arg_0 . canvas . Func ( arg_4 , format = arg_1 , bbox_inches = 'tight' ) arg_5 = arg_4 . getvalue ( ) finally : arg_0 . set_facecolor ( arg_2 ) arg_0 . set_edgecolor ( arg_3 ) return arg_5

def Func(arg_0, arg_1='png'):
    """Convert a figure to svg or png for inline display."""
    # When there's an empty figure, we shouldn't return anything, otherwise we
    # get big blank areas in the qt console.
    if not arg_0.axes and not arg_0.lines:
        return

    arg_2 = arg_0.get_facecolor()
    arg_3 = arg_0.get_edgecolor()
    arg_0.set_facecolor('white')
    arg_0.set_edgecolor('white')
    try:
        arg_4 = BytesIO()
        arg_0.canvas.Func(arg_4, format=arg_1, bbox_inches='tight')
        arg_5 = arg_4.getvalue()
    finally:
        arg_0.set_facecolor(arg_2)
        arg_0.set_edgecolor(arg_3)
    return arg_5

Convert a figure to svg or png for inline display .


def Func(arg_0):
    """
    Convert the table and column descriptions of a `TableGroup` into specifications for the
    DB Func.

    :param ds:
    :return: A pair (tables, reference_tables).
    """
    arg_1 = {}
    for arg_2, arg_3 in arg_0.tabledict.items():
        arg_4 = TableSpec.from_table_metadata(arg_3)
        arg_1[arg_4.name] = arg_4
        for arg_6 in arg_4.many_to_many.values():
            arg_1[arg_6.name] = arg_6

    # We must determine the order in which tables must be created!
    arg_7 = OrderedDict()
    arg_8 = 0

    # We loop through the tables repeatedly, and whenever we find one, which has all
    # referenced tables already in ordered, we move it from tables to ordered.
    while arg_1 and arg_8 < 100:
        arg_8 += 1
        for arg_3 in list(arg_1.keys()):
            if all((arg_9[1] in arg_7) or arg_9[1] == arg_3 for arg_9 in arg_1[arg_3].foreign_keys):
                # All referenced tables are already created (or self-referential).
                arg_7[arg_3] = arg_1.pop(arg_3)
                break
    if arg_1:  # pragma: no cover
        raise ValueError('there seem to be cyclic dependencies between the tables')

    return list(arg_7.values())

Convert the table and column descriptions of a `TableGroup` into specifications for the
    DB schema.

    :param ds:
    :return: A pair (tables, reference_tables).

Convert the table and column descriptions of a TableGroup into specifications for the DB schema .


return self.algorithm.verify_signature(key, value, sig)

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . derive_key ( ) try : arg_2 = base64_decode ( arg_2 ) except Exception : return False return arg_0 . algorithm . Func ( arg_3 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
        """Verifies the signature for the given value."""
        arg_3 = arg_0.derive_key()
        try:
            arg_2 = base64_decode(arg_2)
        except Exception:
            return False
        return arg_0.algorithm.Func(arg_3, arg_1, arg_2)

Verifies the signature for the given value .


def Func(arg_0):
        """ Displays a dialog for Funcing HTML generated by Qt's rich text
        system.

        Returns
        -------
        The name of the file that was saved, or None if no file was saved.
        """
        arg_1 = arg_0.control.window()
        arg_2 = QtGui.QFileDialog(arg_1, 'Save as...')
        arg_2.setAcceptMode(QtGui.QFileDialog.AcceptSave)
        arg_3 = [
            'HTML with PNG figures (*.html *.htm)',
            'XHTML with inline SVG figures (*.xhtml *.xml)'
        ]
        arg_2.setNameFilters(arg_3)
        if arg_0.filename:
            arg_2.selectFile(arg_0.filename)
            arg_4,arg_5 = os.path.splitext(arg_0.filename)
            if arg_5.lower() in ('.xml', '.xhtml'):
                arg_2.selectNameFilter(arg_3[-1])

        if arg_2.exec_():
            arg_0.filename = arg_2.selectedFiles()[0]
            arg_7 = arg_2.selectedNameFilter()
            arg_8 = arg_0.control.document().toHtml().encode('utf-8')

            # Configure the Funcer.
            if arg_7.startswith('XHTML'):
                arg_9 = Func_xhtml
            else:
                # If there are PNGs, decide how to Func them.
                arg_10 = arg_0.inline_png
                if arg_10 is None and IMG_RE.search(arg_8):
                    arg_2 = QtGui.QDialog(arg_1)
                    arg_2.setWindowTitle('Save as...')
                    arg_11 = QtGui.QVBoxLayout(arg_2)
                    arg_12 = "Exporting HTML with PNGs"
                    arg_13 = "Would you like inline PNGs (single large html " \
                        "file) or external image files?"
                    arg_14 = QtGui.QCheckBox("&Don't ask again")
                    arg_14.setShortcut('D')
                    arg_15 = QtGui.QPushButton("&Inline")
                    arg_15.setShortcut('I')
                    arg_16 = QtGui.QPushButton("&External")
                    arg_16.setShortcut('E')
                    arg_17 = QtGui.QMessageBox(QtGui.QMessageBox.Question,
                                            arg_2.windowTitle(), arg_12)
                    arg_17.setInformativeText(arg_13)
                    arg_17.addButton(arg_15, QtGui.QMessageBox.NoRole)
                    arg_17.addButton(arg_16, QtGui.QMessageBox.YesRole)
                    arg_11.setSpacing(0)
                    arg_11.addWidget(arg_17)
                    arg_11.addWidget(arg_14)
                    arg_2.setLayout(arg_11)
                    arg_2.show()
                    arg_18 = arg_17.exec_()
                    arg_2.hide()
                    arg_10 = (arg_18 == 0)
                    if arg_14.checkState():
                        # Don't ask anymore; always use this choice.
                        arg_0.inline_png = arg_10
                arg_9 = lambda h, f, i: Func_html(h, f, i, arg_10)

            # Perform the Func!
            try:
                return arg_9(arg_8, arg_0.filename, arg_0.image_tag)
            except Exception, e:
                arg_12 = "Error Funcing HTML to %s\n" % arg_0.filename + str(e)
                arg_18 = QtGui.QMessageBox.warning(arg_1, 'Error', arg_12,
                    QtGui.QMessageBox.Ok, QtGui.QMessageBox.Ok)

        return None

Displays a dialog for exporting HTML generated by Qt's rich text
        system.

        Returns
        -------
        The name of the file that was saved, or None if no file was saved.

Displays a dialog for exporting HTML generated by Qt s rich text system .


def Func ( arg_0 , arg_1 ) : if not arg_1 or arg_1 [ 0 ] is None : return '' if len ( arg_1 ) == 1 : return arg_1 [ 0 ] . encode ( 'utf-8' ) arg_2 = u'' . join ( [ ( u'\ufffd%d\ufffd%s' % ( len ( p ) , p ) ) for p in arg_1 if p is not None ] ) return arg_2 . encode ( 'utf-8' )

def Func(arg_0, arg_1):
        """Encode list of messages. Expects messages to be unicode.

        ``messages`` - List of raw messages to encode, if necessary

        """
        if not arg_1 or arg_1[0] is None:
            return ''

        if len(arg_1) == 1:
            return arg_1[0].encode('utf-8')

        arg_2 = u''.join([(u'\ufffd%d\ufffd%s' % (len(p), p))
                            for p in arg_1 if p is not None])
        # FIXME: why is it so that we must filter None from here ?  How
        #        is it even possible that a None gets in there ?

        return arg_2.encode('utf-8')

Encode list of messages . Expects messages to be unicode .


return os.path.normpath(os.path.join(package_root, 'bin', *paths))

def Func ( * arg_0 ) : arg_1 = os . path . dirname ( __file__ ) return os . path . normpath ( os . path . join ( arg_1 , 'bin' , * arg_0 ) )

def Func(*arg_0):
    '''Like os.path.join but acts relative to this packages bin path.'''

    arg_1 = os.path.dirname(__file__)
    return os.path.normpath(os.path.join(arg_1, 'bin', *arg_0))

Like os . path . join but acts relative to this packages bin path .


def Func ( arg_0 , arg_1 ) : arg_0 . stream . write ( arg_1 ) arg_0 . stream . flush ( )

def Func(arg_0, arg_1):
        """
        Write the text to the stream and flush immediately.

        """

        arg_0.stream.write(arg_1)
        arg_0.stream.flush()

Write the text to the stream and flush immediately .


def Func ( arg_0 , arg_1 : arg_2 ) -> None : if arg_0 . Funcs : with arg_0 . _log_fp . open ( 'a+' ) as log_file : log_file . write ( f'{text}\n' )

def Func(arg_0, arg_1: arg_2) -> None:
        '''
        Given some error text it will log the text if self.Funcs is True

        :param text: Error text to log
        '''
        if arg_0.Funcs:
            with arg_0._log_fp.open('a+') as log_file:
                log_file.write(f'{text}\n')

Given some error text it will log the text if self.log_errors is True

        :param text: Error text to log

Given some error text it will log the text if self . log_errors is True


return (x_train, y_train), (x_test, y_test)

def Func ( ) : arg_0 = 10 arg_1 = np . random . rand ( arg_0 , * IMAGE_SHAPE ) . astype ( np . float32 ) arg_2 = np . random . permutation ( np . arange ( arg_0 ) ) . astype ( np . int32 ) arg_3 = np . random . rand ( arg_0 , * IMAGE_SHAPE ) . astype ( np . float32 ) arg_4 = np . random . permutation ( np . arange ( arg_0 ) ) . astype ( np . int32 ) return ( arg_1 , arg_2 ) , ( arg_3 , arg_4 )

def Func():
  """Build fake CIFAR10-style data for unit testing."""
  arg_0 = 10
  arg_1 = np.random.rand(arg_0, *IMAGE_SHAPE).astype(np.float32)
  arg_2 = np.random.permutation(np.arange(arg_0)).astype(np.int32)
  arg_3 = np.random.rand(arg_0, *IMAGE_SHAPE).astype(np.float32)
  arg_4 = np.random.permutation(np.arange(arg_0)).astype(np.int32)
  return (arg_1, arg_2), (arg_3, arg_4)

Build fake CIFAR10 - style data for unit testing .


def
Func
(
arg_0
,
arg_1
=
5
)
:
arg_0
.
assert_is_dir_and_exists
(
)
arg_2
=
sorted
(
[
(
p
,
p
.
dirsize
)
for
p
in
arg_0
.
select_dir
(
recursive
=
False
)
]
,
key
=
lambda
x
:
x
[
1
]
,
reverse
=
True
,
)
for
arg_3
,
arg_4
in
arg_2
[
:
arg_1
]
:
print
(
"{:<9}    {:<9}"
.
format
(
repr_data_size
(
arg_4
)
,
arg_3
.
abspath
)
)
arg_5
=
sorted
(
[
(
p
,
p
.
size
)
for
p
in
arg_3
.
select_file
(
recursive
=
True
)
]
,
key
=
lambda
x
:
x
[
1
]
,
reverse
=
True
,
)
for
arg_6
,
arg_7
in
arg_5
[
:
arg_1
]
:
print
(
"    {:<9}    {:<9}"
.
format
(
repr_data_size
(
arg_7
)
,
arg_6
.
abspath
)
)

def Func(arg_0, arg_1=5):
        """Print ``top_n`` big dir and ``top_n`` big file in each dir.
        """
        arg_0.assert_is_dir_and_exists()

        arg_2 = sorted(
            [(p, p.dirsize) for p in arg_0.select_dir(recursive=False)],
            key=lambda x: x[1],
            reverse=True,
        )
        for arg_3, arg_4 in arg_2[:arg_1]:
            print("{:<9}    {:<9}".format(repr_data_size(arg_4), arg_3.abspath))
            arg_5 = sorted(
                [(p, p.size) for p in arg_3.select_file(recursive=True)],
                key=lambda x: x[1],
                reverse=True,
            )
            for arg_6, arg_7 in arg_5[:arg_1]:
                print("    {:<9}    {:<9}".format(
                    repr_data_size(arg_7), arg_6.abspath))

Print top_n big dir and top_n big file in each dir .


return "".join([x for x in self.info_gen(code, message, compressed)])

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : return "" . join ( [ arg_4 for arg_4 in arg_0 . Func_gen ( arg_1 , arg_2 , arg_3 ) ] )

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """The complete content of an Func response.

        This should only used for commands that return small or known amounts of
        data.

        Returns:
            A the complete content of a textual response.
        """
        return "".join([arg_4 for arg_4 in arg_0.Func_gen(arg_1, arg_2, arg_3)])

The complete content of an info response.

        This should only used for commands that return small or known amounts of
        data.

        Returns:
            A the complete content of a textual response.

The complete content of an info response .


def Func(arg_0, **arg_1):
        """
        Get the list of Func for a particular genre by id. By default, only
        Func with 10 or more votes are included.

        Args:
            page: (optional) Minimum 1, maximum 1000.
            language: (optional) ISO 639-1 code.
            include_all_Func: (optional) Toggle the inclusion of all Func
                                and not just those with 10 or more ratings.
                                Expected value is: True or False.
            include_adult: (optional) Toggle the inclusion of adult titles.
                           Expected value is: True or False.

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

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

Get the list of movies for a particular genre by id. By default, only
        movies with 10 or more votes are included.

        Args:
            page: (optional) Minimum 1, maximum 1000.
            language: (optional) ISO 639-1 code.
            include_all_movies: (optional) Toggle the inclusion of all movies
                                and not just those with 10 or more ratings.
                                Expected value is: True or False.
            include_adult: (optional) Toggle the inclusion of adult titles.
                           Expected value is: True or False.

        Returns:
            A dict respresentation of the JSON returned from the API.

Get the list of movies for a particular genre by id . By default only movies with 10 or more votes are included .


def Func(arg_0, arg_1, arg_2, *, arg_3=None):
        """Add a new Funcing rule."""
        if arg_3 is None:
            arg_3 = arg_1
        if arg_3 in arg_0.requests:
            raise ValueError("A Func request is already scheduled for alias %s" % arg_3)
        arg_0.requests[arg_3] = (arg_1, arg_2)
        if arg_0._fd is not None:
            # We've started, register the Func immediately.
            arg_0._setup_Func(arg_3, arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : arg_2 = { 'uploaded' : True } arg_3 = requests . patch ( arg_0 , auth = ( arg_1 , '' ) , json = arg_2 ) if arg_3 . status_code != 200 : raise KeeperError ( arg_3 )

def Func(arg_0, arg_1):
    """Confirm a build upload is complete.

    Wraps ``PATCH /builds/{build}``.

    Parameters
    ----------
    build_url : `str`
        URL of the build resource. Given a build resource, this URL is
        available from the ``self_url`` field.
    keeper_token : `str`
        Auth token (`ltdconveyor.keeper.get_keeper_token`).

    Raises
    ------
    ltdconveyor.keeper.KeeperError
        Raised if there is an error communicating with the LTD Keeper API.
    """
    arg_2 = {
        'uploaded': True
    }

    arg_3 = requests.patch(
        arg_0,
        auth=(arg_1, ''),
        json=arg_2)
    if arg_3.status_code != 200:
        raise KeeperError(arg_3)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Declare an environment variable as a special variable.  This can
        be used even if the environment variable is not present.

        :param name: The name of the environment variable that should
                     be considered special.
        :param sep: The separator to be used.
        :param klass: The subclass of ``SpecialVariable`` used to
                      represent the variable.
        """

        # First, has it already been declared?
        if arg_1 in arg_0._special:
            arg_4 = arg_0._special[arg_1]
            if not isinstance(arg_4, arg_3) or arg_2 != arg_4._sep:
                raise ValueError('variable %s already declared as %s '
                                 'with separator "%s"' %
                                 (arg_1, arg_4.__class__.__name__,
                                  arg_4._sep))

        # OK, it's new; declare it
        else:
            arg_0._special[arg_1] = arg_3(arg_0, arg_1, arg_2)

Declare an environment variable as a special variable . This can be used even if the environment variable is not present .


def
Func
(
arg_0
,
arg_1
)
:
arg_1
=
arg_1
.
strip
(
)
arg_1
=
re
.
sub
(
'[ \t]+'
,
' '
,
arg_1
)
arg_2
=
[
]
arg_3
=
re
.
compile
(
r'^\\"'
)
arg_4
=
re
.
compile
(
'Referer|User-Agent'
)
arg_5
=
re
.
compile
(
'^%.*t$'
)
arg_6
=
re
.
compile
(
r'^\\"'
)
arg_7
=
re
.
compile
(
r'\\"$'
)
arg_8
=
re
.
compile
(
r'.*%\{([^\}]+)\}i'
)
for
arg_9
in
arg_1
.
split
(
' '
)
:
arg_10
=
0
if
arg_3
.
search
(
arg_9
)
:
arg_10
=
1
if
arg_10
:
arg_9
=
arg_6
.
sub
(
''
,
arg_9
)
arg_9
=
arg_7
.
sub
(
''
,
arg_9
)
arg_11
=
arg_8
.
match
(
arg_9
)
if
arg_11
:
arg_0
.
_names
.
append
(
arg_11
.
groups
(
)
[
0
]
.
lower
(
)
)
arg_0
.
_types
.
append
(
str
)
else
:
arg_0
.
_names
.
append
(
arg_0
.
alias
(
arg_9
)
)
arg_0
.
_types
.
append
(
arg_0
.
types
.
get
(
arg_9
,
[
,
str
]
)
[
1
]
)
arg_12
=
'(\S*)'
if
arg_10
:
if
arg_9
==
'%r'
or
arg_4
.
search
(
arg_9
)
:
arg_12
=
r'\"([^"\\]*(?:\\.[^"\\]*)*)\"'
else
:
arg_12
=
r'\"([^\"]*)\"'
elif
arg_5
.
search
(
arg_9
)
:
arg_12
=
r'(\[[^\]]+\])'
elif
arg_9
==
'%U'
:
arg_12
=
'(.+?)'
arg_2
.
append
(
arg_12
)
arg_0
.
_pattern
=
'^'
+
' '
.
join
(
arg_2
)
+
'$'
try
:
arg_0
.
_regex
=
re
.
compile
(
arg_0
.
_pattern
)
except
Exception
as
e
:
raise
ApacheLogParserError
(
e
)

def Func(arg_0, arg_1):
        """
        Converts the input format to a regular
        expression, as well as extracting fields

        Raises an exception if it couldn't compile
        the generated regex.
        """
        arg_1 = arg_1.strip()
        arg_1 = re.sub('[ \t]+',' ',arg_1)

        arg_2 = []

        arg_3 = re.compile(r'^\\"')
        arg_4 = re.compile('Referer|User-Agent')
        arg_5 = re.compile('^%.*t$')
        arg_6 = re.compile(r'^\\"')
        arg_7 = re.compile(r'\\"$')
        arg_8 = re.compile(r'.*%\{([^\}]+)\}i')

        for arg_9 in arg_1.split(' '):

            arg_10 = 0
            if arg_3.search(arg_9): arg_10 = 1

            if arg_10:
                arg_9 = arg_6.sub('', arg_9)
                arg_9 = arg_7.sub('', arg_9)

            arg_11 = arg_8.match(arg_9)
            if arg_11:
                arg_0._names.append(arg_11.groups()[0].lower())
                arg_0._types.append(str)
            else:
                arg_0._names.append(arg_0.alias(arg_9))
                arg_0._types.append(arg_0.types.get(arg_9, [None, str])[1])

            arg_12 = '(\S*)'

            if arg_10:
                if arg_9 == '%r' or arg_4.search(arg_9):
                    arg_12 = r'\"([^"\\]*(?:\\.[^"\\]*)*)\"'
                else:
                    arg_12 = r'\"([^\"]*)\"'

            elif arg_5.search(arg_9):
                arg_12 = r'(\[[^\]]+\])'

            elif arg_9 == '%U':
                arg_12 = '(.+?)'

            arg_2.append(arg_12)

        arg_0._pattern = '^' + ' '.join(arg_2) + '$'
        try:
            arg_0._regex = re.compile(arg_0._pattern)
        except Exception as e:
            raise ApacheLogParserError(e)

Converts the input format to a regular expression as well as extracting fields


(desc_proto, package='', build_file_if_cpp=True,
                   syntax=None)

return Descriptor(desc_proto.name, desc_name, None, None, fields,
                    list(nested_types.values()), list(enum_types.values()), [],
                    options=desc_proto.options)

def Func ( arg_0 , arg_1 = '' , arg_2 = True , arg_3 = None ) : if api_implementation . Type ( ) == 'cpp' and arg_2 : from typy . google . protobuf import descriptor_pb2 arg_4 = descriptor_pb2 . FileDescriptorProto ( ) arg_4 . message_type . add ( ) . MergeFrom ( arg_0 ) arg_5 = str ( uuid . uuid4 ( ) ) if arg_1 : arg_4 . name = os . path . join ( arg_1 . replace ( '.' , '/' ) , arg_5 + '.proto' ) arg_4 . package = arg_1 else : arg_4 . name = arg_5 + '.proto' _message . default_pool . Add ( arg_4 ) arg_7 = _message . default_pool . FindFileByName ( arg_4 . name ) if _USE_C_DESCRIPTORS : return arg_7 . message_types_by_name [ arg_0 . name ] arg_8 = [ arg_0 . name ] if arg_1 : arg_8 . insert ( 0 , arg_1 ) arg_9 = { } for arg_10 in arg_0 . enum_type : arg_11 = '.' . join ( arg_8 + [ arg_10 . name ] ) arg_12 = EnumDescriptor ( arg_10 . name , arg_11 , None , [ EnumValueDescriptor ( enum_val . name , ii , enum_val . number ) for ii , enum_val in enumerate ( arg_10 . value ) ] ) arg_9 [ arg_11 ] = arg_12 arg_13 = { } for arg_14 in arg_0 . nested_type : arg_11 = '.' . join ( arg_8 + [ arg_14 . name ] ) arg_15 = Func ( arg_14 , arg_1 = '.' . join ( arg_8 ) , arg_2 = False , arg_3 = arg_3 ) arg_13 [ arg_11 ] = arg_15 arg_16 = [ ] for arg_17 in arg_0 . field : arg_11 = '.' . join ( arg_8 + [ arg_17 . name ] ) arg_12 = None arg_15 = None if arg_17 . HasField ( 'type_name' ) : arg_18 = arg_17 . type_name arg_19 = '.' . join ( arg_8 + [ arg_18 [ arg_18 . rfind ( '.' ) + 1 : ] ] ) if arg_19 in arg_13 : arg_15 = arg_13 [ arg_19 ] elif arg_19 in arg_9 : arg_12 = arg_9 [ arg_19 ] arg_20 = FieldDescriptor ( arg_17 . name , arg_11 , arg_17 . number - 1 , arg_17 . number , arg_17 . type , FieldDescriptor . ProtoTypeToCppProtoType ( arg_17 . type ) , arg_17 . label , None , arg_15 , arg_12 , None , False , None , options = arg_17 . options , has_default_value = False ) arg_16 . append ( arg_20 ) arg_21 = '.' . join ( arg_8 ) return Descriptor ( arg_0 . name , arg_21 , None , None , arg_16 , list ( arg_13 . values ( ) ) , list ( arg_9 . values ( ) ) , [ ] , options = arg_0 . options )

def Func(arg_0, arg_1='', arg_2=True,
                   arg_3=None):
  """Make a protobuf Descriptor given a DescriptorProto protobuf.

  Handles nested descriptors. Note that this is limited to the scope of defining
  a message inside of another message. Composite fields can currently only be
  resolved if the message is defined in the same scope as the field.

  Args:
    desc_proto: The descriptor_pb2.DescriptorProto protobuf message.
    package: Optional package name for the new message Descriptor (string).
    build_file_if_cpp: Update the C++ descriptor pool if api matches.
                       Set to False on recursion, so no duplicates are created.
    syntax: The syntax/semantics that should be used.  Set to "proto3" to get
            proto3 field presence semantics.
  Returns:
    A Descriptor for protobuf messages.
  """
  if api_implementation.Type() == 'cpp' and arg_2:
    # The C++ implementation requires all descriptors to be backed by the same
    # definition in the C++ descriptor pool. To do this, we build a
    # FileDescriptorProto with the same definition as this descriptor and build
    # it into the pool.
    from typy.google.protobuf import descriptor_pb2
    arg_4 = descriptor_pb2.FileDescriptorProto()
    arg_4.message_type.add().MergeFrom(arg_0)

    # Generate a random name for this proto file to prevent conflicts with any
    # imported ones. We need to specify a file name so the descriptor pool
    # accepts our FileDescriptorProto, but it is not important what that file
    # name is actually set to.
    arg_5 = str(uuid.uuid4())

    if arg_1:
      arg_4.name = os.path.join(arg_1.replace('.', '/'),
                                                arg_5 + '.proto')
      arg_4.package = arg_1
    else:
      arg_4.name = arg_5 + '.proto'

    _message.default_pool.Add(arg_4)
    arg_7 = _message.default_pool.FindFileByName(arg_4.name)

    if _USE_C_DESCRIPTORS:
      return arg_7.message_types_by_name[arg_0.name]

  arg_8 = [arg_0.name]
  if arg_1: arg_8.insert(0, arg_1)

  # Create Descriptors for enum types
  arg_9 = {}
  for arg_10 in arg_0.enum_type:
    arg_11 = '.'.join(arg_8 + [arg_10.name])
    arg_12 = EnumDescriptor(
      arg_10.name, arg_11, None, [
          EnumValueDescriptor(enum_val.name, ii, enum_val.number)
          for ii, enum_val in enumerate(arg_10.value)])
    arg_9[arg_11] = arg_12

  # Create Descriptors for nested types
  arg_13 = {}
  for arg_14 in arg_0.nested_type:
    arg_11 = '.'.join(arg_8 + [arg_14.name])
    # Nested types are just those defined inside of the message, not all types
    # used by fields in the message, so no loops are possible here.
    arg_15 = Func(arg_14,
                                 arg_1='.'.join(arg_8),
                                 arg_2=False,
                                 arg_3=arg_3)
    arg_13[arg_11] = arg_15

  arg_16 = []
  for arg_17 in arg_0.field:
    arg_11 = '.'.join(arg_8 + [arg_17.name])
    arg_12 = None
    arg_15 = None
    if arg_17.HasField('type_name'):
      arg_18 = arg_17.type_name
      arg_19 = '.'.join(arg_8 +
                                [arg_18[arg_18.rfind('.')+1:]])
      if arg_19 in arg_13:
        arg_15 = arg_13[arg_19]
      elif arg_19 in arg_9:
        arg_12 = arg_9[arg_19]
      # Else type_name references a non-local type, which isn't implemented
    arg_20 = FieldDescriptor(
        arg_17.name, arg_11, arg_17.number - 1,
        arg_17.number, arg_17.type,
        FieldDescriptor.ProtoTypeToCppProtoType(arg_17.type),
        arg_17.label, None, arg_15, arg_12, None, False, None,
        options=arg_17.options, has_default_value=False)
    arg_16.append(arg_20)

  arg_21 = '.'.join(arg_8)
  return Descriptor(arg_0.name, arg_21, None, None, arg_16,
                    list(arg_13.values()), list(arg_9.values()), [],
                    options=arg_0.options)

Make a protobuf Descriptor given a DescriptorProto protobuf .


(self, tier_id, ling='default-lt', parent=None, locale=None,
                 part=None, ann=None, language=None, tier_dict=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'default-lt'
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
arg_6
=
,
arg_7
=
,
arg_8
=
)
:
if
not
arg_1
:
raise
ValueError
(
'Tier id is empty...'
)
if
arg_2
not
in
arg_0
.
linguistic_types
:
arg_2
=
sorted
(
arg_0
.
linguistic_types
.
keys
(
)
)
[
0
]
if
arg_4
and
arg_4
not
in
arg_0
.
locales
:
arg_4
=
if
arg_7
and
arg_7
not
in
arg_0
.
languages
:
arg_7
=
if
arg_8
is
:
arg_0
.
tiers
[
arg_1
]
=
(
{
}
,
{
}
,
{
'TIER_ID'
:
arg_1
,
'LINGUISTIC_TYPE_REF'
:
arg_2
,
'PARENT_REF'
:
arg_3
,
'PARTICIPANT'
:
arg_5
,
'DEFAULT_LOCALE'
:
arg_4
,
'LANG_REF'
:
arg_7
,
'ANNOTATOR'
:
arg_6
}
,
len
(
arg_0
.
tiers
)
)
else
:
arg_0
.
tiers
[
arg_1
]
=
(
{
}
,
{
}
,
arg_8
,
len
(
arg_0
.
tiers
)
)

def Func(arg_0, arg_1, arg_2='default-lt', arg_3=None, arg_4=None,
                 arg_5=None, arg_6=None, arg_7=None, arg_8=None):
        """Add a tier. When no linguistic type is given and the default
        linguistic type is unavailable then the assigned linguistic type will
        be the first in the list.

        :param str tier_id: Name of the tier.
        :param str ling: Linguistic type, if the type is not available it will
                         warn and pick the first available type.
        :param str parent: Parent tier name.
        :param str locale: Locale, if the locale is not present this option is
            ignored and the locale will not be set.
        :param str part: Participant.
        :param str ann: Annotator.
        :param str language: Language , if the language is not present this
            option is ignored and the language will not be set.
        :param dict tier_dict: TAG attributes, when this is not ``None`` it
                               will ignore all other options. Please only use
                               dictionaries coming from the
                               :func:`get_parameters_for_tier`
        :raises ValueError: If the tier_id is empty
        """
        if not arg_1:
            raise ValueError('Tier id is empty...')
        if arg_2 not in arg_0.linguistic_types:
            arg_2 = sorted(arg_0.linguistic_types.keys())[0]
        if arg_4 and arg_4 not in arg_0.locales:
            arg_4 = None
        if arg_7 and arg_7 not in arg_0.languages:
            arg_7 = None
        if arg_8 is None:
            arg_0.tiers[arg_1] = ({}, {}, {
                'TIER_ID': arg_1,
                'LINGUISTIC_TYPE_REF': arg_2,
                'PARENT_REF': arg_3,
                'PARTICIPANT': arg_5,
                'DEFAULT_LOCALE': arg_4,
                'LANG_REF': arg_7,
                'ANNOTATOR': arg_6}, len(arg_0.tiers))
        else:
            arg_0.tiers[arg_1] = ({}, {}, arg_8, len(arg_0.tiers))

Add a tier . When no linguistic type is given and the default linguistic type is unavailable then the assigned linguistic type will be the first in the list .


def Func():  # pylint: disable=g-statement-before-imports
  """Attempt to import tensorflow, and ensure its version is sufficient.

  Raises:
    ImportError: if either tensorflow is not importable or its version is
    inadequate.
  """
  try:
    import tensorflow as tf
  except ImportError:
    # Print more informative error message, then reraise.
    print("\n\nFailed to import TensorFlow. Please note that TensorFlow is not "
          "installed by default when you install TensorFlow Probability. This "
          "is so that users can decide whether to install the GPU-enabled "
          "TensorFlow package. To use TensorFlow Probability, please install "
          "the most recent version of TensorFlow, by following instructions at "
          "https://tensorflow.org/install.\n\n")
    raise

  import distutils.version

  #
  # Update this whenever we need to depend on a newer TensorFlow release.
  #
  arg_0 = "1.13"

  if (distutils.version.LooseVersion(tf.__version__) <
      distutils.version.LooseVersion(arg_0)):
    raise ImportError(
        "This version of TensorFlow Probability requires TensorFlow "
        "version >= {required}; Detected an installation of version {present}. "
        "Please upgrade TensorFlow to proceed.".format(
            required=arg_0,
            present=tf.__version__))

Attempt to import tensorflow and ensure its version is sufficient .


(self, sess, sort=None, model_name='model', **kwargs)

def Func(arg_0, arg_1, arg_2=None, arg_3='model', **arg_4):
        """Finds and returns a model architecture and its parameters from the database which matches the requirement.

        Parameters
        ----------
        sess : Session
            TensorFlow session.
        sort : List of tuple
            PyMongo sort comment, search "PyMongo find one sorting" and `collection level operations <http://api.mongodb.com/python/current/api/pymongo/collection.html>`__ for more details.
        model_name : str or None
            The name/key of model.
        kwargs : other events
            Other events, such as name, accuracy, loss, step number and etc (optinal).

        Examples
        ---------
        - see ``save_model``.

        Returns
        ---------
        network : TensorLayer layer
            Note that, the returned network contains all information of the document (record), e.g. if you saved accuracy in the document, you can get the accuracy by using ``net._accuracy``.
        """
        # print(kwargs)   # {}
        arg_4.update({'model_name': arg_3})
        arg_0._fill_project_info(arg_4)

        arg_5 = time.time()

        arg_6 = arg_0.db.Model.find_one(filter=arg_4, arg_2=arg_2)

        arg_7 = '_find_one_model_ztemp_file'
        if arg_6 is not None:
            arg_8 = arg_6['params_id']
            arg_9 = arg_6['architecture']
            arg_10 = arg_6['time']
            exists_or_mkdir(arg_7, False)
            with open(os.path.join(arg_7, 'graph.pkl'), 'wb') as file:
                pickle.dump(arg_9, file, protocol=pickle.HIGHEST_PROTOCOL)
        else:
            print("[Database] FAIL! Cannot find model: {}".format(arg_4))
            return False
        try:
            arg_11 = arg_0._deserialization(arg_0.model_fs.get(arg_8).read())
            np.savez(os.path.join(arg_7, 'params.npz'), arg_11=arg_11)

            arg_12 = load_graph_and_params(name=arg_7, arg_1=arg_1)
            del_folder(arg_7)

            arg_13 = arg_0.db.Model.find(arg_4)
            print(
                "[Database] Find one model SUCCESS. kwargs:{} sort:{} save time:{} took: {}s".
                format(arg_4, arg_2, arg_10, round(time.time() - arg_5, 2))
            )

            # put all informations of model into the TL layer
            for arg_14 in arg_6:
                arg_12.__dict__.update({"_%s" % arg_14: arg_6[arg_14]})

            # check whether more parameters match the requirement
            arg_15 = arg_13.distinct('params_id')
            arg_16 = len(arg_15)
            if arg_16 != 1:
                print("     Note that there are {} models match the kwargs".format(arg_16))
            return arg_12
        except Exception as e:
            arg_17, arg_18, arg_19 = sys.exc_info()
            arg_20 = os.path.split(arg_19.tb_frame.f_code.co_filename)[1]
            logging.info("{}  {}  {}  {}  {}".format(arg_17, arg_18, arg_20, arg_19.tb_lineno, e))
            return False

Finds and returns a model architecture and its parameters from the database which matches the requirement .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
,
arg_4
=
arg_0
.
Func_with_reason
(
arg_1
,
arg_2
)
if
arg_0
.
debug
.
should
(
'trace'
)
:
if
not
arg_3
:
arg_5
=
"Not tracing %r: %s"
%
(
arg_1
,
arg_4
)
else
:
arg_5
=
"Tracing %r"
%
(
arg_1
,
)
arg_0
.
debug
.
write
(
arg_5
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """Decide whether to trace execution in `filename`.

        Calls `Func_with_reason`, and returns just the decision.

        """
        arg_3, arg_4 = arg_0.Func_with_reason(arg_1, arg_2)
        if arg_0.debug.should('trace'):
            if not arg_3:
                arg_5 = "Not tracing %r: %s" % (arg_1, arg_4)
            else:
                arg_5 = "Tracing %r" % (arg_1,)
            arg_0.debug.write(arg_5)
        return arg_3

Decide whether to trace execution in `filename`.

        Calls `_should_trace_with_reason`, and returns just the decision.

Decide whether to trace execution in filename .


def Func ( ) : arg_0 = subprocess . Popen ( [ 'pbpaste' , '-Prefer' , 'ascii' ] , stdout = subprocess . PIPE ) arg_1 , arg_2 = arg_0 . communicate ( ) arg_1 = arg_1 . replace ( '\r' , '\n' ) return arg_1

def Func():
    """ Get the clipboard's text on OS X.
    """
    arg_0 = subprocess.Popen(['pbpaste', '-Prefer', 'ascii'],
        stdout=subprocess.PIPE)
    arg_1, arg_2 = arg_0.communicate()
    # Text comes in with old Mac \r line endings. Change them to \n.
    arg_1 = arg_1.replace('\r', '\n')
    return arg_1


def Func(arg_0, arg_1, arg_2):
        """Store the given text contents so that they are later retrievable by
        the given key."""

        arg_0._blobservice.create_blob_from_text(
            arg_0.uuid,
            arg_1,
            arg_2
        )

Store the given text contents so that they are later retrievable by the given key .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : arg_2 = arg_0 . ngcorpus if not arg_1 : return arg_2 [ None ] if isinstance ( arg_1 , ( text_type , str ) ) : arg_1 = text_type ( arg_1 ) . split ( ) if arg_1 [ 0 ] in arg_2 : return arg_0 . Func ( arg_1 [ 1 : ] , arg_2 [ arg_1 [ 0 ] ] ) return 0

def Func(arg_0, arg_1, arg_2=None):
        r"""Get the count of an n-gram in the corpus.

        Parameters
        ----------
        ngram : str
            The n-gram to retrieve the count of from the n-gram corpus
        corpus : Corpus
            The corpus

        Returns
        -------
        int
            The n-gram count

        Examples
        --------
        >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n'
        >>> tqbf += 'And then it slept.\n And the dog ran off.'
        >>> ngcorp = NGramCorpus(Corpus(tqbf))
        >>> NGramCorpus(Corpus(tqbf)).Func('the')
        2
        >>> NGramCorpus(Corpus(tqbf)).Func('fox')
        1

        """
        if not arg_2:
            arg_2 = arg_0.ngcorpus

        # if ngram is empty, we're at our leaf node and should return the
        # value in None
        if not arg_1:
            return arg_2[None]

        # support strings or lists/tuples by splitting strings
        if isinstance(arg_1, (text_type, str)):
            arg_1 = text_type(arg_1).split()

        # if ngram is not empty, check whether the next element is in the
        # corpus; if so, recurse--if not, return 0
        if arg_1[0] in arg_2:
            return arg_0.Func(arg_1[1:], arg_2[arg_1[0]])
        return 0

r"""Get the count of an n-gram in the corpus.

        Parameters
        ----------
        ngram : str
            The n-gram to retrieve the count of from the n-gram corpus
        corpus : Corpus
            The corpus

        Returns
        -------
        int
            The n-gram count

        Examples
        --------
        >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n'
        >>> tqbf += 'And then it slept.\n And the dog ran off.'
        >>> ngcorp = NGramCorpus(Corpus(tqbf))
        >>> NGramCorpus(Corpus(tqbf)).get_count('the')
        2
        >>> NGramCorpus(Corpus(tqbf)).get_count('fox')
        1

r Get the count of an n - gram in the corpus .


def Func(arg_0, arg_1, arg_2):
    """Run WsgiDAV using wsgiref.simple_server, on Python 2.5+."""
    # http://www.python.org/doc/2.5.2/lib/module-wsgiref.html
    from wsgiref.simple_server import make_server, software_version

    arg_3 = "WsgiDAV/{} {}".format(__version__, software_version)
    _logger.info("Running {}...".format(arg_3))
    _logger.warning(
        "WARNING: This single threaded server (wsgiref) is not meant for production."
    )
    arg_4 = make_server(arg_1["host"], arg_1["port"], arg_0)
    try:
        arg_4.serve_forever()
    except KeyboardInterrupt:
        _logger.warning("Caught Ctrl-C, shutting down...")
    return

Run WsgiDAV using wsgiref . simple_server on Python 2 . 5 + .


def Func(arg_0):
        """
        Retrieve all of the relevant key wrapping data fields and return them
        as a dictionary.
        """
        Func = {}
        arg_2 = {
            'unique_identifier': arg_0._kdw_eki_unique_identifier,
            'cryptographic_parameters': {
                'block_cipher_mode': arg_0._kdw_eki_cp_block_cipher_mode,
                'padding_method': arg_0._kdw_eki_cp_padding_method,
                'hashing_algorithm': arg_0._kdw_eki_cp_hashing_algorithm,
                'key_role_type': arg_0._kdw_eki_cp_key_role_type,
                'digital_signature_algorithm':
                    arg_0._kdw_eki_cp_digital_signature_algorithm,
                'cryptographic_algorithm':
                    arg_0._kdw_eki_cp_cryptographic_algorithm,
                'random_iv': arg_0._kdw_eki_cp_random_iv,
                'iv_length': arg_0._kdw_eki_cp_iv_length,
                'tag_length': arg_0._kdw_eki_cp_tag_length,
                'fixed_field_length': arg_0._kdw_eki_cp_fixed_field_length,
                'invocation_field_length':
                    arg_0._kdw_eki_cp_invocation_field_length,
                'counter_length': arg_0._kdw_eki_cp_counter_length,
                'initial_counter_value':
                    arg_0._kdw_eki_cp_initial_counter_value
            }
        }
        if not any(arg_2['cryptographic_parameters'].values()):
            arg_2['cryptographic_parameters'] = {}
        if not any(arg_2.values()):
            arg_2 = {}

        arg_3 = {
            'unique_identifier': arg_0._kdw_mski_unique_identifier,
            'cryptographic_parameters': {
                'block_cipher_mode': arg_0._kdw_mski_cp_block_cipher_mode,
                'padding_method': arg_0._kdw_mski_cp_padding_method,
                'hashing_algorithm': arg_0._kdw_mski_cp_hashing_algorithm,
                'key_role_type': arg_0._kdw_mski_cp_key_role_type,
                'digital_signature_algorithm':
                    arg_0._kdw_mski_cp_digital_signature_algorithm,
                'cryptographic_algorithm':
                    arg_0._kdw_mski_cp_cryptographic_algorithm,
                'random_iv': arg_0._kdw_mski_cp_random_iv,
                'iv_length': arg_0._kdw_mski_cp_iv_length,
                'tag_length': arg_0._kdw_mski_cp_tag_length,
                'fixed_field_length': arg_0._kdw_mski_cp_fixed_field_length,
                'invocation_field_length':
                    arg_0._kdw_mski_cp_invocation_field_length,
                'counter_length': arg_0._kdw_mski_cp_counter_length,
                'initial_counter_value':
                    arg_0._kdw_mski_cp_initial_counter_value
            }
        }
        if not any(arg_3['cryptographic_parameters'].values()):
            arg_3['cryptographic_parameters'] = {}
        if not any(arg_3.values()):
            arg_3 = {}

        Func['wrapping_method'] = arg_0._kdw_wrapping_method
        Func['encryption_key_information'] = arg_2
        Func['mac_signature_key_information'] = arg_3
        Func['mac_signature'] = arg_0._kdw_mac_signature
        Func['iv_counter_nonce'] = arg_0._kdw_iv_counter_nonce
        Func['encoding_option'] = arg_0._kdw_encoding_option
        if not any(Func.values()):
            Func = {}

        return Func

Retrieve all of the relevant key wrapping data fields and return them as a dictionary .


def Func ( arg_0 : arg_1 [ arg_2 , arg_3 [ arg_4 ] ] ) -> RepeatedParser : if isinstance ( arg_0 , str ) : arg_0 = lit ( arg_0 ) return RepeatedParser ( arg_0 )

def Func(arg_0: arg_1[arg_2, arg_3[arg_4]]) -> RepeatedParser:
    """Match a parser zero or more times Funceatedly.

    This matches ``parser`` multiple times in a row. A list is returned
    containing the value from each match. If there are no matches, an empty list
    is returned.

    Args:
        parser: Parser or literal
    """
    if isinstance(arg_0, str):
        arg_0 = lit(arg_0)
    return RepeatedParser(arg_0)

Match a parser zero or more times repeatedly.

    This matches ``parser`` multiple times in a row. A list is returned
    containing the value from each match. If there are no matches, an empty list
    is returned.

    Args:
        parser: Parser or literal

Match a parser zero or more times repeatedly .


def Func(arg_0):
        """Return pairs of run ids and results.

        This method waits until all event loops finish
        """
        arg_1 = arg_0.communicationChannel.Func_all()
        arg_0.nruns -= len(arg_1)
        if arg_0.nruns > 0:
            import logging
            arg_2 = logging.getLogger(__name__)
            arg_2.warning(
                'too few results Funcd: {} results Funcd, {} more expected'.format(
                    len(arg_1), arg_0.nruns))
        elif arg_0.nruns < 0:
            import logging
            arg_2 = logging.getLogger(__name__)
            arg_2.warning(
                'too many results Funcd: {} results Funcd, {} too many'.format(
                    len(arg_1), -arg_0.nruns))
        return arg_1


return H2OFrame._expr(expr=ExprNode("relevel", self, quote(y)))

def Func ( arg_0 , arg_1 ) : return H2OFrame . _expr ( expr = ExprNode ( "Func" , arg_0 , quote ( arg_1 ) ) )

def Func(arg_0, arg_1):
        """
        Reorder levels of an H2O factor for one single column of a H2O frame

        The levels of a factor are reordered such that the reference level is at level 0, all remaining levels are
        moved down as needed.

        :param str y: The reference level
        :returns: New reordered factor column
        """
        return H2OFrame._expr(expr=ExprNode("Func", arg_0, quote(arg_1)))


def Func(arg_0, arg_1):
        """Convert the specification into an instruction

        :param specification: a specification with a key
          :data:`knittingpattern.Instruction.TYPE`

        The instruction is not added.

        .. seealso:: :meth:`add_instruction`
        """
        arg_2 = arg_0._instruction_class(arg_1)
        arg_3 = arg_2.type
        if arg_3 in arg_0._type_to_instruction:
            arg_2.inherit_from(arg_0._type_to_instruction[arg_3])
        return arg_2


(character, action_metadata, direction, length=8, start=0)

def Func(arg_0, arg_1, arg_2, arg_3=8, arg_4=0):
  """Creates a sequence.

  Args:
    character: A character sprite tensor.
    action_metadata: An action metadata tuple.
    direction: An integer representing the direction, i.e., the row
      offset within each action group corresponding to a particular
      direction.
    length: Desired length of the sequence. If this is longer than
      the number of available frames, it will roll over to the
      beginning.
    start: Index of possible frames at which to start the sequence.

  Returns:
    A sequence tensor.
  """
  arg_5 = (arg_1[0]+arg_2) * FRAME_SIZE
  arg_6 = (arg_1[0]+arg_2+1) * FRAME_SIZE
  arg_7 = arg_0[arg_5:arg_6, ...]

  # Extract 64x64 patches that are side-by-side in the sprite, and limit
  # to the actual number of frames for the given action.
  arg_8 = tf.stack(tf.split(arg_7, 13, axis=1))  # 13 is a hack
  arg_8 = arg_8[0:arg_1[1]]

  # Extract a slice of the desired length.
  # NOTE: Length could be longer than the number of frames, so tile as needed.
  arg_8 = tf.roll(arg_8, shift=-arg_4, axis=0)
  arg_8 = tf.tile(arg_8, [2, 1, 1, 1])  # 2 is a hack
  arg_8 = arg_8[:arg_3]
  arg_8 = tf.cast(arg_8, dtype=tf.float32)
  arg_8.set_shape([arg_3, FRAME_SIZE, FRAME_SIZE, CHANNELS])
  return arg_8


def Func(arg_0, arg_1):
        """pre-processed the data frame.new filtering methods will be implement here.
        """
        # read data in
        if isinstance(arg_0.data, pd.DataFrame) :
            arg_2 = arg_0.data.copy()
            # handle index is gene_names
            if arg_2.index.dtype == 'O':
                arg_2 = arg_2.reset_index()
        elif os.path.isfile(arg_0.data) :
            # GCT input format?
            if arg_0.data.endswith("gct"):
                arg_2 = pd.read_csv(arg_0.data, skiprows=1, comment='#',sep="\t")
            else:
                arg_2 = pd.read_csv(arg_0.data, comment='#',sep="\t")
        else:
            raise Exception('Error parsing gene expression DataFrame!')

        #drop duplicated gene names
        if arg_2.iloc[:,0].duplicated().sum() > 0:
            arg_0._logger.warning("Warning: dropping duplicated gene names, only keep the first values")
            arg_2.drop_duplicates(subset=arg_2.columns[0], inplace=True) #drop duplicate gene_names.
        if arg_2.isnull().any().sum() > 0:
            arg_0._logger.warning("Warning: Input data contains NA, filled NA with 0")
            arg_2.dropna(how='all', inplace=True) #drop rows with all NAs
            arg_2 = arg_2.fillna(0)
        # set gene name as index
        arg_2.set_index(keys=arg_2.columns[0], inplace=True)
        # select numberic columns
        arg_3 = arg_2.select_dtypes(include=[np.number])
        # drop any genes which std ==0
        arg_4 =  arg_3.groupby(by=arg_1, axis=1).std()
        arg_3 =  arg_3[~arg_4.isin([0]).any(axis=1)]
        arg_3 = arg_3 + 0.00001 # we don't like zeros!!!
        return arg_3

pre - processed the data frame . new filtering methods will be implement here .


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Manually add a subscriber to a workflow, bypassing the default trigger
        settings. You can also use this endpoint to trigger a series of
        automated emails in an API 3.0 workflow type or add subscribers to an
        automated email queue that uses the API request delay type.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param data: The request body parameters
        :type data: :py:class:`dict`
        data = {
            "email_address": string*
        }
        """
        arg_0.workflow_id = arg_1
        arg_0.email_id = arg_2
        if 'email_address' not in arg_3:
            raise KeyError('The automation email queue must have an email_address')
        check_email(arg_3['email_address'])
        arg_4 = arg_0._mc_client._post(
            url=arg_0._build_path(arg_1, 'emails', arg_2, 'queue'),
            arg_3=arg_3
        )
        if arg_4 is not None:
            arg_0.subscriber_hash = arg_4['id']
        else:
            arg_0.subscriber_hash = None
        return arg_4

Manually add a subscriber to a workflow bypassing the default trigger settings . You can also use this endpoint to trigger a series of automated emails in an API 3 . 0 workflow type or add subscribers to an automated email queue that uses the API request delay type .


return style.get('%sval' % w_namespace) != 'false'

def Func ( arg_0 ) : if arg_0 is None : return False arg_1 = get_namespace ( arg_0 , 'w' ) return arg_0 . get ( '%sval' % arg_1 ) != 'false'

def Func(arg_0):
    """
    For bold, italics and underline. Simply checking to see if the various tags
    are present will not suffice. If the tag is present and set to False then
    the style should not be present.
    """
    if arg_0 is None:
        return False
    arg_1 = get_namespace(arg_0, 'w')
    return arg_0.get('%sval' % arg_1) != 'false'

For bold italics and underline . Simply checking to see if the various tags are present will not suffice . If the tag is present and set to False then the style should not be present .


The speed limit for a boid.

        Boids can momentarily go very fast,
        something that is impossible for real animals.

def Func ( arg_0 , arg_1 = 30 ) : if abs ( arg_0 . vx ) > arg_1 : arg_0 . vx = arg_0 . vx / abs ( arg_0 . vx ) * arg_1 if abs ( arg_0 . vy ) > arg_1 : arg_0 . vy = arg_0 . vy / abs ( arg_0 . vy ) * arg_1 if abs ( arg_0 . vz ) > arg_1 : arg_0 . vz = arg_0 . vz / abs ( arg_0 . vz ) * arg_1

def Func(arg_0, arg_1=30):

        """ The speed Func for a boid.

        Boids can momentarily go very fast,
        something that is impossible for real animals.

        """

        if abs(arg_0.vx) > arg_1:
            arg_0.vx = arg_0.vx/abs(arg_0.vx)*arg_1
        if abs(arg_0.vy) > arg_1:
            arg_0.vy = arg_0.vy/abs(arg_0.vy)*arg_1
        if abs(arg_0.vz) > arg_1:
            arg_0.vz = arg_0.vz/abs(arg_0.vz)*arg_1

The speed limit for a boid . Boids can momentarily go very fast something that is impossible for real animals .


Customized version of get_data to directly get the data without
            using the authentication method.

(self, url, headers=dict(), params=dict(), render_json=True)

def Func ( arg_0 , arg_1 , arg_2 = arg_3 ( ) , arg_4 = arg_3 ( ) , arg_5 = True ) : arg_1 = urljoin ( arg_0 . end_point , arg_1 ) arg_6 = requests . get ( arg_1 , arg_2 = arg_2 , arg_4 = arg_4 , timeout = arg_0 . get_timeout ( ) ) if arg_5 : return arg_6 . json ( ) return arg_6 . content

def Func(arg_0, arg_1, arg_2=arg_3(), arg_4=arg_3(), arg_5=True):
        """
            Customized version of Func to directly get the data without
            using the authentication method.
        """
        arg_1 = urljoin(arg_0.end_point, arg_1)

        arg_6 = requests.get(arg_1, arg_2=arg_2, arg_4=arg_4,
                                timeout=arg_0.get_timeout())

        if arg_5:
            return arg_6.json()
        return arg_6.content

Customized version of get_data to directly get the data without using the authentication method .


def Func(arg_0):
        """Most of this method is from ``docutils.parser.rst.Directive``.

        docutils version: 0.12
        """
        if not arg_0.state.document.settings.file_insertion_enabled:
            raise arg_0.warning('"%s" directive disabled.' % arg_0.name)
        arg_1 = arg_0.state_machine.input_lines.source(
            arg_0.lineno - arg_0.state_machine.input_offset - 1)
        arg_2 = os.path.dirname(os.path.abspath(arg_1))
        arg_3 = rst.directives.path(arg_0.arguments[0])
        arg_3 = os.path.normpath(os.path.join(arg_2, arg_3))
        arg_3 = utils.relative_path(None, arg_3)
        arg_3 = nodes.repFuncicode(arg_3)

        # get options (currently not use directive-specific options)
        arg_4 = arg_0.options.get(
            'encoding', arg_0.state.document.settings.input_encoding)
        arg_5 = arg_0.state.document.settings.input_encoding_error_handler
        arg_6 = arg_0.options.get(
            'tab-width', arg_0.state.document.settings.tab_width)

        # open the inclding file
        try:
            arg_0.state.document.settings.record_dependencies.add(arg_3)
            arg_7 = io.FileInput(source_path=arg_3,
                                        arg_4=arg_4,
                                        error_handler=arg_5)
        except UnicodeEncodeError as error:
            raise arg_0.severe('Problems with "%s" directive path:\n'
                              'Cannot encode input file path "%s" '
                              '(wrong locale?).' %
                              (arg_0.name, SafeString(arg_3)))
        except IOError as error:
            raise arg_0.severe('Problems with "%s" directive path:\n%s.' %
                              (arg_0.name, ErrorString(error)))

        # read from the file
        try:
            arg_8 = arg_7.read()
        except UnicodeError as error:
            raise arg_0.severe('Problem with "%s" directive:\n%s' %
                              (arg_0.name, ErrorString(error)))

        arg_9 = arg_0.state.document.settings.env.config
        arg_10 = M2R(no_underscore_emphasis=arg_9.no_underscore_emphasis)
        arg_11 = statemachine.string2lines(arg_10(arg_8),
                                                  arg_6,
                                                  convert_whitespace=True)
        arg_0.state_machine.insert_input(arg_11, arg_3)
        return []

Most of this method is from docutils . parser . rst . Directive .


def
Func
(
arg_0
)
:
if
arg_0
is
:
return
elif
(
not
isinstance
(
arg_0
,
str
)
and
isinstance
(
arg_0
,
collections
.
abc
.
Iterable
)
)
:
return
', '
.
join
(
str
(
arg_1
)
for
arg_1
in
sorted
(
arg_0
)
)
else
:
return
str
(
arg_0
)

def Func(arg_0):
    """
    A more flexible str function which intelligently handles stringifying
    strings, lists and other iterables. The results are lexographically sorted
    to ensure generated responses are consistent when iterables such as Set
    are used.
    """
    if arg_0 is None:
        return None
    elif(not isinstance(arg_0, str)
            and isinstance(arg_0, collections.abc.Iterable)):
        return ', '.join(str(arg_1) for arg_1 in sorted(arg_0))
    else:
        return str(arg_0)

A more flexible str function which intelligently handles stringifying strings lists and other iterables . The results are lexographically sorted to ensure generated responses are consistent when iterables such as Set are used .


def Func ( ) : if sys . platform != 'win32' : raise NotImplementedError arg_0 = [ ] arg_1 = _CallWindowsNetCommand ( [ 'use' ] ) for arg_2 in arg_1 . split ( EOL_STYLE_WINDOWS ) : arg_3 = re . match ( "(\w*)\s+(\w:)\s+(.+)" , arg_2 . rstrip ( ) ) if arg_3 : arg_0 . append ( ( arg_3 . group ( 2 ) , arg_3 . group ( 3 ) , arg_3 . group ( 1 ) == 'OK' ) ) return arg_0

def Func():
    '''
    On Windows, returns a list of mapped network drives

    :return: tuple(string, string, bool)
        For each mapped netword drive, return 3 values tuple:
            - the local drive
            - the remote path-
            - True if the mapping is enabled (warning: not reliable)
    '''
    if sys.platform != 'win32':
        raise NotImplementedError
    arg_0 = []
    arg_1 = _CallWindowsNetCommand(['use'])
    for arg_2 in arg_1.split(EOL_STYLE_WINDOWS):
        arg_3 = re.match("(\w*)\s+(\w:)\s+(.+)", arg_2.rstrip())
        if arg_3:
            arg_0.append((arg_3.group(2), arg_3.group(3), arg_3.group(1) == 'OK'))
    return arg_0

On Windows returns a list of mapped network drives


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = arg_0 . xpath_ctxt . xpathEval ( "d:item" ) if arg_2 is not None : for arg_3 in arg_2 : arg_1 . append ( DiscoItem ( arg_0 , arg_3 ) ) return arg_1

def Func(arg_0):
        """Get the items contained in `self`.

        :return: the items contained.
        :returntype: `list` of `DiscoItem`"""
        arg_1=[]
        arg_2=arg_0.xpath_ctxt.xpathEval("d:item")
        if arg_2 is not None:
            for arg_3 in arg_2:
                arg_1.append(DiscoItem(arg_0, arg_3))
        return arg_1


def Func(arg_0, arg_1):
    """
    This method takes a list of labels and returns a unique category number.
    This enables this class to store a list of categories for each point since
    the KNN classifier only stores a single number category for each record.
    """
    arg_2 = 0
    for arg_3 in arg_1:
      arg_2 += arg_0._labelToCategoryNumber(arg_3)
    return arg_2

This method takes a list of labels and returns a unique category number . This enables this class to store a list of categories for each point since the KNN classifier only stores a single number category for each record .


def Func ( arg_0 : arg_1 [ arg_2 , arg_3 ] ) -> Optional [ Tuple [ int , int ] ] : try : arg_4 = arg_0 . meta arg_5 = arg_4 . get ( reader . READER_LINE_KW ) arg_6 = arg_4 . get ( reader . READER_COL_KW ) except AttributeError : return None else : assert isinstance ( arg_5 , int ) and isinstance ( arg_6 , int ) return arg_5 , arg_6

def Func(arg_0: arg_1[arg_2, arg_3]) -> Optional[Tuple[int, int]]:
    """Fetch the location of the form in the original filename from the
    input form, if it has metadata."""
    try:
        arg_4 = arg_0.meta  # type: ignore
        arg_5 = arg_4.get(reader.READER_LINE_KW)  # type: ignore
        arg_6 = arg_4.get(reader.READER_COL_KW)  # type: ignore
    except AttributeError:
        return None
    else:
        assert isinstance(arg_5, int) and isinstance(arg_6, int)
        return arg_5, arg_6

Fetch the location of the form in the original filename from the input form if it has metadata .


def Func(arg_0):
    """
    Mark all message instances for a user as read.

    :param user: user instance for the recipient
    """
    arg_1 = stored_messages_settings.STORAGE_BACKEND
    arg_2 = arg_1()
    arg_2.inbox_purge(arg_0)

Mark all message instances for a user as read .


(parser: Parser[Input, Output], reader: Reader[Input])

def
Func
(
arg_0
:
arg_1
[
arg_2
,
arg_3
]
,
arg_4
:
arg_5
[
arg_2
]
)
->
Result
[
arg_3
]
:
arg_6
=
(
arg_0
<<
eof
)
.
consume
(
arg_4
)
if
isinstance
(
arg_6
,
Continue
)
:
return
Success
(
arg_6
.
value
)
else
:
arg_7
=
set
(
)
arg_8
=
[
]
for
arg_9
in
arg_6
.
expected
:
arg_10
=
arg_9
(
)
if
arg_10
not
in
arg_7
:
arg_7
.
add
(
arg_10
)
arg_8
.
append
(
arg_10
)
return
Failure
(
arg_6
.
farthest
.
expected_error
(
' or '
.
join
(
arg_8
)
)
)

def Func(arg_0: arg_1[arg_2, arg_3], arg_4: arg_5[arg_2]) -> Result[arg_3]:
    """Consume reader and return Success only on complete consumption.

    This is a helper function for ``parse`` methods, which return ``Success``
    when the input is completely consumed and ``Failure`` with an appropriate
    message otherwise.

    Args:
        parser: The parser doing the consuming
        reader: The input being consumed

    Returns:
        A parsing ``Result``
    """
    arg_6 = (arg_0 << eof).consume(arg_4)

    if isinstance(arg_6, Continue):
        return Success(arg_6.value)
    else:
        arg_7 = set()
        arg_8 = []
        for arg_9 in arg_6.expected:
            arg_10 = arg_9()
            if arg_10 not in arg_7:
                arg_7.add(arg_10)
                arg_8.append(arg_10)

        return Failure(arg_6.farthest.expected_error(' or '.join(arg_8)))

Consume reader and return Success only on complete consumption .


(x, values, threshold=None, included_in='upper')

def Func(arg_0, arg_1, arg_2=None, arg_3='upper'):
    """Binarizes the values of x.

    Parameters
    ----------
    values : tuple of two floats
        The lower and upper value to which the inputs are mapped.
    threshold : float
        The threshold; defaults to (values[0] + values[1]) / 2 if None.
    included_in : str
        Whether the threshold value itself belongs to the lower or
        upper interval.

    """
    arg_4, arg_5 = arg_1

    if arg_2 is None:
        arg_2 = (arg_4 + arg_5) / 2.

    arg_0 = arg_0.copy()
    if arg_3 == 'lower':
        arg_0[arg_0 <= arg_2] = arg_4
        arg_0[arg_0 > arg_2] = arg_5
    elif arg_3 == 'upper':
        arg_0[arg_0 < arg_2] = arg_4
        arg_0[arg_0 >= arg_2] = arg_5
    else:
        raise ValueError('included_in must be "lower" or "upper"')
    return arg_0


(old_template, old_version, new_template, new_version)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 != arg_2 : return True else : return _cookiecutter_configs_have_changed ( arg_2 , arg_1 , arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Given two templates and their respective versions, return True if a new cookiecutter
    config needs to be obtained from the user
    """
    if arg_0 != arg_2:
        return True
    else:
        return _cookiecutter_configs_have_changed(arg_2,
                                                  arg_1,
                                                  arg_3)

Given two templates and their respective versions return True if a new cookiecutter config needs to be obtained from the user


def
Func
(
arg_0
,
arg_1
)
:
if
hasattr
(
arg_1
,
"__hash__"
)
and
callable
(
arg_1
.
__hash__
)
:
return
arg_1
elif
isinstance
(
arg_1
,
list
)
:
return
tuple
(
(
arg_0
.
Func
(
arg_2
)
for
arg_2
in
arg_1
)
)
elif
isinstance
(
arg_1
,
dict
)
:
arg_3
=
[
(
key
,
arg_0
.
Func
(
value
)
)
for
key
,
value
in
arg_1
.
items
(
)
]
arg_3
.
sort
(
)
return
tuple
(
arg_3
)
else
:
raise
TypeError
(
"Unable to freeze {} data type."
.
format
(
type
(
arg_1
)
)
)

def Func(arg_0, arg_1):
        """Serialize data to an frozen tuple."""
        if hasattr(arg_1, "__hash__") and callable(arg_1.__hash__):
            # If the data is already hashable (should be immutable) return it
            return arg_1
        elif isinstance(arg_1, list):
            # Freeze the elements of the list and return as a tuple
            return tuple((arg_0.Func(arg_2) for arg_2 in arg_1))
        elif isinstance(arg_1, dict):
            # Freeze the elements of the dictionary, sort them, and return
            # them as a list of tuples
            arg_3 = [
                (key, arg_0.Func(value))
                for key, value in arg_1.items()
            ]
            arg_3.sort()
            return tuple(arg_3)
        else:
            raise TypeError(
                "Unable to freeze {} data type.".format(type(arg_1))
            )


def Func ( arg_0 ) : arg_1 = arg_0 . get_muc_child ( ) if not arg_1 : return None if not isinstance ( arg_1 , MucX ) : return None return arg_1

def Func(arg_0):
        """If `self` is a MUC room join request return the information contained.

        :return: the join request details or `None`.
        :returntype: `MucX`
        """
        arg_1=arg_0.get_muc_child()
        if not arg_1:
            return None
        if not isinstance(arg_1,MucX):
            return None
        return arg_1

If self is a MUC room join request return the information contained .


def Func ( arg_0 ) : arg_0 . _ft232h . setup_pins ( { 0 : GPIO . OUT , 1 : GPIO . OUT , 2 : GPIO . IN } , { 0 : GPIO . HIGH , 1 : GPIO . HIGH } )

def Func(arg_0):
        """Put I2C lines into idle state."""
        # Put the I2C lines into an idle state with SCL and SDA high.
        arg_0._ft232h.setup_pins({0: GPIO.OUT, 1: GPIO.OUT, 2: GPIO.IN},
                                {0: GPIO.HIGH, 1: GPIO.HIGH})


def Func ( ) : try : arg_0 = conf . get ( 'core' , 'hostname_callable' ) except AirflowConfigException : arg_0 = None if not arg_0 : return socket . getfqdn ( ) arg_1 , arg_2 = arg_0 . split ( ':' ) arg_3 = importlib . import_module ( arg_1 ) arg_4 = getattr ( arg_3 , arg_2 ) return arg_4 ( )

def Func():
    """
    Fetch the hostname using the callable from the config or using
    `socket.getfqdn` as a fallback.
    """
    # First we attempt to fetch the callable path from the config.
    try:
        arg_0 = conf.get('core', 'hostname_callable')
    except AirflowConfigException:
        arg_0 = None

    # Then we handle the case when the config is missing or empty. This is the
    # default behavior.
    if not arg_0:
        return socket.getfqdn()

    # Since we have a callable path, we try to import and run it next.
    arg_1, arg_2 = arg_0.split(':')
    arg_3 = importlib.import_module(arg_1)
    arg_4 = getattr(arg_3, arg_2)
    return arg_4()

Fetch the hostname using the callable from the config or using socket . getfqdn as a fallback .


return i_start, i_stop, chan_start_idx, chan_stop_idx

def Func(arg_0, arg_1=None, arg_2=None):
        """ Setup frequency axis """
        ## Setup frequency axis
        arg_3 = arg_0.header[b'fch1']
        arg_4 = arg_0.header[b'foff']

        arg_5, arg_6 = 0, arg_0.header[b'nchans']
        if arg_1:
            arg_5 = int((arg_1 - arg_3) / arg_4)
        if arg_2:
            arg_6  = int((arg_2 - arg_3)  / arg_4)

        #calculate closest true index value
        arg_7 = np.int(arg_5)
        arg_8  = np.int(arg_6)

        #create freq array
        if arg_5 < arg_6:
            arg_9 = np.arange(arg_7, arg_8)
        else:
            arg_9 = np.arange(arg_8, arg_7)

        arg_0.freqs = arg_4 * arg_9 + arg_3

#         if f_delt < 0:
#             self.freqs = self.freqs[::-1]

        if arg_8 < arg_7:
            arg_8, arg_7 = arg_7,arg_8

        return arg_5, arg_6, arg_7, arg_8


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"display: %s"
,
arg_1
.
get
(
'content'
,
''
)
)
if
not
arg_0
.
_hidden
and
arg_0
.
_is_from_this_session
(
arg_1
)
:
arg_2
=
arg_1
[
'content'
]
[
'source'
]
arg_3
=
arg_1
[
'content'
]
[
'data'
]
arg_4
=
arg_1
[
'content'
]
[
'metadata'
]
if
arg_3
.
has_key
(
'text/html'
)
:
arg_5
=
arg_3
[
'text/html'
]
arg_0
.
_append_html
(
arg_5
,
True
)
elif
arg_3
.
has_key
(
'text/plain'
)
:
arg_6
=
arg_3
[
'text/plain'
]
arg_0
.
_append_plain_text
(
arg_6
,
True
)
arg_0
.
_append_plain_text
(
u'\n'
,
True
)

def Func(arg_0, arg_1):
        """ The base handler for the ``display_data`` message.
        """
        arg_0.log.debug("display: %s", arg_1.get('content', ''))
        # For now, we don't display data from other frontends, but we
        # eventually will as this allows all frontends to monitor the display
        # data. But we need to figure out how to handle this in the GUI.
        if not arg_0._hidden and arg_0._is_from_this_session(arg_1):
            arg_2 = arg_1['content']['source']
            arg_3 = arg_1['content']['data']
            arg_4 = arg_1['content']['metadata']
            # In the regular IPythonWidget, we simply print the plain text
            # representation.
            if arg_3.has_key('text/html'):
                arg_5 = arg_3['text/html']
                arg_0._append_html(arg_5, True)
            elif arg_3.has_key('text/plain'):
                arg_6 = arg_3['text/plain']
                arg_0._append_plain_text(arg_6, True)
            # This newline seems to be needed for text and html output.
            arg_0._append_plain_text(u'\n', True)

The base handler for the display_data message .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
trees
.
Tree
(
)
.
root
arg_3
=
arg_1
.
split
(
"/"
)
for
arg_4
in
arg_3
:
arg_5
=
{
x
.
name
:
x
for
x
in
arg_2
.
children
}
if
arg_4
not
in
arg_5
:
arg_0
.
log
.
warning
(
"Cgroup does not exist: %s"
,
arg_1
)
return
else
:
arg_2
=
arg_5
[
arg_4
]
arg_6
=
arg_2
.
parent
arg_0
.
log
.
debug
(
"Deleting cgroup %s/%s"
,
arg_6
,
arg_2
.
name
)
arg_6
.
delete_cgroup
(
arg_2
.
name
)

def Func(arg_0, arg_1):
        """
        Delete the specified cgroup.

        :param path: The path of the cgroup to delete.
        E.g. cpu/mygroup/mysubgroup
        """
        arg_2 = trees.Tree().root
        arg_3 = arg_1.split("/")
        for arg_4 in arg_3:
            arg_5 = {x.name: x for x in arg_2.children}
            if arg_4 not in arg_5:
                arg_0.log.warning("Cgroup does not exist: %s", arg_1)
                return
            else:
                arg_2 = arg_5[arg_4]
        # node is now the leaf node
        arg_6 = arg_2.parent
        arg_0.log.debug("Deleting cgroup %s/%s", arg_6, arg_2.name)
        arg_6.delete_cgroup(arg_2.name)


def Func ( arg_0 : arg_1 [ arg_2 ] ) -> NodePredicate : arg_3 = set ( arg_0 ) def exclusion_filter ( arg_4 : arg_5 , arg_6 : arg_2 ) -> bool : return arg_6 not in arg_3 return exclusion_filter

def Func(arg_0: arg_1[arg_2]) -> NodePredicate:
    """Build a filter that fails on nodes in the given list."""
    arg_3 = set(arg_0)

    def exclusion_filter(arg_4: arg_5, arg_6: arg_2) -> bool:
        """Pass only for a node that isn't in the enclosed node list

        :return: If the node isn't contained within the enclosed node list
        """
        return arg_6 not in arg_3

    return exclusion_filter

Build a filter that fails on nodes in the given list .


def Func(arg_0, *arg_1):
        """Asserts that val is equal to one of the given items."""
        if len(arg_1) == 0:
            raise ValueError('one or more args must be given')
        else:
            for arg_2 in arg_1:
                if arg_0.val == arg_2:
                    return arg_0
        arg_0._err('Expected <%s> to be in %s, but was not.' % (arg_0.val, arg_0._fmt_items(arg_1)))

Asserts that val is equal to one of the given items .


return rolling_sum * 2 / (mag * (mag + 1))

def Func(arg_0):
    r"""Return Heronian mean.

    The Heronian mean is:
    :math:`\frac{\sum\limits_{i, j}\sqrt{{x_i \cdot x_j}}}
    {|nums| \cdot \frac{|nums| + 1}{2}}`
    for :math:`j \ge i`

    Cf. https://en.wikipedia.org/wiki/Heronian_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The Heronian mean of nums

    Examples
    --------
    >>> Func([1, 2, 3, 4])
    2.3888282852609093
    >>> Func([1, 2])
    1.4714045207910316
    >>> Func([0, 5, 1000])
    179.28511301977582

    """
    arg_1 = len(arg_0)
    arg_2 = 0
    for arg_3 in range(arg_1):
        for arg_4 in range(arg_3, arg_1):
            if arg_0[arg_3] == arg_0[arg_4]:
                arg_2 += arg_0[arg_3]
            else:
                arg_2 += (arg_0[arg_3] * arg_0[arg_4]) ** 0.5
    return arg_2 * 2 / (arg_1 * (arg_1 + 1))

r"""Return Heronian mean.

    The Heronian mean is:
    :math:`\frac{\sum\limits_{i, j}\sqrt{{x_i \cdot x_j}}}
    {|nums| \cdot \frac{|nums| + 1}{2}}`
    for :math:`j \ge i`

    Cf. https://en.wikipedia.org/wiki/Heronian_mean

    Parameters
    ----------
    nums : list
        A series of numbers

    Returns
    -------
    float
        The Heronian mean of nums

    Examples
    --------
    >>> heronian_mean([1, 2, 3, 4])
    2.3888282852609093
    >>> heronian_mean([1, 2])
    1.4714045207910316
    >>> heronian_mean([0, 5, 1000])
    179.28511301977582


return self._nn_interface._add_generic(self, type_name=LINK,
                                               group_type_name=GROUP, args=(name, instance),
                                               kwargs={},
                                               add_prefix=False)

def Func ( arg_0 , arg_1 , arg_2 = None ) : if isinstance ( arg_1 , str ) : arg_3 = arg_1 if isinstance ( arg_2 , str ) : arg_4 = arg_0 . v_root . f_get ( arg_2 ) else : arg_4 = arg_2 else : arg_4 = arg_1 arg_3 = arg_4 . v_name return arg_0 . _nn_interface . _add_generic ( arg_0 , type_name = LINK , group_type_name = GROUP , args = ( arg_3 , arg_4 ) , kwargs = { } , add_prefix = False )

def Func(arg_0, arg_1, arg_2=None):
        """Adds a link to an existing node.

        Can be called as ``node.Func(other_node)`` this will add a link the `other_node`
        with the link name as the name of the node.

        Or can be called as ``node.Func(name, other_node)`` to add a link to the
        `other_node` and the given `name` of the link.

        In contrast to addition of groups and leaves,  colon separated names
        are **not** allowed, i.e. ``node.Func('mygroup.mylink', other_node)``
        does not work.

        """
        if isinstance(arg_1, str):
            arg_3 = arg_1
            if isinstance(arg_2, str):
                arg_4 = arg_0.v_root.f_get(arg_2)
            else:
                arg_4 =  arg_2
        else:
            arg_4 = arg_1
            arg_3 = arg_4.v_name

        return arg_0._nn_interface._add_generic(arg_0, type_name=LINK,
                                               group_type_name=GROUP, args=(arg_3, arg_4),
                                               kwargs={},
                                               add_prefix=False)

Adds a link to an existing node.

        Can be called as ``node.f_add_link(other_node)`` this will add a link the `other_node`
        with the link name as the name of the node.

        Or can be called as ``node.f_add_link(name, other_node)`` to add a link to the
        `other_node` and the given `name` of the link.

        In contrast to addition of groups and leaves,  colon separated names
        are **not** allowed, i.e. ``node.f_add_link('mygroup.mylink', other_node)``
        does not work.


def Func ( arg_0 , arg_1 ) : assert arg_1 . ndim == 2 arg_1 = arg_1 - np . max ( arg_1 , axis = 1 , keepdims = True ) arg_2 = np . exp ( arg_1 ) arg_3 = np . sum ( arg_2 , axis = 1 ) arg_4 = np . log ( arg_3 ) - arg_1 [ : , arg_0 ] return arg_4

def Func(arg_0, arg_1):
    """Calculates the cross-entropy for a batch of logits.

    Parameters
    ----------
    logits : array_like
        The logits predicted by the model for a batch of inputs.
    label : int
        The label describing the target distribution.

    Returns
    -------
    np.ndarray
        The cross-entropy between softmax(logits[i]) and onehot(label)
        for all i.

    """

    assert arg_1.ndim == 2

    # for numerical reasons we subtract the max logit
    # (mathematically it doesn't matter!)
    # otherwise exp(logits) might become too large or too small
    arg_1 = arg_1 - np.max(arg_1, axis=1, keepdims=True)
    arg_2 = np.exp(arg_1)
    arg_3 = np.sum(arg_2, axis=1)
    arg_4 = np.log(arg_3) - arg_1[:, arg_0]
    return arg_4

Calculates the cross - entropy for a batch of logits .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = { "_document" : arg_1 } if isinstance ( arg_2 . field , EmbeddedDocumentField ) : arg_4 . update ( arg_0 . create_document_dictionary ( arg_1 = arg_2 . field . document_type_obj , owner_document = arg_1 ) ) arg_4 . update ( { "_document_field" : arg_2 . field , "_key" : arg_3 , "_field_type" : ListField , "_widget" : get_widget ( arg_2 . field ) , "_value" : getattr ( arg_1 , arg_3 , None ) } ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Genereates a dictionary representation of the list field. Document
        should be the document the list_field comes from.

        DO NOT CALL DIRECTLY
        """
        arg_4 = {"_document": arg_1}

        if isinstance(arg_2.field, EmbeddedDocumentField):
            arg_4.update(arg_0.create_document_dictionary(arg_1=arg_2.field.document_type_obj,
                                                             owner_document=arg_1))

        # Set the list_dict after it may have been updated
        arg_4.update({"_document_field": arg_2.field,
                          "_key": arg_3,
                          "_field_type": ListField,
                          "_widget": get_widget(arg_2.field),
                          "_value": getattr(arg_1, arg_3, None)})

        return arg_4

Genereates a dictionary representation of the list field . Document should be the document the list_field comes from .


def Func(arg_0):
    """
    Identify whether the user is requesting unit validation against
    astropy.units, pint, or quantities.
    """

    if HAS_ASTROPY:

        from astropy.units import UnitBase

        if isinstance(arg_0, UnitBase):

            return ASTROPY

    if HAS_PINT:

        from pint.unit import UnitsContainer

        if hasattr(arg_0, 'dimensionality') and isinstance(arg_0.dimensionality, UnitsContainer):

            return PINT

    if HAS_QUANTITIES:

        from quantities.unitquantity import IrreducibleUnit
        from quantities import Quantity

        if isinstance(arg_0, IrreducibleUnit) or isinstance(arg_0, Quantity):

            return QUANTITIES

    raise TraitError("Could not identify unit framework for target unit of type {0}".format(type(arg_0).__name__))

Identify whether the user is requesting unit validation against astropy . units pint or quantities .


return tf.where(self.concentration > 0,
                    -safe_lognorm,
                    log_nsphere_surface_area * tf.ones_like(safe_lognorm))

def Func(arg_0):
    """Computes the log-normalizer of the distribution."""
    arg_1 = tf.compat.dimension_value(arg_0.event_shape[0])
    if arg_1 is None:
      raise ValueError('vMF _log_normalizer currently only supports '
                       'statically known event shape')
    arg_2 = tf.where(arg_0.concentration > 0,
                         arg_0.concentration,
                         tf.ones_like(arg_0.concentration))
    arg_3 = ((arg_1 / 2 - 1) * tf.math.log(arg_2) -
                    (arg_1 / 2) * np.log(2 * np.pi) -
                    tf.math.log(_bessel_ive(arg_1 / 2 - 1, arg_2)) -
                    tf.abs(arg_2))
    arg_4 = (
        np.log(2.) + (arg_1 / 2) * np.log(np.pi) -
        tf.math.lgamma(tf.cast(arg_1 / 2, arg_0.dtype)))
    return tf.where(arg_0.concentration > 0,
                    -arg_3,
                    arg_4 * tf.ones_like(arg_3))

Computes the log - normalizer of the distribution .


def Func(arg_0, arg_1, arg_2):
  """Cancel operations.

  Args:
    batch_fn: API-specific batch function.
    Func_fn: API-specific Func function.
    ops: A list of operations to Func.

  Returns:
    A list of operations Funced and a list of error messages.
  """

  # Canceling many operations one-by-one can be slow.
  # The Pipelines API doesn't directly support a list of operations to Func,
  # but the requests can be performed in batch.

  arg_3 = []
  arg_4 = []

  arg_5 = 256
  arg_6 = len(arg_2)
  for arg_7 in range(0, arg_6, arg_5):
    arg_8, arg_9 = _Func_batch(
        arg_0, arg_1, arg_2[arg_7:arg_7 + arg_5])
    arg_3.extend(arg_8)
    arg_4.extend(arg_9)

  return arg_3, arg_4

Cancel operations.

  Args:
    batch_fn: API-specific batch function.
    cancel_fn: API-specific cancel function.
    ops: A list of operations to cancel.

  Returns:
    A list of operations canceled and a list of error messages.


(cls, path, argv=None, envp=None, entry_symbol=None, symbolic_files=None, concrete_start='', pure_symbolic=False, stdin_size=None, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
,
arg_5
=
,
arg_6
=
''
,
arg_7
=
False
,
arg_8
=
,
**
arg_9
)
:
if
arg_8
is
:
arg_8
=
consts
.
stdin_size
try
:
return
arg_0
(
_make_Func
(
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
,
arg_8
)
,
**
arg_9
)
except
elftools
.
common
.
exceptions
.
ELFError
:
raise
Exception
(
f'Invalid binary: {path}'
)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None, arg_6='', arg_7=False, arg_8=None, **arg_9):
        """
        Constructor for Linux binary analysis.

        :param str path: Path to binary to analyze
        :param argv: Arguments to provide to the binary
        :type argv: list[str]
        :param envp: Environment to provide to the binary
        :type envp: dict[str, str]
        :param entry_symbol: Entry symbol to resolve to start execution
        :type envp: str
        :param symbolic_files: Filenames to mark as having symbolic input
        :type symbolic_files: list[str]
        :param str concrete_start: Concrete stdin to use before symbolic input
        :param int stdin_size: symbolic stdin size to use
        :param kwargs: Forwarded to the Manticore constructor
        :return: Manticore instance, initialized with a Linux State
        :rtype: Manticore
        """
        if arg_8 is None:
            arg_8 = consts.stdin_size

        try:
            return arg_0(_make_Func(arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8), **arg_9)
        except elftools.common.exceptions.ELFError:
            raise Exception(f'Invalid binary: {path}')


def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Convert binary data to type 'type'.

        'type' must have a convert_binary function.  If 'type'
        supports size checking, the size function is called to ensure
        that binvalue is the correct size for deserialization
        """

        arg_4 = arg_0.get_type_size(arg_2)
        if arg_4 > 0 and len(arg_1) != arg_4:
            raise ArgumentError("Could not convert type from binary since the data was not the correct size", required_size=arg_4, actual_size=len(arg_1), arg_2=arg_2)

        arg_5 = arg_0.get_type(arg_2)

        if not hasattr(arg_5, 'convert_binary'):
            raise ArgumentError("Type does not support conversion from binary", arg_2=arg_2)

        return arg_5.convert_binary(arg_1, **arg_3)


Get the list of network interfaces. Will return all datalinks on SmartOS.

return [line.split(' ')[0] for line in res.splitlines()[1:]]

def
Func
(
)
:
with
settings
(
hide
(
'running'
,
'stdout'
)
)
:
if
is_file
(
'/usr/sbin/dladm'
)
:
arg_0
=
run
(
'/usr/sbin/dladm show-link'
)
else
:
arg_0
=
sudo
(
'/sbin/ifconfig -s'
)
return
[
arg_1
.
split
(
' '
)
[
0
]
for
arg_1
in
arg_0
.
splitlines
(
)
[
1
:
]
]

def Func():
    """
    Get the list of network Func. Will return all datalinks on SmartOS.
    """
    with settings(hide('running', 'stdout')):
        if is_file('/usr/sbin/dladm'):
            arg_0 = run('/usr/sbin/dladm show-link')
        else:
            arg_0 = sudo('/sbin/ifconfig -s')
    return [arg_1.split(' ')[0] for arg_1 in arg_0.splitlines()[1:]]

Get the list of network interfaces . Will return all datalinks on SmartOS .


(remote_path, local_path, dry_run=False, force=False)

def Func(arg_0, arg_1, arg_2=False, arg_3=False):
    """Recursively downloads a folder in a vault to a local directory.
    Only downloads files, not datasets."""

    arg_1 = os.path.normpath(os.path.expanduser(arg_1))
    if not os.access(arg_1, os.W_OK):
        raise Exception(
            'Write access to local path ({}) is required'
            .format(arg_1))

    arg_4, arg_5 = solvebio.Object.validate_full_path(arg_0)
    arg_6 = solvebio.Vault.get_by_full_path(arg_5['vault'])
    print('Downloading all files from {} to {}'.format(arg_4, arg_1))

    if arg_5['path'] == '/':
        arg_7 = None
    else:
        arg_8 = solvebio.Object.get_by_full_path(
            arg_0, assert_type='folder')
        arg_7 = arg_8.id

    # Scan the folder for all sub-folders and create them locally
    print('Creating local directory structure at: {}'.format(arg_1))
    if not os.path.exists(arg_1):
        if not arg_2:
            os.makedirs(arg_1)

    arg_9 = arg_6.folders(arg_7=arg_7)
    for arg_10 in arg_9:
        arg_11 = os.path.normpath(arg_1 + arg_10.path)
        if not os.path.exists(arg_11):
            print('Creating folder: {}'.format(arg_11))
            if not arg_2:
                os.makedirs(arg_11)

    arg_12 = arg_6.files(arg_7=arg_7)
    for arg_10 in arg_12:
        arg_11 = os.path.normpath(arg_1 + arg_10.path)
        if os.path.exists(arg_11):
            if arg_3:
                # Delete the local copy
                print('Deleting local file (force download): {}'.format(arg_11))
                if not arg_2:
                    os.remove(arg_11)
            else:
                print('Skipping file (already exists): {}'.format(arg_11))
                continue

        print('Downloading file: {}'.format(arg_11))
        if not arg_2:
            arg_10.download(arg_11)

Recursively downloads a folder in a vault to a local directory . Only downloads files not datasets .


def Func ( arg_0 , arg_1 , ** arg_2 ) : if 'fields' in arg_2 : if 'total_items' not in arg_2 [ 'fields' ] . split ( ',' ) : arg_2 [ 'fields' ] += ',total_items' arg_2 . pop ( "offset" , None ) arg_2 . pop ( "count" , None ) arg_3 = arg_0 . _mc_client . _get ( arg_1 = arg_1 , arg_5 = 0 , count = 1000 , ** arg_2 ) arg_4 = arg_3 [ 'total_items' ] if arg_4 > 1000 : for arg_5 in range ( 1 , int ( arg_4 / 1000 ) + 1 ) : arg_3 = merge_results ( arg_3 , arg_0 . _mc_client . _get ( arg_1 = arg_1 , arg_5 = int ( arg_5 * 1000 ) , count = 1000 , ** arg_2 ) ) return arg_3 else : return arg_3

def Func(arg_0, arg_1, **arg_2):
        """
        Iterate over all pages for the given url. Feed in the result of self._build_path as the url.

        :param url: The url of the endpoint
        :type url: :py:class:`str`
        :param queryparams: The query string parameters
        queryparams['fields'] = []
        queryparams['exclude_fields'] = []
        queryparams['count'] = integer
        queryparams['offset'] = integer
        """
        # fields as a query string parameter should be a string with
        # comma-separated substring values to pass along to
        # self._mc_client._get(). It should also contain total_items whenever
        # the parameter is employed, which is forced here.
        if 'fields' in arg_2:
            if 'total_items' not in arg_2['fields'].split(','):
                arg_2['fields'] += ',total_items'
        # Remove offset and count if provided in queryparams
        # to avoid 'multiple values for keyword argument' TypeError
        arg_2.pop("offset", None)
        arg_2.pop("count", None)
        # Fetch results from mailchimp, up to first 1000
        arg_3 = arg_0._mc_client._get(arg_1=arg_1, arg_5=0, count=1000, **arg_2)
        arg_4 = arg_3['total_items']
        # Fetch further results if necessary
        if arg_4 > 1000:
            for arg_5 in range(1, int(arg_4 / 1000) + 1):
                arg_3 = merge_results(arg_3, arg_0._mc_client._get(
                    arg_1=arg_1,
                    arg_5=int(arg_5 * 1000),
                    count=1000,
                    **arg_2
                ))
            return arg_3
        else:  # Further results not necessary
            return arg_3

Iterate over all pages for the given url . Feed in the result of self . _build_path as the url .


def Func(arg_0, arg_1):
        """
        returns the list of states obtained by adding the given inputs
        to the current state, one by one.
        """
        arg_2 = []
        arg_3 = arg_0
        for arg_4 in arg_1:
            arg_3 = arg_3.add_input(arg_4)
            arg_2.append(arg_3)
        return arg_2

returns the list of states obtained by adding the given inputs to the current state one by one .


def Func ( arg_0 ) : arg_1 = [ 'root' ] while arg_1 : arg_2 = arg_1 . pop ( ) for arg_3 in arg_0 . hierarchy . get ( arg_2 , ( ) ) : arg_1 . append ( arg_3 ) if arg_2 not in arg_0 . bones : continue arg_4 = arg_0 . bones [ arg_2 ] arg_5 = [ b for b in arg_0 . bodies if b . name == arg_2 ] [ 0 ] for arg_3 in arg_0 . hierarchy . get ( arg_2 , ( ) ) : arg_6 = arg_0 . bones [ arg_3 ] arg_7 = [ b for b in arg_0 . bodies if b . name == arg_3 ] [ 0 ] arg_8 = ( '' , 'hinge' , 'universal' , 'ball' ) [ len ( arg_6 . dof ) ] arg_0 . joints . append ( arg_0 . world . join ( arg_8 , arg_5 , arg_7 ) )

def Func(arg_0):
        '''Traverse the bone hierarchy and create physics joints.'''
        arg_1 = ['root']
        while arg_1:
            arg_2 = arg_1.pop()
            for arg_3 in arg_0.hierarchy.get(arg_2, ()):
                arg_1.append(arg_3)
            if arg_2 not in arg_0.bones:
                continue
            arg_4 = arg_0.bones[arg_2]
            arg_5 = [b for b in arg_0.bodies if b.name == arg_2][0]
            for arg_3 in arg_0.hierarchy.get(arg_2, ()):
                arg_6 = arg_0.bones[arg_3]
                arg_7 = [b for b in arg_0.bodies if b.name == arg_3][0]
                arg_8 = ('', 'hinge', 'universal', 'ball')[len(arg_6.dof)]
                arg_0.joints.append(arg_0.world.join(arg_8, arg_5, arg_7))

Traverse the bone hierarchy and create physics joints .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 . entries : arg_2 . append ( arg_3 [ "content" ] [ 0 ] [ "value" ] ) arg_0 . url_params = None return arg_2

def Func(arg_0, arg_1):
        """ Return a list of strings formatted as HTML bibliography entries
        """
        arg_2 = []
        for arg_3 in arg_1.entries:
            arg_2.append(arg_3["content"][0]["value"])
        arg_0.url_params = None
        return arg_2


def Func(arg_0):
        """Start the controller."""

        if arg_0.mode == "manual":
            return

        if arg_0.ipython_dir != '~/.ipython':
            arg_0.ipython_dir = os.path.abspath(os.path.expanduser(arg_0.ipython_dir))

        if arg_0.log:
            arg_2 = open(os.path.join(arg_0.ipython_dir, "{0}.controller.out".format(arg_0.profile)), 'w')
            arg_3 = open(os.path.join(arg_0.ipython_dir, "{0}.controller.err".format(arg_0.profile)), 'w')
        else:
            arg_2 = open(os.devnull, 'w')
            arg_3 = open(os.devnull, 'w')

        try:
            arg_4 = [
                'ipcontroller',
                '' if arg_0.ipython_dir == '~/.ipython' else '--ipython-dir={}'.format(arg_0.ipython_dir),
                arg_0.interfaces if arg_0.interfaces is not None else '--ip=*',
                '' if arg_0.profile == 'default' else '--profile={0}'.format(arg_0.profile),
                '--reuse' if arg_0.reuse else '',
                '--location={}'.format(arg_0.public_ip) if arg_0.public_ip else '',
                '--port={}'.format(arg_0.port) if arg_0.port is not None else ''
            ]
            if arg_0.port_range is not None:
                arg_4 += [
                    '--HubFactory.hb={0},{1}'.format(arg_0.hb_ping, arg_0.hb_pong),
                    '--HubFactory.control={0},{1}'.format(arg_0.control_client, arg_0.control_engine),
                    '--HubFactory.mux={0},{1}'.format(arg_0.mux_client, arg_0.mux_engine),
                    '--HubFactory.task={0},{1}'.format(arg_0.task_client, arg_0.task_engine)
                ]
            logger.debug("Starting ipcontroller with '{}'".format(' '.join([str(arg_5) for arg_5 in arg_4])))
            arg_0.proc = subprocess.Popen(arg_4, arg_2=arg_2, arg_3=arg_3, preexec_fn=os.setsid)
        except FileNotFoundError:
            arg_7 = "Could not find ipcontroller. Please make sure that ipyparallel is installed and available in your env"
            logger.error(arg_7)
            raise ControllerError(arg_7)
        except Exception as e:
            arg_7 = "IPPController failed to Func: {0}".format(e)
            logger.error(arg_7)
            raise ControllerError(arg_7)


Returns the maximum representable value in this data type.

return np.finfo(dtype).max if use_finfo else np.iinfo(dtype).max

def Func ( arg_0 ) : arg_0 = tf . as_dtype ( arg_0 ) if hasattr ( arg_0 , 'Func' ) : return arg_0 . Func arg_1 = is_floating ( arg_0 ) or is_complex ( arg_0 ) return np . finfo ( arg_0 ) . Func if arg_1 else np . iinfo ( arg_0 ) . Func

def Func(arg_0):  # pylint: disable=redefined-builtin
  """Returns the Funcimum representable value in this data type."""
  arg_0 = tf.as_dtype(arg_0)
  if hasattr(arg_0, 'Func'):
    return arg_0.Func
  arg_1 = is_floating(arg_0) or is_complex(arg_0)
  return np.finfo(arg_0).Func if arg_1 else np.iinfo(arg_0).Func

Returns the maximum representable value in this data type .


def Func ( arg_0 , arg_1 ) : arg_2 = True arg_3 = [ ] arg_4 = arg_1 while arg_2 and arg_4 : if hasattr ( arg_0 , arg_4 ) : arg_2 = False else : arg_5 = arg_4 . split ( "_" ) arg_3 . append ( arg_5 . pop ( ) ) arg_4 = u"_" . join ( arg_5 ) arg_3 . reverse ( ) return arg_4 , arg_3

def Func(arg_0, arg_1):
    """
    Returns the smallest delimited version of field_key that
    is an attribute on document.

    return (key, left_over_array)
    """
    arg_2 = True
    arg_3 = []
    arg_4 = arg_1
    while arg_2 and arg_4:
        if hasattr(arg_0, arg_4):
            arg_2 = False
        else:
            arg_5 = arg_4.split("_")
            arg_3.append(arg_5.pop())
            arg_4 = u"_".join(arg_5)

    arg_3.reverse()
    return arg_4, arg_3

Returns the smallest delimited version of field_key that is an attribute on document .