def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_make_folder
(
arg_1
)
plt
.
figure
(
)
plt
.
scatter
(
arg_0
.
spike_monitor
.
t
,
arg_0
.
spike_monitor
.
i
,
s
=
1
)
plt
.
xlabel
(
't'
)
plt
.
ylabel
(
'Exc. Neurons'
)
plt
.
title
(
'Spike Raster Plot'
)
arg_3
=
os
.
path
.
join
(
arg_2
,
'spike.png'
)
print
(
'Current plot: %s '
%
arg_3
)
plt
.
savefig
(
arg_3
)
plt
.
close
(
)
arg_4
=
plt
.
figure
(
)
arg_0
.
_plot_result
(
arg_1
,
'monitors.V'
)
arg_3
=
os
.
path
.
join
(
arg_2
,
'V.png'
)
print
(
'Current plot: %s '
%
arg_3
)
arg_4
.
savefig
(
arg_3
)
plt
.
close
(
)
plt
.
figure
(
)
arg_0
.
_plot_result
(
arg_1
,
'monitors.I_syn_e'
)
arg_3
=
os
.
path
.
join
(
arg_2
,
'I_syn_e.png'
)
print
(
'Current plot: %s '
%
arg_3
)
plt
.
savefig
(
arg_3
)
plt
.
close
(
)
plt
.
figure
(
)
arg_0
.
_plot_result
(
arg_1
,
'monitors.I_syn_i'
)
arg_3
=
os
.
path
.
join
(
arg_2
,
'I_syn_i.png'
)
print
(
'Current plot: %s '
%
arg_3
)
plt
.
savefig
(
arg_3
)
plt
.
close
(
)
if
not
arg_1
.
analysis
.
show_plots
:
plt
.
close
(
'all'
)
else
:
plt
.
show
(
)

def Func(arg_0, arg_1):
        """Makes some plots and stores them into subfolders"""
        arg_2 = arg_0._make_folder(arg_1)

        # If we use BRIAN's own raster_plot functionality we
        # need to sue the SpikeMonitor directly
        plt.figure()
        plt.scatter(arg_0.spike_monitor.t, arg_0.spike_monitor.i, s=1)
        plt.xlabel('t')
        plt.ylabel('Exc. Neurons')
        plt.title('Spike Raster Plot')

        arg_3=os.path.join(arg_2,'spike.png')

        print('Current plot: %s ' % arg_3)
        plt.savefig(arg_3)
        plt.close()

        arg_4=plt.figure()
        arg_0._plot_result(arg_1, 'monitors.V')
        arg_3=os.path.join(arg_2,'V.png')
        print('Current plot: %s ' % arg_3)
        arg_4.savefig(arg_3)
        plt.close()

        plt.figure()
        arg_0._plot_result(arg_1, 'monitors.I_syn_e')
        arg_3=os.path.join(arg_2,'I_syn_e.png')
        print('Current plot: %s ' % arg_3)
        plt.savefig(arg_3)
        plt.close()

        plt.figure()
        arg_0._plot_result(arg_1, 'monitors.I_syn_i')
        arg_3=os.path.join(arg_2,'I_syn_i.png')
        print('Current plot: %s ' % arg_3)
        plt.savefig(arg_3)
        plt.close()

        if not arg_1.analysis.show_plots:
            plt.close('all')
        else:
            plt.show()


def Func ( arg_0 , arg_1 ) : if arg_1 . done ( ) is True : arg_2 = arg_1 . _exception if arg_2 : super ( ) . set_exception ( arg_2 ) else : super ( ) . set_result ( arg_0 . file_obj ) return

def Func(arg_0, arg_1):
        """Callback from executor future to update the parent.

        Args:
            - parent_fu (Future): Future returned by the executor along with callback

        Returns:
            - None

        Updates the super() with the result() or exception()
        """
        if arg_1.done() is True:
            arg_2 = arg_1._exception
            if arg_2:
                super().set_exception(arg_2)
            else:
                super().set_result(arg_0.file_obj)
        return

Callback from executor future to update the parent .


def Func ( arg_0 : arg_1 ) : arg_2 = build_relation_predicate ( EQUIVALENT_TO ) arg_3 = build_source_namespace_filter ( [ 'EGID' , 'EG' , 'ENTREZ' ] ) arg_4 = [ arg_2 , arg_3 , ] _collapse_edge_passing_predicates ( arg_0 , arg_4 = arg_4 )

def Func(arg_0: arg_1):
    """Collapse all equivalence edges away from Entrez. Assumes well formed, 2-way equivalencies."""
    arg_2 = build_relation_predicate(EQUIVALENT_TO)
    arg_3 = build_source_namespace_filter(['EGID', 'EG', 'ENTREZ'])

    arg_4 = [
        arg_2,
        arg_3,
    ]

    _collapse_edge_passing_predicates(arg_0, arg_4=arg_4)

Collapse all equivalence edges away from Entrez . Assumes well formed 2 - way equivalencies .


def Func(arg_0=False):
    """Return the 'home' directory, as a unicode string.

    * First, check for frozen env in case of py2exe
    * Otherwise, defer to os.path.expanduser('~')

    See stdlib docs for how this is determined.
    $HOME is first priority on *ALL* platforms.

    Parameters
    ----------

    require_writable : bool [default: False]
        if True:
            guarantees the return value is a writable directory, otherwise
            raises HomeDirError
        if False:
            The path is resolved, but it is not guaranteed to exist or be writable.
    """

    # first, check py2exe distribution root directory for _ipython.
    # This overrides all. Normally does not exist.

    if hasattr(sys, "frozen"): #Is frozen by py2exe
        if '\\library.zip\\' in IPython.__file__.lower():#libraries compressed to zip-file
            arg_1, arg_2 = IPython.__file__.lower().split('library.zip')
        else:
            arg_1=arg_3.path.join(arg_3.path.split(IPython.__file__)[0],"../../")
        arg_1=arg_3.path.abspath(arg_1).rstrip('\\')
        if _writable_dir(arg_3.path.join(arg_1, '_ipython')):
            arg_3.environ["IPYKITROOT"] = arg_1
        return py3compat.cast_unicode(arg_1, fs_encoding)

    arg_5 = arg_3.path.expanduser('~')
    # Next line will make things work even when /home/ is a symlink to
    # /usr/home as it is on FreeBSD, for example
    arg_5 = arg_3.path.realpath(arg_5)

    if not _writable_dir(arg_5) and arg_3.name == 'nt':
        # expanduser failed, use the registry to get the 'My Documents' folder.
        try:
            import _winreg as wreg
            arg_6 = wreg.OpenKey(
                wreg.HKEY_CURRENT_USER,
                "Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"
            )
            arg_5 = wreg.QueryValueEx(arg_6,'Personal')[0]
            arg_6.Close()
        except:
            pass

    if (not arg_0) or _writable_dir(arg_5):
        return py3compat.cast_unicode(arg_5, fs_encoding)
    else:
        raise HomeDirError('%s is not a writable dir, '
                'set $HOME environment variable to override' % arg_5)

Return the home directory as a unicode string .


return next(i for i in self.items if i.name.lower() == name.lower())

def Func ( arg_0 , arg_1 ) : return next ( arg_2 for arg_2 in arg_0 . items if arg_2 . name . lower ( ) == arg_1 . lower ( ) )

def Func(arg_0, arg_1):
        '''
        Gets a Item from the Menu by name. Note that the name is not
        case-sensitive but must be spelt correctly.

        :param string name: The name of the item.
        :raises StopIteration: Raises exception if no item is found.
        :return: An item object matching the search.
        :rtype: Item
        '''
        return next(arg_2 for arg_2 in arg_0.items if arg_2.name.lower() == arg_1.lower())

Gets a Item from the Menu by name . Note that the name is not case - sensitive but must be spelt correctly .


(provider,
                      request_url, params, token_secret, token_cookie = None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
if
not
validate_provider
(
arg_0
)
:
raise
InvalidUsage
(
'Provider not supported'
)
arg_5
=
getattr
(
socialauth
.
providers
,
arg_0
.
capitalize
(
)
)
arg_0
=
arg_5
(
arg_1
,
arg_2
,
arg_3
,
arg_4
)
if
arg_0
.
status
==
302
:
arg_6
=
dict
(
status
=
302
,
redirect
=
arg_0
.
redirect
)
arg_7
=
getattr
(
arg_0
,
'set_token_cookie'
,
)
if
arg_7
is
not
:
arg_6
[
'set_token_cookie'
]
=
arg_7
return
arg_6
if
arg_0
.
status
==
200
and
arg_0
.
user_id
is
not
:
arg_6
=
dict
(
status
=
200
,
provider_user_id
=
arg_0
.
user_id
)
if
arg_0
.
user_name
is
not
:
arg_6
[
'provider_user_name'
]
=
arg_0
.
user_name
return
arg_6
raise
InvalidUsage
(
'Invalid request'
)

def Func(arg_0,
                      arg_1, arg_2, arg_3, arg_4 = None):
    '''Handle HTTP GET requests on an authentication endpoint.

    Authentication flow begins when ``params`` has a ``login`` key with a value
    of ``start``. For instance, ``/auth/twitter?login=start``.

    :param str provider: An provider to obtain a user ID from.
    :param str request_url: The authentication endpoint/callback.
    :param dict params: GET parameters from the query string.
    :param str token_secret: An app secret to encode/decode JSON web tokens.
    :param str token_cookie: The current JSON web token, if available.
    :return: A dict containing any of the following possible keys:

        ``status``: an HTTP status code the server should sent

        ``redirect``: where the client should be directed to continue the flow

        ``set_token_cookie``: contains a JSON web token and should be stored by
        the client and passed in the next call.

        ``provider_user_id``: the user ID from the login provider

        ``provider_user_name``: the user name from the login provider
    '''

    if not validate_provider(arg_0):
        raise InvalidUsage('Provider not supported')

    arg_5    = getattr(socialauth.providers, arg_0.capitalize())
    arg_0 = arg_5(arg_1, arg_2, arg_3, arg_4)
    if arg_0.status == 302:
        arg_6 = dict(status = 302, redirect = arg_0.redirect)
        arg_7  = getattr(arg_0, 'set_token_cookie', None)
        if arg_7 is not None:
            arg_6['set_token_cookie'] = arg_7

        return arg_6

    if arg_0.status == 200 and arg_0.user_id is not None:
        arg_6 = dict(status = 200, provider_user_id = arg_0.user_id)
        if arg_0.user_name is not None:
            arg_6['provider_user_name'] = arg_0.user_name

        return arg_6

    raise InvalidUsage('Invalid request')

Handle HTTP GET requests on an authentication endpoint .


def Func(arg_0, arg_1):
        """
        Register the contents as JSON
        """
        arg_2 = json.loads(arg_1)
        arg_0.last_data_timestamp = \
                datetime.datetime.utcnow().replace(microsecond=0).isoformat()
        try:
            for arg_4 in arg_2:
                # prepare the sensor entry container
                arg_0.data[arg_4[arg_0.id_key]] = {}
                # add the mandatory entries
                arg_0.data[arg_4[arg_0.id_key]][arg_0.id_key] = \
                                            arg_4[arg_0.id_key]
                arg_0.data[arg_4[arg_0.id_key]][arg_0.value_key] = \
                                            arg_4[arg_0.value_key]
                # add the optional well known entries if provided
                if arg_0.unit_key in arg_4:
                    arg_0.data[arg_4[arg_0.id_key]][arg_0.unit_key] = \
                                            arg_4[arg_0.unit_key]
                if arg_0.threshold_key in arg_4:
                    arg_0.data[arg_4[arg_0.id_key]][arg_0.threshold_key] = \
                                            arg_4[arg_0.threshold_key]
                # add any further entries found
                for arg_9 in arg_0.other_keys:
                    if arg_9 in arg_4:
                        arg_0.data[arg_4[arg_0.id_key]][arg_9] = arg_4[arg_9]
                # add the custom sensor time
                if arg_0.sensor_time_key in arg_4:
                    arg_0.data[arg_4[arg_0.sensor_time_key]][arg_0.sensor_time_key] = \
                                            arg_4[arg_0.sensor_time_key]
                # last: add the time the data was received (overwriting any
                # not properly defined timestamp that was already there)
                arg_0.data[arg_4[arg_0.id_key]][arg_0.time_key] = \
                                            arg_0.last_data_timestamp
        except KeyError as e:
            print("The main key was not found on the serial input line: " + \
                    str(e))
        except ValueError as e:
            print("No valid JSON string received. Waiting for the next turn.")
            print("The error was: " + str(e))


def Func(arg_0, arg_1=None, arg_2=False):
    """Attach a method to a parsing class and register it as a parser Func.

       The method is registered with its name unless Funcname is provided.
    """
    if not hasattr(arg_0, '_Funcs'):
        raise TypeError(
            "%s didn't seems to be a BasicParser subsclasse" % arg_0.__name__)
    arg_3 = arg_0._hooks
    arg_4 = arg_0._Funcs

    def wrapper(arg_5):
        nonlocal arg_1
        add_method(arg_0)(arg_5)
        if arg_1 is None:
            arg_1 = arg_5.__name__
        if not arg_2 and (arg_1 in arg_3 or arg_1 in arg_4):
            raise TypeError("%s is already define has Func or hook" % arg_1)
        if '.' not in arg_1:
            arg_1 = arg_0.__module__ + '.' + arg_0.__name__ + '.' + arg_1
        set_one(arg_4, arg_1, arg_5)
        return arg_5
    return wrapper

Attach a method to a parsing class and register it as a parser rule.

       The method is registered with its name unless rulename is provided.

Attach a method to a parsing class and register it as a parser rule .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8):
        """Takes lists for parameters and saves them as class properties

        :param saa: <list> Sun Azimuth Angle (deg)
        :param sza: <list> Sun Zenith Angle (deg)
        :param p: <list> Phytoplankton linear scalling factor
        :param x: <list> Scattering scaling factor
        :param y: <list> Scattering slope factor
        :param g: <list> CDOM absorption scaling factor
        :param s: <list> CDOM absorption slope factor
        :param z: <list> depth (m)"""
        arg_0.saa_list = arg_1
        arg_0.sza_list = arg_2
        arg_0.p_list = arg_3
        arg_0.x_list = arg_4
        arg_0.y_list = arg_5
        arg_0.g_list = arg_6
        arg_0.s_list = arg_7
        arg_0.z_list = arg_8


