def Func ( arg_0 ) : import pandas as pd return pd . Series ( arg_0 ) . dt . year . values

def Func(arg_0):
    """Extracts the year out of a datetime sample.

    :returns: an expression containing the year extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.year
    Expression = Func(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  2009
    1  2016
    2  2015
    """
    import pandas as pd
    return pd.Series(arg_0).dt.year.values

Extracts the year out of a datetime sample.

    :returns: an expression containing the year extracted from a datetime column.

    Example:

    >>> import vaex
    >>> import numpy as np
    >>> date = np.array(['2009-10-12T03:31:00', '2016-02-11T10:17:34', '2015-11-12T11:34:22'], dtype=np.datetime64)
    >>> df = vaex.from_arrays(date=date)
    >>> df
      #  date
      0  2009-10-12 03:31:00
      1  2016-02-11 10:17:34
      2  2015-11-12 11:34:22

    >>> df.date.dt.year
    Expression = dt_year(date)
    Length: 3 dtype: int64 (expression)
    -----------------------------------
    0  2009
    1  2016
    2  2015

Extracts the year out of a datetime sample .


def Func ( arg_0 ) : if not arg_0 . _client : arg_0 . _client = Client ( credentials = arg_0 . _get_credentials ( ) ) return arg_0 . _client

def Func(arg_0):
        """
        Retrieves connection to Cloud Translate

        :return: Google Cloud Translate client object.
        :rtype: Client
        """
        if not arg_0._client:
            arg_0._client = Client(credentials=arg_0._get_credentials())
        return arg_0._client


def
Func
(
arg_0
,
arg_1
)
:
with
io
.
open
(
arg_1
,
"w"
)
as
fh
:
fh
.
write
(
"strict digraph DependencyDiagram {\n"
)
arg_2
=
arg_0
.
edges
(
)
arg_3
=
set
(
arg_0
.
nodes
(
)
)
if
arg_2
:
for
arg_4
in
sorted
(
arg_2
)
:
arg_5
,
arg_6
=
arg_4
arg_3
=
arg_3
set
(
arg_5
)
arg_3
=
arg_3
set
(
arg_6
)
arg_7
=
'"{}" -> "{}";\n'
fh
.
write
(
arg_7
.
format
(
arg_5
,
arg_6
)
)
if
arg_3
:
for
arg_8
in
sorted
(
arg_3
)
:
arg_7
=
'"{}"\n'
.
format
(
arg_8
)
fh
.
write
(
arg_7
)
fh
.
write
(
"}"
)

def Func(arg_0, arg_1):
    """
    Writes the graph G in dot file format for graphviz visualization.

    Args:
        a Networkx graph
        A filename to name the dot files
    """
    with io.open(arg_1, "w") as fh:
        fh.write("strict digraph DependencyDiagram {\n")
        arg_2 = arg_0.edges()
        arg_3 = set(arg_0.nodes())
        if arg_2:
            for arg_4 in sorted(arg_2):
                arg_5, arg_6 = arg_4
                arg_3 = arg_3 - set(arg_5)
                arg_3 = arg_3 - set(arg_6)
                arg_7 = '"{}" -> "{}";\n'
                fh.write(arg_7.format(arg_5, arg_6))
        # draw nodes with no links
        if arg_3:
            for arg_8 in sorted(arg_3):
                arg_7 = '"{}"\n'.format(arg_8)
                fh.write(arg_7)
        fh.write("}")

Writes the graph G in dot file format for graphviz visualization .


def
Func
(
arg_0
)
:
arg_1
=
GTFS
(
arg_0
)
arg_2
=
arg_0
.
execute
(
'SELECT date, day_start_ut FROM days'
)
for
arg_3
,
arg_4
in
arg_2
:
assert
arg_4
==
arg_1
.
get_day_start_ut
(
arg_3
)

def Func(arg_0):
    """This validates the day_start_ut of the days table."""
    arg_1 = GTFS(arg_0)
    arg_2 = arg_0.execute('SELECT date, day_start_ut FROM days')
    for arg_3, arg_4 in arg_2:
        #print date, day_start_ut
        assert arg_4 == arg_1.get_day_start_ut(arg_3)

This validates the day_start_ut of the days table .


return process in sig.simFallingSensProcs\
        or process in sig.simRisingSensProcs

def Func ( arg_0 , arg_1 ) -> bool : if arg_0 is None : return False return arg_1 in arg_0 . simFallingSensProcs or arg_1 in arg_0 . simRisingSensProcs

def Func(arg_0, arg_1) -> bool:
    """
    Check if hdl process has event depenency on signal
    """
    if arg_0 is None:
        return False

    return arg_1 in arg_0.simFallingSensProcs\
        or arg_1 in arg_0.simRisingSensProcs


def
Func
(
arg_0
=
)
:
if
len
(
arg_0
)
:
arg_1
=
' '
.
join
(
arg_0
)
arg_2
,
arg_1
=
arg_1
.
split
(
,
1
)
sendCommands
(
arg_2
,
arg_1
)
return
0

def Func(arg_0=None):
    """Send X10 commands when module is used from the command line.

    This uses syntax similar to sendCommands, for example:

    x10.py com2 A1 On, A2 Off, B All Off
    """
    if len(arg_0):
        # join all the arguments together by spaces so that quotes
        # aren't required on the command line.
        arg_1 = ' '.join(arg_0)

        # the comPort is everything leading up to the first space
        arg_2, arg_1 = arg_1.split(None, 1)

        sendCommands(arg_2, arg_1)

    return 0

Send X10 commands when module is used from the command line .


def Func ( arg_0 , arg_1 ) : import shapely . geometry if arg_0 . is_out_of_image ( arg_1 , fully = True , partly = False ) : return [ ] arg_2 , arg_3 = arg_1 . shape [ 0 : 2 ] if ia . is_np_array ( arg_1 ) else arg_1 [ 0 : 2 ] arg_4 = arg_0 . to_shapely_polygon ( ) arg_5 = shapely . geometry . Polygon ( [ ( 0 , 0 ) , ( arg_3 , 0 ) , ( arg_3 , arg_2 ) , ( 0 , arg_2 ) ] ) arg_6 = arg_4 . intersection ( arg_5 ) if not isinstance ( arg_6 , shapely . geometry . MultiPolygon ) : ia . do_assert ( isinstance ( arg_6 , shapely . geometry . Polygon ) ) arg_6 = shapely . geometry . MultiPolygon ( [ arg_6 ] ) arg_7 = [ ] for arg_8 in arg_6 . geoms : arg_7 . append ( Polygon . from_shapely ( arg_8 , label = arg_0 . label ) ) arg_9 = [ ] for arg_10 in arg_7 : arg_11 = False for arg_12 , arg_13 in arg_0 . exterior : arg_14 , arg_15 = arg_10 . find_closest_point_index ( arg_12 = arg_12 , arg_13 = arg_13 , return_distance = True ) if arg_15 < 1e-6 : arg_16 = arg_10 . change_first_point_by_index ( arg_14 ) arg_9 . append ( arg_16 ) arg_11 = True break ia . do_assert ( arg_11 ) return arg_9

def Func(arg_0, arg_1):
        """
        Cut off all parts of the polygon that are outside of the image.

        This operation may lead to new points being created.
        As a single polygon may be split into multiple new polygons, the result
        is always a list, which may contain more than one output polygon.

        This operation will return an empty list if the polygon is completely
        outside of the image plane.

        Parameters
        ----------
        image : (H,W,...) ndarray or tuple of int
            Image dimensions to use for the clipping of the polygon.
            If an ndarray, its shape will be used.
            If a tuple, it is assumed to represent the image shape and must
            contain at least two integers.

        Returns
        -------
        list of imgaug.Polygon
            Polygon, clipped to fall within the image dimensions.
            Returned as a list, because the clipping can split the polygon into
            multiple parts. The list may also be empty, if the polygon was
            fully outside of the image plane.

        """
        # load shapely lazily, which makes the dependency more optional
        import shapely.geometry

        # if fully out of image, clip everything away, nothing remaining
        if arg_0.is_out_of_image(arg_1, fully=True, partly=False):
            return []

        arg_2, arg_3 = arg_1.shape[0:2] if ia.is_np_array(arg_1) else arg_1[0:2]
        arg_4 = arg_0.to_shapely_polygon()
        arg_5 = shapely.geometry.Polygon([(0, 0), (arg_3, 0), (arg_3, arg_2), (0, arg_2)])
        arg_6 = arg_4.intersection(arg_5)
        if not isinstance(arg_6, shapely.geometry.MultiPolygon):
            ia.do_assert(isinstance(arg_6, shapely.geometry.Polygon))
            arg_6 = shapely.geometry.MultiPolygon([arg_6])

        arg_7 = []
        for arg_8 in arg_6.geoms:
            arg_7.append(Polygon.from_shapely(arg_8, label=arg_0.label))

        # shapely changes the order of points, we try here to preserve it as
        # much as possible
        arg_9 = []
        for arg_10 in arg_7:
            arg_11 = False
            for arg_12, arg_13 in arg_0.exterior:
                arg_14, arg_15 = arg_10.find_closest_point_index(arg_12=arg_12, arg_13=arg_13, return_distance=True)
                if arg_15 < 1e-6:
                    arg_16 = arg_10.change_first_point_by_index(arg_14)
                    arg_9.append(arg_16)
                    arg_11 = True
                    break
            ia.do_assert(arg_11)  # could only not find closest points if new polys are empty

        return arg_9

Cut off all parts of the polygon that are outside of the image .


(self, passphrase=None, iter=2048, maciter=1)

def Func(arg_0, arg_1=None, arg_2=2048, arg_3=1):
        """
        Dump a PKCS12 object as a string.

        For more information, see the :c:func:`PKCS12_create` man page.

        :param passphrase: The passphrase used to encrypt the structure. Unlike
            some other passphrase arguments, this *must* be a string, not a
            callback.
        :type passphrase: :py:data:`bytes`

        :param iter: Number of times to repeat the encryption step.
        :type iter: :py:data:`int`

        :param maciter: Number of times to repeat the MAC step.
        :type maciter: :py:data:`int`

        :return: The string representation of the PKCS #12 structure.
        :rtype:
        """
        arg_1 = _text_to_bytes_and_warn("passphrase", arg_1)

        if arg_0._cacerts is None:
            arg_4 = _ffi.NULL
        else:
            arg_4 = _lib.sk_X509_new_null()
            arg_4 = _ffi.gc(arg_4, _lib.sk_X509_free)
            for arg_5 in arg_0._cacerts:
                _lib.sk_X509_push(arg_4, arg_5._x509)

        if arg_1 is None:
            arg_1 = _ffi.NULL

        arg_6 = arg_0._friendlyname
        if arg_6 is None:
            arg_6 = _ffi.NULL

        if arg_0._pkey is None:
            arg_7 = _ffi.NULL
        else:
            arg_7 = arg_0._pkey._pkey

        if arg_0._cert is None:
            arg_5 = _ffi.NULL
        else:
            arg_5 = arg_0._cert._x509

        arg_8 = _lib.PKCS12_create(
            arg_1, arg_6, arg_7, arg_5, arg_4,
            _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
            _lib.NID_pbe_WithSHA1And3_Key_TripleDES_CBC,
            arg_2, arg_3, 0)
        if arg_8 == _ffi.NULL:
            _raise_current_error()
        arg_8 = _ffi.gc(arg_8, _lib.PKCS12_free)

        arg_9 = _new_mem_buf()
        _lib.i2d_PKCS12_bio(arg_9, arg_8)
        return _bio_to_string(arg_9)


