return http_method(TRELLO_URL + self._url, *args, **kwargs)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_3 . setdefault ( 'params' , { } ) arg_4 . update ( { 'key' : arg_0 . _apikey } ) if arg_0 . _token is not None : arg_4 . update ( { 'token' : arg_0 . _token } ) arg_5 = getattr ( requests , arg_1 ) return arg_5 ( TRELLO_URL + arg_0 . _url , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Makes the HTTP request.

        """
        arg_4 = arg_3.setdefault('params', {})
        arg_4.update({'key': arg_0._apikey})
        if arg_0._token is not None:
            arg_4.update({'token': arg_0._token})

        arg_5 = getattr(requests, arg_1)
        return arg_5(TRELLO_URL + arg_0._url, *arg_2, **arg_3)


(self, micro_architecture, asm_block='auto',
                      pointer_increment='auto_with_manual_fallback', verbose=False)

return iaca.iaca_analyse_instrumented_binary(obj_name, micro_architecture), self.asm_block

def Func(arg_0, arg_1, arg_2='auto',
                      arg_3='auto_with_manual_fallback', arg_4=False):
        """
        Run an IACA analysis and return its outcome.

        *asm_block* controls how the to-be-marked block is chosen. "auto" (default) results in
        the largest block, "manual" results in interactive and a number in the according block.

        *pointer_increment* is the number of bytes the pointer is incremented after the loop or
           - 'auto': automatic detection, RuntimeError is raised in case of failure
           - 'auto_with_manual_fallback': automatic detection, fallback to manual input
           - 'manual': prompt user
        """
        arg_5 = arg_0.compile_kernel(assembly=True, arg_4=arg_4)
        arg_6 = os.path.splitext(arg_5)[0]+'-iaca.s'
        with open(arg_5, 'r') as in_file, open(arg_6, 'w') as out_file:
            arg_0.asm_block = iaca.iaca_instrumentation(
                in_file, out_file,
                block_selection=arg_2,
                arg_3=arg_3)
        arg_7 = arg_0.assemble_to_object(arg_6, arg_4=arg_4)
        return iaca.iaca_analyse_instrumented_binary(arg_7, arg_1), arg_0.asm_block

Run an IACA analysis and return its outcome .


def Func(arg_0):
        """
        Get a unique token for usage in differentiating test runs that need to
        run in parallel.
        """
        if arg_0._unique_token is None:
            arg_0._unique_token = arg_0._random_token()

        return arg_0._unique_token

Get a unique token for usage in differentiating test runs that need to run in parallel .


def
Func
(
arg_0
)
:
with
settings
(
hide
(
'running'
,
'warnings'
,
'stdout'
)
,
warn_only
=
True
)
:
arg_1
=
run_as_root
(
'blkid -U %s'
%
arg_0
)
if
not
arg_1
.
succeeded
:
return
return
arg_1

def Func(arg_0):
    """
    Get a HDD device by uuid

    Example::

        from burlap.disk import Func

        device = Func("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c")
        if device:
            mount(device,'/mountpoint')
    """
    with settings(hide('running', 'warnings', 'stdout'), warn_only=True):
        arg_1 = run_as_root('blkid -U %s' % arg_0)

        if not arg_1.succeeded:
            return None

        return arg_1

Get a HDD device by uuid

    Example::

        from burlap.disk import getdevice_by_uuid

        device = getdevice_by_uuid("356fafdc-21d5-408e-a3e9-2b3f32cb2a8c")
        if device:
            mount(device,'/mountpoint')


(self, node, key, max_depth=float('inf'), with_links=True, crun=None)

def Func(arg_0, arg_1, arg_2, arg_3=arg_4('inf'), arg_5=True, arg_6=None):
        """ Searches for an item in the tree below `node`

        :param node:

            The parent node below which the search is performed

        :param key:

            Name to search for. Can be the short name, the full name or parts of it

        :param max_depth:

            maximum search depth.

        :param with_links:

            If links should be considered

        :param crun:

            Used for very fast search if we know we operate in a single run branch

        :return: The found node and the depth it was found for

        """

        # If we find it directly there is no need for an exhaustive search
        if arg_2 in arg_1._children and (arg_5 or arg_2 not in arg_1._links):
            return arg_1._children[arg_2], 1

        # First the very fast search is tried that does not need tree traversal.
        try:
            arg_7 = arg_0._very_fastFunc(arg_1, arg_2, arg_3, arg_5, arg_6)
            if arg_7:
                return arg_7
        except pex.TooManyGroupsError:
            pass
        except pex.NotUniqueNodeError:
            pass

        # Slowly traverse the entire tree
        arg_8 = arg_0._iter_nodes(arg_1, recursive=True,
                                          arg_3=arg_3, inFunc=True,
                                          arg_5=arg_5)
        arg_9 = None
        arg_10 = arg_4('inf')
        for arg_11, arg_12, arg_13 in arg_8:

            if arg_11 > arg_10:
                # We can break here because we enter a deeper stage of the tree and we
                # cannot find matching node of the same depth as the one we found
                break

            if arg_2 == arg_12:
                # If result_node is not None means that we care about uniqueness and the search
                # has found more than a single solution.
                if arg_9 is not None:
                    raise pex.NotUniqueNodeError('Node `%s` has been found more than once within '
                                                 'the same depth %d. '
                                                 'Full name of first occurrence is `%s` and of '
                                                 'second `%s`'
                                                 % (arg_2, arg_13.v_depth, arg_9.v_full_name,
                                                    arg_13.v_full_name))

                arg_9 = arg_13
                arg_10 = arg_11

        return arg_9, arg_10

Searches for an item in the tree below node


def Func ( arg_0 ) : arg_1 = glob . glob ( os . path . join ( arg_0 . dirs . fastqs , "tmp_*_R*.fastq" ) ) arg_1 += glob . glob ( os . path . join ( arg_0 . dirs . fastqs , "tmp_*.p" ) ) for arg_2 in arg_1 : os . remove ( arg_2 )

def Func(arg_0):
    """ cleanup func for step 1 """
    arg_1 = glob.glob(os.path.join(arg_0.dirs.fastqs, "tmp_*_R*.fastq"))
    arg_1 += glob.glob(os.path.join(arg_0.dirs.fastqs, "tmp_*.p"))
    for arg_2 in arg_1:
        os.remove(arg_2)


(tx: Dict[str, any], v: int, r: int, s: int)

def Func(arg_0: arg_1[arg_2, arg_3], arg_4: arg_5, arg_6: arg_5, arg_7: arg_5) -> (bytes, HexBytes):
        """
        Signed transaction that compatible with `w3.eth.sendRawTransaction`
        Is not used because `pyEthereum` implementation of Transaction was found to be more
        robust regarding invalid signatures
        """
        arg_8 = serializable_unsigned_transaction_from_dict(arg_0)
        arg_9 = encode_transaction(arg_8, vrs=(arg_4, arg_6, arg_7))

        # To get the address signing, just do ecrecover_to_pub(unsigned_transaction.hash(), v, r, s)
        return arg_9, arg_8.hash()

Signed transaction that compatible with w3 . eth . sendRawTransaction Is not used because pyEthereum implementation of Transaction was found to be more robust regarding invalid signatures


def
Func
(
arg_0
)
:
if
arg_0
.
authenticated
:
arg_0
.
__logger
.
debug
(
"Func: already authenticated"
)
return
arg_0
.
__logger
.
debug
(
"doing handshake..."
)
arg_1
=
arg_0
.
_compute_handshake
(
)
arg_2
=
common_root
.
newTextChild
(
,
"handshake"
,
arg_1
)
arg_0
.
_write_node
(
arg_2
)
arg_2
.
unlinkNode
(
)
arg_2
.
freeNode
(
)
arg_0
.
__logger
.
debug
(
"handshake hash sent."
)

def Func(arg_0):
        """Authenticate on the server.

        [component only]"""
        if arg_0.authenticated:
            arg_0.__logger.debug("Func: already authenticated")
            return
        arg_0.__logger.debug("doing handshake...")
        arg_1=arg_0._compute_handshake()
        arg_2=common_root.newTextChild(None,"handshake",arg_1)
        arg_0._write_node(arg_2)
        arg_2.unlinkNode()
        arg_2.freeNode()
        arg_0.__logger.debug("handshake hash sent.")


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

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

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

        Notes
        -----
        If S2 is set to 0, the solution is the same as in the SRK EOS, and that
        is used. Otherwise, newton's method must be used to solve for `T`.
        There are 8 roots of T in that case, six of them real. No guarantee can
        be made regarding which root will be obtained.
        '''
        if arg_0.S2 == 0:
            arg_0.m = arg_0.S1
            return SRK.Func(arg_0, arg_1, arg_2, arg_3=arg_3)
        else:
            # Previously coded method is  63 microseconds vs 47 here
#            return super(SRK, self).Func(P, V, quick=quick)
            arg_5, arg_6, arg_7, arg_8, arg_9 = arg_0.Tc, arg_0.a, arg_0.b, arg_0.S1, arg_0.S2
            if arg_3:
                arg_10 = R/(arg_2-arg_7)
                arg_11 = (arg_2*(arg_2 + arg_7))
                def to_solve(arg_12):
                    arg_13 = (arg_12/arg_5)**0.5
                    arg_14 = arg_13 - 1.
                    return (arg_10*arg_12 - arg_6*(arg_8*arg_14 + arg_9*arg_14/arg_13 - 1.)**2/arg_11) - arg_1
            else:
                def to_solve(arg_12):
                    arg_15 = R*arg_12/(arg_2 - arg_7) - arg_6*(arg_8*(-sqrt(arg_12/arg_5) + 1) + arg_9*(-sqrt(arg_12/arg_5) + 1)/sqrt(arg_12/arg_5) + 1)**2/(arg_2*(arg_2 + arg_7))
                    return arg_15 - arg_1
            return newton(to_solve, arg_5*0.5)

r Method to calculate T from a specified P and V for the API SRK EOS . Uses a b and Tc obtained from the class s namespace .


def Func(arg_0, arg_1):
    """
    Reads deserialized data from proto object

    :param proto: (DynamicStructBuilder) Proto object

    :returns: (:class:`Connections`) instance
    """
    #pylint: disable=W0212
    arg_2 = arg_1.cells
    arg_3 = arg_0(len(arg_2))

    for arg_4, arg_5 in enumerate(arg_2):
      arg_5 = arg_2[arg_4]
      arg_6 = arg_5.segments
      arg_3._cells[arg_4] = CellData()
      arg_8 = arg_3._cells[arg_4]._segments

      for arg_9, arg_10 in enumerate(arg_6):
        arg_11 = Segment(arg_4, arg_3._nextFlatIdx,
                          arg_3._nextSegmentOrdinal)

        arg_8.append(arg_11)
        arg_3._segmentForFlatIdx.append(arg_11)
        arg_3._nextFlatIdx += 1
        arg_3._nextSegmentOrdinal += 1

        arg_12 = arg_11._synapses
        arg_13 = arg_10.synapses

        for arg_14, arg_15 in enumerate(arg_13):
          arg_16 = arg_15.presynapticCell
          arg_17 = Synapse(arg_11, arg_16, arg_15.permanence,
                            ordinal=arg_3._nextSynapseOrdinal)
          arg_3._nextSynapseOrdinal += 1
          arg_12.add(arg_17)
          arg_3._synapsesForPresynapticCell[arg_16].add(arg_17)

          arg_3._numSynapses += 1

    #pylint: enable=W0212
    return arg_3


def Func ( arg_0 , arg_1 : arg_2 ) -> Tuple [ Callable [ [ Value ] , bool ] , bool ] : arg_3 = False arg_4 = len ( arg_1 ) if arg_4 == 3 : arg_5 , arg_6 , arg_7 = arg_1 return ( mkArrayUpdater ( arg_5 , arg_6 , arg_3 ) , arg_7 ) else : arg_5 , arg_7 = arg_1 return ( mkUpdater ( arg_5 , arg_3 ) , arg_7 )

def Func(arg_0, arg_1: arg_2)\
            -> Tuple[Callable[[Value], bool], bool]:
        """
        This functions resolves write conflicts for signal

        :param actionSet: set of actions made by process
        """

        arg_3 = False
        arg_4 = len(arg_1)
        if arg_4 == 3:
            # update for item in array
            arg_5, arg_6, arg_7 = arg_1
            return (mkArrayUpdater(arg_5, arg_6, arg_3), arg_7)
        else:
            # update for simple signal
            arg_5, arg_7 = arg_1
            return (mkUpdater(arg_5, arg_3), arg_7)


(self, url=None, post_data={}, parse_data=False, key=None, parameters=None)

return self._fetch("DELETE", url, post_data=post_data, parse_data=parse_data, key=key, parameters=parameters, full_return=True)

def Func(arg_0, arg_1=None, arg_2={}, arg_3=False, arg_4=None, arg_5=None):
        """ Issue a PUT request.

        Kwargs:
            url (str): Destination URL
            post_data (dict): Dictionary of parameter and values
            parse_data (bool): If true, parse response data
            key (string): If parse_data==True, look for this key when parsing data
            parameters (dict): Additional GET parameters to append to the URL

        Returns:
            dict. Response (a dict with keys: success, data, info, body)

        Raises:
            AuthenticationError, ConnectionError, urllib2.HTTPError, ValueError, Exception
        """
        return arg_0._fetch("DELETE", arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, full_return=True)


def Func(arg_0):
    """Maxheap version of a heappop."""
    arg_1 = arg_0.pop()    # raises appropriate IndexError if heap is empty
    if arg_0:
        arg_2 = arg_0[0]
        arg_0[0] = arg_1
        _siftup_max(arg_0, 0)
        return arg_2
    return arg_1


return unipath(self.path, 'lib', py_ver, 'site-packages')

def Func ( arg_0 ) : if platform == 'win' : return unipath ( arg_0 . path , 'Lib' , 'site-packages' ) arg_1 = 'python{0}' . format ( sys . version [ : 3 ] ) return unipath ( arg_0 . path , 'lib' , arg_1 , 'site-packages' )

def Func(arg_0):
        '''Path to environments site-packages'''

        if platform == 'win':
            return unipath(arg_0.path, 'Lib', 'site-packages')

        arg_1 = 'python{0}'.format(sys.version[:3])
        return unipath(arg_0.path, 'lib', arg_1, 'site-packages')


def Func ( * arg_0 , ** arg_1 ) : arg_1 [ 'value' ] = str ( arg_1 [ 'value' ] ) arg_1 . pop ( 'options' , None ) return TextInput ( * arg_0 , ** arg_1 )

def Func(*arg_0, **arg_1):
    """Forces a parameter value to be text"""
    arg_1['value'] = str(arg_1['value'])
    arg_1.pop('options', None)
    return TextInput(*arg_0,**arg_1)


def Func ( arg_0 ) : arg_1 = Operators . EXTRACT ( arg_0 . AX , 15 , 1 ) arg_0 . EAX = Operators . SEXTEND ( arg_0 . AX , 16 , 32 ) arg_0 . EDX = Operators . SEXTEND ( arg_1 , 1 , 32 )

def Func(arg_0):
        """
        Converts word to doubleword.

        ::
            DX = sign-extend of AX.

        :param cpu: current CPU.
        """
        arg_1 = Operators.EXTRACT(arg_0.AX, 15, 1)
        arg_0.EAX = Operators.SEXTEND(arg_0.AX, 16, 32)
        arg_0.EDX = Operators.SEXTEND(arg_1, 1, 32)


def Func(arg_0,arg_1="",arg_2="plot",arg_3=False,arg_4=True):
    """
    frame the current matplotlib plot with ABF info, and optionally save it.
    Note that this is entirely independent of the ABFplot class object.
    if saveImage is False, show it instead.

    Datatype should be:
        * plot
        * experiment
    """
    print("closeWhenDone",arg_4)
    plt.tight_layout()
    plt.subplots_adjust(top=.93,bottom =.07)
    plt.annotate(arg_1,(.01,.99),xycoords='figure fraction',ha='left',va='top',family='monospace',size=10,alpha=.5)
    arg_5="%s [%s]"%(arg_0.ID,arg_0.protocomment)
    plt.annotate(arg_5,(.01,.01),xycoords='figure fraction',ha='left',va='bottom',family='monospace',size=10,alpha=.5)
    arg_6=arg_1.lower().replace(" ",'_')+".jpg"
    arg_6=arg_2+"_"+arg_6
    plt.tight_layout()
    if IMAGE_SAVE:
        arg_0.log.info("saving [%s]",arg_6)
        try:
            if arg_3:
                arg_7=os.path.abspath(arg_3)
            else:
                arg_7=os.path.abspath(arg_0.outPre+arg_6)
            if not os.path.exists(arg_0.outFolder):
                os.mkdir(arg_0.outFolder)
            plt.savefig(arg_7)
        except Exception as E:
            arg_0.log.error("saving [%s] failed! 'pip install pillow'?",arg_6)
            print(E)
    if IMAGE_SHOW==True:
        if arg_4==False:
            print("NOT SHOWING (because closeWhenDone==True and showing would mess things up)")
        else:
            arg_0.log.info("showing [%s]",arg_6)
            plt.show()
    if arg_4:
        print("closing figure")
        plt.close('all')

frame the current matplotlib plot with ABF info and optionally save it . Note that this is entirely independent of the ABFplot class object . if saveImage is False show it instead .


def Func(arg_0, arg_1):
        """Create a cells from a module."""
        # Outside formulas only
        arg_2 = arg_0._impl.new_cells_from_module(arg_1)
        return get_interfaces(arg_2)


(Tms=None, ws=None, xs=None, CASRNs=None, AvailableMethods=False,
              Method=None)

def
Func
(
arg_0
=
,
arg_1
=
,
arg_2
=
,
arg_3
=
,
arg_4
=
False
,
arg_5
=
)
:
def
list_methods
(
)
:
arg_6
=
[
]
if
none_and_length_check
(
[
arg_0
]
)
:
arg_6
.
append
(
'Maximum'
)
arg_6
.
append
(
'Simple'
)
arg_6
.
append
(
'None'
)
return
arg_6
if
arg_4
:
return
list_methods
(
)
if
not
arg_5
:
arg_5
=
list_methods
(
)
[
0
]
if
arg_5
==
'Maximum'
:
arg_7
=
max
(
arg_0
)
elif
arg_5
==
'Simple'
:
arg_7
=
mixing_simple
(
arg_2
,
arg_0
)
elif
arg_5
==
'None'
:
return
else
:
raise
Exception
(
'Failure in in function'
)
return
arg_7

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=None, arg_4=False,
              arg_5=None):  # pragma: no cover
    '''This function handles the retrival of a mixtures's liquidus point.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> Func(Tms=[250.0, 350.0], xs=[0.5, 0.5])
    350.0
    >>> Func(Tms=[250, 350], xs=[0.5, 0.5], Method='Simple')
    300.0
    >>> Func(Tms=[250, 350], xs=[0.5, 0.5], AvailableMethods=True)
    ['Maximum', 'Simple', 'None']
    '''
    def list_methods():
        arg_6 = []
        if none_and_length_check([arg_0]):
            arg_6.append('Maximum')
            arg_6.append('Simple')
        arg_6.append('None')
        return arg_6
    if arg_4:
        return list_methods()
    if not arg_5:
        arg_5 = list_methods()[0]
    # This is the calculate, given the method section
    if arg_5 == 'Maximum':
        arg_7 = max(arg_0)
    elif arg_5 == 'Simple':
        arg_7 = mixing_simple(arg_2, arg_0)
    elif arg_5 == 'None':
        return None
    else:
        raise Exception('Failure in in function')
    return arg_7

This function handles the retrival of a mixtures's liquidus point.

    This API is considered experimental, and is expected to be removed in a
    future release in favor of a more complete object-oriented interface.

    >>> Tliquidus(Tms=[250.0, 350.0], xs=[0.5, 0.5])
    350.0
    >>> Tliquidus(Tms=[250, 350], xs=[0.5, 0.5], Method='Simple')
    300.0
    >>> Tliquidus(Tms=[250, 350], xs=[0.5, 0.5], AvailableMethods=True)
    ['Maximum', 'Simple', 'None']

This function handles the retrival of a mixtures s liquidus point .


def Func ( arg_0 , arg_1 = [ ] ) : if arg_0 <= 1 : return "child" if os . getenv ( "IN_MPI" ) is None : arg_2 = os . environ . copy ( ) arg_2 . update ( MKL_NUM_THREADS = "1" , OMP_NUM_THREADS = "1" , IN_MPI = "1" ) arg_3 = [ "mpirun" , "-np" , str ( arg_0 ) ] + arg_1 + [ sys . executable ] arg_3 += sys . argv subprocess . check_call ( arg_3 , arg_2 = arg_2 ) return "parent" else : install_mpi_excepthook ( ) return "child"

def Func(arg_0, arg_1=[]):
    """Re-launches the current script with workers
    Returns "parent" for original parent, "child" for MPI children
    """
    if arg_0 <= 1:
        return "child"
    if os.getenv("IN_MPI") is None:
        arg_2 = os.environ.copy()
        arg_2.update(
            MKL_NUM_THREADS="1",
            OMP_NUM_THREADS="1",
            IN_MPI="1"
        )
        # "-bind-to core" is crucial for good performance
        arg_3 = ["mpirun", "-np", str(arg_0)] + \
            arg_1 + \
            [sys.executable]

        arg_3 += sys.argv
        subprocess.check_call(arg_3, arg_2=arg_2)
        return "parent"
    else:
        install_mpi_excepthook()
        return "child"

Re - launches the current script with workers Returns parent for original parent child for MPI children


def Func ( arg_0 , arg_1 ) : if ( hasattr ( arg_0 , "predict_proba" ) ) : arg_2 = arg_0 . predict ( arg_1 ) else : arg_2 = arg_0 . predict ( arg_1 ) return arg_2

def Func(arg_0, arg_1):
    """
    Generates predictions on a novel data array using a fit classifier
    clf is a classifier that has already been fit
    arr is a data array identical in dimension to the array clf was trained on
    Returns the array of predictions.
    """
    if(hasattr(arg_0, "predict_proba")):
        arg_2 = arg_0.predict(arg_1)
        # pred_score=preds.argmax(1)+min(x._score)
    else:
        arg_2 = arg_0.predict(arg_1)
    return arg_2

Generates predictions on a novel data array using a fit classifier clf is a classifier that has already been fit arr is a data array identical in dimension to the array clf was trained on Returns the array of predictions .


def Func(arg_0, arg_1=None, arg_2='utf-8'):
        """Show the data of a set of commits.

        The method returns the output of Git Func command for a
        set of commits using the following options:

            git Func --raw --numstat --pretty=fuller --decorate=full
                --parents -M -C -c [<commit>...<commit>]

        When the list of commits is empty, the command will return
        data about the last commit, like the default behaviour of
        `git Func`.

        :param commits: list of commits to Func data
        :param encoding: encode the output using this format

        :returns: a generator where each item is a line from the Func output

        :raises EmptyRepositoryError: when the repository is empty and
            the action cannot be performed
        :raises RepositoryError: when an error occurs fetching the Func output
        """
        if arg_0.is_empty():
            logger.warning("Git %s repository is empty; unable to run Func",
                           arg_0.uri)
            raise EmptyRepositoryError(repository=arg_0.uri)

        if arg_1 is None:
            arg_1 = []

        arg_3 = ['git', 'Func']
        arg_3.extend(arg_0.GIT_PRETTY_OUTPUT_OPTS)
        arg_3.extend(arg_1)

        for arg_4 in arg_0._exec_nb(arg_3, cwd=arg_0.dirpath, env=arg_0.gitenv):
            yield arg_4

        logger.debug("Git Func fetched from %s repository (%s)",
                     arg_0.uri, arg_0.dirpath)

Show the data of a set of commits.

        The method returns the output of Git show command for a
        set of commits using the following options:

            git show --raw --numstat --pretty=fuller --decorate=full
                --parents -M -C -c [<commit>...<commit>]

        When the list of commits is empty, the command will return
        data about the last commit, like the default behaviour of
        `git show`.

        :param commits: list of commits to show data
        :param encoding: encode the output using this format

        :returns: a generator where each item is a line from the show output

        :raises EmptyRepositoryError: when the repository is empty and
            the action cannot be performed
        :raises RepositoryError: when an error occurs fetching the show output


return self._perform_post(
            self._get_vm_image_path(),
            _XmlSerializer.create_vm_image_to_xml(vm_image),
            as_async=True)

def Func(arg_0, arg_1):
        '''
        Creates a VM Image in the image repository that is associated with the
        specified subscription using a specified set of virtual hard disks.

        vm_image:
            An instance of VMImage class.
        vm_image.name: Required. Specifies the name of the image.
        vm_image.label: Required. Specifies an identifier for the image.
        vm_image.description: Optional. Specifies the description of the image.
        vm_image.os_disk_configuration:
            Required. Specifies configuration information for the operating
            system disk that is associated with the image.
        vm_image.os_disk_configuration.host_caching:
            Optional. Specifies the caching behavior of the operating system disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.os_disk_configuration.os_state:
            Required. Specifies the state of the operating system in the image.
            Possible values are: Generalized, Specialized
            A Virtual Machine that is fully configured and running contains a
            Specialized operating system. A Virtual Machine on which the
            Sysprep command has been run with the generalize option contains a
            Generalized operating system.
        vm_image.os_disk_configuration.os:
            Required. Specifies the operating system type of the image.
        vm_image.os_disk_configuration.media_link:
            Required. Specifies the location of the blob in Windows Azure
            storage. The blob location belongs to a storage account in the
            subscription specified by the <subscription-id> value in the
            operation call.
        vm_image.data_disk_configurations:
            Optional. Specifies configuration information for the data disks
            that are associated with the image. A VM Image might not have data
            disks associated with it.
        vm_image.data_disk_configurations[].host_caching:
            Optional. Specifies the caching behavior of the data disk.
            Possible values are: None, ReadOnly, ReadWrite
        vm_image.data_disk_configurations[].lun:
            Optional if the lun for the disk is 0. Specifies the Logical Unit
            Number (LUN) for the data disk.
        vm_image.data_disk_configurations[].media_link:
            Required. Specifies the location of the blob in Windows Azure
            storage. The blob location belongs to a storage account in the
            subscription specified by the <subscription-id> value in the
            operation call.
        vm_image.data_disk_configurations[].logical_size_in_gb:
            Required. Specifies the size, in GB, of the data disk.
        vm_image.language: Optional. Specifies the language of the image.
        vm_image.image_family:
            Optional. Specifies a value that can be used to group VM Images.
        vm_image.recommended_vm_size:
            Optional. Specifies the size to use for the Virtual Machine that
            is created from the VM Image.
        vm_image.eula:
            Optional. Specifies the End User License Agreement that is
            associated with the image. The value for this element is a string,
            but it is recommended that the value be a URL that points to a EULA.
        vm_image.icon_uri:
            Optional. Specifies the URI to the icon that is displayed for the
            image in the Management Portal.
        vm_image.small_icon_uri:
            Optional. Specifies the URI to the small icon that is displayed for
            the image in the Management Portal.
        vm_image.privacy_uri:
            Optional. Specifies the URI that points to a document that contains
            the privacy policy related to the image.
        vm_image.published_date:
            Optional. Specifies the date when the image was added to the image
            repository.
        vm_image.show_in_gui:
            Optional. Indicates whether the VM Images should be listed in the
            portal.
        '''
        _validate_not_none('vm_image', arg_1)
        _validate_not_none('vm_image.name', arg_1.name)
        _validate_not_none('vm_image.label', arg_1.label)
        _validate_not_none('vm_image.os_disk_configuration.os_state',
                           arg_1.os_disk_configuration.os_state)
        _validate_not_none('vm_image.os_disk_configuration.os',
                           arg_1.os_disk_configuration.os)
        _validate_not_none('vm_image.os_disk_configuration.media_link',
                           arg_1.os_disk_configuration.media_link)
        return arg_0._perform_post(
            arg_0._get_vm_image_path(),
            _XmlSerializer.Func_to_xml(arg_1),
            as_async=True)

Creates a VM Image in the image repository that is associated with the specified subscription using a specified set of virtual hard disks .


def Func ( arg_0 ) : arg_0 . branch = 'master' arg_0 . fix = False super ( lint , arg_0 ) . Func ( )

def Func(arg_0):
        """Set the default options."""
        arg_0.branch = 'master'
        arg_0.fix = False
        super(lint, arg_0).Func()


def Func(arg_0, arg_1, arg_2=False):
    """
    Called at the end of inference to print out various diagnostic
    information based on the current verbosity level.

    :param output: TODO: document
    :param learn: TODO: document
    """
    if arg_0.verbosity >= 3:
      print "----- computeEnd summary: "
      print "learn:", arg_2
      print "numBurstingCols: %s, " % (
          arg_0.infActiveState['t'].min(axis=1).sum()),
      print "curPredScore2: %s, " % (
          arg_0._internalStats['curPredictionScore2']),
      print "curFalsePosScore: %s, " % (
          arg_0._internalStats['curFalsePositiveScore']),
      print "1-curFalseNegScore: %s, " % (
          1 - arg_0._internalStats['curFalseNegativeScore'])
      print "numSegments: ", arg_0.getNumSegments(),
      print "avgLearnedSeqLength: ", arg_0.avgLearnedSeqLength

      print "----- infActiveState (%d on) ------" % (
          arg_0.infActiveState['t'].sum())
      arg_0.printActiveIndices(arg_0.infActiveState['t'])
      if arg_0.verbosity >= 6:
        arg_0.printState(arg_0.infActiveState['t'])

      print "----- infPredictedState (%d on)-----" % (
          arg_0.infPredictedState['t'].sum())
      arg_0.printActiveIndices(arg_0.infPredictedState['t'])
      if arg_0.verbosity >= 6:
        arg_0.printState(arg_0.infPredictedState['t'])

      print "----- lrnActiveState (%d on) ------" % (
          arg_0.lrnActiveState['t'].sum())
      arg_0.printActiveIndices(arg_0.lrnActiveState['t'])
      if arg_0.verbosity >= 6:
        arg_0.printState(arg_0.lrnActiveState['t'])

      print "----- lrnPredictedState (%d on)-----" % (
          arg_0.lrnPredictedState['t'].sum())
      arg_0.printActiveIndices(arg_0.lrnPredictedState['t'])
      if arg_0.verbosity >= 6:
        arg_0.printState(arg_0.lrnPredictedState['t'])

      print "----- cellConfidence -----"
      arg_0.printActiveIndices(arg_0.cellConfidence['t'], andValues=True)
      if arg_0.verbosity >= 6:
        arg_0.printConfidence(arg_0.cellConfidence['t'])

      print "----- colConfidence -----"
      arg_0.printActiveIndices(arg_0.colConfidence['t'], andValues=True)

      print "----- cellConfidence[t-1] for currently active cells -----"
      arg_3 = arg_0.cellConfidence['t-1'] * arg_0.infActiveState['t']
      arg_0.printActiveIndices(arg_3, andValues=True)

      if arg_0.verbosity == 4:
        print "Cells, predicted segments only:"
        arg_0.printCells(predictedOnly=True)
      elif arg_0.verbosity >= 5:
        print "Cells, all segments:"
        arg_0.printCells(predictedOnly=False)
      print

    elif arg_0.verbosity >= 1:
      print "TM: learn:", arg_2
      print "TM: active outputs(%d):" % len(arg_1.nonzero()[0]),
      arg_0.printActiveIndices(arg_1.reshape(arg_0.numberOfCols,
                                             arg_0.cellsPerColumn))

Called at the end of inference to print out various diagnostic information based on the current verbosity level .


def Func(arg_0, arg_1, arg_2):
        """
        Moves data after swapping bytes.

        Performs a byte swap operation on the data copied from the second operand (source operand) and store the result
        in the first operand (destination operand). The source operand can be a general-purpose register, or memory location; the destination register can be a general-purpose register, or a memory location; however, both operands can
        not be registers, and only one operand can be a memory location. Both operands must be the same size, which can
        be a word, a doubleword or quadword.
        The Func instruction is provided for swapping the bytes on a read from memory or on a write to memory; thus
        providing support for converting little-endian values to big-endian format and vice versa.
        In 64-bit mode, the instruction's default operation size is 32 bits. Use of the REX.R prefix permits access to additional registers (R8-R15). Use of the REX.W prefix promotes operation to 64 bits::

                TEMP = SRC
                IF ( OperandSize = 16)
                THEN
                    DEST[7:0] = TEMP[15:8];
                    DEST[15:8] = TEMP[7:0];
                ELSE IF ( OperandSize = 32)
                    DEST[7:0] = TEMP[31:24];
                    DEST[15:8] = TEMP[23:16];
                    DEST[23:16] = TEMP[15:8];
                    DEST[31:23] = TEMP[7:0];
                ELSE IF ( OperandSize = 64)
                    DEST[7:0] = TEMP[63:56];
                    DEST[15:8] = TEMP[55:48];
                    DEST[23:16] = TEMP[47:40];
                    DEST[31:24] = TEMP[39:32];
                    DEST[39:32] = TEMP[31:24];
                    DEST[47:40] = TEMP[23:16];
                    DEST[55:48] = TEMP[15:8];
                    DEST[63:56] = TEMP[7:0];
                FI;

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_3 = arg_1.size
        arg_4 = arg_1.read()
        arg_5 = 0
        for arg_6 in range(0, arg_3, 8):
            arg_5 = (arg_5 << 8) | (arg_4 & 0xff)
            arg_4 = arg_4 >> 8
        arg_1.write(arg_4)

Moves data after swapping bytes.

        Performs a byte swap operation on the data copied from the second operand (source operand) and store the result
        in the first operand (destination operand). The source operand can be a general-purpose register, or memory location; the destination register can be a general-purpose register, or a memory location; however, both operands can
        not be registers, and only one operand can be a memory location. Both operands must be the same size, which can
        be a word, a doubleword or quadword.
        The MOVBE instruction is provided for swapping the bytes on a read from memory or on a write to memory; thus
        providing support for converting little-endian values to big-endian format and vice versa.
        In 64-bit mode, the instruction's default operation size is 32 bits. Use of the REX.R prefix permits access to additional registers (R8-R15). Use of the REX.W prefix promotes operation to 64 bits::

                TEMP = SRC
                IF ( OperandSize = 16)
                THEN
                    DEST[7:0] = TEMP[15:8];
                    DEST[15:8] = TEMP[7:0];
                ELSE IF ( OperandSize = 32)
                    DEST[7:0] = TEMP[31:24];
                    DEST[15:8] = TEMP[23:16];
                    DEST[23:16] = TEMP[15:8];
                    DEST[31:23] = TEMP[7:0];
                ELSE IF ( OperandSize = 64)
                    DEST[7:0] = TEMP[63:56];
                    DEST[15:8] = TEMP[55:48];
                    DEST[23:16] = TEMP[47:40];
                    DEST[31:24] = TEMP[39:32];
                    DEST[39:32] = TEMP[31:24];
                    DEST[47:40] = TEMP[23:16];
                    DEST[55:48] = TEMP[15:8];
                    DEST[63:56] = TEMP[7:0];
                FI;

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.


def Func ( arg_0 , arg_1 , arg_2 ) : arg_1 . text ( 're.compile(' ) arg_3 = repr ( arg_0 . pattern ) if arg_3 [ : 1 ] in 'uU' : arg_3 = arg_3 [ 1 : ] arg_4 = 'ur' else : arg_4 = 'r' arg_3 = arg_4 + arg_3 . replace ( '\\\\' , '\\' ) arg_1 . text ( arg_3 ) if arg_0 . flags : arg_1 . text ( ',' ) arg_1 . breakable ( ) arg_5 = False for arg_6 in ( 'TEMPLATE' , 'IGNORECASE' , 'LOCALE' , 'MULTILINE' , 'DOTALL' , 'UNICODE' , 'VERBOSE' , 'DEBUG' ) : if arg_0 . flags & getattr ( re , arg_6 ) : if arg_5 : arg_1 . text ( '|' ) arg_1 . text ( 're.' + arg_6 ) arg_5 = True arg_1 . text ( ')' )

def Func(arg_0, arg_1, arg_2):
    """The pprint function for regular expression patterns."""
    arg_1.text('re.compile(')
    arg_3 = repr(arg_0.pattern)
    if arg_3[:1] in 'uU':
        arg_3 = arg_3[1:]
        arg_4 = 'ur'
    else:
        arg_4 = 'r'
    arg_3 = arg_4 + arg_3.replace('\\\\', '\\')
    arg_1.text(arg_3)
    if arg_0.flags:
        arg_1.text(',')
        arg_1.breakable()
        arg_5 = False
        for arg_6 in ('TEMPLATE', 'IGNORECASE', 'LOCALE', 'MULTILINE', 'DOTALL',
            'UNICODE', 'VERBOSE', 'DEBUG'):
            if arg_0.flags & getattr(re, arg_6):
                if arg_5:
                    arg_1.text('|')
                arg_1.text('re.' + arg_6)
                arg_5 = True
    arg_1.text(')')

The pprint function for regular expression patterns .


def Func ( arg_0 ) : super ( QtSubSocketChannel , arg_0 ) . Func ( ) QtCore . QCoreApplication . instance ( ) . processEvents ( )

def Func(arg_0):
        """ Reimplemented to ensure that signals are dispatched immediately.
        """
        super(QtSubSocketChannel, arg_0).Func()
        QtCore.QCoreApplication.instance().processEvents()

Reimplemented to ensure that signals are dispatched immediately .


return cls(**{
        'initializers': [tf.compat.v2.initializers.deserialize(init)
                         for init in config.get('initializers', [])],
        'sizes': config.get('sizes', []),
        'validate_args': config.get('validate_args', False),
    })

def Func ( arg_0 , arg_1 ) : return arg_0 ( ** { 'initializers' : [ tf . compat . v2 . initializers . deserialize ( arg_2 ) for arg_2 in arg_1 . get ( 'initializers' , [ ] ) ] , 'sizes' : arg_1 . get ( 'sizes' , [ ] ) , 'validate_args' : arg_1 . get ( 'validate_args' , False ) , } )

def Func(arg_0, arg_1):
    """Instantiates an initializer from a configuration dictionary."""
    return arg_0(**{
        'initializers': [tf.compat.v2.initializers.deserialize(arg_2)
                         for arg_2 in arg_1.get('initializers', [])],
        'sizes': arg_1.get('sizes', []),
        'validate_args': arg_1.get('validate_args', False),
    })

Instantiates an initializer from a configuration dictionary .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
arg_0
.
is_local
and
not
arg_2
:
return
os
.
path
.
isdir
(
arg_1
)
else
:
arg_3
=
arg_2
and
_sudo
or
_run
with
arg_0
.
settings
(
hide
(
'running'
,
'warnings'
)
,
warn_only
=
True
)
:
return
arg_3
(
'[ -d "%(path)s" ]'
%
locals
(
)
)
.
succeeded

def Func(arg_0, arg_1, arg_2=False):
        """
        Check if a path exists, and is a directory.
        """
        if arg_0.is_local and not arg_2:
            return os.path.isdir(arg_1)
        else:
            arg_3 = arg_2 and _sudo or _run
            with arg_0.settings(hide('running', 'warnings'), warn_only=True):
                return arg_3('[ -d "%(path)s" ]' % locals()).succeeded

Check if a path exists and is a directory .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . encoder . Func ( arg_1 ) arg_3 = arg_0 . decoder . Func ( arg_2 ) arg_4 = arg_0 . classifier . Func ( arg_2 ) arg_5 = AutoEncoderCost ( arg_3 , arg_1 ) . get ( ) arg_6 = CrossEntropyCost ( arg_4 , arg_0 . target_input ) . get ( ) arg_7 = 0.01 * arg_5 + arg_6 arg_8 = ErrorRateCost ( arg_4 , arg_0 . target_input ) . get ( ) arg_0 . register_monitors ( ( "err" , arg_8 ) , ( "encoder_cost" , arg_5 ) , ( "classify_cost" , arg_6 ) ) return arg_7

def Func(arg_0, arg_1):
        """
        Build the computation graph here.
        """
        arg_2 = arg_0.encoder.Func(arg_1)

        arg_3 = arg_0.decoder.Func(arg_2)

        arg_4 = arg_0.classifier.Func(arg_2)

        arg_5 = AutoEncoderCost(arg_3, arg_1).get()

        arg_6 = CrossEntropyCost(arg_4, arg_0.target_input).get()

        arg_7 = 0.01 * arg_5 + arg_6

        arg_8 = ErrorRateCost(arg_4, arg_0.target_input).get()

        arg_0.register_monitors(("err", arg_8),
                               ("encoder_cost", arg_5),
                               ("classify_cost", arg_6))

        return arg_7


return launch_topologies(cl_args, topology_file, tmp_dir)

def Func(arg_0, arg_1, arg_2):
  '''
  Extract and execute the java files inside the tar and then add topology
  definition file created by running submitTopology

  We use the packer to make a package for the tar and dump it
  to a well-known location. We then run the main method of class
  with the specified arguments. We pass arguments as an environment variable HERON_OPTIONS.
  This will run the jar file with the topology class name.

  The submitter inside will write out the topology defn file to a location
  that we specify. Then we write the topology defn file to a well known
  packer location. We then write to appropriate places in zookeeper
  and launch the aurora jobs
  :param cl_args:
  :param unknown_args:
  :param tmp_dir:
  :return:
  '''
  # execute main of the topology to create the topology definition
  arg_3 = arg_0['topology-file-name']
  arg_4 = arg_0['topology_main_jvm_property']
  arg_5 = arg_0['topology-class-name']
  arg_6 = execute.heron_tar(
      arg_5,
      arg_3,
      tuple(arg_1),
      arg_2,
      arg_4)

  result.render(arg_6)

  if not result.is_successful(arg_6):
    arg_7 = ("Failed to create topology definition " \
      "file when executing class '%s' of file '%s'") % (arg_5, arg_3)
    arg_6.add_context(arg_7)
    return arg_6

  return launch_topologies(arg_0, arg_3, arg_2)


def
Func
(
arg_0
)
:
arg_1
=
_REGEX
.
match
(
arg_0
)
if
arg_1
is
:
raise
ValueError
(
'%s is not valid SemVer string'
%
arg_0
)
arg_2
=
arg_1
.
groupdict
(
)
arg_2
[
'major'
]
=
int
(
arg_2
[
'major'
]
)
arg_2
[
'minor'
]
=
int
(
arg_2
[
'minor'
]
)
arg_2
[
'patch'
]
=
int
(
arg_2
[
'patch'
]
)
return
arg_2

def Func(arg_0):
    """
    Parse version to major, minor, patch, pre-release, build parts.
    """
    arg_1 = _REGEX.match(arg_0)
    if arg_1 is None:
        raise ValueError('%s is not valid SemVer string' % arg_0)

    arg_2 = arg_1.groupdict()

    arg_2['major'] = int(arg_2['major'])
    arg_2['minor'] = int(arg_2['minor'])
    arg_2['patch'] = int(arg_2['patch'])

    return arg_2

Parse version to major minor patch pre - release build parts .


def
Func
(
arg_0
)
:
if
len
(
arg_0
)
==
1
:
return
if
len
(
arg_0
)
>
2
:
raise
"Not implemented for more than 2 TMs"
arg_1
=
fdrutils
.
tmDiff2
(
arg_0
.
values
(
)
,
verbosity
=
VERBOSITY
)
assert
(
arg_1
)
return

def Func(arg_0):
  """
  Check for diffs among the TM instances in the passed in tms dict and
  raise an assert if any are detected

  Parameters:
  ---------------------------------------------------------------------
  tms:                  dict of TM instances
  """

  if len(arg_0) == 1:
    return
  if len(arg_0) > 2:
    raise "Not implemented for more than 2 TMs"

  arg_1 = fdrutils.tmDiff2(arg_0.values(), verbosity=VERBOSITY)
  assert(arg_1)
  return


def Func(arg_0, arg_1=None, arg_2=True):
        """ Can be used to manually allow running of an experiment without using an environment.

        :param run_name_or_idx:

            Can manually set a trajectory to a particular run. If `None` the current run
            the trajectory is set to is used.

        :param turn_into_run:

            Turns the trajectory into a run, i.e. reduces functionality but makes storing
            more efficient.

        """
        if arg_0._run_started:
            return arg_0

        if arg_1 is None:
            if arg_0.v_idx == -1:
                raise ValueError('Cannot start run if trajectory is not set to a particular run')
        else:
            arg_0.f_set_crun(arg_1)

        arg_0._run_started = True

        if arg_2:
            arg_0._make_single_run()

        arg_0._set_start()

        return arg_0

Can be used to manually allow running of an experiment without using an environment .


(
    target_url,
    user_agent="archiveis (https://github.com/pastpages/archiveis)",
    proxies={}
)

def Func(
    arg_0,
    arg_1="archiveis (https://github.com/pastpages/archiveis)",
    arg_2={}
):
    """
    Archives the provided URL using archive.is

    Returns the URL where the Func is stored.
    """
    # Put together the URL that will save our request
    arg_3 = "http://archive.vn"
    arg_4 = urljoin(arg_3, "/submit/")

    # Configure the request headers
    arg_5 = {
        'User-Agent': arg_1,
        "host": "archive.vn",
    }

    # Request a unique identifier for our activity
    logger.debug("Requesting {}".format(arg_3 + "/"))
    arg_6 = dict(
        timeout=120,
        allow_redirects=True,
        arg_5=arg_5,
    )
    if arg_2:
        arg_6['proxies'] = arg_2
    arg_7 = requests.get(arg_3 + "/", **arg_6)
    arg_7.raise_for_status()

    # It will need to be parsed from the homepage response headers
    arg_8 = str(arg_7.content)
    try:
        arg_9 = arg_8.split('name="submitid', 1)[1].split('value="', 1)[1].split('"', 1)[0]
        logger.debug("Unique identifier: {}".format(arg_9))
    except IndexError:
        logger.warn("Unable to extract unique identifier from archive.is. Submitting without it.")
        arg_9 = None

    # Send the Func request to archive.is with the unique id included
    arg_10 = {
        "url": arg_0,
        "anyway": 1,
    }
    if arg_9:
        arg_10.update({"submitid": arg_9})

    arg_11 = dict(
        timeout=120,
        allow_redirects=True,
        arg_5=arg_5,
        arg_10=arg_10
    )
    if arg_2:
        arg_11['proxies'] = arg_2

    logger.debug("Requesting {}".format(arg_4))
    arg_7 = requests.post(arg_4, **arg_11)
    arg_7.raise_for_status()

    # There are a couple ways the header can come back
    if 'Refresh' in arg_7.headers:
        arg_12 = str(arg_7.headers['Refresh']).split(';url=')[1]
        logger.debug("Memento from Refresh header: {}".format(arg_12))
        return arg_12
    if 'Location' in arg_7.headers:
        arg_12 = arg_7.headers['Location']
        logger.debug("Memento from Location header: {}".format(arg_12))
        return arg_12
    logger.debug("Memento not found in response headers. Inspecting history.")
    for arg_13, arg_14 in enumerate(arg_7.history):
        logger.debug("Inspecting history request #{}".format(arg_13))
        logger.debug(arg_14.headers)
        if 'Location' in arg_14.headers:
            arg_12 = arg_14.headers['Location']
            logger.debug("Memento from the Location header of {} history response: {}".format(arg_13+1, arg_12))
            return arg_12
    # If there's nothing at this point, throw an error
    logger.error("No memento returned by archive.is")
    logger.error("Status code: {}".format(arg_7.status_code))
    logger.error(arg_7.headers)
    logger.error(arg_7.text)
    raise Exception("No memento returned by archive.is")

Archives the provided URL using archive.is

    Returns the URL where the capture is stored.

Archives the provided URL using archive . is


(objective_function,
                      initial_population,
                      initial_position,
                      population_size,
                      population_stddev,
                      max_iterations,
                      func_tolerance,
                      position_tolerance,
                      differential_weight,
                      crossover_prob,
                      seed)

return (was_iterable,
          population,
          population_values,
          max_iterations,
          func_tolerance,
          position_tolerance,
          differential_weight,
          crossover_prob)

def Func(arg_0,
                      arg_1,
                      arg_2,
                      arg_3,
                      arg_4,
                      arg_5,
                      arg_6,
                      arg_7,
                      arg_8,
                      arg_9,
                      arg_10):
  """Processes initial args."""
  arg_11 = False
  if arg_2 is not None:
    arg_2, arg_11 = _ensure_list(arg_2)

  if arg_1 is not None:
    arg_1, arg_11 = _ensure_list(arg_1)

  arg_12 = _get_starting_population(arg_1,
                                        arg_2,
                                        arg_3,
                                        arg_4,
                                        arg_10=arg_10)

  arg_8 = tf.convert_to_tensor(
      value=arg_8, dtype=arg_12[0].dtype.base_dtype)

  arg_9 = tf.convert_to_tensor(value=arg_9)
  arg_13 = arg_0(*arg_12)
  if arg_5 is not None:
    arg_5 = tf.convert_to_tensor(value=arg_5)
  arg_6 = tf.convert_to_tensor(
      value=arg_6, dtype=arg_13.dtype.base_dtype)
  arg_7 = tf.convert_to_tensor(
      value=arg_7, dtype=arg_12[0].dtype.base_dtype)
  return (arg_11,
          arg_12,
          arg_13,
          arg_5,
          arg_6,
          arg_7,
          arg_8,
          arg_9)


def Func(arg_0, arg_1, arg_2):
        """
        Check item.

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success.
        @rtype: integer
        """
        # FIXME: Check for object type
        arg_3 = arg_0._get_object_handle(arg_1, arg_2)
        if not arg_3.AXEnabled:
            raise LdtpServerException(u"Object %s state disabled" % arg_2)
        if arg_3.AXValue == 1:
            # Already Funced
            return 1
        # AXPress doesn't work with Instruments
        # So did the following work around
        arg_0._grabfocus(arg_3)
        arg_4, arg_5, arg_6, arg_7 = arg_0._getobjectsize(arg_3)
        # Mouse left click on the object
        # Note: x + width/2, y + height / 2 doesn't work
        arg_0.generatemouseevent(arg_4 + arg_6 / 2, arg_5 + arg_7 / 2, "b1c")
        return 1


def Func(arg_0, arg_1, arg_2):
    """
    Decrypts encrypted ASN.1 data

    :param encryption_algorithm_info:
        An instance of asn1crypto.pkcs5.Pkcs5EncryptionAlgorithm

    :param encrypted_content:
        A byte string of the encrypted content

    :param password:
        A byte string of the encrypted content's password

    :return:
        A byte string of the decrypted plaintext
    """

    arg_3 = crypto_funcs[arg_0.encryption_cipher]

    # Modern, PKCS#5 PBES2-based encryption
    if arg_0.kdf == 'pbkdf2':

        if arg_0.encryption_cipher == 'rc5':
            raise ValueError(pretty_message(
                '''
                PBES2 encryption scheme utilizing RC5 encryption is not supported
                '''
            ))

        arg_4 = pbkdf2(
            arg_0.kdf_hmac,
            arg_2,
            arg_0.kdf_salt,
            arg_0.kdf_iterations,
            arg_0.key_length
        )
        arg_5 = arg_0.encryption_iv

        arg_6 = arg_3(arg_4, arg_1, arg_5)

    elif arg_0.kdf == 'pbkdf1':
        arg_7 = pbkdf1(
            arg_0.kdf_hmac,
            arg_2,
            arg_0.kdf_salt,
            arg_0.kdf_iterations,
            arg_0.key_length + 8
        )
        arg_4 = arg_7[0:8]
        arg_5 = arg_7[8:16]

        arg_6 = arg_3(arg_4, arg_1, arg_5)

    elif arg_0.kdf == 'pkcs12_kdf':
        arg_4 = pkcs12_kdf(
            arg_0.kdf_hmac,
            arg_2,
            arg_0.kdf_salt,
            arg_0.kdf_iterations,
            arg_0.key_length,
            1  # ID 1 is for generating a key
        )

        # Since RC4 is a stream cipher, we don't use an IV
        if arg_0.encryption_cipher == 'rc4':
            arg_6 = arg_3(arg_4, arg_1)

        else:
            arg_5 = pkcs12_kdf(
                arg_0.kdf_hmac,
                arg_2,
                arg_0.kdf_salt,
                arg_0.kdf_iterations,
                arg_0.encryption_block_size,
                2   # ID 2 is for generating an IV
            )
            arg_6 = arg_3(arg_4, arg_1, arg_5)

    return arg_6


(json_api_content, output_dir='.', merge=True, info_only=False, **kwargs)

def Func ( arg_0 , arg_1 = '.' , arg_2 = True , arg_3 = False , ** arg_4 ) : for arg_5 in range ( len ( arg_0 [ 0 ] [ 'Topics' ] ) ) : for arg_6 in range ( len ( arg_0 [ 0 ] [ 'Topics' ] [ arg_5 ] [ 'Parts' ] ) ) : Func_topic_part ( arg_0 , arg_5 , arg_6 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , ** arg_4 )

def Func(arg_0, arg_1='.', arg_2=True, arg_3=False, **arg_4):
    """int->None

    Download a WHOLE course.
    Reuse the API call to save time."""

    for arg_5 in range(len(arg_0[0]['Topics'])):
        for arg_6 in range(len(arg_0[0]['Topics'][arg_5]['Parts'])):
            Func_topic_part(arg_0,
                                                 arg_5,
                                                 arg_6,
                                                 arg_1=arg_1,
                                                 arg_2=arg_2,
                                                 arg_3=arg_3,
                                                 **arg_4)

int - > None Download a WHOLE course . Reuse the API call to save time .


def Func ( arg_0 ) : try : return isinstance ( arg_0 , unicode ) or isinstance ( arg_0 , basestring ) except NameError : return isinstance ( arg_0 , str )

def Func(arg_0):
    """Convenience method that works with all 2.x versions of Python
    to determine whether or not something is stringlike."""
    try:
        return isinstance(arg_0, unicode) or isinstance(arg_0, basestring)
    except NameError:
        return isinstance(arg_0, str)

Convenience method that works with all 2 . x versions of Python to determine whether or not something is stringlike .


def Func(arg_0, arg_1, arg_2):
        """Save an existing notebook object by notebook_id."""
        if arg_1 not in arg_0.mapping:
            raise web.HTTPError(404, u'Notebook does not exist: %s' % arg_1)
        arg_3 = arg_0.mapping[arg_1]
        try:
            arg_4 = arg_2.metadata.name
        except AttributeError:
            raise web.HTTPError(400, u'Missing notebook name')
        arg_5 = arg_0.get_path_by_name(arg_4)
        try:
            with open(arg_5,'w') as f:
                current.write(arg_2, f, u'json')
        except Exception as e:
            raise web.HTTPError(400, u'Unexpected error while saving notebook: %s' % e)
        # save .py script as well
        if arg_0.save_script:
            arg_6 = os.path.splitext(arg_5)[0] + '.py'
            try:
                with io.open(arg_6,'w', encoding='utf-8') as f:
                    current.write(arg_2, f, u'py')
            except Exception as e:
                raise web.HTTPError(400, u'Unexpected error while saving notebook as script: %s' % e)

        if arg_3 != arg_4:
            arg_7 = arg_0.get_path_by_name(arg_3)
            if os.path.isfile(arg_7):
                os.unlink(arg_7)
            if arg_0.save_script:
                arg_8 = os.path.splitext(arg_7)[0] + '.py'
                if os.path.isfile(arg_8):
                    os.unlink(arg_8)
            arg_0.mapping[arg_1] = arg_4
            arg_0.rev_mapping[arg_4] = arg_1
            del arg_0.rev_mapping[arg_3]

Save an existing notebook object by notebook_id .


def Func ( ) -> EcommerceAgent : arg_0 = find_config ( 'tfidf_retrieve' ) arg_1 = build_model ( arg_0 ) arg_2 = EcommerceAgent ( skills = [ arg_1 ] ) return arg_2

def Func() -> EcommerceAgent:
    """Make an agent

    Returns:
        agent: created Ecommerce agent
    """

    arg_0 = find_config('tfidf_retrieve')
    arg_1 = build_model(arg_0)
    arg_2 = EcommerceAgent(skills=[arg_1])
    return arg_2


def Func ( arg_0 , arg_1 = 'matplotlib' ) : arg_2 = sorted ( set ( arg_0 . reports [ 0 ] . datasource ) & set ( arg_0 . reports [ 1 ] . datasource ) ) arg_3 = False for arg_4 in arg_2 : arg_5 = naarad . utils . get_default_csv ( arg_0 . reports [ 0 ] . local_location , ( arg_4 + '.percentiles' ) ) arg_6 = naarad . utils . get_default_csv ( arg_0 . reports [ 1 ] . local_location , ( arg_4 + '.percentiles' ) ) if ( not ( naarad . utils . is_valid_file ( arg_5 ) & naarad . utils . is_valid_file ( arg_6 ) ) ) : continue arg_7 = PD ( input_csv = arg_5 , csv_column = 1 , series_name = arg_4 , y_label = arg_4 , precision = None , graph_height = 600 , graph_width = 1200 , graph_type = 'line' , plot_label = 'baseline' , x_label = 'Percentiles' ) arg_8 = PD ( input_csv = arg_6 , csv_column = 1 , series_name = arg_4 , y_label = arg_4 , precision = None , graph_height = 600 , graph_width = 1200 , graph_type = 'line' , plot_label = 'current' , x_label = 'Percentiles' ) arg_3 , arg_9 = Diff . graphing_modules [ arg_1 ] . graph_data_on_the_same_graph ( [ arg_7 , arg_8 ] , os . path . join ( arg_0 . output_directory , arg_0 . resource_path ) , arg_0 . resource_path , ( arg_4 + '.diff' ) ) if arg_3 : arg_0 . plot_files . append ( arg_9 ) return True

def Func(arg_0, arg_1='matplotlib'):
    """
    Generate CDF diff plots of the submetrics
    """
    arg_2 = sorted(set(arg_0.reports[0].datasource) & set(arg_0.reports[1].datasource))
    arg_3 = False
    for arg_4 in arg_2:
      arg_5 = naarad.utils.get_default_csv(arg_0.reports[0].local_location, (arg_4 + '.percentiles'))
      arg_6 = naarad.utils.get_default_csv(arg_0.reports[1].local_location, (arg_4 + '.percentiles'))
      if (not (naarad.utils.is_valid_file(arg_5) & naarad.utils.is_valid_file(arg_6))):
        continue
      arg_7 = PD(input_csv=arg_5, csv_column=1, series_name=arg_4, y_label=arg_4, precision=None, graph_height=600, graph_width=1200,
                         graph_type='line', plot_label='baseline', x_label='Percentiles')
      arg_8 = PD(input_csv=arg_6, csv_column=1, series_name=arg_4, y_label=arg_4, precision=None, graph_height=600, graph_width=1200,
                        graph_type='line', plot_label='current', x_label='Percentiles')
      arg_3, arg_9 = Diff.graphing_modules[arg_1].graph_data_on_the_same_graph([arg_7, arg_8],
                                                                                os.path.join(arg_0.output_directory, arg_0.resource_path),
                                                                                arg_0.resource_path, (arg_4 + '.diff'))
      if arg_3:
        arg_0.plot_files.append(arg_9)
    return True


def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_1
)
->
Callable
[
[
arg_4
]
,
arg_1
]
:
def
download_data
(
arg_3
:
arg_4
=
False
)
->
arg_1
:
if
os
.
path
.
exists
(
arg_2
)
and
not
arg_3
:
log
.
info
(
'using cached data at %s'
,
arg_2
)
else
:
log
.
info
(
'downloading %s to %s'
,
arg_0
,
arg_2
)
urlretrieve
(
arg_0
,
arg_2
)
return
arg_2
return
download_data

