(source, outname, settings, options=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """Video processor.

    :param source: path to a video
    :param outname: path to the generated video
    :param settings: settings dict
    :param options: array of options passed to ffmpeg

    """
    arg_4 = logging.getLogger(__name__)

    # Don't transcode if source is in the required format and
    # has fitting datedimensions, copy instead.
    arg_5 = arg_2['video_converter']
    arg_6, arg_7 = video_size(arg_0, arg_5=arg_5)
    arg_8, arg_9 = arg_2['video_size']
    arg_4.debug('Video size: %i, %i -> %i, %i', arg_6, arg_7, arg_8, arg_9)

    arg_10, arg_11 = splitext(arg_0)
    arg_10, arg_12 = splitext(arg_1)
    if arg_12 == arg_11 and arg_6 <= arg_8 and arg_7 <= arg_9:
        arg_4.debug('Video is smaller than the max size, copying it instead')
        shutil.copy(arg_0, arg_1)
        return

    # http://stackoverflow.com/questions/8218363/maintaining-ffmpeg-aspect-ratio
    # + I made a drawing on paper to figure this out
    if arg_9 * arg_6 < arg_7 * arg_8:
        # biggest fitting dimension is height
        arg_13 = ['-vf', "scale=trunc(oh*a/2)*2:%i" % arg_9]
    else:
        # biggest fitting dimension is width
        arg_13 = ['-vf', "scale=%i:trunc(ow/a/2)*2" % arg_8]

    # do not resize if input dimensions are smaller than output dimensions
    if arg_6 <= arg_8 and arg_7 <= arg_9:
        arg_13 = []

    # Encoding options improved, thanks to
    # http://ffmpeg.org/trac/ffmpeg/wiki/vpxEncodingGuide
    arg_14 = [arg_5, '-i', arg_0, '-y']  # -y to overwrite output files
    if arg_3 is not None:
        arg_14 += arg_3
    arg_14 += arg_13 + [arg_1]

    arg_4.debug('Processing video: %s', ' '.join(arg_14))
    check_subprocess(arg_14, arg_0, arg_1)


def Func ( arg_0 , arg_1 , * arg_2 ) : arg_3 = curses . tigetstr ( arg_1 ) if arg_3 is None : return b'' else : return curses . tparm ( arg_3 , * arg_2 )

def Func(arg_0, arg_1, *arg_2):
        """Return the escape sequence for the selected Control Sequence."""
        arg_3 = curses.tigetstr(arg_1)
        if arg_3 is None:
            return b''
        else:
            return curses.tparm(arg_3, *arg_2)

Return the escape sequence for the selected Control Sequence .


return self._get_resource_url(full_url, auto_page, data_key)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Canvas GET method. Return representation of the requested paged
        resource, either the requested page, or chase pagination links to
        coalesce resources.
        """
        if not arg_2:
            arg_2 = {}

        arg_0._set_as_user(arg_2)

        arg_4 = not ('page' in arg_2 or 'per_page' in arg_2)

        if 'per_page' not in arg_2 and arg_0._per_page != DEFAULT_PAGINATION:
            arg_2["per_page"] = arg_0._per_page

        arg_5 = arg_1 + arg_0._params(arg_2)
        return arg_0._get_resource_url(arg_5, arg_4, arg_3)

Canvas GET method . Return representation of the requested paged resource either the requested page or chase pagination links to coalesce resources .


def Func(arg_0,arg_1,arg_2,arg_3,arg_4,arg_5='H'):
    """
    Cruise control with PI controller and hill disturbance.

    This function returns various system function configurations
    for a the cruise control Case Study example found in
    the supplementary article. The plant model is obtained by the
    linearizing the equations of motion and the controller contains a
    proportional and integral gain term set via the closed-loop parameters
    natuarl frequency wn (rad/s) and damping zeta.

    Parameters
    ----------
    wn : closed-loop natural frequency in rad/s, nominally 0.1
    zeta : closed-loop damping factor, nominally 1.0
    T : vehicle time constant, nominally 10 s
    vcruise : cruise velocity set point, nominally 75 mph
    vmax : maximum vehicle velocity, nominally 120 mph
    tf_mode : 'H', 'HE', 'HVW', or 'HED' controls the system function returned by the function
    'H'   : closed-loop system function V(s)/R(s)
    'HE'  : closed-loop system function E(s)/R(s)
    'HVW' : closed-loop system function V(s)/W(s)
    'HED' : closed-loop system function E(s)/D(s), where D is the hill disturbance input

    Returns
    -------
    b : numerator coefficient ndarray
    a : denominator coefficient ndarray

    Examples
    --------
    >>> # return the closed-loop system function output/input velocity
    >>> b,a = Func(wn,zeta,T,vcruise,vmax,tf_mode='H')
    >>> # return the closed-loop system function loop error/hill disturbance
    >>> b,a = Func(wn,zeta,T,vcruise,vmax,tf_mode='HED')
    """
    arg_6 = arg_2/2.*arg_4/arg_3
    arg_7 = 9.8
    arg_7 *= 3*60**2/5280. # m/s to mph conversion
    arg_8 = arg_2*(2*arg_1*arg_0-1/arg_6)/arg_4
    arg_9 = arg_2*arg_0**2./arg_4
    arg_10 = arg_8*arg_4/arg_2
    print('wn = ', np.sqrt(arg_10/(arg_8/arg_9)))
    print('zeta = ', (arg_10 + 1/arg_6)/(2*arg_0))
    arg_11 = np.array([1, 2*arg_1*arg_0, arg_0**2])
    if arg_5 == 'H':
        arg_12 = np.array([arg_10, arg_0**2])
    elif arg_5 == 'HE':
        arg_12 = np.array([1, 2*arg_1*arg_0-arg_10, 0.])
    elif arg_5 == 'HVW':
        arg_12 = np.array([ 1, arg_0**2/arg_10+1/arg_6, arg_0**2/(arg_10*arg_6)])
        arg_12 *= arg_8
    elif arg_5 == 'HED':
        arg_12 = np.array([arg_7, 0])
    else:
        raise ValueError('tf_mode must be: H, HE, HVU, or HED')
    return arg_12, arg_11

Cruise control with PI controller and hill disturbance.

    This function returns various system function configurations
    for a the cruise control Case Study example found in
    the supplementary article. The plant model is obtained by the
    linearizing the equations of motion and the controller contains a
    proportional and integral gain term set via the closed-loop parameters
    natuarl frequency wn (rad/s) and damping zeta.

    Parameters
    ----------
    wn : closed-loop natural frequency in rad/s, nominally 0.1
    zeta : closed-loop damping factor, nominally 1.0
    T : vehicle time constant, nominally 10 s
    vcruise : cruise velocity set point, nominally 75 mph
    vmax : maximum vehicle velocity, nominally 120 mph
    tf_mode : 'H', 'HE', 'HVW', or 'HED' controls the system function returned by the function
    'H'   : closed-loop system function V(s)/R(s)
    'HE'  : closed-loop system function E(s)/R(s)
    'HVW' : closed-loop system function V(s)/W(s)
    'HED' : closed-loop system function E(s)/D(s), where D is the hill disturbance input

    Returns
    -------
    b : numerator coefficient ndarray
    a : denominator coefficient ndarray

    Examples
    --------
    >>> # return the closed-loop system function output/input velocity
    >>> b,a = cruise_control(wn,zeta,T,vcruise,vmax,tf_mode='H')
    >>> # return the closed-loop system function loop error/hill disturbance
    >>> b,a = cruise_control(wn,zeta,T,vcruise,vmax,tf_mode='HED')

Cruise control with PI controller and hill disturbance .


def Func ( arg_0 , arg_1 ) : arg_2 = zipimport . zipimporter ( arg_0 ) arg_2 . load_module ( "heron" ) arg_3 = arg_1 . split ( '.' ) [ 1 : - 1 ] arg_4 = [ 'heron' ] arg_5 = None for arg_6 in arg_3 : arg_7 = zipimport . zipimporter ( os . path . join ( arg_0 , '/' . join ( arg_4 ) ) ) arg_5 = arg_7 . load_module ( arg_6 ) arg_4 . append ( arg_6 ) return arg_5

def Func(arg_0, arg_1):
  """Resolves duplicate package suffix problems

  When dynamically loading a pex file and a corresponding python class (bolt/spout/topology),
  if the top level package in which to-be-loaded classes reside is named 'heron', the path conflicts
  with this Heron Instance pex package (heron.instance.src.python...), making the Python
  interpreter unable to find the target class in a given pex file.
  This function resolves this issue by individually loading packages with suffix `heron` to
  avoid this issue.

  However, if a dependent module/class that is not directly specified under ``class_path``
  and has conflicts with other native heron packages, there is a possibility that
  such a class/module might not be imported correctly. For example, if a given ``class_path`` was
  ``heron.common.src.module.Class``, but it has a dependent module (such as by import statement),
  ``heron.common.src.python.dep_module.DepClass`` for example, pex_loader does not guarantee that
  ``DepClass` is imported correctly. This is because ``heron.common.src.python.dep_module`` is not
  explicitly added to sys.path, while ``heron.common.src.python`` module exists as the native heron
  package, from which ``dep_module`` cannot be found, so Python interpreter may raise ImportError.

  The best way to avoid this issue is NOT to dynamically load a pex file whose top level package
  name is ``heron``. Note that this method is included because some of the example topologies and
  tests have to have a pex with its top level package name of ``heron``.
  """
  # import top-level package named `heron` of a given pex file
  arg_2 = zipimport.zipimporter(arg_0)
  arg_2.load_module("heron")

  # remove 'heron' and the classname
  arg_3 = arg_1.split('.')[1:-1]
  arg_4 = ['heron']
  arg_5 = None
  for arg_6 in arg_3:
    arg_7 = zipimport.zipimporter(os.path.join(arg_0, '/'.join(arg_4)))
    arg_5 = arg_7.load_module(arg_6)
    arg_4.append(arg_6)

  return arg_5


def
Func
(
arg_0
,
arg_1
=
'/'
)
:
arg_2
=
arg_0
.
get_node
(
arg_1
)
print
(
'Groups in:\n  %s\n'
%
arg_2
)
for
arg_3
in
arg_2
.
_f_walk_groups
(
)
:
if
arg_3
is
not
arg_2
:
print
(
'    %s'
%
arg_3
)
print
(
'\nLeaf-nodes in %s:'
%
arg_1
)
for
arg_3
in
arg_2
.
_v_leaves
.
itervalues
(
)
:
arg_4
=
arg_3
.
shape
if
len
(
arg_4
)
==
0
:
arg_4
=
arg_3
.
read
(
)
print
(
'\t%s, %s'
%
(
arg_3
.
name
,
arg_4
)
)
if
len
(
arg_3
.
title
)
>
0
:
print
(
'\t    %s'
%
arg_3
.
title
)

def Func(arg_0, arg_1='/'):
    """Print all the sub-groups in `group` and leaf-nodes children of `group`.

    Parameters:
        data_file (pytables HDF5 file object): the data file to print
        group (string): path name of the group to be printed.
            Default: '/', the root node.
    """
    arg_2 = arg_0.get_node(arg_1)
    print ('Groups in:\n  %s\n' % arg_2)

    for arg_3 in arg_2._f_walk_groups():
        if arg_3 is not arg_2:
            print ('    %s' % arg_3)

    print ('\nLeaf-nodes in %s:' % arg_1)
    for arg_3 in arg_2._v_leaves.itervalues():
        arg_4 = arg_3.shape
        if len(arg_4) == 0:
            arg_4 = arg_3.read()
        print ('\t%s, %s' % (arg_3.name, arg_4))
        if len(arg_3.title) > 0:
            print ('\t    %s' % arg_3.title)

Print all the sub - groups in group and leaf - nodes children of group .


Returns a cached textpath of the given text in queue.

def
Func
(
arg_0
,
arg_1
)
:
if
len
(
arg_0
.
_Funcs
)
==
arg_1
:
arg_0
.
_ctx
.
font
(
arg_0
.
font
,
arg_0
.
fontsize
)
arg_2
=
arg_0
.
q
[
arg_1
]
if
len
(
arg_0
.
q
)
>
1
:
arg_2
+=
" ("
+
str
(
arg_1
+
1
)
+
"/"
+
str
(
len
(
arg_0
.
q
)
)
+
")"
arg_3
=
arg_0
.
_ctx
.
Func
(
arg_2
,
0
,
0
,
width
=
arg_0
.
_w
)
arg_4
=
arg_0
.
_ctx
.
textheight
(
arg_2
,
width
=
arg_0
.
_w
)
arg_0
.
_Funcs
.
append
(
(
arg_3
,
arg_4
)
)
return
arg_0
.
_Funcs
[
arg_1
]

def Func(arg_0, arg_1):

        """ Returns a cached Func of the given text in queue.
        """

        if len(arg_0._Funcs) == arg_1:
            arg_0._ctx.font(arg_0.font, arg_0.fontsize)
            arg_2 = arg_0.q[arg_1]
            if len(arg_0.q) > 1:
                # Indicate current text (e.g. 5/13).
                arg_2 += " ("+str(arg_1+1)+"/" + str(len(arg_0.q))+")"
            arg_3 = arg_0._ctx.Func(arg_2, 0, 0, width=arg_0._w)
            arg_4 = arg_0._ctx.textheight(arg_2, width=arg_0._w)
            arg_0._Funcs.append((arg_3, arg_4))

        return arg_0._Funcs[arg_1]

Returns a cached textpath of the given text in queue .


def
Func
(
arg_0
,
arg_1
)
:
if
not
hasattr
(
arg_0
,
'__getitem__'
)
:
arg_2
=
"'%s' object can't be concatenated"
%
type
(
arg_0
)
.
__name__
raise
TypeError
(
arg_2
)
arg_0
+=
arg_1
return
arg_0

def Func(arg_0, arg_1):
    "Same as a += b, for a and b sequences."
    if not hasattr(arg_0, '__getitem__'):
        arg_2 = "'%s' object can't be concatenated" % type(arg_0).__name__
        raise TypeError(arg_2)
    arg_0 += arg_1
    return arg_0


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , ( list , tuple ) ) : arg_2 = arg_1 else : arg_2 = arg_0 . dict_to_row ( arg_1 ) arg_0 . writer . Func ( arg_2 )

def Func(arg_0, arg_1):
        """
        Writes a single observation to the output file.

        If the ``observation_data`` parameter is a dictionary, it is
        converted to a list to keep a consisted field order (as described
        in format specification). Otherwise it is assumed that the data
        is a raw record ready to be written to file.

        :param observation_data: a single observation as a dictionary or list
        """
        if isinstance(arg_1, (list, tuple)):
            arg_2 = arg_1
        else:
            arg_2 = arg_0.dict_to_row(arg_1)
        arg_0.writer.Func(arg_2)

Writes a single observation to the output file .


def Func ( arg_0 , arg_1 ) : if arg_0 . _shots <= 1 : arg_0 . _sample_measure = False return if hasattr ( arg_1 . config , 'allows_measure_sampling' ) : arg_0 . _sample_measure = arg_1 . config . allows_measure_sampling else : arg_3 = False for arg_4 in arg_1 . instructions : if arg_4 . name == "reset" : arg_0 . _sample_measure = False return if arg_3 : if arg_4 . name not in [ "measure" , "barrier" , "id" , "u0" ] : arg_0 . _sample_measure = False return elif arg_4 . name == "measure" : arg_3 = True arg_0 . _sample_measure = True

def Func(arg_0, arg_1):
        """Determine if measure sampling is allowed for an experiment

        Args:
            experiment (QobjExperiment): a qobj experiment.
        """
        # If shots=1 we should disable measure sampling.
        # This is also required for statevector simulator to return the
        # correct final statevector without silently dropping final measurements.
        if arg_0._shots <= 1:
            arg_0._sample_measure = False
            return

        # Check for config flag
        if hasattr(arg_1.config, 'allows_measure_sampling'):
            arg_0._sample_measure = arg_1.config.allows_measure_sampling
        # If flag isn't found do a simple test to see if a circuit contains
        # no reset instructions, and no gates instructions after
        # the first measure.
        else:
            arg_3 = False
            for arg_4 in arg_1.instructions:
                # If circuit contains reset operations we cannot sample
                if arg_4.name == "reset":
                    arg_0._sample_measure = False
                    return
                # If circuit contains a measure option then we can
                # sample only if all following operations are measures
                if arg_3:
                    # If we find a non-measure instruction
                    # we cannot do measure sampling
                    if arg_4.name not in ["measure", "barrier", "id", "u0"]:
                        arg_0._sample_measure = False
                        return
                elif arg_4.name == "measure":
                    arg_3 = True
            # If we made it to the end of the circuit without returning
            # measure sampling is allowed
            arg_0._sample_measure = True


def Func(arg_0, arg_1, *arg_2):
    """Assign to a nested dictionary.

    :param dict data: Dictionary to mutate
    :param value: Value to set
    :param list *keys: List of nested keys

    >>> data = {}
    >>> Func(data, 'hi', 'k0', 'k1', 'k2')
    >>> data
    {'k0': {'k1': {'k2': 'hi'}}}

    """
    if len(arg_2) == 1:
        arg_0[arg_2[0]] = arg_1
    else:
        if arg_2[0] not in arg_0:
            arg_0[arg_2[0]] = {}
        Func(arg_0[arg_2[0]], arg_1, *arg_2[1:])

Assign to a nested dictionary.

    :param dict data: Dictionary to mutate
    :param value: Value to set
    :param list *keys: List of nested keys

    >>> data = {}
    >>> set_nested(data, 'hi', 'k0', 'k1', 'k2')
    >>> data
    {'k0': {'k1': {'k2': 'hi'}}}


def Func(arg_0, arg_1, arg_2):
        """Define delay adjustment policy"""
        if arg_2.status in arg_0.retry_http_codes:
            arg_3 = max(arg_1.delay, 1) * 4
            arg_3 = max(arg_3, arg_0.mindelay)
            arg_3 = min(arg_3, arg_0.maxdelay)
            arg_1.delay = arg_3
            arg_0.stats.inc_value('delay_count')
        elif arg_2.status == 200:
            arg_3 = max(arg_1.delay / 2, arg_0.mindelay)
            if arg_3 < 0.01:
                arg_3 = 0
            arg_1.delay = arg_3


(self, checkpoint_trigger,
                       checkpoint_path, isOverWrite=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if not os . path . exists ( arg_2 ) : mkpath ( arg_2 ) callBigDlFunc ( arg_0 . bigdl_type , "setCheckPoint" , arg_0 . value , arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1,
                       arg_2, arg_3=True):
        """
        Configure checkpoint settings.

        :param checkpoint_trigger: the interval to write snapshots
        :param checkpoint_path: the path to write snapshots into
        :param isOverWrite: whether to overwrite existing snapshots in path.default is True
        """
        if not os.path.exists(arg_2):
            mkpath(arg_2)
        callBigDlFunc(arg_0.bigdl_type, "setCheckPoint", arg_0.value,
                      arg_1, arg_2, arg_3)


def Func(arg_0, arg_1):
        """Extend the lists within the DICOM groups dictionary.
        The indices will indicate which list have to be extended by which
        other list.

        Parameters
        ----------
        indices: list or tuple of 2 iterables of int, bot having the same len
             The indices of the lists that have to be merged, both iterables
             items will be read pair by pair, the first is the index to the
             list that will be extended with the list of the second index.
             The indices can be constructed with Numpy e.g.,
             indices = np.where(square_matrix)
        """
        try:
            arg_2 = merge_dict_of_lists(arg_0.dicom_groups, arg_1,
                                         pop_later=True, copy=True)
            arg_0.dicom_groups = arg_2
        except IndexError:
            raise IndexError('Index out of range to merge DICOM groups.')

Extend the lists within the DICOM groups dictionary . The indices will indicate which list have to be extended by which other list .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_1
is
:
return
''
if
not
isinstance
(
arg_1
[
1
]
,
(
list
,
dict
,
tuple
)
)
:
arg_1
=
[
arg_1
[
0
]
,
(
arg_1
[
1
]
,
)
]
arg_1
=
database
.
escape_query
(
*
arg_1
)
return
'AND ('
+
arg_1
+
')'

def Func(arg_0, arg_1):
        """ This method is a good one to extend if you want to create a queue which always applies an extra predicate. """
        if arg_1 is None:
            return ''

        # if they don't have a supported format seq, wrap it for them
        if not isinstance(arg_1[1], (list, dict, tuple)):
            arg_1 = [arg_1[0], (arg_1[1], )]

        arg_1 = database.escape_query(*arg_1)

        return 'AND (' + arg_1 + ')'

This method is a good one to extend if you want to create a queue which always applies an extra predicate .


def Func ( arg_0 ) : arg_1 = arg_0 . get_data ( "regions/" ) arg_2 = list ( ) for arg_3 in arg_1 [ 'regions' ] : arg_4 = Region ( ** arg_3 ) arg_4 . token = arg_0 . token arg_2 . append ( arg_4 ) return arg_2

def Func(arg_0):
        """
            This function returns a list of Region object.
        """
        arg_1 = arg_0.get_data("regions/")
        arg_2 = list()
        for arg_3 in arg_1['regions']:
            arg_4 = Region(**arg_3)
            arg_4.token = arg_0.token
            arg_2.append(arg_4)
        return arg_2

This function returns a list of Region object .


def Func(arg_0):
        """
        Entry point of the Executor; called by workers to start analysis.
        """
        # policy_order=self.policy_order
        # policy=self.policy
        arg_1 = None
        arg_2 = None

        with WithKeyboardInterruptAs(arg_0.shutdown):
            # notify siblings we are about to start a Func
            arg_0._notify_start_Func()

            logger.debug("Starting Manticore Symbolic Emulator Worker (pid %d).", os.getpid())
            arg_3 = Z3Solver()
            while not arg_0.is_shutdown():
                try:  # handle fatal errors: exceptions in Manticore
                    try:  # handle external (e.g. solver) errors, and executor control exceptions
                        # select a suitable state to analyze
                        if arg_1 is None:
                            with arg_0._lock:
                                # notify siblings we are about to stop this Func
                                arg_0._notify_stop_Func()
                                try:
                                    # Select a single state_id
                                    arg_2 = arg_0.get()
                                    # load selected state from secondary storage
                                    if arg_2 is not None:
                                        arg_0._publish('will_load_state', arg_2)
                                        arg_1 = arg_0._workspace.load_state(arg_2)
                                        arg_0.forward_events_from(arg_1, True)
                                        arg_0._publish('did_load_state', arg_1, arg_2)
                                        logger.info("load state %r", arg_2)
                                    # notify siblings we have a state to play with
                                finally:
                                    arg_0._notify_start_Func()

                        # If current_state is still None. We are done.
                        if arg_1 is None:
                            logger.debug("No more states in the queue, byte bye!")
                            break

                        assert arg_1 is not None
                        assert arg_1.constraints is arg_1.platform.constraints

                        # Allows to terminate manticore worker on user request
                        while not arg_0.is_shutdown():
                            if not arg_1.execute():
                                break
                        else:
                            # Notify this worker is done
                            arg_0._publish('will_terminate_state', arg_1, arg_2, TerminateState('Shutdown'))
                            arg_1 = None

                    # Handling Forking and terminating exceptions
                    except Concretize as e:
                        # expression
                        # policy
                        # setstate()
                        logger.debug("Generic state fork on condition")
                        arg_1 = arg_0.fork(arg_1, e.expression, e.policy, e.setstate)

                    except TerminateState as e:
                        # Notify this worker is done
                        arg_0._publish('will_terminate_state', arg_1, arg_2, e)

                        logger.debug("Generic terminate state")
                        if e.testcase:
                            arg_0._publish('internal_generate_testcase', arg_1, message=str(e))
                        arg_1 = None

                    except SolverError as e:
                        # raise
                        import traceback
                        arg_4 = traceback.format_exc()
                        logger.error("Exception: %s\n%s", str(e), arg_4)

                        # Notify this state is done
                        arg_0._publish('will_terminate_state', arg_1, arg_2, e)

                        if arg_3.check(arg_1.constraints):
                            arg_0._publish('internal_generate_testcase', arg_1, message="Solver failed" + str(e))
                        arg_1 = None

                except (Exception, AssertionError) as e:
                    # raise
                    import traceback
                    arg_4 = traceback.format_exc()
                    logger.error("Exception: %s\n%s", str(e), arg_4)
                    # Notify this worker is done
                    arg_0._publish('will_terminate_state', arg_1, arg_2, e)
                    arg_1 = None

            assert arg_1 is None or arg_0.is_shutdown()

            # notify siblings we are about to stop this Func
            arg_0._notify_stop_Func()

Entry point of the Executor ; called by workers to start analysis .


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func vapor pressure of a fluid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at Func vapor pressure, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Psat : float
            Vapor pressure at T, [pa]
        '''
        if arg_2 == WAGNER_MCGARRY:
            arg_3 = Wagner_original(arg_1, arg_0.WAGNER_MCGARRY_Tc, arg_0.WAGNER_MCGARRY_Pc, *arg_0.WAGNER_MCGARRY_coefs)
        elif arg_2 == WAGNER_POLING:
            arg_3 = Wagner(arg_1, arg_0.WAGNER_POLING_Tc, arg_0.WAGNER_POLING_Pc, *arg_0.WAGNER_POLING_coefs)
        elif arg_2 == ANTOINE_EXTENDED_POLING:
            arg_3 = TRC_Antoine_extended(arg_1, *arg_0.ANTOINE_EXTENDED_POLING_coefs)
        elif arg_2 == ANTOINE_POLING:
            arg_4, arg_5, arg_6 = arg_0.ANTOINE_POLING_coefs
            arg_3 = Antoine(arg_1, arg_4, arg_5, arg_6, base=10.0)
        elif arg_2 == DIPPR_PERRY_8E:
            arg_3 = EQ101(arg_1, *arg_0.Perrys2_8_coeffs)
        elif arg_2 == VDI_PPDS:
            arg_3 = Wagner(arg_1, arg_0.VDI_PPDS_Tc, arg_0.VDI_PPDS_Pc, *arg_0.VDI_PPDS_coeffs)
        elif arg_2 == COOLPROP:
            arg_3 = PropsSI('P','T', arg_1,'Q',0, arg_0.CASRN)
        elif arg_2 == BOILING_CRITICAL:
            arg_3 = boiling_critical_relation(arg_1, arg_0.Tb, arg_0.Tc, arg_0.Pc)
        elif arg_2 == LEE_KESLER_PSAT:
            arg_3 = Lee_Kesler(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == AMBROSE_WALTON:
            arg_3 = Ambrose_Walton(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == SANJARI:
            arg_3 = Sanjari(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == EDALAT:
            arg_3 = Edalat(arg_1, arg_0.Tc, arg_0.Pc, arg_0.omega)
        elif arg_2 == EOS:
            arg_3 = arg_0.eos[0].Psat(arg_1)
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3

r'''Method to calculate vapor pressure of a fluid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at calculate vapor pressure, [K]
        method : str
            Name of the method to use

        Returns
        -------
        Psat : float
            Vapor pressure at T, [pa]

r Method to calculate vapor pressure of a fluid at temperature T with a given method .


def Func ( arg_0 : arg_1 . node_classes . NodeNG ) -> bool : if getattr ( arg_0 , "name" , None ) == "super" and arg_0 . root ( ) . name == BUILTINS_NAME : return True return False

def Func(arg_0: arg_1.node_classes.NodeNG) -> bool:
    """return True if the node is referencing the "super" builtin function
    """
    if getattr(arg_0, "name", None) == "super" and arg_0.root().name == BUILTINS_NAME:
        return True
    return False

return True if the node is referencing the super builtin function


(dbg_opts=None, start_opts=None, post_mortem=True,
          step_ignore=1, level=0)

def Func(arg_0=None, arg_1=None, arg_2=True,
          arg_3=1, arg_4=0):
    """
Enter the Funcger.

Parameters
----------

level : how many stack frames go back. Usually it will be
the default 0. But sometimes though there may be calls in setup to the Funcger
that you may want to skip.

step_ignore : how many line events to ignore after the
Func() call. 0 means don't even wait for the Func() call to finish.

param dbg_opts : is an optional "options" dictionary that gets fed
trepan.Debugger(); `start_opts' are the optional "options"
dictionary that gets fed to trepan.Debugger.core.start().

Use like this:

.. code-block:: python

    ... # Possibly some Python code
    import trepan.api # Needed only once
    ... # Possibly some more Python code
    trepan.api.Func() # You can wrap inside conditional logic too
    pass  # Stop will be here.
    # Below is code you want to use the Funcger to do things.
    ....  # more Python code
    # If you get to a place in the program where you aren't going
    # want to Func any more, but want to remove Funcger trace overhead:
    trepan.api.stop()

Parameter "level" specifies how many stack frames go back. Usually it will be
the default 0. But sometimes though there may be calls in setup to the Funcger
that you may want to skip.

Parameter "step_ignore" specifies how many line events to ignore after the
Func() call. 0 means don't even wait for the Func() call to finish.

In situations where you want an immediate stop in the "Func" call
rather than the statement following it ("pass" above), add parameter
step_ignore=0 to Func() like this::

    import trepan.api  # Needed only once
    # ... as before
    trepan.api.Func(step_ignore=0)
    # ... as before

Module variable _Funcger_obj_ from module trepan.Funcger is used as
the Funcger instance variable; it can be subsequently used to change
settings or alter behavior. It should be of type Debugger (found in
module trepan). If not, it will get changed to that type::

   $ python
   >>> from trepan.Funcger import Funcger_obj
   >>> type(Funcger_obj)
   <type 'NoneType'>
   >>> import trepan.api
   >>> trepan.api.Func()
   ...
   (Trepan) c
   >>> from trepan.Funcger import Funcger_obj
   >>> Funcger_obj
   <trepan.Funcger.Debugger instance at 0x7fbcacd514d0>
   >>>

If however you want your own separate Funcger instance, you can
create it from the Funcger _class Debugger()_ from module
trepan.Funcger::

  $ python
  >>> from trepan.Funcger import Debugger
  >>> dbgr = Debugger()  # Add options as desired
  >>> dbgr
  <trepan.Funcger.Debugger instance at 0x2e25320>

`dbg_opts' is an optional "options" dictionary that gets fed
trepan.Debugger(); `start_opts' are the optional "options"
dictionary that gets fed to trepan.Debugger.core.start().
"""
    if not isinstance(arg_5.Funcger_obj, arg_5.Trepan):
        arg_5.Funcger_obj = arg_5.Trepan(arg_0)
        arg_5.Funcger_obj.core.add_ignore(Func, stop)
        pass
    arg_7 = arg_5.Funcger_obj.core
    arg_8 = sys._getframe(0+arg_4)
    arg_7.set_next(arg_8)
    if arg_1 and 'startup-profile' in arg_1 and arg_1['startup-profile']:
        arg_9 = arg_1['startup-profile']
        from trepan import options
        options.add_startup_file(arg_9)
        for arg_10 in arg_9:
            arg_7.processor.queue_startfile(arg_10)

    if not arg_7.is_started():
        arg_7.start(arg_1)
        pass
    if arg_2:
        Funcger_on_post_mortem()
        pass
    if 0 == arg_3:
        arg_8                   = sys._getframe(1+arg_4)
        arg_7.stop_reason        = 'at a Func() call'
        arg_12  = arg_7.trace_hook_suspend
        arg_7.trace_hook_suspend = True
        arg_7.processor.event_processor(arg_8, 'line', None)
        arg_7.trace_hook_suspend = arg_12
    else:
        arg_7.step_ignore = arg_3-1
        pass
    return

Enter the debugger.

Parameters
----------

level : how many stack frames go back. Usually it will be
the default 0. But sometimes though there may be calls in setup to the debugger
that you may want to skip.

step_ignore : how many line events to ignore after the
debug() call. 0 means don't even wait for the debug() call to finish.

param dbg_opts : is an optional "options" dictionary that gets fed
trepan.Debugger(); `start_opts' are the optional "options"
dictionary that gets fed to trepan.Debugger.core.start().

Use like this:

.. code-block:: python

    ... # Possibly some Python code
    import trepan.api # Needed only once
    ... # Possibly some more Python code
    trepan.api.debug() # You can wrap inside conditional logic too
    pass  # Stop will be here.
    # Below is code you want to use the debugger to do things.
    ....  # more Python code
    # If you get to a place in the program where you aren't going
    # want to debug any more, but want to remove debugger trace overhead:
    trepan.api.stop()

Parameter "level" specifies how many stack frames go back. Usually it will be
the default 0. But sometimes though there may be calls in setup to the debugger
that you may want to skip.

Parameter "step_ignore" specifies how many line events to ignore after the
debug() call. 0 means don't even wait for the debug() call to finish.

In situations where you want an immediate stop in the "debug" call
rather than the statement following it ("pass" above), add parameter
step_ignore=0 to debug() like this::

    import trepan.api  # Needed only once
    # ... as before
    trepan.api.debug(step_ignore=0)
    # ... as before

Module variable _debugger_obj_ from module trepan.debugger is used as
the debugger instance variable; it can be subsequently used to change
settings or alter behavior. It should be of type Debugger (found in
module trepan). If not, it will get changed to that type::

   $ python
   >>> from trepan.debugger import debugger_obj
   >>> type(debugger_obj)
   <type 'NoneType'>
   >>> import trepan.api
   >>> trepan.api.debug()
   ...
   (Trepan) c
   >>> from trepan.debugger import debugger_obj
   >>> debugger_obj
   <trepan.debugger.Debugger instance at 0x7fbcacd514d0>
   >>>

If however you want your own separate debugger instance, you can
create it from the debugger _class Debugger()_ from module
trepan.debugger::

  $ python
  >>> from trepan.debugger import Debugger
  >>> dbgr = Debugger()  # Add options as desired
  >>> dbgr
  <trepan.debugger.Debugger instance at 0x2e25320>

`dbg_opts' is an optional "options" dictionary that gets fed
trepan.Debugger(); `start_opts' are the optional "options"
dictionary that gets fed to trepan.Debugger.core.start().


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
set
(
arg_1
)
if
len
(
arg_2
)
!=
len
(
arg_1
)
:
raise
QiskitError
(
"duplicate qubit arguments"
)

def Func(arg_0, arg_1):
        """Raise exception if list of qubits contains duplicates."""
        arg_2 = set(arg_1)
        if len(arg_2) != len(arg_1):
            raise QiskitError("duplicate qubit arguments")

Raise exception if list of qubits contains duplicates .


(graph: BELGraph, edge_predicates: EdgePredicates = None)

def Func(arg_0: arg_1, arg_2: arg_3 = None) -> None:
    """Collapse all edges passing the given edge predicates."""
    for arg_4, arg_5, arg_6 in filter_edges(arg_0, arg_2=arg_2):
        collapse_pair(arg_0, survivor=arg_4, victim=arg_5)

Collapse all edges passing the given edge predicates .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = None if arg_1 is AccessControl . Private : if arg_2 : arg_2 . private = gdata . media . Private ( ) elif arg_1 is AccessControl . Unlisted : from gdata . media import YOUTUBE_NAMESPACE from atom import ExtensionElement arg_5 = { "namespace" : YOUTUBE_NAMESPACE , "attributes" : { 'action' : 'list' , 'permission' : 'denied' } , } arg_3 = ( [ ExtensionElement ( 'accessControl' , ** arg_5 ) ] ) return arg_3

def Func(arg_0, arg_1, arg_2=None):
        """
        Prepares the extension element for access control
        Extension element is the optional parameter for the YouTubeVideoEntry
        We use extension element to modify access control settings

        Returns:
            tuple of extension elements
        """
        # Access control
        arg_3 = None
        if arg_1 is AccessControl.Private:
            # WARNING: this part of code is not tested
            # set video as private
            if arg_2:
                arg_2.private = gdata.media.Private()
        elif arg_1 is AccessControl.Unlisted:
            # set video as unlisted
            from gdata.media import YOUTUBE_NAMESPACE
            from atom import ExtensionElement
            arg_5 = {
                "namespace": YOUTUBE_NAMESPACE,
                "attributes": {'action': 'list', 'permission': 'denied'},
            }
            arg_3 = ([ExtensionElement('accessControl', **arg_5)])
        return arg_3


def Func():
    rollbar.init('ACCESS_TOKEN', environment='test', handler='twisted')

    """This runs the protocol on port 8000"""
    arg_0 = arg_1.ServerFactory()
    arg_0.protocol = Echo
    reactor.listenTCP(8000, arg_0)
    reactor.run()


(bucket_name, root_path,
               aws_access_key_id=None, aws_secret_access_key=None,
               aws_profile=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
arg_5
=
logging
.
getLogger
(
__name__
)
arg_6
=
boto3
.
session
.
Session
(
arg_2
=
arg_2
,
arg_3
=
arg_3
)
arg_7
=
arg_6
.
resource
(
's3'
)
arg_8
=
arg_7
.
meta
.
client
if
not
arg_1
.
endswith
(
'/'
)
:
arg_1
.
rstrip
(
'/'
)
arg_9
=
arg_8
.
get_paginator
(
'list_objects_v2'
)
arg_10
=
arg_9
.
paginate
(
Bucket
=
arg_0
,
Prefix
=
arg_1
)
arg_11
=
dict
(
Objects
=
[
]
)
for
arg_12
in
arg_10
.
search
(
'Contents'
)
:
try
:
arg_11
[
'Objects'
]
.
append
(
{
'Key'
:
arg_12
[
'Key'
]
}
)
except
TypeError
:
continue
if
len
(
arg_11
[
'Objects'
]
)
>=
1000
:
try
:
arg_8
.
delete_objects
(
Bucket
=
arg_0
,
Delete
=
arg_11
)
except
Exception
:
arg_13
=
'Error deleting objects from %r'
%
arg_1
arg_5
.
exception
(
arg_13
)
raise
S3Error
(
arg_13
)
arg_11
=
dict
(
Objects
=
[
]
)
if
len
(
arg_11
[
'Objects'
]
)
>
0
:
try
:
arg_8
.
delete_objects
(
Bucket
=
arg_0
,
Delete
=
arg_11
)
except
Exception
:
arg_13
=
'Error deleting objects from %r'
%
arg_1
arg_5
.
exception
(
arg_13
)
raise
S3Error
(
arg_13
)

def Func(arg_0, arg_1,
               arg_2=None, arg_3=None,
               arg_4=None):
    """Delete all objects in the S3 bucket named ``bucket_name`` that are
    found in the ``root_path`` directory.

    Parameters
    ----------
    bucket_name : `str`
        Name of an S3 bucket.
    root_path : `str`
        Directory in the S3 bucket that will be deleted.
    aws_access_key_id : `str`
        The access key for your AWS account. Also set
        ``aws_secret_access_key``.
    aws_secret_access_key : `str`
        The secret key for your AWS account.
    aws_profile : `str`, optional
        Name of AWS profile in :file:`~/.aws/credentials`. Use this instead
        of ``aws_access_key_id`` and ``aws_secret_access_key`` for file-based
        credentials.

    Raises
    ------
    ltdconveyor.s3.S3Error
        Thrown by any unexpected faults from the S3 API.
    """
    arg_5 = logging.getLogger(__name__)

    arg_6 = boto3.session.Session(
        arg_2=arg_2,
        arg_3=arg_3)
    arg_7 = arg_6.resource('s3')
    arg_8 = arg_7.meta.client

    # Normalize directory path for searching patch prefixes of objects
    if not arg_1.endswith('/'):
        arg_1.rstrip('/')

    arg_9 = arg_8.get_paginator('list_objects_v2')
    arg_10 = arg_9.paginate(Bucket=arg_0, Prefix=arg_1)

    arg_11 = dict(Objects=[])
    for arg_12 in arg_10.search('Contents'):
        try:
            arg_11['Objects'].append({'Key': arg_12['Key']})
        except TypeError:  # item is None; nothing to delete
            continue
        # Delete immediately when 1000 objects are listed
        # the delete_objects method can only take a maximum of 1000 keys
        if len(arg_11['Objects']) >= 1000:
            try:
                arg_8.delete_objects(Bucket=arg_0, Delete=arg_11)
            except Exception:
                arg_13 = 'Error deleting objects from %r' % arg_1
                arg_5.exception(arg_13)
                raise S3Error(arg_13)
            arg_11 = dict(Objects=[])

    # Delete remaining keys
    if len(arg_11['Objects']) > 0:
        try:
            arg_8.delete_objects(Bucket=arg_0, Delete=arg_11)
        except Exception:
            arg_13 = 'Error deleting objects from %r' % arg_1
            arg_5.exception(arg_13)
            raise S3Error(arg_13)

Delete all objects in the S3 bucket named bucket_name that are found in the root_path directory .


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_1 , arg_0 . STATUS_FILE ) arg_3 = { 'format' : arg_0 . STATUS_FORMAT , 'version' : coverage . __version__ , 'settings' : arg_0 . settings , 'files' : arg_0 . files , } arg_4 = open ( arg_2 , "wb" ) try : pickle . dump ( arg_3 , arg_4 ) finally : arg_4 . close ( )

def Func(arg_0, arg_1):
        """Write the current status to `directory`."""
        arg_2 = os.path.join(arg_1, arg_0.STATUS_FILE)
        arg_3 = {
            'format': arg_0.STATUS_FORMAT,
            'version': coverage.__version__,
            'settings': arg_0.settings,
            'files': arg_0.files,
            }
        arg_4 = open(arg_2, "wb")
        try:
            pickle.dump(arg_3, arg_4)
        finally:
            arg_4.close()


def Func ( arg_0 , arg_1 , arg_2 = False ) : if not arg_2 and PyFunceble . directory_separator in arg_1 : arg_3 = arg_1 . split ( PyFunceble . directory_separator ) arg_4 = "" for arg_5 in arg_3 : arg_4 += arg_5 + PyFunceble . directory_separator arg_0 . Func ( arg_4 , True ) if not PyFunceble . path . isdir ( arg_1 ) : AutoSave . travis_permissions ( ) PyFunceble . mkdir ( arg_1 ) AutoSave . travis_permissions ( )

def Func(arg_0, arg_1, arg_2=False):
        """
        Creates the given directory if it does not exists.

        :param directory: The directory to create.
        :type directory: str

        :param loop: Tell us if we are in the creation loop or not.
        :type loop: bool
        """

        if not arg_2 and PyFunceble.directory_separator in arg_1:
            # * We are not in the loop.
            # and
            # * The directory separator in the given directory.

            # We split the directories separator.
            arg_3 = arg_1.split(PyFunceble.directory_separator)

            # We initiate a variable which will save the full path to create.
            arg_4 = ""

            for arg_5 in arg_3:
                # We loop through each directory.

                # We append the currently read directory to the full path.
                arg_4 += arg_5 + PyFunceble.directory_separator

                # And we create the directory if it does not exist.
                arg_0.Func(arg_4, True)

        if not PyFunceble.path.isdir(arg_1):
            # The given directory does not exist.

            # We update the permission.
            # (Only if we are under Travis CI.)
            AutoSave.travis_permissions()

            # We create the directory.
            PyFunceble.mkdir(arg_1)

            # We update the permission.
            # (Only if we are under Travis CI.)
            AutoSave.travis_permissions()

Creates the given directory if it does not exists .


Simply keeps a reference to the stored data

(self, msg, stuff_to_store, *args, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : arg_5 = arg_4 [ 'trajectory_name' ] if arg_5 not in arg_0 . references : arg_0 . references [ arg_5 ] = [ ] arg_0 . references [ arg_5 ] . append ( ( arg_1 , cp . copy ( arg_2 ) , arg_3 , arg_4 ) )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Simply keeps a reference to the Funcd data """
        arg_5 = arg_4['trajectory_name']
        if arg_5 not in arg_0.references:
            arg_0.references[arg_5] = []
        arg_0.references[arg_5].append((arg_1, cp.copy(arg_2), arg_3, arg_4))


return [Bucket(self, bucket) for bucket in mimicdb.backend.smembers(tpl.connection)]

def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_2 . pop ( 'force' , None ) : arg_3 = super ( S3Connection , arg_0 ) . Func ( * arg_1 , ** arg_2 ) for arg_4 in arg_3 : mimicdb . backend . sadd ( tpl . connection , arg_4 . name ) return arg_3 return [ Bucket ( arg_0 , arg_4 ) for arg_4 in mimicdb . backend . smembers ( tpl . connection ) ]

def Func(arg_0, *arg_1, **arg_2):
        """Return a list of buckets in MimicDB.

        :param boolean force: If true, API call is forced to S3
        """
        if arg_2.pop('force', None):
            arg_3 = super(S3Connection, arg_0).Func(*arg_1, **arg_2)

            for arg_4 in arg_3:
                mimicdb.backend.sadd(tpl.connection, arg_4.name)

            return arg_3

        return [Bucket(arg_0, arg_4) for arg_4 in mimicdb.backend.smembers(tpl.connection)]


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = dict ( ) arg_3 [ 'id' ] = arg_1 if arg_2 : arg_3 [ 'token' ] = arg_2 arg_4 = arg_0 . request ( 'midas.community.children' , arg_3 ) return arg_4

def Func(arg_0, arg_1, arg_2=None):
        """
        Get the non-recursive children of the passed in community_id.

        :param community_id: The id of the requested community.
        :type community_id: int | long
        :param token: (optional) A valid token for the user in question.
        :type token: None | string
        :returns: List of the folders in the community.
        :rtype: dict[string, list]
        """
        arg_3 = dict()
        arg_3['id'] = arg_1
        if arg_2:
            arg_3['token'] = arg_2
        arg_4 = arg_0.request('midas.community.children', arg_3)
        return arg_4

Get the non - recursive children of the passed in community_id .


def Func(arg_0):
     '''get a rejester.WorkUnit with KBA s3 path, fetch it, and save
     some counts about it.
     '''
     #fname = 'verify-chunks-%d-%d' % (os.getpid(), time.time())
     arg_1 = arg_0.key.strip().split('/')[-1]

     arg_2 = arg_0.data.get('output_dir_path', '/mnt')
     arg_3 = uuid.uuid3(uuid.UUID(int=0), arg_0.key.strip())
     arg_4 = arg_3.hex[0]
     arg_5 = arg_3.hex[1]
     arg_6 = os.path.join(arg_2, arg_4, arg_5, arg_1)
     if not os.path.exists(os.path.dirname(arg_6)):
          os.makedirs(os.path.dirname(arg_6))

     arg_7 = gzip.open(arg_6 + '-out.gz', 'wb')

     arg_8 = int(arg_1.split('-')[1])

     arg_9 = 20
     arg_10 = 0
     while arg_10 < arg_9:
          try:
               arg_11, arg_12, arg_13, arg_14, arg_15, arg_16 = \
                   attempt_fetch(arg_0, arg_6)
               if arg_12 != arg_8:
                    print 'retrying because si_count = %d != %d expected_si_count' % (arg_12, arg_8)
                    sys.stdout.flush()
                    arg_10 += 1
                    continue
               else:
                    print 'succeeded in reading si_count = %d' % (arg_12,)
                    sys.stdout.flush()
               arg_7.write( '%s\t%d\t%d\t%d\t%d\t%s\t%s\n' % (
                         arg_11, arg_12, arg_13, arg_14, arg_15,
                         arg_0.key.strip(), ','.join(['%s|%s' % arg_17 for arg_17 in arg_16])) )
               break
          except Exception, arg_11:
               print 'broken?'
               print traceback.format_exc(arg_11)
               sys.stdout.flush()
               arg_10 += 1
               arg_7.write(traceback.format_exc(arg_11))

     arg_7.close()

get a rejester . WorkUnit with KBA s3 path fetch it and save some counts about it .


def Func ( arg_0 , arg_1 , arg_2 = 'unsafe' ) : arg_3 = arg_0 . _rdd . mapValues ( lambda v : v . Func ( arg_1 , 'K' , arg_2 ) ) return arg_0 . _constructor ( arg_3 , arg_1 = arg_1 ) . __finalize__ ( arg_0 )

def Func(arg_0, arg_1, arg_2='unsafe'):
        """
        Cast the array to a specified type.

        Parameters
        ----------
        dtype : str or dtype
            Typecode or data-type to cast the array to (see numpy)
        """
        arg_3 = arg_0._rdd.mapValues(lambda v: v.Func(arg_1, 'K', arg_2))
        return arg_0._constructor(arg_3, arg_1=arg_1).__finalize__(arg_0)


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : if arg_0 is None : return None arg_3 = datetime . utcfromtimestamp ( arg_0 ) . replace ( tzinfo = arg_1 or utc ) return totz ( arg_3 , arg_2 )

def Func(arg_0, arg_1=None, arg_2=None):
    """
    Return the datetime representation of the provided Unix timestamp. By defaults the timestamp is
    interpreted as UTC. If tzin is set it will be interpreted as this timestamp instead. By default
    the output datetime will have UTC time. If tzout is set it will be converted in this timezone
    instead.
    """
    if arg_0 is None:
        return None
    arg_3 = datetime.utcfromtimestamp(arg_0).replace(tzinfo=arg_1 or utc)
    return totz(arg_3, arg_2)

Return the datetime representation of the provided Unix timestamp . By defaults the timestamp is interpreted as UTC . If tzin is set it will be interpreted as this timestamp instead . By default the output datetime will have UTC time . If tzout is set it will be converted in this timezone instead .


(orig_msg, orig_msg_nocr, code, lasti=-1, cur_line=0,
                      start_line=-1, end_line=None, relative_pos=False,
                      varnames=(), names=(), constants=(), cells=(),
                      freevars=(), linestarts={}, highlight='light',
                      start_offset=0, end_offset=None)

def Func(arg_0, arg_1, arg_2, arg_3=-1, arg_4=0,
                      arg_5=-1, arg_6=None, arg_7=False,
                      arg_8=(), arg_9=(), arg_10=(), arg_11=(),
                      arg_12=(), arg_13={}, arg_14='light',
                      arg_15=0, arg_16=None):
    """Disassemble byte string of code. If end_line is negative
    it counts the number of statement linestarts to use."""
    arg_17 = 10000
    if arg_6 is None:
        arg_6 = 10000
    elif arg_7:
        arg_6 += arg_5 -1
        pass

    arg_18 = findlabels(arg_2)

    arg_19 = lambda x: None
    if arg_5 > arg_4:
        arg_20 = arg_19
        arg_21 = arg_19
    else:
        arg_20 = arg_1
        arg_21 = arg_0

    for arg_22 in get_instructions_bytes(arg_2, opc, arg_8, arg_9,
                                        arg_10, arg_11, arg_13):
        arg_23 = arg_22.offset
        if arg_16 and arg_23 > arg_16:
            break

        if arg_22.starts_line:
            if arg_23:
                arg_21("")

            arg_4 = arg_22.starts_line
            if (arg_5 and ((arg_5 > arg_4) or
                                arg_15 and arg_15 > arg_23)) :
                arg_20 = arg_19
                arg_21 = arg_19
            else:
                arg_17 -= 1
                arg_20 = arg_1
                arg_21 = arg_0
                pass
            if ((arg_4 > arg_6) or
                (arg_16 and arg_23 > arg_16)):
                break
            arg_20(format_token(Mformat.LineNumber,
                                  "%4d" % arg_4,
                                  arg_14=arg_14))
        else:
            if arg_15 and arg_23 and arg_15 <= arg_23:
                arg_20 = arg_1
                arg_21 = arg_0
                pass
            arg_20('    ')

        if arg_23 == arg_3: arg_20(format_token(Mformat.Arrow, '-->',
                                                  arg_14=arg_14))
        else: arg_20('   ')
        if arg_23 in arg_18: arg_20(format_token(Mformat.Arrow, '>>',
                                                   arg_14=arg_14))
        else: arg_20('  ')
        arg_20(repr(arg_23).rjust(4))
        arg_20(' ')
        arg_20(format_token(Mformat.Opcode,
                              arg_22.opname.ljust(20),
                              arg_14=arg_14))
        arg_20(repr(arg_22.arg).ljust(10))
        arg_20(' ')
        # Show argval?
        arg_21(format_token(Mformat.Name,
                         arg_22.argrepr.ljust(20),
                         arg_14=arg_14))
        pass

    return arg_2, arg_23

Disassemble byte string of code . If end_line is negative it counts the number of statement linestarts to use .


def Func ( arg_0 , arg_1 : arg_2 ) -> float : arg_3 = ( arg_0 . graph . nodes [ arg_1 ] [ arg_0 . tag ] if arg_0 . tag in arg_0 . graph . nodes [ arg_1 ] else arg_0 . default_score ) for arg_4 , arg_5 , arg_6 in arg_0 . graph . in_edges ( arg_1 , data = True ) : if arg_6 [ RELATION ] in CAUSAL_INCREASE_RELATIONS : arg_3 += arg_0 . graph . nodes [ arg_4 ] [ arg_0 . tag ] elif arg_6 [ RELATION ] in CAUSAL_DECREASE_RELATIONS : arg_3 -= arg_0 . graph . nodes [ arg_4 ] [ arg_0 . tag ] return arg_3

def Func(arg_0, arg_1: arg_2) -> float:
        """Calculate the new score of the given node."""
        arg_3 = (
            arg_0.graph.nodes[arg_1][arg_0.tag]
            if arg_0.tag in arg_0.graph.nodes[arg_1] else
            arg_0.default_score
        )

        for arg_4, arg_5, arg_6 in arg_0.graph.in_edges(arg_1, data=True):
            if arg_6[RELATION] in CAUSAL_INCREASE_RELATIONS:
                arg_3 += arg_0.graph.nodes[arg_4][arg_0.tag]
            elif arg_6[RELATION] in CAUSAL_DECREASE_RELATIONS:
                arg_3 -= arg_0.graph.nodes[arg_4][arg_0.tag]

        return arg_3

Calculate the new score of the given node .


Returns a copy of the layout for the given graph.

def Func(arg_0, arg_1):

        """ Returns a Func of the layout for the given graph.
        """

        arg_2 = arg_0.__class__(arg_1, arg_0.n)
        arg_2.i = 0
        return arg_2

Returns a copy of the layout for the given graph .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = arg_0 . client . notes ( GitLabClient . ISSUES , arg_1 ) for arg_4 in arg_3 : for arg_5 in json . loads ( arg_4 ) : arg_6 = arg_5 [ 'id' ] arg_5 [ 'award_emoji_data' ] = arg_0 . __get_note_award_emoji ( GitLabClient . ISSUES , arg_1 , arg_6 ) arg_2 . append ( arg_5 ) return arg_2

def Func(arg_0, arg_1):
        """Get issue notes"""

        arg_2 = []

        arg_3 = arg_0.client.notes(GitLabClient.ISSUES, arg_1)

        for arg_4 in arg_3:

            for arg_5 in json.loads(arg_4):
                arg_6 = arg_5['id']
                arg_5['award_emoji_data'] = \
                    arg_0.__get_note_award_emoji(GitLabClient.ISSUES, arg_1, arg_6)
                arg_2.append(arg_5)

        return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
arg_1
.
elided
[
arg_2
]
arg_5
=
Match
(
r'\s*#\s*include\s+[<"]([^<"]+)[">]'
,
arg_4
)
if
arg_5
and
arg_5
.
group
(
1
)
in
(
'scoped_allocator'
,
'shared_mutex'
)
:
arg_3
(
arg_0
,
arg_2
,
'build/c++14'
,
5
,
(
'<%s> is an unapproved C++14 header.'
)
%
arg_5
.
group
(
1
)
)

def Func(arg_0, arg_1, arg_2, arg_3):
  """Flag those C++14 features that we restrict.

  Args:
    filename: The name of the current file.
    clean_lines: A CleansedLines instance containing the file.
    linenum: The number of the line to check.
    error: The function to call with any errors found.
  """
  arg_4 = arg_1.elided[arg_2]

  arg_5 = Match(r'\s*#\s*include\s+[<"]([^<"]+)[">]', arg_4)

  # Flag unapproved C++14 headers.
  if arg_5 and arg_5.group(1) in ('scoped_allocator', 'shared_mutex'):
    arg_3(arg_0, arg_2, 'build/c++14', 5,
          ('<%s> is an unapproved C++14 header.') % arg_5.group(1))

Flag those C ++ 14 features that we restrict .


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func permittivity of a liquid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to Func relative permittivity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        epsilon : float
            Relative permittivity of the liquid at T, [-]
        '''
        if arg_2 == CRC:
            arg_3, arg_4, arg_5, arg_6 = arg_0.CRC_coeffs
            arg_7 = arg_3 + arg_4*arg_1 + arg_5*arg_1**2 + arg_6*arg_1**3
        elif arg_2 == CRC_CONSTANT:
            arg_7 = arg_0.CRC_permittivity
        elif arg_2 in arg_0.tabular_data:
            arg_7 = arg_0.interpolate(arg_1, arg_2)
        return arg_7

r'''Method to calculate permittivity of a liquid at temperature `T`
        with a given method.

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

        Parameters
        ----------
        T : float
            Temperature at which to calculate relative permittivity, [K]
        method : str
            Name of the method to use

        Returns
        -------
        epsilon : float
            Relative permittivity of the liquid at T, [-]

r Method to calculate permittivity of a liquid at temperature T with a given method .


def Func ( arg_0 , arg_1 = False , arg_2 = 10 ) : if not arg_1 : return sum ( arg_0 . _segment_lengths ( n = arg_2 ) , 0.0 ) else : return arg_0 . _segment_lengths ( relative = True , n = arg_2 )

def Func(arg_0, arg_1=False, arg_2=10):
        """ Returns the length of the path.
            Calculates the length of each spline in the path, using n as a number of points to measure.
            When segmented is True, returns a list containing the individual length of each spline
            as values between 0.0 and 1.0, defining the relative length of each spline
            in relation to the total path length.
        """
        # Originally from nodebox-gl
        if not arg_1:
            return sum(arg_0._segment_lengths(n=arg_2), 0.0)
        else:
            return arg_0._segment_lengths(relative=True, n=arg_2)

Returns the length of the path . Calculates the length of each spline in the path using n as a number of points to measure . When segmented is True returns a list containing the individual length of each spline as values between 0 . 0 and 1 . 0 defining the relative length of each spline in relation to the total path length .


def Func(arg_0: arg_1) -> Graph:
    """Extract an undirected graph of only correlative relationships."""
    arg_2 = Graph()

    for arg_3, arg_4, arg_5 in arg_0.edges(data=True):
        if arg_5[arg_6] not in CORRELATIVE_RELATIONS:
            continue

        if not arg_2.has_edge(arg_3, arg_4):
            arg_2.add_edge(arg_3, arg_4, **{arg_5[arg_6]: True})

        elif arg_5[arg_6] not in arg_2[arg_3][arg_4]:
            log.log(5, 'broken correlation relation for %s, %s', arg_3, arg_4)
            arg_2[arg_3][arg_4][arg_5[arg_6]] = True
            arg_2[arg_4][arg_3][arg_5[arg_6]] = True

    return arg_2

Extract an undirected graph of only correlative relationships .


def Func(arg_0):
    """Find the first frame that is a debugged frame. We do this
    Generally we want traceback information without polluting it with
    debugger frames. We can tell these because those are frames on the
    top which don't have f_trace set. So we'll look back from the top
    to find the fist frame where f_trace is set.
    """
    arg_1 = arg_2 = arg_0
    while arg_2 is not None and arg_2.f_trace is None:
        arg_1 = arg_2
        arg_2 = arg_2.f_back
        pass
    if arg_1:
        arg_3 = arg_1.f_locals.get('tracer_func_frame')
        if arg_3 == arg_1:
            if arg_1.f_back:
                arg_1 = arg_1.f_back
                pass
            pass
        pass
    else:
        return arg_0
    return arg_1

Find the first frame that is a debugged frame . We do this Generally we want traceback information without polluting it with debugger frames . We can tell these because those are frames on the top which don t have f_trace set . So we ll look back from the top to find the fist frame where f_trace is set .


Create a record object from the marcxml description.

(marcxml=None, verbose=CFG_BIBRECORD_DEFAULT_VERBOSE_LEVEL,
                  correct=CFG_BIBRECORD_DEFAULT_CORRECT, parser='',
                  sort_fields_by_indicators=False,
                  keep_singletons=CFG_BIBRECORD_KEEP_SINGLETONS)

def Func ( arg_0 = None , arg_1 = arg_2 , arg_3 = arg_4 , arg_5 = '' , arg_6 = False , arg_7 = arg_8 ) : if arg_0 is None : return { } try : arg_9 = _Func_lxml ( arg_0 , arg_1 , arg_3 , arg_7 = arg_7 ) except InvenioBibRecordParserError as ex1 : return ( None , 0 , str ( ex1 ) ) if arg_6 : _record_sort_by_indicators ( arg_9 ) arg_10 = [ ] if arg_3 : arg_10 = _correct_record ( arg_9 ) return ( arg_9 , int ( not arg_10 ) , arg_10 )

Create a record object from the marcxml description .


def Func(arg_0):
    """ Tries to make directories for a given `filename`.

    Ignores any error but notifies via stderr.

    """
    try:
        arg_1 = os.path.dirname(os.path.normpath(arg_0))
        racedirs(arg_1)
    except Exception as exc:
        sys.stderr.write('ERROR during log config file handling, could not create dirs for '
                         'filename `%s` because of: %s' % (arg_0, repr(exc)))

Tries to make directories for a given filename .


def Func(arg_0):
        """Initial rendering stage, done in order to compute widths of all widgets."""
        arg_1 = [0] * len(arg_0._widgets)
        arg_2 = 0

        # First render all non-flexible widgets
        for arg_3, arg_4 in enumerate(arg_0._widgets):
            if isinstance(arg_4, ProgressBarFlexibleWidget):
                arg_2 += 1
            else:
                arg_1[arg_3] = arg_4.render(1).length

        arg_5 = arg_0._width - sum(arg_1)
        arg_5 -= len(arg_0._widgets) - 1  # account for 1-space interval between widgets
        if arg_5 < 10 * arg_2:
            if arg_0._file_mode:
                arg_5 = 10 * arg_2
            else:
                # The window is too small to accomodate the widget: try to split it into several lines, otherwise
                # switch to "file mode". If we don't do this, then rendering the widget will cause it to wrap, and
                # then when we use \r to go to the beginning of the line, only part of the widget will be overwritten,
                # which means we'll have many (possibly hundreds) of progress bar lines in the end.
                arg_6 = arg_0._widgets[0]
                if isinstance(arg_6, PBWString) and arg_5 + arg_6.render(0).length >= 10 * arg_2:
                    arg_5 += arg_6.render(0).length + 1
                    arg_0._to_render = arg_6.render(0).rendered + "\n"
                    arg_0._widgets = arg_0._widgets[1:]
                if arg_5 < 10 * arg_2:
                    arg_0._file_mode = True
                    arg_5 = 10 * arg_2

        arg_5 = max(arg_5, 10 * arg_2)  # Ensure at least 10 chars per flexible widget

        for arg_3, arg_4 in enumerate(arg_0._widgets):
            if isinstance(arg_4, ProgressBarFlexibleWidget):
                arg_10 = int(arg_5 / arg_2)
                arg_11 = arg_4.render(1, arg_10)
                arg_1[arg_3] = arg_11.length
                arg_5 -= arg_11.length
                arg_2 -= 1

        return arg_1

Initial rendering stage done in order to compute widths of all widgets .


def Func ( arg_0 , arg_1 , arg_2 = False , arg_3 = 0.02 , arg_4 = 0 ) : if not np . array ( arg_1 ) . shape : arg_1 = [ float ( arg_1 ) ] arg_5 = None for arg_6 in arg_1 : if arg_2 : arg_7 = arg_0 . currentSweep else : arg_7 = int ( arg_6 / arg_0 . sweepInterval ) arg_6 = arg_6 - arg_7 * arg_0 . sweepInterval arg_0 . setSweep ( arg_7 ) if arg_4 : arg_8 = int ( arg_4 * arg_0 . rate / 1000 ) arg_9 = ( arg_0 . dataY [ arg_8 : ] - arg_0 . dataY [ : - arg_8 ] ) * arg_0 . rate / 1000 / arg_8 else : arg_9 = arg_0 . dataY arg_10 = int ( arg_3 * arg_0 . rate ) arg_11 = np . empty ( arg_10 ) * np . nan arg_12 = arg_6 * arg_0 . rate arg_9 = np . concatenate ( ( arg_11 , arg_11 , arg_9 , arg_11 , arg_11 ) ) arg_12 += arg_10 * 2 arg_9 = arg_9 [ arg_12 - arg_10 : arg_12 + arg_10 ] arg_9 = arg_9 [ : int ( arg_10 * 2 ) ] if arg_5 is None : arg_5 = [ arg_9 ] else : arg_5 = np . vstack ( ( arg_5 , arg_9 ) ) return arg_5

def Func(arg_0,arg_1,arg_2=False,arg_3=0.02,arg_4=0):
        """
        return self.dataY around a time point. All units are seconds.
        if thisSweep==False, the time point is considered to be experiment time
            and an appropriate sweep may be selected. i.e., with 10 second
            sweeps and timePint=35, will select the 5s mark of the third sweep
        """
        if not np.array(arg_1).shape:
            arg_1=[float(arg_1)]
        arg_5=None
        for arg_6 in arg_1:
            if arg_2:
                arg_7=arg_0.currentSweep
            else:
                arg_7=int(arg_6/arg_0.sweepInterval)
                arg_6=arg_6-arg_7*arg_0.sweepInterval
            arg_0.setSweep(arg_7)
            if arg_4:
                arg_8=int(arg_4*arg_0.rate/1000) #points per ms
                arg_9=(arg_0.dataY[arg_8:]-arg_0.dataY[:-arg_8])*arg_0.rate/1000/arg_8
            else:
                arg_9=arg_0.dataY
            arg_10=int(arg_3*arg_0.rate)
            arg_11=np.empty(arg_10)*np.nan
            arg_12=arg_6*arg_0.rate #center point (I)
            arg_9=np.concatenate((arg_11,arg_11,arg_9,arg_11,arg_11))
            arg_12+=arg_10*2
            arg_9=arg_9[arg_12-arg_10:arg_12+arg_10]
            arg_9=arg_9[:int(arg_10*2)] #TODO: omg so much trouble with this!
            if arg_5 is None:
                arg_5=[arg_9]
            else:
                arg_5=np.vstack((arg_5,arg_9))#TODO: omg so much trouble with this!
        return arg_5

return self . dataY around a time point . All units are seconds . if thisSweep == False the time point is considered to be experiment time and an appropriate sweep may be selected . i . e . with 10 second sweeps and timePint = 35 will select the 5s mark of the third sweep


Use the maximum likelihood estimator for a lognormal distribution to
        produce the best-fit lognormal parameters

def Func(arg_0,arg_1=True):
        """
        Use the maximum likelihood estimator for a Func distribution to
        produce the best-fit Func parameters
        """
        # N = float(self.data.shape[0])
        # mu = log(self.data).sum() / N
        # sigmasquared = ( ( log(self.data) - mu )**2 ).sum() / N
        # self.Func_mu = mu
        # self.Func_sigma = np.sqrt(sigmasquared)
        # self.Func_likelihood = -N/2. * log(np.pi*2) - N/2. * log(sigmasquared) - 1/(2*sigmasquared) * (( self.data - mu )**2).sum()
        # if doprint:
        #     print "Best fit Func is exp( -(x-%g)^2 / (2*%g^2)" % (mu,np.sqrt(sigmasquared))
        #     print "Likelihood: %g" % (self.Func_likelihood)
        if scipyOK:
            arg_2 = scipy.stats.lognorm.fit(arg_0.data)
            arg_0.Func_dist = scipy.stats.lognorm(*arg_2)
            arg_0.Func_ksD,arg_0.Func_ksP = scipy.stats.kstest(arg_0.data,arg_0.Func_dist.cdf)
            # nnlf = NEGATIVE log likelihood
            arg_0.Func_likelihood = -1*scipy.stats.lognorm.nnlf(arg_2,arg_0.data)

            # Is this the right likelihood ratio?
            # Definition of L from eqn. B3 of Clauset et al 2009:
            # L = log(p(x|alpha))
            # _nnlf from scipy.stats.distributions:
            # -sum(log(self._pdf(x, *args)),axis=0)
            # Assuming the pdf and p(x|alpha) are both non-inverted, it looks
            # like the _nnlf and L have opposite signs, which would explain the
            # likelihood ratio I've used here:
            arg_0.power_lognorm_likelihood = (arg_0._likelihood + arg_0.Func_likelihood)
            # a previous version had 2*(above).  That is the correct form if you want the likelihood ratio
            # statistic "D": http://en.wikipedia.org/wiki/Likelihood-ratio_test
            # The above explanation makes sense, since nnlf is the *negative* log likelihood function:
            ## nnlf  -- negative log likelihood function (to minimize)
            #
            # Assuming we want the ratio between the POSITIVE likelihoods, the D statistic is:
            # D = -2 log( L_power / L_Func )
            arg_0.likelihood_ratio_D = -2 * (log(arg_0._likelihood/arg_0.Func_likelihood))

            if arg_1:
                print("Lognormal KS D: %g  p(D): %g" % (arg_0.Func_ksD,arg_0.Func_ksP), end=' ')
                print("  Likelihood Ratio Statistic (powerlaw/Func): %g" % arg_0.likelihood_ratio_D)
                print("At this point, have a look at Clauset et al 2009 Appendix C: determining sigma(likelihood_ratio)")

Use the maximum likelihood estimator for a lognormal distribution to produce the best - fit lognormal parameters


def Func ( arg_0 ) : arg_1 = arg_0 . cnxn . xfer ( [ 0xCF ] ) [ 0 ] sleep ( 0.1 ) return True if arg_1 == 0xF3 else False

def Func(arg_0):
        """Checks the connection between the Raspberry Pi and the OPC

        :rtype: Boolean
        """
        arg_1 = arg_0.cnxn.xfer([0xCF])[0]           # send the command byte

        sleep(0.1)

        return True if arg_1 == 0xF3 else False


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . join ( arg_0 . _bucket_root , arg_1 ) arg_3 = list ( arg_0 . _bucket . objects . filter ( Prefix = arg_2 ) ) for arg_4 in arg_3 : arg_4 . delete ( )

def Func(arg_0, arg_1):
        """Delete a file from the bucket.

        Parameters
        ----------
        filename : `str`
            Name of the file, relative to ``bucket_root/``.
        """
        arg_2 = os.path.join(arg_0._bucket_root, arg_1)
        arg_3 = list(arg_0._bucket.objects.filter(Prefix=arg_2))
        for arg_4 in arg_3:
            arg_4.delete()


(self, cmp1="hue", cmp2="brightness", reversed=False, n=12)

def Func(arg_0, arg_1="hue", arg_2="brightness", arg_3=False, arg_4=12):
        """
        Sorts the list by cmp1, then cuts it into n pieces which are sorted by cmp2.

        If you want to cluster by hue, use n=12 (since there are 12 primary/secondary hues).
        The resulting list will not contain n even slices:
        n is used rather to slice up the cmp1 property of the colors,
        e.g. cmp1=brightness and n=3 will cluster colors by brightness >= 0.66, 0.33, 0.0
        """
        arg_5 = arg_0.sort(arg_1)
        arg_6 = ColorList()

        arg_7 = 1.0
        arg_8 = 0
        for arg_9 in _range(len(arg_5)):
            if getattr(arg_5[arg_9], arg_1) < arg_7:
                arg_6.extend(arg_5[arg_8:arg_9].sort(arg_2))
                arg_7 -= 1.0 / arg_4
                arg_8 = arg_9
        arg_6.extend(arg_5[arg_8:].sort(arg_2))
        if arg_3: _list.reverse(arg_6)
        return arg_6

Sorts the list by cmp1 then cuts it into n pieces which are sorted by cmp2 .


def Func ( arg_0 ) : arg_1 = PyFunceble . CONFIGURATION [ "links" ] [ "psl" ] arg_1 = Version ( True ) . right_url_from_version ( arg_1 ) arg_2 = ( PyFunceble . CURRENT_DIRECTORY + PyFunceble . CONFIGURATION [ "outputs" ] [ "default_files" ] [ "public_suffix" ] ) if not Version ( True ) . is_cloned ( ) or not PyFunceble . path . isfile ( arg_2 ) : return Download ( arg_1 , arg_2 ) . text ( ) return None

def Func(arg_0):
        """
        Download `public-suffix.json` if not present.
        """

        # We initiate the link to the public suffix configuration.
        # It is not hard coded because this method is called only if we
        # are sure that the configuration file exist.
        arg_1 = PyFunceble.CONFIGURATION["links"]["psl"]

        # We update the link according to our current version.
        arg_1 = Version(True).right_url_from_version(arg_1)

        # We set the destination of the downloaded file.
        arg_2 = (
            PyFunceble.CURRENT_DIRECTORY
            + PyFunceble.CONFIGURATION["outputs"]["default_files"]["public_suffix"]
        )

        if not Version(True).is_cloned() or not PyFunceble.path.isfile(arg_2):
            # The current version is not the cloned version.

            # We Download the link content and return the download status.
            return Download(arg_1, arg_2).text()

        # We are in the cloned version.

        # We do not need to download the file, so we are returning None.
        return None

Download public - suffix . json if not present .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
server
arg_2
,
arg_3
,
arg_4
,
arg_5
=
extract_params
(
)
try
:
arg_6
,
arg_7
=
arg_1
.
get_realms_and_credentials
(
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
)
arg_8
=
arg_1
.
create_authorization_response
(
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
,
arg_7
)
log
.
debug
(
'Authorization successful.'
)
return
create_response
(
*
arg_8
)
except
errors
.
OAuth1Error
as
e
:
return
redirect
(
e
.
in_uri
(
arg_0
.
error_uri
)
)
except
errors
.
InvalidClientError
as
e
:
return
redirect
(
e
.
in_uri
(
arg_0
.
error_uri
)
)

def Func(arg_0):
        """When consumer confirm the authrozation."""
        arg_1 = arg_0.server

        arg_2, arg_3, arg_4, arg_5 = extract_params()
        try:
            arg_6, arg_7 = arg_1.get_realms_and_credentials(
                arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5
            )
            arg_8 = arg_1.create_authorization_response(
                arg_2, arg_3, arg_4, arg_5, arg_6, arg_7
            )
            log.debug('Authorization successful.')
            return create_response(*arg_8)
        except errors.OAuth1Error as e:
            return redirect(e.in_uri(arg_0.error_uri))
        except errors.InvalidClientError as e:
            return redirect(e.in_uri(arg_0.error_uri))

When consumer confirm the authrozation .


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = institute_and_case ( store , arg_0 , arg_1 ) arg_4 = store . user ( current_user . email ) arg_5 = request . form [ 'collaborator' ] arg_6 = 'revoke' in request . form arg_7 = url_for ( '.case' , arg_0 = arg_0 , arg_1 = arg_1 ) if arg_6 : store . unFunc ( arg_2 , arg_3 , arg_5 , arg_4 , arg_7 ) else : store . Func ( arg_2 , arg_3 , arg_5 , arg_4 , arg_7 ) return redirect ( request . referrer )

def Func(arg_0, arg_1):
    """Share a case with a different institute."""
    arg_2, arg_3 = institute_and_case(store, arg_0, arg_1)
    arg_4 = store.user(current_user.email)
    arg_5 = request.form['collaborator']
    arg_6 = 'revoke' in request.form
    arg_7 = url_for('.case', arg_0=arg_0, arg_1=arg_1)

    if arg_6:
        store.unFunc(arg_2, arg_3, arg_5, arg_4, arg_7)
    else:
        store.Func(arg_2, arg_3, arg_5, arg_4, arg_7)

    return redirect(request.referrer)

Share a case with a different institute .


def
Func
(
arg_0
,
Func
,
arg_2
)
:
try
:
arg_3
=
getattr
(
arg_0
,
arg_0
.
CMD_MAP
[
Func
]
[
1
]
)
except
(
IndexError
,
KeyError
)
:
return
arg_0
.
screen
.
print_error
(
"Invalid command {!r}!"
.
format
(
Func
)
)
arg_3
(
arg_2
)

def Func(arg_0, Func, arg_2):
        """Input callback, handles key presses
        """
        try:
            arg_3 = getattr(arg_0, arg_0.CMD_MAP[Func][1])
        except (IndexError, KeyError):
            return arg_0.screen.print_error(
                "Invalid command {!r}!".format(Func))

        arg_3(arg_2)


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting dropout ...'
)
if
arg_6
==
'short'
:
arg_7
=
'DO'
+
random_string
(
6
)
elif
arg_6
==
'keep'
:
arg_7
=
arg_1
else
:
arg_7
=
arg_1
+
str
(
random
.
random
(
)
)
arg_8
=
keras
.
layers
.
Dropout
(
rate
=
arg_0
[
'ratio'
]
,
name
=
arg_7
)
arg_4
[
arg_2
]
=
arg_8
(
arg_4
[
arg_3
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert dropout.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting dropout ...')

    if arg_6 == 'short':
        arg_7 = 'DO' + random_string(6)
    elif arg_6 == 'keep':
        arg_7 = arg_1
    else:
        arg_7 = arg_1 + str(random.random())

    arg_8 = keras.layers.Dropout(rate=arg_0['ratio'], name=arg_7)
    arg_4[arg_2] = arg_8(arg_4[arg_3[0]])


def Func ( ) : from django . conf import settings for arg_0 in settings . INSTALLED_APPS : arg_1 = import_module ( arg_0 ) if module_has_submodule ( arg_1 , 'emails' ) : arg_2 = import_module ( '%s.emails' % arg_0 ) try : import_module ( '%s.emails.previews' % arg_0 ) except ImportError : if module_has_submodule ( arg_2 , 'previews' ) : raise

def Func():
    """
    Imports all available previews classes.
    """
    from django.conf import settings
    for arg_0 in settings.INSTALLED_APPS:
        arg_1 = import_module(arg_0)

        if module_has_submodule(arg_1, 'emails'):
            arg_2 = import_module('%s.emails' % arg_0)
            try:
                import_module('%s.emails.previews' % arg_0)
            except ImportError:
                # Only raise the exception if this module contains previews and
                # there was a problem importing them. (An emails module that
                # does not contain previews is not an error.)
                if module_has_submodule(arg_2, 'previews'):
                    raise

Imports all available previews classes .


Load all operands and process them by self._evalFn

def Func ( arg_0 , arg_1 , arg_2 = None ) : def getVal ( arg_3 ) : while not isinstance ( arg_3 , Value ) : arg_3 = arg_3 . _val return arg_3 arg_4 = list ( map ( getVal , arg_1 . operands ) ) if isEventDependentOp ( arg_1 . operator ) : arg_4 . append ( arg_2 . now ) elif arg_1 . operator == AllOps . IntToBits : arg_4 . append ( arg_1 . result . _dtype ) return arg_0 . _FuncFn ( * arg_4 )

def Func(arg_0, arg_1, arg_2=None):
        """Load all operands and process them by self._FuncFn"""
        def getVal(arg_3):
            while not isinstance(arg_3, Value):
                arg_3 = arg_3._val

            return arg_3

        arg_4 = list(map(getVal, arg_1.operands))

        if isEventDependentOp(arg_1.operator):
            arg_4.append(arg_2.now)
        elif arg_1.operator == AllOps.IntToBits:
            arg_4.append(arg_1.result._dtype)

        return arg_0._FuncFn(*arg_4)

Load all operands and process them by self . _evalFn


(step_size_parts, volatility_parts, grads_volatility,
               grads_target_log_prob,
               name=None)

def Func(arg_0, arg_1, arg_2,
               arg_3,
               arg_4=None):
  """Compute diffusion drift at the current location `current_state`.

  The drift of the diffusion at is computed as

  ```none
  0.5 * `step_size` * volatility_parts * `target_log_prob_fn(current_state)`
  + `step_size` * `grads_volatility`
  ```

  where `volatility_parts` = `volatility_fn(current_state)**2` and
  `grads_volatility` is a gradient of `volatility_parts` at the `current_state`.

  Args:
    step_size_parts: Python `list` of `Tensor`s representing the step size for
      Euler-Maruyama method. Must broadcast with the shape of
      `volatility_parts`.  Larger step sizes lead to faster progress, but
      too-large step sizes make rejection exponentially more likely. When
      possible, it's often helpful to match per-variable step sizes to the
      standard deviations of the target distribution in each variable.
    volatility_parts: Python `list` of `Tensor`s representing the value of
      `volatility_fn(*state_parts)`.
    grads_volatility: Python list of `Tensor`s representing the value of the
      gradient of `volatility_parts**2` wrt the state of the chain.
    grads_target_log_prob: Python list of `Tensor`s representing
      gradient of `target_log_prob_fn(*state_parts`) wrt `state_parts`. Must
      have same shape as `volatility_parts`.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'malaFunc').

  Returns:
    drift_parts: Tensor or Python list of `Tensor`s representing the
      state(s) of the Markov chain(s) at each result step. Has same shape as
      input `current_state_parts`.
  """

  with tf.compat.v1.name_scope(arg_4, 'malaFunc', [
      arg_0, arg_1, arg_2, arg_3
  ]):

    arg_5 = []

    for arg_6, arg_7, arg_8, arg_9 in (
        zip(arg_0,
            arg_1,
            arg_2,
            arg_3)):
      arg_10 = tf.square(arg_7)
      arg_11 = 0.5 * arg_6 * (arg_10 * arg_9
                                 + arg_8)
      arg_5.append(arg_11)

    return arg_5

Compute diffusion drift at the current location `current_state`.

  The drift of the diffusion at is computed as

  ```none
  0.5 * `step_size` * volatility_parts * `target_log_prob_fn(current_state)`
  + `step_size` * `grads_volatility`
  ```

  where `volatility_parts` = `volatility_fn(current_state)**2` and
  `grads_volatility` is a gradient of `volatility_parts` at the `current_state`.

  Args:
    step_size_parts: Python `list` of `Tensor`s representing the step size for
      Euler-Maruyama method. Must broadcast with the shape of
      `volatility_parts`.  Larger step sizes lead to faster progress, but
      too-large step sizes make rejection exponentially more likely. When
      possible, it's often helpful to match per-variable step sizes to the
      standard deviations of the target distribution in each variable.
    volatility_parts: Python `list` of `Tensor`s representing the value of
      `volatility_fn(*state_parts)`.
    grads_volatility: Python list of `Tensor`s representing the value of the
      gradient of `volatility_parts**2` wrt the state of the chain.
    grads_target_log_prob: Python list of `Tensor`s representing
      gradient of `target_log_prob_fn(*state_parts`) wrt `state_parts`. Must
      have same shape as `volatility_parts`.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'mala_get_drift').

  Returns:
    drift_parts: Tensor or Python list of `Tensor`s representing the
      state(s) of the Markov chain(s) at each result step. Has same shape as
      input `current_state_parts`.