def Func ( arg_0 , arg_1 , arg_2 ) : self . _Funced__ . append ( arg_1 ) setattr ( arg_0 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Append to self, accessible via Qt.QtCompat"""
    self._Funced__.append(arg_1)
    setattr(arg_0, arg_1, arg_2)

Append to self accessible via Qt . QtCompat


def Func(arg_0,arg_1,arg_2=None,arg_3=True,arg_4='l',**arg_5):
    '''
    Write Stokes-calibrated filterbank file for a given observation
    with a calibrator noise diode measurement on the source

    Parameters
    ----------
    cross_pols : string
        Path to cross polarization filterbank file (rawspec output) for observation to be calibrated
    diode_cross : string
        Path to cross polarization filterbank file of noise diode measurement ON the target
    obsI : string
        Path to Stokes I filterbank file of main observation (only needed if onefile=False)
    onefile : boolean
        True writes all calibrated Stokes parameters to a single filterbank file,
        False writes four separate files
    feedtype : 'l' or 'c'
        Basis of antenna dipoles. 'c' for circular, 'l' for linear
    '''
    #Obtain time sample length, frequencies, and noise diode data
    arg_6 = Waterfall(arg_1,max_load=150)
    arg_7 = arg_6.data
    arg_8 = arg_6.header['tsamp']

    #Calculate number of coarse channels in the noise diode measurement (usually 8)
    arg_9 = arg_6.calc_n_coarse_chan()
    arg_10 = arg_6.header['nchans']
    arg_11 = arg_10/arg_9
    arg_6 = None
    arg_12,arg_13,arg_14,arg_15 = get_stokes(arg_7,arg_4)
    arg_7 = None
    #Calculate differential gain and phase from noise diode measurements
    print('Calculating Mueller Matrix variables')
    arg_16 = gain_offsets(arg_12,arg_13,arg_14,arg_15,arg_8,arg_11,arg_4,**arg_5)
    arg_17 = phase_offsets(arg_12,arg_13,arg_14,arg_15,arg_8,arg_11,arg_4,**arg_5)

    #Clear data arrays to save memory
    arg_12 = None
    arg_13 = None
    arg_14 = None
    arg_15 = None

    #Get corrected Stokes parameters
    print('Opening '+arg_0)
    arg_18 = Waterfall(arg_0,max_load=150)
    arg_19 = arg_18.calc_n_coarse_chan()
    arg_20 = arg_18.header['nchans']
    arg_21 = arg_20/arg_19

    print('Grabbing Stokes parameters')
    arg_22,arg_23,arg_24,arg_25 = get_stokes(arg_18.data,arg_4)

    print('Applying Mueller Matrix')
    arg_22,arg_23,arg_24,arg_25 = apply_Mueller(arg_22,arg_23,arg_24,arg_25,arg_16,arg_17,arg_21,arg_4)

    #Use onefile (default) to produce one filterbank file containing all Stokes information
    if arg_3==True:
        arg_18.data[:,0,:] = np.squeeze(arg_22)
        arg_18.data[:,1,:] = np.squeeze(arg_23)
        arg_18.data[:,2,:] = np.squeeze(arg_24)
        arg_18.data[:,3,:] = np.squeeze(arg_25)
        arg_18.write_to_fil(arg_0[:-15]+'.SIQUV.polcal.fil')
        print('Calibrated Stokes parameters written to '+arg_0[:-15]+'.SIQUV.polcal.fil')
        return

    #Write corrected Stokes parameters to four filterbank files if onefile==False
    arg_6 = Waterfall(obs_I,max_load=150)
    arg_6.data = arg_22
    arg_6.write_to_fil(arg_0[:-15]+'.SI.polcal.fil')   #assuming file is named *.cross_pols.fil
    print('Calibrated Stokes I written to '+arg_0[:-15]+'.SI.polcal.fil')

    arg_6.data = arg_23
    arg_6.write_to_fil(arg_0[:-15]+'.Q.polcal.fil')   #assuming file is named *.cross_pols.fil
    print('Calibrated Stokes Q written to '+arg_0[:-15]+'.Q.polcal.fil')

    arg_6.data = arg_24
    arg_6.write_to_fil(arg_0[:-15]+'.U.polcal.fil')   #assuming file is named *.cross_pols.fil
    print('Calibrated Stokes U written to '+arg_0[:-15]+'.U.polcal.fil')

    arg_6.data = arg_25
    arg_6.write_to_fil(arg_0[:-15]+'.V.polcal.fil')   #assuming file is named *.cross_pols.fil
    print('Calibrated Stokes V written to '+arg_0[:-15]+'.V.polcal.fil')

Write Stokes - calibrated filterbank file for a given observation with a calibrator noise diode measurement on the source


(self, column_name_or_i, filter_column_name_or_i, filter_criterion)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_0
.
_get_column_index
(
arg_1
)
arg_5
=
arg_0
.
_get_column_index
(
arg_2
)
arg_6
=
{
float
:
lambda
x
:
float
(
x
)
==
arg_3
,
int
:
lambda
x
:
int
(
x
)
==
arg_3
,
str
:
lambda
x
:
x
.
lower
(
)
==
arg_3
.
lower
(
)
}
[
type
(
arg_3
)
]
for
arg_7
,
arg_8
in
enumerate
(
arg_0
.
_data
)
:
if
arg_6
(
arg_8
[
arg_5
]
)
:
break
else
:
raise
ValueError
(
"Filter did not return any values."
)
return
arg_0
.
_data
[
arg_7
]
[
arg_4
]

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Returns first occurrence of value of filter column matching filter criterion.
        """
        # find column indexes
        arg_4 = arg_0._get_column_index(arg_1)
        arg_5 = arg_0._get_column_index(arg_2)

        arg_6 = {
            float: lambda x: float(x) == arg_3,
            int: lambda x: int(x) == arg_3,
            str: lambda x: x.lower() == arg_3.lower()
        }[type(arg_3)]

        for arg_7, arg_8 in enumerate(arg_0._data):
            if arg_6(arg_8[arg_5]):
                break
        else:
            raise ValueError("Filter did not return any values.")

        return arg_0._data[arg_7][arg_4]

Returns first occurrence of value of filter column matching filter criterion .


(self, data, bandwidth=None, bin_seeding=False, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , ** arg_4 ) : if arg_2 is None : arg_2 = cl . estimate_bandwidth ( arg_1 ) arg_5 = cl . MeanShift ( arg_2 = arg_2 , arg_3 = arg_3 ) arg_5 . fit ( arg_1 ) return arg_5

def Func(arg_0, arg_1, arg_2=None, arg_3=False, **arg_4):
        """
        Fit MeanShift clustering algorithm to data.

        Parameters
        ----------
        data : array-like
            A dataset formatted by `classifier.fitting_data`.
        bandwidth : float
            The bandwidth value used during clustering.
            If none, determined automatically. Note:
            the data are scaled before clutering, so
            this is not in the same units as the data.
        bin_seeding : bool
            Whether or not to use 'bin_seeding'. See
            documentation for `sklearn.cluster.MeanShift`.
        **kwargs
            passed to `sklearn.cluster.MeanShift`.

        Returns
        -------
        Fitted `sklearn.cluster.MeanShift` object.
        """
        if arg_2 is None:
            arg_2 = cl.estimate_bandwidth(arg_1)
        arg_5 = cl.MeanShift(arg_2=arg_2, arg_3=arg_3)
        arg_5.fit(arg_1)
        return arg_5

Fit MeanShift clustering algorithm to data .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
Funcings
.
append
(
arg_1
)
sys
.
stderr
.
write
(
"Coverage.py warning: %s\n"
%
arg_1
)

def Func(arg_0, arg_1):
        """Use `msg` as a warning."""
        arg_0.Funcings.append(arg_1)
        sys.stderr.write("Coverage.py warning: %s\n" % arg_1)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_1
:
arg_3
=
getattr
(
logging
,
arg_1
,
)
if
not
arg_3
:
print
(
"Invalid log level '%s'"
%
arg_1
)
return
logger
.
setLevel
(
arg_3
)
run
(
arg_0
=
arg_0
,
arg_2
=
arg_2
)

def Func(arg_0, arg_1, arg_2):
    "Discover systems using WS-Discovery"

    if arg_1:
        arg_3 = getattr(logging, arg_1, None)
        if not arg_3:
           print("Invalid log level '%s'" % arg_1)
           return
        logger.setLevel(arg_3)

    run(arg_0=arg_0, arg_2=arg_2)


(self, handle, op, dest_path=None, dest_name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None ) : unrarlib . RARProcessFileW ( arg_1 , arg_2 , arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """Process current member with 'op' operation."""
        unrarlib.RARProcessFileW(arg_1, arg_2, arg_3, arg_4)

Process current member with op operation .


def
Func
(
arg_0
)
:
arg_1
=
os
.
path
.
basename
(
arg_0
.
connection_file
)
if
arg_1
==
arg_0
.
connection_file
or
os
.
path
.
dirname
(
arg_0
.
connection_file
)
==
arg_0
.
profile_dir
.
security_dir
:
arg_2
=
arg_1
if
arg_0
.
profile
!=
'default'
:
arg_2
+=
" --profile %s"
%
arg_0
.
profile
else
:
arg_2
=
arg_0
.
connection_file
arg_0
.
log
.
critical
(
"--existing %s"
,
arg_2
)
arg_0
.
ports
=
dict
(
shell
=
arg_0
.
shell_port
,
iopub
=
arg_0
.
iopub_port
,
stdin
=
arg_0
.
stdin_port
,
hb
=
arg_0
.
hb_port
)

def Func(arg_0):
        """display connection info, and store ports"""
        arg_1 = os.path.basename(arg_0.connection_file)
        if arg_1 == arg_0.connection_file or \
            os.path.dirname(arg_0.connection_file) == arg_0.profile_dir.security_dir:
            # use shortname
            arg_2 = arg_1
            if arg_0.profile != 'default':
                arg_2 += " --profile %s" % arg_0.profile
        else:
            arg_2 = arg_0.connection_file
        arg_0.log.critical("--existing %s", arg_2)

        arg_0.ports = dict(shell=arg_0.shell_port, iopub=arg_0.iopub_port,
                                stdin=arg_0.stdin_port, hb=arg_0.hb_port)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
key
(
)
if
arg_0
.
_control_key_down
(
arg_1
.
modifiers
(
)
,
include_command
=
False
)
:
if
arg_2
==
QtCore
.
Qt
.
Key_C
and
arg_0
.
_executing
:
arg_0
.
request_interrupt_kernel
(
)
return
True
elif
arg_2
==
QtCore
.
Qt
.
Key_Period
:
arg_0
.
request_restart_kernel
(
)
return
True
elif
not
arg_1
.
modifiers
(
)
&
QtCore
.
Qt
.
AltModifier
:
if
arg_2
==
QtCore
.
Qt
.
Key_Backspace
:
arg_3
=
arg_0
.
_get_input_buffer_cursor_column
(
)
arg_4
=
arg_0
.
_control
.
textCursor
(
)
if
arg_3
>
3
and
not
arg_4
.
hasSelection
(
)
:
arg_5
=
arg_0
.
_get_input_buffer_cursor_line
(
)
[
:
arg_3
]
if
arg_5
.
endswith
(
'    '
)
and
not
arg_5
.
strip
(
)
:
arg_4
.
movePosition
(
QtGui
.
QTextCursor
.
Left
,
QtGui
.
QTextCursor
.
KeepAnchor
,
4
)
arg_4
.
removeSelectedText
(
)
return
True
return
super
(
FrontendWidget
,
arg_0
)
.
Func
(
arg_1
)

def Func(arg_0, arg_1):
        """ Reimplemented for execution interruption and smart backspace.
        """
        arg_2 = arg_1.key()
        if arg_0._control_key_down(arg_1.modifiers(), include_command=False):

            if arg_2 == QtCore.Qt.Key_C and arg_0._executing:
                arg_0.request_interrupt_kernel()
                return True

            elif arg_2 == QtCore.Qt.Key_Period:
                arg_0.request_restart_kernel()
                return True

        elif not arg_1.modifiers() & QtCore.Qt.AltModifier:

            # Smart backspace: remove four characters in one backspace if:
            # 1) everything left of the cursor is whitespace
            # 2) the four characters immediately left of the cursor are spaces
            if arg_2 == QtCore.Qt.Key_Backspace:
                arg_3 = arg_0._get_input_buffer_cursor_column()
                arg_4 = arg_0._control.textCursor()
                if arg_3 > 3 and not arg_4.hasSelection():
                    arg_5 = arg_0._get_input_buffer_cursor_line()[:arg_3]
                    if arg_5.endswith('    ') and not arg_5.strip():
                        arg_4.movePosition(QtGui.QTextCursor.Left,
                                            QtGui.QTextCursor.KeepAnchor, 4)
                        arg_4.removeSelectedText()
                        return True

        return super(FrontendWidget, arg_0).Func(arg_1)

Reimplemented for execution interruption and smart backspace .


def Func ( arg_0 ) : @ wraps ( arg_0 ) def wrapper ( * arg_1 , ** arg_2 ) : arg_3 = 'session' arg_4 = arg_0 . __code__ . co_varnames arg_5 = arg_3 in arg_4 and arg_4 . index ( arg_3 ) < len ( arg_1 ) arg_6 = arg_3 in arg_2 if arg_6 or arg_5 : return arg_0 ( * arg_1 , ** arg_2 ) else : with create_session ( ) as session : arg_2 [ arg_3 ] = session return arg_0 ( * arg_1 , ** arg_2 ) return wrapper

def Func(arg_0):
    """
    Function decorator that provides a session if it isn't provided.
    If you want to reuse a session or run the function as part of a
    database transaction, you pass it to the function, if not this wrapper
    will create one and close it for you.
    """
    @wraps(arg_0)
    def wrapper(*arg_1, **arg_2):
        arg_3 = 'session'

        arg_4 = arg_0.__code__.co_varnames
        arg_5 = arg_3 in arg_4 and \
            arg_4.index(arg_3) < len(arg_1)
        arg_6 = arg_3 in arg_2

        if arg_6 or arg_5:
            return arg_0(*arg_1, **arg_2)
        else:
            with create_session() as session:
                arg_2[arg_3] = session
                return arg_0(*arg_1, **arg_2)

    return wrapper

Function decorator that provides a session if it isn t provided . If you want to reuse a session or run the function as part of a database transaction you pass it to the function if not this wrapper will create one and close it for you .


return pd.DataFrame(filt_, columns=["Filter", "Description"])

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . filters ( arg_1 ) arg_3 = [ ( k , v [ 0 ] ) for k , v in arg_2 . items ( ) ] return pd . DataFrame ( arg_3 , columns = [ "Filter" , "Description" ] )

def Func(arg_0, arg_1):
        """Get available filters from dataset you've selected"""
        arg_2 = arg_0.filters(arg_1)
        arg_3 = [ (k, v[0]) for k, v in arg_2.items()]
        return pd.DataFrame(arg_3, columns=["Filter", "Description"])

Get available filters from dataset you ve selected


def Func ( arg_0 , arg_1 = 300 ) : with open ( arg_0 . log_file ) as fh : arg_2 = fh . readlines ( ) [ - arg_1 : ] return arg_2

def Func(arg_0, arg_1=300):
        """Returns a list with the last ``n`` lines of the nextflow log file

        Parameters
        ----------
        n : int
            Number of last lines from the log file

        Returns
        -------
        list
            List of strings with the nextflow log
        """

        with open(arg_0.log_file) as fh:
            arg_2 = fh.readlines()[-arg_1:]

        return arg_2

Returns a list with the last n lines of the nextflow log file


(source=None, prevent=None, exclude=None, secret_management='default', no_color=False)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = 'default' , arg_4 = False ) : from tower_cli . cli . transfer . Func import Sender arg_5 = Sender ( arg_4 ) arg_5 . Func ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3='default', arg_4=False):
    """Import assets into Tower.

    'tower Func' imports one or more assets into a Tower instance

    The import can take either JSON or YAML.
    Data can be sent on stdin (i.e. from tower-cli receive pipe) and/or from files
    or directories passed as parameters.

    If a directory is specified only files that end in .json, .yaml or .yml will be
    imported. Other files will be ignored.
    """

    from tower_cli.cli.transfer.Func import Sender
    arg_5 = Sender(arg_4)
    arg_5.Func(arg_0, arg_1, arg_2, arg_3)