def Func(arg_0: arg_1, arg_2: arg_1) -> Callable[[arg_4], arg_1]:  # noqa: D202
    """Make a function that downloads the data for you, or uses a cached version at the given path.

    :param url: The URL of some data
    :param path: The path of the cached data, or where data is cached if it does not already exist
    :return: A function that downloads the data and returns the path of the data
    """

    def download_data(arg_3: arg_4 = False) -> arg_1:
        """Download the data.

        :param force_download: If true, overwrites a previously cached file
        """
        if os.path.exists(arg_2) and not arg_3:
            log.info('using cached data at %s', arg_2)
        else:
            log.info('downloading %s to %s', arg_0, arg_2)
            urlretrieve(arg_0, arg_2)

        return arg_2

    return download_data

Make a function that downloads the data for you or uses a cached version at the given path .


Draws the submenu and its background.

        Note that this leaves the OpenGL state set to 2d drawing and may modify the scissor settings.

def Func ( arg_0 ) : if not arg_0 . visible : return if not isinstance ( arg_0 . submenu , Container ) : glEnable ( GL_SCISSOR_TEST ) glScissor ( * arg_0 . pos + arg_0 . size ) SubMenu . Func ( arg_0 ) if not isinstance ( arg_0 . submenu , Container ) : glDisable ( GL_SCISSOR_TEST )

