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

def Func(arg_0,
                      arg_1,
                      arg_2=None,
                      arg_3=True,
                      arg_4=None,
                      arg_5=None,
                      arg_6=None,
                      arg_7='hat-sql',
                      arg_8=None,
                      arg_9=('gls','pdm','mav','win'),
                      arg_10=({},{},{},{}),
                      arg_11=10.0,
                      arg_12=False,
                      arg_13=arg_14,
                      arg_15=1,
                      arg_16=None,
                      arg_17=None,
                      arg_18=500,
                      arg_19=True):
    '''This runs parallel light curve period finding for directory of LCs.

    Parameters
    ----------

    lcdir : str
        The directory containing the LCs to process.

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

    fileglob : str or None
        The UNIX file glob to use to search for LCs in `lcdir`. If None, the
        default file glob associated with the registered LC format will be used
        instead.

    recursive : bool
        If True, will search recursively in `lcdir` for light curves to process.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Returns
    -------

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

    '''

    try:
        arg_20 = get_lcformat(arg_7,
                                  use_lcformat_dir=arg_8)
        if arg_20:
            (arg_21, arg_22,
             arg_23, arg_24, arg_25,
             arg_26, arg_27) = arg_20
        else:
            LOGERROR("can't figure out the light curve format")
            return None
    except Exception as e:
        LOGEXCEPTION("can't figure out the light curve format")
        return None

    if not arg_2:
        arg_2 = arg_21

    # now find the files
    LOGINFO('searching for %s light curves in %s ...' % (arg_7, arg_0))

    if arg_3 is False:
        arg_28 = glob.glob(os.path.join(arg_0, arg_2))

    else:
        # use recursive glob for Python 3.5+
        if sys.version_info[:2] > (3,4):

            arg_28 = glob.glob(os.path.join(arg_0,
                                              '**',
                                              arg_2),arg_3=True)

        # otherwise, use os.walk and glob
        else:

            # use os.walk to go through the directories
            arg_29 = os.walk(arg_0)
            arg_28 = []

            for arg_30, arg_31, arg_32 in arg_29:
                for arg_33 in arg_31:
                    arg_34 = os.path.join(arg_30,
                                              arg_33,
                                              arg_2)
                    arg_35 = glob.glob(arg_34)

                    if arg_35:
                        arg_28.extend(arg_35)

    # now that we have all the files, process them
    if arg_28 and len(arg_28) > 0:

        # this helps us process things in deterministic order when we distribute
        # processing over several machines
        arg_28 = sorted(arg_28)

        LOGINFO('found %s light curves, running pf...' % len(arg_28))

        return parallel_pf(arg_28,
                           arg_1,
                           arg_4=arg_4,
                           arg_5=arg_5,
                           arg_6=arg_6,
                           arg_7=arg_7,
                           arg_8=arg_8,
                           arg_9=arg_9,
                           arg_10=arg_10,
                           arg_12=arg_12,
                           arg_11=arg_11,
                           arg_13=arg_13,
                           arg_15=arg_15,
                           arg_16=arg_16,
                           arg_17=arg_17,
                           arg_18=arg_18,
                           arg_19=arg_19)

    else:

        LOGERROR('no light curve files in %s format found in %s' % (arg_7,
                                                                    arg_0))
        return None

This runs parallel light curve period finding for directory of LCs .


async def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : try : await arg_3 except Exception as exc : if arg_1 == arg_0 . LISTENER_ERROR_EVENT : raise arg_0 . emit ( arg_0 . LISTENER_ERROR_EVENT , arg_1 , arg_2 , exc )

async def Func(arg_0, arg_1, arg_2, arg_3):
    """Coroutine wrapper to catch errors after async scheduling.

    Args:
        emitter (EventEmitter): The event emitter that is attempting to
            call a listener.
        event (str): The event that triggered the emitter.
        listener (async def): The async def that was used to generate the coro.
        coro (coroutine): The coroutine that should be tried.

    If an exception is caught the function will use the emitter to emit the
    failure event. If, however, the current event _is_ the failure event then
    the method reraises. The reraised exception may show in debug mode for the
    event loop but is otherwise silently dropped.
    """
    try:

        await arg_3

    except Exception as exc:

        if arg_1 == arg_0.LISTENER_ERROR_EVENT:

            raise

        arg_0.emit(arg_0.LISTENER_ERROR_EVENT, arg_1, arg_2, exc)

Coroutine wrapper to catch errors after async scheduling .


(course_id, course_url, cost_in_cents, mode, course_data, sku)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
{
'id'
:
"{}-{}"
.
format
(
arg_0
,
arg_3
)
,
'url'
:
arg_1
,
'price'
:
arg_2
,
'qty'
:
1
,
}
if
'title'
in
arg_4
:
arg_6
[
'title'
]
=
arg_4
[
'title'
]
else
:
arg_6
[
'title'
]
=
'Course {} mode: {}'
.
format
(
arg_0
,
arg_3
)
if
'tags'
in
arg_4
:
arg_6
[
'tags'
]
=
arg_4
[
'tags'
]
arg_6
[
'vars'
]
=
dict
(
arg_4
.
get
(
'vars'
,
{
}
)
,
arg_3
=
arg_3
,
course_run_id
=
arg_0
)
arg_6
[
'vars'
]
[
'purchase_sku'
]
=
arg_5
return
arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    """Build and return Sailthru purchase item object"""

    # build item description
    arg_6 = {
        'id': "{}-{}".format(arg_0, arg_3),
        'url': arg_1,
        'price': arg_2,
        'qty': 1,
    }

    # get title from course info if we don't already have it from Sailthru
    if 'title' in arg_4:
        arg_6['title'] = arg_4['title']
    else:
        # can't find, just invent title
        arg_6['title'] = 'Course {} mode: {}'.format(arg_0, arg_3)

    if 'tags' in arg_4:
        arg_6['tags'] = arg_4['tags']

    # add vars to item
    arg_6['vars'] = dict(arg_4.get('vars', {}), arg_3=arg_3, course_run_id=arg_0)

    arg_6['vars']['purchase_sku'] = arg_5

    return arg_6


(self, name=None, attrs={}, text=None, **kwargs)

return self._findOne(self.findAllPrevious, name, attrs, text, **kwargs)

def Func ( arg_0 , arg_1 = None , arg_2 = { } , arg_3 = None , ** arg_4 ) : return arg_0 . _findOne ( arg_0 . findAllPrevious , arg_1 , arg_2 , arg_3 , ** arg_4 )

def Func(arg_0, arg_1=None, arg_2={}, arg_3=None, **arg_4):
        """Returns the first item that matches the given criteria and
        appears before this Tag in the document."""
        return arg_0._findOne(arg_0.findAllPrevious, arg_1, arg_2, arg_3, **arg_4)

Returns the first item that matches the given criteria and appears before this Tag in the document .


def
Func
(
)
:
sys
.
stderr
.
write
(
''
.
join
(
'  %s\n'
%
arg_0
for
arg_0
in
_ERROR_CATEGORIES
)
)
sys
.
exit
(
0
)

def Func():
  """Prints a list of all the error-categories used by error messages.

  These are the categories used to filter messages via --filter.
  """
  sys.stderr.write(''.join('  %s\n' % arg_0 for arg_0 in _ERROR_CATEGORIES))
  sys.exit(0)

Prints a list of all the error - categories used by error messages .


def
Func
(
arg_0
,
arg_1
=
7
)
:
if
not
isinstance
(
arg_0
,
int
)
:
raise
TypeError
(
'iterator_size must be integer.'
)
arg_2
=
0
while
arg_2
!=
arg_0
:
arg_2
+=
1
yield
GetRandomHash
(
arg_1
)

def Func(arg_0, arg_1=7):
    '''
    Iterator for random hexadecimal hashes

    :param iterator_size:
        Amount of hashes return before this iterator stops.
        Goes on forever if `iterator_size` is negative.

    :param int hash_length:
        Size of each hash returned.

    :return generator(unicode):
    '''
    if not isinstance(arg_0, int):
        raise TypeError('iterator_size must be integer.')

    arg_2 = 0
    while arg_2 != arg_0:
        arg_2 += 1
        yield GetRandomHash(arg_1)


def Func(arg_0, arg_1, arg_2):
    """
    Loads a certificate, public key or private key into a Certificate,
    PublicKey or PrivateKey object via CryptoAPI

    :param key_object:
        An asn1crypto.x509.Certificate, asn1crypto.keys.PublicKeyInfo or
        asn1crypto.keys.PrivateKeyInfo object

    :param key_info:
        An asn1crypto.keys.PublicKeyInfo or asn1crypto.keys.PrivateKeyInfo
        object

    :param container:
        The class of the object to hold the key_handle

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        oscrypto.errors.AsymmetricKeyError - when the key is incompatible with the OS crypto library
        OSError - when an error is returned by the OS crypto library

    :return:
        A PrivateKey, PublicKey or Certificate object, based on container
    """

    arg_3 = 'public' if isinstance(arg_1, keys.PublicKeyInfo) else 'private'
    arg_4 = arg_1.algorithm

    if arg_4 == 'rsa':
        arg_5 = Advapi32Const.MS_ENH_RSA_AES_PROV
    else:
        arg_5 = Advapi32Const.MS_ENH_DSS_DH_PROV

    arg_6 = None
    arg_7 = None

    try:
        arg_6 = open_context_handle(arg_5, verify_only=arg_3 == 'public')

        arg_8 = _advapi32_create_blob(arg_1, arg_3, arg_4)
        arg_9 = buffer_from_bytes(arg_8)

        arg_10 = new(advapi32, 'HCRYPTKEY *')
        arg_11 = advapi32.CryptImportKey(
            arg_6,
            arg_9,
            len(arg_8),
            null(),
            0,
            arg_10
        )
        handle_error(arg_11)

        arg_7 = unwrap(arg_10)
        arg_12 = arg_2(arg_7, arg_0)
        arg_12.context_handle = arg_6

        if arg_4 == 'rsa':
            arg_13 = _advapi32_create_blob(arg_1, arg_3, arg_4, signing=False)
            arg_14 = buffer_from_bytes(arg_13)

            arg_15 = new(advapi32, 'HCRYPTKEY *')
            arg_11 = advapi32.CryptImportKey(
                arg_6,
                arg_14,
                len(arg_13),
                null(),
                0,
                arg_15
            )
            handle_error(arg_11)

            arg_12.ex_key_handle = unwrap(arg_15)

        return arg_12

    except (Exception):
        if arg_7:
            advapi32.CryptDestroyKey(arg_7)
        if arg_6:
            close_context_handle(arg_6)
        raise

Loads a certificate public key or private key into a Certificate PublicKey or PrivateKey object via CryptoAPI


rule = identifier , "=" , expression , ";" ;

return concatenation([
      self.identifier,
      "=",
      self.expression,
      ";",
    ], ignore_whitespace=True)(text).retyped(TokenType.rule)

def Func ( arg_0 , arg_1 ) : arg_0 . _attempting ( arg_1 ) return concatenation ( [ arg_0 . identifier , "=" , arg_0 . expression , ";" , ] , ignore_whitespace = True ) ( arg_1 ) . retyped ( TokenType . Func )

def Func(arg_0, arg_1):
    """Func = identifier , "=" , expression , ";" ;"""
    arg_0._attempting(arg_1)
    return concatenation([
      arg_0.identifier,
      "=",
      arg_0.expression,
      ";",
    ], ignore_whitespace=True)(arg_1).retyped(TokenType.Func)


(self, scale=0.7, filename=None, style=None, output='text',
             interactive=False, line_length=None, plot_barriers=True,
             reverse_bits=False, justify=None)

return visualization.circuit_drawer(self, scale=scale,
                                            filename=filename, style=style,
                                            output=output,
                                            interactive=interactive,
                                            line_length=line_length,
                                            plot_barriers=plot_barriers,
                                            reverse_bits=reverse_bits,
                                            justify=justify)

