def Func ( arg_0 ) : arg_1 = { 'sift_predictions' : [ ] , 'polyphen_predictions' : [ ] , 'region_annotations' : [ ] , 'functional_annotations' : [ ] } for arg_2 in arg_0 : for arg_3 in arg_1 : arg_4 = arg_3 [ : - 1 ] if len ( arg_0 ) == 1 : arg_5 = arg_2 . get ( arg_4 , '-' ) else : arg_6 = arg_2 . get ( 'hgnc_symbol' ) or str ( arg_2 [ 'hgnc_id' ] ) arg_5 = ':' . join ( [ arg_6 , arg_2 . get ( arg_4 , '-' ) ] ) arg_1 [ arg_3 ] . append ( arg_5 ) return arg_1

def Func(arg_0):
    """Get sift predictions from genes."""
    arg_1 = {
        'sift_predictions': [],
        'polyphen_predictions': [],
        'region_annotations': [],
        'functional_annotations': []
    }
    for arg_2 in arg_0:
        for arg_3 in arg_1:
            arg_4 = arg_3[:-1]
            if len(arg_0) == 1:
                arg_5 = arg_2.get(arg_4, '-')
            else:
                arg_6 = arg_2.get('hgnc_symbol') or str(arg_2['hgnc_id'])
                arg_5 = ':'.join([arg_6, arg_2.get(arg_4, '-')])
            arg_1[arg_3].append(arg_5)

    return arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = itertools . zip_longest ( arg_0 . data , arg_1 [ 'data' ] ) arg_0 . data = list ( itertools . starmap ( robust_add , arg_2 ) )

def Func(arg_0, arg_1):
		"""
		Add a data set to the graph

		>>> graph.Func({data:[1,2,3,4]}) # doctest: +SKIP

		Note that a 'title' key is ignored.

		Multiple calls to Func will sum the elements, and the pie will
		display the aggregated data.  e.g.

		>>> graph.Func({data:[1,2,3,4]}) # doctest: +SKIP
		>>> graph.Func({data:[2,3,5,7]}) # doctest: +SKIP

		is the same as:

		>>> graph.Func({data:[3,5,8,11]}) # doctest: +SKIP

		If data is added of with differing lengths, the corresponding
		values will be assumed to be zero.

		>>> graph.Func({data:[1,2,3,4]}) # doctest: +SKIP
		>>> graph.Func({data:[5,7]}) # doctest: +SKIP

		is the same as:

		>>> graph.Func({data:[5,7]}) # doctest: +SKIP
		>>> graph.Func({data:[1,2,3,4]}) # doctest: +SKIP

		and

		>>> graph.Func({data:[6,9,3,4]}) # doctest: +SKIP
		"""
		arg_2 = itertools.zip_longest(arg_0.data, arg_1['data'])
		arg_0.data = list(itertools.starmap(robust_add, arg_2))

Add a data set to the graph

		>>> graph.add_data({data:[1,2,3,4]}) # doctest: +SKIP

		Note that a 'title' key is ignored.

		Multiple calls to add_data will sum the elements, and the pie will
		display the aggregated data.  e.g.

		>>> graph.add_data({data:[1,2,3,4]}) # doctest: +SKIP
		>>> graph.add_data({data:[2,3,5,7]}) # doctest: +SKIP

		is the same as:

		>>> graph.add_data({data:[3,5,8,11]}) # doctest: +SKIP

		If data is added of with differing lengths, the corresponding
		values will be assumed to be zero.

		>>> graph.add_data({data:[1,2,3,4]}) # doctest: +SKIP
		>>> graph.add_data({data:[5,7]}) # doctest: +SKIP

		is the same as:

		>>> graph.add_data({data:[5,7]}) # doctest: +SKIP
		>>> graph.add_data({data:[1,2,3,4]}) # doctest: +SKIP

		and

		>>> graph.add_data({data:[6,9,3,4]}) # doctest: +SKIP


return "%s@%s.%s" % (
        xunit.any_string(min_length=min_length, max_length=max_length),
        xunit.any_string(min_length=min_length, max_length=max_length),
        xunit.any_string(min_length=2, max_length=3))

def Func(arg_0, **arg_1):
    """
    Return random value for EmailField

    >>> result = any_form_field(forms.EmailField(min_length=10, max_length=30))
    >>> type(result)
    <type 'str'>
    >>> len(result) <= 30, len(result) >= 10
    (True, True)
    """
    arg_2 = 10
    if arg_0.max_length:
        arg_2 = (arg_0.max_length -5) / 2
    arg_3 = 10
    if arg_0.min_length:
        arg_3 = (arg_0.min_length-4) / 2
    return "%s@%s.%s" % (
        xunit.any_string(arg_3=arg_3, arg_2=arg_2),
        xunit.any_string(arg_3=arg_3, arg_2=arg_2),
        xunit.any_string(arg_3=2, arg_2=3))


def
Func
(
arg_0
=
,
arg_1
=
)
:
if
utils
.
is_system_path
(
arg_0
)
:
arg_2
=
unipath
(
arg_0
)
else
:
arg_2
=
unipath
(
get_home_path
(
)
,
arg_0
)
if
os
.
path
.
exists
(
arg_2
)
:
raise
OSError
(
'{} already exists'
.
format
(
arg_2
)
)
arg_3
=
VirtualEnvironment
(
arg_2
)
utils
.
ensure_path_exists
(
arg_3
.
path
)
if
arg_1
:
if
utils
.
is_git_repo
(
arg_1
)
:
Git
(
''
)
.
clone
(
arg_1
,
arg_3
.
path
)
else
:
shutil
.
copy2
(
arg_1
,
arg_3
.
config_path
)
else
:
with
open
(
arg_3
.
config_path
,
'w'
)
as
f
:
f
.
write
(
defaults
.
environment_config
)
utils
.
ensure_path_exists
(
arg_3
.
hook_path
)
utils
.
ensure_path_exists
(
arg_3
.
modules_path
)
arg_3
.
run_hook
(
'preFunc'
)
virtualenv
.
Func_environment
(
arg_3
.
path
)
if
not
utils
.
is_home_environment
(
arg_3
.
path
)
:
EnvironmentCache
.
add
(
arg_3
)
EnvironmentCache
.
save
(
)
try
:
arg_3
.
update
(
)
except
:
utils
.
rmtree
(
arg_2
)
logger
.
debug
(
'Failed to update, rolling back...'
)
raise
else
:
arg_3
.
run_hook
(
'postFunc'
)
return
arg_3

def Func(arg_0=None, arg_1=None):
    '''Create a virtual environment. You can pass either the name of a new
    environment to Func in your CPENV_HOME directory OR specify a full path
    to Func an environment outisde your CPENV_HOME.

    Create an environment in CPENV_HOME::

        >>> cpenv.Func('myenv')

    Create an environment elsewhere::

        >>> cpenv.Func('~/custom_location/myenv')

    :param name_or_path: Name or full path of environment
    :param config: Environment configuration including dependencies etc...
    '''

    # Get the real path of the environment
    if utils.is_system_path(arg_0):
        arg_2 = unipath(arg_0)
    else:
        arg_2 = unipath(get_home_path(), arg_0)

    if os.path.exists(arg_2):
        raise OSError('{} already exists'.format(arg_2))

    arg_3 = VirtualEnvironment(arg_2)
    utils.ensure_path_exists(arg_3.path)

    if arg_1:
        if utils.is_git_repo(arg_1):
            Git('').clone(arg_1, arg_3.path)
        else:
            shutil.copy2(arg_1, arg_3.config_path)
    else:
        with open(arg_3.config_path, 'w') as f:
            f.write(defaults.environment_config)

    utils.ensure_path_exists(arg_3.hook_path)
    utils.ensure_path_exists(arg_3.modules_path)

    arg_3.run_hook('preFunc')

    virtualenv.Func_environment(arg_3.path)
    if not utils.is_home_environment(arg_3.path):
        EnvironmentCache.add(arg_3)
        EnvironmentCache.save()

    try:
        arg_3.update()
    except:
        utils.rmtree(arg_2)
        logger.debug('Failed to update, rolling back...')
        raise
    else:
        arg_3.run_hook('postFunc')

    return arg_3

Create a virtual environment. You can pass either the name of a new
    environment to create in your CPENV_HOME directory OR specify a full path
    to create an environment outisde your CPENV_HOME.

    Create an environment in CPENV_HOME::

        >>> cpenv.create('myenv')

    Create an environment elsewhere::

        >>> cpenv.create('~/custom_location/myenv')

    :param name_or_path: Name or full path of environment
    :param config: Environment configuration including dependencies etc...

Create a virtual environment . You can pass either the name of a new environment to create in your CPENV_HOME directory OR specify a full path to create an environment outisde your CPENV_HOME .


def
Func
(
arg_0
)
:
if
not
arg_0
.
data
:
raise
ValueError
(
"No data available"
)
if
hasattr
(
arg_0
,
'calculations'
)
:
arg_0
.
calculations
(
)
arg_0
.
start_svg
(
)
arg_0
.
calculate_graph_dimensions
(
)
arg_0
.
foreground
=
etree
.
Element
(
"g"
)
arg_0
.
draw_graph
(
)
arg_0
.
draw_titles
(
)
arg_0
.
draw_legend
(
)
arg_0
.
draw_data
(
)
arg_0
.
graph
.
append
(
arg_0
.
foreground
)
arg_0
.
render_inline_styles
(
)
return
arg_0
.
render
(
arg_0
.
root
)

def Func(arg_0):
		"""
		Process the template with the data and
		config which has been set and return the resulting SVG.

		Raises ValueError when no data set has
		been added to the graph object.
		"""
		if not arg_0.data:
			raise ValueError("No data available")

		if hasattr(arg_0, 'calculations'):
			arg_0.calculations()

		arg_0.start_svg()
		arg_0.calculate_graph_dimensions()
		arg_0.foreground = etree.Element("g")
		arg_0.draw_graph()
		arg_0.draw_titles()
		arg_0.draw_legend()
		arg_0.draw_data()
		arg_0.graph.append(arg_0.foreground)
		arg_0.render_inline_styles()

		return arg_0.render(arg_0.root)

Process the template with the data and config which has been set and return the resulting SVG .