def Func(arg_0):
        """
        Draws the submenu and its background.

        Note that this leaves the OpenGL state set to 2d Funcing and may modify the scissor settings.
        """
        if not arg_0.visible:
            # Simple visibility check, has to be tested to see if it works properly
            return

        if not isinstance(arg_0.submenu,Container):
            glEnable(GL_SCISSOR_TEST)
            glScissor(*arg_0.pos+arg_0.size)

        SubMenu.Func(arg_0)

        if not isinstance(arg_0.submenu,Container):
            glDisable(GL_SCISSOR_TEST)

Draws the submenu and its background . Note that this leaves the OpenGL state set to 2d drawing and may modify the scissor settings .


def
Func
(
arg_0
)
:
arg_0
.
using_ssh
=
bool
(
arg_0
.
sshkey
or
arg_0
.
sshserver
)
if
arg_0
.
sshkey
and
not
arg_0
.
sshserver
:
arg_0
.
sshserver
=
arg_0
.
url
.
split
(
'://'
)
[
1
]
.
split
(
':'
)
[
0
]
if
arg_0
.
using_ssh
:
if
tunnel
.
try_passwordless_ssh
(
arg_0
.
sshserver
,
arg_0
.
sshkey
,
arg_0
.
paramiko
)
:
arg_3
=
False
else
:
arg_3
=
getpass
(
"SSH Password for %s: "
%
arg_0
.
sshserver
)
else
:
arg_3
=
False
def
connect
(
arg_4
,
arg_5
)
:
arg_5
=
disambiguate_url
(
arg_5
,
arg_0
.
location
)
if
arg_0
.
using_ssh
:
arg_0
.
log
.
debug
(
"Tunneling connection to %s via %s"
%
(
arg_5
,
arg_0
.
sshserver
)
)
return
tunnel
.
tunnel_connection
(
arg_4
,
arg_5
,
arg_0
.
sshserver
,
keyfile
=
arg_0
.
sshkey
,
paramiko
=
arg_0
.
paramiko
,
arg_3
=
arg_3
,
)
else
:
return
arg_4
.
connect
(
arg_5
)
def
maybe_tunnel
(
arg_5
)
:
arg_5
=
disambiguate_url
(
arg_5
,
arg_0
.
location
)
if
arg_0
.
using_ssh
:
arg_0
.
log
.
debug
(
"Tunneling connection to %s via %s"
%
(
arg_5
,
arg_0
.
sshserver
)
)
arg_5
,
arg_6
=
tunnel
.
open_tunnel
(
arg_5
,
arg_0
.
sshserver
,
keyfile
=
arg_0
.
sshkey
,
paramiko
=
arg_0
.
paramiko
,
arg_3
=
arg_3
,
)
return
arg_5
return
connect
,
maybe_tunnel