def Func(arg_0, arg_1=0.7, arg_2=None, arg_3=None, arg_4='text',
             arg_5=False, arg_6=None, arg_7=True,
             arg_8=False, arg_9=None):
        """Draw the quantum circuit

        Using the output parameter you can specify the format. The choices are:
        0. text: ASCII art string
        1. latex: high-quality images, but heavy external software dependencies
        2. matplotlib: purely in Python with no external dependencies

        Defaults to an overcomplete basis, in order to not alter gates.

        Args:
            scale (float): scale of image to Func (shrink if < 1)
            filename (str): file path to save image to
            style (dict or str): dictionary of style or file name of style
                file. You can refer to the
                :ref:`Style Dict Doc <style-dict-doc>` for more information
                on the contents.
            output (str): Select the output method to use for Funcing the
                circuit. Valid choices are `text`, `latex`, `latex_source`,
                `mpl`.
            interactive (bool): when set true show the circuit in a new window
                (for `mpl` this depends on the matplotlib backend being used
                supporting this). Note when used with either the `text` or the
                `latex_source` output type this has no effect and will be
                silently ignored.
            line_length (int): sets the length of the lines generated by `text`
            reverse_bits (bool): When set to True reverse the bit order inside
                registers for the output visualization.
            plot_barriers (bool): Enable/disable Funcing barriers in the output
                circuit. Defaults to True.
            justify (string): Options are `left`, `right` or `none`, if anything
                else is supplied it defaults to left justified. It refers to where
                gates should be placed in the output circuit if there is an option.
                `none` results in each gate being placed in its own column. Currently
                only supported by text Funcer.

        Returns:
            PIL.Image or matplotlib.figure or str or TextDrawing:
                * PIL.Image: (output `latex`) an in-memory representation of the
                  image of the circuit diagram.
                * matplotlib.figure: (output `mpl`) a matplotlib figure object
                  for the circuit diagram.
                * str: (output `latex_source`). The LaTeX source code.
                * TextDrawing: (output `text`). A Funcing that can be printed as
                  ascii art

        Raises:
            VisualizationError: when an invalid output method is selected
        """
        from qiskit.tools import visualization
        return visualization.circuit_Funcer(arg_0, arg_1=arg_1,
                                            arg_2=arg_2, arg_3=arg_3,
                                            arg_4=arg_4,
                                            arg_5=arg_5,
                                            arg_6=arg_6,
                                            arg_7=arg_7,
                                            arg_8=arg_8,
                                            arg_9=arg_9)

Draw the quantum circuit

        Using the output parameter you can specify the format. The choices are:
        0. text: ASCII art string
        1. latex: high-quality images, but heavy external software dependencies
        2. matplotlib: purely in Python with no external dependencies

        Defaults to an overcomplete basis, in order to not alter gates.

        Args:
            scale (float): scale of image to draw (shrink if < 1)
            filename (str): file path to save image to
            style (dict or str): dictionary of style or file name of style
                file. You can refer to the
                :ref:`Style Dict Doc <style-dict-doc>` for more information
                on the contents.
            output (str): Select the output method to use for drawing the
                circuit. Valid choices are `text`, `latex`, `latex_source`,
                `mpl`.
            interactive (bool): when set true show the circuit in a new window
                (for `mpl` this depends on the matplotlib backend being used
                supporting this). Note when used with either the `text` or the
                `latex_source` output type this has no effect and will be
                silently ignored.
            line_length (int): sets the length of the lines generated by `text`
            reverse_bits (bool): When set to True reverse the bit order inside
                registers for the output visualization.
            plot_barriers (bool): Enable/disable drawing barriers in the output
                circuit. Defaults to True.
            justify (string): Options are `left`, `right` or `none`, if anything
                else is supplied it defaults to left justified. It refers to where
                gates should be placed in the output circuit if there is an option.
                `none` results in each gate being placed in its own column. Currently
                only supported by text drawer.

        Returns:
            PIL.Image or matplotlib.figure or str or TextDrawing:
                * PIL.Image: (output `latex`) an in-memory representation of the
                  image of the circuit diagram.
                * matplotlib.figure: (output `mpl`) a matplotlib figure object
                  for the circuit diagram.
                * str: (output `latex_source`). The LaTeX source code.
                * TextDrawing: (output `text`). A drawing that can be printed as
                  ascii art

        Raises:
            VisualizationError: when an invalid output method is selected


def Func ( arg_0 ) : arg_1 = csv . DictReader ( arg_0 . split ( '\n' ) , delimiter = ',' , quotechar = '"' ) for arg_2 in arg_1 : yield arg_2

def Func(arg_0):
        """Parse a Bugzilla CSV bug list.

        The method parses the CSV file and returns an iterator of
        dictionaries. Each one of this, contains the summary of a bug.

        :param raw_csv: CSV string to parse

        :returns: a generator of parsed bugs
        """
        arg_1 = csv.DictReader(arg_0.split('\n'),
                                delimiter=',', quotechar='"')
        for arg_2 in arg_1:
            yield arg_2


def Func ( arg_0 , arg_1 = 'worker' ) : Func = [ ] Func += [ ( 'success_rate' , np . mean ( arg_0 . success_history ) ) ] if arg_0 . compute_Q : Func += [ ( 'mean_Q' , np . mean ( arg_0 . Q_history ) ) ] Func += [ ( 'episode' , arg_0 . n_episodes ) ] if arg_1 != '' and not arg_1 . endswith ( '/' ) : return [ ( arg_1 + '/' + arg_3 , arg_4 ) for arg_3 , arg_4 in Func ] else : return Func

def Func(arg_0, arg_1='worker'):
        """Generates a dictionary that contains all collected statistics.
        """
        Func = []
        Func += [('success_rate', np.mean(arg_0.success_history))]
        if arg_0.compute_Q:
            Func += [('mean_Q', np.mean(arg_0.Q_history))]
        Func += [('episode', arg_0.n_episodes)]

        if arg_1 != '' and not arg_1.endswith('/'):
            return [(arg_1 + '/' + arg_3, arg_4) for arg_3, arg_4 in Func]
        else:
            return Func

Generates a dictionary that contains all collected statistics .


(self, expdecay_despiker=True, exponent=None,
                noise_despiker=True, win=3, nlim=12., maxiter=3)

def Func(arg_0, arg_1=True, arg_2=None,
                arg_3=True, arg_4=3, arg_5=12., arg_6=3):
        """
        Applies expdecay_Funcr and noise_Funcr to data.

        Parameters
        ----------
        expdecay_Funcr : bool
            Whether or not to apply the exponential decay filter.
        exponent : None or float
            The exponent for the exponential decay filter. If None,
            it is determined automatically using `find_expocoef`.
        noise_Funcr : bool
            Whether or not to apply the standard deviation spike filter.
        win : int
            The rolling window over which the spike filter calculates
            the trace statistics.
        nlim : float
            The number of standard deviations above the rolling mean
            that data are excluded.
        maxiter : int
            The max number of times that the fitler is applied.

        Returns
        -------
        None

        """
        if not hasattr(arg_0, 'Funcd'):
            arg_0.data['Funcd'] = Bunch()

        arg_8 = {}
        for arg_9, arg_10 in arg_0.focus.items():
            if 'time' not in arg_9.lower():
                arg_11 = arg_10.copy()  # copy data
                if arg_1:
                    if arg_2 is not None:
                        arg_11 = proc.expdecay_Func(arg_11, arg_2, arg_0.tstep, arg_6)
                    else:
                        warnings.warn('exponent is None - either provide exponent, or run at `analyse`\nlevel to automatically calculate it.')

                if arg_3:
                    arg_11 = proc.noise_Func(arg_11, int(arg_4), arg_5, arg_6)
                arg_8[arg_9] = arg_11

        arg_0.data['Funcd'].update(arg_8)
        # recalculate total counts
        arg_0.data['total_counts'] = sum(arg_0.data['Funcd'].values())
        arg_0.setfocus('Funcd')
        return

Applies expdecay_despiker and noise_despiker to data.

        Parameters
        ----------
        expdecay_despiker : bool
            Whether or not to apply the exponential decay filter.
        exponent : None or float
            The exponent for the exponential decay filter. If None,
            it is determined automatically using `find_expocoef`.
        noise_despiker : bool
            Whether or not to apply the standard deviation spike filter.
        win : int
            The rolling window over which the spike filter calculates
            the trace statistics.
        nlim : float
            The number of standard deviations above the rolling mean
            that data are excluded.
        maxiter : int
            The max number of times that the fitler is applied.

        Returns
        -------
        None

Applies expdecay_despiker and noise_despiker to data .