def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Execute the callbacks for the listeners on the specified event with the
        supplied arguments.

        All extra arguments are passed through to each callback.

        :param name: the name of the event
        :type name: string
        """
        for arg_4 in arg_0.__listeners[arg_1]:
            arg_4(*arg_2, **arg_3)

Execute the callbacks for the listeners on the specified event with the supplied arguments .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . filters = [ [ sl , arg_2 [ sl ] ] for sl in arg_1 ]

def Func(arg_0, arg_1, arg_2):
        """
        Sets Fourier-space filters for the image. The image is filtered by
        subtracting values from the image at slices.

        Parameters
        ----------
        slices : List of indices or slice objects.
            The q-values in Fourier space to filter.
        values : np.ndarray
            The complete array of Fourier space peaks to subtract off.  values
            should be the same size as the FFT of the image; only the portions
            of values at slices will be removed.

        Examples
        --------
        To remove a two Fourier peaks in the data at q=(10, 10, 10) &
        (245, 245, 245), where im is the residuals of a model:

            * slices = [(10,10,10), (245, 245, 245)]
            * values = np.fft.fftn(im)
            * im.Func(slices, values)
        """
        arg_0.filters = [[sl,arg_2[sl]] for sl in arg_1]

Sets Fourier-space filters for the image. The image is filtered by
        subtracting values from the image at slices.

        Parameters
        ----------
        slices : List of indices or slice objects.
            The q-values in Fourier space to filter.
        values : np.ndarray
            The complete array of Fourier space peaks to subtract off.  values
            should be the same size as the FFT of the image; only the portions
            of values at slices will be removed.

        Examples
        --------
        To remove a two Fourier peaks in the data at q=(10, 10, 10) &
        (245, 245, 245), where im is the residuals of a model:

            * slices = [(10,10,10), (245, 245, 245)]
            * values = np.fft.fftn(im)
            * im.set_filter(slices, values)

Sets Fourier - space filters for the image . The image is filtered by subtracting values from the image at slices .


def Func ( arg_0 ) : for arg_1 in record_get_field_instances ( arg_0 . record , '653' , ind1 = '1' ) : arg_2 = field_get_subfields ( arg_1 ) arg_3 = [ ] if 'a' in arg_2 : for arg_4 in arg_2 [ 'a' ] : arg_3 . extend ( [ ( '9' , 'author' ) , ( 'a' , arg_4 ) ] ) arg_5 = create_field ( subfields = arg_3 , ind1 = '1' ) record_replace_field ( arg_0 . record , '653' , arg_5 , field_position_global = arg_1 [ 4 ] )

def Func(arg_0):
        """653 Free Keywords."""
        for arg_1 in record_get_field_instances(arg_0.record, '653', ind1='1'):
            arg_2 = field_get_subfields(arg_1)
            arg_3 = []
            if 'a' in arg_2:
                for arg_4 in arg_2['a']:
                    arg_3.extend([('9', 'author'), ('a', arg_4)])
            arg_5 = create_field(subfields=arg_3, ind1='1')
            record_replace_field(
                arg_0.record, '653', arg_5, field_position_global=arg_1[4])


def Func ( arg_0 ) : if not isinstance ( arg_0 , ProtocolVersion ) : return None if arg_0 . major == 1 : if arg_0 . minor == 0 : return enums . KMIPVersion . KMIP_1_0 elif arg_0 . minor == 1 : return enums . KMIPVersion . KMIP_1_1 elif arg_0 . minor == 2 : return enums . KMIPVersion . KMIP_1_2 elif arg_0 . minor == 3 : return enums . KMIPVersion . KMIP_1_3 elif arg_0 . minor == 4 : return enums . KMIPVersion . KMIP_1_4 else : return None else : return None

def Func(arg_0):
    """
    Convert a ProtocolVersion struct to its KMIPVersion enumeration equivalent.

    Args:
        value (ProtocolVersion): A ProtocolVersion struct to be converted into
            a KMIPVersion enumeration.

    Returns:
        KMIPVersion: The enumeration equivalent of the struct. If the struct
            cannot be converted to a valid enumeration, None is returned.
    """
    if not isinstance(arg_0, ProtocolVersion):
        return None

    if arg_0.major == 1:
        if arg_0.minor == 0:
            return enums.KMIPVersion.KMIP_1_0
        elif arg_0.minor == 1:
            return enums.KMIPVersion.KMIP_1_1
        elif arg_0.minor == 2:
            return enums.KMIPVersion.KMIP_1_2
        elif arg_0.minor == 3:
            return enums.KMIPVersion.KMIP_1_3
        elif arg_0.minor == 4:
            return enums.KMIPVersion.KMIP_1_4
        else:
            return None
    else:
        return None

Convert a ProtocolVersion struct to its KMIPVersion enumeration equivalent .


def Func ( arg_0 , arg_1 ) : for arg_2 in iterate_forever ( arg_1 . get_playlist ) : try : arg_0 . play ( arg_2 ) except StopIteration : arg_0 . stop ( ) return

def Func(arg_0, arg_1):
        """Play the station until something ends it

        This function will run forever until termintated by calling
        end_station.
        """
        for arg_2 in iterate_forever(arg_1.get_playlist):
            try:
                arg_0.play(arg_2)
            except StopIteration:
                arg_0.stop()
                return


def Func ( arg_0 ) : arg_1 = distribution_util . prefer_static_rank ( arg_0 ) arg_2 = tf . range ( arg_1 ) arg_2 = tf . concat ( [ arg_2 [ : - 2 ] , [ arg_2 [ - 1 ] , arg_2 [ - 2 ] ] ] , axis = 0 ) return tf . transpose ( a = arg_0 , arg_2 = arg_2 )

def Func(arg_0):
  """Transpose a possibly batched matrix.

  Args:
    mat: A `tf.Tensor` of shape `[..., n, m]`.

  Returns:
    A tensor of shape `[..., m, n]` with matching batch dimensions.
  """
  arg_1 = distribution_util.prefer_static_rank(arg_0)
  arg_2 = tf.range(arg_1)
  arg_2 = tf.concat([arg_2[:-2], [arg_2[-1], arg_2[-2]]], axis=0)
  return tf.transpose(a=arg_0, arg_2=arg_2)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
arg_1
:
return
arg_1
arg_3
=
arg_0
.
options
.
max_simultaneous_requests
arg_4
=
arg_0
.
options
.
verbose
arg_5
=
arg_0
.
github
arg_6
=
arg_0
.
options
.
user
arg_7
=
arg_0
.
options
.
project
arg_0
.
events_cnt
=
0
if
arg_4
:
print
(
"fetching events for {} {}... "
.
format
(
len
(
arg_1
)
,
arg_2
)
)
def
worker
(
arg_9
)
:
arg_10
=
1
arg_9
[
'events'
]
=
[
]
while
arg_10
>
0
:
arg_11
,
arg_12
=
arg_5
.
repos
[
arg_6
]
[
arg_7
]
.
issues
[
arg_9
[
'number'
]
]
.
events
.
get
(
arg_10
=
arg_10
,
per_page
=
PER_PAGE_NUMBER
)
if
arg_11
==
200
:
arg_9
[
'events'
]
.
extend
(
arg_12
)
arg_0
.
events_cnt
+=
len
(
arg_12
)
else
:
arg_0
.
raise_GitHubError
(
arg_11
,
arg_12
,
arg_5
.
getheaders
(
)
)
arg_10
=
NextPage
(
arg_5
)
arg_13
=
[
]
arg_14
=
len
(
arg_1
)
for
arg_15
in
range
(
0
,
(
arg_14
//
arg_3
)
+
1
)
:
for
arg_16
in
range
(
arg_3
)
:
arg_17
=
arg_15
*
arg_3
+
arg_16
if
arg_17
==
arg_14
:
break
arg_18
=
threading
.
Thread
(
target
=
worker
,
args
=
(
arg_1
[
arg_17
]
,
)
)
arg_13
.
append
(
arg_18
)
arg_18
.
start
(
)
if
arg_4
>
2
:
print
(
"."
,
end
=
""
)
if
not
arg_17
%
PER_PAGE_NUMBER
:
print
(
""
)
for
arg_18
in
arg_13
:
arg_18
.
join
(
)
if
arg_4
>
2
:
print
(
"."
)

def Func(arg_0, arg_1, arg_2):
        """
        Fetch events for all issues and add them to self.events

        :param list issues: all issues
        :param str tag_name: name of the tag to fetch events for
        :returns: Nothing
        """

        if not arg_1:
            return arg_1

        arg_3 = arg_0.options.max_simultaneous_requests
        arg_4 = arg_0.options.verbose
        arg_5 = arg_0.github
        arg_6 = arg_0.options.user
        arg_7 = arg_0.options.project
        arg_0.events_cnt = 0
        if arg_4:
            print("fetching events for {} {}... ".format(
                len(arg_1), arg_2)
            )

        def worker(arg_9):
            arg_10 = 1
            arg_9['events'] = []
            while arg_10 > 0:
                arg_11, arg_12 = arg_5.repos[arg_6][arg_7].issues[
                    arg_9['number']].events.get(
                    arg_10=arg_10, per_page=PER_PAGE_NUMBER)
                if arg_11 == 200:
                    arg_9['events'].extend(arg_12)
                    arg_0.events_cnt += len(arg_12)
                else:
                    arg_0.raise_GitHubError(arg_11, arg_12, arg_5.getheaders())
                arg_10 = NextPage(arg_5)

        arg_13 = []
        arg_14 = len(arg_1)
        for arg_15 in range(0, (arg_14 // arg_3) + 1):
            for arg_16 in range(arg_3):
                arg_17 = arg_15 * arg_3 + arg_16
                if arg_17 == arg_14:
                    break
                arg_18 = threading.Thread(target=worker, args=(arg_1[arg_17],))
                arg_13.append(arg_18)
                arg_18.start()
                if arg_4 > 2:
                    print(".", end="")
                    if not arg_17 % PER_PAGE_NUMBER:
                        print("")
            for arg_18 in arg_13:
                arg_18.join()
        if arg_4 > 2:
            print(".")

Fetch events for all issues and add them to self . events


def Func ( arg_0 ) : arg_1 = find_funcdef ( arg_0 ) arg_2 = [ ] for arg_3 in ast . walk ( arg_1 . args ) : if isinstance ( arg_3 , ast . arg ) : if arg_3 . arg not in arg_2 : arg_2 . append ( arg_3 . arg ) return arg_2

def Func(arg_0):
    """Extract parameters from a function definition"""

    arg_1 = find_funcdef(arg_0)
    arg_2 = []
    for arg_3 in ast.walk(arg_1.args):
        if isinstance(arg_3, ast.arg):
            if arg_3.arg not in arg_2:
                arg_2.append(arg_3.arg)

    return arg_2


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

return AddElementwise(iap.RandomSign(iap.Poisson(lam=lam2)), per_channel=per_channel, name=name,
                          deterministic=deterministic, random_state=random_state)

def Func ( arg_0 = 0 , arg_1 = False , arg_2 = None , arg_3 = False , arg_4 = None ) : arg_5 = iap . handle_continuous_param ( arg_0 , "lam" , value_range = ( 0 , None ) , tuple_to_uniform = True , list_to_choice = True ) if arg_2 is None : arg_2 = "Unnamed%s" % ( ia . caller_name ( ) , ) return AddElementwise ( iap . RandomSign ( iap . Poisson ( arg_0 = arg_5 ) ) , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0=0, arg_1=False, arg_2=None, arg_3=False, arg_4=None):
    """
    Create an augmenter to add poisson noise to images.

    Poisson noise is comparable to gaussian noise as in ``AdditiveGaussianNoise``, but the values are sampled from
    a poisson distribution instead of a gaussian distribution. As poisson distributions produce only positive numbers,
    the sign of the sampled values are here randomly flipped.

    Values of around ``10.0`` for `lam` lead to visible noise (for uint8).
    Values of around ``20.0`` for `lam` lead to very visible noise (for uint8).
    It is recommended to usually set `per_channel` to True.

    dtype support::

        See ``imgaug.augmenters.arithmetic.AddElementwise``.

    Parameters
    ----------
    lam : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Lambda parameter of the poisson distribution. Recommended values are around ``0.0`` to ``10.0``.

            * If a number, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

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

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

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

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

    Examples
    --------
    >>> aug = iaa.Func(lam=5.0)

    Adds poisson noise sampled from ``Poisson(5.0)`` to images.

    >>> aug = iaa.Func(lam=(0.0, 10.0))

    Adds poisson noise sampled from ``Poisson(x)`` to images, where ``x`` is randomly sampled per image from the
    interval ``[0.0, 10.0]``.

    >>> aug = iaa.Func(lam=5.0, per_channel=True)

    Adds poisson noise sampled from ``Poisson(5.0)`` to images,
    where the values are different per pixel *and* channel (e.g. a
    different one for red, green and blue channels for the same pixel).

    >>> aug = iaa.Func(lam=(0.0, 10.0), per_channel=True)

    Adds poisson noise sampled from ``Poisson(x)`` to images,
    with ``x`` being sampled from ``uniform(0.0, 10.0)`` per image, pixel and channel.
    This is the *recommended* configuration.

    >>> aug = iaa.Func(lam=2, per_channel=0.5)

    Adds poisson noise sampled from the distribution ``Poisson(2)`` to images,
    where the values are sometimes (50 percent of all cases) the same
    per pixel for all channels and sometimes different (other 50 percent).

    """
    arg_5 = iap.handle_continuous_param(arg_0, "lam", value_range=(0, None), tuple_to_uniform=True,
                                       list_to_choice=True)

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

    return AddElementwise(iap.RandomSign(iap.Poisson(arg_0=arg_5)), arg_1=arg_1, arg_2=arg_2,
                          arg_3=arg_3, arg_4=arg_4)

Create an augmenter to add poisson noise to images.

    Poisson noise is comparable to gaussian noise as in ``AdditiveGaussianNoise``, but the values are sampled from
    a poisson distribution instead of a gaussian distribution. As poisson distributions produce only positive numbers,
    the sign of the sampled values are here randomly flipped.

    Values of around ``10.0`` for `lam` lead to visible noise (for uint8).
    Values of around ``20.0`` for `lam` lead to very visible noise (for uint8).
    It is recommended to usually set `per_channel` to True.

    dtype support::

        See ``imgaug.augmenters.arithmetic.AddElementwise``.

    Parameters
    ----------
    lam : number or tuple of number or list of number or imgaug.parameters.StochasticParameter, optional
        Lambda parameter of the poisson distribution. Recommended values are around ``0.0`` to ``10.0``.

            * If a number, exactly that value will be used.
            * If a tuple ``(a, b)``, a random value from the range ``a <= x <= b`` will
              be sampled per image.
            * If a list, then a random value will be sampled from that list per image.
            * If a StochasticParameter, a value will be sampled from the
              parameter per image.

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

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

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

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

    Examples
    --------
    >>> aug = iaa.AdditivePoissonNoise(lam=5.0)

    Adds poisson noise sampled from ``Poisson(5.0)`` to images.

    >>> aug = iaa.AdditivePoissonNoise(lam=(0.0, 10.0))

    Adds poisson noise sampled from ``Poisson(x)`` to images, where ``x`` is randomly sampled per image from the
    interval ``[0.0, 10.0]``.

    >>> aug = iaa.AdditivePoissonNoise(lam=5.0, per_channel=True)

    Adds poisson noise sampled from ``Poisson(5.0)`` to images,
    where the values are different per pixel *and* channel (e.g. a
    different one for red, green and blue channels for the same pixel).

    >>> aug = iaa.AdditivePoissonNoise(lam=(0.0, 10.0), per_channel=True)

    Adds poisson noise sampled from ``Poisson(x)`` to images,
    with ``x`` being sampled from ``uniform(0.0, 10.0)`` per image, pixel and channel.
    This is the *recommended* configuration.

    >>> aug = iaa.AdditivePoissonNoise(lam=2, per_channel=0.5)

    Adds poisson noise sampled from the distribution ``Poisson(2)`` to images,
    where the values are sometimes (50 percent of all cases) the same
    per pixel for all channels and sometimes different (other 50 percent).

Create an augmenter to add poisson noise to images .


def Func(arg_0, arg_1, arg_2):
        """Displays a progressbar"""
        if arg_0.report_progress:
            arg_3, arg_4, arg_5 = arg_0.report_progress
            if arg_4 == 'print':
                arg_6 = 'print'
            else:
                arg_6 = logging.getLogger(arg_4)

            if arg_1 == -1:
                # Compute the number of digits and avoid log10(0)
                arg_7 = int(math.log10(arg_2 + 0.1)) + 1
                arg_0._format_string = 'PROGRESS: Finished %' + '%d' % arg_7 + 'd/%d runs '

            arg_9 = arg_0._format_string % (arg_1 + 1, arg_2) + '%s'
            arg_10 = arg_5 == 0
            progressbar(arg_1, arg_2, percentage_step=arg_3,
                        arg_6=arg_6, arg_5=arg_5,
                        arg_9=arg_9, arg_10=arg_10)


(times, mags, errs, frequency,
              binsize=0.05, minbin=9)

def Func(arg_0, arg_1, arg_2, arg_3,
              arg_4=0.05, arg_5=9):
    '''Calculates the Schwarzenberg-Czerny AoV statistic at a test frequency.

    Parameters
    ----------

    times,mags,errs : np.array
        The input time-series and associated errors.

    frequency : float
        The test frequency to calculate the theta statistic at.

    binsize : float
        The phase bin size to use.

    minbin : int
        The minimum number of items in a phase bin to consider in the
        calculation of the statistic.

    Returns
    -------

    theta_aov : float
        The value of the AoV statistic at the specified `frequency`.

    '''

    arg_6 = 1.0/arg_3
    arg_7 = arg_0[0]

    arg_8 = phase_magseries(arg_0,
                             arg_1,
                             arg_6,
                             arg_7,
                             wrap=False,
                             sort=True)

    arg_9 = arg_8['phase']
    arg_10 = arg_8['mags']
    arg_11 = nparange(0.0, 1.0, arg_4)
    arg_12 = arg_9.size

    arg_13 = npdigitize(arg_9, arg_11)

    arg_14 = []
    arg_15 = []
    arg_16 = []
    arg_17 = 0

    arg_18 = npmedian(arg_10)

    for arg_19 in npunique(arg_13):

        arg_20 = arg_13 == arg_19
        arg_21 = arg_10[arg_20]

        if arg_21.size > arg_5:

            arg_22 = arg_21.size
            arg_23 = npmedian(arg_21)

            # get s1
            arg_24 = (
                arg_22 *
                (arg_23 - arg_18) *
                (arg_23 - arg_18)
            )

            # get s2
            arg_25 = npsum((arg_21 - arg_18) *
                                   (arg_21 - arg_18))

            arg_14.append(arg_24)
            arg_15.append(arg_25)
            arg_16.append(arg_22)
            arg_17 = arg_17 + 1

    # turn the quantities into arrays
    arg_14 = nparray(arg_14)
    arg_15 = nparray(arg_15)
    arg_16 = nparray(arg_16)

    # calculate s1 first
    arg_26 = npsum(arg_14)/(arg_17 - 1.0)

    # then calculate s2
    arg_27 = npsum(arg_15)/(arg_12 - arg_17)

    arg_28 = arg_26/arg_27

    return arg_28

Calculates the Schwarzenberg - Czerny AoV statistic at a test frequency .


def Func(arg_0, arg_1):
        """Renders the barcode to whatever the inheriting writer provides,
        using the registered callbacks.

        :parameters:
            code : List
                List of strings matching the writer spec
                (only contain 0 or 1).
        """
        if arg_0._callbacks['initialize'] is not None:
            arg_0._callbacks['initialize'](arg_1)
        arg_2 = 1.0
        for arg_3 in arg_1:
            # Left quiet zone is x startposition
            arg_4 = arg_0.quiet_zone
            for arg_5 in arg_3:
                if arg_5 == '0':
                    arg_6 = arg_0.background
                else:
                    arg_6 = arg_0.foreground
                arg_0._callbacks['paint_module'](arg_4, arg_2, arg_0.module_width,
                                                arg_6)
                arg_4 += arg_0.module_width
            # Add right quiet zone to every line
            arg_0._callbacks['paint_module'](arg_4, arg_2, arg_0.quiet_zone,
                                            arg_0.background)
            arg_2 += arg_0.module_height
        if arg_0.text and arg_0._callbacks['paint_text'] is not None:
            arg_2 += arg_0.text_distance
            if arg_0.center_text:
                arg_4 = arg_4 / 2.0
            else:
                arg_4 = arg_0.quiet_zone + 4.0
            arg_0._callbacks['paint_text'](arg_4, arg_2)
        return arg_0._callbacks['finish']()

Renders the barcode to whatever the inheriting writer provides using the registered callbacks .


(self, image_shape, size_lines=1, size_points=0,
                            raise_if_out_of_image=False)

return SegmentationMapOnImage(
            self.draw_mask(
                image_shape, size_lines=size_lines, size_points=size_points,
                raise_if_out_of_image=raise_if_out_of_image),
            shape=image_shape
        )

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = 0 , arg_4 = False ) : from . segmaps import SegmentationMapOnImage return SegmentationMapOnImage ( arg_0 . draw_mask ( arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) , shape = arg_1 )

def Func(arg_0, arg_1, arg_2=1, arg_3=0,
                            arg_4=False):
        """
        Generate a segmentation map object from the line string.

        This is similar to
        :func:`imgaug.augmentables.lines.LineString.draw_mask`.
        The result is wrapped in a ``SegmentationMapOnImage`` object
        instead of just an array.

        Parameters
        ----------
        image_shape : tuple of int
            The shape of the image onto which to draw the line mask.

        size_lines : int, optional
            Thickness of the line.

        size_points : int, optional
            Size of the points in pixels.

        raise_if_out_of_image : bool, optional
            Whether to raise an error if the line string is fully
            outside of the image. If set to False, no error will be raised and
            only the parts inside the image will be drawn.

        Returns
        -------
        imgaug.augmentables.segmaps.SegmentationMapOnImage
            Segmentation map object containing drawn line string.

        """
        from .segmaps import SegmentationMapOnImage
        return SegmentationMapOnImage(
            arg_0.draw_mask(
                arg_1, arg_2=arg_2, arg_3=arg_3,
                arg_4=arg_4),
            shape=arg_1
        )

Generate a segmentation map object from the line string .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . MS_CHARS . get ( arg_1 ) if type ( arg_2 ) == types . TupleType : if arg_0 . smartQuotesTo == 'xml' : arg_2 = '&#x%s;' % arg_2 [ 1 ] else : arg_2 = '&%s;' % arg_2 [ 0 ] return arg_2

def Func(arg_0, arg_1):
        """Changes a MS smart quote character to an XML or HTML
        entity."""
        arg_2 = arg_0.MS_CHARS.get(arg_1)
        if type(arg_2) == types.TupleType:
            if arg_0.smartQuotesTo == 'xml':
                arg_2 = '&#x%s;' % arg_2[1]
            else:
                arg_2 = '&%s;' % arg_2[0]
        return arg_2

Changes a MS smart quote character to an XML or HTML entity .


def Func ( arg_0 , arg_1 ) : arg_2 = time . time ( ) + arg_1 arg_3 = [ ] while True : try : arg_0 . gdb_process . stdout . flush ( ) if PYTHON3 : arg_4 = arg_0 . gdb_process . stdout . readline ( ) . replace ( b"\r" , b"\n" ) else : arg_4 = arg_0 . gdb_process . stdout . read ( ) . replace ( b"\r" , b"\n" ) arg_3 += arg_0 . _get_responses_list ( arg_4 , "stdout" ) except IOError : pass try : arg_0 . gdb_process . stderr . flush ( ) if PYTHON3 : arg_4 = arg_0 . gdb_process . stderr . readline ( ) . replace ( b"\r" , b"\n" ) else : arg_4 = arg_0 . gdb_process . stderr . read ( ) . replace ( b"\r" , b"\n" ) arg_3 += arg_0 . _get_responses_list ( arg_4 , "stderr" ) except IOError : pass if time . time ( ) > arg_2 : break return arg_3

def Func(arg_0, arg_1):
        """Get responses on windows. Assume no support for select and use a while loop."""
        arg_2 = time.time() + arg_1
        arg_3 = []
        while True:
            try:
                arg_0.gdb_process.stdout.flush()
                if PYTHON3:
                    arg_4 = arg_0.gdb_process.stdout.readline().replace(
                        b"\r", b"\n"
                    )
                else:
                    arg_4 = arg_0.gdb_process.stdout.read().replace(b"\r", b"\n")
                arg_3 += arg_0._get_responses_list(arg_4, "stdout")
            except IOError:
                pass

            try:
                arg_0.gdb_process.stderr.flush()
                if PYTHON3:
                    arg_4 = arg_0.gdb_process.stderr.readline().replace(
                        b"\r", b"\n"
                    )
                else:
                    arg_4 = arg_0.gdb_process.stderr.read().replace(b"\r", b"\n")
                arg_3 += arg_0._get_responses_list(arg_4, "stderr")
            except IOError:
                pass

            if time.time() > arg_2:
                break

        return arg_3

Get responses on windows . Assume no support for select and use a while loop .


def Func ( arg_0 , arg_1 , arg_2 = "utf-8" ) : arg_3 = arg_1 ( ) arg_3 . update ( arg_0 . encode ( arg_2 ) ) return arg_3 . hexdigest ( )

def Func(arg_0, arg_1, arg_2="utf-8"):  # pragma: no cover
    """
    Use default hash method to return hash value of a piece of string
    default setting use 'utf-8' encoding.
    """
    arg_3 = arg_1()
    arg_3.update(arg_0.encode(arg_2))
    return arg_3.hexdigest()

Use default hash method to return hash value of a piece of string default setting use utf - 8 encoding .


def Func(arg_0, arg_1, arg_2=0, arg_3=None):
    """Returns the highest indices in each string in a column, where the provided substring is fully contained between within a
    sample. If the substring is not found, -1 is returned. Same as `str.rfind`.

    :param str sub: A substring to be found in the samples
    :param int start:
    :param int end:
    :returns: an expression containing the highest indices specifying the start of the substring.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.rindex(sub="et")
    Expression = Func(text, sub='et')
    Length: 5 dtype: int64 (expression)
    -----------------------------------
    0   3
    1   7
    2  -1
    3  -1
    4  -1
    """
    return str_rfind(arg_0, arg_1, arg_2, arg_3)

Returns the highest indices in each string in a column, where the provided substring is fully contained between within a
    sample. If the substring is not found, -1 is returned. Same as `str.rfind`.

    :param str sub: A substring to be found in the samples
    :param int start:
    :param int end:
    :returns: an expression containing the highest indices specifying the start of the substring.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.rindex(sub="et")
    Expression = str_rindex(text, sub='et')
    Length: 5 dtype: int64 (expression)
    -----------------------------------
    0   3
    1   7
    2  -1
    3  -1
    4  -1

Returns the highest indices in each string in a column where the provided substring is fully contained between within a sample . If the substring is not found - 1 is returned . Same as str . rfind .


def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : arg_4 = { 'entropy' : lambda x , y : eval_entropy ( y ) - eval_entropy ( x ) , 'integral' : integral_approx_estimator } arg_5 = { 'gaussian' : lambda x : standard_scale . fit_transform ( x . reshape ( ( - 1 , 1 ) ) ) , 'uniform' : lambda x : min_max_scale . fit_transform ( x . reshape ( ( - 1 , 1 ) ) ) , 'None' : lambda x : x } arg_6 = arg_5 [ arg_3 . get ( 'refMeasure' , 'gaussian' ) ] arg_7 = arg_4 [ arg_3 . get ( 'estimator' , 'entropy' ) ] arg_1 = arg_6 ( arg_1 ) arg_2 = arg_6 ( arg_2 ) return arg_7 ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """Evaluate a pair using the IGCI model.

        :param a: Input variable 1D
        :param b: Input variable 1D
        :param kwargs: {refMeasure: Scaling method (gaussian, integral or None),
                        estimator: method used to evaluate the pairs (entropy or integral)}
        :return: Return value of the IGCI model >0 if a->b otherwise if return <0
        """
        arg_4 = {'entropy': lambda x, y: eval_entropy(y) - eval_entropy(x), 'integral': integral_approx_estimator}
        arg_5 = {'gaussian': lambda x: standard_scale.fit_transform(x.reshape((-1, 1))),
                        'uniform': lambda x: min_max_scale.fit_transform(x.reshape((-1, 1))), 'None': lambda x: x}

        arg_6 = arg_5[arg_3.get('refMeasure', 'gaussian')]
        arg_7 = arg_4[arg_3.get('estimator', 'entropy')]

        arg_1 = arg_6(arg_1)
        arg_2 = arg_6(arg_2)

        return arg_7(arg_1, arg_2)


def Func ( ) : arg_0 = get_options ( ) arg_1 = Dice ( arg_0 . sides ) arg_2 = [ arg_1 . roll ( ) for n in range ( arg_0 . number ) ] for arg_3 in arg_2 : print ( 'rolled' , arg_3 ) if arg_0 . number > 1 : print ( 'total' , sum ( arg_2 ) )

def Func():
	"""
	Roll n-sided dice and return each result and the total
	"""
	arg_0 = get_options()
	arg_1 = Dice(arg_0.sides)
	arg_2 = [arg_1.roll() for n in range(arg_0.number)]
	for arg_3 in arg_2:
		print('rolled', arg_3)
	if arg_0.number > 1:
		print('total', sum(arg_2))

Roll n - sided dice and return each result and the total


def
Func
(
arg_0
)
:
arg_1
=
""
for
arg_2
in
range
(
arg_0
.
sweeps
)
:
for
arg_3
in
arg_0
.
APs
[
arg_2
]
:
for
arg_4
in
sorted
(
arg_3
.
keys
(
)
)
:
if
arg_4
[
1
]
is
"I"
or
arg_4
[
2
:
]
in
[
"I1"
,
"I2"
]
:
continue
arg_1
+=
"%s = %s\n"
%
(
arg_4
,
arg_3
[
arg_4
]
)
return
arg_1

def Func(arg_0):
    """provide all stats on the first AP."""
    arg_1=""
    for arg_2 in range(arg_0.sweeps):
        for arg_3 in arg_0.APs[arg_2]:
            for arg_4 in sorted(arg_3.keys()):
                if arg_4[-1] is "I" or arg_4[-2:] in ["I1","I2"]:
                    continue
                arg_1+="%s = %s\n"%(arg_4,arg_3[arg_4])
            return arg_1


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
defaultdict
(
dict
)
arg_3
=
operator
.
methodcaller
(
'split'
,
' '
)
arg_4
=
{
arg_15
:
{
'env'
:
safe_path
,
'pre_requirements'
:
arg_3
,
}
,
'pip'
:
{
'allow_external'
:
arg_3
,
'allow_unverified'
:
arg_3
,
}
}
arg_5
=
copy
.
deepcopy
(
CONFIG
)
arg_6
=
set
(
iterkeys
(
arg_5
)
)
if
int
(
getattr
(
pip
,
'__version__'
,
'1.x'
)
.
split
(
'.'
)
[
0
]
)
<
6
:
arg_5
[
'pip'
]
[
'download_cache'
]
=
safe_path
(
os
.
path
.
expanduser
(
os
.
path
.
join
(
'~'
,
'.{0}'
.
format
(
arg_15
)
,
'pip-cache'
)
)
)
arg_7
=
arg_0
==
DEFAULT_CONFIG
arg_0
=
os
.
path
.
expandvars
(
os
.
path
.
expanduser
(
arg_0
)
)
if
not
arg_7
and
not
os
.
path
.
isfile
(
arg_0
)
:
print_error
(
'Config file does not exist at {0!r}'
.
format
(
arg_0
)
)
return
arg_8
=
ConfigParser
(
)
try
:
arg_8
.
read
(
arg_0
)
except
ConfigParserError
:
print_error
(
'Cannot parse config file at {0!r}'
.
format
(
arg_0
)
)
return
for
arg_9
in
arg_6
:
if
not
arg_8
.
has_section
(
arg_9
)
:
continue
arg_10
=
arg_8
.
items
(
arg_9
)
for
arg_11
,
arg_12
in
arg_10
:
try
:
arg_12
=
int
(
arg_12
)
except
(
TypeError
,
ValueError
)
:
try
:
arg_12
=
bool
(
strtobool
(
arg_12
)
)
except
ValueError
:
pass
if
arg_9
in
arg_4
and
arg_11
in
arg_4
[
arg_9
]
:
arg_12
=
arg_4
[
arg_9
]
[
arg_11
]
(
arg_12
)
arg_2
[
arg_9
]
[
arg_11
]
=
arg_12
for
arg_9
,
arg_13
in
iteritems
(
arg_5
)
:
if
arg_9
not
in
arg_2
:
arg_2
[
arg_9
]
=
arg_13
else
:
for
arg_11
,
arg_12
in
iteritems
(
arg_13
)
:
arg_2
[
arg_9
]
.
setdefault
(
arg_11
,
arg_12
)
arg_14
=
set
(
(
'env'
,
'hook'
,
'install_dev_requirements'
,
'ignore_activated'
,
'pre_requirements'
,
'quiet'
,
'recreate'
,
'requirements'
)
)
for
arg_11
in
arg_14
:
arg_12
=
getattr
(
arg_1
,
arg_11
)
arg_2
[
arg_15
]
.
setdefault
(
arg_11
,
arg_12
)
if
arg_11
==
'pre_requirements'
and
not
arg_12
:
continue
if
arg_12
is
not
:
arg_2
[
arg_15
]
[
arg_11
]
=
arg_12
return
arg_2

def Func(arg_0, arg_1):
    """
    Read and parse configuration file. By default, ``filename`` is relative
    path to current work directory.

    If no config file found, default ``CONFIG`` would be used.

    :param filename: Read config from given filename.
    :param args: Parsed command line arguments.
    """
    # Initial vars
    arg_2 = defaultdict(dict)
    arg_3 = operator.methodcaller('split', ' ')

    arg_4 = {
        arg_15: {
            'env': safe_path,
            'pre_requirements': arg_3,
        },
        'pip': {
            'allow_external': arg_3,
            'allow_unverified': arg_3,
        }
    }
    arg_5 = copy.deepcopy(CONFIG)
    arg_6 = set(iterkeys(arg_5))

    # Append download-cache for old pip versions
    if int(getattr(pip, '__version__', '1.x').split('.')[0]) < 6:
        arg_5['pip']['download_cache'] = safe_path(os.path.expanduser(
            os.path.join('~', '.{0}'.format(arg_15), 'pip-cache')
        ))

    # Expand user and environ vars in config filename
    arg_7 = arg_0 == DEFAULT_CONFIG
    arg_0 = os.path.expandvars(os.path.expanduser(arg_0))

    # Read config if it exists on disk
    if not arg_7 and not os.path.isfile(arg_0):
        print_error('Config file does not exist at {0!r}'.format(arg_0))
        return None

    arg_8 = ConfigParser()

    try:
        arg_8.read(arg_0)
    except ConfigParserError:
        print_error('Cannot parse config file at {0!r}'.format(arg_0))
        return None

    # Apply config for each possible section
    for arg_9 in arg_6:
        if not arg_8.has_section(arg_9):
            continue

        arg_10 = arg_8.items(arg_9)

        # Make auto convert here for integers and boolean values
        for arg_11, arg_12 in arg_10:
            try:
                arg_12 = int(arg_12)
            except (TypeError, ValueError):
                try:
                    arg_12 = bool(strtobool(arg_12))
                except ValueError:
                    pass

            if arg_9 in arg_4 and arg_11 in arg_4[arg_9]:
                arg_12 = arg_4[arg_9][arg_11](arg_12)

            arg_2[arg_9][arg_11] = arg_12

    # Update config with default values if necessary
    for arg_9, arg_13 in iteritems(arg_5):
        if arg_9 not in arg_2:
            arg_2[arg_9] = arg_13
        else:
            for arg_11, arg_12 in iteritems(arg_13):
                arg_2[arg_9].setdefault(arg_11, arg_12)

    # Update bootstrap config from parsed args
    arg_14 = set((
        'env', 'hook', 'install_dev_requirements', 'ignore_activated',
        'pre_requirements', 'quiet', 'recreate', 'requirements'
    ))

    for arg_11 in arg_14:
        arg_12 = getattr(arg_1, arg_11)
        arg_2[arg_15].setdefault(arg_11, arg_12)

        if arg_11 == 'pre_requirements' and not arg_12:
            continue

        if arg_12 is not None:
            arg_2[arg_15][arg_11] = arg_12

    return arg_2

Read and parse configuration file . By default filename is relative path to current work directory .


def Func(arg_0, arg_1):
        r"""Return term frequency.

        Parameters
        ----------
        term : str
            The term for which to calculate Func

        Returns
        -------
        float
            The term frequency (Func)

        Raises
        ------
        ValueError
            Func can only calculate the frequency of individual words

        Examples
        --------
        >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n'
        >>> tqbf += 'And then it slept.\n And the dog ran off.'
        >>> ngcorp = NGramCorpus(Corpus(tqbf))
        >>> NGramCorpus(Corpus(tqbf)).Func('the')
        1.3010299956639813
        >>> NGramCorpus(Corpus(tqbf)).Func('fox')
        1.0

        """
        if ' ' in arg_1:
            raise ValueError(
                'Func can only calculate the term frequency of individual words'
            )
        arg_2 = arg_0.get_count(arg_1)
        if arg_2 == 0:
            return 0.0
        return 1 + log10(arg_2)

r"""Return term frequency.

        Parameters
        ----------
        term : str
            The term for which to calculate tf

        Returns
        -------
        float
            The term frequency (tf)

        Raises
        ------
        ValueError
            tf can only calculate the frequency of individual words

        Examples
        --------
        >>> tqbf = 'The quick brown fox jumped over the lazy dog.\n'
        >>> tqbf += 'And then it slept.\n And the dog ran off.'
        >>> ngcorp = NGramCorpus(Corpus(tqbf))
        >>> NGramCorpus(Corpus(tqbf)).tf('the')
        1.3010299956639813
        >>> NGramCorpus(Corpus(tqbf)).tf('fox')
        1.0