def Func(arg_0):
        """construct connection function, which handles tunnels."""
        arg_0.using_ssh = bool(arg_0.sshkey or arg_0.sshserver)

        if arg_0.sshkey and not arg_0.sshserver:
            # We are using ssh directly to the controller, tunneling localhost to localhost
            arg_0.sshserver = arg_0.url.split('://')[1].split(':')[0]

        if arg_0.using_ssh:
            if tunnel.try_passwordless_ssh(arg_0.sshserver, arg_0.sshkey, arg_0.paramiko):
                arg_3=False
            else:
                arg_3 = getpass("SSH Password for %s: "%arg_0.sshserver)
        else:
            arg_3 = False

        def connect(arg_4, arg_5):
            arg_5 = disambiguate_url(arg_5, arg_0.location)
            if arg_0.using_ssh:
                arg_0.log.debug("Tunneling connection to %s via %s"%(arg_5, arg_0.sshserver))
                return tunnel.tunnel_connection(arg_4, arg_5, arg_0.sshserver,
                            keyfile=arg_0.sshkey, paramiko=arg_0.paramiko,
                            arg_3=arg_3,
                )
            else:
                return arg_4.connect(arg_5)

        def maybe_tunnel(arg_5):
            """like connect, but don't complete the connection (for use by heartbeat)"""
            arg_5 = disambiguate_url(arg_5, arg_0.location)
            if arg_0.using_ssh:
                arg_0.log.debug("Tunneling connection to %s via %s"%(arg_5, arg_0.sshserver))
                arg_5,arg_6 = tunnel.open_tunnel(arg_5, arg_0.sshserver,
                            keyfile=arg_0.sshkey, paramiko=arg_0.paramiko,
                            arg_3=arg_3,
                )
            return arg_5
        return connect, maybe_tunnel