def Func(arg_0):
    """Generates RGB values from HSV that have an even visual
    distribution.  Be careful as this method is only have as fast as
    hsv2rgb_spectrum."""

    def nscale8x3_video(arg_1, arg_2, arg_3, arg_4):
        arg_5 = 0
        if arg_4 != 0:
            arg_5 = 1
        if arg_1 != 0:
            arg_1 = ((arg_1 * arg_4) >> 8) + arg_5
        if arg_2 != 0:
            arg_2 = ((arg_2 * arg_4) >> 8) + arg_5
        if arg_3 != 0:
            arg_3 = ((arg_3 * arg_4) >> 8) + arg_5
        return (arg_1, arg_2, arg_3)

    def scale8_video_LEAVING_R1_DIRTY(arg_6, arg_4):
        arg_5 = 0
        if arg_4 != 0:
            arg_5 = 1
        if arg_6 != 0:
            arg_6 = ((arg_6 * arg_4) >> 8) + arg_5
        return arg_6

    arg_7, arg_8, arg_9 = arg_0
    arg_10 = arg_7 & 0x1F  # 0..31
    arg_11 = arg_10 * 8
    arg_12 = (arg_11 * (256 // 3)) >> 8
    arg_1, arg_2, arg_3 = (0, 0, 0)

    if not (arg_7 & 0x80):
        if not (arg_7 & 0x40):
            if not (arg_7 & 0x20):
                arg_1 = 255 - arg_12
                arg_2 = arg_12
                arg_3 = 0
            else:
                arg_1 = 171
                arg_2 = 85 + arg_12
                arg_3 = 0x00
        else:
            if not (arg_7 & 0x20):
                arg_13 = (arg_12 << 1)
                arg_1 = 171 - arg_13
                arg_2 = 171 + arg_12
                arg_3 = 0
            else:
                arg_1 = 0
                arg_2 = 255 - arg_12
                arg_3 = arg_12
    else:
        if not (arg_7 & 0x40):
            if not (arg_7 & 0x20):
                arg_1 = 0x00
                arg_13 = (arg_12 << 1)
                arg_2 = 171 - arg_13
                arg_3 = 85 + arg_13
            else:
                arg_1 = arg_12
                arg_2 = 0
                arg_3 = 255 - arg_12
        else:
            if not (arg_7 & 0x20):
                arg_1 = 85 + arg_12
                arg_2 = 0
                arg_3 = 171 - arg_12
            else:
                arg_1 = 171 + arg_12
                arg_2 = 0x00
                arg_3 = 85 - arg_12

    if arg_8 != 255:
        arg_1, arg_2, arg_3 = nscale8x3_video(arg_1, arg_2, arg_3, arg_8)
        arg_14 = 255 - arg_8
        arg_14 = (arg_14 * arg_14) >> 8
        arg_15 = arg_14
        arg_1 = arg_1 + arg_15
        arg_2 = arg_2 + arg_15
        arg_3 = arg_3 + arg_15

    if arg_9 != 255:
        arg_9 = scale8_video_LEAVING_R1_DIRTY(arg_9, arg_9)
        arg_1, arg_2, arg_3 = nscale8x3_video(arg_1, arg_2, arg_3, arg_9)

    return (arg_1, arg_2, arg_3)

Generates RGB values from HSV that have an even visual distribution . Be careful as this method is only have as fast as hsv2rgb_spectrum .


(self, create_selection, name, executor=None, execute_fully=False)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=False):
        """select_lasso and select almost share the same code"""
        arg_5 = arg_0.selection_histories[arg_2]
        arg_6 = arg_0.selection_history_indices[arg_2]
        arg_7 = arg_5[arg_6] if arg_5 else None
        arg_8 = arg_1(arg_7)
        arg_3 = arg_3 or arg_0.executor
        arg_5.append(arg_8)
        arg_0.selection_history_indices[arg_2] += 1
        # clip any redo history
        del arg_5[arg_0.selection_history_indices[arg_2]:-1]
        if 0:
            if arg_0.is_local():
                if arg_8:
                    # result = selection.execute(executor=executor, execute_fully=execute_fully)
                    arg_9 = vaex.promise.Promise.fulfilled(None)
                    arg_0.signalFunc_changed.emit(arg_0)
                else:
                    arg_9 = vaex.promise.Promise.fulfilled(None)
                    arg_0.signalFunc_changed.emit(arg_0)
            else:
                arg_0.signalFunc_changed.emit(arg_0)
                arg_9 = vaex.promise.Promise.fulfilled(None)
        arg_0.signalFunc_changed.emit(arg_0)
        arg_9 = vaex.promise.Promise.fulfilled(None)
        logger.debug("select selection history is %r, index is %r", arg_5, arg_0.selection_history_indices[arg_2])
        return arg_9


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 in arg_0 . assets and arg_2 in arg_0 . assets [ arg_1 ] and arg_0 . assets [ arg_1 ] [ arg_2 ] : return send_from_directory ( directory = arg_0 . assets [ arg_1 ] [ arg_2 ] , filename = arg_2 ) abort ( 404 )

def Func(arg_0, arg_1, arg_2):
        """ Route for specific assets.

        :param filetype: Asset Type
        :param asset: Filename of an asset
        :return: Response
        """
        if arg_1 in arg_0.assets and arg_2 in arg_0.assets[arg_1] and arg_0.assets[arg_1][arg_2]:
            return send_from_directory(
                directory=arg_0.assets[arg_1][arg_2],
                filename=arg_2
            )
        abort(404)


def Func ( arg_0 ) : arg_1 = re . compile ( r'https?:{0,1}/{1,2}' ) arg_2 = urlparse . urlparse ( arg_0 ) if not arg_2 . scheme and not arg_1 . search ( arg_0 ) : arg_0 = 'http://{0}' . format ( arg_0 ) return arg_0

def Func(arg_0):
    """
    Given a URL, check to see if there is an assocaited protocol.

    If not, set the protocol to HTTP and return the Funcd URL
    """
    # Use the regex to match http//localhost/something
    arg_1 = re.compile(r'https?:{0,1}/{1,2}')
    arg_2 = urlparse.urlparse(arg_0)
    if not arg_2.scheme and not arg_1.search(arg_0):
        arg_0 = 'http://{0}'.format(arg_0)
    return arg_0

Given a URL, check to see if there is an assocaited protocol.

    If not, set the protocol to HTTP and return the protocolised URL

Given a URL check to see if there is an assocaited protocol .


return obj.msg("%s is %d." % (what, val))

def
Func
(
arg_0
,
arg_1
=
)
:
arg_2
=
arg_0
.
debugger
.
settings
[
arg_0
.
name
]
if
not
arg_1
:
arg_1
=
arg_0
.
name
return
arg_0
.
msg
(
"%s is %d."
%
(
arg_1
,
arg_2
)
)

def Func(arg_0, arg_1=None):
    """Generic subcommand integer value display"""
    arg_2 = arg_0.debugger.settings[arg_0.name]
    if not arg_1: arg_1 = arg_0.name
    return arg_0.msg("%s is %d." % (arg_1, arg_2))


def Func(arg_0, arg_1):
        """Send message dicts through r_q, and throw explicit errors for
        pickle problems"""

        # Check whether msg_dict can be pickled...
        arg_2 = arg_0.invalid_dict_pickle_keys(arg_1)

        if arg_2 == []:
            arg_0.r_q.put(arg_1)

        else:
            ## Explicit pickle error handling
            arg_3 = md5()
            arg_3.update(str(arg_1))
            arg_4 = str(arg_3.hexdigest())[-7:]  # Last 7 digits of hash
            arg_5 = os.linesep
            sys.stderr.write(
                "{0} {1}Func({2}) Can't pickle this dict:{3} '''{7}{4}   {5}{7}{6}''' {7}".format(
                    datetime.now(),
                    Style.BRIGHT,
                    arg_4,
                    Style.RESET_ALL,
                    Fore.MAGENTA,
                    arg_1,
                    Style.RESET_ALL,
                    arg_5,
                )
            )

            ## Verbose list of the offending key(s) / object attrs
            ## Send all output to stderr...
            arg_6 = (
                Style.BRIGHT
                + "    Func({0}) Offending dict keys:".format(arg_4)
                + Style.RESET_ALL
            )
            arg_7 = Fore.YELLOW + " {0}".format(arg_2) + Style.RESET_ALL
            arg_8 = "{0}".format(arg_5)
            sys.stderr.write(arg_6 + arg_7 + arg_8)
            for arg_9 in sorted(arg_2):
                sys.stderr.write(
                    "      msg_dict['{0}']: {1}'{2}'{3}{4}".format(
                        arg_9,
                        Fore.MAGENTA,
                        repr(arg_1.get(arg_9)),
                        Style.RESET_ALL,
                        arg_5,
                    )
                )
                if isinstance(arg_1.get(arg_9), object):
                    arg_10 = arg_1.get(arg_9)
                    arg_11 = arg_0.invalid_obj_pickle_attrs(arg_10)
                    arg_6 = (
                        Style.BRIGHT
                        + "      Func({0}) Offending attrs:".format(arg_4)
                        + Style.RESET_ALL
                    )
                    arg_7 = (
                        Fore.YELLOW + " {0}".format(arg_11) + Style.RESET_ALL
                    )
                    arg_8 = "{0}".format(arg_5)
                    sys.stderr.write(arg_6 + arg_7 + arg_8)
                    for arg_12 in arg_11:
                        sys.stderr.write(
                            "        msg_dict['{0}'].{1}: {2}'{3}'{4}{5}".format(
                                arg_9,
                                arg_12,
                                Fore.RED,
                                repr(getattr(arg_10, arg_12)),
                                Style.RESET_ALL,
                                arg_5,
                            )
                        )

            sys.stderr.write(
                "    {0}Func({1}) keys (no problems):{2}{3}".format(
                    Style.BRIGHT, arg_4, Style.RESET_ALL, arg_5
                )
            )
            for arg_9 in sorted(set(arg_1.keys()).difference(arg_2)):
                sys.stderr.write(
                    "      msg_dict['{0}']: {1}{2}{3}{4}".format(
                        arg_9,
                        Fore.GREEN,
                        repr(arg_1.get(arg_9)),
                        Style.RESET_ALL,
                        arg_5,
                    )
                )

Send message dicts through r_q and throw explicit errors for pickle problems


def Func ( arg_0 ) : arg_1 = base_profiler . get_pkg_module_names ( arg_0 . _run_object ) try : with _CodeEventsTracker ( arg_1 ) as prof : prof . compute_mem_overhead ( ) runpy . run_path ( arg_0 . _run_object , run_name = '__main__' ) except SystemExit : pass return prof , None

def Func(arg_0):
        """Returns memory stats for a package."""
        arg_1 = base_profiler.get_pkg_module_names(arg_0._run_object)
        try:
            with _CodeEventsTracker(arg_1) as prof:
                prof.compute_mem_overhead()
                runpy.run_path(arg_0._run_object, run_name='__main__')
        except SystemExit:
            pass
        return prof, None


def Func(arg_0):
        """Set the internal flag to true.

        All threads waiting for the flag to become true are awakened. Threads
        that call wait() once the flag is true will not block at all.

        """
        with arg_0.__cond:
            arg_0.__flag = True
            arg_0.__cond.notify_all()


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = os . path . join ( * arg_1 . split ( MODULE_PATH_SEP ) ) for arg_4 in arg_0 . paths : arg_5 = os . path . join ( arg_4 , arg_3 ) arg_6 = False if os . path . isdir ( arg_5 ) : arg_7 = os . path . join ( arg_5 , '__init__.py' ) arg_6 = True else : arg_7 = '{}.py' . format ( arg_5 ) if os . path . exists ( arg_7 ) : return ModuleLoader ( arg_5 , arg_1 , arg_7 , arg_6 ) return None

def Func(arg_0, arg_1, arg_2=None):
        """
        Searches the paths for the required module.

        :param module_name: the full name of the module to find
        :param path: set to None when the module in being searched for is a
                     top-level module - otherwise this is set to
                     package.__path__ for submodules and subpackages (unused)
        """
        arg_3 = os.path.join(*arg_1.split(MODULE_PATH_SEP))

        for arg_4 in arg_0.paths:
            arg_5 = os.path.join(arg_4, arg_3)
            arg_6 = False

            # If the target references a directory, try to load it as
            # a module by referencing the __init__.py file, otherwise
            # append .py and attempt to resolve it.
            if os.path.isdir(arg_5):
                arg_7 = os.path.join(arg_5, '__init__.py')
                arg_6 = True
            else:
                arg_7 = '{}.py'.format(arg_5)

            if os.path.exists(arg_7):
                return ModuleLoader(
                    arg_5, arg_1, arg_7, arg_6)
        return None

Searches the paths for the required module .


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_3 = arg_2 . copy ( ) arg_3 [ 'trajectory' ] = arg_1 arg_4 = get_matching_kwargs ( arg_0 , arg_3 ) arg_0 = arg_0 ( ** arg_4 ) arg_5 = set ( arg_2 . keys ( ) ) - set ( arg_4 . keys ( ) ) return arg_0 , arg_5

def Func(arg_0, arg_1=None, **arg_2):
    """Creates a service from a constructor and checks which kwargs are not used"""
    arg_3 = arg_2.copy()
    arg_3['trajectory'] = arg_1
    arg_4 = get_matching_kwargs(arg_0, arg_3)
    arg_0 = arg_0(**arg_4)
    arg_5 = set(arg_2.keys()) - set(arg_4.keys())
    return arg_0, arg_5


def Func(arg_0):
    """Adds all necessary parameters to `traj`."""

    # We set the BrianParameter to be the standard parameter
    arg_0.v_standard_parameter=Brian2Parameter
    arg_0.v_fast_access=True

    # Add parameters we need for our network
    arg_0.f_add_parameter('Net.C',281*pF)
    arg_0.f_add_parameter('Net.gL',30*nS)
    arg_0.f_add_parameter('Net.EL',-70.6*mV)
    arg_0.f_add_parameter('Net.VT',-50.4*mV)
    arg_0.f_add_parameter('Net.DeltaT',2*mV)
    arg_0.f_add_parameter('Net.tauw',40*ms)
    arg_0.f_add_parameter('Net.a',4*nS)
    arg_0.f_add_parameter('Net.b',0.08*nA)
    arg_0.f_add_parameter('Net.I',.8*nA)
    arg_0.f_add_parameter('Net.Vcut','vm > 0*mV') # practical threshold condition
    arg_0.f_add_parameter('Net.N',50)

    arg_3='''
    dvm/dt=(gL*(EL-vm)+gL*DeltaT*exp((vm-VT)/DeltaT)+I-w)/C : volt
    dw/dt=(a*(vm-EL)-w)/tauw : amp
    Vr:volt
    '''
    arg_0.f_add_parameter('Net.eqs', arg_3)
    arg_0.f_add_parameter('reset', 'vm=Vr;w+=b')


def Func ( arg_0 , arg_1 , arg_2 = arg_3 . KMIPVersion . KMIP_1_0 ) : super ( LocateResponsePayload , arg_0 ) . Func ( arg_1 , arg_2 = arg_2 ) arg_6 = utils . BytearrayStream ( arg_1 . Func ( arg_0 . length ) ) if arg_0 . is_tag_next ( arg_3 . Tags . LOCATED_ITEMS , arg_6 ) : arg_0 . _located_items = primitives . Integer ( tag = arg_3 . Tags . LOCATED_ITEMS ) arg_0 . _located_items . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _unique_identifiers = [ ] while arg_0 . is_tag_next ( arg_3 . Tags . UNIQUE_IDENTIFIER , arg_6 ) : arg_9 = primitives . TextString ( tag = arg_3 . Tags . UNIQUE_IDENTIFIER ) arg_9 . Func ( arg_6 , arg_2 = arg_2 ) arg_0 . _unique_identifiers . append ( arg_9 ) arg_0 . is_oversized ( arg_6 )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the data encoding the Locate response payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a Func method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.
        """
        super(LocateResponsePayload, arg_0).Func(
            arg_1,
            arg_2=arg_2
        )
        arg_6 = utils.BytearrayStream(arg_1.Func(arg_0.length))

        if arg_0.is_tag_next(arg_3.Tags.LOCATED_ITEMS, arg_6):
            arg_0._located_items = primitives.Integer(
                tag=arg_3.Tags.LOCATED_ITEMS
            )
            arg_0._located_items.Func(
                arg_6,
                arg_2=arg_2
            )

        arg_0._unique_identifiers = []
        while arg_0.is_tag_next(arg_3.Tags.UNIQUE_IDENTIFIER, arg_6):
            arg_9 = primitives.TextString(
                tag=arg_3.Tags.UNIQUE_IDENTIFIER
            )
            arg_9.Func(arg_6, arg_2=arg_2)
            arg_0._unique_identifiers.append(arg_9)

        arg_0.is_oversized(arg_6)

Read the data encoding the Locate response payload and decode it
        into its constituent parts.

        Args:
            input_buffer (stream): A data buffer containing encoded object
                data, supporting a read method.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

Read the data encoding the Locate response payload and decode it into its constituent parts .


def Func(arg_0):
    """Converts Config protobuf message to python dictionary

    Values are converted according to the rules below:

    - Number string (e.g. "12" or "1.2") is appropriately converted to ``int`` or ``float``
    - Boolean string ("true", "True", "false" or "False") is converted to built-in boolean type
      (i.e. ``True`` or ``False``)
    - Normal string is inserted to dict as is
    - Serialized value is deserialized and inserted as a corresponding Python object
    """
    arg_1 = {}
    for arg_2 in arg_0.kvs:
      if arg_2.HasField("value"):
        assert arg_2.type == topology_pb2.ConfigValueType.Value("STRING_VALUE")
        # value is string
        if PhysicalPlanHelper._is_number(arg_2.value):
          arg_1[arg_2.key] = PhysicalPlanHelper._get_number(arg_2.value)
        elif arg_2.value.lower() in ("true", "false"):
          arg_1[arg_2.key] = True if arg_2.value.lower() == "true" else False
        else:
          arg_1[arg_2.key] = arg_2.value
      elif arg_2.HasField("serialized_value") and \
        arg_2.type == topology_pb2.ConfigValueType.Value("PYTHON_SERIALIZED_VALUE"):
        # deserialize that
        arg_1[arg_2.key] = default_serializer.deserialize(arg_2.serialized_value)
      else:
        assert arg_2.HasField("type")
        Log.error("Unsupported config <key:value> found: %s, with type: %s"
                  % (str(arg_2), str(arg_2.type)))
        continue

    return arg_1


def Func ( arg_0 , arg_1 = "" ) : arg_2 = Mesh ( ) arg_2 . elements . data = hdf [ "elements/connectivity" ] arg_2 . nodes . data = hdf [ "nodes/xyz" ] for arg_6 in hdf . keys ( ) : if arg_6 . startswith ( "/nodes/sets" ) : arg_7 = arg_6 . replace ( "/nodes/sets/" , "" ) arg_2 . nodes . sets [ arg_7 ] = set ( hdf [ arg_6 ] ) if arg_6 . startswith ( "/elements/sets" ) : arg_7 = arg_6 . replace ( "/elements/sets/" , "" ) arg_2 . elements . sets [ arg_7 ] = set ( hdf [ arg_6 ] ) if arg_6 . startswith ( "/elements/surfaces" ) : arg_7 = arg_6 . replace ( "/elements/surfaces/" , "" ) arg_2 . elements . surfaces [ arg_7 ] = hdf [ arg_6 ] if arg_6 . startswith ( "/fields/" ) : if arg_6 . endswith ( "/metadata" ) : arg_10 = arg_6 . split ( "/" ) [ 2 ] arg_11 = Field ( ) arg_11 . metadata = hdf [ "fields/{0}/metadata" . format ( arg_10 ) ] arg_11 . metadata = hdf [ "fields/{0}/data" . format ( arg_10 ) ] arg_11 . master = arg_2 arg_2 . add_field ( arg_10 , arg_11 ) hdf . close ( ) return arg_2

def Func(arg_0, arg_1 = ""):
  """
  DEPRECATED
  Reads a mesh saved in the HDF5 format.
  """
  arg_2 = Mesh()
  arg_2.elements.data = hdf["elements/connectivity"]
  arg_2.nodes.data    = hdf["nodes/xyz"]
  for arg_6 in hdf.keys():
    if arg_6.startswith("/nodes/sets"):
      arg_7 = arg_6.replace("/nodes/sets/", "")
      arg_2.nodes.sets[arg_7] = set(hdf[arg_6])
    if arg_6.startswith("/elements/sets"):
      arg_7 = arg_6.replace("/elements/sets/", "")
      arg_2.elements.sets[arg_7] = set(hdf[arg_6])
    if arg_6.startswith("/elements/surfaces"):
      arg_7 = arg_6.replace("/elements/surfaces/", "")
      arg_2.elements.surfaces[arg_7] = hdf[arg_6]
    if arg_6.startswith("/fields/"):
      if arg_6.endswith("/metadata"):
        arg_10 = arg_6.split("/")[2]
        arg_11 = Field()
        arg_11.metadata = hdf["fields/{0}/metadata".format(arg_10)]
        arg_11.metadata = hdf["fields/{0}/data".format(arg_10)]
        arg_11.master = arg_2
        arg_2.add_field(arg_10, arg_11)
  hdf.close()
  return arg_2

DEPRECATED Reads a mesh saved in the HDF5 format .


An alternative rotate implementation that uses a geometric function.
    This is more accurate than the built-in version.

def
Func
(
arg_0
,
arg_1
=
'z'
,
arg_2
=
0.0
)
:
arg_2
=
math
.
radians
(
arg_2
)
if
arg_1
.
lower
(
)
==
'x'
:
vert_function
(
arg_0
,
x_func
=
'x'
,
y_func
=
'y*cos({angle})-z*sin({angle})'
.
format
(
arg_2
=
arg_2
)
,
z_func
=
'y*sin({angle})+z*cos({angle})'
.
format
(
arg_2
=
arg_2
)
)
elif
arg_1
.
lower
(
)
==
'y'
:
vert_function
(
arg_0
,
x_func
=
'z*sin({angle})+x*cos({angle})'
.
format
(
arg_2
=
arg_2
)
,
y_func
=
'y'
,
z_func
=
'z*cos({angle})-x*sin({angle})'
.
format
(
arg_2
=
arg_2
)
)
elif
arg_1
.
lower
(
)
==
'z'
:
vert_function
(
arg_0
,
x_func
=
'x*cos({angle})-y*sin({angle})'
.
format
(
arg_2
=
arg_2
)
,
y_func
=
'x*sin({angle})+y*cos({angle})'
.
format
(
arg_2
=
arg_2
)
,
z_func
=
'z'
)
else
:
print
(
'Axis name is not valid; exiting ...'
)
sys
.
exit
(
1
)
return

def Func(arg_0, arg_1='z', arg_2=0.0):
    """An alternative Func implementation that uses a geometric function.
    This is more accurate than the built-in version."""
    arg_2 = math.radians(arg_2)
    if arg_1.lower() == 'x':
        vert_function(arg_0,
                 x_func='x',
                 y_func='y*cos({angle})-z*sin({angle})'.format(arg_2=arg_2),
                 z_func='y*sin({angle})+z*cos({angle})'.format(arg_2=arg_2))
    elif arg_1.lower() == 'y':
        vert_function(arg_0,
                 x_func='z*sin({angle})+x*cos({angle})'.format(arg_2=arg_2),
                 y_func='y',
                 z_func='z*cos({angle})-x*sin({angle})'.format(arg_2=arg_2))
    elif arg_1.lower() == 'z':
        vert_function(arg_0,
                 x_func='x*cos({angle})-y*sin({angle})'.format(arg_2=arg_2),
                 y_func='x*sin({angle})+y*cos({angle})'.format(arg_2=arg_2),
                 z_func='z')
    else:
        print('Axis name is not valid; exiting ...')
        sys.exit(1)
    return None

An alternative rotate implementation that uses a geometric function . This is more accurate than the built - in version .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_1 == 'line_cell' : arg_0 [ 'line' ] [ arg_2 ] = arg_0 [ 'cell' ] [ arg_2 ] = arg_3 else : arg_0 [ arg_1 ] [ arg_2 ] = arg_3

def Func(arg_0, arg_1, arg_2, arg_3):
    """Utility function to store a function as a magic of a specific kind.

    Parameters
    ----------
    dct : dict
      A dictionary with 'line' and 'cell' subdicts.

    magic_kind : str
      Kind of magic to be stored.

    magic_name : str
      Key to store the magic as.

    func : function
      Callable object to store.
    """
    if arg_1 == 'line_cell':
        arg_0['line'][arg_2] = arg_0['cell'][arg_2] = arg_3
    else:
        arg_0[arg_1][arg_2] = arg_3

Utility function to store a function as a magic of a specific kind .


def Func ( ) : import sysconfig arg_0 = [ ] if six . PY2 : arg_1 = sysconfig . get_config_var ( 'MULTIARCH' ) if arg_1 is not None : arg_0 . append ( arg_1 ) else : arg_0 . append ( sysconfig . get_config_var ( 'SOABI' ) ) arg_0 . append ( 'abi3' ) arg_0 = [ t for t in arg_0 if t ] return arg_0

def Func():
    """
    Returns valid tags an extension module might have
    """
    import sysconfig
    arg_0 = []
    if six.PY2:
        # see also 'SHLIB_EXT'
        arg_1 = sysconfig.get_config_var('MULTIARCH')
        if arg_1 is not None:
            arg_0.append(arg_1)
    else:
        # handle PEP 3149 -- ABI version tagged .so files
        # ABI = application binary interface
        arg_0.append(sysconfig.get_config_var('SOABI'))
        arg_0.append('abi3')  # not sure why this one is valid but it is
    arg_0 = [t for t in arg_0 if t]
    return arg_0


return await asyncio.wait_for(
            self._protocol.send_command(cmd), timeout=self._timeout
        )

async
def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
"Func %s"
%
arg_1
return
await
asyncio
.
wait_for
(
arg_0
.
_protocol
.
send_command
(
arg_2
)
,
timeout
=
arg_0
.
_timeout
)

async def Func(arg_0, arg_1):
        """Load a measurement.

        :param filename: Path to measurement you want to Func.
        """
        arg_2 = "Func %s" % arg_1
        return await asyncio.wait_for(
            arg_0._protocol.send_command(arg_2), timeout=arg_0._timeout
        )

Load a measurement.

        :param filename: Path to measurement you want to load.


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
uri_map
.
get
(
arg_0
.
path
)
or
arg_0
.
_handle_other
arg_2
,
arg_3
=
arg_1
(
)
arg_4
=
gzip
.
compress
(
arg_2
)
arg_0
.
_send_response
(
200
,
headers
=
(
(
'Content-type'
,
'%s; charset=utf-8'
%
arg_3
)
,
(
'Content-Encoding'
,
'gzip'
)
,
(
'Content-Length'
,
len
(
arg_4
)
)
)
)
arg_0
.
wfile
.
write
(
arg_4
)

def Func(arg_0):
        """Handles HTTP GET requests."""
        arg_1 = arg_0.uri_map.get(arg_0.path) or arg_0._handle_other
        arg_2, arg_3 = arg_1()
        arg_4 = gzip.compress(arg_2)
        arg_0._send_response(
            200, headers=(('Content-type', '%s; charset=utf-8' % arg_3),
                          ('Content-Encoding', 'gzip'),
                          ('Content-Length', len(arg_4))))
        arg_0.wfile.write(arg_4)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = os . path . join ( arg_0 . paramsdict [ "project_dir" ] , "tmp-chunks-" + arg_0 . name ) if os . path . exists ( arg_3 ) : shutil . rmtree ( arg_3 ) os . makedirs ( arg_3 ) arg_4 = estimate_optim ( arg_0 , arg_1 [ 0 ] [ 0 ] , arg_2 ) arg_5 = int ( 8e6 ) arg_6 = int ( arg_4 / ( arg_5 / 4. ) ) * len ( arg_1 ) arg_7 = 0 if ( len ( arg_1 ) > len ( arg_2 ) ) or ( arg_4 < arg_5 ) : arg_7 = 1 arg_8 = time . time ( ) arg_9 = { } for arg_10 , arg_11 in enumerate ( arg_1 ) : arg_12 = os . path . splitext ( os . path . basename ( arg_11 [ 0 ] ) ) [ 0 ] if arg_7 : arg_9 [ arg_12 ] = [ arg_11 ] else : arg_13 = zcat_make_temps ( arg_0 , arg_11 , arg_10 , arg_3 , arg_5 , arg_6 , arg_8 ) arg_9 [ arg_12 ] = arg_13 if not arg_7 : print ( "" ) return arg_9

def Func(arg_0, arg_1, arg_2):
    """ sends raws to be chunked"""

    ## create a tmpdir for chunked_files and a chunk optimizer
    arg_3 = os.path.join(arg_0.paramsdict["project_dir"], "tmp-chunks-"+arg_0.name)
    if os.path.exists(arg_3):
        shutil.rmtree(arg_3)
    os.makedirs(arg_3)

    ## chunk into 8M reads
    arg_4 = estimate_optim(arg_0, arg_1[0][0], arg_2)
    arg_5 = int(8e6)
    arg_6 = int(arg_4/(arg_5/4.)) * len(arg_1)

    ## if more files than cpus: no chunking
    arg_7 = 0
    if (len(arg_1) > len(arg_2)) or (arg_4 < arg_5):
        arg_7 = 1

    ## send slices N at a time. The dict chunkfiles stores a tuple of rawpairs
    ## dictionary to store asyncresults for sorting jobs
    arg_8 = time.time()
    arg_9 = {}
    for arg_10, arg_11 in enumerate(arg_1):
        arg_12 = os.path.splitext(os.path.basename(arg_11[0]))[0]
        ## if number of lines is > 20M then just submit it
        if arg_7:
            arg_9[arg_12] = [arg_11]
        else:
            ## chunk the file using zcat_make_temps
            arg_13 = zcat_make_temps(arg_0, arg_11, arg_10, arg_3, arg_5, arg_6, arg_8)
            arg_9[arg_12] = arg_13
    if not arg_7:
        print("")

    return arg_9


return self._broker.dispatch(event, *args, **kwargs)

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : return arg_0 . _broker . dispatch ( arg_1 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """ Triggers an event, and associates some data to it, so if there are any
        subscribers, their callback will be called synchronously. """
        return arg_0._broker.dispatch(arg_1, *arg_2, **arg_3)

Triggers an event and associates some data to it so if there are any subscribers their callback will be called synchronously .


def Func ( arg_0 ) : arg_1 = collections . OrderedDict ( ) for arg_2 in arg_0 . qregs . values ( ) : arg_3 = QuantumRegister ( arg_2 . size , arg_4 = arg_2 . name ) arg_1 [ arg_2 . name ] = arg_3 arg_5 = collections . OrderedDict ( ) for arg_6 in arg_0 . cregs . values ( ) : arg_7 = ClassicalRegister ( arg_6 . size , arg_4 = arg_6 . name ) arg_5 [ arg_6 . name ] = arg_7 arg_4 = arg_0 . name or None arg_8 = QuantumCircuit ( * arg_1 . values ( ) , * arg_5 . values ( ) , arg_4 = arg_4 ) for arg_9 in arg_0 . topological_op_nodes ( ) : arg_10 = [ ] for arg_11 in arg_9 . qargs : arg_10 . append ( arg_1 [ arg_11 [ 0 ] . name ] [ arg_11 [ 1 ] ] ) arg_12 = [ ] for arg_13 in arg_9 . cargs : arg_12 . append ( arg_5 [ arg_13 [ 0 ] . name ] [ arg_13 [ 1 ] ] ) if arg_9 . condition is None : arg_14 = None else : arg_14 = ( arg_9 . condition [ 0 ] , arg_9 . condition [ 1 ] ) arg_15 = arg_9 . op . copy ( ) arg_15 . control = arg_14 arg_8 . append ( arg_15 , arg_10 , arg_12 ) return arg_8

def Func(arg_0):
    """Build a ``QuantumCircuit`` object from a ``DAGCircuit``.

    Args:
        dag (DAGCircuit): the input dag.

    Return:
        QuantumCircuit: the circuit representing the input dag.
    """
    arg_1 = collections.OrderedDict()
    for arg_2 in arg_0.qregs.values():
        arg_3 = QuantumRegister(arg_2.size, arg_4=arg_2.name)
        arg_1[arg_2.name] = arg_3
    arg_5 = collections.OrderedDict()
    for arg_6 in arg_0.cregs.values():
        arg_7 = ClassicalRegister(arg_6.size, arg_4=arg_6.name)
        arg_5[arg_6.name] = arg_7

    arg_4 = arg_0.name or None
    arg_8 = QuantumCircuit(*arg_1.values(), *arg_5.values(), arg_4=arg_4)

    for arg_9 in arg_0.topological_op_nodes():
        arg_10 = []
        for arg_11 in arg_9.qargs:
            arg_10.append(arg_1[arg_11[0].name][arg_11[1]])

        arg_12 = []
        for arg_13 in arg_9.cargs:
            arg_12.append(arg_5[arg_13[0].name][arg_13[1]])

        # Get arguments for classical control (if any)
        if arg_9.condition is None:
            arg_14 = None
        else:
            arg_14 = (arg_9.condition[0], arg_9.condition[1])

        arg_15 = arg_9.op.copy()
        arg_15.control = arg_14
        arg_8.append(arg_15, arg_10, arg_12)
    return arg_8

Build a QuantumCircuit object from a DAGCircuit .


def Func(arg_0=arg_1, arg_2=arg_3):
    """Return a list of all FT232H device serial numbers connected to the
    machine.  You can use these serial numbers to open a specific FT232H device
    by passing it to the FT232H initializer's serial parameter.
    """
    try:
        # Create a libftdi context.
        arg_4 = None
        arg_4 = ftdi.new()
        # Enumerate FTDI devices.
        arg_5 = None
        arg_6, arg_5 = ftdi.usb_find_all(arg_4, arg_0, arg_2)
        if arg_6 < 0:
            raise RuntimeError('ftdi_usb_find_all returned error {0}: {1}'.format(arg_6, ftdi.get_error_string(self._ctx)))
        # Walk through list of devices and assemble list of serial numbers.
        arg_7 = []
        while arg_5 is not None:
            # Get USB device strings and add serial to list of devices.
            arg_8, arg_9, arg_10, arg_11 = ftdi.usb_get_strings(arg_4, arg_5.dev, 256, 256, 256)
            if arg_11 is not None:
                arg_7.append(arg_11)
            arg_5 = arg_5.next
        return arg_7
    finally:
        # Make sure to clean up list and context when done.
        if arg_5 is not None:
            ftdi.list_free(arg_5)
        if arg_4 is not None:
            ftdi.free(arg_4)

Return a list of all FT232H device serial numbers connected to the machine . You can use these serial numbers to open a specific FT232H device by passing it to the FT232H initializer s serial parameter .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
name
if
arg_1
.
arguments
is
not
:
arg_3
=
arg_0
.
_process_node
(
arg_1
.
arguments
)
else
:
arg_3
=
[
]
arg_4
=
[
arg_0
.
_process_bit_id
(
node_element
)
for
node_element
in
arg_1
.
bitlist
.
children
]
if
arg_2
in
arg_0
.
gates
:
arg_5
=
arg_0
.
gates
[
arg_2
]
[
"args"
]
arg_6
=
arg_0
.
gates
[
arg_2
]
[
"bits"
]
arg_7
=
max
(
map
(
len
,
arg_4
)
)
for
arg_8
in
range
(
arg_7
)
:
arg_0
.
arg_stack
.
append
(
{
arg_5
[
arg_9
]
:
arg_3
[
arg_9
]
for
arg_9
in
range
(
len
(
arg_5
)
)
}
)
arg_10
=
[
arg_8
*
x
for
x
in
[
len
(
arg_4
[
arg_9
]
)
>
1
for
arg_9
in
range
(
len
(
arg_4
)
)
]
]
arg_0
.
bit_stack
.
append
(
{
arg_6
[
arg_9
]
:
arg_4
[
arg_9
]
[
arg_10
[
arg_9
]
]
for
arg_9
in
range
(
len
(
arg_6
)
)
}
)
arg_0
.
_create_dag_op
(
arg_2
,
[
arg_0
.
arg_stack
[
1
]
[
arg_11
]
.
sym
(
)
for
arg_11
in
arg_5
]
,
[
arg_0
.
bit_stack
[
1
]
[
arg_11
]
for
arg_11
in
arg_6
]
)
arg_0
.
arg_stack
.
pop
(
)
arg_0
.
bit_stack
.
pop
(
)
else
:
raise
QiskitError
(
"internal error undefined gate:"
,
"line=%s"
%
arg_1
.
line
,
"file=%s"
%
arg_1
.
file
)

def Func(arg_0, arg_1):
        """Process a custom unitary node."""
        arg_2 = arg_1.name
        if arg_1.arguments is not None:
            arg_3 = arg_0._process_node(arg_1.arguments)
        else:
            arg_3 = []
        arg_4 = [arg_0._process_bit_id(node_element)
                for node_element in arg_1.bitlist.children]
        if arg_2 in arg_0.gates:
            arg_5 = arg_0.gates[arg_2]["args"]
            arg_6 = arg_0.gates[arg_2]["bits"]
            # Loop over register arguments, if any.
            arg_7 = max(map(len, arg_4))
            for arg_8 in range(arg_7):
                arg_0.arg_stack.append({arg_5[arg_9]: arg_3[arg_9]
                                       for arg_9 in range(len(arg_5))})
                # Only index into register arguments.
                arg_10 = [arg_8*x for x in
                           [len(arg_4[arg_9]) > 1 for arg_9 in range(len(arg_4))]]
                arg_0.bit_stack.append({arg_6[arg_9]: arg_4[arg_9][arg_10[arg_9]]
                                       for arg_9 in range(len(arg_6))})
                arg_0._create_dag_op(arg_2,
                                    [arg_0.arg_stack[-1][arg_11].sym() for arg_11 in arg_5],
                                    [arg_0.bit_stack[-1][arg_11] for arg_11 in arg_6])
                arg_0.arg_stack.pop()
                arg_0.bit_stack.pop()
        else:
            raise QiskitError("internal error undefined gate:",
                              "line=%s" % arg_1.line, "file=%s" % arg_1.file)


(x, y, dx, dy, radius=300, angle=0, spread=90)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=300, arg_5=0, arg_6=90):
    """
    Returns a 0.0 - 1.0 brightness adjusted to a light source.

    The light source is positioned at dx, dy.
    The returned float is calculated for x, y position
    (e.g. an oval at x, y should have this brightness).

    The radius influences the strength of the light,
    angle and spread control the direction of the light.
    """
    if arg_5 != None:
        arg_4 *= 2

    # Get the distance and angle between point and light source.
    arg_7 = sqrt((arg_2 - arg_0) ** 2 + (arg_3 - arg_1) ** 2)
    arg_8 = degrees(atan2(arg_3 - arg_1, arg_2 - arg_0)) + 180

    # If no angle is defined,
    # light is emitted evenly in all directions
    # and carries as far as the defined radius
    # (e.g. like a radial gradient).
    if arg_7 <= arg_4:
        arg_9 = 1.0 * arg_7 / arg_4
    else:
        arg_9 = 1.0
    if arg_5 is None:
        return 1 - arg_9

    # Normalize the light's direction and spread
    # between 0 and 360.
    arg_5 = 360 - arg_5 % 360
    arg_6 = max(0, min(arg_6, 360))
    if arg_6 == 0:
        return 0.0

    # Objects that fall within the spreaded direction
    # of the light are illuminated.
    arg_7 = abs(arg_8 - arg_5)
    if arg_7 <= arg_6 / 2:
        arg_10 = arg_7 / arg_6 + arg_9
    else:
        arg_10 = 1.0

    # Wrapping from 0 to 360:
    # a light source with a direction of 10 degrees
    # and a spread of 45 degrees illuminates
    # objects between 0 and 35 degrees and 350 and 360 degrees.
    if 360 - arg_5 <= arg_6 / 2:
        arg_7 = abs(360 - arg_5 + arg_8)
        if arg_7 <= arg_6 / 2:
            arg_10 = arg_7 / arg_6 + arg_9
    # Wrapping from 360 to 0.
    if arg_5 < arg_6 / 2:
        arg_7 = abs(360 + arg_5 - arg_8)
        if arg_7 <= arg_6 / 2:
            arg_10 = arg_7 / arg_6 + arg_9

    return 1 - max(0, min(arg_10, 1))

Returns a 0 . 0 - 1 . 0 brightness adjusted to a light source .


return Agency(agency_id, agency_url, op, '')

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . tags . get ( 'operator' ) arg_3 = arg_0 . tags . get ( 'url' ) or arg_0 . tags . get ( 'contact_website' ) if not arg_2 : return arg_4 = int ( hashlib . sha256 ( arg_2 . encode ( 'utf8' ) ) . hexdigest ( ) , 16 ) % 10 ** 8 return Agency ( arg_4 , arg_3 , arg_2 , '' )

def Func(arg_0, arg_1):
    """Extract agency information."""
    # TODO: find out the operator for routes without operator tag.
    # See: http://wiki.openstreetmap.org/wiki/Key:operator
    # Quote from the above link:
    #
    #    If the vast majority of a certain object in an area is operated by a certain
    #    organization and only very few by others then it may be sufficient to only tag the
    #    exceptions. For example, when nearly all roads in an area are managed by a local
    #    authority then it would be sufficient to only tag those that are not with an operator
    #    tag.
    arg_2 = arg_0.tags.get('operator')
    arg_3 = arg_0.tags.get('url') or arg_0.tags.get('contact_website')

    if not arg_2:
        return

    arg_4 = int(hashlib.sha256(arg_2.encode('utf8')).hexdigest(), 16) % 10**8

    return Agency(arg_4, arg_3, arg_2, '')


(model, returns_train, returns_test=None,
              bmark=None, samples=500, ppc=False, progressbar=True)

def Func(arg_0, arg_1, arg_2=None,
              arg_3=None, arg_4=500, arg_5=False, arg_6=True):
    """
    Run one of the Bayesian models.

    Parameters
    ----------
    model : {'alpha_beta', 't', 'normal', 'best'}
        Which model to run
    returns_train : pd.Series
        Timeseries of simple returns
    returns_test : pd.Series (optional)
        Out-of-sample returns. Datetimes in returns_test will be added to
        returns_train as missing values and predictions will be generated
        for them.
    bmark : pd.Series or pd.DataFrame (optional)
        Only used for alpha_beta to estimate regression coefficients.
        If bmark has more recent returns than returns_train, these dates
        will be treated as missing values and predictions will be
        generated for them taking market correlations into account.
    samples : int (optional)
        Number of posterior samples to draw.
    ppc : boolean (optional)
        Whether to run a posterior predictive check. Will generate
        samples of length returns_test.  Returns a second argument
        that contains the PPC of shape samples x len(returns_test).

    Returns
    -------
    trace : pymc3.sampling.BaseTrace object
        A PyMC3 trace object that contains samples for each parameter
        of the posterior.

    ppc : numpy.array (if ppc==True)
       PPC of shape samples x len(returns_test).
    """

    if arg_0 == 'alpha_beta':
        arg_0, arg_7 = model_returns_t_alpha_beta(arg_1,
                                                  arg_3, arg_4,
                                                  arg_6=arg_6)
    elif arg_0 == 't':
        arg_0, arg_7 = model_returns_t(arg_1, arg_4,
                                       arg_6=arg_6)
    elif arg_0 == 'normal':
        arg_0, arg_7 = model_returns_normal(arg_1, arg_4,
                                            arg_6=arg_6)
    elif arg_0 == 'best':
        arg_0, arg_7 = model_best(arg_1, arg_2,
                                  arg_4=arg_4,
                                  arg_6=arg_6)
    else:
        raise NotImplementedError(
            'Model {} not found.'
            'Use alpha_beta, t, normal, or best.'.format(arg_0))

    if arg_5:
        arg_8 = pm.sample_ppc(arg_7, arg_4=arg_4,
                                    arg_0=arg_0, size=len(arg_2),
                                    arg_6=arg_6)
        return arg_7, arg_8['returns']

    return arg_7


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_3 . get_target ( ) if arg_0 . format == 'png' : arg_4 . write_to_png ( arg_0 . _output_file ( arg_2 ) ) arg_4 . finish ( ) arg_4 . flush ( )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Called when CairoCanvas has rendered a bot
        """
        arg_4 = arg_3.get_target()
        if arg_0.format == 'png':
            arg_4.write_to_png(arg_0._output_file(arg_2))
        arg_4.finish()
        arg_4.flush()


(value_and_gradients_function,
                   initial_args,
                   val_0,
                   val_c,
                   f_lim,
                   sufficient_decrease_param,
                   curvature_param)

return prefer_static.cond(
      tf.reduce_any(input_tensor=next_args.active),
      _apply_inner_update,
      lambda: next_args)

def Func(arg_0,
                   arg_1,
                   arg_2,
                   arg_3,
                   arg_4,
                   arg_5,
                   arg_6):
  """Helper function for secant square."""
  # Apply the `update` function on active branch members to squeeze their
  # bracketing interval.
  arg_7 = update(arg_0,
                         arg_1.left,
                         arg_1.right,
                         arg_3,
                         arg_4,
                         arg_8=arg_1.active)

  # Update active and failed flags, update left/right on non-failed entries.
  arg_8 = arg_1.active & ~arg_7.failed
  arg_9 = arg_1.failed | arg_7.failed
  arg_10 = val_where(arg_8, arg_7.left, arg_1.left)
  arg_11 = val_where(arg_8, arg_7.right, arg_1.right)

  # Check if new `c` points should be generated.
  arg_12 = arg_8 & tf.equal(arg_10.x, arg_3.x)
  arg_13 = arg_8 & tf.equal(arg_11.x, arg_3.x)
  arg_14 = arg_12 | arg_13

  arg_15 = tf.where(arg_12,
                    _secant(arg_1.left, arg_10),
                    arg_3.x)
  arg_15 = tf.where(arg_13,
                    _secant(arg_1.right, arg_11),
                    arg_15)
  arg_16 = (arg_10.x <= arg_15) & (arg_15 <= arg_11.x)

  # Figure out if an extra function evaluation is needed for new `c` points.
  arg_17 = tf.reduce_any(input_tensor=arg_16 & arg_14)
  arg_18 = arg_1.num_evals + arg_7.num_evals
  arg_18 = arg_18 + tf.cast(arg_17, arg_18.dtype)

  arg_19 = _Secant2Result(
      arg_8=arg_8 & arg_16,  # No longer active if `c` is out of range.
      converged=arg_1.converged,
      arg_9=arg_9,
      arg_18=arg_18,
      left=arg_10,
      right=arg_11)

  def _apply_inner_update():
    arg_20 = prefer_static.cond(
        arg_17,
        (lambda: arg_0(arg_15)),
        (lambda: arg_3))
    return Func_update(
        arg_0, arg_19, arg_2, arg_20, arg_4,
        arg_5, arg_6)

  return prefer_static.cond(
      tf.reduce_any(input_tensor=arg_19.active),
      _apply_inner_update,
      lambda: arg_19)


(self, obj, message, linenum, char_offset=0)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 0 ) : arg_0 . controller . Func ( linenumber = arg_3 , filename = arg_1 . path , severity = arg_0 . severity , arg_2 = arg_2 , rulename = arg_0 . __class__ . __name__ , char = arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=0):
        """Report an error or warning"""
        arg_0.controller.Func(linenumber=arg_3, filename=arg_1.path,
                               severity=arg_0.severity, arg_2=arg_2,
                               rulename = arg_0.__class__.__name__,
                               char=arg_4)