def Func ( arg_0 ) : arg_1 = 0 while arg_1 < len ( arg_0 ) and arg_0 . seq [ arg_1 ] in 'nN' : arg_1 += 1 arg_0 . seq = arg_0 . seq [ arg_1 : ] arg_0 . qual = arg_0 . qual [ arg_1 : ] arg_0 . seq = arg_0 . seq . rstrip ( 'Nn' ) arg_0 . qual = arg_0 . qual [ : len ( arg_0 . seq ) ]

def Func(arg_0):
        '''Removes any leading or trailing N or n characters from the sequence'''
        # get index of first base that is not an N
        arg_1 = 0
        while arg_1 < len(arg_0) and arg_0.seq[arg_1] in 'nN':
            arg_1 += 1

        # strip off start of sequence and quality
        arg_0.seq = arg_0.seq[arg_1:]
        arg_0.qual = arg_0.qual[arg_1:]

        # strip the ends
        arg_0.seq = arg_0.seq.rstrip('Nn')
        arg_0.qual = arg_0.qual[:len(arg_0.seq)]


def Func(arg_0, arg_1=250, arg_2=15):
    """
    Simplified check for API limits

    If necessary, spin in place waiting for API to reset before returning.

    See: https://developer.github.com/v3/#rate-limiting
    """
    arg_3 = arg_0.rate_limit()

    arg_4 = arg_3['rate']['remaining']
    arg_5 = arg_3['rate']['reset']
    logger.debug('Rate Limit - %d requests remaining', arg_4)

    if arg_4 > arg_1:
        return

    arg_6 = time.time()
    arg_7 = int(arg_5 - arg_6)
    logger.warn('Rate Limit Depleted - Sleeping for %d seconds', arg_7)

    while arg_6 < arg_5:
        time.sleep(10)
        arg_6 = time.time()

    return