Import assets into Tower.

    'tower send' imports one or more assets into a Tower instance

    The import can take either JSON or YAML.
    Data can be sent on stdin (i.e. from tower-cli receive pipe) and/or from files
    or directories passed as parameters.

    If a directory is specified only files that end in .json, .yaml or .yml will be
    imported. Other files will be ignored.


def Func(arg_0, arg_1):
        """Show a temporary message."""
        if arg_0._message_handle is not None:
            arg_0._message_handle.cancel()
        arg_0._message_handle = asyncio.get_event_loop().call_later(
            arg_0._MESSAGE_DELAY_SECS, arg_0._clear_message
        )
        arg_0._message = arg_1
        arg_0._update()


def Func(arg_0, arg_1):
    """
    Deserialize a dataframe.

    Parameters
    ----------
    reader : file
        File-like object to read from. Must be opened in binary mode.
    data_type_id : dict
        Serialization format of the raw data.
        See the azureml.DataTypeIds class for constants.

    Returns
    -------
    pandas.DataFrame
        Dataframe object.
    """
    _not_none('reader', arg_0)
    _not_none_or_empty('data_type_id', arg_1)

    arg_2 = _SERIALIZERS.get(arg_1)
    if arg_2 is None:
        raise UnsupportedDatasetTypeError(arg_1)
    return arg_2[1](arg_0=arg_0)


def Func ( arg_0 ) : arg_1 = { } arg_2 = 0 arg_3 = sorted ( arg_0 . keys ( ) ) for arg_4 in arg_3 : arg_5 = arg_0 [ arg_4 ] arg_1 [ arg_4 ] = [ ] arg_6 = set ( ) for arg_7 in arg_5 : arg_8 = ( tuple ( arg_7 [ 0 ] ) , ) + arg_7 [ 1 : 4 ] if arg_8 not in arg_6 : arg_6 . add ( arg_8 ) arg_2 += 1 arg_1 [ arg_4 ] . append ( arg_7 [ : 4 ] + ( arg_2 , ) ) return arg_1

def Func(arg_0):
    """
    Return a record where all the duplicate fields have been removed.

    Fields are considered identical considering also the order of their
    subfields.
    """
    arg_1 = {}
    arg_2 = 0
    arg_3 = sorted(arg_0.keys())
    for arg_4 in arg_3:
        arg_5 = arg_0[arg_4]
        arg_1[arg_4] = []
        arg_6 = set()
        for arg_7 in arg_5:
            arg_8 = (tuple(arg_7[0]),) + arg_7[1:4]
            if arg_8 not in arg_6:
                arg_6.add(arg_8)
                arg_2 += 1
                arg_1[arg_4].append(arg_7[:4] + (arg_2,))
    return arg_1

Return a record where all the duplicate fields have been removed .


def
Func
(
arg_0
,
arg_1
=
"nibjb"
)
:
print
(
"popping up pasword window..."
)
arg_2
=
TK_askPassword
(
"FTP LOGIN"
,
"enter password for %s"
%
arg_1
)
if
not
arg_2
:
return
print
(
"username:"
,
arg_1
)
print
(
"password:"
,
"*"
*
(
len
(
arg_2
)
)
)
print
(
"connecting..."
)
arg_3
=
ftplib
.
FTP
(
"swharden.com"
)
arg_3
.
login
(
arg_1
,
arg_2
)
print
(
"successful login!"
)
arg_3
.
cwd
(
"/software/swhlab/versions"
)
print
(
"uploading"
,
os
.
path
.
basename
(
arg_0
)
)
arg_3
.
storbinary
(
"STOR "
+
os
.
path
.
basename
(
arg_0
)
,
open
(
arg_0
,
"rb"
)
,
1024
)
print
(
"disconnecting..."
)
arg_3
.
quit
(
)

def Func(arg_0,arg_1="nibjb"):
    """Only scott should do this. Upload new version to site."""
    print("popping up pasword window...")
    arg_2=TK_askPassword("FTP LOGIN","enter password for %s"%arg_1)
    if not arg_2:
        return
    print("username:",arg_1)
    print("password:","*"*(len(arg_2)))
    print("connecting...")
    arg_3 = ftplib.FTP("swharden.com")
    arg_3.login(arg_1, arg_2)
    print("successful login!")
    arg_3.cwd("/software/swhlab/versions") #IMMEDIATELY GO HERE!!!
    print("uploading",os.path.basename(arg_0))
    arg_3.storbinary("STOR " + os.path.basename(arg_0), open(arg_0, "rb"), 1024) #for binary files
    print("disconnecting...")
    arg_3.quit()

Only scott should do this . Upload new version to site .


async def Func ( arg_0 ) : if arg_0 . _ws is not None : await arg_0 . _ws . Func ( ) if arg_0 . polygon is not None : await arg_0 . polygon . Func ( )

async def Func(arg_0):
        '''Close any of open connections'''
        if arg_0._ws is not None:
            await arg_0._ws.Func()
        if arg_0.polygon is not None:
            await arg_0.polygon.Func()