(a, llim=0.1, denominator=None, focus_stage=None)

def
Func
(
arg_0
,
arg_1
=
0.1
,
arg_2
=
,
arg_3
=
)
:
if
not
isinstance
(
arg_0
,
(
int
,
float
)
)
:
arg_0
=
nominal_values
(
arg_0
)
arg_0
=
np
.
percentile
(
arg_0
[
~
np
.
isnan
(
arg_0
)
]
,
25
)
if
arg_2
is
not
:
arg_4
=
pretty_element
(
arg_2
)
else
:
arg_4
=
''
if
arg_3
==
'calibrated'
:
arg_5
=
{
0
:
'mol/mol '
+
arg_4
,
1
:
'mmol/mol '
+
arg_4
,
2
:
'$\mu$mol/mol '
+
arg_4
,
3
:
'nmol/mol '
+
arg_4
,
4
:
'pmol/mol '
+
arg_4
,
5
:
'fmol/mol '
+
arg_4
}
elif
arg_3
==
'ratios'
:
arg_5
=
{
0
:
'counts/count '
+
arg_4
,
1
:
'$10^{-3}$ counts/count '
+
arg_4
,
2
:
'$10^{-6}$ counts/count '
+
arg_4
,
3
:
'$10^{-9}$ counts/count '
+
arg_4
,
4
:
'$10^{-12}$ counts/count '
+
arg_4
,
5
:
'$10^{-15}$ counts/count '
+
arg_4
}
elif
arg_3
in
(
'rawdata'
,
'despiked'
,
'bkgsub'
)
:
arg_5
=
arg_5
=
{
0
:
'counts'
,
1
:
'$10^{-3}$ counts'
,
2
:
'$10^{-6}$ counts'
,
3
:
'$10^{-9}$ counts'
,
4
:
'$10^{-12}$ counts'
,
5
:
'$10^{-15}$ counts'
}
else
:
arg_5
=
{
0
:
''
,
1
:
''
,
2
:
''
,
3
:
''
,
4
:
''
,
5
:
''
}
arg_0
=
abs
(
arg_0
)
arg_6
=
0
if
arg_0
<
arg_1
:
while
arg_0
<
arg_1
:
arg_0
*=
1000
arg_6
+=
1
return
float
(
1000
**
arg_6
)
,
arg_5
[
arg_6
]