def Func(arg_0, arg_1):
        """Receive offer on SELECTING state."""
        logger.debug("C2. Received OFFER?, in SELECTING state.")
        if isoffer(arg_1):
            logger.debug("C2: T, OFFER received")
            arg_0.offers.append(arg_1)
            if len(arg_0.offers) >= MAX_OFFERS_COLLECTED:
                logger.debug("C2.5: T, raise REQUESTING.")
                arg_0.select_offer()
                raise arg_0.REQUESTING()
            logger.debug("C2.5: F, raise SELECTING.")
            raise arg_0.SELECTING()


def Func(arg_0):
    """
    Extracts xml from a zip or gzip file at the given path, file-like object,
    or bytes.

    Args:
        input_: A path to a file, a file like object, or bytes

    Returns:
        str: The extracted XML

    """
    if type(arg_0) == str:
        arg_1 = open(arg_0, "rb")
    elif type(arg_0) == bytes:
        arg_1 = BytesIO(arg_0)
    else:
        arg_1 = arg_0
    try:
        arg_2 = arg_1.read(6)
        arg_1.seek(0)
        if arg_2.startswith(MAGIC_ZIP):
            arg_3 = zipfile.ZipFile(arg_1)
            arg_4 = arg_3.open(arg_3.namelist()[0]).read().decode()
        elif arg_2.startswith(MAGIC_GZIP):
            arg_4 = GzipFile(fileobj=arg_1).read().decode()
        elif arg_2.startswith(MAGIC_XML):
            arg_4 = arg_1.read().decode()
        else:
            arg_1.close()
            raise InvalidAggregateReport("Not a valid zip, gzip, or xml file")

        arg_1.close()

    except UnicodeDecodeError:
        raise InvalidAggregateReport("File objects must be opened in binary "
                                     "(rb) mode")
    except Exception as error:
        raise InvalidAggregateReport(
            "Invalid archive file: {0}".format(error.__str__()))

    return arg_4

Extracts xml from a zip or gzip file at the given path file - like object or bytes .