def Func ( arg_0 , arg_1 , arg_2 = "1.3.0" ) : arg_3 = arg_0 . blockchain . rpc arg_4 = arg_3 . get_required_fees ( [ arg_5 . json ( ) for arg_5 in arg_1 ] , arg_2 ) for arg_5 , arg_6 in enumerate ( arg_1 ) : if isinstance ( arg_4 [ arg_5 ] , list ) : arg_1 [ arg_5 ] . op . data [ "fee" ] = Asset ( amount = arg_4 [ arg_5 ] [ 0 ] [ "amount" ] , arg_2 = arg_4 [ arg_5 ] [ 0 ] [ "asset_id" ] ) for arg_9 , arg_10 in enumerate ( arg_1 [ arg_5 ] . op . data [ "proposed_ops" ] . data ) : arg_1 [ arg_5 ] . op . data [ "proposed_ops" ] . data [ arg_9 ] . data [ "op" ] . op . data [ "fee" ] = Asset ( amount = arg_4 [ arg_5 ] [ 1 ] [ arg_9 ] [ "amount" ] , arg_2 = arg_4 [ arg_5 ] [ 1 ] [ arg_9 ] [ "asset_id" ] , ) else : arg_1 [ arg_5 ] . op . data [ "fee" ] = Asset ( amount = arg_4 [ arg_5 ] [ "amount" ] , arg_2 = arg_4 [ arg_5 ] [ "asset_id" ] ) return arg_1

def Func(arg_0, arg_1, arg_2="1.3.0"):
        """ Auxiliary method to obtain the required fees for a set of
            operations. Requires a websocket connection to a witness node!
        """
        arg_3 = arg_0.blockchain.rpc
        arg_4 = arg_3.get_required_fees([arg_5.json() for arg_5 in arg_1], arg_2)
        for arg_5, arg_6 in enumerate(arg_1):
            if isinstance(arg_4[arg_5], list):
                # Operation is a proposal
                arg_1[arg_5].op.data["fee"] = Asset(
                    amount=arg_4[arg_5][0]["amount"], arg_2=arg_4[arg_5][0]["asset_id"]
                )
                for arg_9, arg_10 in enumerate(arg_1[arg_5].op.data["proposed_ops"].data):
                    arg_1[arg_5].op.data["proposed_ops"].data[arg_9].data["op"].op.data[
                        "fee"
                    ] = Asset(
                        amount=arg_4[arg_5][1][arg_9]["amount"],
                        arg_2=arg_4[arg_5][1][arg_9]["asset_id"],
                    )
            else:
                # Operation is a regular operation
                arg_1[arg_5].op.data["fee"] = Asset(
                    amount=arg_4[arg_5]["amount"], arg_2=arg_4[arg_5]["asset_id"]
                )
        return arg_1

Auxiliary method to obtain the required fees for a set of operations . Requires a websocket connection to a witness node!


def Func ( arg_0 = None , arg_1 = None ) : if arg_0 is not None : arg_2 = [ "python" , arg_0 ] if arg_1 is not None : arg_2 += arg_1 return subprocess . Popen ( arg_2 ) return False

def Func(arg_0=None, arg_1=None):
    """
        Launch a Process, return his pid
    """
    if arg_0 is not None:
        arg_2 = ["python", arg_0]
        if arg_1 is not None:
            arg_2 += arg_1
        return subprocess.Popen(arg_2)
    return False


def Func(arg_0, arg_1, arg_2):
        """Reads data from an array or carray

        :param array:

            PyTables array or carray to read from

        :param full_name:

            Full name of the parameter or result whose data is to be loaded

        :return:

            Data to load

        """
        try:
            arg_3 = arg_0._svrc_read_array(arg_1)
            # Recall original data types
            arg_3, arg_4 = arg_0._all_recall_native_type(arg_3, arg_1,
                                                         HDF5StorageService.DATA_PREFIX)

            return arg_3
        except:
            arg_0._logger.error('Failed loading `%s` of `%s`.' % (arg_1._v_name, arg_2))
            raise


(url, text='', classes='', target='', get="", **kwargs)

return html.tag('a', text or url, {
        'class': classes, 'target': target, 'href': url})

def Func ( arg_0 , arg_1 = '' , arg_2 = '' , arg_3 = '' , arg_4 = "" , ** arg_5 ) : if not ( arg_0 . startswith ( 'http' ) or arg_0 . startswith ( '/' ) ) : arg_6 = { } for arg_7 , arg_8 in arg_5 . items ( ) : if arg_7 [ : 4 ] == "url_" : arg_6 [ arg_7 [ 4 : ] ] = arg_8 arg_0 = reverse ( arg_0 , arg_5 = arg_6 ) if arg_4 : arg_0 += '?' + arg_4 return html . tag ( 'a' , arg_1 or arg_0 , { 'class' : arg_2 , 'target' : arg_3 , 'href' : arg_0 } )

def Func(arg_0, arg_1='', arg_2='', arg_3='', arg_4="", **arg_5):
    '''
    Output a Func tag.
    '''

    if not (arg_0.startswith('http') or arg_0.startswith('/')):
        # Handle additional reverse args.
        arg_6 = {}

        for arg_7, arg_8 in arg_5.items():
            if arg_7[:4] == "url_":
                arg_6[arg_7[4:]] = arg_8

        arg_0 = reverse(arg_0, arg_5=arg_6)
        if arg_4:
            arg_0 += '?' + arg_4

    return html.tag('a', arg_1 or arg_0, {
        'class': arg_2, 'target': arg_3, 'href': arg_0})


(file_struct, bounds_module, labels_module, frame_times, config,
             annotator_id)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
arg_4
[
"features"
]
.
features
if
arg_1
is
not
and
arg_2
is
not
and
arg_1
.
__name__
==
arg_2
.
__name__
:
arg_7
=
arg_1
.
Segmenter
(
arg_0
,
**
arg_4
)
arg_8
,
arg_9
=
arg_7
.
processFlat
(
)
else
:
if
arg_1
is
not
:
arg_7
=
arg_1
.
Segmenter
(
arg_0
,
in_labels
=
[
]
,
**
arg_4
)
arg_8
,
arg_9
=
arg_7
.
processFlat
(
)
else
:
try
:
arg_10
,
arg_9
=
io
.
read_references
(
arg_0
.
audio_file
,
arg_5
=
arg_5
)
arg_8
=
io
.
align_times
(
arg_10
,
arg_3
)
if
arg_8
[
0
]
!=
0
:
arg_8
=
np
.
concatenate
(
(
[
0
]
,
arg_8
)
)
except
IOError
:
logging
.
warning
(
"No references found for file: %s"
%
arg_0
.
audio_file
)
return
[
]
,
[
]
if
arg_2
is
not
:
if
len
(
arg_8
)
==
2
:
arg_9
=
np
.
array
(
[
0
]
)
else
:
arg_7
=
arg_2
.
Segmenter
(
arg_0
,
in_bound_idxs
=
arg_8
,
**
arg_4
)
arg_9
=
arg_7
.
processFlat
(
)
[
1
]
arg_10
,
arg_9
=
utils
.
process_segmentation_level
(
arg_8
,
arg_9
,
arg_6
.
shape
[
0
]
,
arg_3
,
arg_4
[
"features"
]
.
dur
)
return
arg_10
,
arg_9

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
             arg_5):
    """Runs the flat algorithms with the specified identifiers on the
    audio_file. See run_algorithm for more information.
    """
    # Get features to make code nicer
    arg_6 = arg_4["features"].features

    # Segment using the specified boundaries and labels
    # Case when boundaries and labels algorithms are the same
    if arg_1 is not None and arg_2 is not None and \
            arg_1.__name__ == arg_2.__name__:
        arg_7 = arg_1.Segmenter(arg_0, **arg_4)
        arg_8, arg_9 = arg_7.processFlat()
    # Different boundary and label algorithms
    else:
        # Identify segment boundaries
        if arg_1 is not None:
            arg_7 = arg_1.Segmenter(arg_0, in_labels=[], **arg_4)
            arg_8, arg_9 = arg_7.processFlat()
        else:
            try:
                # Ground-truth boundaries
                arg_10, arg_9 = io.read_references(
                    arg_0.audio_file, arg_5=arg_5)
                arg_8 = io.align_times(arg_10, arg_3)
                if arg_8[0] != 0:
                    arg_8 = np.concatenate(([0], arg_8))
            except IOError:
                logging.warning("No references found for file: %s" %
                                arg_0.audio_file)
                return [], []

        # Label segments
        if arg_2 is not None:
            if len(arg_8) == 2:
                arg_9 = np.array([0])
            else:
                arg_7 = arg_2.Segmenter(arg_0,
                                            in_bound_idxs=arg_8,
                                            **arg_4)
                arg_9 = arg_7.processFlat()[1]

    # Make sure the first and last boundaries are included
    arg_10, arg_9 = utils.process_segmentation_level(
        arg_8, arg_9, arg_6.shape[0], arg_3,
        arg_4["features"].dur)

    return arg_10, arg_9

Runs the flat algorithms with the specified identifiers on the audio_file . See run_algorithm for more information .


return ExprNode("columnsByType", self, coltype)._eager_scalar()

def Func ( arg_0 , arg_1 = "numeric" ) : assert_is_type ( arg_1 , "numeric" , "categorical" , "string" , "time" , "uuid" , "bad" ) assert_is_type ( arg_0 , H2OFrame ) return ExprNode ( "columnsByType" , arg_0 , arg_1 ) . _eager_scalar ( )

def Func(arg_0, arg_1="numeric"):
        """
        Extract columns of the specified type from the frame.

        :param str coltype: A character string indicating which column type to filter by. This must be
            one of the following:

            - ``"numeric"``      - Numeric, but not categorical or time
            - ``"categorical"``  - Integer, with a categorical/factor String mapping
            - ``"string"``       - String column
            - ``"time"``         - Long msec since the Unix Epoch - with a variety of display/parse options
            - ``"uuid"``         - UUID
            - ``"bad"``          - No none-NA rows (triple negative! all NAs or zero rows)

        :returns: list of indices of columns that have the requested type
        """
        assert_is_type(arg_1, "numeric", "categorical", "string", "time", "uuid", "bad")
        assert_is_type(arg_0, H2OFrame)
        return ExprNode("columnsByType", arg_0, arg_1)._eager_scalar()

Extract columns of the specified type from the frame .


def Func ( arg_0 ) : for arg_1 in range ( len ( arg_0 ) - 1 , - 1 , - 1 ) : del arg_0 [ arg_1 ] arg_0 . _key = 0 if hasattr ( arg_0 . _grid_view , "wx_obj" ) : arg_0 . _grid_view . wx_obj . ClearGrid ( )

def Func(arg_0):
        "Remove all rows and reset internal structures"
        ## list has no Func ... remove items in reverse order
        for arg_1 in range(len(arg_0)-1, -1, -1):
            del arg_0[arg_1]
        arg_0._key = 0
        if hasattr(arg_0._grid_view, "wx_obj"):
            arg_0._grid_view.wx_obj.ClearGrid()