def Func(arg_0, arg_1=0.1, arg_2=None, arg_3=None):
    """
    Determines the most appropriate plotting unit for data.

    Parameters
    ----------
    a : float or array-like
        number to optimise. If array like, the 25% quantile is optimised.
    llim : float
        minimum allowable value in scaled data.

    Returns
    -------
    (float, str)
        (multiplier, unit)
    """

    if not isinstance(arg_0, (int, float)):
        arg_0 = nominal_values(arg_0)
        arg_0 = np.percentile(arg_0[~np.isnan(arg_0)], 25)

    if arg_2 is not None:
        arg_4 = pretty_element(arg_2)
    else:
        arg_4 = ''

    if arg_3 == 'calibrated':
        arg_5 = {0: 'mol/mol ' + arg_4,
                 1: 'mmol/mol ' + arg_4,
                 2: '$\mu$mol/mol ' + arg_4,
                 3: 'nmol/mol ' + arg_4,
                 4: 'pmol/mol ' + arg_4,
                 5: 'fmol/mol ' + arg_4}
    elif arg_3 == 'ratios':
        arg_5 = {0: 'counts/count ' + arg_4,
                 1: '$10^{-3}$ counts/count ' + arg_4,
                 2: '$10^{-6}$ counts/count ' + arg_4,
                 3: '$10^{-9}$ counts/count ' + arg_4,
                 4: '$10^{-12}$ counts/count ' + arg_4,
                 5: '$10^{-15}$ counts/count ' + arg_4}
    elif arg_3 in ('rawdata', 'despiked', 'bkgsub'):
        arg_5 = arg_5 = {0: 'counts',
                         1: '$10^{-3}$ counts',
                         2: '$10^{-6}$ counts',
                         3: '$10^{-9}$ counts',
                         4: '$10^{-12}$ counts',
                         5: '$10^{-15}$ counts'}
    else:
        arg_5 = {0: '', 1: '', 2: '', 3: '', 4: '', 5: ''}

    arg_0 = abs(arg_0)
    arg_6 = 0
    if arg_0 < arg_1:
        while arg_0 < arg_1:
            arg_0 *= 1000
            arg_6 += 1
    return float(1000**arg_6), arg_5[arg_6]