(adapter, exon_lines, build='37', ensembl_genes=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'37'
,
arg_3
=
)
:
arg_3
=
arg_3
or
arg_0
.
ensembl_genes
(
arg_2
)
arg_4
=
arg_0
.
id_transcripts_by_gene
(
arg_2
=
arg_2
)
if
isinstance
(
arg_1
,
DataFrame
)
:
arg_5
=
parse_ensembl_exon_request
(
arg_1
)
arg_6
=
arg_1
.
shape
[
0
]
else
:
arg_5
=
parse_ensembl_exons
(
arg_1
)
arg_6
=
1000000
arg_7
=
datetime
.
now
(
)
arg_8
=
0
LOG
.
info
(
"Loading exons..."
)
with
progressbar
(
arg_5
,
label
=
"Loading exons"
,
length
=
arg_6
)
as
bar
:
for
arg_9
in
bar
:
arg_10
=
arg_9
[
'gene'
]
arg_11
=
arg_9
[
'transcript'
]
arg_12
=
arg_3
.
get
(
arg_10
)
if
not
arg_12
:
continue
arg_13
=
arg_12
[
'hgnc_id'
]
if
not
arg_11
in
arg_4
[
arg_13
]
:
continue
arg_9
[
'hgnc_id'
]
=
arg_13
arg_14
=
build_exon
(
arg_9
,
arg_2
)
arg_0
.
load_exon
(
arg_14
)
arg_8
+=
1
LOG
.
info
(
'Number of exons in build {0}: {1}'
.
format
(
arg_2
,
arg_6
)
)
LOG
.
info
(
'Number loaded: {0}'
.
format
(
arg_8
)
)
LOG
.
info
(
'Time to load exons: {0}'
.
format
(
datetime
.
now
(
)
arg_7
)
)

def Func(arg_0, arg_1, arg_2='37', arg_3=None):
    """Load all the exons

    Transcript information is from ensembl.
    Check that the transcript that the exon belongs to exists in the database

    Args:
        adapter(MongoAdapter)
        exon_lines(iterable): iterable with ensembl exon lines
        build(str)
        ensembl_transcripts(dict): Existing ensembl transcripts

    """
    # Fetch all genes with ensemblid as keys
    arg_3 = arg_3 or arg_0.ensembl_genes(arg_2)
    arg_4 = arg_0.id_transcripts_by_gene(arg_2=arg_2)

    if isinstance(arg_1, DataFrame):
        arg_5 = parse_ensembl_exon_request(arg_1)
        arg_6 = arg_1.shape[0]
    else:
        arg_5 = parse_ensembl_exons(arg_1)
        arg_6 = 1000000

    arg_7 = datetime.now()
    arg_8 = 0
    LOG.info("Loading exons...")
    with progressbar(arg_5, label="Loading exons", length=arg_6) as bar:
        for arg_9 in bar:
            arg_10 = arg_9['gene']
            arg_11 = arg_9['transcript']
            arg_12 = arg_3.get(arg_10)

            if not arg_12:
                continue

            arg_13 = arg_12['hgnc_id']

            if not arg_11 in arg_4[arg_13]:
                continue

            arg_9['hgnc_id'] = arg_13

            arg_14 = build_exon(arg_9, arg_2)
            arg_0.load_exon(arg_14)
            arg_8 += 1

    LOG.info('Number of exons in build {0}: {1}'.format(arg_2, arg_6))
    LOG.info('Number loaded: {0}'.format(arg_8))
    LOG.info('Time to load exons: {0}'.format(datetime.now() - arg_7))

Load all the exons Transcript information is from ensembl . Check that the transcript that the exon belongs to exists in the database


(self, save_pos=False, total_emission=True,
                           radial=False, rs=None, seed=1, path='./',
                           wrap_func=wrap_periodic,
                           chunksize=2**19, chunkslice='times', verbose=True)

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
True
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
1
,
arg_6
=
'./'
,
arg_7
=
arg_8
,
arg_9
=
2
**
19
,
arg_10
=
'times'
,
arg_11
=
True
)
:
if
arg_4
is
:
arg_4
=
np
.
random
.
RandomState
(
arg_5
=
arg_5
)
arg_0
.
open_store_traj
(
arg_9
=
arg_9
,
arg_10
=
arg_10
,
arg_3
=
arg_3
,
arg_6
=
arg_6
)
arg_0
.
traj_group
.
_v_attrs
[
'init_random_state'
]
=
arg_4
.
get_state
(
)
arg_14
=
arg_0
.
emission_tot
if
arg_2
else
arg_0
.
emission
print
(
'- Start trajectories simulation - %s'
%
ctime
(
)
,
flush
=
True
)
if
arg_11
:
print
(
'[PID %d] Diffusion time:'
%
os
.
getpid
(
)
,
end
=
''
)
arg_15
=
0
arg_16
=
arg_0
.
emission
.
chunkshape
[
1
]
arg_17
=
arg_16
*
arg_0
.
t_step
arg_18
=
arg_0
.
particles
.
positions
arg_19
=
0
for
arg_20
in
iter_chunksize
(
arg_0
.
n_samples
,
arg_16
)
:
if
arg_11
:
arg_21
=
int
(
arg_17
*
(
arg_15
+
1
)
)
if
arg_21
>
arg_19
:
print
(
' %ds'
%
arg_21
,
end
=
''
,
flush
=
True
)
arg_19
=
arg_21
arg_22
,
arg_23
=
arg_0
.
_sim_trajectories
(
arg_20
,
arg_18
,
arg_4
,
arg_2
=
arg_2
,
arg_1
=
arg_1
,
arg_3
=
arg_3
,
arg_7
=
arg_7
)
arg_14
.
append
(
arg_23
)
if
arg_1
:
arg_0
.
position
.
append
(
np
.
vstack
(
arg_22
)
.
astype
(
'float32'
)
)
arg_15
+=
1
arg_0
.
store
.
h5file
.
flush
(
)
arg_0
.
traj_group
.
_v_attrs
[
'last_random_state'
]
=
arg_4
.
get_state
(
)
arg_0
.
store
.
h5file
.
flush
(
)
print
(
'\n- End trajectories simulation - %s'
%
ctime
(
)
,
flush
=
True
)

def Func(arg_0, arg_1=False, arg_2=True,
                           arg_3=False, arg_4=None, arg_5=1, arg_6='./',
                           arg_7=arg_8,
                           arg_9=2**19, arg_10='times', arg_11=True):
        """Simulate Brownian motion trajectories and emission rates.

        This method performs the Brownian motion simulation using the current
        set of parameters. Before running this method you can check the
        disk-space requirements using :method:`print_sizes`.

        Results are stored to disk in HDF5 format and are accessible in
        in `self.emission`, `self.emission_tot` and `self.position` as
        pytables arrays.

        Arguments:
            save_pos (bool): if True, save the particles 3D trajectories
            total_emission (bool): if True, store only the total emission array
                containing the sum of emission of all the particles.
            rs (RandomState object): random state object used as random number
                generator. If None, use a random state initialized from seed.
            seed (uint): when `rs` is None, `seed` is used to initialize the
                random state, otherwise is ignored.
            wrap_func (function): the function used to apply the boundary
                condition (use :func:`wrap_periodic` or :func:`wrap_mirror`).
            path (string): a folder where simulation data is saved.
            verbose (bool): if False, prints no output.
        """
        if arg_4 is None:
            arg_4 = np.random.RandomState(arg_5=arg_5)
        arg_0.open_store_traj(arg_9=arg_9, arg_10=arg_10,
                             arg_3=arg_3, arg_6=arg_6)
        # Save current random state for reproducibility
        arg_0.traj_group._v_attrs['init_random_state'] = arg_4.get_state()

        arg_14 = arg_0.emission_tot if arg_2 else arg_0.emission

        print('- Start trajectories simulation - %s' % ctime(), flush=True)
        if arg_11:
            print('[PID %d] Diffusion time:' % os.getpid(), end='')
        arg_15 = 0
        arg_16 = arg_0.emission.chunkshape[1]
        arg_17 = arg_16 * arg_0.t_step

        arg_18 = arg_0.particles.positions
        arg_19 = 0
        for arg_20 in iter_chunksize(arg_0.n_samples, arg_16):
            if arg_11:
                arg_21 = int(arg_17 * (arg_15 + 1))
                if arg_21 > arg_19:
                    print(' %ds' % arg_21, end='', flush=True)
                    arg_19 = arg_21

            arg_22, arg_23 = arg_0._sim_trajectories(arg_20, arg_18, arg_4,
                                             arg_2=arg_2,
                                             arg_1=arg_1, arg_3=arg_3,
                                             arg_7=arg_7)

            ## Append em to the permanent storage
            # if total_emission, data is just a linear array
            # otherwise is a 2-D array (self.num_particles, c_size)
            arg_14.append(arg_23)
            if arg_1:
                arg_0.position.append(np.vstack(arg_22).astype('float32'))
            arg_15 += 1
            arg_0.store.h5file.flush()

        # Save current random state
        arg_0.traj_group._v_attrs['last_random_state'] = arg_4.get_state()
        arg_0.store.h5file.flush()
        print('\n- End trajectories simulation - %s' % ctime(), flush=True)

Simulate Brownian motion trajectories and emission rates .


(self, idents, parent, raw_msg, success=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=True):
        """handle a real task result, either success or failure"""
        # first, relay result to client
        arg_5 = arg_1[0]
        arg_6 = arg_1[1]
        # swap_ids for ROUTER-ROUTER mirror
        arg_3[:2] = [arg_6,arg_5]
        # print (map(str, raw_msg[:4]))
        arg_0.client_stream.send_multipart(arg_3, copy=False)
        # now, update our data structures
        arg_7 = arg_2['msg_id']
        arg_0.pending[arg_5].pop(arg_7)
        if arg_4:
            arg_0.completed[arg_5].add(arg_7)
            arg_0.all_completed.add(arg_7)
        else:
            arg_0.failed[arg_5].add(arg_7)
            arg_0.all_failed.add(arg_7)
        arg_0.all_done.add(arg_7)
        arg_0.destinations[arg_7] = arg_5

        arg_0.update_graph(arg_7, arg_4)

handle a real task result either success or failure


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = json . JSONEncoder ( ) . encode ( arg_0 . json ( ) ) if arg_2 : json . dump ( json . loads ( arg_3 ) , arg_1 , sort_keys = True , indent = 4 ) else : json . dump ( json . loads ( arg_3 ) , arg_1 ) return

def Func(arg_0, arg_1, arg_2=True):
        """
        Write composite object to file handle in JSON format.

        Args:
            fh (file): File handle to write to.
            pretty (bool): Sort keys and indent in output.
        """
        arg_3 = json.JSONEncoder().encode(arg_0.json())
        if arg_2:
            json.dump(json.loads(arg_3), arg_1, sort_keys=True, indent=4)
        else:
            json.dump(json.loads(arg_3), arg_1)
        return

Write composite object to file handle in JSON format .


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
get
(
'<model>'
)
if
not
arg_1
:
logger
.
warning
(
'Model name cannot be empty.'
)
return
logger
.
info
(
'Start generating model.'
)
arg_2
=
os
.
path
.
join
(
dirname
(
abspath
(
__file__
)
)
,
'templates/model.py'
)
arg_3
=
os
.
getcwd
(
)
with
open
(
arg_2
,
'r'
)
as
template_file
:
arg_4
=
os
.
path
.
join
(
arg_3
,
'application/models'
,
arg_1
+
'.py'
)
with
open
(
arg_4
,
'w+'
)
as
model_file
:
for
arg_5
in
template_file
:
arg_6
=
arg_5
.
replace
(
'#{model|title}'
,
arg_1
.
title
(
)
)
model_file
.
write
(
arg_6
)
logger
.
info
(
"New: %s"
%
_relative_path
(
arg_4
)
)
with
open
(
os
.
path
.
join
(
arg_3
,
'application/models/__init__.py'
)
,
'a'
)
as
package_file
:
package_file
.
write
(
'\nfrom .%s import *'
%
arg_1
)
logger
.
info
(
'Finish generating model.'
)

def Func(arg_0):
    """Generate model."""
    arg_1 = arg_0.get('<model>')
    if not arg_1:
        logger.warning('Model name cannot be empty.')
        return

    logger.info('Start generating model.')

    arg_2 = os.path.join(dirname(abspath(__file__)), 'templates/model.py')
    arg_3 = os.getcwd()

    with open(arg_2, 'r') as template_file:
        arg_4 = os.path.join(arg_3, 'application/models',
                                       arg_1 + '.py')
        with open(arg_4, 'w+') as model_file:
            for arg_5 in template_file:
                arg_6 = arg_5.replace('#{model|title}', arg_1.title())
                model_file.write(arg_6)
    logger.info("New: %s" % _relative_path(arg_4))

    with open(os.path.join(arg_3, 'application/models/__init__.py'), 'a') as package_file:
        package_file.write('\nfrom .%s import *' % arg_1)

    logger.info('Finish generating model.')


(y, sr=22050, max_points=5e4, x_axis='time', offset=0.0,
             max_sr=1000, ax=None, **kwargs)