construct connection function which handles tunnels .


def Func ( arg_0 ) : arg_1 = Network ( ) arg_2 = createRecordSensor ( arg_1 , name = _RECORD_SENSOR , arg_0 = arg_0 ) createSpatialPooler ( arg_1 , name = _L1_SPATIAL_POOLER , inputWidth = arg_2 . encoder . getWidth ( ) ) arg_3 = "UniformLink" arg_4 = "" arg_1 . link ( _RECORD_SENSOR , _L1_SPATIAL_POOLER , arg_3 , arg_4 ) arg_5 = createTemporalMemory ( arg_1 , _L1_TEMPORAL_MEMORY ) arg_1 . link ( _L1_SPATIAL_POOLER , _L1_TEMPORAL_MEMORY , arg_3 , arg_4 ) arg_6 = { 'alpha' : 0.005 , 'steps' : '1' , 'implementation' : 'py' , 'verbosity' : 0 } arg_7 = arg_1 . addRegion ( _L1_CLASSIFIER , "py.SDRClassifierRegion" , json . dumps ( arg_6 ) ) arg_7 . setParameter ( 'inferenceMode' , True ) arg_7 . setParameter ( 'learningMode' , True ) arg_1 . link ( _L1_TEMPORAL_MEMORY , _L1_CLASSIFIER , arg_3 , arg_4 , srcOutput = "bottomUpOut" , destInput = "bottomUpIn" ) arg_1 . link ( _RECORD_SENSOR , _L1_CLASSIFIER , arg_3 , arg_4 , srcOutput = "categoryOut" , destInput = "categoryIn" ) arg_1 . link ( _RECORD_SENSOR , _L1_CLASSIFIER , arg_3 , arg_4 , srcOutput = "bucketIdxOut" , destInput = "bucketIdxIn" ) arg_1 . link ( _RECORD_SENSOR , _L1_CLASSIFIER , arg_3 , arg_4 , srcOutput = "actValueOut" , destInput = "actValueIn" ) arg_8 = arg_5 . getSelf ( ) . getOutputElementCount ( "bottomUpOut" ) createSpatialPooler ( arg_1 , name = _L2_SPATIAL_POOLER , inputWidth = arg_8 ) arg_1 . link ( _L1_TEMPORAL_MEMORY , _L2_SPATIAL_POOLER , arg_3 , arg_4 ) createTemporalMemory ( arg_1 , _L2_TEMPORAL_MEMORY ) arg_1 . link ( _L2_SPATIAL_POOLER , _L2_TEMPORAL_MEMORY , arg_3 , arg_4 ) arg_9 = arg_1 . addRegion ( _L2_CLASSIFIER , "py.SDRClassifierRegion" , json . dumps ( arg_6 ) ) arg_9 . setParameter ( 'inferenceMode' , True ) arg_9 . setParameter ( 'learningMode' , True ) arg_1 . link ( _L2_TEMPORAL_MEMORY , _L2_CLASSIFIER , arg_3 , arg_4 , srcOutput = "bottomUpOut" , destInput = "bottomUpIn" ) arg_1 . link ( _RECORD_SENSOR , _L2_CLASSIFIER , arg_3 , arg_4 , srcOutput = "categoryOut" , destInput = "categoryIn" ) arg_1 . link ( _RECORD_SENSOR , _L2_CLASSIFIER , arg_3 , arg_4 , srcOutput = "bucketIdxOut" , destInput = "bucketIdxIn" ) arg_1 . link ( _RECORD_SENSOR , _L2_CLASSIFIER , arg_3 , arg_4 , srcOutput = "actValueOut" , destInput = "actValueIn" ) return arg_1