Determines the most appropriate plotting unit for data .


def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_2 : return True return arg_0 . passes_filter ( arg_1 )

def Func(arg_0, arg_1, arg_2=False):
        ''' Returns True if this flag condition is met, otherwise returns
        False. It determines if the condition is met by calling pre_filter
        with a queryset containing only self.condition. '''

        if arg_2:
            return True  # Why query again?

        return arg_0.passes_filter(arg_1)

Returns True if this flag condition is met otherwise returns False . It determines if the condition is met by calling pre_filter with a queryset containing only self . condition .


(self, ids=None, features=None, dense=True)

return result.to_dense() if dense else result

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = True ) : arg_4 = arg_0 . data if arg_1 is not None : arg_4 = arg_4 . ix [ arg_1 ] if arg_2 is not None : arg_4 = arg_4 . ix [ : , arg_2 ] return arg_4 . to_dense ( ) if arg_3 else arg_4

def Func(arg_0, arg_1=None, arg_2=None, arg_3=True):
        """ Slices and returns a subset of feature data.

        Args:
            ids (list, array): A list or 1D numpy array of study ids to
                return rows for. If None, returns data for all studies
                (i.e., all rows in array).
            features (list, array): A list or 1D numpy array of named features
                to return. If None, returns data for all features (i.e., all
                columns in array).
            dense (bool): Optional boolean. When True (default), convert the
                result to a dense array before returning. When False, keep as
                sparse matrix. Note that if ids is not None, the returned array
                will always be dense.
        Returns:
          A pandas DataFrame with study IDs in rows and features incolumns.
        """
        arg_4 = arg_0.data

        if arg_1 is not None:
            arg_4 = arg_4.ix[arg_1]

        if arg_2 is not None:
            arg_4 = arg_4.ix[:, arg_2]

        return arg_4.to_dense() if arg_3 else arg_4