Compute diffusion drift at the current location current_state .


(dim=2, N=256, n=-2.5, t=None, scale=1, seed=None)

return vaex.file.other.Zeldovich(dim=dim, N=N, n=n, t=t, scale=scale)

def Func(arg_0=2, arg_1=256, arg_2=-2.5, arg_3=None, arg_4=1, arg_5=None):
    """Creates a Func DataFrame.
    """
    import vaex.file
    return vaex.file.other.Zeldovich(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
'__init__.py'
arg_0
=
os
.
path
.
normpath
(
os
.
path
.
abspath
(
arg_0
)
)
if
arg_2
in
os
.
listdir
(
arg_0
)
:
arg_3
=
arg_0
.
split
(
os
.
path
.
sep
)
[
1
]
print
"Searching modules in"
,
arg_0
else
:
print
"No modules in"
,
arg_0
return
def
makename
(
arg_4
,
arg_5
)
:
if
arg_4
:
arg_6
=
arg_4
if
arg_5
:
arg_6
+=
'.'
+
arg_5
else
:
arg_6
=
arg_5
return
arg_6
arg_7
=
[
]
for
arg_8
in
arg_1
.
keys
(
)
:
if
arg_1
[
arg_8
]
is
:
arg_7
.
append
(
arg_8
)
arg_9
=
{
}
arg_10
=
0
arg_11
=
0
def
save
(
arg_5
,
arg_12
)
:
arg_6
=
arg_5
+
"."
+
arg_12
for
arg_13
in
arg_7
:
if
arg_6
.
startswith
(
arg_13
)
:
print
"Skipping "
+
arg_6
return
False
if
arg_1
.
has_key
(
arg_5
)
:
if
arg_12
in
arg_1
[
arg_5
]
:
print
"Skipping "
+
arg_6
return
False
if
not
arg_9
.
has_key
(
arg_5
)
:
arg_9
[
arg_5
]
=
[
]
arg_9
[
arg_5
]
.
append
(
arg_12
)
return
True
for
arg_14
,
arg_15
,
arg_16
in
os
.
walk
(
arg_0
)
:
arg_17
=
sorted
(
[
f
for
f
in
arg_16
if
os
.
path
.
splitext
(
f
)
[
1
]
==
'.py'
]
)
if
arg_2
in
arg_17
:
arg_18
=
arg_14
[
len
(
arg_0
)
:
]
.
lstrip
(
os
.
path
.
sep
)
.
replace
(
os
.
path
.
sep
,
'.'
)
arg_19
=
makename
(
arg_3
,
arg_18
)
arg_20
=
arg_19
.
rpartition
(
'.'
)
arg_21
,
arg_12
=
arg_20
[
0
]
,
arg_20
[
2
]
arg_11
+=
1
if
save
(
arg_21
,
arg_12
)
:
arg_10
+=
1
arg_17
.
remove
(
arg_2
)
for
arg_22
in
arg_17
:
arg_11
+=
1
arg_5
=
os
.
path
.
splitext
(
arg_22
)
[
0
]
if
save
(
arg_19
,
arg_5
)
:
arg_10
+=
1
for
arg_23
in
arg_9
.
keys
(
)
:
arg_9
[
arg_23
]
.
sort
(
)
print
"%s contains %i submodules, %i skipped"
%
(
arg_3
,
arg_11
,
arg_11
arg_10
)
return
arg_9

def Func(arg_0, arg_1):
    """
    Look for every file in the directory tree and return a dict
    Hacked from sphinx.autodoc
    """

    arg_2 = '__init__.py'

    arg_0 = os.path.normpath(os.path.abspath(arg_0))
    if arg_2 in os.listdir(arg_0):
        arg_3 = arg_0.split(os.path.sep)[-1]
        print "Searching modules in", arg_0
    else:
        print "No modules in", arg_0
        return

    def makename(arg_4, arg_5):
        """Join package and module with a dot."""
        if arg_4:
            arg_6 = arg_4
            if arg_5:
                arg_6 += '.' + arg_5
        else:
            arg_6 = arg_5
        return arg_6

    arg_7 = []
    for arg_8 in arg_1.keys():
        if arg_1[arg_8] is None: arg_7.append(arg_8)

    arg_9 = {}
    arg_10 = 0
    arg_11 = 0
    def save(arg_5, arg_12):
        arg_6 = arg_5+ "."+ arg_12

        for arg_13 in arg_7:
            if arg_6.startswith(arg_13):
                print "Skipping "+arg_6
                return False
        if arg_1.has_key(arg_5):
            if arg_12 in arg_1[arg_5]:
                print "Skipping "+arg_6
                return False
        if not arg_9.has_key(arg_5):
            arg_9[arg_5] = []
        arg_9[arg_5].append(arg_12)
        return True

    for arg_14, arg_15, arg_16 in os.walk(arg_0):
        arg_17 = sorted([f for f in arg_16 if os.path.splitext(f)[1] == '.py'])

        if arg_2 in arg_17:
            arg_18 = arg_14[len(arg_0):].lstrip(os.path.sep).\
                replace(os.path.sep, '.')
            arg_19 = makename(arg_3, arg_18)
            arg_20 = arg_19.rpartition('.')
            arg_21, arg_12 = arg_20[0], arg_20[2]
            arg_11 += 1
            if save(arg_21, arg_12): arg_10 += 1

            arg_17.remove(arg_2)
            for arg_22 in arg_17:
                arg_11 += 1
                arg_5 = os.path.splitext(arg_22)[0]
                if save(arg_19, arg_5): arg_10 += 1
    for arg_23 in arg_9.keys():
        arg_9[arg_23].sort()
    print "%s contains %i submodules, %i skipped" % \
          (arg_3, arg_11, arg_11-arg_10)

    return arg_9

Look for every file in the directory tree and return a dict Hacked from sphinx . autodoc


def Func(arg_0: arg_1, arg_2: arg_3) -> arg_1:
    """Get a sub-graph induced over all nodes matching the query string.

    :param graph: A BEL Graph
    :param query: A query string or iterable of query strings for node names

    Thinly wraps :func:`search_node_names` and :func:`get_subgraph_by_induction`.
    """
    arg_4 = search_node_names(arg_0, arg_2)
    return get_subgraph_by_induction(arg_0, arg_4)

Get a sub - graph induced over all nodes matching the query string .


def Func ( arg_0 ) : arg_1 = MarkdownLexer ( ) for arg_2 in arg_1 . aliases : arg_0 . add_lexer ( arg_2 , arg_1 ) return dict ( version = __version__ )

def Func(arg_0):
    """ Initializer for Sphinx extension API.

        See http://www.sphinx-doc.org/en/stable/extdev/index.html#dev-extensions.
    """
    arg_1 = MarkdownLexer()
    for arg_2 in arg_1.aliases:
        arg_0.add_lexer(arg_2, arg_1)

    return dict(version=__version__)


return dict(
        ipython_version=release.version,
        ipython_path=pkg_path,
        commit_source=src,
        commit_hash=hsh,
        sys_version=sys.version,
        sys_executable=sys.executable,
        sys_platform=sys.platform,
        platform=platform.platform(),
        os_name=os.name,
        default_encoding=encoding.DEFAULT_ENCODING,
        )

def Func ( arg_0 ) : arg_1 , arg_2 = pkg_commit_hash ( arg_0 ) return dict ( ipython_version = release . version , ipython_path = arg_0 , commit_source = arg_1 , commit_hash = arg_2 , sys_version = sys . version , sys_executable = sys . executable , sys_platform = sys . platform , platform = platform . platform ( ) , os_name = os . name , default_encoding = encoding . DEFAULT_ENCODING , )

def Func(arg_0):
    """Return dict describing the context of this package

    Parameters
    ----------
    pkg_path : str
       path containing __init__.py for package

    Returns
    -------
    context : dict
       with named parameters of interest
    """
    arg_1, arg_2 = pkg_commit_hash(arg_0)
    return dict(
        ipython_version=release.version,
        ipython_path=arg_0,
        commit_source=arg_1,
        commit_hash=arg_2,
        sys_version=sys.version,
        sys_executable=sys.executable,
        sys_platform=sys.platform,
        platform=platform.platform(),
        os_name=os.name,
        default_encoding=encoding.DEFAULT_ENCODING,
        )


def Func(arg_0):
        """Creates a websocket connection.

        :return:
        """
        arg_0.log.debug("Func(): Initializing Connection..")
        arg_0.socket = websocket.WebSocketApp(
            arg_0.url,
            on_open=arg_0._on_open,
            on_message=arg_0._on_message,
            on_error=arg_0._on_error,
            on_close=arg_0._on_close
        )

        if 'ca_certs' not in arg_0.sslopt.keys():
            arg_2 = ssl.get_default_verify_paths()
            arg_0.sslopt['ca_certs'] = arg_2.cafile

        arg_0.log.debug("Func(): Starting Connection..")
        arg_0.socket.run_forever(arg_3=arg_0.sslopt,
                        http_proxy_host=arg_0.http_proxy_host,
                        http_proxy_port=arg_0.http_proxy_port,
                        http_proxy_auth=arg_0.http_proxy_auth,
                        http_no_proxy=arg_0.http_no_proxy)

        # stop outstanding ping/pong timers
        arg_0._stop_timers()
        while arg_0.reconnect_required.is_set():
            if not arg_0.disconnect_called.is_set():
                arg_0.log.info("Attempting to connect again in %s seconds."
                              % arg_0.reconnect_interval)
                arg_0.state = "unavailable"
                time.sleep(arg_0.reconnect_interval)

                # We need to set this flag since closing the socket will
                # set it to False
                arg_0.socket.keep_running = True
                arg_0.socket.sock = None
                arg_0.socket.run_forever(arg_3=arg_0.sslopt,
                                http_proxy_host=arg_0.http_proxy_host,
                                http_proxy_port=arg_0.http_proxy_port,
                                http_proxy_auth=arg_0.http_proxy_auth,
                                http_no_proxy=arg_0.http_no_proxy)
            else:
                break


def Func ( arg_0 ) : arg_1 = open ( arg_0 , 'rb' ) arg_2 = arg_1 . read ( 5000 ) arg_1 . close ( ) arg_3 = "unknown" if b"SWHLab4[" in arg_2 : arg_3 = arg_2 . split ( b"SWHLab4[" ) [ 1 ] . split ( b"]" , 1 ) [ 0 ] elif b"SWH[" in arg_2 : arg_3 = arg_2 . split ( b"SWH[" ) [ 1 ] . split ( b"]" , 1 ) [ 0 ] else : arg_3 = "?" if not type ( arg_3 ) is str : arg_3 = arg_3 . decode ( "utf-8" ) return arg_3

def Func(arg_0):
    """determine the comment cooked in the protocol."""
    arg_1=open(arg_0,'rb')
    arg_2=arg_1.read(5000) #it should be in the first 5k of the file
    arg_1.close()
    arg_3="unknown"
    if b"SWHLab4[" in arg_2:
        arg_3=arg_2.split(b"SWHLab4[")[1].split(b"]",1)[0]
    elif b"SWH[" in arg_2:
        arg_3=arg_2.split(b"SWH[")[1].split(b"]",1)[0]
    else:
        arg_3="?"
    if not type(arg_3) is str:
        arg_3=arg_3.decode("utf-8")
    return arg_3

determine the comment cooked in the protocol .


async def Func(arg_0, arg_1):
        """Receive Conversation delta and create or update the conversation.

        Args:
            conversation: hangouts_pb2.Conversation instance

        Raises:
            NetworkError: A request to fetch the complete conversation failed.
        """
        arg_2 = arg_1.conversation_id.id
        arg_3 = arg_0._conv_dict.get(arg_2, None)
        if arg_3 is None:
            # Ignore the delta and fetch the complete conversation.
            await arg_0._get_or_fetch_conversation(arg_2)
        else:
            # Update conversation using the delta.
            arg_3.update_conversation(arg_1)

Receive Conversation delta and create or update the conversation .


(
        self, start_loc: Optional[Tuple[int, int]] = None
    )

def
Func
(
arg_0
,
arg_1
:
arg_2
[
arg_3
[
arg_4
,
arg_4
]
]
=
)
->
"Node"
:
if
arg_0
.
env
.
line
is
or
arg_0
.
env
.
col
is
:
arg_5
=
arg_1
else
:
arg_5
=
(
arg_0
.
env
.
line
,
arg_0
.
env
.
col
)
assert
arg_5
is
not
and
all
(
[
arg_6
is
not
for
arg_6
in
arg_5
]
)
,
"Must specify location information"
arg_7
:
MutableMapping
[
str
,
Union
[
NodeEnv
,
Node
,
Iterable
[
Node
]
]
]
=
{
"env"
:
attr
.
evolve
(
arg_0
.
env
,
line
=
arg_5
[
0
]
,
col
=
arg_5
[
1
]
)
}
for
arg_8
in
arg_0
.
children
:
arg_9
=
munge
(
arg_8
.
name
)
assert
arg_9
!=
"env"
,
"Node environment already set"
if
arg_9
.
endswith
(
"s"
)
:
arg_10
:
Iterable
[
Node
]
=
getattr
(
arg_0
,
arg_9
)
assert
arg_10
is
not
,
"Listed child must not be none"
arg_11
=
[
]
for
arg_12
in
arg_10
:
arg_11
.
append
(
arg_12
.
Func
(
arg_1
)
)
arg_7
[
arg_9
]
=
vec
.
vector
(
arg_11
)
else
:
arg_13
:
Node
=
getattr
(
arg_0
,
arg_9
)
assert
arg_13
is
not
,
"Listed child must not be none"
arg_7
[
arg_9
]
=
arg_13
.
Func
(
arg_1
)
return
arg_0
.
assoc
(
**
arg_7
)

def Func(
        arg_0, arg_1: arg_2[arg_3[arg_4, arg_4]] = None
    ) -> "Node":
        """Return a transformed copy of this node with location in this node's
        environment updated to match the `start_loc` if given, or using its
        existing location otherwise. All child nodes will be recursively
        transformed and replaced. Child nodes will use their parent node
        location if they do not have one."""
        if arg_0.env.line is None or arg_0.env.col is None:
            arg_5 = arg_1
        else:
            arg_5 = (arg_0.env.line, arg_0.env.col)

        assert arg_5 is not None and all(
            [arg_6 is not None for arg_6 in arg_5]
        ), "Must specify location information"

        arg_7: MutableMapping[str, Union[NodeEnv, Node, Iterable[Node]]] = {
            "env": attr.evolve(arg_0.env, line=arg_5[0], col=arg_5[1])
        }
        for arg_8 in arg_0.children:
            arg_9 = munge(arg_8.name)
            assert arg_9 != "env", "Node environment already set"

            if arg_9.endswith("s"):
                arg_10: Iterable[Node] = getattr(arg_0, arg_9)
                assert arg_10 is not None, "Listed child must not be none"
                arg_11 = []
                for arg_12 in arg_10:
                    arg_11.append(arg_12.Func(arg_1))
                arg_7[arg_9] = vec.vector(arg_11)
            else:
                arg_13: Node = getattr(arg_0, arg_9)
                assert arg_13 is not None, "Listed child must not be none"
                arg_7[arg_9] = arg_13.Func(arg_1)

        return arg_0.assoc(**arg_7)

Return a transformed copy of this node with location in this node s environment updated to match the start_loc if given or using its existing location otherwise . All child nodes will be recursively transformed and replaced . Child nodes will use their parent node location if they do not have one .


def Func ( arg_0 , arg_1 = False ) : arg_2 = '%s.gz' % arg_0 try : if os . path . exists ( arg_2 ) and not arg_1 : os . remove ( arg_0 ) return arg_2 else : with open ( arg_0 , 'rb' ) as infd : with gzip . open ( arg_2 , 'wb' ) as outfd : shutil . copyfileobj ( infd , outfd ) if os . path . exists ( arg_2 ) : os . remove ( arg_0 ) return arg_2 except Exception as e : return None

def Func(arg_0, arg_1=False):
    '''This just compresses the sqlitecurve. Should be independent of OS.

    '''

    arg_2 = '%s.gz' % arg_0

    try:

        if os.path.exists(arg_2) and not arg_1:
            os.remove(arg_0)
            return arg_2

        else:

            with open(arg_0,'rb') as infd:
                with gzip.open(arg_2,'wb') as outfd:
                    shutil.copyfileobj(infd, outfd)

            if os.path.exists(arg_2):
                os.remove(arg_0)
                return arg_2

    except Exception as e:
        return None

This just compresses the sqlitecurve . Should be independent of OS .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Add tomography measurement circuits to a QuantumProgram.

    The quantum program must contain a circuit 'name', which is treated as a
    state preparation circuit for state tomography, or as teh circuit being
    measured for process tomography. This function then appends the circuit
    with a set of measurements specified by the input `tomography_set`,
    optionally it also prepends the circuit with state preparation circuits if
    they are specified in the `tomography_set`.

    For n-qubit tomography with a tomographically complete set of preparations
    and measurements this results in $4^n 3^n$ circuits being added to the
    quantum program.

    Args:
        circuit (QuantumCircuit): The circuit to be appended with tomography
                                  state preparation and/or measurements.
        qreg (QuantumRegister): the quantum register containing qubits to be
                                measured.
        creg (ClassicalRegister): the classical register containing bits to
                                  store measurement outcomes.
        tomoset (tomography_set): the dict of tomography configurations.

    Returns:
        list: A list of quantum tomography circuits for the input circuit.

    Raises:
        QiskitError: if circuit is not a valid QuantumCircuit

    Example:
        For a tomography set specifying state tomography of qubit-0 prepared
        by a circuit 'circ' this would return:
        ```
        ['circ_meas_X(0)', 'circ_meas_Y(0)', 'circ_meas_Z(0)']
        ```
        For process tomography of the same circuit with preparation in the
        SIC-POVM basis it would return:
        ```
        [
            'circ_prep_S0(0)_meas_X(0)', 'circ_prep_S0(0)_meas_Y(0)',
            'circ_prep_S0(0)_meas_Z(0)', 'circ_prep_S1(0)_meas_X(0)',
            'circ_prep_S1(0)_meas_Y(0)', 'circ_prep_S1(0)_meas_Z(0)',
            'circ_prep_S2(0)_meas_X(0)', 'circ_prep_S2(0)_meas_Y(0)',
            'circ_prep_S2(0)_meas_Z(0)', 'circ_prep_S3(0)_meas_X(0)',
            'circ_prep_S3(0)_meas_Y(0)', 'circ_prep_S3(0)_meas_Z(0)'
        ]
        ```
    """

    if not isinstance(arg_0, QuantumCircuit):
        raise QiskitError('Input circuit must be a QuantumCircuit object')

    arg_4 = arg_3['circuits']
    arg_5 = tomography_circuit_names(arg_3, arg_0.name)
    arg_6 = []
    for arg_7, arg_8 in zip(arg_5, arg_4):
        arg_9 = arg_0
        # Add prep circuits
        if 'prep' in arg_8:
            arg_10 = QuantumCircuit(arg_1, arg_2, arg_14='tmp_prep')
            for arg_11, arg_12 in arg_8['prep'].items():
                arg_3['prep_basis'].prep_gate(arg_10, arg_1[arg_11], arg_12)
                arg_10.barrier(arg_1[arg_11])
            arg_9 = arg_10 + arg_9
        # Add measurement circuits
        arg_13 = QuantumCircuit(arg_1, arg_2, arg_14='tmp_meas')
        for arg_11, arg_12 in arg_8['meas'].items():
            arg_13.barrier(arg_1[arg_11])
            arg_3['meas_basis'].meas_gate(arg_13, arg_1[arg_11], arg_12)
            arg_13.measure(arg_1[arg_11], arg_2[arg_11])
        arg_9 = arg_9 + arg_13
        # Add label to the circuit
        arg_9.name = arg_7
        arg_6.append(arg_9)

    logger.info('>> created tomography circuits for "%s"', arg_0.name)
    return arg_6

Add tomography measurement circuits to a QuantumProgram .