def
Func
(
arg_0
,
arg_1
=
22050
,
arg_2
=
5e4
,
arg_3
=
'time'
,
arg_4
=
0.0
,
arg_5
=
1000
,
arg_6
=
,
**
arg_7
)
:
util
.
valid_audio
(
arg_0
,
mono
=
False
)
if
not
(
isinstance
(
arg_5
,
int
)
and
arg_5
>
0
)
:
raise
ParameterError
(
'max_sr must be a non-negative integer'
)
arg_8
=
arg_1
arg_9
=
1
if
arg_2
is
not
:
if
arg_2
<=
0
:
raise
ParameterError
(
'max_points must be strictly positive'
)
if
arg_2
<
arg_0
.
shape
[
1
]
:
arg_8
=
min
(
arg_5
,
(
arg_1
*
arg_0
.
shape
[
1
]
)
//
arg_2
)
arg_9
=
arg_1
//
arg_8
if
arg_0
.
ndim
==
1
:
arg_0
=
__envelope
(
arg_0
,
arg_9
)
else
:
arg_0
=
np
.
vstack
(
[
__envelope
(
_
,
arg_9
)
for
_
in
arg_0
]
)
if
arg_0
.
ndim
>
1
:
arg_10
=
arg_0
[
0
]
arg_11
=
arg_0
[
1
]
else
:
arg_10
=
arg_0
arg_11
=
arg_0
arg_12
=
__check_axes
(
arg_6
)
arg_7
.
setdefault
(
'color'
,
next
(
arg_12
.
_get_lines
.
prop_cycler
)
[
'color'
]
)
arg_13
=
arg_4
+
core
.
frames_to_time
(
np
.
arange
(
len
(
arg_10
)
)
,
arg_1
=
arg_1
,
arg_9
=
arg_9
)
arg_14
=
arg_12
.
fill_between
(
arg_13
,
arg_11
,
arg_10
,
**
arg_7
)
arg_12
.
set_xlim
(
[
arg_13
.
min
(
)
,
arg_13
.
max
(
)
]
)
if
arg_3
==
'time'
:
arg_12
.
xaxis
.
set_major_formatter
(
TimeFormatter
(
lag
=
False
)
)
arg_12
.
xaxis
.
set_label_text
(
'Time'
)
elif
arg_3
is
or
arg_3
in
[
'off'
,
'none'
]
:
arg_12
.
set_xticks
(
[
]
)
else
:
raise
ParameterError
(
'Unknown x_axis value: {}'
.
format
(
arg_3
)
)
return
arg_14

def Func(arg_0, arg_1=22050, arg_2=5e4, arg_3='time', arg_4=0.0,
             arg_5=1000, arg_6=None, **arg_7):
    '''Plot the amplitude envelope of a waveform.

    If `y` is monophonic, a filled curve is drawn between `[-abs(y), abs(y)]`.

    If `y` is stereo, the curve is drawn between `[-abs(y[1]), abs(y[0])]`,
    so that the left and right channels are drawn above and below the axis,
    respectively.

    Long signals (`duration >= max_points`) are down-sampled to at
    most `max_sr` before plotting.

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

    sr : number > 0 [scalar]
        sampling rate of `y`

    max_points : postive number or None
        Maximum number of time-points to plot: if `max_points` exceeds
        the duration of `y`, then `y` is downsampled.

        If `None`, no downsampling is performed.

    x_axis : str {'time', 'off', 'none'} or None
        If 'time', the x-axis is given time tick-marks.

    ax : matplotlib.axes.Axes or None
        Axes to plot on instead of the default `plt.gca()`.

    offset : float
        Horizontal offset (in seconds) to start the waveform plot

    max_sr : number > 0 [scalar]
        Maximum sampling rate for the visualization

    kwargs
        Additional keyword arguments to `matplotlib.pyplot.fill_between`

    Returns
    -------
    pc : matplotlib.collections.PolyCollection
        The PolyCollection created by `fill_between`.

    See also
    --------
    librosa.core.resample
    matplotlib.pyplot.fill_between

    Examples
    --------
    Plot a monophonic waveform

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=10)
    >>> plt.figure()
    >>> plt.subplot(3, 1, 1)
    >>> librosa.display.Func(y, sr=sr)
    >>> plt.title('Monophonic')

    Or a stereo waveform

    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      mono=False, duration=10)
    >>> plt.subplot(3, 1, 2)
    >>> librosa.display.Func(y, sr=sr)
    >>> plt.title('Stereo')

    Or harmonic and percussive components with transparency

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=10)
    >>> y_harm, y_perc = librosa.effects.hpss(y)
    >>> plt.subplot(3, 1, 3)
    >>> librosa.display.Func(y_harm, sr=sr, alpha=0.25)
    >>> librosa.display.Func(y_perc, sr=sr, color='r', alpha=0.5)
    >>> plt.title('Harmonic + Percussive')
    >>> plt.tight_layout()
    '''

    util.valid_audio(arg_0, mono=False)

    if not (isinstance(arg_5, int) and arg_5 > 0):
        raise ParameterError('max_sr must be a non-negative integer')

    arg_8 = arg_1
    arg_9 = 1

    if arg_2 is not None:
        if arg_2 <= 0:
            raise ParameterError('max_points must be strictly positive')

        if arg_2 < arg_0.shape[-1]:
            arg_8 = min(arg_5, (arg_1 * arg_0.shape[-1]) // arg_2)

        arg_9 = arg_1 // arg_8

        if arg_0.ndim == 1:
            arg_0 = __envelope(arg_0, arg_9)
        else:
            arg_0 = np.vstack([__envelope(_, arg_9) for _ in arg_0])

    if arg_0.ndim > 1:
        arg_10 = arg_0[0]
        arg_11 = -arg_0[1]
    else:
        arg_10 = arg_0
        arg_11 = -arg_0

    arg_12 = __check_axes(arg_6)

    arg_7.setdefault('color', next(arg_12._get_lines.prop_cycler)['color'])

    arg_13 = arg_4 + core.frames_to_time(np.arange(len(arg_10)),
                                        arg_1=arg_1,
                                        arg_9=arg_9)

    arg_14 = arg_12.fill_between(arg_13, arg_11, arg_10, **arg_7)

    arg_12.set_xlim([arg_13.min(), arg_13.max()])
    if arg_3 == 'time':
        arg_12.xaxis.set_major_formatter(TimeFormatter(lag=False))
        arg_12.xaxis.set_label_text('Time')
    elif arg_3 is None or arg_3 in ['off', 'none']:
        arg_12.set_xticks([])
    else:
        raise ParameterError('Unknown x_axis value: {}'.format(arg_3))

    return arg_14

Plot the amplitude envelope of a waveform.

    If `y` is monophonic, a filled curve is drawn between `[-abs(y), abs(y)]`.

    If `y` is stereo, the curve is drawn between `[-abs(y[1]), abs(y[0])]`,
    so that the left and right channels are drawn above and below the axis,
    respectively.

    Long signals (`duration >= max_points`) are down-sampled to at
    most `max_sr` before plotting.

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

    sr : number > 0 [scalar]
        sampling rate of `y`

    max_points : postive number or None
        Maximum number of time-points to plot: if `max_points` exceeds
        the duration of `y`, then `y` is downsampled.

        If `None`, no downsampling is performed.

    x_axis : str {'time', 'off', 'none'} or None
        If 'time', the x-axis is given time tick-marks.

    ax : matplotlib.axes.Axes or None
        Axes to plot on instead of the default `plt.gca()`.

    offset : float
        Horizontal offset (in seconds) to start the waveform plot

    max_sr : number > 0 [scalar]
        Maximum sampling rate for the visualization

    kwargs
        Additional keyword arguments to `matplotlib.pyplot.fill_between`

    Returns
    -------
    pc : matplotlib.collections.PolyCollection
        The PolyCollection created by `fill_between`.

    See also
    --------
    librosa.core.resample
    matplotlib.pyplot.fill_between

    Examples
    --------
    Plot a monophonic waveform

    >>> import matplotlib.pyplot as plt
    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=10)
    >>> plt.figure()
    >>> plt.subplot(3, 1, 1)
    >>> librosa.display.waveplot(y, sr=sr)
    >>> plt.title('Monophonic')

    Or a stereo waveform

    >>> y, sr = librosa.load(librosa.util.example_audio_file(),
    ...                      mono=False, duration=10)
    >>> plt.subplot(3, 1, 2)
    >>> librosa.display.waveplot(y, sr=sr)
    >>> plt.title('Stereo')

    Or harmonic and percussive components with transparency

    >>> y, sr = librosa.load(librosa.util.example_audio_file(), duration=10)
    >>> y_harm, y_perc = librosa.effects.hpss(y)
    >>> plt.subplot(3, 1, 3)
    >>> librosa.display.waveplot(y_harm, sr=sr, alpha=0.25)
    >>> librosa.display.waveplot(y_perc, sr=sr, color='r', alpha=0.5)
    >>> plt.title('Harmonic + Percussive')
    >>> plt.tight_layout()

Plot the amplitude envelope of a waveform .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . multiline . get ( arg_1 ) if arg_2 : Func = arg_2 [ 0 ] else : Func = arg_1 return Func

def Func(arg_0, arg_1):
        """Return the first line number of the statement including `line`."""
        arg_2 = arg_0.multiline.get(arg_1)
        if arg_2:
            Func = arg_2[0]
        else:
            Func = arg_1
        return Func

Return the first line number of the statement including line .


return style.get('%sval' % w_namespace) == 'Title'

def Func ( arg_0 ) : arg_1 = get_namespace ( arg_0 , 'w' ) arg_2 = arg_0 . xpath ( './/w:pStyle' , namespaces = arg_0 . nsmap ) if len ( arg_2 ) == 0 : return False arg_3 = arg_2 [ 0 ] return arg_3 . get ( '%sval' % arg_1 ) == 'Title'

def Func(arg_0):
    """
    Certain p tags are denoted as ``Title`` tags. This function will return
    True if the passed in p tag is considered a title.
    """
    arg_1 = get_namespace(arg_0, 'w')
    arg_2 = arg_0.xpath('.//w:pStyle', namespaces=arg_0.nsmap)
    if len(arg_2) == 0:
        return False
    arg_3 = arg_2[0]
    return arg_3.get('%sval' % arg_1) == 'Title'

Certain p tags are denoted as Title tags . This function will return True if the passed in p tag is considered a title .


(pred, true_value, false_value, name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None ) : with tf . name_scope ( arg_3 or "Func" ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , dtype_hint = tf . bool , arg_3 = "pred" ) arg_1 = tf . convert_to_tensor ( value = arg_1 , arg_3 = "true_value" ) arg_2 = tf . convert_to_tensor ( value = arg_2 , arg_3 = "false_value" ) arg_4 = tf . get_static_value ( arg_0 ) if arg_4 is None : return tf . where ( arg_0 , arg_1 , arg_2 ) return arg_1 if arg_4 else arg_2

def Func(arg_0, arg_1, arg_2, arg_3=None):
  """Convenience function that chooses one of two values based on the predicate.

  This utility is equivalent to a version of `tf.where` that accepts only a
  scalar predicate and computes its result statically when possible. It may also
  be used in place of `tf.cond` when both branches yield a `Tensor` of the same
  shape; the operational difference is that `tf.cond` uses control flow to
  evaluate only the branch that's needed, while `tf.where` (and thus
  this method) may evaluate both branches before the predicate's truth is known.
  This means that `tf.cond` is preferred when one of the branches is expensive
  to evaluate (like performing a large matmul), while this method is preferred
  when both branches are cheap, e.g., constants. In the latter case, we expect
  this method to be substantially faster than `tf.cond` on GPU and to give
  similar performance on CPU.

  Args:
    pred: Scalar `bool` `Tensor` predicate.
    true_value: `Tensor` to return if `pred` is `True`.
    false_value: `Tensor` to return if `pred` is `False`. Must have the same
      shape as `true_value`.
    name: Python `str` name given to ops managed by this object.

  Returns:
    result: a `Tensor` (or `Tensor`-convertible Python value) equal to
      `true_value` if `pred` evaluates to `True` and `false_value` otherwise.
      If the condition can be evaluated statically, the result returned is one
      of the input Python values, with no graph side effects.
  """
  with tf.name_scope(arg_3 or "Func"):
    arg_0 = tf.convert_to_tensor(
        value=arg_0, dtype_hint=tf.bool, arg_3="pred")
    arg_1 = tf.convert_to_tensor(value=arg_1, arg_3="true_value")
    arg_2 = tf.convert_to_tensor(value=arg_2, arg_3="false_value")
    arg_4 = tf.get_static_value(arg_0)
    if arg_4 is None:
      return tf.where(arg_0, arg_1, arg_2)
    return arg_1 if arg_4 else arg_2

Convenience function that chooses one of two values based on the predicate .