Slices and returns a subset of feature data .


def Func ( arg_0 , arg_1 ) : arg_0 . tags = list ( set ( arg_0 . tags or [ ] ) | set ( [ arg_1 ] ) )

def Func(arg_0, arg_1):
        """
            Adds a tag to the list of tags and makes sure the result list contains only unique results.
        """
        arg_0.tags = list(set(arg_0.tags or []) | set([arg_1]))

Adds a tag to the list of tags and makes sure the result list contains only unique results .


return self.closure(
            {rule.move_dot() for rule in rules
             if not rule.at_end and rule.rhs[rule.pos] == symbol},
        )

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . closure ( { arg_3 . move_dot ( ) for arg_3 in arg_1 if not arg_3 . at_end and arg_3 . rhs [ arg_3 . pos ] == arg_2 } , )

def Func(arg_0, arg_1, arg_2):
        """Computes the next closure for rules based on the symbol we got.

        Args:
            rules - an iterable of DottedRules
            symbol - a string denoting the symbol we've just seen

        Returns: frozenset of DottedRules
        """
        return arg_0.closure(
            {arg_3.move_dot() for arg_3 in arg_1
             if not arg_3.at_end and arg_3.rhs[arg_3.pos] == arg_2},
        )

Computes the next closure for rules based on the symbol we got .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
)
:
arg_3
=
arg_1
if
is_type
(
arg_1
,
int
)
else
arg_0
.
model_ids
.
index
(
arg_1
)
arg_4
=
arg_0
[
arg_3
]
if
arg_4
.
_is_xvalidated
:
arg_4
=
h2o
.
get_model
(
arg_4
.
_xval_keys
[
0
]
)
arg_5
=
[
arg_4
.
params
[
h
]
[
'actual'
]
[
0
]
if
isinstance
(
arg_4
.
params
[
h
]
[
'actual'
]
,
list
)
else
arg_4
.
params
[
h
]
[
'actual'
]
for
h
in
arg_0
.
hyper_params
]
if
arg_2
:
print
(
'Hyperparameters: ['
+
', '
.
join
(
list
(
arg_0
.
hyper_params
.
keys
(
)
)
)
+
']'
)
return
arg_5

def Func(arg_0, arg_1, arg_2=True):
        """
        Get the hyperparameters of a model explored by grid search.

        :param str id: The model id of the model with hyperparameters of interest.
        :param bool display: Flag to indicate whether to display the hyperparameter names.

        :returns: A list of the hyperparameters for the specified model.
        """
        arg_3 = arg_1 if is_type(arg_1, int) else arg_0.model_ids.index(arg_1)
        arg_4 = arg_0[arg_3]

        # if cross-validation is turned on, parameters in one of the fold model actuall contains the max_runtime_secs
        # parameter and not the main model that is returned.
        if arg_4._is_xvalidated:
            arg_4 = h2o.get_model(arg_4._xval_keys[0])

        arg_5 = [arg_4.params[h]['actual'][0] if isinstance(arg_4.params[h]['actual'], list)
               else arg_4.params[h]['actual']
               for h in arg_0.hyper_params]
        if arg_2: print('Hyperparameters: [' + ', '.join(list(arg_0.hyper_params.keys())) + ']')
        return arg_5

Get the hyperparameters of a model explored by grid search .


The list of compilers used to build asset.

return [self.environment.compilers.get(e) for e in self.compiler_extensions]

def Func ( arg_0 ) : return [ arg_0 . environment . Func . get ( arg_1 ) for arg_1 in arg_0 . compiler_extensions ]

def Func(arg_0):
        """The list of Func used to build asset."""
        return [arg_0.environment.Func.get(arg_1) for arg_1 in arg_0.compiler_extensions]

The list of compilers used to build asset .


(self, path=".", get_genmodel_jar=False, genmodel_name="")

return h2o.api("GET /3/Models/%s/mojo" % self.model_id, save_to=path)

def
Func
(
arg_0
,
arg_1
=
"."
,
arg_2
=
False
,
arg_3
=
""
)
:
assert_is_type
(
arg_1
,
str
)
assert_is_type
(
arg_2
,
bool
)
if
not
arg_0
.
have_mojo
:
raise
H2OValueError
(
"Export to MOJO not supported"
)
if
arg_2
:
if
arg_3
==
""
:
h2o
.
api
(
"GET /3/h2o-genmodel.jar"
,
save_to
=
os
.
path
.
join
(
arg_1
,
"h2o-genmodel.jar"
)
)
else
:
h2o
.
api
(
"GET /3/h2o-genmodel.jar"
,
save_to
=
os
.
path
.
join
(
arg_1
,
arg_3
)
)
return
h2o
.
api
(
"GET /3/Models/%s/mojo"
%
arg_0
.
model_id
,
save_to
=
arg_1
)

def Func(arg_0, arg_1=".", arg_2=False, arg_3=""):
        """
        Download the model in MOJO format.

        :param path: the path where MOJO file should be saved.
        :param get_genmodel_jar: if True, then also download h2o-genmodel.jar and store it in folder ``path``.
        :param genmodel_name Custom name of genmodel jar
        :returns: name of the MOJO file written.
        """
        assert_is_type(arg_1, str)
        assert_is_type(arg_2, bool)

        if not arg_0.have_mojo:
            raise H2OValueError("Export to MOJO not supported")

        if arg_2:
            if arg_3 == "":
                h2o.api("GET /3/h2o-genmodel.jar", save_to=os.path.join(arg_1, "h2o-genmodel.jar"))
            else:
                h2o.api("GET /3/h2o-genmodel.jar", save_to=os.path.join(arg_1, arg_3))
        return h2o.api("GET /3/Models/%s/mojo" % arg_0.model_id, save_to=arg_1)


def Func ( arg_0 , arg_1 ) : try : while len ( arg_0 . _result_cache ) < arg_1 : arg_0 . _result_cache . append ( next ( arg_0 . _result_iter ) ) return True except StopIteration : return False

def Func(arg_0, arg_1):
        """
        Attempts to fill the result cache with at least the given number of results.

        Returns:
            bool: Whether the cache contains at least the given size.
        """

        try:
            while len(arg_0._result_cache) < arg_1:
                arg_0._result_cache.append(next(arg_0._result_iter))
            return True
        except StopIteration:
            return False

Attempts to fill the result cache with at least the given number of results .


return {
            'album': album,
            'index_title': self.index_title,
            'settings': self.settings,
            'sigal_link': sigal_link,
            'theme': {'name': os.path.basename(self.theme),
                      'url': url_from_path(os.path.relpath(self.theme_path,
                                                           album.dst_path))},
        }

def
Func
(
arg_0
,
arg_1
)
:
from
.
import
__url__
as
sigal_link
arg_0
.
logger
.
info
(
"Output album : %r"
,
arg_1
)
return
{
'album'
:
arg_1
,
'index_title'
:
arg_0
.
index_title
,
'settings'
:
arg_0
.
settings
,
'sigal_link'
:
sigal_link
,
'theme'
:
{
'name'
:
os
.
path
.
basename
(
arg_0
.
theme
)
,
'url'
:
url_from_path
(
os
.
path
.
relpath
(
arg_0
.
theme_path
,
arg_1
.
dst_path
)
)
}
,
}

def Func(arg_0, arg_1):
        """Generate the context dict for the given path."""

        from . import __url__ as sigal_link
        arg_0.logger.info("Output album : %r", arg_1)
        return {
            'album': arg_1,
            'index_title': arg_0.index_title,
            'settings': arg_0.settings,
            'sigal_link': sigal_link,
            'theme': {'name': os.path.basename(arg_0.theme),
                      'url': url_from_path(os.path.relpath(arg_0.theme_path,
                                                           arg_1.dst_path))},
        }

Generate the context dict for the given path .


(setter, x0, y0, x1, y1, color=None, colorFunc=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=None, arg_6=None):
    """Draw line from point x0,y0 to x,1,y1. Will draw beyond matrix bounds."""
    arg_7 = abs(arg_4 - arg_2) > abs(arg_3 - arg_1)
    if arg_7:
        arg_1, arg_2 = arg_2, arg_1
        arg_3, arg_4 = arg_4, arg_3

    if arg_1 > arg_3:
        arg_1, arg_3 = arg_3, arg_1
        arg_2, arg_4 = arg_4, arg_2

    arg_8 = arg_3 - arg_1
    arg_9 = abs(arg_4 - arg_2)

    arg_10 = arg_8 / 2

    if arg_2 < arg_4:
        arg_11 = 1
    else:
        arg_11 = -1

    arg_12 = 0
    for arg_13 in range(arg_1, arg_3 + 1):
        if arg_6:
            arg_5 = arg_6(arg_12)
            arg_12 += 1

        if arg_7:
            arg_0(arg_2, arg_13, arg_5)
        else:
            arg_0(arg_13, arg_2, arg_5)

        arg_10 -= arg_9
        if arg_10 < 0:
            arg_2 += arg_11
            arg_10 += arg_8

Draw line from point x0 y0 to x 1 y1 . Will draw beyond matrix bounds .


def Func(arg_0, arg_1=None):
        """override to allow old '-pylab' flag with deprecation warning"""

        arg_1 = sys.argv[1:] if arg_1 is None else arg_1

        if '-pylab' in arg_1:
            # deprecated `-pylab` given,
            # warn and transform into current syntax
            arg_1 = arg_1[:] # copy, don't clobber
            arg_2 = arg_1.index('-pylab')
            warn.warn("`-pylab` flag has been deprecated.\n"
            "    Use `--pylab` instead, or `--pylab=foo` to specify a backend.")
            arg_3 = '--pylab'
            if len(arg_1) > arg_2+1:
                # check for gui arg, as in '-pylab qt'
                arg_4 = arg_1[arg_2+1]
                if arg_4 in ('wx', 'qt', 'qt4', 'gtk', 'auto'):
                    arg_3 = '--pylab='+arg_4
                    arg_1.pop(arg_2+1)
            arg_1[arg_2] = arg_3

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

override to allow old - pylab flag with deprecation warning


return render(request, "registrasion/product_category.html", data)

def Func(arg_0, arg_1):
    ''' Form for selecting products from an individual product category.

    Arguments:
        category_id (castable to int): The id of the category to display.

    Returns:
        redirect or render:
            If the form has been sucessfully submitted, redirect to
            ``dashboard``. Otherwise, render
            ``registrasion/Func.html`` with data::

                {
                    "category": category,         # An inventory.Category for
                                                  # category_id
                    "discounts": discounts,       # A list of
                                                  # DiscountAndQuantity
                    "form": products_form,        # A form for selecting
                                                  # products
                    "voucher_form": voucher_form, # A form for entering a
                                                  # voucher code
                }

    '''

    arg_2 = "products"
    arg_3 = "vouchers"

    # Handle the voucher form *before* listing products.
    # Products can change as vouchers are entered.
    arg_4 = _handle_voucher(arg_0, arg_3)
    arg_5, arg_6 = arg_4

    arg_1 = int(arg_1)  # Routing is [0-9]+
    arg_7 = inventory.Category.objects.get(pk=arg_1)

    with BatchController.batch(arg_0.user):
        arg_8 = ProductController.available_products(
            arg_0.user,
            arg_7=arg_7,
        )

        if not arg_8:
            messages.warning(
                arg_0,
                (
                    "There are no products available from category: " +
                    arg_7.name
                ),
            )
            return redirect("dashboard")

        arg_9 = _handle_products(arg_0, arg_7, arg_8, arg_2)
        arg_10, arg_11, arg_12 = arg_9

    if arg_0.POST and not arg_6 and not arg_10.errors:
        # Only return to the dashboard if we didn't add a voucher code
        # and if there's no errors in the products form
        if arg_10.has_changed():
            messages.success(
                arg_0,
                "Your reservations have been updated.",
            )
        return redirect(review)

    arg_13 = {
        "category": arg_7,
        "discounts": arg_11,
        "form": arg_10,
        "voucher_form": arg_5,
    }

    return render(arg_0, "registrasion/Func.html", arg_13)