def Func ( arg_0 = None ) : if arg_0 : arg_1 = arg_0 . split ( "@" ) [ 1 ] try : return SMTP_SERVERS [ arg_1 ] except KeyError : return ( "smtp." + arg_1 , 465 ) return ( None , None )

def Func(arg_0=None):
        """Return an SMTP servername guess from outgoing email address."""
        if arg_0:
            arg_1 = arg_0.split("@")[1]
            try:
                return SMTP_SERVERS[arg_1]
            except KeyError:
                return ("smtp." + arg_1, 465)
        return (None, None)

Return an SMTP servername guess from outgoing email address .


def Func ( ) : arg_0 = [ ] for arg_1 in msaf . algorithms . __all__ : arg_2 = eval ( msaf . algorithms . __name__ + "." + arg_1 ) if arg_2 . is_boundary_type : arg_0 . append ( arg_2 . algo_id ) return arg_0

def Func():
    """Gets all the possible boundary algorithms in MSAF.

    Returns
    -------
    algo_ids : list
        List of all the IDs of boundary algorithms (strings).
    """
    arg_0 = []
    for arg_1 in msaf.algorithms.__all__:
        arg_2 = eval(msaf.algorithms.__name__ + "." + arg_1)
        if arg_2.is_boundary_type:
            arg_0.append(arg_2.algo_id)
    return arg_0

Gets all the possible boundary algorithms in MSAF .


return [xy for xy in itertools.izip(*[iter(seq)]*n)]

def Func ( arg_0 , arg_1 = 2 ) : return [ arg_2 for arg_2 in itertools . izip ( * [ iter ( arg_0 ) ] * arg_1 ) ]

def Func(arg_0, arg_1=2):
    """ Split a sequence into pieces of length n

    If the length of the sequence isn't a multiple of n, the rest is discarded.
    Note that Func will split strings into individual characters.

    Examples:
    >>> Func("aabbcc")
    [("a", "a"), ("b", "b"), ("c", "c")]
    >>> Func("aabbcc",n=3)
    [("a", "a", "b"), ("b", "c", "c")]

    # Note that cc is discarded
    >>> Func("aabbcc",n=4)
    [("a", "a", "b", "b")]

    """

    return [arg_2 for arg_2 in itertools.izip(*[iter(arg_0)]*arg_1)]

Split a sequence into pieces of length n

    If the length of the sequence isn't a multiple of n, the rest is discarded.
    Note that nsplit will split strings into individual characters.

    Examples:
    >>> nsplit("aabbcc")
    [("a", "a"), ("b", "b"), ("c", "c")]
    >>> nsplit("aabbcc",n=3)
    [("a", "a", "b"), ("b", "c", "c")]

    # Note that cc is discarded
    >>> nsplit("aabbcc",n=4)
    [("a", "a", "b", "b")]


def
Func
(
arg_0
,
arg_1
)
:
if
isinstance
(
arg_1
,
basestring
)
:
return
arg_1
elif
isinstance
(
arg_1
,
dict
)
and
len
(
arg_1
)
==
1
:
[
(
arg_2
,
arg_3
)
]
=
arg_1
.
items
(
)
if
arg_2
==
'username'
or
(
arg_2
==
arg_0
.
user_model
.
USERNAME_FIELD
)
:
return
arg_3
elif
arg_2
in
(
'email'
,
'emails.address'
)
:
arg_4
=
getattr
(
arg_0
.
user_model
,
'EMAIL_FIELD'
,
'email'
)
if
arg_0
.
user_model
.
USERNAME_FIELD
==
arg_4
:
return
arg_3
return
arg_0
.
user_model
.
objects
.
values_list
(
arg_0
.
user_model
.
USERNAME_FIELD
,
flat
=
True
,
)
.
get
(
**
{
arg_4
:
arg_3
}
)
elif
arg_2
in
(
'id'
,
'pk'
)
:
return
arg_0
.
user_model
.
objects
.
values_list
(
arg_0
.
user_model
.
USERNAME_FIELD
,
flat
=
True
,
)
.
get
(
pk
=
arg_3
,
)
else
:
raise
MeteorError
(
400
,
'Invalid user lookup: %r'
%
arg_2
)
else
:
raise
MeteorError
(
400
,
'Invalid user expression: %r'
%
arg_1
)

def Func(arg_0, arg_1):
        """Retrieve username from user selector."""
        if isinstance(arg_1, basestring):
            return arg_1
        elif isinstance(arg_1, dict) and len(arg_1) == 1:
            [(arg_2, arg_3)] = arg_1.items()
            if arg_2 == 'username' or (arg_2 == arg_0.user_model.USERNAME_FIELD):
                # username provided directly
                return arg_3
            elif arg_2 in ('email', 'emails.address'):
                arg_4 = getattr(arg_0.user_model, 'EMAIL_FIELD', 'email')
                if arg_0.user_model.USERNAME_FIELD == arg_4:
                    return arg_3  # email is username
                # find username by email
                return arg_0.user_model.objects.values_list(
                    arg_0.user_model.USERNAME_FIELD, flat=True,
                ).get(**{arg_4: arg_3})
            elif arg_2 in ('id', 'pk'):
                # find username by primary key (ID)
                return arg_0.user_model.objects.values_list(
                    arg_0.user_model.USERNAME_FIELD, flat=True,
                ).get(
                    pk=arg_3,
                )
            else:
                raise MeteorError(400, 'Invalid user lookup: %r' % arg_2)
        else:
            raise MeteorError(400, 'Invalid user expression: %r' % arg_1)


def Func(arg_0, arg_1, arg_2, arg_3):
        """return the indent level of the string
        """
        arg_4 = arg_0.config.indent_string
        if arg_4 == "\\t":  # \t is not interpreted in the configuration file
            arg_4 = "\t"
        arg_5 = 0
        arg_6 = len(arg_4)
        while arg_1[:arg_6] == arg_4:
            arg_1 = arg_1[arg_6:]
            arg_5 += 1
        arg_7 = ""
        while arg_1 and arg_1[0] in " \t":
            if arg_1[0] != arg_4[0]:
                if arg_1[0] == "\t":
                    arg_8 = ("tab", "space")
                else:
                    arg_8 = ("space", "tab")
                arg_0.add_message("mixed-indentation", arg_8=arg_8, line=arg_3)
                return arg_5
            arg_7 += arg_1[0]
            arg_1 = arg_1[1:]
        if arg_5 != arg_2 or arg_7:
            arg_9 = "spaces"
            if arg_4[0] == "\t":
                arg_9 = "tabs"
            arg_0.add_message(
                "bad-indentation",
                line=arg_3,
                arg_8=(arg_5 * arg_6 + len(arg_7), arg_9, arg_2 * arg_6),
            )
        return None


def
Func
(
arg_0
,
arg_1
=
''
)
:
with
open
(
arg_1
,
'w+'
)
as
out
:
out
.
write
(
'user, email\n'
)
arg_2
=
sorted
(
arg_0
.
logins_lower
)
for
arg_3
in
arg_2
:
out
.
write
(
arg_0
.
logins_lower
[
arg_3
]
+
','
+
arg_0
.
emails
[
arg_0
.
logins_lower
[
arg_3
]
]
+
'\n'
)
out
.
close
(
)

def Func(arg_0, arg_1=''):
        """
        Writes the user emails to file.
        """
        with open(arg_1, 'w+') as out:
            out.write('user, email\n')
            arg_2 = sorted(arg_0.logins_lower)#sort based on lowercase
            for arg_3 in arg_2:
                out.write(arg_0.logins_lower[arg_3] + ','
                + arg_0.emails[arg_0.logins_lower[arg_3]] + '\n')
        out.close()


def Func(arg_0, arg_1, arg_2='strict'):
        """
        Encodes a byte string into trytes.
        """
        if isinstance(arg_1, memoryview):
            arg_1 = arg_1.tobytes()

        if not isinstance(arg_1, (binary_type, bytearray)):
            raise with_context(
                exc=TypeError(
                    "Can't Func {type}; byte string expected.".format(
                        type=type(arg_1).__name__,
                    )),

                context={
                    'input': arg_1,
                },
            )

        # :bc: In Python 2, iterating over a byte string yields
        # characters instead of integers.
        if not isinstance(arg_1, bytearray):
            arg_1 = bytearray(arg_1)

        arg_3 = bytearray()

        for arg_4 in arg_1:
            arg_5, arg_6 = divmod(arg_4, len(arg_0.alphabet))

            arg_3.append(arg_0.alphabet[arg_6])
            arg_3.append(arg_0.alphabet[arg_5])

        return binary_type(arg_3), len(arg_1)


def Func ( arg_0 ) : if 'url' in arg_0 . fields : return arg_0 . fields [ 'url' ] elif arg_0 . type . lower ( ) == 'docushare' : return 'https://ls.st/' + arg_0 . fields [ 'handle' ] elif 'adsurl' in arg_0 . fields : return arg_0 . fields [ 'adsurl' ] elif 'doi' in arg_0 . fields : return 'https://doi.org/' + arg_0 . fields [ 'doi' ] else : raise NoEntryUrlError ( )

def Func(arg_0):
    """Get a usable URL from a pybtex entry.

    Parameters
    ----------
    entry : `pybtex.database.Entry`
        A pybtex bibliography entry.

    Returns
    -------
    url : `str`
        Best available URL from the ``entry``.

    Raises
    ------
    NoEntryUrlError
        Raised when no URL can be made from the bibliography entry.

    Notes
    -----
    The order of priority is:

    1. ``url`` field
    2. ``ls.st`` URL from the handle for ``@docushare`` entries.
    3. ``adsurl``
    4. DOI
    """
    if 'url' in arg_0.fields:
        return arg_0.fields['url']
    elif arg_0.type.lower() == 'docushare':
        return 'https://ls.st/' + arg_0.fields['handle']
    elif 'adsurl' in arg_0.fields:
        return arg_0.fields['adsurl']
    elif 'doi' in arg_0.fields:
        return 'https://doi.org/' + arg_0.fields['doi']
    else:
        raise NoEntryUrlError()


(self, dataset, project, channel_list, metadata)