def Func(arg_0, arg_1):
        "Remove the item from the list and unset the related data"
        arg_2 = arg_0.GetItemData(arg_1)
        arg_3 = arg_0._py_data_map[arg_2]
        del arg_0._py_data_map[arg_2]
        del arg_0._wx_data_map[arg_3]
        wx.ListCtrl.Func(arg_0, arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = [ arg_0 . __getattribute__ ( p ) for p in arg_0 . _portnames if arg_1 . startswith ( p ) and arg_1 != p and hasattr ( arg_0 , p ) and arg_0 . __getattribute__ ( p ) . is_multiplex ] for arg_3 in arg_2 : return arg_3 return None

def Func(arg_0,arg_1):
        """
        Given a name, figure out if a multiplex port prefixes this name and return it.  Otherwise return none.
        """

        # short circuit:  if the attribute name already exists return none
        # if name in self._portnames: return None
        # if not len([p for p in self._portnames if name.startswith(p) and name != p]): return None

        arg_2 = [arg_0.__getattribute__(p) for p in arg_0._portnames
            if arg_1.startswith(p)
            and arg_1 != p
            and hasattr(arg_0, p)
            and arg_0.__getattribute__(p).is_multiplex
        ]

        for arg_3 in arg_2:
            return arg_3

        return None

Given a name figure out if a multiplex port prefixes this name and return it . Otherwise return none .


def Func ( arg_0 ) : arg_0 = color ( arg_0 ) arg_1 = colorlist ( arg_0 ) arg_2 = arg_0 . copy ( ) if arg_0 . brightness > 0.4 : arg_2 . brightness = 0.1 + arg_2 . brightness * 0.25 else : arg_2 . brightness = 1.0 - arg_2 . brightness * 0.25 arg_1 . append ( arg_2 ) arg_2 = arg_0 . copy ( ) arg_2 . brightness = 0.3 + arg_2 . brightness arg_2 . saturation = 0.1 + arg_2 . saturation * 0.3 arg_1 . append ( arg_2 ) arg_0 = arg_0 . complement arg_2 = arg_0 . copy ( ) if arg_0 . brightness > 0.3 : arg_2 . brightness = 0.1 + arg_0 . brightness * 0.25 else : arg_2 . brightness = 1.0 - arg_2 . brightness * 0.25 arg_1 . append ( arg_2 ) arg_1 . append ( arg_0 ) arg_2 = arg_0 . copy ( ) arg_2 . brightness = 0.3 + arg_2 . brightness arg_2 . saturation = 0.1 + arg_2 . saturation * 0.25 arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
    """
    Returns a list of Func colors.

    The complement is the color 180 degrees across
    the artistic RYB color wheel.
    The list contains darker and softer contrasting
    and complementing colors.
    """
    arg_0 = color(arg_0)
    arg_1 = colorlist(arg_0)

    # A contrasting color: much darker or lighter than the original.
    arg_2 = arg_0.copy()
    if arg_0.brightness > 0.4:
        arg_2.brightness = 0.1 + arg_2.brightness * 0.25
    else:
        arg_2.brightness = 1.0 - arg_2.brightness * 0.25
    arg_1.append(arg_2)

    # A soft supporting color: lighter and less saturated.
    arg_2 = arg_0.copy()
    arg_2.brightness = 0.3 + arg_2.brightness
    arg_2.saturation = 0.1 + arg_2.saturation * 0.3
    arg_1.append(arg_2)

    # A contrasting complement: very dark or very light.
    arg_0 = arg_0.complement
    arg_2 = arg_0.copy()
    if arg_0.brightness > 0.3:
        arg_2.brightness = 0.1 + arg_0.brightness * 0.25
    else:
        arg_2.brightness = 1.0 - arg_2.brightness * 0.25
    arg_1.append(arg_2)

    # The complement and a light supporting variant.
    arg_1.append(arg_0)

    arg_2 = arg_0.copy()
    arg_2.brightness = 0.3 + arg_2.brightness
    arg_2.saturation = 0.1 + arg_2.saturation * 0.25
    arg_1.append(arg_2)

    return arg_1

Returns a list of complementary colors.

    The complement is the color 180 degrees across
    the artistic RYB color wheel.
    The list contains darker and softer contrasting
    and complementing colors.

Returns a list of complementary colors .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . obj [ 'file_previews' ] arg_5 = arg_4 . Func ( arg_1 ) click . echo ( arg_5 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    """
    Retreive preview results for ID.
    """
    arg_4 = arg_0.obj['file_previews']
    arg_5 = arg_4.Func(arg_1)

    click.echo(arg_5)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_0
.
infer_node
.
scope_node
.
get_by_symbol_name
(
arg_1
)
if
len
(
arg_3
)
>
0
:
arg_0
.
infer_node
.
scope_node
.
update
(
arg_3
)
else
:
arg_2
.
notify
(
Severity
.
ERROR
,
"%s never declared"
%
arg_0
.
value
,
arg_0
.
info
)

def Func(arg_0, arg_1, arg_2=None):
        """
        Infer type from an ID!
        - check if ID is declarated in the scope
        - if no ID is polymorphic type
        """
        # check if ID is declared
        #defined = self.type_node.get_by_symbol_name(ident)
        arg_3 = arg_0.infer_node.scope_node.get_by_symbol_name(arg_1)
        if len(arg_3) > 0:
            # set from matchings declarations
            #self.type_node.update(defined)
            arg_0.infer_node.scope_node.update(arg_3)
        else:
            arg_2.notify(
                Severity.ERROR,
                "%s never declared" % arg_0.value,
                arg_0.info
            )


def Func ( arg_0 , arg_1 = ( arg_2 . platform == 'win32' ) ) : if arg_1 : if arg_0 . startswith ( ( "'" , '"' ) ) and arg_0 . endswith ( ( "'" , '"' ) ) : arg_0 = arg_0 [ 1 : - 1 ] return arg_0

def Func(arg_0, arg_1=(arg_2.platform=='win32')):
    """ On Windows, remove leading and trailing quotes from filenames.
    """
    if arg_1:
        if arg_0.startswith(("'", '"')) and arg_0.endswith(("'", '"')):
            arg_0 = arg_0[1:-1]
    return arg_0

On Windows remove leading and trailing quotes from filenames .


def Func(arg_0, arg_1, arg_2):
    r"""approximate corrected Kullback information

    .. math:: Func(k) = log(rho_k) + \frac{p}{N*(N-k)} + (3-\frac{k+2}{N})*\frac{k+1}{N-k-2}

    """
    from numpy import log, array
    arg_3 = arg_2
    arg_4 = log(arg_1) + arg_3/arg_0/(arg_0-arg_3) + (3.-(arg_3+2.)/arg_0) * (arg_3+1.) / (arg_0-arg_3-2.)
    return arg_4

r"""approximate corrected Kullback information

    .. math:: AKICc(k) = log(rho_k) + \frac{p}{N*(N-k)} + (3-\frac{k+2}{N})*\frac{k+1}{N-k-2}

r approximate corrected Kullback information


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_1
:
raise
ChangelogGeneratorError
(
"tag is nil"
)
arg_2
=
arg_1
[
"name"
]
arg_3
=
arg_0
.
tag_times_dict
.
get
(
arg_2
,
)
if
arg_3
:
return
arg_3
else
:
arg_4
=
arg_0
.
fetcher
.
fetch_date_of_tag
(
arg_1
)
try
:
arg_0
.
tag_times_dict
[
arg_2
]
=
timestring_to_datetime
(
arg_4
)
except
UnicodeWarning
:
print
(
"ERROR ERROR:"
,
arg_1
)
arg_0
.
tag_times_dict
[
arg_2
]
=
timestring_to_datetime
(
arg_4
)
return
arg_0
.
tag_times_dict
[
arg_2
]

def Func(arg_0, arg_1):
        """
        Get date and time for tag, fetching it if not already cached.

        :param dict tag: Tag to get the datetime for.
        :rtype: datetime
        :return: datetime for specified tag.
        """

        if not arg_1:
            raise ChangelogGeneratorError("tag is nil")

        arg_2 = arg_1["name"]
        arg_3 = arg_0.tag_times_dict.get(arg_2, None)
        if arg_3:
            return arg_3
        else:
            arg_4 = arg_0.fetcher.fetch_date_of_tag(arg_1)
            try:
                arg_0.tag_times_dict[arg_2] = \
                    timestring_to_datetime(arg_4)
            except UnicodeWarning:
                print("ERROR ERROR:", arg_1)
                arg_0.tag_times_dict[arg_2] = \
                    timestring_to_datetime(arg_4)
            return arg_0.tag_times_dict[arg_2]

Get date and time for tag fetching it if not already cached .


def
Func
(
)
:
arg_0
=
DocMapper
(
)
if
arg_0
.
is_pipe
:
arg_1
=
[
arg_4
for
arg_4
in
arg_0
.
get_pipe
(
)
]
arg_2
=
modify_data
(
arg_1
)
for
arg_3
in
arg_2
:
arg_4
=
arg_0
.
line_to_object
(
arg_3
)
arg_4
.
save
(
)
print_success
(
"Object(s) successfully changed"
)
else
:
print_error
(
"Please use this tool with pipes"
)

def Func():
    """
        This functions gives the user a way to change the data that is given as input.
    """
    arg_0 = DocMapper()
    if arg_0.is_pipe:
        arg_1 = [arg_4 for arg_4 in arg_0.get_pipe()]
        arg_2 = modify_data(arg_1)
        for arg_3 in arg_2:
            arg_4 = arg_0.line_to_object(arg_3)
            arg_4.save()
        print_success("Object(s) successfully changed")
    else:
        print_error("Please use this tool with pipes")

This functions gives the user a way to change the data that is given as input .


def Func(arg_0):
    """Add logging option to an ArgumentParser."""
    arg_0.register("action", "log_levels", LogLevelAction)
    arg_0.register("action", "log_files", LogFileAction)
    arg_0.register("action", "log_help", LogHelpAction)

    arg_1 = arg_0.add_argument_group("Logging options")
    arg_1.add_argument(
        "-l", "--log-level", dest="log_levels",
        action="log_levels", metavar="LOGGER:LEVEL", default=[],
        help="Set log levels for individual loggers. See --help-logging for "
             "complete details.")

    arg_1.add_argument(
        "-L", "--log-file", dest="log_files",
        action="log_files", metavar="LOGGER:FILE", default=[],
        help="Set log the output file for individual loggers. "
             " See --help-logging for complete details.")

    arg_1.add_argument("--help-logging", action="log_help",
                       help=argparse.SUPPRESS)

Add logging option to an ArgumentParser .


def Func ( arg_0 , arg_1 = None ) : arg_2 = Popen ( arg_0 , stdout = PIPE , stderr = PIPE ) arg_3 , arg_4 = arg_2 . communicate ( ) if arg_2 . returncode : raise DistutilsExecError ( arg_4 )

def Func(arg_0, arg_1=None):
    """Spawn a process, and eat the stdio."""
    arg_2 = Popen(arg_0, stdout=PIPE, stderr=PIPE)
    arg_3, arg_4 = arg_2.communicate()
    if arg_2.returncode:
        raise DistutilsExecError(arg_4)


def Func ( arg_0 , arg_1 ) : try : arg_2 = arg_0 . exon_collection . insert_many ( transcript_objs ) except ( DuplicateKeyError , BulkWriteError ) as err : raise IntegrityError ( err ) return arg_2

def Func(arg_0, arg_1):
        """Load a bulk of exon objects to the database

        Arguments:
            exon_objs(iterable(scout.models.hgnc_exon))

        """
        try:
            arg_2 = arg_0.exon_collection.insert_many(transcript_objs)
        except (DuplicateKeyError, BulkWriteError) as err:
            raise IntegrityError(err)

        return arg_2


def Func(arg_0):
    """
    Validate a list of size keys.

    `sizes`: An iterable of 2-tuples, both strings. Example:
    [
        ('large', 'url'),
        ('medium', 'crop__400x400'),
        ('small', 'thumbnail__100x100')
    ]
    """
    try:
        for arg_1, arg_2 in arg_0:
            arg_3 = arg_2.split('__')
            if arg_3[-1] != 'url' and (
                'x' not in arg_3[-1]
            ):
                raise InvalidSizeKey(
                    "{0} is an invalid size. All sizes must be either "
                    "'url' or made up of at least two segments separated "
                    "by double underscores. Examples: 'crop__400x400', "
                    "filters__invert__url".format(arg_2)
                )
    except ValueError:
        raise InvalidSizeKeySet(
            '{} is an invalid size key set. Size key sets must be an '
            'iterable of 2-tuples'.format(str(arg_0))
        )
    return list(set(arg_0))


(tis,
                         session,
                         activate_dag_runs=True,
                         dag=None,
                         )

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = None , ) : arg_4 = [ ] for arg_5 in arg_0 : if arg_5 . state == State . RUNNING : if arg_5 . job_id : arg_5 . state = State . SHUTDOWN arg_4 . append ( arg_5 . job_id ) else : arg_7 = arg_5 . task_id if arg_3 and arg_3 . has_task ( arg_7 ) : arg_8 = arg_3 . get_task ( arg_7 ) arg_9 = arg_8 . retries arg_5 . max_tries = arg_5 . try_number + arg_9 - 1 else : arg_5 . max_tries = max ( arg_5 . max_tries , arg_5 . try_number - 1 ) arg_5 . state = State . NONE arg_1 . merge ( arg_5 ) if arg_4 : from airflow . jobs import BaseJob as BJ for arg_11 in arg_1 . query ( BJ ) . filter ( BJ . id . in_ ( arg_4 ) ) . all ( ) : arg_11 . state = State . SHUTDOWN if arg_2 and arg_0 : from airflow . models . dagrun import DagRun arg_12 = arg_1 . query ( DagRun ) . filter ( DagRun . dag_id . in_ ( { arg_5 . dag_id for arg_5 in arg_0 } ) , DagRun . execution_date . in_ ( { arg_5 . execution_date for arg_5 in arg_0 } ) , ) . all ( ) for arg_13 in arg_12 : arg_13 . state = State . RUNNING arg_13 . start_date = timezone . utcnow ( )

def Func(arg_0,
                         arg_1,
                         arg_2=True,
                         arg_3=None,
                         ):
    """
    Clears a set of task instances, but makes sure the running ones
    get killed.

    :param tis: a list of task instances
    :param session: current session
    :param activate_dag_runs: flag to check for active dag run
    :param dag: DAG object
    """
    arg_4 = []
    for arg_5 in arg_0:
        if arg_5.state == State.RUNNING:
            if arg_5.job_id:
                arg_5.state = State.SHUTDOWN
                arg_4.append(arg_5.job_id)
        else:
            arg_7 = arg_5.task_id
            if arg_3 and arg_3.has_task(arg_7):
                arg_8 = arg_3.get_task(arg_7)
                arg_9 = arg_8.retries
                arg_5.max_tries = arg_5.try_number + arg_9 - 1
            else:
                # Ignore errors when updating max_tries if dag is None or
                # task not found in dag since database records could be
                # outdated. We make max_tries the maximum value of its
                # original max_tries or the current task try number.
                arg_5.max_tries = max(arg_5.max_tries, arg_5.try_number - 1)
            arg_5.state = State.NONE
            arg_1.merge(arg_5)

    if arg_4:
        from airflow.jobs import BaseJob as BJ
        for arg_11 in arg_1.query(BJ).filter(BJ.id.in_(arg_4)).all():
            arg_11.state = State.SHUTDOWN

    if arg_2 and arg_0:
        from airflow.models.dagrun import DagRun  # Avoid circular import
        arg_12 = arg_1.query(DagRun).filter(
            DagRun.dag_id.in_({arg_5.dag_id for arg_5 in arg_0}),
            DagRun.execution_date.in_({arg_5.execution_date for arg_5 in arg_0}),
        ).all()
        for arg_13 in arg_12:
            arg_13.state = State.RUNNING
            arg_13.start_date = timezone.utcnow()

Clears a set of task instances but makes sure the running ones get killed .


(tt_scores, td_scores, cutoff_fdr, parametric, pfdr, pi0_lambda, pi0_method, pi0_smooth_df, pi0_smooth_log_pi0)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8):
    """ Finds cut off target score for specified false discovery rate fdr """

    arg_9, arg_10 = error_statistics(arg_0, arg_1, arg_3, arg_4, arg_5, arg_6, arg_7, arg_8, False)
    if not len(arg_9):
        raise click.ClickException("Too little data for calculating error statistcs.")
    arg_11 = (arg_9.qvalue - arg_2).abs().idxmin()
    arg_12 = arg_9.iloc[arg_11]["cutoff"]
    return arg_12


def Func ( arg_0 ) : arg_1 = [ arg_2 for arg_2 in arg_0 . tables if not isinstance ( arg_2 , UnknownTable ) ] if len ( arg_1 ) == 0 : return None for arg_2 in arg_0 . tables : if isinstance ( arg_2 , TestcaseTable ) : return "suite" return "resource"

def Func(arg_0):
        '''Return 'suite' or 'resource' or None

        This will return 'suite' if a testcase table is found;
        It will return 'resource' if at least one robot table
        is found. If no tables are found it will return None
        '''

        arg_1 = [arg_2 for arg_2 in arg_0.tables if not isinstance(arg_2, UnknownTable)]
        if len(arg_1) == 0:
            return None

        for arg_2 in arg_0.tables:
            if isinstance(arg_2, TestcaseTable):
                return "suite"

        return "resource"


return cls.query_by_user(user, state=MembershipState.PENDING_USER,
                                 eager=eager)

def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_2 : arg_2 = [ Membership . group ] return arg_0 . query_by_user ( arg_1 , state = MembershipState . PENDING_USER , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=False):
        """Get all invitations for given user."""
        if arg_2:
            arg_2 = [Membership.group]
        return arg_0.query_by_user(arg_1, state=MembershipState.PENDING_USER,
                                 arg_2=arg_2)


def Func ( arg_0 ) : arg_1 = 8.0713171 arg_2 = lambda parent , daugther : - parent + daugther + arg_1 return arg_0 . derived ( 'Func' , ( 0 , - 1 ) , arg_2 )

def Func(arg_0):
        """Return 1 neutron separation energy"""
        arg_1 = 8.0713171         # neutron mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + arg_1
        return arg_0.derived('Func', (0, -1), arg_2)


def
Func
(
arg_0
,
arg_1
)
:
if
scipy
.
sparse
.
issparse
(
arg_0
.
data
)
:
arg_2
=
arg_0
.
data
.
shape
[
1
]
else
:
arg_2
=
50000
arg_3
=
np
.
zeros
(
(
arg_0
.
data
.
shape
[
1
]
)
)
if
arg_1
==
1
:
arg_4
=
np
.
zeros
(
(
arg_0
.
data
.
shape
[
0
]
,
1
)
)
if
scipy
.
sparse
.
issparse
(
arg_0
.
data
)
:
arg_4
=
scipy
.
sparse
.
csc_matrix
(
arg_4
)
else
:
arg_4
=
arg_0
.
data
[
:
,
arg_1
:
arg_1
+
1
]
arg_0
.
_logger
.
info
(
'compute distance to node '
+
str
(
arg_1
)
)
for
arg_5
in
range
(
0
,
arg_0
.
data
.
shape
[
1
]
,
arg_2
)
:
if
arg_5
+
arg_2
>
arg_0
.
data
.
shape
[
1
]
:
arg_6
=
arg_0
.
data
.
shape
[
1
]
else
:
arg_6
=
arg_5
+
arg_2
arg_3
[
arg_5
:
arg_6
]
=
arg_0
.
_distfunc
(
arg_0
.
data
[
:
,
arg_5
:
arg_6
]
,
arg_4
)
arg_0
.
_logger
.
info
(
'completed:'
+
str
(
arg_6
/
(
arg_0
.
data
.
shape
[
1
]
/
100.0
)
)
+
"%"
)
return
arg_3

def Func(arg_0, arg_1):
        """ compute distances of a specific data point to all other samples"""

        if scipy.sparse.issparse(arg_0.data):
            arg_2 = arg_0.data.shape[1]
        else:
            arg_2 = 50000

        arg_3 = np.zeros((arg_0.data.shape[1]))
        if arg_1 == -1:
            # set vec to origin if idx=-1
            arg_4 = np.zeros((arg_0.data.shape[0], 1))
            if scipy.sparse.issparse(arg_0.data):
                arg_4 = scipy.sparse.csc_matrix(arg_4)
        else:
            arg_4 = arg_0.data[:, arg_1:arg_1+1]

        arg_0._logger.info('compute distance to node ' + str(arg_1))

        # slice data into smaller chunks
        for arg_5 in range(0, arg_0.data.shape[1], arg_2):
            if arg_5 + arg_2 > arg_0.data.shape[1]:
                arg_6 = arg_0.data.shape[1]
            else:
                arg_6 = arg_5 + arg_2

            arg_3[arg_5:arg_6] = arg_0._distfunc(
                arg_0.data[:,arg_5:arg_6], arg_4)
            arg_0._logger.info('completed:' +
                str(arg_6/(arg_0.data.shape[1]/100.0)) + "%")
        return arg_3


def Func(arg_0, arg_1):
        """
        Get Existing Message

        http://dev.wheniwork.com/#get-existing-message
        """
        arg_2 = "/2/messages/%s" % arg_1

        return arg_0.message_from_json(arg_0._get_resource(arg_2)["message"])


return start + consonant_part + vowel_part

def Func(arg_0, arg_1):
        """Return the skeleton key.

        Parameters
        ----------
        word : str
            The word to transform into its skeleton key

        Returns
        -------
        str
            The skeleton key

        Examples
        --------
        >>> sk = SkeletonKey()
        >>> sk.Func('The quick brown fox jumped over the lazy dog.')
        'THQCKBRWNFXJMPDVLZYGEUIOA'
        >>> sk.Func('Christopher')
        'CHRSTPIOE'
        >>> sk.Func('Niall')
        'NLIA'

        """
        arg_1 = unicode_normalize('NFKD', text_type(arg_1.upper()))
        arg_1 = ''.join(c for c in arg_1 if c in arg_0._letters)
        arg_2 = arg_1[0:1]
        arg_3 = ''
        arg_4 = ''

        # add consonants & vowels to to separate strings
        # (omitting the first char & duplicates)
        for arg_5 in arg_1[1:]:
            if arg_5 != arg_2:
                if arg_5 in arg_0._vowels:
                    if arg_5 not in arg_4:
                        arg_4 += arg_5
                elif arg_5 not in arg_3:
                    arg_3 += arg_5
        # return the first char followed by consonants followed by vowels
        return arg_2 + arg_3 + arg_4

Return the skeleton key.

        Parameters
        ----------
        word : str
            The word to transform into its skeleton key

        Returns
        -------
        str
            The skeleton key

        Examples
        --------
        >>> sk = SkeletonKey()
        >>> sk.fingerprint('The quick brown fox jumped over the lazy dog.')
        'THQCKBRWNFXJMPDVLZYGEUIOA'
        >>> sk.fingerprint('Christopher')
        'CHRSTPIOE'
        >>> sk.fingerprint('Niall')
        'NLIA'


return int(hashlib.md5(string).hexdigest()[:8], 16) & 0x7FFFFFFF

def Func ( arg_0 , arg_1 ) : if arg_0 is None : return None arg_2 = ( str ( arg_0 ) + arg_1 ) . encode ( "utf-8" ) return int ( hashlib . md5 ( arg_2 ) . hexdigest ( ) [ : 8 ] , 16 ) & 0x7FFFFFFF

def Func(arg_0, arg_1):
  """Generate a new seed, from the given seed and salt."""
  if arg_0 is None:
    return None
  arg_2 = (str(arg_0) + arg_1).encode("utf-8")
  return int(hashlib.md5(arg_2).hexdigest()[:8], 16) & 0x7FFFFFFF

Generate a new seed from the given seed and salt .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
logger
.
info
(
'Submitting form on page %r'
,
arg_0
.
_page
.
url
.
split
(
'?'
)
[
0
]
)
logger
.
info
(
'Page contains forms: %s'
,
[
arg_3
.
get
(
'id'
)
for
arg_3
in
arg_0
.
_page
.
soup
.
select
(
'form'
)
]
)
try
:
arg_4
=
arg_0
.
_page
.
soup
.
select
(
arg_1
)
[
0
]
except
IndexError
:
raise
GoogleAuthError
(
'Failed to find form {!r} in page'
.
format
(
arg_1
)
)
logger
.
info
(
'Page contains inputs: %s'
,
[
arg_3
.
get
(
'id'
)
for
arg_3
in
arg_4
.
select
(
'input'
)
]
)
for
arg_5
,
arg_6
in
arg_2
.
items
(
)
:
try
:
arg_4
.
select
(
arg_5
)
[
0
]
[
'value'
]
=
arg_6
except
IndexError
:
raise
GoogleAuthError
(
'Failed to find input {!r} in form'
.
format
(
arg_5
)
)
try
:
arg_0
.
_page
=
arg_0
.
_browser
.
submit
(
arg_4
,
arg_0
.
_page
.
url
)
arg_0
.
_page
.
raise_for_status
(
)
except
requests
.
RequestException
as
e
:
raise
GoogleAuthError
(
'Failed to submit form: {}'
.
format
(
e
)
)

def Func(arg_0, arg_1, arg_2):
        """Populate and submit a form on the current page.

        Raises GoogleAuthError if form can not be submitted.
        """
        logger.info(
            'Submitting form on page %r', arg_0._page.url.split('?')[0]
        )
        logger.info(
            'Page contains forms: %s',
            [arg_3.get('id') for arg_3 in arg_0._page.soup.select('form')]
        )
        try:
            arg_4 = arg_0._page.soup.select(arg_1)[0]
        except IndexError:
            raise GoogleAuthError(
                'Failed to find form {!r} in page'.format(arg_1)
            )
        logger.info(
            'Page contains inputs: %s',
            [arg_3.get('id') for arg_3 in arg_4.select('input')]
        )
        for arg_5, arg_6 in arg_2.items():
            try:
                arg_4.select(arg_5)[0]['value'] = arg_6
            except IndexError:
                raise GoogleAuthError(
                    'Failed to find input {!r} in form'.format(arg_5)
                )
        try:
            arg_0._page = arg_0._browser.submit(arg_4, arg_0._page.url)
            arg_0._page.raise_for_status()
        except requests.RequestException as e:
            raise GoogleAuthError('Failed to submit form: {}'.format(e))

Populate and submit a form on the current page .


(cls, model, bounds, input_shape=None,
                   channel_axis=3, preprocessing=(0, 1))

def Func(arg_0, arg_1, arg_2, arg_3=None,
                   arg_4=3, arg_5=(0, 1)):
        """Alternative constructor for a TensorFlowModel that
        accepts a `tf.keras.Model` instance.

        Parameters
        ----------
        model : `tensorflow.keras.Model`
            A `tensorflow.keras.Model` that accepts a single input tensor
            and returns a single output tensor representing logits.
        bounds : tuple
            Tuple of lower and upper bound for the pixel values, usually
            (0, 1) or (0, 255).
        input_shape : tuple
            The shape of a single input, e.g. (28, 28, 1) for MNIST.
            If None, tries to get the the shape from the model's
            input_shape attribute.
        channel_axis : int
            The index of the axis that represents color channels.
        preprocessing: 2-element tuple with floats or numpy arrays
            Elementwises preprocessing of input; we first subtract the first
            element of preprocessing from the input and then divide the input
            by the second element.

        """
        import tensorflow as tf
        if arg_3 is None:
            try:
                arg_3 = arg_1.input_shape[1:]
            except AttributeError:
                raise ValueError(
                    'Please specify input_shape manually or '
                    'provide a model with an input_shape attribute')
        with tf.keras.backend.get_session().as_default():
            arg_6 = tf.placeholder(tf.float32, (None,) + arg_3)
            arg_7 = arg_1(arg_6)
            return arg_0(arg_6, arg_7, arg_2=arg_2,
                       arg_4=arg_4, arg_5=arg_5)

Alternative constructor for a TensorFlowModel that accepts a tf . keras . Model instance .