def Func(arg_0):
  """Creates and returns a new Network with a sensor region reading data from
  'dataSource'. There are two hierarchical levels, each with one SP and one TM.
  @param dataSource - A RecordStream containing the input data
  @returns a Network ready to run
  """
  arg_1 = Network()

  # Create and add a record sensor and a SP region
  arg_2 = createRecordSensor(arg_1, name=_RECORD_SENSOR,
                              arg_0=arg_0)
  createSpatialPooler(arg_1, name=_L1_SPATIAL_POOLER,
                      inputWidth=arg_2.encoder.getWidth())

  # Link the SP region to the sensor input
  arg_3 = "UniformLink"
  arg_4 = ""
  arg_1.link(_RECORD_SENSOR, _L1_SPATIAL_POOLER, arg_3, arg_4)

  # Create and add a TM region
  arg_5 = createTemporalMemory(arg_1, _L1_TEMPORAL_MEMORY)

  # Link SP region to TM region in the feedforward direction
  arg_1.link(_L1_SPATIAL_POOLER, _L1_TEMPORAL_MEMORY, arg_3, arg_4)

  # Add a classifier
  arg_6 = {  # Learning rate. Higher values make it adapt faster.
                        'alpha': 0.005,

                        # A comma separated list of the number of steps the
                        # classifier predicts in the future. The classifier will
                        # learn predictions of each order specified.
                        'steps': '1',

                        # The specific implementation of the classifier to use
                        # See SDRClassifierFactory#create for options
                        'implementation': 'py',

                        # Diagnostic output verbosity control;
                        # 0: silent; [1..6]: increasing levels of verbosity
                        'verbosity': 0}

  arg_7 = arg_1.addRegion(_L1_CLASSIFIER, "py.SDRClassifierRegion",
                                   json.dumps(arg_6))
  arg_7.setParameter('inferenceMode', True)
  arg_7.setParameter('learningMode', True)
  arg_1.link(_L1_TEMPORAL_MEMORY, _L1_CLASSIFIER, arg_3, arg_4,
               srcOutput="bottomUpOut", destInput="bottomUpIn")
  arg_1.link(_RECORD_SENSOR, _L1_CLASSIFIER, arg_3, arg_4,
               srcOutput="categoryOut", destInput="categoryIn")
  arg_1.link(_RECORD_SENSOR, _L1_CLASSIFIER, arg_3, arg_4,
               srcOutput="bucketIdxOut", destInput="bucketIdxIn")
  arg_1.link(_RECORD_SENSOR, _L1_CLASSIFIER, arg_3, arg_4,
               srcOutput="actValueOut", destInput="actValueIn")

  # Second Level
  arg_8 = arg_5.getSelf().getOutputElementCount("bottomUpOut")
  createSpatialPooler(arg_1, name=_L2_SPATIAL_POOLER, inputWidth=arg_8)
  arg_1.link(_L1_TEMPORAL_MEMORY, _L2_SPATIAL_POOLER, arg_3, arg_4)

  createTemporalMemory(arg_1, _L2_TEMPORAL_MEMORY)
  arg_1.link(_L2_SPATIAL_POOLER, _L2_TEMPORAL_MEMORY, arg_3, arg_4)

  arg_9 = arg_1.addRegion(_L2_CLASSIFIER, "py.SDRClassifierRegion",
                                   json.dumps(arg_6))
  arg_9.setParameter('inferenceMode', True)
  arg_9.setParameter('learningMode', True)
  arg_1.link(_L2_TEMPORAL_MEMORY, _L2_CLASSIFIER, arg_3, arg_4,
               srcOutput="bottomUpOut", destInput="bottomUpIn")
  arg_1.link(_RECORD_SENSOR, _L2_CLASSIFIER, arg_3, arg_4,
               srcOutput="categoryOut", destInput="categoryIn")
  arg_1.link(_RECORD_SENSOR, _L2_CLASSIFIER, arg_3, arg_4,
               srcOutput="bucketIdxOut", destInput="bucketIdxIn")
  arg_1.link(_RECORD_SENSOR, _L2_CLASSIFIER, arg_3, arg_4,
               srcOutput="actValueOut", destInput="actValueIn")
  return arg_1

Creates and returns a new Network with a sensor region reading data from dataSource . There are two hierarchical levels each with one SP and one TM .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = tomography_circuit_names ( arg_2 , arg_1 ) arg_4 = arg_2 [ 'circuits' ] arg_5 = [ ] arg_6 = None for arg_7 , arg_8 in enumerate ( arg_3 ) : arg_9 = marginal_counts ( arg_0 . get_counts ( arg_3 [ arg_7 ] ) , arg_2 [ 'qubits' ] ) arg_10 = sum ( arg_9 . values ( ) ) arg_11 = arg_4 [ arg_7 ] [ 'meas' ] arg_6 = arg_4 [ arg_7 ] . get ( 'prep' , None ) arg_12 = sorted ( arg_11 . keys ( ) ) if arg_6 : arg_13 = sorted ( arg_6 . keys ( ) ) arg_14 = { } for arg_15 in arg_9 . keys ( ) : arg_14 [ arg_15 ] = { } arg_14 [ arg_15 ] [ 'meas' ] = [ ( arg_11 [ arg_12 [ k ] ] , int ( arg_15 [ - 1 - k ] ) ) for k in range ( len ( arg_12 ) ) ] if arg_6 : arg_14 [ arg_15 ] [ 'prep' ] = [ arg_6 [ arg_13 [ k ] ] for k in range ( len ( arg_13 ) ) ] arg_5 . append ( { 'counts' : arg_9 , 'shots' : arg_10 , 'circuit' : arg_14 } ) arg_16 = { 'data' : arg_5 , 'meas_basis' : arg_2 [ 'meas_basis' ] } if arg_6 : arg_16 [ 'prep_basis' ] = arg_2 [ 'prep_basis' ] return arg_16

def Func(arg_0, arg_1, arg_2):
    """
    Return a results dict for a state or process tomography experiment.

    Args:
        results (Result): Results from execution of a process tomography
            circuits on a backend.
        name (string): The name of the circuit being reconstructed.
        tomoset (tomography_set): the dict of tomography configurations.

    Returns:
        list: A list of dicts for the outcome of each process tomography
        measurement circuit.
    """

    arg_3 = tomography_circuit_names(arg_2, arg_1)
    arg_4 = arg_2['circuits']
    arg_5 = []
    arg_6 = None
    for arg_7, arg_8 in enumerate(arg_3):
        arg_9 = marginal_counts(arg_0.get_counts(arg_3[arg_7]),
                                 arg_2['qubits'])
        arg_10 = sum(arg_9.values())
        arg_11 = arg_4[arg_7]['meas']
        arg_6 = arg_4[arg_7].get('prep', None)
        arg_12 = sorted(arg_11.keys())
        if arg_6:
            arg_13 = sorted(arg_6.keys())
        arg_14 = {}
        for arg_15 in arg_9.keys():
            arg_14[arg_15] = {}
            arg_14[arg_15]['meas'] = [(arg_11[arg_12[k]], int(arg_15[-1 - k]))
                                  for k in range(len(arg_12))]
            if arg_6:
                arg_14[arg_15]['prep'] = [arg_6[arg_13[k]]
                                      for k in range(len(arg_13))]
        arg_5.append({'counts': arg_9, 'shots': arg_10, 'circuit': arg_14})

    arg_16 = {'data': arg_5, 'meas_basis': arg_2['meas_basis']}
    if arg_6:
        arg_16['prep_basis'] = arg_2['prep_basis']
    return arg_16