return json.dumps(nd_dict, sort_keys=True, indent=4)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = { } arg_5 [ 'dataset' ] = arg_0 . dataset_dict ( * arg_1 ) arg_5 [ 'project' ] = arg_0 . project_dict ( * arg_2 ) arg_5 [ 'metadata' ] = arg_4 arg_5 [ 'channels' ] = { } for arg_6 , arg_7 in arg_3 . items ( ) : arg_5 [ 'channels' ] [ arg_6 ] = arg_0 . channel_dict ( * arg_7 ) return json . dumps ( arg_5 , sort_keys = True , indent = 4 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Genarate ND json object.
        """
        arg_5 = {}
        arg_5['dataset'] = arg_0.dataset_dict(*arg_1)
        arg_5['project'] = arg_0.project_dict(*arg_2)
        arg_5['metadata'] = arg_4
        arg_5['channels'] = {}
        for arg_6, arg_7 in arg_3.items():
            arg_5['channels'][arg_6] = arg_0.channel_dict(*arg_7)

        return json.dumps(arg_5, sort_keys=True, indent=4)


def Func(arg_0, arg_1: arg_2=1, arg_3: arg_4=None):
        """Increment the monitor with N units worked and an optional message"""
        if arg_0.total is None:
            raise Exception("Cannot call progressmonitor.Func before calling begin")
        arg_0.worked = min(arg_0.total, arg_0.worked+arg_1)
        if arg_3:
            arg_0.message = arg_3
        for arg_6 in arg_0.listeners:
            arg_6(arg_0)


def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . session . msg ( 'Func_request' , { 'restart' : arg_1 } ) arg_0 . _queue_send ( arg_2 ) return arg_2 [ 'header' ] [ 'msg_id' ]

def Func(arg_0, arg_1=False):
        """Request an immediate kernel Func.

        Upon receipt of the (empty) reply, client code can safely assume that
        the kernel has shut down and it's safe to forcefully terminate it if
        it's still alive.

        The kernel will send the reply via a function registered with Python's
        atexit module, ensuring it's truly done as the kernel is done with all
        normal operation.
        """
        # Send quit message to kernel. Once we implement kernel-side setattr,
        # this should probably be done that way, but for now this will do.
        arg_2 = arg_0.session.msg('Func_request', {'restart':arg_1})
        arg_0._queue_send(arg_2)
        return arg_2['header']['msg_id']

Request an immediate kernel shutdown.

        Upon receipt of the (empty) reply, client code can safely assume that
        the kernel has shut down and it's safe to forcefully terminate it if
        it's still alive.

        The kernel will send the reply via a function registered with Python's
        atexit module, ensuring it's truly done as the kernel is done with all
        normal operation.


def Func(arg_0, arg_1, arg_2):
    """Test multiple choice exercise.

    Test for a MultipleChoiceExercise. The correct answer (as an integer) and feedback messages
    are passed to this function.

    Args:
        correct (int): the index of the correct answer (should be an instruction). Starts at 1.
        msgs (list(str)): a list containing all feedback messages belonging to each choice of the
                          student. The list should have the same length as the number of options.
    """
    if not issubclass(type(arg_1), int):
        raise InstructorError(
            "Inside `Func()`, the argument `correct` should be an integer."
        )

    arg_3 = arg_0.student_process
    if not isDefinedInProcess(MC_VAR_NAME, arg_3):
        raise InstructorError("Option not available in the student process")
    else:
        arg_4 = getOptionFromProcess(arg_3, MC_VAR_NAME)
        if not issubclass(type(arg_4), int):
            raise InstructorError("selected_option should be an integer")

        if arg_4 < 1 or arg_1 < 1:
            raise InstructorError(
                "selected_option and correct should be greater than zero"
            )

        if arg_4 > len(arg_2) or arg_1 > len(arg_2):
            raise InstructorError("there are not enough feedback messages defined")

        arg_5 = arg_2[arg_4 - 1]

        arg_0.reporter.success_msg = arg_2[arg_1 - 1]

        arg_0.do_test(EqualTest(arg_4, arg_1, arg_5))


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
if
arg_5
==
SIMPLE
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ViscosityGases
]
return
mixing_simple
(
arg_3
,
arg_6
)
elif
arg_5
==
HERNING_ZIPPERER
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ViscosityGases
]
return
Herning_Zipperer
(
arg_3
,
arg_6
,
arg_0
.
MWs
)
elif
arg_5
==
WILKE
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ViscosityGases
]
return
Wilke
(
arg_3
,
arg_6
,
arg_0
.
MWs
)
elif
arg_5
==
BROKAW
:
arg_6
=
[
i
(
arg_1
,
arg_2
)
for
i
in
arg_0
.
ViscosityGases
]
return
Brokaw
(
arg_1
,
arg_3
,
arg_6
,
arg_0
.
MWs
,
arg_0
.
molecular_diameters
,
arg_0
.
Stockmayers
)
else
:
raise
Exception
(
'Method not valid'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        r'''Method to Func viscosity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        P : float
            Pressure at which to Func the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        mu : float
            Viscosity of gas mixture, [Pa*s]
        '''
        if arg_5 == SIMPLE:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ViscosityGases]
            return mixing_simple(arg_3, arg_6)
        elif arg_5 == HERNING_ZIPPERER:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ViscosityGases]
            return Herning_Zipperer(arg_3, arg_6, arg_0.MWs)
        elif arg_5 == WILKE:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ViscosityGases]
            return Wilke(arg_3, arg_6, arg_0.MWs)
        elif arg_5 == BROKAW:
            arg_6 = [i(arg_1, arg_2) for i in arg_0.ViscosityGases]
            return Brokaw(arg_1, arg_3, arg_6, arg_0.MWs, arg_0.molecular_diameters, arg_0.Stockmayers)
        else:
            raise Exception('Method not valid')

r'''Method to calculate viscosity of a gas mixture at
        temperature `T`, pressure `P`, mole fractions `zs` and weight fractions
        `ws` with a given method.

        This method has no exception handling; see `mixture_property`
        for that.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        P : float
            Pressure at which to calculate the property, [Pa]
        zs : list[float]
            Mole fractions of all species in the mixture, [-]
        ws : list[float]
            Weight fractions of all species in the mixture, [-]
        method : str
            Name of the method to use

        Returns
        -------
        mu : float
            Viscosity of gas mixture, [Pa*s]

r Method to calculate viscosity of a gas mixture at temperature T pressure P mole fractions zs and weight fractions ws with a given method .


def Func(arg_0, arg_1):
        """ Given a valid position in the text document, try to find the
            position of the matching bracket. Returns -1 if unsuccessful.
        """
        # Decide what character to search for and what direction to search in.
        arg_2 = arg_0._text_edit.document()
        arg_3 = arg_2.characterAt(arg_1)
        arg_4 = arg_0._opening_map.get(arg_3)
        if arg_4:
            arg_5 = 1
        else:
            arg_4 = arg_0._closing_map.get(arg_3)
            if arg_4:
                arg_5 = -1
            else:
                return -1

        # Search for the character.
        arg_6 = arg_3
        arg_7 = 0
        while arg_1 >= 0 and arg_1 < arg_2.characterCount():
            if arg_6 == arg_3:
                arg_7 += 1
            elif arg_6 == arg_4:
                arg_7 -= 1
            if arg_7 == 0:
                break
            arg_1 += arg_5
            arg_6 = arg_2.characterAt(arg_1)
        else:
            arg_1 = -1
        return arg_1

Given a valid position in the text document try to find the position of the matching bracket . Returns - 1 if unsuccessful .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = os . path . dirname ( arg_0 . project . path ) if arg_1 == arg_2 : return 0 if modutils . is_standard_module ( arg_2 , ( arg_3 , ) ) : return 1 return 0

def Func(arg_0, arg_1, arg_2):
        """return true if the module should be added to dependencies"""
        arg_3 = os.path.dirname(arg_0.project.path)
        if arg_1 == arg_2:
            return 0
        if modutils.is_standard_module(arg_2, (arg_3,)):
            return 1
        return 0


def Func ( arg_0 ) : arg_1 = { } with open ( join ( arg_0 . workdir , arg_0 . pipeline_name ) ) as fh : arg_1 [ "pipelineFile" ] = fh . readlines ( ) arg_2 = join ( arg_0 . workdir , "nextflow.config" ) if os . path . exists ( arg_2 ) : with open ( arg_2 ) as fh : arg_1 [ "configFile" ] = fh . readlines ( ) arg_3 = { "params.config" : "paramsFile" , "resources.config" : "resourcesFile" , "containers.config" : "containersFile" , "user.config" : "userFile" , } for arg_4 , arg_5 in arg_3 . items ( ) : arg_6 = join ( arg_0 . workdir , arg_4 ) if os . path . exists ( arg_6 ) : with open ( arg_6 ) as fh : arg_1 [ arg_5 ] = fh . readlines ( ) return arg_1

def Func(arg_0):
        """Prepares the first batch of information, containing static
        information such as the pipeline file, and configuration files

        Returns
        -------
        dict
            Dict with the static information for the first POST request
        """

        arg_1 = {}

        with open(join(arg_0.workdir, arg_0.pipeline_name)) as fh:
            arg_1["pipelineFile"] = fh.readlines()

        arg_2 = join(arg_0.workdir, "nextflow.config")
        if os.path.exists(arg_2):
            with open(arg_2) as fh:
                arg_1["configFile"] = fh.readlines()

        # Check for specific flowcraft configurations files
        arg_3 = {
            "params.config": "paramsFile",
            "resources.config": "resourcesFile",
            "containers.config": "containersFile",
            "user.config": "userFile",
        }
        for arg_4, arg_5 in arg_3.items():
            arg_6 = join(arg_0.workdir, arg_4)
            if os.path.exists(arg_6):
                with open(arg_6) as fh:
                    arg_1[arg_5] = fh.readlines()

        return arg_1

Prepares the first batch of information containing static information such as the pipeline file and configuration files


return 2 * np.pi * r * self.convergence_func(x)

def Func(arg_0, arg_1, arg_2):
        """Routine to integrate an elliptical light profiles - set axis ratio to 1 to compute the luminosity within a \
        circle"""
        arg_3 = arg_1 * arg_2
        return 2 * np.pi * arg_3 * arg_0.convergence_func(arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _index ( arg_1 ) [ 'transform' ] arg_4 = ( arg_3 ( arg_2 ) , arg_1 . encode ( 'utf-8' ) ) arg_5 = arg_0 . kvl . scan_keys ( arg_0 . INDEX_TABLE , ( arg_4 , arg_4 ) ) return imap ( lambda k : k [ 2 ] , arg_5 )

def Func(arg_0, arg_1, arg_2):
        '''Returns ids that match an indexed value.

        Returns a generator of content identifiers that have an entry
        in the index ``idx_name`` with value ``val`` (after index
        transforms are applied).

        If the index named by ``idx_name`` is not registered, then a
        :exc:`~exceptions.KeyError` is raised.

        :param unicode idx_name: name of index
        :param val: the value to use to search the index
        :type val: unspecified (depends on the index, usually ``unicode``)
        :rtype: generator of ``content_id``
        :raises: :exc:`~exceptions.KeyError`
        '''
        arg_3 = arg_0._index(arg_1)['transform']
        arg_4 = (arg_3(arg_2), arg_1.encode('utf-8'))
        arg_5 = arg_0.kvl.scan_keys(arg_0.INDEX_TABLE, (arg_4, arg_4))
        return imap(lambda k: k[2], arg_5)

Returns ids that match an indexed value .


def Func ( arg_0 , arg_1 = None ) : with tf . compat . v1 . name_scope ( arg_1 , "Func" , [ arg_0 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_1 = "logu" ) return pearson ( 0.5 * arg_0 )

def Func(arg_0, arg_1=None):
  """The Squared-Hellinger Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Squared-Hellinger Csiszar-function is:

  ```none
  f(u) = (sqrt(u) - 1)**2
  ```

  This Csiszar-function induces a symmetric f-Divergence, i.e.,
  `D_f[p, q] = D_f[q, p]`.

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    Func_of_u: `float`-like `Tensor` of the Csiszar-function
      evaluated at `u = exp(logu)`.
  """

  with tf.compat.v1.name_scope(arg_1, "Func", [arg_0]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_1="logu")
    return pearson(0.5 * arg_0)

The Squared-Hellinger Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  The Squared-Hellinger Csiszar-function is:

  ```none
  f(u) = (sqrt(u) - 1)**2
  ```

  This Csiszar-function induces a symmetric f-Divergence, i.e.,
  `D_f[p, q] = D_f[q, p]`.

  Warning: this function makes non-log-space calculations and may therefore be
  numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    squared_hellinger_of_u: `float`-like `Tensor` of the Csiszar-function
      evaluated at `u = exp(logu)`.

The Squared - Hellinger Csiszar - function in log - space .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : if arg_0 . Funcger : arg_0 . Funcger . log ( arg_1 , arg_2 , extra = { 'context' : arg_3 or { } } )

def Func(arg_0, arg_1, arg_2, arg_3=None):
        # type: (int, Text, Optional[dict]) -> None
        """
        Sends a message to the instance's logger, if configured.
        """
        if arg_0.Funcger:
            arg_0.Funcger.log(arg_1, arg_2, extra={'context': arg_3 or {}})

Sends a message to the instance s logger if configured .


(session,
                    query,
                    search_filter=None,
                    project_details=None,
                    user_details=None,
                    limit=10,
                    offset=0,
                    active_only=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = 10 , arg_6 = 0 , arg_7 = None ) : arg_8 = { 'query' : arg_1 , 'limit' : arg_5 , 'offset' : arg_6 , } if arg_2 : arg_8 . update ( arg_2 ) if arg_3 : arg_8 . update ( arg_3 ) if arg_4 : arg_8 . update ( arg_4 ) arg_9 = 'projects/{}' . format ( 'active' if arg_7 else 'all' ) arg_10 = make_get_request ( arg_0 , arg_9 , params_data = arg_8 ) arg_11 = arg_10 . json ( ) if arg_10 . status_code == 200 : return arg_11 [ 'result' ] else : raise ProjectsNotFoundException ( message = arg_11 [ 'message' ] , error_code = arg_11 [ 'error_code' ] , request_id = arg_11 [ 'request_id' ] )

def Func(arg_0,
                    arg_1,
                    arg_2=None,
                    arg_3=None,
                    arg_4=None,
                    arg_5=10,
                    arg_6=0,
                    arg_7=None):
    """
    Search for all projects
    """
    arg_8 = {
        'query': arg_1,
        'limit': arg_5,
        'offset': arg_6,
    }
    if arg_2:
        arg_8.update(arg_2)
    if arg_3:
        arg_8.update(arg_3)
    if arg_4:
        arg_8.update(arg_4)

    # GET /api/projects/0.1/projects/all/
    # GET /api/projects/0.1/projects/active/
    arg_9 = 'projects/{}'.format('active' if arg_7 else 'all')
    arg_10 = make_get_request(arg_0, arg_9, params_data=arg_8)
    arg_11 = arg_10.json()
    if arg_10.status_code == 200:
        return arg_11['result']
    else:
        raise ProjectsNotFoundException(
            message=arg_11['message'],
            error_code=arg_11['error_code'],
            request_id=arg_11['request_id'])


def
Func
(
arg_0
)
:
if
arg_0
.
source_dir
and
os
.
path
.
exists
(
os
.
path
.
join
(
arg_0
.
source_dir
,
PIP_DELETE_MARKER_FILENAME
)
)
:
logger
.
debug
(
'Removing source in %s'
,
arg_0
.
source_dir
)
rmtree
(
arg_0
.
source_dir
)
arg_0
.
source_dir
=
if
arg_0
.
_temp_build_dir
and
os
.
path
.
exists
(
arg_0
.
_temp_build_dir
)
:
rmtree
(
arg_0
.
_temp_build_dir
)
arg_0
.
_temp_build_dir
=

def Func(arg_0):
        """Remove the source files from this requirement, if they are marked
        for deletion"""
        if arg_0.source_dir and os.path.exists(
                os.path.join(arg_0.source_dir, PIP_DELETE_MARKER_FILENAME)):
            logger.debug('Removing source in %s', arg_0.source_dir)
            rmtree(arg_0.source_dir)
        arg_0.source_dir = None
        if arg_0._temp_build_dir and os.path.exists(arg_0._temp_build_dir):
            rmtree(arg_0._temp_build_dir)
        arg_0._temp_build_dir = None

Remove the source files from this requirement if they are marked for deletion


def Func(arg_0, arg_1=None):
    """Sets up a new project from a template

    Note that the `temple.constants.TEMPLE_ENV_VAR` is set to 'Func' during the duration
    of this function.

    Args:
        template (str): The git SSH path to a template
        version (str, optional): The version of the template to use when updating. Defaults
            to the latest version
    """
    temple.check.is_git_ssh_path(arg_0)
    temple.check.not_in_git_repo()

    arg_2 = temple.utils.get_repo_path(arg_0)
    arg_3 = (
        'You will be prompted for the parameters of your new project.'
        ' Please read the docs at https://github.com/{} before entering parameters.'
    ).format(arg_2)
    print(arg_3)

    arg_4, arg_5 = temple.utils.get_cookiecutter_config(arg_0, arg_1=arg_1)

    if not arg_1:
        with temple.utils.cd(arg_4):
            arg_6 = temple.utils.shell('git rev-parse HEAD', stdout=subprocess.PIPE)
            arg_1 = arg_6.stdout.decode('utf-8').strip()

    _generate_files(repo_dir=arg_4, arg_5=arg_5, arg_0=arg_0, arg_1=arg_1)

Sets up a new project from a template

    Note that the `temple.constants.TEMPLE_ENV_VAR` is set to 'setup' during the duration
    of this function.

    Args:
        template (str): The git SSH path to a template
        version (str, optional): The version of the template to use when updating. Defaults
            to the latest version


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : print >> io . stdout , arg_0 . InteractiveTB . stb2text ( arg_3 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Actually show a traceback.

        Subclasses may override this method to put the traceback on a different
        place, like a side channel.
        """
        print >> io.stdout, arg_0.InteractiveTB.stb2text(arg_3)


(port=0, service_name='unknown', ipv4=None, ipv6=None)

return zipkin_core.Endpoint(
        ipv4=ipv4_int,
        ipv6=ipv6_binary,
        port=port,
        service_name=service_name,
    )

def Func ( arg_0 = 0 , arg_1 = 'unknown' , arg_2 = None , arg_3 = None ) : arg_4 = 0 arg_5 = None if arg_2 : arg_4 = struct . unpack ( '!i' , socket . inet_pton ( socket . AF_INET , arg_2 ) ) [ 0 ] if arg_3 : arg_5 = socket . inet_pton ( socket . AF_INET6 , arg_3 ) arg_0 = struct . unpack ( 'h' , struct . pack ( 'H' , arg_0 ) ) [ 0 ] return zipkin_core . Endpoint ( arg_2 = arg_4 , arg_3 = arg_5 , arg_0 = arg_0 , arg_1 = arg_1 , )

def Func(arg_0=0, arg_1='unknown', arg_2=None, arg_3=None):
    """Create a zipkin Endpoint object.

    An Endpoint object holds information about the network context of a span.

    :param port: int value of the port. Defaults to 0
    :param service_name: service name as a str. Defaults to 'unknown'
    :param ipv4: ipv4 host address
    :param ipv6: ipv6 host address
    :returns: thrift Endpoint object
    """
    arg_4 = 0
    arg_5 = None

    # Convert ip address to network byte order
    if arg_2:
        arg_4 = struct.unpack('!i', socket.inet_pton(socket.AF_INET, arg_2))[0]

    if arg_3:
        arg_5 = socket.inet_pton(socket.AF_INET6, arg_3)

    # Zipkin passes unsigned values in signed types because Thrift has no
    # unsigned types, so we have to convert the value.
    arg_0 = struct.unpack('h', struct.pack('H', arg_0))[0]
    return zipkin_core.Endpoint(
        arg_2=arg_4,
        arg_3=arg_5,
        arg_0=arg_0,
        arg_1=arg_1,
    )


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_2 : arg_2 = { } arg_2 . update ( { 'admin' : arg_0 . admin , 'debug' : arg_0 . debug } ) arg_3 = arg_0 . _create_options_claims ( arg_2 ) arg_3 [ 'v' ] = arg_0 . TOKEN_VERSION arg_3 [ 'iat' ] = int ( time . mktime ( time . gmtime ( ) ) ) arg_3 [ 'd' ] = arg_1 return arg_0 . _encode_token ( arg_0 . secret , arg_3 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Generates a secure authentication token.

        Our token format follows the JSON Web Token (JWT) standard:
        header.claims.signature

        Where:
        1) 'header' is a stringified, base64-encoded JSON object containing version and algorithm information.
        2) 'claims' is a stringified, base64-encoded JSON object containing a set of claims:
            Library-generated claims:
            'iat' -> The issued at time in seconds since the epoch as a number
            'd' -> The arbitrary JSON object supplied by the user.
            User-supplied claims (these are all optional):
            'exp' (optional) -> The expiration time of this token, as a number of seconds since the epoch.
            'nbf' (optional) -> The 'not before' time before which the token should be rejected (seconds since the epoch)
            'admin' (optional) -> If set to true, this client will bypass all security rules (use this to authenticate servers)
            'debug' (optional) -> 'set to true to make this client receive debug information about security rule execution.
            'simulate' (optional, internal-only for now) -> Set to true to neuter all API operations (listens / puts
                       will run security rules but not actually write or return data).
        3) A signature that proves the validity of this token (see: http://tools.ietf.org/html/draft-ietf-jose-json-web-signature-07)

        For base64-encoding we use URL-safe base64 encoding. This ensures that the entire token is URL-safe
        and could, for instance, be placed as a query argument without any encoding (and this is what the JWT spec requires).

        Args:
            data - a json serializable object of data to be included in the token
            options - An optional dictionary of additional claims for the token. Possible keys include:
                a) 'expires' -- A timestamp (as a number of seconds since the epoch) denoting a time after which
                    this token should no longer be valid.
                b) 'notBefore' -- A timestamp (as a number of seconds since the epoch) denoting a time before
                    which this token should be rejected by the server.
                c) 'admin' -- Set to true to bypass all security rules (use this for your trusted servers).
                d) 'debug' -- Set to true to enable debug mode (so you can see the results of Rules API operations)
                e) 'simulate' -- (internal-only for now) Set to true to neuter all API operations (listens / puts
                                will run security rules but not actually write or return data)
        Returns:
            A signed Firebase Authentication Token
        Raises:
            ValueError: if an invalid key is specified in options
        """
        if not arg_2:
            arg_2 = {}
        arg_2.update({'admin': arg_0.admin, 'debug': arg_0.debug})
        arg_3 = arg_0._create_options_claims(arg_2)
        arg_3['v'] = arg_0.TOKEN_VERSION
        arg_3['iat'] = int(time.mktime(time.gmtime()))
        arg_3['d'] = arg_1
        return arg_0._encode_token(arg_0.secret, arg_3)

Generates a secure authentication token .


def Func ( arg_0 , arg_1 ) : if not arg_0 . _first : arg_0 . _first = arg_0 . _last = node = DLL . Node ( arg_1 ) elif arg_0 . _first . value == arg_1 : return else : try : arg_0 . delete ( arg_1 ) except KeyError : pass arg_0 . _first = node = arg_0 . _first . insert_before ( arg_1 ) arg_0 . _index [ arg_1 ] = node arg_0 . _size += 1

def Func(arg_0, arg_1):
        """Push k to the top of the list

        >>> l = DLL()
        >>> l.Func(1)
        >>> l
        [1]
        >>> l.Func(2)
        >>> l
        [2, 1]
        >>> l.Func(3)
        >>> l
        [3, 2, 1]
        """
        if not arg_0._first:
            # first item
            arg_0._first = arg_0._last = node = DLL.Node(arg_1)
        elif arg_0._first.value == arg_1:
            # it's already at the top
            return
        else:
            try:
                arg_0.delete(arg_1) # in case we have it already
            except KeyError:
                pass
            arg_0._first = node = arg_0._first.insert_before(arg_1)
        arg_0._index[arg_1] = node
        arg_0._size += 1


def Func(arg_0, arg_1, arg_2):
    """
    Add distribution to row row.
    Distribution should be an array of probabilities or counts.

    :param row:   Integer index of the row to add to.
                  May be larger than the current number of rows, in which case
                  the histogram grows.
    :param distribution: Array of length equal to the number of columns.
    """
    arg_0.grow(arg_1+1, len(arg_2))
    arg_0.hist_.axby(arg_1, 1, 1, arg_2)
    arg_0.rowSums_[arg_1] += arg_2.sum()
    arg_0.colSums_ += arg_2
    arg_0.hack_ = None

Add distribution to row row . Distribution should be an array of probabilities or counts .


def Func ( arg_0 ) : arg_0 . stream . seek ( arg_0 . start_pos + arg_0 . header . size ) return VLRList . read_from ( arg_0 . stream , num_to_read = arg_0 . header . number_of_vlr )

def Func(arg_0):
        """ Reads and return the vlrs of the file
        """
        arg_0.stream.seek(arg_0.start_pos + arg_0.header.size)
        return VLRList.read_from(arg_0.stream, num_to_read=arg_0.header.number_of_vlr)


def Func(arg_0, arg_1):
 """
 Remove a global hotkey.

 control - The control to affect
 key - The key to remove.
 """
 arg_2 = arg_6.get(arg_0, [])
 for arg_3 in arg_2:
  arg_4, arg_5 = arg_3
  if arg_4 == arg_1:
   arg_0.Unbind(wx.EVT_HOTKEY, arg_5 = arg_5)
   arg_0.UnregisterHotKey(arg_5)
   arg_2.remove(arg_3)
   if arg_2:
    arg_6[arg_0] = arg_2
   else:
    del arg_6[arg_0]

Remove a global hotkey . control - The control to affect key - The key to remove .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . preprocessors : arg_1 = arg_2 . Func ( arg_1 = arg_1 ) return arg_1

def Func(arg_0, arg_1):
        """
        Shape of preprocessed state given original shape.

        Args:
            shape: original state shape

        Returns: processed state shape
        """
        for arg_2 in arg_0.preprocessors:
            arg_1 = arg_2.Func(arg_1=arg_1)
        return arg_1

Shape of preprocessed state given original shape .


def Func ( arg_0 , arg_1 = '' , arg_2 = arg_3 ( arg_4 . date . today ( ) ) ) : arg_6 = os . path . isfile ( arg_1 ) if arg_6 : with open ( arg_1 , 'rb' ) as inp , open ( 'temp.csv' , 'wb' ) as out : arg_7 = csv . writer ( out ) for arg_8 in csv . reader ( inp ) : if arg_8 [ 0 ] != arg_2 : arg_7 . writerow ( arg_8 ) inp . close ( ) out . close ( ) os . remove ( arg_1 ) os . rename ( "temp.csv" , arg_1 )

def Func(arg_0, arg_1='', arg_2=arg_3(arg_4.date.today())):
        """
        Removes all rows of the associated date from the given csv file.
        Defaults to today.
        """
        arg_6 = os.path.isfile(arg_1)
        if arg_6:
            with open(arg_1, 'rb') as inp, open('temp.csv', 'wb') as out:
                arg_7 = csv.writer(out)
                for arg_8 in csv.reader(inp):
                    if arg_8[0] != arg_2:
                        arg_7.writerow(arg_8)
            inp.close()
            out.close()
            os.remove(arg_1)
            os.rename("temp.csv",arg_1)

Removes all rows of the associated date from the given csv file . Defaults to today .


(s: sym.Symbol, ns: Optional[Namespace] = None)

def Func ( arg_0 : arg_1 . Symbol , arg_3 : arg_4 [ arg_5 ] = None ) -> arg_4 [ Var ] : return Var . find ( resolve_alias ( arg_0 , arg_3 ) )

def Func(arg_0: arg_1.Symbol, arg_3: arg_4[arg_5] = None) -> arg_4[Var]:
    """Resolve the aliased symbol to a Var from the specified
    namespace, or the current namespace if none is specified."""
    return Var.find(resolve_alias(arg_0, arg_3))

Resolve the aliased symbol to a Var from the specified namespace or the current namespace if none is specified .


def
Func
(
arg_0
,
arg_1
=
'roles/all/ssl'
)
:
arg_2
=
0
arg_3
=
0
arg_4
=
[
]
for
arg_5
in
os
.
listdir
(
arg_1
)
:
arg_6
=
os
.
path
.
join
(
arg_1
,
arg_5
)
if
not
os
.
path
.
isfile
(
arg_6
)
:
continue
if
not
arg_5
.
endswith
(
'.crt'
)
:
continue
arg_7
=
arg_0
.
get_expiration_date
(
arg_6
)
arg_2
=
max
(
arg_2
,
len
(
arg_5
)
)
arg_3
=
max
(
arg_3
,
len
(
str
(
arg_7
)
)
)
arg_4
.
append
(
(
arg_5
,
arg_7
)
)
print
(
'%s %s %s'
%
(
'Filename'
.
ljust
(
arg_2
)
,
'Expiration Date'
.
ljust
(
arg_3
)
,
'Expired'
)
)
arg_8
=
datetime
.
now
(
)
.
replace
(
tzinfo
=
pytz
.
UTC
)
for
arg_5
,
arg_9
in
sorted
(
arg_4
)
:
if
arg_9
is
:
arg_10
=
'?'
elif
arg_9
<
arg_8
:
arg_10
=
'YES'
else
:
arg_10
=
'NO'
print
(
'%s %s %s'
%
(
arg_5
.
ljust
(
arg_2
)
,
str
(
arg_9
)
.
ljust
(
arg_3
)
,
arg_10
)
)

def Func(arg_0, arg_1='roles/all/ssl'):
        """
        Scans through all local .crt files and displays the expiration dates.
        """
        arg_2 = 0
        arg_3 = 0
        arg_4 = []
        for arg_5 in os.listdir(arg_1):
            arg_6 = os.path.join(arg_1, arg_5)
            if not os.path.isfile(arg_6):
                continue
            if not arg_5.endswith('.crt'):
                continue
            arg_7 = arg_0.get_expiration_date(arg_6)
            arg_2 = max(arg_2, len(arg_5))
            arg_3 = max(arg_3, len(str(arg_7)))
            arg_4.append((arg_5, arg_7))
        print('%s %s %s' % ('Filename'.ljust(arg_2), 'Expiration Date'.ljust(arg_3), 'Expired'))
        arg_8 = datetime.now().replace(tzinfo=pytz.UTC)
        for arg_5, arg_9 in sorted(arg_4):

            if arg_9 is None:
                arg_10 = '?'
            elif arg_9 < arg_8:
                arg_10 = 'YES'
            else:
                arg_10 = 'NO'
            print('%s %s %s' % (arg_5.ljust(arg_2), str(arg_9).ljust(arg_3), arg_10))

Scans through all local . crt files and displays the expiration dates .


return mir_eval.display.events(times, labels=labels, **kwargs)

def Func ( arg_0 , ** arg_1 ) : arg_2 , arg_3 = arg_0 . to_interval_values ( ) if any ( arg_3 ) : arg_4 = arg_3 else : arg_4 = None return mir_eval . display . Funcs ( arg_2 , arg_4 = arg_4 , ** arg_1 )

def Func(arg_0, **arg_1):
    '''Plotting wrapper for Funcs'''

    arg_2, arg_3 = arg_0.to_interval_values()

    if any(arg_3):
        arg_4 = arg_3
    else:
        arg_4 = None

    return mir_eval.display.Funcs(arg_2, arg_4=arg_4, **arg_1)


def Func(arg_0, arg_1, arg_2=2):
    """
    Efficient way to compute highly repetitive scoring
    i.e. sequences are involved multiple time

    Args:
        sequences(list[str]): list of sequences (either hyp or ref)
        scores_ids(list[tuple(int)]): list of pairs (hyp_id, ref_id)
            ie. scores[i] = rouge_n(scores_ids[i][0],
                                    scores_ids[i][1])

    Returns:
        scores: list of length `len(scores_ids)` containing rouge `n`
                scores as a dict with 'f', 'r', 'p'
    Raises:
        KeyError: if there's a value of i in scores_ids that is not in
                  [0, len(sequences)[
    """
    arg_3 = [_get_word_ngrams(arg_2, sequence) for sequence in arg_0]
    arg_4 = [len(ngram) for ngram in arg_3]

    arg_5 = []
    for arg_6, arg_7 in arg_1:
        arg_8 = arg_3[arg_6]
        arg_9 = arg_4[arg_6]

        arg_10 = arg_3[arg_7]
        arg_11 = arg_4[arg_7]

        arg_12 = arg_8.intersection(arg_10)
        arg_13 = len(arg_12)

        arg_5 += [f_r_p_rouge_n(arg_9,
                                 arg_11, arg_13)]
    return arg_5

Efficient way to compute highly repetitive scoring i . e . sequences are involved multiple time


def Func(arg_0, arg_1):
        """Load checkpoints from the checkpoint files into a dictionary.

        The results are used to pre-populate the memoizer's lookup_table

        Kwargs:
             - checkpointDirs (list) : List of run folder to use as checkpoints
               Eg. ['runinfo/001', 'runinfo/002']

        Returns:
             - dict containing, hashed -> future mappings
        """
        arg_0.memo_lookup_table = None

        if not arg_1:
            return {}

        if type(arg_1) is not list:
            raise BadCheckpoint("checkpointDirs expects a list of checkpoints")

        return arg_0._Func(arg_1)

Load checkpoints from the checkpoint files into a dictionary .


def
Func
(
arg_0
)
:
arg_1
=
os
.
path
.
abspath
(
os
.
path
.
expanduser
(
str
(
arg_0
)
)
)
echo
.
h2
(
"Available scripts in {}"
.
format
(
arg_1
)
)
echo
.
br
(
)
for
arg_2
,
arg_3
,
arg_4
in
os
.
walk
(
arg_1
,
topdown
=
True
)
:
for
arg_5
in
fnmatch
.
filter
(
arg_4
,
'*.py'
)
:
try
:
arg_6
=
os
.
path
.
join
(
arg_2
,
arg_5
)
with
open
(
arg_6
,
encoding
=
"UTF-8"
)
as
fp
:
arg_7
=
fp
.
read
(
)
arg_8
=
"InteractiveConsole"
in
arg_7
arg_8
=
arg_8
or
"code"
in
arg_7
arg_8
=
arg_8
and
"interact("
in
arg_7
if
arg_8
:
continue
arg_9
=
captain
.
Script
(
arg_6
)
if
arg_9
.
can_run_from_cli
(
)
:
arg_10
=
arg_9
.
call_path
(
arg_1
)
arg_11
=
arg_9
.
parser
echo
.
h3
(
arg_10
)
arg_12
=
arg_11
.
description
if
arg_12
:
echo
.
indent
(
arg_12
,
indent
=
(
" "
*
4
)
)
arg_13
=
arg_9
.
subcommands
if
arg_13
:
echo
.
br
(
)
echo
.
indent
(
"Subcommands:"
,
indent
=
(
" "
*
4
)
)
for
arg_14
in
arg_13
.
keys
(
)
:
echo
.
indent
(
arg_14
,
indent
=
(
" "
*
6
)
)
echo
.
br
(
)
except
captain
.
ParseError
:
pass
except
Exception
as
e
:
echo
.
err
(
"Failed to parse {}"
,
arg_5
)
echo
.
verbose
(
e
.
message
)
echo
.
br
(
)

def Func(arg_0):
    '''scan path directory and any subdirectories for valid captain scripts'''
    arg_1 = os.path.abspath(os.path.expanduser(str(arg_0)))

    echo.h2("Available scripts in {}".format(arg_1))
    echo.br()
    for arg_2, arg_3, arg_4 in os.walk(arg_1, topdown=True):
        for arg_5 in fnmatch.filter(arg_4, '*.py'):
            try:
                arg_6 = os.path.join(arg_2, arg_5)

                # super edge case, this makes sure the python script won't start
                # an interactive console session which would cause the session
                # to start and not allow the for loop to complete
                with open(arg_6, encoding="UTF-8") as fp:
                    arg_7 = fp.read()
                    arg_8 = "InteractiveConsole" in arg_7
                    arg_8 = arg_8 or "code" in arg_7
                    arg_8 = arg_8 and "interact(" in arg_7
                    if arg_8:
                        continue

                arg_9 = captain.Script(arg_6)
                if arg_9.can_run_from_cli():
                    arg_10 = arg_9.call_path(arg_1)
                    arg_11 = arg_9.parser

                    echo.h3(arg_10)

                    arg_12 = arg_11.description
                    if arg_12:
                        echo.indent(arg_12, indent=(" " * 4))

                    arg_13 = arg_9.subcommands
                    if arg_13:
                        echo.br()
                        echo.indent("Subcommands:", indent=(" " * 4))
                        for arg_14 in arg_13.keys():
                            echo.indent(arg_14, indent=(" " * 6))

                    echo.br()

            except captain.ParseError:
                pass

            except Exception as e:
                #echo.exception(e)
                #echo.err("Failed to parse {} because {}", f, e.message)
                echo.err("Failed to parse {}", arg_5)
                echo.verbose(e.message)
                echo.br()


def Func(arg_0):
        """ Checks for alternative index-url in pip.conf """

        if 'VIRTUAL_ENV' in os.environ:
            arg_0.pip_config_locations.append(os.path.join(os.environ['VIRTUAL_ENV'], 'pip.conf'))
            arg_0.pip_config_locations.append(os.path.join(os.environ['VIRTUAL_ENV'], 'pip.ini'))

        if site_config_files:
            arg_0.pip_config_locations.extend(site_config_files)

        arg_1 = None
        arg_2 = None

        if 'PIP_INDEX_URL' in os.environ and os.environ['PIP_INDEX_URL']:
            # environ variable takes priority
            arg_1 = os.environ['PIP_INDEX_URL']
            arg_2 = 'PIP_INDEX_URL environment variable'
        else:
            for arg_3 in arg_0.pip_config_locations:
                if arg_3.startswith('~'):
                    arg_3 = os.path.expanduser(arg_3)

                if os.path.isfile(arg_3):
                    arg_4 = ConfigParser()
                    arg_4.read([arg_3])
                    try:
                        arg_1 = arg_4.get('global', 'index-url')
                        arg_2 = arg_3
                        break  # stop on first detected, because config locations have a priority
                    except (NoOptionError, NoSectionError):  # pragma: nocover
                        pass

        if arg_1:
            arg_0.PYPI_API_URL = arg_0._prepare_api_url(arg_1)
            print(Color('Setting API url to {{autoyellow}}{}{{/autoyellow}} as found in {{autoyellow}}{}{{/autoyellow}}'
                        '. Use --default-index-url to use pypi default index'.format(arg_0.PYPI_API_URL, arg_2)))

Checks for alternative index - url in pip . conf


def Func ( arg_0 , arg_1 ) : if arg_0 is None : import matplotlib . pyplot as plt plt . sci ( arg_1 )

def Func(arg_0, arg_1):
    '''Helper to set the current image in pyplot mode.

    If the provided `ax` is not `None`, then we assume that the user is using the object API.
    In this case, the pyplot current image is not set.
    '''

    if arg_0 is None:
        import matplotlib.pyplot as plt
        plt.sci(arg_1)

Helper to set the current image in pyplot mode .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_2 [ 'timestamp' ] = calendar . timegm ( time . gmtime ( ) ) return arg_2

def Func(arg_0, arg_1, arg_2):
    ''' Attach the event time, as unix epoch '''
    arg_2['timestamp'] = calendar.timegm(time.gmtime())
    return arg_2


def Func(arg_0, arg_1):
        """Parses ssh-rsa public keys."""
        arg_2, arg_3 = arg_0._unpack_by_int(arg_1, 0)
        arg_2, arg_4 = arg_0._unpack_by_int(arg_1, arg_2)

        arg_5 = arg_0._parse_long(arg_3)
        arg_6 = arg_0._parse_long(arg_4)

        arg_0.rsa = RSAPublicNumbers(arg_5, arg_6).public_key(default_backend())
        arg_0.bits = arg_0.rsa.key_size

        if arg_0.strict_mode:
            arg_9 = arg_0.RSA_MIN_LENGTH_STRICT
            arg_10 = arg_0.RSA_MAX_LENGTH_STRICT
        else:
            arg_9 = arg_0.RSA_MIN_LENGTH_LOOSE
            arg_10 = arg_0.RSA_MAX_LENGTH_LOOSE
        if arg_0.bits < arg_9:
            raise TooShortKeyError(
                "%s key data can not be shorter than %s bits (was %s)" % (arg_0.key_type, arg_9, arg_0.bits)
            )
        if arg_0.bits > arg_10:
            raise TooLongKeyError(
                "%s key data can not be longer than %s bits (was %s)" % (arg_0.key_type, arg_10, arg_0.bits)
            )
        return arg_2


def Func(arg_0, arg_1=None, arg_2=None, arg_3=3):
        """Decorator that invokes `add_Func`.

        ::

            @app.Func
            def postgresql():
                # query/ping postgres

            @app.Func(name="Active Directory")
            def active_directory():
                # query active directory

            @app.Func(timeout=5)
            def paypal():
                # query paypal, timeout after 5 seconds

        """
        if arg_1 is None:
            def decorator(arg_1):
                arg_0.add_Func(arg_1, arg_2, arg_3)
            return decorator
        else:
            arg_0.add_Func(arg_1, arg_2, arg_3)

Decorator that invokes `add_status_job`.

        ::

            @app.status_job
            def postgresql():
                # query/ping postgres

            @app.status_job(name="Active Directory")
            def active_directory():
                # query active directory

            @app.status_job(timeout=5)
            def paypal():
                # query paypal, timeout after 5 seconds


def Func ( arg_0 ) : arg_1 = getLoggerClass ( ) class DebugLogger ( arg_1 ) : def getEffectiveLevel ( arg_2 ) : if arg_2 . level == 0 and arg_0 . debug : return DEBUG return arg_1 . getEffectiveLevel ( arg_2 ) class DebugHandler ( StreamHandler ) : def emit ( arg_2 , arg_3 ) : StreamHandler . emit ( arg_2 , arg_3 ) if arg_0 . debug else None arg_4 = DebugHandler ( ) arg_4 . setLevel ( DEBUG ) arg_4 . setFormatter ( Formatter ( arg_0 . debug_log_format ) ) arg_5 = getLogger ( arg_0 . logger_name ) del arg_5 . handlers [ : ] arg_5 . __class__ = DebugLogger arg_5 . addHandler ( arg_4 ) return arg_5

def Func(arg_0):
    """Creates a logger for the given application.  This logger works
    similar to a regular Python logger but changes the effective logging
    level based on the application's debug flag.  Furthermore this
    function also removes all attached handlers in case there was a
    logger with the log name before.
    """
    arg_1 = getLoggerClass()

    class DebugLogger(arg_1):
        def getEffectiveLevel(arg_2):
            if arg_2.level == 0 and arg_0.debug:
                return DEBUG
            return arg_1.getEffectiveLevel(arg_2)

    class DebugHandler(StreamHandler):
        def emit(arg_2, arg_3):
            StreamHandler.emit(arg_2, arg_3) if arg_0.debug else None

    arg_4 = DebugHandler()
    arg_4.setLevel(DEBUG)
    arg_4.setFormatter(Formatter(arg_0.debug_log_format))
    arg_5 = getLogger(arg_0.logger_name)
    # just in case that was not a new logger, get rid of all the handlers
    # already attached to it.
    del arg_5.handlers[:]
    arg_5.__class__ = DebugLogger
    arg_5.addHandler(arg_4)
    return arg_5

Creates a logger for the given application . This logger works similar to a regular Python logger but changes the effective logging level based on the application s debug flag . Furthermore this function also removes all attached handlers in case there was a logger with the log name before .


return (precision - recall) / (math.log(precision) - math.log(recall))

def Func ( arg_0 ) : arg_1 = arg_0 . precision ( ) arg_2 = arg_0 . recall ( ) if not arg_1 or not arg_2 : return 0.0 elif arg_1 == arg_2 : return arg_1 return ( arg_1 - arg_2 ) / ( math . log ( arg_1 ) - math . log ( arg_2 ) )

def Func(arg_0):
        r"""Return logarithmic mean of precision & recall.

        The logarithmic mean is:
        0 if either precision or recall is 0,
        the precision if they are equal,
        otherwise :math:`\frac{precision - recall}
        {ln(precision) - ln(recall)}`

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

        Returns
        -------
        float
            The logarithmic mean of the confusion table's precision & recall

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        0.8282429171492667

        """
        arg_1 = arg_0.precision()
        arg_2 = arg_0.recall()
        if not arg_1 or not arg_2:
            return 0.0
        elif arg_1 == arg_2:
            return arg_1
        return (arg_1 - arg_2) / (math.log(arg_1) - math.log(arg_2))

r"""Return logarithmic mean of precision & recall.

        The logarithmic mean is:
        0 if either precision or recall is 0,
        the precision if they are equal,
        otherwise :math:`\frac{precision - recall}
        {ln(precision) - ln(recall)}`

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

        Returns
        -------
        float
            The logarithmic mean of the confusion table's precision & recall

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.pr_lmean()
        0.8282429171492667

r Return logarithmic mean of precision & recall .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . columns [ arg_1 ] . name arg_3 = [ ] for arg_4 in arg_0 . data : arg_5 , arg_6 = arg_4 arg_3 . append ( ( arg_6 . get ( arg_2 , None ) , arg_4 ) ) arg_3 . sort ( ) arg_0 . data = [ ] for arg_8 , arg_4 in arg_3 : arg_0 . data . append ( arg_4 )

def Func(arg_0, arg_1):
        "col -> sort the data based on the column indexed by col"
        arg_2 = arg_0.columns[arg_1].name
        arg_3 = []

        for arg_4 in arg_0.data:
            arg_5, arg_6 = arg_4
            arg_3.append((arg_6.get(arg_2, None), arg_4))

        arg_3.sort()
        arg_0.data = []

        for arg_8, arg_4 in arg_3:
            arg_0.data.append(arg_4)

col - > sort the data based on the column indexed by col


(self, direct_value, config_section,
                        config_option_name, default_value)

def Func(arg_0, arg_1, arg_2,
                        arg_3, arg_4):
        """Returns a value that can be used as a parameter in client or
        server. If a direct_value is given, that value will be returned
        instead of the value from the config file. If the appropriate config
        file option is not found, the default_value is returned.

        :param direct_value: represents a direct value that should be used.
                             supercedes values from config files
        :param config_section: which section of the config file to use
        :param config_option_name: name of config option value
        :param default_value: default value to be used if other options not
                              found
        :returns: a value that can be used as a parameter
        """
        arg_5 = "Using given value '{0}' for {1}"
        arg_6 = "Using value '{0}' from configuration file {1} for {2}"
        arg_7 = "Using default value '{0}' for {1}"
        if arg_1:
            arg_8 = arg_1
            arg_0.logger.debug(arg_5.format(arg_1, arg_3))
        else:
            try:
                arg_8 = arg_0.conf.get(arg_2,
                                             arg_3)
                arg_0.logger.debug(arg_6.format(arg_8,
                                                  CONFIG_FILE,
                                                  arg_3))
            except Exception:
                arg_8 = arg_4
                arg_0.logger.debug(arg_7.format(arg_4,
                                                     arg_3))
        # TODO (peter-hamilton): Think about adding better value validation
        if arg_8 == arg_0.NONE_VALUE:
            return None
        else:
            return arg_8

Returns a value that can be used as a parameter in client or server . If a direct_value is given that value will be returned instead of the value from the config file . If the appropriate config file option is not found the default_value is returned .


def
Func
(
arg_0
)
:
if
arg_0
.
method
==
"POST"
:
try
:
arg_1
=
YoutubeDirectUploadForm
(
arg_0
.
POST
,
arg_0
.
FILES
)
if
arg_1
.
is_valid
(
)
:
arg_2
=
arg_1
.
save
(
)
arg_3
=
Api
(
)
arg_3
.
authenticate
(
)
arg_4
=
arg_3
.
upload_direct
(
arg_2
.
file_on_server
.
path
,
"Uploaded video from zuqqa"
)
arg_5
=
arg_4
.
GetSwfUrl
(
)
arg_6
=
arg_4
.
id
.
text
arg_7
=
arg_6
.
split
(
"/"
)
arg_7
.
reverse
(
)
arg_8
=
arg_7
[
0
]
arg_9
=
Video
(
)
arg_9
.
user
=
arg_0
.
user
arg_9
.
video_id
=
arg_8
arg_9
.
title
=
'tmp video'
arg_9
.
youtube_url
=
arg_6
arg_9
.
swf_url
=
arg_5
arg_9
.
save
(
)
video_created
.
send
(
sender
=
arg_9
,
arg_9
=
arg_9
)
arg_2
.
delete
(
)
arg_12
=
arg_0
.
GET
.
get
(
'only_data'
)
if
arg_12
:
return
HttpResponse
(
json
.
dumps
(
{
"video_id"
:
arg_8
}
)
,
content_type
=
"application/json"
)
else
:
try
:
arg_13
=
settings
.
YOUTUBE_UPLOAD_REDIRECT_URL
except
AttributeError
:
arg_13
=
reverse
(
"django_youtube.views.video"
,
kwargs
=
{
"video_id"
:
arg_8
}
)
return
HttpResponseRedirect
(
arg_13
)
except
:
import
sys
logger
.
error
(
"Unexpected error: %s - %s"
%
(
sys
.
exc_info
(
)
[
0
]
,
sys
.
exc_info
(
)
[
1
]
)
)
return
HttpResponse
(
"error happened"
)
arg_1
=
YoutubeDirectUploadForm
(
)
if
arg_12
:
return
HttpResponse
(
json
.
dumps
(
{
"error"
:
500
}
)
,
content_type
=
"application/json"
)
else
:
return
render_to_response
(
"django_youtube/direct-upload.html"
,
{
"form"
:
arg_1
}
,
context_instance
=
RequestContext
(
arg_0
)
)

def Func(arg_0):
    """
    direct upload method
    starts with uploading video to our server
    then sends the video file to youtube

    param:
        (optional) `only_data`: if set, a json response is returns i.e. {'video_id':'124weg'}

    return:
        if `only_data` set, a json object.
        otherwise redirects to the video display page
    """
    if arg_0.method == "POST":
        try:
            arg_1 = YoutubeDirectUploadForm(arg_0.POST, arg_0.FILES)
            # upload the file to our server
            if arg_1.is_valid():
                arg_2 = arg_1.save()

                # send this file to youtube
                arg_3 = Api()
                arg_3.authenticate()
                arg_4 = arg_3.upload_direct(arg_2.file_on_server.path, "Uploaded video from zuqqa")

                # get data from video entry
                arg_5 = arg_4.GetSwfUrl()
                arg_6 = arg_4.id.text

                # getting video_id is tricky, I can only reach the url which
                # contains the video_id.
                # so the only option is to parse the id element
                # https://groups.google.com/forum/?fromgroups=#!topic/youtube-api-gdata/RRl_h4zuKDQ
                arg_7 = arg_6.split("/")
                arg_7.reverse()
                arg_8 = arg_7[0]

                # save video_id to video instance
                arg_9 = Video()
                arg_9.user = arg_0.user
                arg_9.video_id = arg_8
                arg_9.title = 'tmp video'
                arg_9.youtube_url = arg_6
                arg_9.swf_url = arg_5
                arg_9.save()

                # send a signal
                video_created.send(sender=arg_9, arg_9=arg_9)

                # delete the uploaded video instance
                arg_2.delete()

                # return the response
                arg_12 = arg_0.GET.get('only_data')
                if arg_12:
                    return HttpResponse(json.dumps({"video_id": arg_8}), content_type="application/json")
                else:
                    # Redirect to the video page or the specified page
                    try:
                        arg_13 = settings.YOUTUBE_UPLOAD_REDIRECT_URL
                    except AttributeError:
                        arg_13 = reverse(
                            "django_youtube.views.video", kwargs={"video_id": arg_8})

                    return HttpResponseRedirect(arg_13)
        except:
            import sys
            logger.error("Unexpected error: %s - %s" % (sys.exc_info()[
                0], sys.exc_info()[1]))
            # @todo: proper error management
            return HttpResponse("error happened")

    arg_1 = YoutubeDirectUploadForm()

    if arg_12:
        return HttpResponse(json.dumps({"error": 500}), content_type="application/json")
    else:
        return render_to_response(
            "django_youtube/direct-upload.html",
            {"form": arg_1},
            context_instance=RequestContext(arg_0)
        )


def
Func
(
arg_0
)
:
if
arg_0
.
ping_timer
:
arg_0
.
ping_timer
.
cancel
(
)
if
arg_0
.
connection_timer
:
arg_0
.
connection_timer
.
cancel
(
)
if
arg_0
.
pong_timer
:
arg_0
.
pong_timer
.
cancel
(
)
arg_0
.
log
.
debug
(
"Func(): Timers stopped."
)

def Func(arg_0):
        """Stops ping, pong and connection timers.

        :return:
        """
        if arg_0.ping_timer:
            arg_0.ping_timer.cancel()

        if arg_0.connection_timer:
            arg_0.connection_timer.cancel()

        if arg_0.pong_timer:
            arg_0.pong_timer.cancel()
        arg_0.log.debug("Func(): Timers stopped.")


def Func ( arg_0 , arg_1 ) : if 'task_id' in arg_1 . internal_data : arg_2 = arg_1 . _get_internal_data ( 'task_history' , [ ] ) arg_2 . append ( arg_1 . _get_internal_data ( 'task_id' ) ) del arg_1 . internal_data [ 'task_id' ] arg_1 . _set_internal_data ( task_history = arg_2 ) if 'task_state' in arg_1 . internal_data : del arg_1 . internal_data [ 'task_state' ] if 'error' in arg_1 . internal_data : del arg_1 . internal_data [ 'error' ] if hasattr ( arg_1 , 'async_call' ) : delattr ( arg_1 , 'async_call' ) if hasattr ( arg_1 , 'deserialized' ) : delattr ( arg_1 , 'deserialized' )

def Func(arg_0, arg_1):
        """ Clear celery task data """
        # Save history
        if 'task_id' in arg_1.internal_data:
            # Save history for diagnostics/forensics
            arg_2 = arg_1._get_internal_data('task_history', [])
            arg_2.append(arg_1._get_internal_data('task_id'))
            del arg_1.internal_data['task_id']
            arg_1._set_internal_data(task_history=arg_2)
        if 'task_state' in arg_1.internal_data:
            del arg_1.internal_data['task_state']
        if 'error' in arg_1.internal_data:
            del arg_1.internal_data['error']
        if hasattr(arg_1, 'async_call'):
            delattr(arg_1, 'async_call')
        if hasattr(arg_1, 'deserialized'):
            delattr(arg_1, 'deserialized')


def Func ( arg_0 , * arg_1 ) : arg_2 = arg_0 . to_dict ( ) arg_2 [ 'data' ] = repr ( arg_2 [ 'data' ] ) arg_3 = { 'job' : arg_2 } arg_4 = { 'framework' : 'rq' } rollbar . report_exc_info ( arg_1 , arg_3 = arg_3 , arg_4 = arg_4 ) return True

def Func(arg_0, *arg_1):
    """
    Called by RQ when there is a failure in a worker.

    NOTE: Make sure that in your RQ worker process, rollbar.init() has been called with
    handler='blocking'. The default handler, 'thread', does not work from inside an RQ worker.
    """
    # Report data about the job with the exception.
    arg_2 = arg_0.to_dict()
    # job_info['data'] is the pickled representation of the job, and doesn't json-serialize well.
    # repr() works nicely.
    arg_2['data'] = repr(arg_2['data'])

    arg_3 = {'job': arg_2}
    arg_4 = {'framework': 'rq'}

    rollbar.report_exc_info(arg_1, arg_3=arg_3, arg_4=arg_4)

    # continue to the next handler
    return True

Called by RQ when there is a failure in a worker .


def Func(arg_0):
    """Delete experiment.

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

    Example:

    \b
    ```bash
    $ polyaxon experiment Func
    ```
    """
    arg_1, arg_2, arg_3 = get_project_experiment_or_local(arg_0.obj.get('project'),
                                                                      arg_0.obj.get('experiment'))
    if not click.confirm("Are sure you want to Func experiment `{}`".format(arg_3)):
        click.echo('Existing without deleting experiment.')
        sys.exit(1)

    try:
        arg_4 = PolyaxonClient().experiment.Func_experiment(
            arg_1, arg_2, arg_3)
        # Purge caching
        ExperimentManager.purge()
    except (PolyaxonHTTPError, PolyaxonShouldExitError, PolyaxonClientException) as e:
        Printer.print_error('Could not Func experiment `{}`.'.format(arg_3))
        Printer.print_error('Error message `{}`.'.format(e))
        sys.exit(1)

    if arg_4.status_code == 204:
        Printer.print_success("Experiment `{}` was Func successfully".format(arg_3))

Delete experiment.

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

    Example:

    \b
    ```bash
    $ polyaxon experiment delete
    ```


def Func(arg_0):
    """Decorator that stores function results in a dictionary to be used on the
    next time that the same arguments were informed."""

    arg_0._cache_dict = {}

    @wraps(arg_0)
    def _inner(*arg_2, **arg_3):
        return _get_Funcd_value(arg_0, arg_2, arg_3)

    return _inner

Decorator that stores function results in a dictionary to be used on the next time that the same arguments were informed .


def Func ( arg_0 , arg_1 = 0o777 ) : try : os . makedirs ( arg_0 , arg_1 ) except OSError as err : if err . errno != errno . EEXIST or not os . path . isdir ( arg_0 ) : raise

def Func(arg_0, arg_1=0o777):
    """The missing mkdir -p functionality in os."""
    try:
        os.makedirs(arg_0, arg_1)
    except OSError as err:
        # Reraise the error unless it's about an already existing directory
        if err.errno != errno.EEXIST or not os.path.isdir(arg_0):
            raise

The missing mkdir - p functionality in os .


(connection, echo=False, autoflush=None, autocommit=None, expire_on_commit=None,
                         scopefunc=None)

def Func(arg_0, arg_1=False, arg_2=None, arg_3=None, arg_4=None,
                         arg_5=None):
    """Build an engine and a session.

    :param str connection: An RFC-1738 database connection string
    :param bool echo: Turn on echoing SQL
    :param Optional[bool] autoflush: Defaults to True if not specified in kwargs or configuration.
    :param Optional[bool] autocommit: Defaults to False if not specified in kwargs or configuration.
    :param Optional[bool] expire_on_commit: Defaults to False if not specified in kwargs or configuration.
    :param scopefunc: Scoped function to pass to :func:`sqlalchemy.orm.scoped_session`
    :rtype: tuple[Engine,Session]

    From the Flask-SQLAlchemy documentation:

    An extra key ``'scopefunc'`` can be set on the ``options`` dict to
    specify a custom scope function.  If it's not provided, Flask's app
    context stack identity is used. This will ensure that sessions are
    created and removed with the request/response cycle, and should be fine
    in most cases.
    """
    if arg_0 is None:
        raise ValueError('can not build engine when connection is None')

    arg_6 = create_engine(arg_0, arg_1=arg_1)

    arg_2 = arg_2 if arg_2 is not None else False
    arg_3 = arg_3 if arg_3 is not None else False
    arg_4 = arg_4 if arg_4 is not None else True

    log.debug('auto flush: %s, auto commit: %s, expire on commmit: %s', arg_2, arg_3, arg_4)

    #: A SQLAlchemy session maker
    arg_7 = sessionmaker(
        bind=arg_6,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
    )

    #: A SQLAlchemy session object
    arg_8 = scoped_session(
        arg_7,
        arg_5=arg_5
    )

    return arg_6, arg_8


return output + list(reversed(operators))

def Func ( arg_0 , * , arg_1 = None ) : arg_2 = [ ] arg_3 = [ ] for arg_4 in arg_0 : if isinstance ( arg_4 , OperatorNode ) : arg_5 = arg_4 . operator while arg_3 : arg_6 = arg_3 [ - 1 ] . operator if arg_6 . precedence > arg_5 . precedence or arg_6 . precedence == arg_5 . precedence and arg_6 . association == Association . left : arg_2 . append ( arg_3 . pop ( ) ) else : break arg_3 . append ( arg_4 ) else : if arg_1 is not None and arg_4 . node_type in arg_1 : arg_2 . extend ( Func ( arg_4 . children , arg_1 = arg_1 ) ) else : arg_2 . append ( arg_4 ) return arg_2 + list ( reversed ( arg_3 ) )

def Func(arg_0, *, arg_1=None):
  """Convert a list of nodes in infix order to a list of nodes in postfix order.

  E.G. with normal algebraic precedence, 3 + 4 * 5 -> 3 4 5 * +
  """
  arg_2 = []
  arg_3 = []

  for arg_4 in arg_0:
    if isinstance(arg_4, OperatorNode):
      # Drain out all operators whose precedence is gte the node's...
      arg_5 = arg_4.operator
      while arg_3:
        arg_6 = arg_3[-1].operator
        if arg_6.precedence > arg_5.precedence or \
           arg_6.precedence == arg_5.precedence and arg_6.association == Association.left:
          arg_2.append(arg_3.pop())
        else:
          break
      arg_3.append(arg_4)
    else:
      if arg_1 is not None and arg_4.node_type in arg_1:
        arg_2.extend(Func(arg_4.children, arg_1=arg_1))
      else:
        arg_2.append(arg_4)

  return arg_2 + list(reversed(arg_3))

Convert a list of nodes in infix order to a list of nodes in postfix order .


def Func(arg_0, arg_1, arg_2=True):
        """
        Yields self's data in chunks of frame_duration_ms.

        This function adapted from pywebrtc's example [https://github.com/wiseman/py-webrtcvad/blob/master/example.py].

        :param frame_duration_ms: The length of each frame in ms.
        :param zero_pad: Whether or not to zero pad the end of the AudioSegment object to get all
                         the audio data out as frames. If not, there may be a part at the end
                         of the Segment that is cut off (the part will be <= `frame_duration_ms` in length).
        :returns: A Frame object with properties 'bytes (the data)', 'timestamp (start time)', and 'duration'.
        """
        arg_3 = collections.namedtuple("Frame", "bytes timestamp duration")

        # (samples/sec) * (seconds in a frame) * (bytes/sample)
        arg_4 = int(arg_0.frame_rate * (arg_1 / 1000) * arg_0.sample_width)
        arg_5 = 0  # where we are so far in self's data (in bytes)
        arg_6 = 0.0  # where we are so far in self (in seconds)
        # (bytes/frame) * (sample/bytes) * (sec/samples)
        arg_7 = (arg_4 / arg_0.frame_rate) / arg_0.sample_width
        while arg_5 + arg_4 < len(arg_0.raw_data):
            yield arg_3(arg_0.raw_data[arg_5:arg_5 + arg_4], arg_6, arg_7)
            arg_6 += arg_7
            arg_5 += arg_4

        if arg_2:
            arg_8 = arg_0.raw_data[arg_5:]
            arg_9 = bytes(arg_4 - len(arg_8))
            yield arg_3(arg_8 + arg_9, arg_6, arg_7)

Yields self s data in chunks of frame_duration_ms .


return {'tpr': self.rp(kwargs['s']), 'xtc': self.rp(kwargs['o'])}

def Func(arg_0, **arg_1):
        """Write compact xtc that is fitted to the tpr reference structure.

        See :func:`gromacs.cbook.trj_fitandcenter` for details and
        description of *kwargs* (including *input*, *input1*, *n* and
        *n1* for how to supply custom index groups). The most important ones are listed
        here but in most cases the defaults should work.

        :Keywords:
           *s*
             Input structure (typically the default tpr file but can be set to
             some other file with a different conformation for fitting)
           *n*
             Alternative index file.
           *o*
             Name of the output trajectory.
           *xy* : Boolean
             If ``True`` then only fit in xy-plane (useful for a membrane normal
             to z). The default is ``False``.
           *force*
             - ``True``: overwrite existing trajectories
             - ``False``: throw a IOError exception
             - ``None``: skip existing and log a warning [default]

        :Returns:
              dictionary with keys *tpr*, *xtc*, which are the names of the
              the new files
        """
        arg_1.setdefault('s', arg_0.tpr)
        arg_1.setdefault('n', arg_0.ndx)
        arg_1['f'] = arg_0.xtc
        arg_1.setdefault('o', arg_0.outfile(arg_0.infix_filename(None, arg_0.xtc, '_centfit', 'xtc')))
        arg_2 = arg_1.pop('force', arg_0.force)

        logger.info("Centering and fitting trajectory {f!r}...".format(**arg_1))
        with utilities.in_dir(arg_0.dirname):
            if not arg_0.check_file_exists(arg_1['o'], resolve="indicate", arg_2=arg_2):
                trj_fitandcenter(**arg_1)
            logger.info("Centered and fit trajectory: {o!r}.".format(**arg_1))
        return {'tpr': arg_0.rp(arg_1['s']), 'xtc': arg_0.rp(arg_1['o'])}

Write compact xtc that is fitted to the tpr reference structure .