(client, application_name, service_name, input_file)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Execute create, update, delete operations on existing reliable dictionaries.

    carry out create, update and delete operations on existing reliable dictionaries for given application and service.

    :param application_name: Name of the application.
    :type application_name: str
    :param service_name: Name of the service.
    :type service_name: str
    :param output_file: input file with list of json to provide the operation information for reliable dictionaries.
    """

    arg_4 = Cluster.from_sfclient(arg_0)
    arg_5 = arg_4.get_application(arg_1).get_service(arg_2)

    # call get service with headers and params
    with open(arg_3) as json_file:
        arg_6 = json.load(json_file)
        arg_5.execute(arg_6)
    return

Execute create update delete operations on existing reliable dictionaries .


def Func ( arg_0 ) : arg_0 . _nopickle = [ ] for arg_2 in arg_0 . comps : arg_3 = inspect . getmembers ( arg_2 , predicate = inspect . ismethod ) for arg_4 in arg_3 : if arg_4 [ 0 ] . startswith ( 'param_' ) : setattr ( arg_0 , arg_4 [ 0 ] , arg_4 [ 1 ] ) arg_0 . _nopickle . append ( arg_4 [ 0 ] ) arg_3 = arg_2 . exports ( ) for arg_4 in arg_3 : arg_5 = arg_2 . category + '_' + arg_4 . __func__ . __name__ setattr ( arg_0 , arg_5 , arg_4 ) arg_0 . _nopickle . append ( arg_5 )

def Func(arg_0):
        """
        Inherit some functions from the components that we own. In particular,
        let's grab all functions that begin with `param_` so the super class
        knows how to get parameter groups. Also, take anything that is listed
        under Component.exports and rename with the category type, i.e.,
        SphereCollection.add_particle -> Component.obj_add_particle
        """
        arg_0._nopickle = []

        for arg_2 in arg_0.comps:
            # take all member functions that start with 'param_'
            arg_3 = inspect.getmembers(arg_2, predicate=inspect.ismethod)
            for arg_4 in arg_3:
                if arg_4[0].startswith('param_'):
                    setattr(arg_0, arg_4[0], arg_4[1])
                    arg_0._nopickle.append(arg_4[0])

            # add everything from exports
            arg_3 = arg_2.exports()
            for arg_4 in arg_3:
                arg_5 = arg_2.category + '_' + arg_4.__func__.__name__
                setattr(arg_0, arg_5, arg_4)
                arg_0._nopickle.append(arg_5)

Inherit some functions from the components that we own . In particular let s grab all functions that begin with param_ so the super class knows how to get parameter groups . Also take anything that is listed under Component . exports and rename with the category type i . e . SphereCollection . add_particle - > Component . obj_add_particle


return {
            'content': self.content,
            'resources': [r._asdict() for r in self.resources],  # pylint: disable=W0212
            'js_init_fn': self.js_init_fn,
            'js_init_version': self.js_init_version,
            'json_init_args': self.json_init_args
        }

def Func ( arg_0 ) : return { 'content' : arg_0 . content , 'resources' : [ arg_1 . _asdict ( ) for arg_1 in arg_0 . resources ] , 'js_init_fn' : arg_0 . js_init_fn , 'js_init_version' : arg_0 . js_init_version , 'json_init_args' : arg_0 . json_init_args }

def Func(arg_0):
        """
        Returns the fragment in a dictionary representation.
        """
        return {
            'content': arg_0.content,
            'resources': [arg_1._asdict() for arg_1 in arg_0.resources],  # pylint: disable=W0212
            'js_init_fn': arg_0.js_init_fn,
            'js_init_version': arg_0.js_init_version,
            'json_init_args': arg_0.json_init_args
        }

Returns the fragment in a dictionary representation .


def Func(arg_0):
    """Parse the given color files.

    Supported are:
        * .txt for X11 colors
        * .json for colornames
    """
    if arg_0.endswith(".txt"):
        return parse_rgb_txt_file(arg_0)
    elif arg_0.endswith(".json"):
        return parse_json_color_file(arg_0)

    raise TypeError("colorful only supports .txt and .json files for colors")


def Func(arg_0):
    """
    Propagate negative reset "rst_n" signal
    to all subcomponents
    """
    arg_1 = arg_0.rst_n

    for arg_2 in arg_0._units:
        _tryConnect(arg_1, arg_2, 'rst_n')
        _tryConnect(~arg_1, arg_2, 'rst')

Propagate negative reset rst_n signal to all subcomponents


(line, filename, linenum, next_line_start, error)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
  """Checks for common mistakes in comments.

  Args:
    line: The line in question.
    filename: The name of the current file.
    linenum: The number of the line to check.
    next_line_start: The first non-whitespace column of the next line.
    error: The function to call with any errors found.
  """
  arg_5 = arg_0.find('//')
  if arg_5 != -1:
    # Check if the // may be in quotes.  If so, ignore it
    if re.sub(r'\\.', '', arg_0[0:arg_5]).count('"') % 2 == 0:
      # Allow one space for new scopes, two spaces otherwise:
      if (not (Match(r'^.*{ *//', arg_0) and arg_3 == arg_5) and
          ((arg_5 >= 1 and
            arg_0[arg_5-1] not in string.whitespace) or
           (arg_5 >= 2 and
            arg_0[arg_5-2] not in string.whitespace))):
        arg_4(arg_1, arg_2, 'whitespace/comments', 2,
              'At least two spaces is best between code and comments')

      # Checks for common mistakes in TODO comments.
      arg_6 = arg_0[arg_5:]
      arg_7 = _RE_PATTERN_TODO.match(arg_6)
      if arg_7:
        # One whitespace is correct; zero whitespace is handled elsewhere.
        arg_8 = arg_7.group(1)
        if len(arg_8) > 1:
          arg_4(arg_1, arg_2, 'whitespace/todo', 2,
                'Too many spaces before TODO')

        arg_9 = arg_7.group(2)
        if not arg_9:
          arg_4(arg_1, arg_2, 'readability/todo', 2,
                'Missing username in TODO; it should look like '
                '"// TODO(my_username): Stuff."')

        arg_10 = arg_7.group(3)
        # Comparisons made explicit for correctness -- pylint: disable=g-explicit-bool-comparison
        if arg_10 != ' ' and arg_10 != '':
          arg_4(arg_1, arg_2, 'whitespace/todo', 2,
                'TODO(my_username) should be followed by a space')

      # If the comment contains an alphanumeric character, there
      # should be a space somewhere between it and the // unless
      # it's a /// or //! Doxygen comment.
      if (Match(r'//[^ ]*\w', arg_6) and
          not Match(r'(///|//\!)(\s+|$)', arg_6)):
        arg_4(arg_1, arg_2, 'whitespace/comments', 4,
              'Should have a space between // and comment')

Checks for common mistakes in comments .


(source_las, *, point_format_id=None, file_version=None)

def Func(arg_0, *, arg_1=None, arg_2=None):
    """ Converts a Las from one point format to another
    Automatically upgrades the file version if source file version is not compatible with
    the new point_format_id

    Func to point format 0

    >>> las = read_las('pylastests/simple.las')
    >>> las.header.version
    '1.2'
    >>> las = Func(las, point_format_id=0)
    >>> las.header.point_format_id
    0
    >>> las.header.version
    '1.2'

    Func to point format 6, which need version >= 1.4
    then Func back to point format 0, version is not downgraded

    >>> las = read_las('pylastests/simple.las')
    >>> las.header.version
    '1.2'
    >>> las = Func(las, point_format_id=6)
    >>> las.header.point_format_id
    6
    >>> las.header.version
    '1.4'
    >>> las = Func(las, point_format_id=0)
    >>> las.header.version
    '1.4'

    an exception is raised if the requested point format is not compatible
    with the file version

    >>> las = read_las('pylastests/simple.las')
    >>> Func(las, point_format_id=6, file_version='1.2')
    Traceback (most recent call last):
     ...
    pylas.errors.PylasError: Point format 6 is not compatible with file version 1.2

    Parameters
    ----------
    source_las : pylas.lasdatas.base.LasBase
        The source data to be Funced

    point_format_id : int, optional
        The new point format id (the default is None, which won't change the source format id)

    file_version : str, optional,
        The new file version. None by default which means that the file_version
        may be upgraded for compatibility with the new point_format. The file version will not
        be downgraded.

    Returns
    -------
        pylas.lasdatas.base.LasBase
    """
    if arg_1 is None:
        arg_1 = arg_0.points_data.point_format.id

    if arg_2 is None:
        arg_2 = max(
            arg_0.header.version,
            dims.min_file_version_for_point_format(arg_1),
        )
    else:
        arg_2 = str(arg_2)
        dims.raise_if_version_not_compatible_with_fmt(arg_1, arg_2)

    arg_3 = headers.HeaderFactory.Func_header(arg_0.header, arg_2)
    arg_3.point_format_id = arg_1

    arg_4 = PointFormat(
        arg_1, arg_0.points_data.point_format.extra_dims
    )
    arg_5 = record.PackedPointRecord.from_point_record(
        arg_0.points_data, arg_4
    )

    try:
        arg_6 = arg_0.evlrs
    except ValueError:
        arg_6 = []

    if arg_2 >= "1.4":

        arg_7 = las14.LasData(
            arg_3=arg_3, vlrs=arg_0.vlrs, arg_5=arg_5, arg_6=arg_6
        )
    else:
        if arg_6:
            logger.warning(
                "The source contained {} EVLRs,"
                " they will be lost as version {} doest not support them".format(
                    len(arg_6), arg_2
                )
            )
        arg_7 = las12.LasData(arg_3=arg_3, vlrs=arg_0.vlrs, arg_5=arg_5)

    return arg_7

Converts a Las from one point format to another
    Automatically upgrades the file version if source file version is not compatible with
    the new point_format_id

    convert to point format 0

    >>> las = read_las('pylastests/simple.las')
    >>> las.header.version
    '1.2'
    >>> las = convert(las, point_format_id=0)
    >>> las.header.point_format_id
    0
    >>> las.header.version
    '1.2'

    convert to point format 6, which need version >= 1.4
    then convert back to point format 0, version is not downgraded

    >>> las = read_las('pylastests/simple.las')
    >>> las.header.version
    '1.2'
    >>> las = convert(las, point_format_id=6)
    >>> las.header.point_format_id
    6
    >>> las.header.version
    '1.4'
    >>> las = convert(las, point_format_id=0)
    >>> las.header.version
    '1.4'

    an exception is raised if the requested point format is not compatible
    with the file version

    >>> las = read_las('pylastests/simple.las')
    >>> convert(las, point_format_id=6, file_version='1.2')
    Traceback (most recent call last):
     ...
    pylas.errors.PylasError: Point format 6 is not compatible with file version 1.2

    Parameters
    ----------
    source_las : pylas.lasdatas.base.LasBase
        The source data to be converted

    point_format_id : int, optional
        The new point format id (the default is None, which won't change the source format id)

    file_version : str, optional,
        The new file version. None by default which means that the file_version
        may be upgraded for compatibility with the new point_format. The file version will not
        be downgraded.

    Returns
    -------
        pylas.lasdatas.base.LasBase


def Func(arg_0, arg_1, arg_2=0, arg_3=0):
    """
    Windows helper for ub.symlink
    """
    if exists(arg_1) and not os.path.islink(arg_1):
        # On windows a broken link might still exist as a hard link or a
        # junction. Overwrite it if it is a file and we cannot symlink.
        # However, if it is a non-junction directory then do not overwrite
        if arg_3:
            print('link location already exists')
        arg_4 = _win32_is_junction(arg_1)
        # NOTE:
        # in python2 broken junctions are directories and exist
        # in python3 broken junctions are directories and do not exist
        if os.path.isdir(arg_1):
            if arg_4:
                arg_5 = _win32_read_junction(arg_1)
                if arg_0 == arg_5:
                    if arg_3:
                        print('...and is a junction that points to the same place')
                    return arg_1
                else:
                    if arg_3:
                        if not exists(arg_5):
                            print('...and is a broken junction that points somewhere else')
                        else:
                            print('...and is a junction that points somewhere else')
            else:
                if arg_3:
                    print('...and is an existing real directory!')
                raise IOError('Cannot overwrite a real directory')

        elif os.path.isfile(arg_1):
            if _win32_is_hardlinked(arg_1, arg_0):
                if arg_3:
                    print('...and is a hard link that points to the same place')
                return arg_1
            else:
                if arg_3:
                    print('...and is a hard link that points somewhere else')
                if _win32_canFunc():
                    raise IOError('Cannot overwrite potentially real file if we can symlink')
        if arg_2:
            if arg_3:
                print('...overwriting')
            util_io.delete(arg_1, arg_3 > 1)
        else:
            if exists(arg_1):
                raise IOError('Link already exists')

    _win32Func2(arg_0, arg_1, arg_3=arg_3)


return dict(
        (key, os.path.expandvars(value))
        for key, value in settings.iteritems()
    )

def Func ( arg_0 ) : return dict ( ( arg_1 , os . path . expandvars ( arg_2 ) ) for arg_1 , arg_2 in arg_0 . iteritems ( ) )

def Func(arg_0):
    """Expands all environment variables in a settings dictionary."""
    return dict(
        (arg_1, os.path.expandvars(arg_2))
        for arg_1, arg_2 in arg_0.iteritems()
    )

Expands all environment variables in a settings dictionary .


(self, samplerate=None, n_channels=None, bitdepth=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''Converts output audio to the specified format.

        Parameters
        ----------
        samplerate : float, default=None
            Desired samplerate. If None, defaults to the same as input.
        n_channels : int, default=None
            Desired number of channels. If None, defaults to the same as input.
        bitdepth : int, default=None
            Desired bitdepth. If None, defaults to the same as input.

        See Also
        --------
        rate

        '''
        arg_4 = [8, 16, 24, 32, 64]
        if arg_3 is not None:
            if arg_3 not in arg_4:
                raise ValueError(
                    "bitdepth must be one of {}.".format(str(arg_4))
                )
            arg_0.output_format.extend(['-b', '{}'.format(arg_3)])
        if arg_2 is not None:
            if not isinstance(arg_2, int) or arg_2 <= 0:
                raise ValueError(
                    "n_channels must be a positive integer."
                )
            arg_0.output_format.extend(['-c', '{}'.format(arg_2)])
        if arg_1 is not None:
            if not is_number(arg_1) or arg_1 <= 0:
                raise ValueError("samplerate must be a positive number.")
            arg_0.rate(arg_1)
        return arg_0

Converts output audio to the specified format .


def Func ( arg_0 ) : if not arg_0 . tag_as_cern : arg_1 = record_get_field_instances ( arg_0 . record , tag = "595" ) for arg_2 in arg_1 : for arg_3 , arg_4 in arg_2 [ 0 ] : if arg_4 == "CDS" : arg_0 . tag_as_cern = True record_delete_fields ( arg_0 . record , tag = "595" )

def Func(arg_0):
        """Remove hidden notes and tag a CERN if detected."""
        if not arg_0.tag_as_cern:
            arg_1 = record_get_field_instances(arg_0.record,
                                               tag="595")
            for arg_2 in arg_1:
                for arg_3, arg_4 in arg_2[0]:
                    if arg_4 == "CDS":
                        arg_0.tag_as_cern = True
        record_delete_fields(arg_0.record, tag="595")

Remove hidden notes and tag a CERN if detected .


def Func ( arg_0 ) : if not arg_0 . _unprepared_pending : return for arg_1 in list ( arg_0 . _unprepared_pending ) : arg_0 . _configure_io_handler ( arg_1 ) arg_0 . check_events ( )

def Func(arg_0):
        """Prepare pending handlers.
        """
        if not arg_0._unprepared_pending:
            return
        for arg_1 in list(arg_0._unprepared_pending):
            arg_0._configure_io_handler(arg_1)
        arg_0.check_events()


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
log
.
info
(
'renaming database from %s to %s'
%
(
arg_1
,
arg_2
)
)
arg_0
.
_run_stmt
(
'alter database %s Func to %s'
%
(
arg_1
,
arg_2
)
)

def Func(arg_0, arg_1, arg_2):
        """Renames an existing database."""
        log.info('renaming database from %s to %s' % (arg_1, arg_2))
        arg_0._run_stmt('alter database %s Func to %s' % (arg_1, arg_2))


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . graph_file = open ( arg_1 , "w+" ) arg_0 . printer = VCGPrinter ( arg_0 . graph_file ) arg_0 . printer . open_graph ( title = arg_2 , layoutalgorithm = "dfs" , late_edge_labels = "yes" , port_sharing = "no" , manhattan_edges = "yes" , ) arg_0 . printer . emit_node = arg_0 . printer . node arg_0 . printer . emit_edge = arg_0 . printer . edge

def Func(arg_0, arg_1, arg_2):
        """initialize VCGWriter for a UML graph"""
        arg_0.graph_file = open(arg_1, "w+")
        arg_0.printer = VCGPrinter(arg_0.graph_file)
        arg_0.printer.open_graph(
            title=arg_2,
            layoutalgorithm="dfs",
            late_edge_labels="yes",
            port_sharing="no",
            manhattan_edges="yes",
        )
        arg_0.printer.emit_node = arg_0.printer.node
        arg_0.printer.emit_edge = arg_0.printer.edge


def Func ( arg_0 ) : arg_1 = ( 0 , 20 , 50 , 100 , 200 ) for arg_2 in range ( len ( arg_1 ) ) : if arg_0 <= arg_1 [ arg_2 ] : return BADGE_COLORS [ arg_2 ] return BADGE_COLORS [ - 1 ]

def Func(arg_0):
    """Return flake8 badge color.

    Parameters
    ----------
    score : float
        A flake8 score

    Returns
    -------
    str
        Badge color

    """
    # These are the score cutoffs for each color above.
    # I.e. score==0 -> brightgreen, down to 100 < score <= 200 -> orange
    arg_1 = (0, 20, 50, 100, 200)
    for arg_2 in range(len(arg_1)):
        if arg_0 <= arg_1[arg_2]:
            return BADGE_COLORS[arg_2]
    # and score > 200 -> red
    return BADGE_COLORS[-1]


def Func ( arg_0 ) : arg_1 = [ 'sample' , 'ratio_params' , 'despike_params' , 'autorange_params' , 'bkgcorrect_params' ] arg_2 = { } for arg_3 in arg_1 : arg_2 [ arg_3 ] = getattr ( arg_0 , arg_3 ) arg_2 [ 'filter_params' ] = arg_0 . filt . params arg_2 [ 'filter_sequence' ] = arg_0 . filt . sequence arg_2 [ 'filter_used' ] = arg_0 . filt . make_keydict ( ) return arg_2

def Func(arg_0):
        """
        Returns paramters used to process data.

        Returns
        -------
        dict
            dict of analysis parameters
        """
        arg_1 = ['sample',
                   'ratio_params',
                   'despike_params',
                   'autorange_params',
                   'bkgcorrect_params']

        arg_2 = {}
        for arg_3 in arg_1:
            arg_2[arg_3] = getattr(arg_0, arg_3)

        arg_2['filter_params'] = arg_0.filt.params
        arg_2['filter_sequence'] = arg_0.filt.sequence
        arg_2['filter_used'] = arg_0.filt.make_keydict()

        return arg_2

Returns paramters used to process data .


def Func(arg_0):
    """
    Identify the release type and create a new target file with TOML header.

    Requires three arguments.

    """
    arg_1, arg_2, arg_3 = arg_0
    if "a" in arg_3:
        arg_4 = "alpha"
    if "b" in arg_3:
        arg_4 = "beta"
    else:
        arg_4 = find_bump(arg_2, arg_3)
    arg_5 = "{}.md".format(arg_3)
    arg_6 = copy(join(arg_1, arg_5), arg_2)
    build_hugo_md(arg_6, arg_3, arg_4)

Identify the release type and create a new target file with TOML header .


return sum([
                256**(self.chunklen[0]-1-i) * ord_byte(chunk[i])
                for i in range(self.chunklen[0])
            ])

def Func ( arg_0 , arg_1 ) : return sum ( [ 256 ** ( arg_0 . chunklen [ 0 ] - 1 - arg_2 ) * ord_byte ( arg_1 [ arg_2 ] ) for arg_2 in range ( arg_0 . chunklen [ 0 ] ) ] )

def Func(arg_0, arg_1):
        '''
        parses a chunk of bytes to integer using big-endian representation
        '''
        return sum([
                256**(arg_0.chunklen[0]-1-arg_2) * ord_byte(arg_1[arg_2])
                for arg_2 in range(arg_0.chunklen[0])
            ])

parses a chunk of bytes to integer using big - endian representation


def Func(arg_0):
    """A helper function that decorates a function to retain the current
    request context.  This is useful when working with greenlets.  The moment
    the function is decorated a copy of the request context is created and
    then pushed when the function is called.

    Example::

        import gevent
        from flask import Func

        @app.route('/')
        def index():
            @Func
            def do_some_work():
                # do some work here, it can access flask.request like you
                # would otherwise in the view function.
                ...
            gevent.spawn(do_some_work)
            return 'Regular response'

    .. versionadded:: 0.10
    """
    arg_1 = _request_ctx_stack.top
    if arg_1 is None:
        raise RuntimeError('This decorator can only be used at local scopes '
            'when a request context is on the stack.  For instance within '
            'view functions.')
    arg_2 = arg_1.copy()
    def wrapper(*arg_3, **arg_4):
        with arg_2:
            return arg_0(*arg_3, **arg_4)
    return update_wrapper(wrapper, arg_0)

A helper function that decorates a function to retain the current
    request context.  This is useful when working with greenlets.  The moment
    the function is decorated a copy of the request context is created and
    then pushed when the function is called.

    Example::

        import gevent
        from flask import copy_current_request_context

        @app.route('/')
        def index():
            @copy_current_request_context
            def do_some_work():
                # do some work here, it can access flask.request like you
                # would otherwise in the view function.
                ...
            gevent.spawn(do_some_work)
            return 'Regular response'

    .. versionadded:: 0.10

A helper function that decorates a function to retain the current request context . This is useful when working with greenlets . The moment the function is decorated a copy of the request context is created and then pushed when the function is called .


def Func ( arg_0 , ** arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : if hasattr ( arg_3 , 'value' ) : arg_3 = arg_3 . value arg_0 . inputs . __Funcattr__ ( arg_2 , arg_3 )

def Func(arg_0, **arg_1):
        """
        Set input values on task

        Args:
               arbitrary_keys: values for the keys

        Returns:
            None
        """
        for arg_2, arg_3 in arg_1.items():
            # Support both port and port.value
            if hasattr(arg_3, 'value'):
                arg_3 = arg_3.value

            arg_0.inputs.__Funcattr__(arg_2, arg_3)


def
Func
(
)
:
arg_0
=
folders
.
cacheDirectory
(
)
def
fullpath
(
arg_1
)
:
return
os
.
path
.
join
(
arg_0
,
arg_1
)
def
getMTimeSafe
(
arg_1
)
:
try
:
return
os
.
stat
(
arg_1
)
.
st_mtime
except
FileNotFoundError
:
import
time
return
time
.
clock
(
)
fsutils
.
mkDirP
(
arg_0
)
arg_2
=
getMaxCachedModules
(
)
for
arg_1
in
sorted
(
[
arg_1
for
arg_1
in
os
.
listdir
(
arg_0
)
if
os
.
path
.
isfile
(
fullpath
(
arg_1
)
)
and
not
arg_1
.
endswith
(
'.json'
)
and
not
arg_1
.
endswith
(
'.locked'
)
]
,
key
=
lambda
arg_1
:
getMTimeSafe
(
fullpath
(
arg_1
)
)
,
reverse
=
True
)
[
arg_2
:
]
:
cache_logger
.
debug
(
'cleaning up cache file %s'
,
arg_1
)
removeFromCache
(
arg_1
)
cache_logger
.
debug
(
'cache pruned to %s items'
,
arg_2
)

def Func():
    ''' Prune the cache '''
    arg_0 = folders.cacheDirectory()
    def fullpath(arg_1):
        return os.path.join(arg_0, arg_1)
    def getMTimeSafe(arg_1):
        # it's possible that another process removed the file before we stat
        # it, handle this gracefully
        try:
            return os.stat(arg_1).st_mtime
        except FileNotFoundError:
            import time
            return time.clock()
    # ensure cache exists
    fsutils.mkDirP(arg_0)
    arg_2 = getMaxCachedModules()
    for arg_1 in sorted(
            [arg_1 for arg_1 in os.listdir(arg_0) if
                os.path.isfile(fullpath(arg_1)) and not arg_1.endswith('.json') and not arg_1.endswith('.locked')
            ],
            key = lambda arg_1: getMTimeSafe(fullpath(arg_1)),
            reverse = True
        )[arg_2:]:
        cache_logger.debug('cleaning up cache file %s', arg_1)
        removeFromCache(arg_1)
    cache_logger.debug('cache pruned to %s items', arg_2)


def Func ( arg_0 = None , arg_1 = None ) : arg_2 = MemoryFile ( ) arg_1 . update ( width = arg_0 . shape [ - 2 ] , height = arg_0 . shape [ - 1 ] ) with arg_2 . open ( ** arg_1 ) as dataset : dataset . write ( arg_0 ) return arg_2

def Func(arg_0=None, arg_1=None):
    """
    Return a rasterio.io.MemoryFile instance from input.

    Parameters
    ----------
    data : array
        array to be written
    profile : dict
        rasterio profile for MemoryFile
    """
    arg_2 = MemoryFile()
    arg_1.update(width=arg_0.shape[-2], height=arg_0.shape[-1])
    with arg_2.open(**arg_1) as dataset:
        dataset.write(arg_0)
    return arg_2

Return a rasterio . io . MemoryFile instance from input .


(lclist,
                outdir,
                timecols=None,
                magcols=None,
                errcols=None,
                lcformat='hat-sql',
                lcformatdir=None,
                pfmethods=('gls','pdm','mav','win'),
                pfkwargs=({},{},{},{}),
                sigclip=10.0,
                getblssnr=False,
                nperiodworkers=NCPUS,
                ncontrolworkers=1,
                liststartindex=None,
                listmaxobjects=None,
                minobservations=500,
                excludeprocessed=True)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = 'hat-sql' , arg_6 = None , arg_7 = ( 'gls' , 'pdm' , 'mav' , 'win' ) , arg_8 = ( { } , { } , { } , { } ) , arg_9 = 10.0 , arg_10 = False , arg_11 = arg_12 , arg_13 = 1 , arg_14 = None , arg_15 = None , arg_16 = 500 , arg_17 = True ) : if not os . path . exists ( arg_1 ) : os . makedirs ( arg_1 ) if ( arg_14 is not None ) and ( arg_15 is None ) : arg_0 = arg_0 [ arg_14 : ] elif ( arg_14 is None ) and ( arg_15 is not None ) : arg_0 = arg_0 [ : arg_15 ] elif ( arg_14 is not None ) and ( arg_15 is not None ) : arg_0 = arg_0 [ arg_14 : arg_14 + arg_15 ] arg_18 = [ ( x , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 , arg_8 , arg_10 , arg_9 , arg_11 , arg_16 , arg_17 ) for x in arg_0 ] with ProcessPoolExecutor ( max_workers = arg_13 ) as executor : arg_19 = executor . map ( _runpf_worker , arg_18 ) arg_20 = [ x for x in arg_19 ] return arg_20

def Func(arg_0,
                arg_1,
                arg_2=None,
                arg_3=None,
                arg_4=None,
                arg_5='hat-sql',
                arg_6=None,
                arg_7=('gls','pdm','mav','win'),
                arg_8=({},{},{},{}),
                arg_9=10.0,
                arg_10=False,
                arg_11=arg_12,
                arg_13=1,
                arg_14=None,
                arg_15=None,
                arg_16=500,
                arg_17=True):
    '''This drives the overall parallel period processing for a list of LCs.

    As a rough benchmark, 25000 HATNet light curves with up to 50000 points per
    LC take about 26 days in total for an invocation of this function using
    GLS+PDM+BLS, 10 periodworkers, and 4 controlworkers (so all 40 'cores') on a
    2 x Xeon E5-2660v3 machine.

    Parameters
    ----------

    lclist : list of str
        The list of light curve file to process.

    outdir : str
        The output directory where the period-finding result pickles will go.

    timecols : list of str or None
        The timecol keys to use from the lcdict in calculating the features.

    magcols : list of str or None
        The magcol keys to use from the lcdict in calculating the features.

    errcols : list of str or None
        The errcol keys to use from the lcdict in calculating the features.

    lcformat : str
        This is the `formatkey` associated with your light curve format, which
        you previously passed in to the `lcproc.register_lcformat`
        function. This will be used to look up how to find and read the light
        curves specified in `basedir` or `use_list_of_filenames`.

    lcformatdir : str or None
        If this is provided, gives the path to a directory when you've stored
        your lcformat description JSONs, other than the usual directories lcproc
        knows to search for them in. Use this along with `lcformat` to specify
        an LC format JSON file that's not currently registered with lcproc.

    pfmethods : list of str
        This is a list of period finding methods to run. Each element is a
        string matching the keys of the `PFMETHODS` dict above. By default, this
        runs GLS, PDM, AoVMH, and the spectral window Lomb-Scargle periodogram.

    pfkwargs : list of dicts
        This is used to provide any special kwargs as dicts to each
        period-finding method function specified in `pfmethods`.

    sigclip : float or int or sequence of two floats/ints or None
        If a single float or int, a symmetric sigma-clip will be performed using
        the number provided as the sigma-multiplier to cut out from the input
        time-series.

        If a list of two ints/floats is provided, the function will perform an
        'asymmetric' sigma-clip. The first element in this list is the sigma
        value to use for fainter flux/mag values; the second element in this
        list is the sigma value to use for brighter flux/mag values. For
        example, `sigclip=[10., 3.]`, will sigclip out greater than 10-sigma
        dimmings and greater than 3-sigma brightenings. Here the meaning of
        "dimming" and "brightening" is set by *physics* (not the magnitude
        system), which is why the `magsarefluxes` kwarg must be correctly set.

        If `sigclip` is None, no sigma-clipping will be performed, and the
        time-series (with non-finite elems removed) will be passed through to
        the output.

    getblssnr : bool
        If this is True and BLS is one of the methods specified in `pfmethods`,
        will also calculate the stats for each best period in the BLS results:
        transit depth, duration, ingress duration, refit period and epoch, and
        the SNR of the transit.

    nperiodworkers : int
        The number of parallel period-finding workers to launch per object task.

    ncontrolworkers : int
        The number of controlling processes to launch. This effectively sets how
        many objects from `lclist` will be processed in parallel.

    liststartindex : int or None
        This sets the index from where to start in `lclist`.

    listmaxobjects : int or None
        This sets the maximum number of objects in `lclist` to run
        period-finding for in this invocation. Together with `liststartindex`,
        `listmaxobjects` can be used to distribute processing over several
        independent machines if the number of light curves is very large.

    minobservations : int
        The minimum number of finite LC points required to process a light
        curve.

    excludeprocessed : bool
        If this is True, light curves that have existing period-finding result
        pickles in `outdir` will not be processed.

        FIXME: currently, this uses a dumb method of excluding already-processed
        files. A smarter way to do this is to (i) generate a SHA512 cachekey
        based on a repr of `{'lcfile', 'timecols', 'magcols', 'errcols',
        'lcformat', 'pfmethods', 'sigclip', 'getblssnr', 'pfkwargs'}`, (ii) make
        sure all list kwargs in the dict are sorted, (iii) check if the output
        file has the same cachekey in its filename (last 8 chars of cachekey
        should work), so the result was processed in exactly the same way as
        specifed in the input to this function, and can therefore be
        ignored. Will implement this later.

    Returns
    -------

    list of str
        A list of the period-finding pickles created for all of input LCs
        processed.

    '''

    # make the output directory if it doesn't exist
    if not os.path.exists(arg_1):
        os.makedirs(arg_1)

    if (arg_14 is not None) and (arg_15 is None):
        arg_0 = arg_0[arg_14:]

    elif (arg_14 is None) and (arg_15 is not None):
        arg_0 = arg_0[:arg_15]

    elif (arg_14 is not None) and (arg_15 is not None):
        arg_0 = arg_0[arg_14:arg_14+arg_15]

    arg_18 = [(x, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6,
                 arg_7, arg_8, arg_10, arg_9, arg_11,
                 arg_16,
                 arg_17)
                for x in arg_0]

    with ProcessPoolExecutor(max_workers=arg_13) as executor:
        arg_19 = executor.map(_runpf_worker, arg_18)

    arg_20 = [x for x in arg_19]
    return arg_20

This drives the overall parallel period processing for a list of LCs .


def Func ( arg_0 ) : arg_1 = inspect . signature ( arg_0 ) . parameters . items ( ) @ wraps ( arg_0 ) def wrapper ( * arg_2 , ** arg_3 ) : arg_2 = list ( arg_2 ) arg_4 = [ ] arg_5 = { } for arg_6 , arg_7 in arg_1 : arg_8 = arg_7 . annotation if arg_8 is inspect . _empty : arg_8 = lambda arg_10 : arg_10 if arg_7 . kind is arg_7 . POSITIONAL_OR_KEYWORD : if arg_2 : arg_9 = arg_2 . pop ( 0 ) arg_4 . append ( arg_8 ( arg_9 ) ) elif arg_7 . kind is arg_7 . VAR_POSITIONAL : for arg_10 in arg_2 : arg_4 . append ( arg_8 ( arg_10 ) ) else : for arg_11 , arg_12 in arg_3 . items ( ) : arg_13 , arg_14 = arg_8 ( arg_11 , arg_12 ) arg_5 [ arg_13 ] = arg_14 return arg_0 ( * arg_4 , ** arg_5 ) return wrapper

def Func(arg_0):
    """Decorator that converts arguments via annotations."""
    arg_1 = inspect.signature(arg_0).parameters.items()

    @wraps(arg_0)
    def wrapper(*arg_2, **arg_3):
        arg_2 = list(arg_2)
        arg_4 = []
        arg_5 = {}
        for arg_6, arg_7 in arg_1:
            arg_8 = arg_7.annotation
            if arg_8 is inspect._empty:
                arg_8 = lambda arg_10: arg_10  # do nothing
            if arg_7.kind is arg_7.POSITIONAL_OR_KEYWORD:
                if arg_2:
                    arg_9 = arg_2.pop(0)
                    arg_4.append(arg_8(arg_9))
            elif arg_7.kind is arg_7.VAR_POSITIONAL:
                for arg_10 in arg_2:
                    arg_4.append(arg_8(arg_10))
            else:
                for arg_11, arg_12 in arg_3.items():
                    arg_13, arg_14 = arg_8(arg_11, arg_12)
                    arg_5[arg_13] = arg_14
        return arg_0(*arg_4, **arg_5)
    return wrapper

Decorator that converts arguments via annotations .


def
Func
(
arg_0
)
:
arg_0
.
log
.
info
(
"Making stpd-file: %s"
,
arg_0
.
stpd
)
arg_1
=
Stepper
(
arg_0
.
core
,
rps_schedule
=
arg_0
.
load_profile
.
schedule
if
arg_0
.
load_profile
.
is_rps
(
)
else
,
http_ver
=
arg_0
.
http_ver
,
ammo_file
=
arg_0
.
ammo_file
,
instances_schedule
=
arg_0
.
load_profile
.
schedule
if
arg_0
.
load_profile
.
is_instances
(
)
else
,
instances
=
arg_0
.
instances
,
loop_limit
=
arg_0
.
loop_limit
,
ammo_limit
=
arg_0
.
ammo_limit
,
uris
=
arg_0
.
uris
,
headers
=
[
header
.
strip
(
'[]'
)
for
header
in
arg_0
.
headers
]
,
autocases
=
arg_0
.
autocases
,
enum_ammo
=
arg_0
.
enum_ammo
,
ammo_type
=
arg_0
.
ammo_type
,
chosen_cases
=
arg_0
.
chosen_cases
,
use_cache
=
arg_0
.
use_caching
)
with
open
(
arg_0
.
stpd
,
'w'
,
arg_0
.
file_cache
)
as
os
:
arg_1
.
write
(
os
)

def Func(arg_0):
        ''' stpd generation using Stepper class '''
        arg_0.log.info("Making stpd-file: %s", arg_0.stpd)
        arg_1 = Stepper(
            arg_0.core,
            rps_schedule=arg_0.load_profile.schedule if arg_0.load_profile.is_rps() else None,
            http_ver=arg_0.http_ver,
            ammo_file=arg_0.ammo_file,
            instances_schedule=arg_0.load_profile.schedule if arg_0.load_profile.is_instances() else None,
            instances=arg_0.instances,
            loop_limit=arg_0.loop_limit,
            ammo_limit=arg_0.ammo_limit,
            uris=arg_0.uris,
            headers=[header.strip('[]') for header in arg_0.headers],
            autocases=arg_0.autocases,
            enum_ammo=arg_0.enum_ammo,
            ammo_type=arg_0.ammo_type,
            chosen_cases=arg_0.chosen_cases,
            use_cache=arg_0.use_caching)
        with open(arg_0.stpd, 'w', arg_0.file_cache) as os:
            arg_1.write(os)


def Func ( arg_0 , arg_1 = None ) -> List [ 'Tag' ] : arg_2 = arg_0 . _lststr arg_3 = arg_0 . _type_to_spans if arg_1 : if arg_1 in _tag_extensions : arg_4 = arg_2 [ 0 ] return [ Tag ( arg_2 , arg_3 , arg_5 , 'ExtensionTag' ) for arg_5 in arg_3 [ 'ExtensionTag' ] if arg_4 . startswith ( '<' + arg_1 , arg_5 [ 0 ] ) ] Func = [ ] else : Func = [ Tag ( arg_2 , arg_3 , arg_5 , 'ExtensionTag' ) for arg_5 in arg_3 [ 'ExtensionTag' ] ] arg_7 = Func . append arg_8 = arg_0 . _span [ 0 ] arg_9 = arg_0 . _shadow if arg_1 : arg_10 = reversed ( [ m for m in regex_compile ( START_TAG_PATTERN . replace ( rb'{name}' , rb'(?P<name>' + arg_1 . encode ( ) + rb')' ) ) . finditer ( arg_9 ) ] ) arg_11 = regex_compile ( END_TAG_PATTERN . replace ( b'{name}' , arg_1 . encode ( ) ) ) . search else : arg_10 = reversed ( [ m for m in START_TAG_FINDITER ( arg_9 ) ] ) arg_12 = arg_9 [ : ] arg_13 = arg_3 . setdefault ( 'Tag' , [ ] ) arg_14 = { ( arg_17 [ 0 ] , arg_17 [ 1 ] ) : arg_17 for arg_17 in arg_13 } . get arg_15 = arg_13 . append for arg_16 in arg_10 : if arg_16 [ 'self_closing' ] : arg_17 , arg_18 = arg_16 . span ( ) arg_5 = [ arg_8 + arg_17 , arg_8 + arg_18 ] else : if arg_1 : arg_19 = arg_11 ( arg_12 , arg_16 . end ( ) ) else : arg_19 = search ( END_TAG_PATTERN . replace ( b'{name}' , arg_16 [ 'name' ] ) , arg_12 ) if arg_19 : arg_17 , arg_18 = arg_19 . span ( ) arg_12 [ arg_17 : arg_18 ] = b'_' * ( arg_18 - arg_17 ) arg_5 = [ arg_8 + arg_16 . start ( ) , arg_8 + arg_18 ] else : arg_17 , arg_18 = arg_16 . span ( ) arg_5 = [ arg_8 + arg_17 , arg_8 + arg_18 ] arg_20 = arg_14 ( ( arg_5 [ 0 ] , arg_5 [ 1 ] ) ) if arg_20 is None : arg_15 ( arg_5 ) else : arg_5 = arg_20 arg_7 ( Tag ( arg_2 , arg_3 , arg_5 , 'Tag' ) ) return sorted ( Func , key = attrgetter ( '_span' ) )

def Func(arg_0, arg_1=None) -> List['Tag']:
        """Return all tags with the given name."""
        arg_2 = arg_0._lststr
        arg_3 = arg_0._type_to_spans
        if arg_1:
            if arg_1 in _tag_extensions:
                arg_4 = arg_2[0]
                return [
                    Tag(arg_2, arg_3, arg_5, 'ExtensionTag')
                    for arg_5 in arg_3['ExtensionTag']
                    if arg_4.startswith('<' + arg_1, arg_5[0])]
            Func = []  # type: List['Tag']
        else:
            # There is no name, add all extension tags. Before using shadow.
            Func = [
                Tag(arg_2, arg_3, arg_5, 'ExtensionTag')
                for arg_5 in arg_3['ExtensionTag']]
        arg_7 = Func.append
        # Get the left-most start tag, match it to right-most end tag
        # and so on.
        arg_8 = arg_0._span[0]
        arg_9 = arg_0._shadow
        if arg_1:
            # There is a name but it is not in TAG_EXTENSIONS.
            arg_10 = reversed([m for m in regex_compile(
                START_TAG_PATTERN.replace(
                    rb'{name}', rb'(?P<name>' + arg_1.encode() + rb')')
            ).finditer(arg_9)])
            arg_11 = regex_compile(END_TAG_PATTERN .replace(
                b'{name}', arg_1.encode())).search
        else:
            arg_10 = reversed(
                [m for m in START_TAG_FINDITER(arg_9)])
        arg_12 = arg_9[:]
        arg_13 = arg_3.setdefault('Tag', [])
        arg_14 = {(arg_17[0], arg_17[1]): arg_17 for arg_17 in arg_13}.get
        arg_15 = arg_13.append
        for arg_16 in arg_10:
            if arg_16['self_closing']:
                # Don't look for the end tag
                arg_17, arg_18 = arg_16.span()
                arg_5 = [arg_8 + arg_17, arg_8 + arg_18]
            else:
                # look for the end-tag
                if arg_1:
                    # the end_search is already available
                    # noinspection PyUnboundLocalVariable
                    arg_19 = arg_11(arg_12, arg_16.end())
                else:
                    # build end_search according to start tag name
                    arg_19 = search(
                        END_TAG_PATTERN.replace(
                            b'{name}', arg_16['name']),
                        arg_12)
                if arg_19:
                    arg_17, arg_18 = arg_19.span()
                    arg_12[arg_17:arg_18] = b'_' * (arg_18 - arg_17)
                    arg_5 = [arg_8 + arg_16.start(), arg_8 + arg_18]
                else:
                    # Assume start-only tag.
                    arg_17, arg_18 = arg_16.span()
                    arg_5 = [arg_8 + arg_17, arg_8 + arg_18]
            arg_20 = arg_14((arg_5[0], arg_5[1]))
            if arg_20 is None:
                arg_15(arg_5)
            else:
                arg_5 = arg_20
            arg_7(Tag(arg_2, arg_3, arg_5, 'Tag'))
        return sorted(Func, key=attrgetter('_span'))


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . read ( ) arg_3 = Operators . ITEBV ( arg_2 . size , Operators . UGT ( arg_3 , 63 ) , 64 , arg_3 ) arg_3 = Operators . EXTRACT ( arg_3 , 0 , 64 ) if arg_1 . size == 64 : arg_1 . write ( arg_1 . read ( ) >> arg_3 ) else : arg_4 = Operators . EXTRACT ( arg_1 . read ( ) , 64 , 64 ) >> arg_3 arg_5 = Operators . EXTRACT ( arg_1 . read ( ) , 0 , 64 ) >> arg_3 arg_1 . write ( Operators . CONCAT ( 128 , arg_4 , arg_5 ) )

def Func(arg_0, arg_1, arg_2):
        """Shift Packed Data Right Logical

        Shifts the bits in the individual quadword in the destination operand to the right by
        the number of bits specified in the count operand . As the bits in the data elements
        are shifted right, the empty high-order bits are cleared (set to 0). If the value
        specified by the count operand is greater than  63, then the destination operand is set
        to all 0s.

        if(OperandSize == 64) {
                        //Func instruction with 64-bit operand:
                        if(Count > 63) Destination[64..0] = 0;
                        else Destination = ZeroExtend(Destination >> Count);
                }
                else {
                        //Func instruction with 128-bit operand:
                        if(Count > 15) Destination[128..0] = 0;
                        else {
                                Destination[0..63] = ZeroExtend(Destination[0..63] >> Count);
                                Destination[64..127] = ZeroExtend(Destination[64..127] >> Count);
                        }
                }
        """

        arg_3 = arg_2.read()
        arg_3 = Operators.ITEBV(arg_2.size, Operators.UGT(arg_3, 63), 64, arg_3)
        arg_3 = Operators.EXTRACT(arg_3, 0, 64)
        if arg_1.size == 64:
            arg_1.write(arg_1.read() >> arg_3)
        else:
            arg_4 = Operators.EXTRACT(arg_1.read(), 64, 64) >> arg_3
            arg_5 = Operators.EXTRACT(arg_1.read(), 0, 64) >> arg_3
            arg_1.write(Operators.CONCAT(128, arg_4, arg_5))

Shift Packed Data Right Logical

        Shifts the bits in the individual quadword in the destination operand to the right by
        the number of bits specified in the count operand . As the bits in the data elements
        are shifted right, the empty high-order bits are cleared (set to 0). If the value
        specified by the count operand is greater than  63, then the destination operand is set
        to all 0s.

        if(OperandSize == 64) {
                        //PSRLQ instruction with 64-bit operand:
                        if(Count > 63) Destination[64..0] = 0;
                        else Destination = ZeroExtend(Destination >> Count);
                }
                else {
                        //PSRLQ instruction with 128-bit operand:
                        if(Count > 15) Destination[128..0] = 0;
                        else {
                                Destination[0..63] = ZeroExtend(Destination[0..63] >> Count);
                                Destination[64..127] = ZeroExtend(Destination[64..127] >> Count);
                        }
                }


def Func(arg_0):
    """Decorator for making functions appear as Funcly defined.

    This results in the function being linked to the user_ns as globals()
    instead of the module globals().
    """
    # build new FunctionType, so it can have the right globals
    # Func functions never have closures, that's kind of the point
    if isinstance(arg_0, FunctionType):
        arg_1 = __import__('__main__')
        arg_0 = FunctionType(arg_0.__code__, arg_1.__dict__,
                         arg_0.__name__, arg_0.__defaults__,
                         )
    # associate with __main__ for uncanning
    arg_0.__module__ = '__main__'
    return arg_0

Decorator for making functions appear as interactively defined.

    This results in the function being linked to the user_ns as globals()
    instead of the module globals().

Decorator for making functions appear as interactively defined .


def Func(arg_0, arg_1, arg_2):
        # type: (Bundle, int) -> None
        """
        Signs the inputs starting at the specified index.

        :param bundle:
            The bundle that contains the input transactions to sign.

        :param start_index:
            The index of the first input transaction.

            If necessary, the resulting signature will be split across
            subsequent transactions automatically.
        """

        if not arg_1.hash:
            raise with_context(
                exc=ValueError('Cannot sign inputs without a bundle hash!'),

                context={
                    'bundle': arg_1,
                    'key_index': arg_0.key_index,
                    'start_index': arg_2,
                },
            )

        from iota.crypto.signing import SignatureFragmentGenerator
        arg_3 = (
            SignatureFragmentGenerator(arg_0, arg_1.hash)
        )

        # We can only fit one signature fragment into each transaction,
        # so we have to split the entire signature.
        for arg_4 in range(arg_0.security_level):
            # Do lots of validation before we attempt to sign the
            # transaction, and attach lots of context info to any
            # exception.
            #
            # This method is likely to be invoked at a very low level in
            # the application, so if anything goes wrong, we want to
            # make sure it's as easy to troubleshoot as possible!
            try:
                arg_5 = arg_1[arg_2 + arg_4]
            except IndexError as e:
                raise with_context(
                    exc=e,

                    context={
                        'bundle': arg_1,
                        'key_index': arg_0.key_index,
                        'current_index': arg_2 + arg_4,
                    },
                )

            # Only inputs can be signed.
            if arg_5.value > 0:
                raise with_context(
                    exc=ValueError(
                        'Attempting to sign non-input transaction #{i} '
                        '(value={value}).'.format(
                            i=arg_5.current_index,
                            value=arg_5.value,
                        ),
                    ),

                    context={
                        'bundle': arg_1,
                        'key_index': arg_0.key_index,
                        'start_index': arg_2,
                    },
                )

            if arg_5.signature_message_fragment:
                raise with_context(
                    exc=ValueError(
                        'Attempting to sign input transaction #{i}, '
                        'but it has a non-empty fragment '
                        '(is it already signed?).'.format(
                            i=arg_5.current_index,
                        ),
                    ),

                    context={
                        'bundle': arg_1,
                        'key_index': arg_0.key_index,
                        'start_index': arg_2,
                    },
                )

            arg_5.signature_message_fragment = next(arg_3)

Signs the inputs starting at the specified index .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , bytes ) : arg_1 = [ bytes ( [ c ] ) for c in arg_1 ] for arg_2 in sorted ( arg_0 . maps ) : for arg_3 in arg_2 : if arg_3 + len ( arg_1 ) >= arg_2 . end : break arg_4 = arg_2 [ arg_3 : arg_3 + len ( arg_1 ) ] if issymbolic ( arg_4 [ 0 ] ) : break if arg_4 == arg_1 : yield arg_3

def Func(arg_0, arg_1):
        """
        Scan for concrete bytes in all mapped memory. Successively yield addresses of all matches.

        :param bytes data_to_find: String to locate
        :return:
        """

        # TODO: for the moment we just treat symbolic bytes as bytes that don't match.
        # for our simple test cases right now, the bytes we're interested in scanning
        # for will all just be there concretely
        # TODO: Can probably do something smarter here like Boyer-Moore, but unnecessary
        # if we're looking for short strings.

        # Querying mem with an index returns [bytes]
        if isinstance(arg_1, bytes):
            arg_1 = [bytes([c]) for c in arg_1]

        for arg_2 in sorted(arg_0.maps):
            for arg_3 in arg_2:
                if arg_3 + len(arg_1) >= arg_2.end:
                    break

                arg_4 = arg_2[arg_3:arg_3 + len(arg_1)]

                # TODO: treat symbolic bytes as bytes that don't match. for our simple tests right now, the
                # bytes will be there concretely
                if issymbolic(arg_4[0]):
                    break

                if arg_4 == arg_1:
                    yield arg_3

Scan for concrete bytes in all mapped memory . Successively yield addresses of all matches .


def Func(arg_0):
    """Load a constraint satisfaction problem from a .cnf file.

    Args:
        fp (file, optional):
            `.write()`-supporting `file object`_ DIMACS CNF formatted_ file.

    Returns:
        :obj:`.ConstraintSatisfactionProblem` a binary-valued SAT problem.

    Examples:

        >>> import dwavebinarycsp as dbcsp
        ...
        >>> with open('test.cnf', 'r') as fp: # doctest: +SKIP
        ...     csp = dbcsp.cnf.Func(fp)

    .. _file object: https://docs.python.org/3/glossary.html#term-file-object

    .. _formatted: http://www.satcompetition.org/2009/format-benchmarks2009.html

    """

    arg_0 = iter(arg_0)  # handle lists/tuples/etc

    arg_1 = ConstraintSatisfactionProblem(dimod.BINARY)

    # first look for the problem
    arg_2 = arg_8 = 0
    arg_3 = re.compile(_PROBLEM_REGEX)
    for arg_4 in arg_0:
        arg_5 = arg_3.findall(arg_4)
        if arg_5:
            if len(arg_5) > 1:
                raise ValueError
            arg_6, arg_7 = arg_5[0]
            arg_8, arg_2 = int(arg_6), int(arg_7)
            break

    # now parse the clauses, picking up where we left off looking for the header
    arg_9 = re.compile(_CLAUSE_REGEX)
    for arg_4 in arg_0:
        if arg_9.match(arg_4) is not None:
            arg_10 = [int(arg_13) for arg_13 in arg_4.split(' ')[:-1]]  # line ends with a trailing 0

            # -1 is the notation for NOT(1)
            arg_11 = [abs(arg_13) for arg_13 in arg_10]

            arg_12 = _cnf_or(arg_10)

            arg_1.add_constraint(arg_12, arg_11)

    for arg_13 in range(1, arg_8+1):
        arg_1.add_variable(arg_13)
    for arg_13 in arg_1.variables:
        if arg_13 > arg_8:
            arg_14 = ("given .cnf file's header defines variables [1, {}] and {} clauses "
                   "but constraints a reference to variable {}").format(arg_8, arg_2, arg_13)
            raise ValueError(arg_14)

    if len(arg_1) != arg_2:
        arg_14 = ("given .cnf file's header defines {} "
               "clauses but the file contains {}").format(arg_2, len(arg_1))
        raise ValueError(arg_14)

    return arg_1

Load a constraint satisfaction problem from a .cnf file.

    Args:
        fp (file, optional):
            `.write()`-supporting `file object`_ DIMACS CNF formatted_ file.

    Returns:
        :obj:`.ConstraintSatisfactionProblem` a binary-valued SAT problem.

    Examples:

        >>> import dwavebinarycsp as dbcsp
        ...
        >>> with open('test.cnf', 'r') as fp: # doctest: +SKIP
        ...     csp = dbcsp.cnf.load_cnf(fp)

    .. _file object: https://docs.python.org/3/glossary.html#term-file-object

    .. _formatted: http://www.satcompetition.org/2009/format-benchmarks2009.html

Load a constraint satisfaction problem from a . cnf file .


def Func ( arg_0 ) : util . valid_audio ( arg_0 , mono = False ) if arg_0 . ndim > 1 : arg_0 = np . mean ( arg_0 , axis = 0 ) return arg_0

def Func(arg_0):
    '''Force an audio signal down to mono.

    Parameters
    ----------
    y : np.ndarray [shape=(2,n) or shape=(n,)]
        audio time series, either stereo or mono

    Returns
    -------
    y_mono : np.ndarray [shape=(n,)]
        `y` as a monophonic time-series

    Notes
    -----
    This function caches at level 20.

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), mono=False)
    >>> y.shape
    (2, 1355168)
    >>> y_mono = librosa.Func(y)
    >>> y_mono.shape
    (1355168,)

    '''

    # Validate the buffer.  Stereo is ok here.
    util.valid_audio(arg_0, mono=False)

    if arg_0.ndim > 1:
        arg_0 = np.mean(arg_0, axis=0)

    return arg_0

Force an audio signal down to mono.

    Parameters
    ----------
    y : np.ndarray [shape=(2,n) or shape=(n,)]
        audio time series, either stereo or mono

    Returns
    -------
    y_mono : np.ndarray [shape=(n,)]
        `y` as a monophonic time-series

    Notes
    -----
    This function caches at level 20.

    Examples
    --------
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), mono=False)
    >>> y.shape
    (2, 1355168)
    >>> y_mono = librosa.to_mono(y)
    >>> y_mono.shape
    (1355168,)


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = sys . argv [ 1 : ] from getopt import getopt arg_1 = "hdi" arg_2 = ( "help" , "duplicates=" , "ignore-comments" , "ignore-imports" , "ignore-docstrings" , ) arg_3 = 4 arg_4 = False arg_5 = False arg_6 = False arg_7 , arg_8 = getopt ( arg_0 , arg_1 , arg_2 ) for arg_9 , arg_10 in arg_7 : if arg_9 in ( "-d" , "--duplicates" ) : arg_3 = int ( arg_10 ) elif arg_9 in ( "-h" , "--help" ) : usage ( ) elif arg_9 in ( "-i" , "--ignore-comments" ) : arg_4 = True elif arg_9 in ( "--ignore-docstrings" , ) : arg_5 = True elif arg_9 in ( "--ignore-imports" , ) : arg_6 = True if not arg_8 : usage ( 1 ) arg_11 = Similar ( arg_3 , arg_4 , arg_5 , arg_6 ) for arg_12 in arg_8 : with open ( arg_12 ) as stream : arg_11 . append_stream ( arg_12 , stream ) arg_11 . run ( ) sys . exit ( 0 )

def Func(arg_0=None):
    """standalone command line access point"""
    if arg_0 is None:
        arg_0 = sys.argv[1:]
    from getopt import getopt

    arg_1 = "hdi"
    arg_2 = (
        "help",
        "duplicates=",
        "ignore-comments",
        "ignore-imports",
        "ignore-docstrings",
    )
    arg_3 = 4
    arg_4 = False
    arg_5 = False
    arg_6 = False
    arg_7, arg_8 = getopt(arg_0, arg_1, arg_2)
    for arg_9, arg_10 in arg_7:
        if arg_9 in ("-d", "--duplicates"):
            arg_3 = int(arg_10)
        elif arg_9 in ("-h", "--help"):
            usage()
        elif arg_9 in ("-i", "--ignore-comments"):
            arg_4 = True
        elif arg_9 in ("--ignore-docstrings",):
            arg_5 = True
        elif arg_9 in ("--ignore-imports",):
            arg_6 = True
    if not arg_8:
        usage(1)
    arg_11 = Similar(arg_3, arg_4, arg_5, arg_6)
    for arg_12 in arg_8:
        with open(arg_12) as stream:
            arg_11.append_stream(arg_12, stream)
    arg_11.run()
    sys.exit(0)


def Func ( ) : arg_0 = pkgrs . resource_filename ( 'latools' , 'latools.cfg' ) arg_1 = configparser . ConfigParser ( ) arg_1 . read ( arg_0 ) return arg_0 , arg_1

def Func():
    """
    Reads configuration, returns a ConfigParser object.

    Distinct from read_configuration, which returns a dict.
    """
    arg_0 = pkgrs.resource_filename('latools', 'latools.cfg')
    arg_1 = configparser.ConfigParser()
    arg_1.read(arg_0)
    return arg_0, arg_1

Reads configuration returns a ConfigParser object .


return sum([count for count in exit_counts.values() if count > 1])

def Func ( arg_0 ) : arg_1 = arg_0 . parser . exit_counts ( ) return sum ( [ arg_2 for arg_2 in arg_1 . values ( ) if arg_2 > 1 ] )

def Func(arg_0):
        """How many total branches are there?"""
        arg_1 = arg_0.parser.exit_counts()
        return sum([arg_2 for arg_2 in arg_1.values() if arg_2 > 1])


(self,
                                         get_group_conversation_url_request)

async def Func ( arg_0 , arg_1 ) : arg_2 = hangouts_pb2 . GetGroupConversationUrlResponse ( ) await arg_0 . _pb_request ( 'conversations/getgroupconversationurl' , arg_1 , arg_2 ) return arg_2

async def Func(arg_0,
                                         arg_1):
        """Get URL to allow others to join a group conversation."""
        arg_2 = hangouts_pb2.GetGroupConversationUrlResponse()
        await arg_0._pb_request('conversations/getgroupconversationurl',
                               arg_1,
                               arg_2)
        return arg_2

Get URL to allow others to join a group conversation .


def Func ( arg_0 ) : arg_0 . pids = [ ] for arg_2 in arg_0 . pid_fetchers : arg_3 = arg_2 ( None , arg_0 . revisions [ - 1 ] [ 1 ] ) if arg_3 : arg_0 . pids . append ( arg_3 )

def Func(arg_0):
        """Prepare persistent identifiers."""
        arg_0.pids = []
        for arg_2 in arg_0.pid_fetchers:
            arg_3 = arg_2(None, arg_0.revisions[-1][1])
            if arg_3:
                arg_0.pids.append(arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . ishape . intersection ( [ arg_0 . ishape , arg_1 ] ) return arg_2 . translate ( - arg_0 . pad )

def Func(arg_0, arg_1):
    """
    Translates a tile in the padded image to the unpadded image.

    Given a state and a tile that corresponds to the padded image, returns
    a tile that corresponds to the the corresponding pixels of the difference
    image

    Parameters
    ----------
        st : :class:`peri.states.State`
            The state
        padded_tile : :class:`peri.util.Tile`
            The tile in the padded image.

    Returns
    -------
        :class:`peri.util.Tile`
            The tile corresponding to padded_tile in the unpadded image.
    """
    arg_2 = arg_0.ishape.intersection([arg_0.ishape, arg_1])
    return arg_2.translate(-arg_0.pad)

Translates a tile in the padded image to the unpadded image .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Transform a QuantumChannel to the SuperOp representation."""
    if arg_0 == 'SuperOp':
        return arg_1
    if arg_0 == 'Operator':
        return _from_operator('SuperOp', arg_1, arg_2, arg_3)
    if arg_0 == 'Choi':
        return _choiFunc(arg_1, arg_2, arg_3)
    if arg_0 == 'Kraus':
        return _krausFunc(arg_1, arg_2, arg_3)
    if arg_0 == 'Chi':
        arg_1 = _chi_to_choi(arg_1, arg_2, arg_3)
        return _choiFunc(arg_1, arg_2, arg_3)
    if arg_0 == 'PTM':
        return _ptmFunc(arg_1, arg_2, arg_3)
    if arg_0 == 'Stinespring':
        return _stinespringFunc(arg_1, arg_2, arg_3)
    raise QiskitError('Invalid QuantumChannel {}'.format(arg_0))

Transform a QuantumChannel to the SuperOp representation .


def Func(arg_0, arg_1, arg_2=None):
        """
        Return the number of nodes that match the pattern.

        :param pattern:

        :param adict:
        :return: int
        """
        arg_3 = arg_0._filetree if arg_2 is None else arg_2

        arg_4 = 0
        if isinstance(arg_3, dict):
            arg_5 = arg_3.keys()
            arg_4 += len(filter_list(arg_5, arg_1))
            for arg_6 in arg_5:
                arg_4 += arg_0.Func(arg_1, arg_3[arg_6])
        else:
            arg_4 = len(filter_list(arg_3, arg_1))

        return arg_4

Return the number of nodes that match the pattern .


(self, sleep_for_rate=False, min_rate_to_sleep=MIN_RATE_LIMIT,
                                 rate_limit_header=RATE_LIMIT_HEADER,
                                 rate_limit_reset_header=RATE_LIMIT_RESET_HEADER)

def Func(arg_0, arg_1=False, arg_2=arg_3,
                                 arg_4=arg_5,
                                 arg_6=arg_7):
        """Setup the rate limit handler.

        :param sleep_for_rate: sleep until rate limit is reset
        :param min_rate_to_sleep: minimun rate needed to make the fecthing process sleep
        :param rate_limit_header: header from where extract the rate limit data
        :param rate_limit_reset_header: header from where extract the rate limit reset data
        """
        arg_0.rate_limit = None
        arg_0.rate_limit_reset_ts = None
        arg_0.sleep_for_rate = arg_1
        arg_0.rate_limit_header = arg_4
        arg_0.rate_limit_reset_header = arg_6

        if arg_2 > arg_0.MAX_RATE_LIMIT:
            arg_10 = "Minimum rate to sleep value exceeded (%d)."
            arg_10 += "High values might cause the client to sleep forever."
            arg_10 += "Reset to %d."
            arg_0.min_rate_to_sleep = arg_0.MAX_RATE_LIMIT
            logger.warning(arg_10, arg_2, arg_0.MAX_RATE_LIMIT)
        else:
            arg_0.min_rate_to_sleep = arg_2


def
Func
(
)
:
from
airflow
import
models
from
alembic
.
migration
import
MigrationContext
log
.
info
(
"Dropping tables that exist"
)
models
.
base
.
Base
.
metadata
.
drop_all
(
settings
.
engine
)
arg_0
=
MigrationContext
.
configure
(
settings
.
engine
)
if
arg_0
.
_version
.
exists
(
settings
.
engine
)
:
arg_0
.
_version
.
drop
(
settings
.
engine
)
from
flask_appbuilder
.
models
.
sqla
import
Base
Base
.
metadata
.
drop_all
(
settings
.
engine
)
initdb
(
)

def Func():
    """
    Clear out the database
    """
    from airflow import models

    # alembic adds significant import time, so we import it lazily
    from alembic.migration import MigrationContext

    log.info("Dropping tables that exist")

    models.base.Base.metadata.drop_all(settings.engine)
    arg_0 = MigrationContext.configure(settings.engine)
    if arg_0._version.exists(settings.engine):
        arg_0._version.drop(settings.engine)

    from flask_appbuilder.models.sqla import Base
    Base.metadata.drop_all(settings.engine)

    initdb()


(struct=None, protein='protein',
             top='system.top',  dirname='top',
             posres="posres.itp",
             ff="oplsaa", water="tip4p",
             **pdb2gmx_args)

return { \
            'top': realpath(dirname, top), \
            'struct': realpath(dirname, new_struct), \
            'posres' : realpath(dirname, posres) }

def Func(arg_0=None, arg_1='protein',
             arg_2='system.top',  arg_3='top',
             arg_4="posres.itp",
             arg_5="oplsaa", arg_6="tip4p",
             **arg_7):
    """Build Gromacs Func files from pdb.

    :Keywords:
       *struct*
           input structure (**required**)
       *protein*
           name of the output files
       *top*
           name of the Func file
       *dirname*
           directory in which the new Func will be stored
       *ff*
           force field (string understood by ``pdb2gmx``); default
           "oplsaa"
       *water*
           water model (string), default "tip4p"
       *pdb2gmxargs*
           other arguments for ``pdb2gmx``

    .. note::
       At the moment this function simply runs ``pdb2gmx`` and uses
       the resulting Func file directly. If you want to create
       more complicated topologies and maybe also use additional itp
       files or make a protein itp file then you will have to do this
       manually.
    """

    arg_8 = realpath(arg_0)

    arg_9 = arg_1 + '.pdb'
    if arg_4 is None:
        arg_4 = arg_1 + '_posres.itp'

    arg_7.update({'f': arg_8, 'o': arg_9, 'p': arg_2, 'i': arg_4,
                         'ff': arg_5, 'water': arg_6})

    with in_dir(arg_3):
        logger.info("[{dirname!s}] Building Func {top!r} from struct = {struct!r}".format(**vars()))
        # perhaps parse output from pdb2gmx 4.5.x to get the names of the chain itp files?
        gromacs.pdb2gmx(**arg_7)
    return { \
            'top': realpath(arg_3, arg_2), \
            'struct': realpath(arg_3, arg_9), \
            'posres' : realpath(arg_3, arg_4) }

Build Gromacs topology files from pdb.

    :Keywords:
       *struct*
           input structure (**required**)
       *protein*
           name of the output files
       *top*
           name of the topology file
       *dirname*
           directory in which the new topology will be stored
       *ff*
           force field (string understood by ``pdb2gmx``); default
           "oplsaa"
       *water*
           water model (string), default "tip4p"
       *pdb2gmxargs*
           other arguments for ``pdb2gmx``

    .. note::
       At the moment this function simply runs ``pdb2gmx`` and uses
       the resulting topology file directly. If you want to create
       more complicated topologies and maybe also use additional itp
       files or make a protein itp file then you will have to do this
       manually.


def Func ( arg_0 , arg_1 ) : if ( arg_1 not in arg_0 . _sections and arg_1 not in arg_0 . airflow_defaults . _sections ) : return None arg_2 = copy . deepcopy ( arg_0 . airflow_defaults . _sections [ arg_1 ] ) if arg_1 in arg_0 . _sections : arg_2 . update ( copy . deepcopy ( arg_0 . _sections [ arg_1 ] ) ) arg_3 = 'AIRFLOW__{S}__' . format ( S = arg_1 . upper ( ) ) for arg_4 in sorted ( os . environ . keys ( ) ) : if arg_4 . startswith ( arg_3 ) : arg_5 = arg_4 . replace ( arg_3 , '' ) . lower ( ) arg_2 [ arg_5 ] = arg_0 . _get_env_var_option ( arg_1 , arg_5 ) for arg_5 , arg_6 in iteritems ( arg_2 ) : try : arg_6 = int ( arg_6 ) except ValueError : try : arg_6 = float ( arg_6 ) except ValueError : if arg_6 . lower ( ) in ( 't' , 'true' ) : arg_6 = True elif arg_6 . lower ( ) in ( 'f' , 'false' ) : arg_6 = False arg_2 [ arg_5 ] = arg_6 return arg_2

def Func(arg_0, arg_1):
        """
        Returns the section as a dict. Values are converted to int, float, bool
        as required.

        :param section: section from the config
        :rtype: dict
        """
        if (arg_1 not in arg_0._sections and
                arg_1 not in arg_0.airflow_defaults._sections):
            return None

        arg_2 = copy.deepcopy(arg_0.airflow_defaults._sections[arg_1])

        if arg_1 in arg_0._sections:
            arg_2.update(copy.deepcopy(arg_0._sections[arg_1]))

        arg_3 = 'AIRFLOW__{S}__'.format(S=arg_1.upper())
        for arg_4 in sorted(os.environ.keys()):
            if arg_4.startswith(arg_3):
                arg_5 = arg_4.replace(arg_3, '').lower()
                arg_2[arg_5] = arg_0._get_env_var_option(arg_1, arg_5)

        for arg_5, arg_6 in iteritems(arg_2):
            try:
                arg_6 = int(arg_6)
            except ValueError:
                try:
                    arg_6 = float(arg_6)
                except ValueError:
                    if arg_6.lower() in ('t', 'true'):
                        arg_6 = True
                    elif arg_6.lower() in ('f', 'false'):
                        arg_6 = False
            arg_2[arg_5] = arg_6
        return arg_2

Returns the section as a dict . Values are converted to int float bool as required .