Return a results dict for a state or process tomography experiment .


def Func(arg_0, arg_1):
        """Extract function signature from an existing partial instance."""

        arg_0.pargl     = list(arg_1.pargl)
        arg_0.kargl     = list(arg_1.kargl)
        arg_0.def_argv  = arg_1.def_argv.copy()
        arg_0.var_pargs = arg_1.var_pargs
        arg_0.var_kargs = arg_1.var_kargs

Extract function signature from an existing partial instance .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
if
not
scipy_io
:
raise
ImportError
(
'load_matlab_model requires scipy'
)
if
arg_2
is
:
arg_2
=
str
(
arg_0
.
id
)
if
arg_0
.
id
is
not
and
len
(
arg_0
.
id
)
>
0
else
"exported_model"
arg_3
=
create_mat_dict
(
arg_0
)
scipy_io
.
savemat
(
arg_1
,
{
arg_2
:
arg_3
}
,
appendmat
=
True
,
oned_as
=
"column"
)

def Func(arg_0, arg_1, arg_2=None):
    """Save the cobra model as a .mat file.

    This .mat file can be used directly in the MATLAB version of COBRA.

    Parameters
    ----------
    model : cobra.core.Model.Model object
        The model to save
    file_name : str or file-like object
        The file to save to
    varname : string
       The name of the variable within the workspace
    """
    if not scipy_io:
        raise ImportError('load_matlab_model requires scipy')

    if arg_2 is None:
        arg_2 = str(arg_0.id) \
            if arg_0.id is not None and len(arg_0.id) > 0 \
            else "exported_model"
    arg_3 = create_mat_dict(arg_0)
    scipy_io.savemat(arg_1, {arg_2: arg_3},
                     appendmat=True, oned_as="column")


def
Func
(
arg_0
)
:
@
functools
.
wraps
(
arg_0
)
def
connection
(
*
arg_1
,
**
arg_2
)
:
arg_3
=
Session
(
)
arg_3
.
mount
(
'http://'
,
HTTPAdapter
(
max_retries
=
2
)
)
arg_3
.
mount
(
'https://'
,
HTTPAdapter
(
max_retries
=
2
)
)
arg_4
=
Request
(
**
arg_0
(
*
arg_1
,
**
arg_2
)
)
arg_5
=
arg_3
.
prepare_request
(
arg_4
)
arg_6
=
arg_3
.
send
(
arg_5
,
verify
=
True
)
if
arg_6
.
status_code
!=
requests
.
codes
.
ok
:
arg_6
.
raise_for_status
(
)
arg_7
=
re
.
subn
(
r',(?=,)'
,
''
,
arg_6
.
content
.
decode
(
'utf-8'
)
)
[
0
]
return
json
.
loads
(
arg_7
.
replace
(
r'\xA0'
,
r' '
)
.
replace
(
'[,'
,
'[1,'
)
,
encoding
=
'UTF-8'
)
return
connection

def Func(arg_0):
    '''
    Decorates a function returning the url of translation API.
    Creates and maintains HTTP connection state

    Returns a dict response object from the server containing the translated
    text and metadata of the request body

    :param interface: Callable Request Interface
    :type interface: Function
    '''

    @functools.wraps(arg_0)
    def connection(*arg_1, **arg_2):
        """
        Extends and wraps a HTTP interface.

        :return: Response Content
        :rtype: Dictionary
        """
        arg_3 = Session()
        arg_3.mount('http://',  HTTPAdapter(max_retries=2))
        arg_3.mount('https://', HTTPAdapter(max_retries=2))

        arg_4  = Request(**arg_0(*arg_1, **arg_2))
        arg_5  = arg_3.prepare_request(arg_4)
        arg_6 = arg_3.send(arg_5, verify=True)

        if arg_6.status_code != requests.codes.ok:
            arg_6.raise_for_status()

        arg_7 = re.subn(r',(?=,)', '', arg_6.content.decode('utf-8'))[0]

        return json.loads(arg_7.replace(r'\xA0', r' ').replace('[,', '[1,'), encoding='UTF-8')

    return connection

Decorates a function returning the url of translation API . Creates and maintains HTTP connection state


def Func(arg_0, arg_1, arg_2):
    """Returns the closest training pattern to inputPattern that belongs to
    category "cat".

    :param inputPattern: The pattern whose closest neighbor is sought

    :param cat: The required category of closest neighbor

    :returns: A dense version of the closest training pattern, or None if no
        such patterns exist
    """
    arg_3 = arg_0._getDistances(arg_1)
    arg_4 = arg_3.argsort()

    for arg_5 in arg_4:
      arg_6 = arg_0._categoryList[arg_5]

      # If closest pattern belongs to desired category, return it
      if arg_6 == arg_2:
        if arg_0.useSparseMemory:
          arg_7 = arg_0._Memory.getRow(int(arg_5))
        else:
          arg_7 = arg_0._M[arg_5]

        return arg_7

    # No patterns were found!
    return None

Returns the closest training pattern to inputPattern that belongs to category cat .


(
        instance_id_list,
        client=None
)

def Func ( arg_0 , arg_1 = None ) : if not arg_1 : arg_1 = boto3 . client ( 'ec2' ) arg_2 = arg_1 . terminate_instances ( InstanceIds = arg_0 ) return arg_2

def Func(
        arg_0,
        arg_1=None
):
    """This deletes EC2 nodes and terminates the instances.

    Parameters
    ----------

    instance_id_list : list of str
        A list of EC2 instance IDs to terminate.

    client : boto3.Client or None
        If None, this function will instantiate a new `boto3.Client` object to
        use in its operations. Alternatively, pass in an existing `boto3.Client`
        instance to re-use it here.

    Returns
    -------

    Nothing.

    """

    if not arg_1:
        arg_1 = boto3.client('ec2')

    arg_2 = arg_1.terminate_instances(
        InstanceIds=arg_0
    )

    return arg_2

This deletes EC2 nodes and terminates the instances .


(p=0, per_channel=False, name=None, deterministic=False, random_state=None)

return ReplaceElementwise(
        mask=p,
        replacement=replacement,
        per_channel=per_channel,
        name=name,
        deterministic=deterministic,
        random_state=random_state
    )

def Func ( arg_0 = 0 , arg_1 = False , arg_2 = None , arg_3 = False , arg_4 = None ) : arg_5 = iap . ForceSign ( iap . Beta ( 0.5 , 0.5 ) - 0.5 , positive = False , mode = "invert" ) + 0.5 arg_6 = arg_5 * 255 if arg_2 is None : arg_2 = "Unnamed%s" % ( ia . caller_name ( ) , ) return ReplaceElementwise ( mask = arg_0 , arg_6 = arg_6 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0=0, arg_1=False, arg_2=None, arg_3=False, arg_4=None):
    """
    Adds pepper noise to an image, i.e. black-ish pixels.

    This is similar to dropout, but slower and the black pixels are not uniformly black.

    dtype support::

        See ``imgaug.augmenters.arithmetic.ReplaceElementwise``.

    Parameters
    ----------
    p : float or tuple of float or list of float or imgaug.parameters.StochasticParameter, optional
        Probability of changing a pixel to pepper noise.

            * If a float, then that value will be used for all images as the
              probability.
            * If a tuple ``(a, b)``, then a probability will be sampled per image
              from the range ``a <= x <= b``.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, then this parameter will be used as
              the *mask*, i.e. it is expected to contain values between
              0.0 and 1.0, where 1.0 means that pepper is to be added
              at that location.

    per_channel : bool or float, optional
        Whether to use the same value for all channels (False)
        or to sample a new value for each channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.Func(0.05)

    Replaces 5 percent of all pixels with pepper.

    """

    arg_5 = iap.ForceSign(
        iap.Beta(0.5, 0.5) - 0.5,
        positive=False,
        mode="invert"
    ) + 0.5
    arg_6 = arg_5 * 255

    if arg_2 is None:
        arg_2 = "Unnamed%s" % (ia.caller_name(),)

    return ReplaceElementwise(
        mask=arg_0,
        arg_6=arg_6,
        arg_1=arg_1,
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4
    )

Adds pepper noise to an image, i.e. black-ish pixels.

    This is similar to dropout, but slower and the black pixels are not uniformly black.

    dtype support::

        See ``imgaug.augmenters.arithmetic.ReplaceElementwise``.

    Parameters
    ----------
    p : float or tuple of float or list of float or imgaug.parameters.StochasticParameter, optional
        Probability of changing a pixel to pepper noise.

            * If a float, then that value will be used for all images as the
              probability.
            * If a tuple ``(a, b)``, then a probability will be sampled per image
              from the range ``a <= x <= b``.
            * If a list, then a random value will be sampled from that list
              per image.
            * If a StochasticParameter, then this parameter will be used as
              the *mask*, i.e. it is expected to contain values between
              0.0 and 1.0, where 1.0 means that pepper is to be added
              at that location.

    per_channel : bool or float, optional
        Whether to use the same value for all channels (False)
        or to sample a new value for each channel (True).
        If this value is a float ``p``, then for ``p`` percent of all images
        `per_channel` will be treated as True, otherwise as False.

    name : None or str, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    deterministic : bool, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    random_state : None or int or numpy.random.RandomState, optional
        See :func:`imgaug.augmenters.meta.Augmenter.__init__`.

    Examples
    --------
    >>> aug = iaa.Pepper(0.05)

    Replaces 5 percent of all pixels with pepper.

Adds pepper noise to an image i . e . black - ish pixels .


(p=0, name=None, deterministic=False, random_state=None)

return SaltAndPepper(p=p, per_channel=True, name=name, deterministic=deterministic, random_state=random_state)

def Func(arg_0=0, arg_1=None, arg_2=False, arg_3=None):
    """
    Creates an augmenter to apply impulse noise to an image.

    This is identical to ``SaltAndPepper``, except that per_channel is always set to True.

    dtype support::

        See ``imgaug.augmenters.arithmetic.SaltAndPepper``.

    """
    return SaltAndPepper(arg_0=arg_0, per_channel=True, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)

Creates an augmenter to apply impulse noise to an image .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
_tags
:
if
"extensible"
in
arg_1
:
cycle_len
=
int
(
arg_1
.
split
(
":"
)
[
1
]
)
break
else
:
return
arg_2
=
arg_3
=
[
]
for
arg_4
,
arg_5
in
enumerate
(
arg_0
.
_field_descriptors
)
:
if
(
arg_2
is
not
)
and
(
arg_4
>=
(
arg_2
+
cycle_len
)
)
:
break
if
(
arg_2
is
)
and
(
"begin-extensible"
in
arg_5
.
tags
)
:
arg_2
=
arg_4
if
arg_2
is
:
continue
arg_3
.
append
(
arg_5
.
ref
.
replace
(
"1"
,
r"(\d+)"
)
)
else
:
raise
RuntimeError
(
"cycle start not found"
)
arg_0
.
_field_descriptors
=
arg_0
.
_field_descriptors
[
:
arg_2
+
cycle_len
]
arg_0
.
extensible_info
=
(
arg_2
,
cycle_len
,
tuple
(
arg_3
)
)
for
arg_4
,
arg_8
in
enumerate
(
arg_0
.
_field_descriptors
[
arg_2
:
]
)
:
arg_8
.
set_extensible_info
(
arg_2
,
cycle_len
,
arg_3
[
arg_4
]
)