Form for selecting products from an individual product category.

    Arguments:
        category_id (castable to int): The id of the category to display.

    Returns:
        redirect or render:
            If the form has been sucessfully submitted, redirect to
            ``dashboard``. Otherwise, render
            ``registrasion/product_category.html`` with data::

                {
                    "category": category,         # An inventory.Category for
                                                  # category_id
                    "discounts": discounts,       # A list of
                                                  # DiscountAndQuantity
                    "form": products_form,        # A form for selecting
                                                  # products
                    "voucher_form": voucher_form, # A form for entering a
                                                  # voucher code
                }

Form for selecting products from an individual product category .


def Func ( arg_0 , arg_1 = 'utf-8' , arg_2 = 'strict' ) : if not IS_PY3 and isinstance ( arg_0 , unicode ) : return arg_0 . encode ( arg_1 , arg_2 ) return str ( arg_0 )

def Func(arg_0, arg_1='utf-8', arg_2='strict'):
    """Convert Python object to string.

    :param value: Python object to convert.
    :param encoding: Encoding to use if in Python 2 given object is unicode.
    :param errors: Errors mode to use if in Python 2 given object is unicode.
    """
    if not IS_PY3 and isinstance(arg_0, unicode):  # noqa
        return arg_0.encode(arg_1, arg_2)
    return str(arg_0)


def
Func
(
arg_0
,
arg_1
)
:
super
(
Connection
,
arg_0
)
.
Func
(
arg_1
)
arg_0
.
_connection_failed
(
"Protocol error occurred."
)

def Func(arg_0, arg_1):
        """The endpoint state machine failed due to protocol error."""
        super(Connection, arg_0).Func(arg_1)
        arg_0._connection_failed("Protocol error occurred.")

The endpoint state machine failed due to protocol error .


def Func ( ) : arg_0 = namedtuple ( "Members" , [ "name" , "handler" , "member_name" , "member" ] ) arg_1 = logging . Logger . manager arg_2 = [ ] arg_3 = set ( [ modname ( ) ] ) if arg_1 . root : arg_2 = list ( arg_1 . loggerDict . items ( ) ) arg_2 . append ( ( "root" , arg_1 . root ) ) for arg_4 , arg_5 in arg_2 : if arg_4 in arg_3 : continue for arg_6 in getattr ( arg_5 , "handlers" , [ ] ) : arg_7 = inspect . getmembers ( arg_6 ) for arg_8 , arg_9 in arg_7 : yield arg_0 ( arg_4 , arg_6 , arg_8 , arg_9 )

def Func():
    """iterate through the attributes of every logger's handler

    this is used to switch out stderr and stdout in tests when buffer is True

    :returns: generator of tuples, each tuple has (name, handler, member_name, member_val)
    """
    arg_0 = namedtuple("Members", ["name", "handler", "member_name", "member"])
    arg_1 = logging.Logger.manager
    arg_2 = []
    arg_3 = set([modname()])
    if arg_1.root:
        arg_2 = list(arg_1.loggerDict.items())
        arg_2.append(("root", arg_1.root))

    for arg_4, arg_5 in arg_2:
        if arg_4 in arg_3: continue

        for arg_6 in getattr(arg_5, "handlers", []):
            arg_7 = inspect.getmembers(arg_6)
            for arg_8, arg_9 in arg_7:
                yield arg_0(arg_4, arg_6, arg_8, arg_9)

iterate through the attributes of every logger s handler


def Func ( arg_0 ) : with open ( arg_0 , 'r' , errors = 'surrogateescape' , newline = os . linesep ) as f : arg_1 = GitParser ( f ) for arg_2 in arg_1 . parse ( ) : yield arg_2

def Func(arg_0):
        """Parse a Git log file.

        The method parses the Git log file and returns an iterator of
        dictionaries. Each one of this, contains a commit.

        :param filepath: path to the log file

        :returns: a generator of parsed commits

        :raises ParseError: raised when the format of the Git log file
            is invalid
        :raises OSError: raised when an error occurs reading the
            given file
        """
        with open(arg_0, 'r', errors='surrogateescape',
                  newline=os.linesep) as f:
            arg_1 = GitParser(f)

            for arg_2 in arg_1.parse():
                yield arg_2


return tf.squeeze(tf.compat.v1.batch_gather(
      params=time_series_tensor,
      indices=first_unmasked_indices[..., tf.newaxis]), axis=-1)

def Func(arg_0, arg_1):
  """Get the first unmasked entry of each time series in the batch.

  Args:
    time_series_tensor: float `Tensor` of shape [..., num_timesteps].
    broadcast_mask: bool `Tensor` of same shape as `time_series`.
  """

  arg_2 = tf.shape(input=arg_0)[-1]

  # Compute the index of the first unmasked entry for each series in the batch.
  arg_3 = (
      tf.cast(~arg_1, tf.int32) *
      tf.range(arg_2, 0, -1))
  arg_4 = arg_2 - tf.reduce_max(
      input_tensor=arg_3, axis=-1)

  if arg_4.shape.ndims is None:
    raise NotImplementedError(
        'Cannot compute initial values of a masked time series with'
        'dynamic rank.')  # `batch_gather` requires static rank

  # Extract the initial value for each series in the batch.
  return tf.squeeze(tf.compat.v1.batch_gather(
      params=arg_0,
      indices=arg_4[..., tf.newaxis]), axis=-1)

Get the first unmasked entry of each time series in the batch .


def Func(arg_0, arg_1):
    """Creates `dist_fn`, `dist_fn_wrapped`, `dist_fn_args`, `dist_fn_name`."""
    if not _is_dict_like(arg_1):
      raise TypeError('`model` must be convertible to `dict` (saw: {}).'.format(
          type(arg_1).__name__))
    [
        arg_0._dist_fn,
        arg_0._dist_fn_wrapped,
        arg_0._dist_fn_args,
        arg_0._dist_fn_name,  # JointDistributionSequential doesn't have this.
    ] = _prob_chain_rule_flatten(arg_1)


def Func(arg_0, arg_1, arg_2 = True):
        """Return jid tuple from an Unicode string.

        :Parameters:
            - `data`: the JID string
            - `check`: when `False` then the JID is not checked for
              specification compliance.

        :Return: (localpart, domainpart, resourcepart) tuple"""
        arg_3 = arg_1.split(u"/", 1)
        arg_4 = arg_3[0].split(u"@", 1)
        if len(arg_4) == 2:
            arg_5 = arg_4[0]
            arg_6 = arg_4[1]
            if arg_2:
                arg_5 = arg_0.__prepare_local(arg_5)
                arg_6 = arg_0.__prepare_domain(arg_6)
        else:
            arg_5 = None
            arg_6 = arg_4[0]
            if arg_2:
                arg_6 = arg_0.__prepare_domain(arg_6)
        if len(arg_3) == 2:
            arg_7 = arg_3[1]
            if arg_2:
                arg_7 = arg_0.__prepare_resource(arg_3[1])
        else:
            arg_7 = None
        if not arg_6:
            raise JIDError("Domain is required in JID.")
        return (arg_5, arg_6, arg_7)

Return jid tuple from an Unicode string .


def Func ( arg_0 , ** arg_1 ) : cache . delete ( 'sitetrees' ) cache . delete ( 'sitetrees_reset' ) arg_1 . get ( 'init' , True ) and arg_0 . init ( )

def Func(arg_0, **arg_1):
        """Empties cached sitetree data."""
        cache.delete('sitetrees')
        cache.delete('sitetrees_reset')

        arg_1.get('init', True) and arg_0.init()


def Func ( arg_0 , arg_1 ) : arg_2 = np . arange ( arg_0 . masker . n_vox_in_vol ) np . random . shuffle ( arg_2 ) arg_3 = arg_2 [ 0 : arg_1 ] return arg_0 . get_image_data ( arg_2 = arg_3 )

def Func(arg_0, arg_1):
    """ Returns mappable data for a random subset of voxels.

    May be useful as a baseline in predictive analyses--e.g., to compare
    performance of a more principled feature selection method with simple
    random selection.

    Args:
        dataset: A Dataset instance
        n_voxels: An integer specifying the number of random voxels to select.

    Returns:
        A 2D numpy array with (randomly-selected) voxels in rows and mappables
        in columns.
    """
    arg_2 = np.arange(arg_0.masker.n_vox_in_vol)
    np.random.shuffle(arg_2)
    arg_3 = arg_2[0:arg_1]
    return arg_0.get_image_data(arg_2=arg_3)

Returns mappable data for a random subset of voxels .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 is None : arg_0 . _CACHE_STATS [ 'access_stats' ] . setdefault ( arg_1 , { 'hit' : 0 , 'miss' : 0 , 'expired' : 0 } ) else : arg_0 . _CACHE_STATS [ 'access_stats' ] [ arg_1 ] [ arg_2 ] += 1

def Func(arg_0, arg_1, arg_2):
        """
        Update the cache stats.

        If no cache-result is specified, we iniitialize the key.
        Otherwise, we increment the correct cache-result.

        Note the behavior for expired.  A client can be expired and the key
        still exists.
        """
        if arg_2 is None:
            arg_0._CACHE_STATS['access_stats'].setdefault(arg_1,
                                         {'hit': 0, 'miss': 0, 'expired': 0})
        else:
            arg_0._CACHE_STATS['access_stats'][arg_1][arg_2] +=1

Update the cache stats . If no cache - result is specified we iniitialize the key . Otherwise we increment the correct cache - result .


Read block type switch descriptor for given kind of blockType.

def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
verboseRead
(
TypeCountAlphabet
(
'BT#'
+
arg_1
[
0
]
.
upper
(
)
,
description
=
'{} block types'
.
format
(
arg_1
)
,
)
)
arg_0
.
numberOfBlockTypes
[
arg_1
]
=
arg_2
if
arg_2
>=
2
:
arg_0
.
FuncCodes
[
arg_1
]
=
arg_0
.
readPrefixCode
(
BlockTypeAlphabet
(
'BT'
+
arg_1
[
0
]
.
upper
(
)
,
arg_2
)
)
arg_0
.
blockCountCodes
[
arg_1
]
=
arg_0
.
readPrefixCode
(
BlockCountAlphabet
(
'BC'
+
arg_1
[
0
]
.
upper
(
)
)
)
arg_6
=
arg_0
.
verboseRead
(
arg_0
.
blockCountCodes
[
arg_1
]
)
else
:
arg_6
=
1
<<
24
arg_0
.
currentBlockCounts
[
arg_1
]
=
arg_6

def Func(arg_0, arg_1):
        """Read block type switch descriptor for given kind of Func."""
        arg_2 = arg_0.verboseRead(TypeCountAlphabet(
            'BT#'+arg_1[0].upper(),
            description='{} block types'.format(arg_1),
            ))
        arg_0.numberOfBlockTypes[arg_1] = arg_2
        if arg_2>=2:
            arg_0.FuncCodes[arg_1] = arg_0.readPrefixCode(
                BlockTypeAlphabet('BT'+arg_1[0].upper(), arg_2))
            arg_0.blockCountCodes[arg_1] = arg_0.readPrefixCode(
                BlockCountAlphabet('BC'+arg_1[0].upper()))
            arg_6 = arg_0.verboseRead(arg_0.blockCountCodes[arg_1])
        else:
            arg_6 = 1<<24
        arg_0.currentBlockCounts[arg_1] = arg_6

Read block type switch descriptor for given kind of blockType .