def Func(arg_0):
        """
        This function finishes initialization, must be called once all field descriptors and tag have been filled.
        """
        # see if extensible and store cycle len
        for arg_1 in arg_0._tags:
            if "extensible" in arg_1:
                cycle_len = int(arg_1.split(":")[1])
                break
        else:
            # not extensible
            return

        # find cycle start and prepare patterns
        arg_2 = None
        arg_3 = []
        for arg_4, arg_5 in enumerate(arg_0._field_descriptors):
            # quit if finished
            if (arg_2 is not None) and (arg_4 >= (arg_2 + cycle_len)):
                break

            # set cycle start if not set yet
            if (arg_2 is None) and ("begin-extensible" in arg_5.tags):
                arg_2 = arg_4

            # leave if cycle start not reached yet
            if arg_2 is None:
                continue

            # store pattern
            arg_3.append(arg_5.ref.replace("1", r"(\d+)"))
        else:
            raise RuntimeError("cycle start not found")

        # detach unnecessary field descriptors
        arg_0._field_descriptors = arg_0._field_descriptors[:arg_2 + cycle_len]

        # store cycle info
        arg_0.extensible_info = (arg_2, cycle_len, tuple(arg_3))

        # set field descriptor cycle_start index (for error messages while serialization)
        for arg_4, arg_8 in enumerate(arg_0._field_descriptors[arg_2:]):
            arg_8.set_extensible_info(arg_2, cycle_len, arg_3[arg_4])

This function finishes initialization must be called once all field descriptors and tag have been filled .


def Func ( arg_0 ) : if os . sep != '/' : arg_0 = '/' . join ( arg_0 . split ( os . sep ) ) return quote ( arg_0 )

def Func(arg_0):
    """Transform path to url, converting backslashes to slashes if needed."""

    if os.sep != '/':
        arg_0 = '/'.join(arg_0.split(os.sep))
    return quote(arg_0)

Transform path to url converting backslashes to slashes if needed .


def Func(arg_0, arg_1=False):
        """Creates logging handlers and redirects stdout."""

        arg_2 = arg_0.log_stdout
        if sys.stdout is arg_0._stdout_to_logger:
            # If we already redirected stdout we don't neet to redo it again
            arg_2 = False

        if arg_0.log_config:
            if arg_1:
                arg_3 = arg_0._mp_config
            else:
                arg_3 = arg_0._sp_config

            if arg_3:
                if isinstance(arg_3, dict):
                    arg_4 = arg_0._handle_dict_config(arg_3)
                    dictConfig(arg_4)
                else:
                    arg_5 = arg_0._handle_config_parsing(arg_3)
                    arg_6 = arg_0._parser_to_string_io(arg_5)
                    fileConfig(arg_6, disable_existing_loggers=False)

        if arg_2:
            #  Create a logging mock for stdout
            arg_7, arg_8 = arg_0.log_stdout

            arg_9 = StdoutToLogger(arg_7, log_level=arg_8)
            arg_9.start()
            arg_0._tools.append(arg_9)

Creates logging handlers and redirects stdout .


def Func(arg_0, arg_1):
        """Get a token response from POST data.

        :param data: POST data containing authorization information.
        :type data: dict
        :rtype: requests.Response
        """
        try:
            # Verify OAuth 2.0 Parameters
            for arg_2 in ['grant_type', 'client_id', 'client_secret']:
                if not arg_1.get(arg_2):
                    raise TypeError("Missing required OAuth 2.0 POST param: {0}".format(arg_2))

            # Handle get token from refresh_token
            if 'refresh_token' in arg_1:
                return arg_0.refresh_token(**arg_1)

            # Handle get token from authorization code
            for arg_2 in ['redirect_uri', 'code']:
                if not arg_1.get(arg_2):
                    raise TypeError("Missing required OAuth 2.0 POST param: {0}".format(arg_2))
            return arg_0.get_token(**arg_1)
        except TypeError as exc:
            arg_0._handle_exception(exc)

            # Catch missing parameters in request
            return arg_0._make_json_error_response('invalid_request')
        except StandardError as exc:
            arg_0._handle_exception(exc)

            # Catch all other server errors
            return arg_0._make_json_error_response('server_error')


def Func(arg_0):
        """create & start main thread

        :return: None
        """
        arg_1 = MainThread(main_queue=arg_0.main_queue,
                            main_spider=arg_0.main_spider,
                            branch_spider=arg_0.branch_spider)
        arg_1.daemon = True
        arg_1.start()


(self, sender, receiver, packet, add_delay=0)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=0):
        """
        bandwidths are inaccurate, as we don't account for parallel transfers here
        """
        arg_5 = min(arg_1.ul_bandwidth, arg_2.dl_bandwidth)
        Func = arg_1.base_latency + arg_2.base_latency
        Func += len(arg_3) / arg_5
        Func += arg_4
        return Func

bandwidths are inaccurate as we don t account for parallel transfers here


def Func ( arg_0 , arg_1 ) : arg_2 = filter ( lambda x : x . username == arg_1 , arg_0 . users . values ( ) ) if len ( arg_2 ) > 0 : return arg_2 [ 0 ] return None

def Func(arg_0, arg_1):
        """Retrieve user by username"""
        arg_2 = filter(lambda x: x.username == arg_1, arg_0.users.values())
        if len(arg_2) > 0:
            return arg_2[0]
        return None


(self, metric_store, line_data, transaction_list, aggregate_timestamp)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : for arg_5 in arg_3 : if arg_2 . get ( 's' ) == 'true' : arg_6 = arg_1 [ 'qps' ] else : arg_6 = arg_1 [ 'eqps' ] arg_7 = arg_6 [ arg_5 ] if arg_4 in arg_7 : arg_7 [ arg_4 ] += 1 else : arg_7 [ arg_4 ] = 1 return None

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """
    Organize and store the count of data from the log line into the metric store by metric type, transaction, timestamp

    :param dict metric_store: The metric store used to store all the parsed jmeter log data
    :param dict line_data: dict with the extracted k:v from the log line
    :param list transaction_list: list of transaction to be used for storing the metrics from given line
    :param string aggregate_timestamp: timestamp used for storing the raw data. This accounts for aggregation time period
    :return: None
    """
    for arg_5 in arg_3:
      if arg_2.get('s') == 'true':
        arg_6 = arg_1['qps']
      else:
        arg_6 = arg_1['eqps']
      arg_7 = arg_6[arg_5]
      if arg_4 in arg_7:
        arg_7[arg_4] += 1
      else:
        arg_7[arg_4] = 1
    return None

Organize and store the count of data from the log line into the metric store by metric type transaction timestamp


def Func(arg_0, arg_1):
        """ Handle requests for raw_input.
        """
        arg_0.log.debug("input: %s", arg_1.get('content', ''))
        if arg_0._hidden:
            raise RuntimeError('Request for raw input during hidden execution.')

        # Make sure that all output from the SUB channel has been processed
        # before entering readline mode.
        arg_0.kernel_manager.sub_channel.flush()

        def callback(arg_2):
            arg_0.kernel_manager.stdin_channel.input(arg_2)
        if arg_0._reading:
            arg_0.log.debug("Got second input request, assuming first was interrupted.")
            arg_0._reading = False
        arg_0._readline(arg_1['content']['prompt'], callback=callback)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
'Usage: %s'
%
arg_1
if
arg_0
.
parser
.
description
:
arg_2
+=
'\n'
return
arg_2

def Func(arg_0, arg_1):
        """
        ensure there is only one newline between usage and the first heading
        if there is no description
        """
        arg_2 = 'Usage: %s' % arg_1
        if arg_0.parser.description:
            arg_2 += '\n'
        return arg_2


def Func ( arg_0 , * arg_1 ) : for arg_2 in arg_1 : arg_0 . parameter_count += np . prod ( arg_2 . get_value ( ) . shape ) arg_0 . parameters . extend ( arg_1 )

def Func(arg_0, *arg_1):
        """
        Register parameters.
        """
        for arg_2 in arg_1:
            arg_0.parameter_count += np.prod(arg_2.get_value().shape)
        arg_0.parameters.extend(arg_1)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Double precision shift right.

        Shifts the first operand (destination operand) to the left the number of bits specified by the third operand
        (count operand). The second operand (source operand) provides bits to shift in from the right (starting with
        the least significant bit of the destination operand).

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        :param count: count operand
        """
        arg_4 = arg_1.size
        arg_5 = Operators.ZEXTEND(arg_3.read(), arg_4) & (arg_4 - 1)
        arg_6 = arg_1.read()
        arg_7 = arg_2.read()

        arg_8 = ((1 << arg_4) - 1)
        arg_9 = (arg_6 << arg_5)
        arg_10 = arg_7 >> (arg_4 - arg_5)
        arg_11 = Operators.ITEBV(arg_4, arg_5 == 0, arg_6, arg_9 | arg_10)
        arg_11 = arg_11 & arg_8
        arg_1.write(arg_11)
        if isinstance(arg_5, int) and arg_5 == 0:
            pass
        else:
            arg_12 = 1 << (arg_4 - 1)
            arg_13 = 0 != ((arg_6 << (arg_5 - 1)) & arg_12)

            arg_0._set_shiftd_flags(arg_4, arg_6, arg_11, arg_13, arg_5)


def Func ( arg_0 ) : if arg_0 . has_default ( ) : if callable ( arg_0 . default ) : arg_1 = arg_0 . default ( ) if isinstance ( arg_1 , uuid . UUID ) : return arg_1 . hex return arg_1 if isinstance ( arg_0 . default , uuid . UUID ) : return arg_0 . default . hex return arg_0 . default return None

def Func(arg_0):
        """
        Returns the default value for this field.
        """
        if arg_0.has_default():
            if callable(arg_0.default):
                arg_1 = arg_0.default()
                if isinstance(arg_1, uuid.UUID):
                    return arg_1.hex
                return arg_1
            if isinstance(arg_0.default, uuid.UUID):
                return arg_0.default.hex
            return arg_0.default
        return None

Returns the default value for this field .


(
            cls,
            request,
            enterprise_customer,
            emails,
            mode,
            course_id=None,
            program_details=None,
            notify=True
    )

def Func(
            arg_0,
            arg_1,
            arg_2,
            arg_3,
            arg_4,
            arg_5=None,
            arg_6=None,
            arg_7=True
    ):
        """
        Enroll the users with the given email addresses to the courses specified, either specifically or by program.

        Args:
            cls (type): The EnterpriseCustomerManageLearnersView class itself
            request: The HTTP request the enrollment is being created by
            enterprise_customer: The instance of EnterpriseCustomer whose attached users we're enrolling
            emails: An iterable of strings containing email addresses to enroll in a course
            mode: The enrollment mode the users will be enrolled in the course with
            course_id: The ID of the course in which we want to enroll
            program_details: Details about a program in which we want to enroll
            notify: Whether to notify (by email) the users that have been enrolled
        """
        arg_8 = []

        if arg_5:
            arg_9, arg_10, arg_11 = arg_0.enroll_users_in_course(
                arg_2=arg_2,
                arg_5=arg_5,
                course_mode=arg_4,
                arg_3=arg_3,
            )
            arg_12 = arg_9 + arg_10
            if arg_7:
                arg_2.notify_enrolled_learners(
                    catalog_api_user=arg_1.user,
                    arg_5=arg_5,
                    users=arg_12,
                )
            if arg_9:
                arg_8.append(arg_0.get_success_enrollment_message(arg_9, arg_5))
            if arg_11:
                arg_8.append(arg_0.get_failed_enrollment_message(arg_11, arg_5))
            if arg_10:
                arg_8.append(arg_0.get_pending_enrollment_message(arg_10, arg_5))

        if arg_6:
            arg_9, arg_10, arg_11 = arg_0.enroll_users_in_program(
                arg_2=arg_2,
                arg_6=arg_6,
                course_mode=arg_4,
                arg_3=arg_3,
            )
            arg_12 = arg_9 + arg_10
            if arg_7:
                arg_0.notify_program_learners(
                    arg_2=arg_2,
                    arg_6=arg_6,
                    users=arg_12
                )
            arg_13 = arg_6.get('title', arg_6.get('uuid', _('the program')))
            if arg_9:
                arg_8.append(arg_0.get_success_enrollment_message(arg_9, arg_13))
            if arg_11:
                arg_8.append(arg_0.get_failed_enrollment_message(arg_11, arg_13))
            if arg_10:
                arg_8.append(arg_0.get_pending_enrollment_message(arg_10, arg_13))

        arg_0.send_messages(arg_1, arg_8)

Enroll the users with the given email addresses to the courses specified either specifically or by program .


(self, lockID, callback=None, sync=False, timeout=None)

return self.__lockImpl.acquire(lockID, self.__selfID, time.time(), callback=callback, sync=sync, timeout=timeout)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False , arg_4 = None ) : return arg_0 . __lockImpl . acquire ( arg_1 , arg_0 . __selfID , time . time ( ) , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=False, arg_4=None):
        """Attempt to acquire lock.

        :param lockID: unique lock identifier.
        :type lockID: str
        :param sync: True - to wait until lock is acquired or failed to acquire.
        :type sync: bool
        :param callback: if sync is False - callback will be called with operation result.
        :type callback: func(opResult, error)
        :param timeout: max operation time (default - unlimited)
        :type timeout: float
        :return True if acquired, False - somebody else already acquired lock
        """
        return arg_0.__lockImpl.acquire(arg_1, arg_0.__selfID, time.time(), arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)