def Func ( arg_0 ) : arg_1 = copy . deepcopy ( arg_0 . __dict__ ) for arg_2 , arg_3 in arg_1 . items ( ) : if isinstance ( arg_3 , Params ) : arg_1 [ arg_2 ] = arg_3 . __dict__ arg_4 = json . dumps ( arg_1 , sort_keys = False , indent = 4 , separators = ( "," , ":" ) , ) arg_5 = os . path . join ( arg_0 . dirs , arg_0 . name + ".tet.json" ) if not os . path . exists ( arg_0 . dirs ) : os . mkdir ( arg_0 . dirs ) arg_6 = 0 while not arg_6 : try : with open ( arg_5 , 'w' ) as jout : jout . write ( arg_4 ) arg_6 = 1 except ( KeyboardInterrupt , SystemExit ) : print ( '.' ) continue

def Func(arg_0):
        """ save a JSON file representation of Tetrad Class for checkpoint"""

        ## save each attribute as dict
        arg_1 = copy.deepcopy(arg_0.__dict__)
        for arg_2, arg_3 in arg_1.items():
            if isinstance(arg_3, Params):
                arg_1[arg_2] = arg_3.__dict__
        arg_4 = json.dumps(arg_1,
                               sort_keys=False,
                               indent=4,
                               separators=(",", ":"),
                               )

        ## save to file, make dir if it wasn't made earlier
        arg_5 = os.path.join(arg_0.dirs, arg_0.name+".tet.json")
        if not os.path.exists(arg_0.dirs):
            os.mkdir(arg_0.dirs)

        ## protect save from interruption
        arg_6 = 0
        while not arg_6:
            try:
                with open(arg_5, 'w') as jout:
                    jout.write(arg_4)
                arg_6 = 1
            except (KeyboardInterrupt, SystemExit):
                print('.')
                continue


(self, bucket, key, filename, extra_args=None,
                      expected_size=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None,
                      arg_5=None):
        """Downloads the object's contents to a file

        :type bucket: str
        :param bucket: The name of the bucket to download from

        :type key: str
        :param key: The name of the key to download from

        :type filename: str
        :param filename: The name of a file to download to.

        :type extra_args: dict
        :param extra_args: Extra arguments that may be passed to the
            client operation

        :type expected_size: int
        :param expected_size: The expected size in bytes of the download. If
            provided, the downloader will not call HeadObject to determine the
            object's size and use the provided value instead. The size is
            needed to determine whether to do a multipart download.

        :rtype: s3transfer.futures.TransferFuture
        :returns: Transfer future representing the download
        """
        arg_0._start_if_needed()
        if arg_4 is None:
            arg_4 = {}
        arg_0._validate_all_known_args(arg_4)
        arg_6 = arg_0._transfer_monitor.notify_new_transfer()
        arg_7 = DownloadFileRequest(
                arg_6=arg_6, arg_1=arg_1, arg_2=arg_2,
                arg_3=arg_3, arg_4=arg_4,
                arg_5=arg_5,
            )
        logger.debug(
            'Submitting download file request: %s.', arg_7)
        arg_0._download_request_queue.put(arg_7)
        arg_8 = CallArgs(
            arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4,
            arg_5=arg_5)
        arg_9 = arg_0._get_transfer_future(arg_6, arg_8)
        return arg_9

Downloads the object s contents to a file


def Func ( arg_0 , arg_1 ) : arg_0 . _callbacks . Func ( arg_1 ) arg_0 . _load_track ( arg_1 ) time . sleep ( 2 ) while True : try : arg_0 . _callbacks . pre_poll ( ) arg_0 . _ensure_started ( ) arg_0 . _loop_hook ( ) arg_2 , arg_3 , arg_3 = select . select ( arg_0 . _get_select_readers ( ) , [ ] , [ ] , 1 ) for arg_4 in arg_2 : if arg_4 . fileno ( ) == arg_0 . _control_fd : arg_0 . _callbacks . input ( arg_4 . readline ( ) . strip ( ) , arg_1 ) else : arg_5 = arg_0 . _read_from_process ( arg_4 ) if arg_0 . _Funcer_stopped ( arg_5 ) : return finally : arg_0 . _callbacks . post_poll ( )

def Func(arg_0, arg_1):
        """Play a new song from a Pandora model

        Returns once the stream starts but does not shut down the remote audio
        output backend process. Calls the input callback when the user has
        input.
        """
        arg_0._callbacks.Func(arg_1)
        arg_0._load_track(arg_1)
        time.sleep(2)  # Give the backend time to load the track

        while True:
            try:
                arg_0._callbacks.pre_poll()
                arg_0._ensure_started()
                arg_0._loop_hook()

                arg_2, arg_3, arg_3 = select.select(
                    arg_0._get_select_readers(), [], [], 1)

                for arg_4 in arg_2:
                    if arg_4.fileno() == arg_0._control_fd:
                        arg_0._callbacks.input(arg_4.readline().strip(), arg_1)
                    else:
                        arg_5 = arg_0._read_from_process(arg_4)
                        if arg_0._Funcer_stopped(arg_5):
                            return
            finally:
                arg_0._callbacks.post_poll()


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _control . verticalScrollBar ( ) arg_2 . setValue ( arg_2 . maximum ( ) ) arg_3 = arg_0 . _control . textCursor ( ) arg_0 . _control . setTextCursor ( arg_1 ) arg_0 . _control . ensureCursorVisible ( ) arg_0 . _control . setTextCursor ( arg_3 )

def Func(arg_0, arg_1):
        """ Scrolls the viewport so that the specified cursor is at the top.
        """
        arg_2 = arg_0._control.verticalScrollBar()
        arg_2.setValue(arg_2.maximum())
        arg_3 = arg_0._control.textCursor()
        arg_0._control.setTextCursor(arg_1)
        arg_0._control.ensureCursorVisible()
        arg_0._control.setTextCursor(arg_3)

Scrolls the viewport so that the specified cursor is at the top .


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . get ( 'courses' , [ ] ) : for arg_3 in arg_2 . get ( 'course_runs' , [ ] ) : if arg_3 . get ( 'start' ) : arg_1 . append ( parse_lms_api_datetime ( arg_3 [ 'start' ] ) ) if not arg_1 : return None return min ( arg_1 )

def Func(arg_0):
    """
    Get the earliest date that one of the courses in the program was available.
    For the sake of emails to new learners, we treat this as the program start date.

    Arguemnts:
        program (dict): Program data from Course Catalog API

    returns:
        datetime.datetime: The date and time at which the first course started
    """
    arg_1 = []
    for arg_2 in arg_0.get('courses', []):
        for arg_3 in arg_2.get('course_runs', []):
            if arg_3.get('start'):
                arg_1.append(parse_lms_api_datetime(arg_3['start']))
    if not arg_1:
        return None
    return min(arg_1)

Get the earliest date that one of the courses in the program was available . For the sake of emails to new learners we treat this as the program start date .


def Func ( ) : arg_0 = get_build_platform ( ) arg_1 = macosVersionString . match ( arg_0 ) if arg_1 is not None and sys . platform == "darwin" : try : arg_0 = 'macosx-%s-%s' % ( '.' . join ( _macosx_vers ( ) [ : 2 ] ) , arg_1 . group ( 3 ) ) except ValueError : pass return arg_0

def Func():
    """Return this platform's maximum compatible version.

    distutils.util.get_platform() normally reports the minimum version
    of Mac OS X that would be required to *use* extensions produced by
    distutils.  But what we want when checking compatibility is to know the
    version of Mac OS X that we are *running*.  To allow usage of packages that
    explicitly require a newer version of Mac OS X, we must also know the
    current version of the OS.

    If this condition occurs for any other platform with a version in its
    platform strings, this function should be extended accordingly.
    """
    arg_0 = get_build_platform(); arg_1 = macosVersionString.match(arg_0)
    if arg_1 is not None and sys.platform == "darwin":
        try:
            arg_0 = 'macosx-%s-%s' % ('.'.join(_macosx_vers()[:2]), arg_1.group(3))
        except ValueError:
            pass    # not Mac OS X
    return arg_0

Return this platform s maximum compatible version .


def Func ( arg_0 , arg_1 , arg_2 = False ) : arg_3 = arg_0 . take_screenshot ( ) try : with open ( arg_1 , "wb" ) as f : f . write ( b64decode ( arg_3 . encode ( 'ascii' ) ) ) except IOError as err : if not arg_2 : raise err

def Func(arg_0, arg_1, arg_2 = False):
        """Save the screenshot to local.

        Support:
            Android iOS Web(WebView)

        Args:
            filename(str): The path to save the image.
            quietly(bool): If True, omit the IOError when
                failed to save the image.

        Returns:
            WebElement Object.

        Raises:
            WebDriverException.
            IOError.
        """
        arg_3 = arg_0.take_screenshot()
        try:
            with open(arg_1, "wb") as f:
                f.write(b64decode(arg_3.encode('ascii')))
        except IOError as err:
            if not arg_2:
                raise err


def
Func
(
arg_0
,
arg_1
=
'37'
,
arg_2
=
)
:
arg_3
=
{
}
if
not
arg_2
:
arg_2
=
arg_0
.
all_genes
(
arg_1
=
arg_1
)
LOG
.
info
(
"Building interval trees..."
)
for
arg_4
,
arg_5
in
enumerate
(
arg_2
)
:
arg_6
=
arg_5
[
'chromosome'
]
arg_7
=
max
(
(
arg_5
[
'start'
]
5000
)
,
1
)
arg_8
=
arg_5
[
'end'
]
+
5000
if
arg_6
not
in
arg_3
:
arg_3
[
arg_6
]
=
intervaltree
.
IntervalTree
(
)
arg_3
[
arg_6
]
.
addi
(
arg_7
,
arg_8
,
arg_4
)
continue
arg_9
=
arg_3
[
arg_6
]
.
search
(
arg_7
,
arg_8
)
if
not
arg_9
:
arg_3
[
arg_6
]
.
addi
(
arg_7
,
arg_8
,
arg_4
)
continue
for
arg_10
in
arg_9
:
if
arg_10
.
begin
<
arg_7
:
arg_7
=
arg_10
.
begin
if
arg_10
.
end
>
arg_8
:
arg_8
=
arg_10
.
end
arg_3
[
arg_6
]
.
remove
(
arg_10
)
arg_3
[
arg_6
]
.
addi
(
arg_7
,
arg_8
,
arg_4
)
return
arg_3

def Func(arg_0, arg_1='37', arg_2=None):
        """Return a dictionary with chromosomes as keys and interval trees as values

        Each interval represents a coding region of overlapping genes.

        Args:
            build(str): The genome build
            genes(iterable(scout.models.HgncGene)):

        Returns:
            intervals(dict): A dictionary with chromosomes as keys and overlapping genomic intervals as values
        """
        arg_3 = {}
        if not arg_2:
            arg_2 = arg_0.all_genes(arg_1=arg_1)
        LOG.info("Building interval trees...")
        for arg_4,arg_5 in enumerate(arg_2):
            arg_6 = arg_5['chromosome']
            arg_7 = max((arg_5['start'] - 5000), 1)
            arg_8 = arg_5['end'] + 5000

            # If this is the first time a chromosome is seen we create a new
            # interval tree with current interval
            if arg_6 not in arg_3:
                arg_3[arg_6] = intervaltree.IntervalTree()
                arg_3[arg_6].addi(arg_7, arg_8, arg_4)
                continue

            arg_9 = arg_3[arg_6].search(arg_7, arg_8)

            # If the interval did not overlap any other intervals we insert it and continue
            if not arg_9:
                arg_3[arg_6].addi(arg_7, arg_8, arg_4)
                continue

            # Loop over the overlapping intervals
            for arg_10 in arg_9:
                # Update the positions to new max and mins
                if arg_10.begin < arg_7:
                    arg_7 = arg_10.begin

                if arg_10.end > arg_8:
                    arg_8 = arg_10.end

                # Delete the old interval
                arg_3[arg_6].remove(arg_10)

            # Add the new interval consisting och the overlapping ones
            arg_3[arg_6].addi(arg_7, arg_8, arg_4)

        return arg_3


(x,
            layer_fn=tf.compat.v1.layers.dense,
            log_rate_fn=lambda x: x,
            name=None)

def Func ( arg_0 , arg_1 = arg_2 . compat . v1 . layers . dense , arg_7 = lambda arg_0 : arg_0 , arg_8 = None ) : with arg_2 . compat . v1 . name_scope ( arg_8 , 'Func' , [ arg_0 ] ) : arg_0 = arg_2 . convert_to_tensor ( value = arg_0 , arg_8 = 'x' ) arg_9 = arg_7 ( arg_2 . squeeze ( arg_1 ( arg_0 , 1 ) , axis = - 1 ) ) return tfd . Poisson ( arg_9 = arg_9 )

def Func(arg_0,
            arg_1=arg_2.compat.v1.layers.dense,
            arg_7=lambda arg_0: arg_0,
            arg_8=None):
  """Constructs a trainable `tfd.Poisson` distribution.

  This function creates a Poisson distribution parameterized by log rate.
  Using default args, this function is mathematically equivalent to:

  ```none
  Y = Poisson(log_rate=matmul(W, x) + b)

  where,
    W in R^[d, n]
    b in R^d
  ```

  #### Examples

  This can be used as a [Poisson regression](
  https://en.wikipedia.org/wiki/Poisson_regression) loss.

  ```python
  # This example fits a Func regression loss.
  import numpy as np
  import tensorflow as tf
  import tensorflow_probability as tfp

  # Create fictitious training data.
  dtype = np.float32
  n = 3000    # number of samples
  x_size = 4  # size of single x
  def make_training_data():
    np.random.seed(142)
    x = np.random.randn(n, x_size).astype(dtype)
    w = np.random.randn(x_size).astype(dtype)
    b = np.random.randn(1).astype(dtype)
    true_log_rate = np.tensordot(x, w, axes=[[-1], [-1]]) + b
    y = np.random.Func(lam=np.exp(true_log_rate)).astype(dtype)
    return y, x
  y, x = make_training_data()

  # Build TF graph for fitting Poisson maximum likelihood estimator.
  Func = tfp.trainable_distributions.Func(x)
  loss = -tf.reduce_mean(Func.log_prob(y))
  train_op = tf.train.AdamOptimizer(learning_rate=2.**-5).minimize(loss)
  mse = tf.reduce_mean(tf.squared_difference(y, Func.mean()))
  init_op = tf.global_variables_initializer()

  # Run graph 1000 times.
  num_steps = 1000
  loss_ = np.zeros(num_steps)   # Style: `_` to indicate sess.run result.
  mse_ = np.zeros(num_steps)
  with tf.Session() as sess:
    sess.run(init_op)
    for it in xrange(loss_.size):
      _, loss_[it], mse_[it] = sess.run([train_op, loss, mse])
      if it % 200 == 0 or it == loss_.size - 1:
        print("iteration:{}  loss:{}  mse:{}".format(it, loss_[it], mse_[it]))

  # ==> iteration:0    loss:37.0814208984  mse:6359.41259766
  #     iteration:200  loss:1.42010736465  mse:40.7654914856
  #     iteration:400  loss:1.39027583599  mse:8.77660560608
  #     iteration:600  loss:1.3902695179   mse:8.78443241119
  #     iteration:800  loss:1.39026939869  mse:8.78443622589
  #     iteration:999  loss:1.39026939869  mse:8.78444766998
  ```

  Args:
    x: `Tensor` with floating type. Must have statically defined rank and
      statically known right-most dimension.
    layer_fn: Python `callable` which takes input `x` and `int` scalar `d` and
      returns a transformation of `x` with shape
      `tf.concat([tf.shape(x)[:-1], [1]], axis=0)`.
      Default value: `tf.layers.dense`.
    log_rate_fn: Python `callable` which transforms the `log_rate` parameter.
      Takes a (batch of) length-`dims` vectors and returns a `Tensor` of same
      shape and `dtype`.
      Default value: `lambda x: x`.
    name: A `name_scope` name for operations created by this function.
      Default value: `None` (i.e., "Func").

  Returns:
    Func: An instance of `tfd.Poisson`.
  """
  with arg_2.compat.v1.name_scope(arg_8, 'Func', [arg_0]):
    arg_0 = arg_2.convert_to_tensor(value=arg_0, arg_8='x')
    arg_9 = arg_7(arg_2.squeeze(arg_1(arg_0, 1), axis=-1))
    return tfd.Poisson(arg_9=arg_9)

Constructs a trainable `tfd.Poisson` distribution.

  This function creates a Poisson distribution parameterized by log rate.
  Using default args, this function is mathematically equivalent to:

  ```none
  Y = Poisson(log_rate=matmul(W, x) + b)

  where,
    W in R^[d, n]
    b in R^d
  ```

  #### Examples

  This can be used as a [Poisson regression](
  https://en.wikipedia.org/wiki/Poisson_regression) loss.

  ```python
  # This example fits a poisson regression loss.
  import numpy as np
  import tensorflow as tf
  import tensorflow_probability as tfp

  # Create fictitious training data.
  dtype = np.float32
  n = 3000    # number of samples
  x_size = 4  # size of single x
  def make_training_data():
    np.random.seed(142)
    x = np.random.randn(n, x_size).astype(dtype)
    w = np.random.randn(x_size).astype(dtype)
    b = np.random.randn(1).astype(dtype)
    true_log_rate = np.tensordot(x, w, axes=[[-1], [-1]]) + b
    y = np.random.poisson(lam=np.exp(true_log_rate)).astype(dtype)
    return y, x
  y, x = make_training_data()

  # Build TF graph for fitting Poisson maximum likelihood estimator.
  poisson = tfp.trainable_distributions.poisson(x)
  loss = -tf.reduce_mean(poisson.log_prob(y))
  train_op = tf.train.AdamOptimizer(learning_rate=2.**-5).minimize(loss)
  mse = tf.reduce_mean(tf.squared_difference(y, poisson.mean()))
  init_op = tf.global_variables_initializer()

  # Run graph 1000 times.
  num_steps = 1000
  loss_ = np.zeros(num_steps)   # Style: `_` to indicate sess.run result.
  mse_ = np.zeros(num_steps)
  with tf.Session() as sess:
    sess.run(init_op)
    for it in xrange(loss_.size):
      _, loss_[it], mse_[it] = sess.run([train_op, loss, mse])
      if it % 200 == 0 or it == loss_.size - 1:
        print("iteration:{}  loss:{}  mse:{}".format(it, loss_[it], mse_[it]))

  # ==> iteration:0    loss:37.0814208984  mse:6359.41259766
  #     iteration:200  loss:1.42010736465  mse:40.7654914856
  #     iteration:400  loss:1.39027583599  mse:8.77660560608
  #     iteration:600  loss:1.3902695179   mse:8.78443241119
  #     iteration:800  loss:1.39026939869  mse:8.78443622589
  #     iteration:999  loss:1.39026939869  mse:8.78444766998
  ```

  Args:
    x: `Tensor` with floating type. Must have statically defined rank and
      statically known right-most dimension.
    layer_fn: Python `callable` which takes input `x` and `int` scalar `d` and
      returns a transformation of `x` with shape
      `tf.concat([tf.shape(x)[:-1], [1]], axis=0)`.
      Default value: `tf.layers.dense`.
    log_rate_fn: Python `callable` which transforms the `log_rate` parameter.
      Takes a (batch of) length-`dims` vectors and returns a `Tensor` of same
      shape and `dtype`.
      Default value: `lambda x: x`.
    name: A `name_scope` name for operations created by this function.
      Default value: `None` (i.e., "poisson").

  Returns:
    poisson: An instance of `tfd.Poisson`.

Constructs a trainable tfd . Poisson distribution .


def Func ( arg_0 ) : try : return arg_0 . _stat . st_Func except : arg_0 . _stat = arg_0 . stat ( ) return arg_0 . Func

def Func(arg_0):
        """
        Get most recent create time in timestamp.
        """
        try:
            return arg_0._stat.st_Func
        except:  # pragma: no cover
            arg_0._stat = arg_0.stat()
            return arg_0.Func

Get most recent create time in timestamp .


def
Func
(
arg_0
)
:
arg_1
=
dict
(
)
arg_2
=
ModuleArgsParser
(
arg_0
)
try
:
arg_3
,
arg_4
,
arg_1
[
'delegate_to'
]
=
arg_2
.
parse
(
)
except
AnsibleParserError
as
e
:
try
:
arg_5
=
"%s:%s"
%
(
arg_0
[
FILENAME_KEY
]
,
arg_0
[
LINE_NUMBER_KEY
]
)
del
arg_0
[
FILENAME_KEY
]
del
arg_0
[
LINE_NUMBER_KEY
]
except
KeyError
:
arg_5
=
"Unknown"
try
:
import
pprint
arg_6
=
pprint
.
PrettyPrinter
(
indent
=
2
)
arg_7
=
arg_6
.
pformat
(
arg_0
)
except
ImportError
:
arg_7
=
arg_0
raise
SystemExit
(
"Couldn't parse task at %s (%s)\n%s"
%
(
arg_5
,
e
.
message
,
arg_7
)
)
if
'_uses_shell'
in
arg_4
:
arg_3
=
'shell'
del
(
arg_4
[
'_uses_shell'
]
)
for
(
arg_8
,
arg_9
)
in
list
(
arg_0
.
items
(
)
)
:
if
arg_8
in
(
'action'
,
'local_action'
,
'args'
,
'delegate_to'
)
or
arg_8
==
arg_3
:
continue
else
:
arg_1
[
arg_8
]
=
arg_9
arg_1
[
'action'
]
=
dict
(
__ansible_module__
=
arg_3
)
if
'_raw_params'
in
arg_4
:
arg_1
[
'action'
]
[
'__ansible_arguments__'
]
=
arg_4
[
'_raw_params'
]
.
split
(
' '
)
del
(
arg_4
[
'_raw_params'
]
)
else
:
arg_1
[
'action'
]
[
'__ansible_arguments__'
]
=
list
(
)
if
'argv'
in
arg_4
and
not
arg_1
[
'action'
]
[
'__ansible_arguments__'
]
:
arg_1
[
'action'
]
[
'__ansible_arguments__'
]
=
arg_4
[
'argv'
]
del
(
arg_4
[
'argv'
]
)
arg_1
[
'action'
]
.
update
(
arg_4
)
return
arg_1

def Func(arg_0):
    '''Ensures tasks have an action key and strings are converted to python objects'''

    arg_1 = dict()
    arg_2 = ModuleArgsParser(arg_0)
    try:
        arg_3, arg_4, arg_1['delegate_to'] = arg_2.parse()
    except AnsibleParserError as e:
        try:
            arg_5 = "%s:%s" % (arg_0[FILENAME_KEY], arg_0[LINE_NUMBER_KEY])
            del arg_0[FILENAME_KEY]
            del arg_0[LINE_NUMBER_KEY]
        except KeyError:
            arg_5 = "Unknown"
        try:
            import pprint
            arg_6 = pprint.PrettyPrinter(indent=2)
            arg_7 = arg_6.pformat(arg_0)
        except ImportError:
            arg_7 = arg_0
        raise SystemExit("Couldn't parse task at %s (%s)\n%s" % (arg_5, e.message, arg_7))

    # denormalize shell -> command conversion
    if '_uses_shell' in arg_4:
        arg_3 = 'shell'
        del(arg_4['_uses_shell'])

    for (arg_8, arg_9) in list(arg_0.items()):
        if arg_8 in ('action', 'local_action', 'args', 'delegate_to') or arg_8 == arg_3:
            # we don't want to re-assign these values, which were
            # determined by the ModuleArgsParser() above
            continue
        else:
            arg_1[arg_8] = arg_9

    arg_1['action'] = dict(__ansible_module__=arg_3)

    if '_raw_params' in arg_4:
        arg_1['action']['__ansible_arguments__'] = arg_4['_raw_params'].split(' ')
        del(arg_4['_raw_params'])
    else:
        arg_1['action']['__ansible_arguments__'] = list()

    if 'argv' in arg_4 and not arg_1['action']['__ansible_arguments__']:
        arg_1['action']['__ansible_arguments__'] = arg_4['argv']
        del(arg_4['argv'])

    arg_1['action'].update(arg_4)
    return arg_1


def Func(arg_0, **arg_1):
        """Plot xvg file data.

        The first column of the data is always taken as the abscissa
        X. Additional columns are Functed as ordinates Y1, Y2, ...

        In the special case that there is only a single column then this column
        is Functed against the index, i.e. (N, Y).

        :Keywords:
          *columns* : list
               Select the columns of the data to be Functed; the list
               is used as a numpy.array extended slice. The default is
               to use all columns. Columns are selected *after* a transform.
          *transform* : function
               function ``transform(array) -> array`` which transforms
               the original array; must return a 2D numpy array of
               shape [X, Y1, Y2, ...] where X, Y1, ... are column
               vectors.  By default the transformation is the
               identity [``lambda x: x``].
          *maxpoints* : int
               limit the total number of data points; matFunclib has issues processing
               png files with >100,000 points and pdfs take forever to display. Set to
               ``None`` if really all data should be displayed. At the moment we simply
               decimate the data at regular intervals. [10000]
          *method*
               method to decimate the data to *maxpoints*, see :meth:`XVG.decimate`
               for details
          *color*
               single color (used for all Funcs); sequence of colors
               (will be repeated as necessary); or a matFunclib
               colormap (e.g. "jet", see :mod:`matFunclib.cm`). The
               default is to use the :attr:`XVG.default_color_cycle`.
          *ax*
               Func into given axes or create new one if ``None`` [``None``]
          *kwargs*
               All other keyword arguments are passed on to :func:`matFunclib.pyFunc.Func`.

        :Returns:
          *ax*
               axes instance
        """
        arg_2 = arg_1.pop('columns', Ellipsis)         # slice for everything
        arg_3 = arg_1.pop('maxpoints', arg_0.maxpoints_default)
        arg_4 = arg_1.pop('transform', lambda x: x)  # default is identity transformation
        arg_5 = arg_1.pop('method', "mean")
        arg_6 = arg_1.pop('ax', None)

        if arg_2 is Ellipsis or arg_2 is None:
            arg_2 = numpy.arange(arg_0.array.shape[0])
        if len(arg_2) == 0:
            raise MissingDataError("Func() needs at least one column of data")

        if len(arg_0.array.shape) == 1 or arg_0.array.shape[0] == 1:
            # special case: Func against index; Func would do this automatically but
            # we'll just produce our own xdata and pretend that this was X all along
            arg_7 = numpy.ravel(arg_0.array)
            arg_8 = numpy.arange(len(arg_7))
            arg_7 = numpy.vstack((arg_8, arg_7))
            arg_2 = [0] + [c+1 for c in arg_2]
        else:
            arg_7 = arg_0.array

        arg_9 = arg_1.pop('color', arg_0.default_color_cycle)
        try:
            arg_10 = matFunclib.cm.get_cmap(arg_9)
            arg_11 = arg_10(matFunclib.colors.Normalize()(numpy.arange(len(arg_2[1:]), dtype=float)))
        except TypeError:
            arg_11 = cycle(utilities.asiterable(arg_9))

        if arg_6 is None:
            arg_6 = plt.gca()

        # (decimate/smooth o slice o transform)(array)
        arg_7 = arg_0.decimate(arg_5, numpy.asarray(arg_4(arg_7))[arg_2], arg_3=arg_3)

        # now deal with infs, nans etc AFTER all transformations (needed for Functing across inf/nan)
        arg_12 = numpy.ma.MaskedArray(arg_7, mask=numpy.logical_not(numpy.isfinite(arg_7)))

        # finally Func (each column separately to catch empty sets)
        for arg_13, arg_9 in zip(range(1,len(arg_2)), arg_11):
            if len(arg_12[arg_13]) == 0:
                warnings.warn("No data to Func for column {column:d}".format(**vars()), category=MissingDataWarning)
            arg_1['color'] = arg_9
            arg_6.Func(arg_12[0], arg_12[arg_13], **arg_1)   # Func all other columns in parallel
        return arg_6

Plot xvg file data.

        The first column of the data is always taken as the abscissa
        X. Additional columns are plotted as ordinates Y1, Y2, ...

        In the special case that there is only a single column then this column
        is plotted against the index, i.e. (N, Y).

        :Keywords:
          *columns* : list
               Select the columns of the data to be plotted; the list
               is used as a numpy.array extended slice. The default is
               to use all columns. Columns are selected *after* a transform.
          *transform* : function
               function ``transform(array) -> array`` which transforms
               the original array; must return a 2D numpy array of
               shape [X, Y1, Y2, ...] where X, Y1, ... are column
               vectors.  By default the transformation is the
               identity [``lambda x: x``].
          *maxpoints* : int
               limit the total number of data points; matplotlib has issues processing
               png files with >100,000 points and pdfs take forever to display. Set to
               ``None`` if really all data should be displayed. At the moment we simply
               decimate the data at regular intervals. [10000]
          *method*
               method to decimate the data to *maxpoints*, see :meth:`XVG.decimate`
               for details
          *color*
               single color (used for all plots); sequence of colors
               (will be repeated as necessary); or a matplotlib
               colormap (e.g. "jet", see :mod:`matplotlib.cm`). The
               default is to use the :attr:`XVG.default_color_cycle`.
          *ax*
               plot into given axes or create new one if ``None`` [``None``]
          *kwargs*
               All other keyword arguments are passed on to :func:`matplotlib.pyplot.plot`.

        :Returns:
          *ax*
               axes instance


(self, colIdx, cellIdx, segList, minPermanence,
                          minNumSyns)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                          arg_5):
    """
    This method goes through a list of segments for a given cell and
    deletes all synapses whose permanence is less than minPermanence and deletes
    any segments that have less than minNumSyns synapses remaining.

    :param colIdx        Column index
    :param cellIdx       Cell index within the column
    :param segList       List of segment references
    :param minPermanence Any syn whose permamence is 0 or < minPermanence will
                         be deleted.
    :param minNumSyns    Any segment with less than minNumSyns synapses remaining
                         in it will be deleted.

    :returns: tuple (numSegsRemoved, numSynsRemoved)
    """
    # Fill in defaults
    if arg_4 is None:
      arg_4 = arg_0.connectedPerm
    if arg_5 is None:
      arg_5 = arg_0.activationThreshold

    # Loop through all segments
    arg_6, arg_7 = 0, 0
    arg_8 = [] # collect and remove segments outside the loop
    for arg_9 in arg_3:

      # List if synapses to delete
      arg_10 = [arg_11 for arg_11 in arg_9.syns if arg_11[2] < arg_4]

      if len(arg_10) == len(arg_9.syns):
        arg_8.append(arg_9) # will remove the whole segment
      else:
        if len(arg_10) > 0:
          for arg_11 in arg_10: # remove some synapses on segment
            arg_9.syns.remove(arg_11)
            arg_7 += 1
        if len(arg_9.syns) < arg_5:
          arg_8.append(arg_9)

    # Remove segments that don't have enough synapses and also take them
    # out of the segment update list, if they are in there
    arg_6 += len(arg_8)
    for arg_12 in arg_8: # remove some segments of this cell
      arg_0._cleanUpdatesList(arg_1, arg_2, arg_12)
      arg_0.cells[arg_1][arg_2].remove(arg_12)
      arg_7 += len(arg_12.syns)

    return arg_6, arg_7

This method goes through a list of segments for a given cell and deletes all synapses whose permanence is less than minPermanence and deletes any segments that have less than minNumSyns synapses remaining .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _fmt ( str ( arg_1 ) ) for arg_3 , arg_4 in enumerate ( arg_0 . _params ) : if arg_1 == arg_3 or arg_2 == arg_4 . name : return arg_4 raise KeyError ( arg_1 )

def Func(arg_0, arg_1):
        '''Get a shared variable for a parameter by name.

        Parameters
        ----------
        key : str or int
            The name of the parameter to look up, or the index of the parameter
            in our parameter list. These are both dependent on the
            implementation of the layer.

        Returns
        -------
        param : shared variable
            A shared variable containing values for the given parameter.

        Raises
        ------
        KeyError
            If a param with the given name does not exist.
        '''
        arg_2 = arg_0._fmt(str(arg_1))
        for arg_3, arg_4 in enumerate(arg_0._params):
            if arg_1 == arg_3 or arg_2 == arg_4.name:
                return arg_4
        raise KeyError(arg_1)

Get a shared variable for a parameter by name .


return self._http_client.post(self._POLLS,
                                      data=data,
                                      request_policy=request_policy,
                                      cls=strawpoll.Poll)

def Func ( arg_0 , arg_1 , * , arg_2 = None ) : if arg_1 . id is not None : raise ExistingPoll ( ) arg_3 = arg_1 . options arg_4 = { 'title' : arg_1 . title , 'options' : arg_3 , 'multi' : arg_1 . multi , 'dupcheck' : arg_1 . dupcheck , 'captcha' : arg_1 . captcha } return arg_0 . _http_client . post ( arg_0 . _POLLS , arg_4 = arg_4 , arg_2 = arg_2 , cls = strawpoll . Poll )

def Func(arg_0, arg_1, *, arg_2=None):
        """Submits a poll on strawpoll.

        :param poll: The poll to submit.
        :type poll: :class:`Poll`
        :param request_policy: Overrides :attr:`API.requests_policy` for that \
        request.
        :type request_policy: Optional[:class:`RequestsPolicy`]

        :raises ExistingPoll: This poll instance has already been submitted.
        :raises HTTPException: The submission failed.

        :returns: The given poll updated with the data sent back from the submission.
        :rtype: :class:`Poll`

        .. note::
            Only polls that have a non empty title and between 2 and 30 options
            can be submitted.
        """
        if arg_1.id is not None:
            raise ExistingPoll()

        arg_3 = arg_1.options
        arg_4 = {
            'title': arg_1.title,
            'options': arg_3,
            'multi': arg_1.multi,
            'dupcheck': arg_1.dupcheck,
            'captcha': arg_1.captcha
        }

        return arg_0._http_client.post(arg_0._POLLS,
                                      arg_4=arg_4,
                                      arg_2=arg_2,
                                      cls=strawpoll.Poll)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = { "Content-Type" : "application/json" , "Accept" : "application/json" } if arg_0 . token : arg_3 [ "W-Token" ] = "%s" % arg_0 . token arg_4 = WhenIWork_DAO ( ) . postURL ( arg_1 , arg_3 , json . dumps ( arg_2 ) ) if not ( arg_4 . status == 200 or arg_4 . status == 204 ) : raise DataFailureException ( arg_1 , arg_4 . status , arg_4 . data ) return json . loads ( arg_4 . data )

def Func(arg_0, arg_1, arg_2):
        """
        When I Work POST method.
        """
        arg_3 = {"Content-Type": "application/json",
                   "Accept": "application/json"}
        if arg_0.token:
            arg_3["W-Token"] = "%s" % arg_0.token
        arg_4 = WhenIWork_DAO().postURL(arg_1, arg_3, json.dumps(arg_2))

        if not (arg_4.status == 200 or arg_4.status == 204):
            raise DataFailureException(arg_1, arg_4.status, arg_4.data)

        return json.loads(arg_4.data)


return (self.post(name=name, ip_address=ip_address)
                .get(self.singular, None))

def Func ( arg_0 , arg_1 , arg_2 ) : return ( arg_0 . post ( arg_1 = arg_1 , arg_2 = arg_2 ) . get ( arg_0 . singular , None ) )

def Func(arg_0, arg_1, arg_2):
        """
        Creates a new domain

        Parameters
        ----------
        name: str
            new domain name
        ip_address: str
            IP address for the new domain
        """
        return (arg_0.post(arg_1=arg_1, arg_2=arg_2)
                .get(arg_0.singular, None))


(self, name, values, ttl=60, weight=None, region=None,
                     set_identifier=None, alias_hosted_zone_id=None,
                     alias_dns_name=None)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( AResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60, arg_4=None, arg_5=None,
                     arg_6=None, arg_7=None,
                     arg_8=None):
        """
        Creates and returns an A record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :keyword int weight: *For weighted record sets only*. Among resource record
            sets that have the same combination of DNS name and type, a value
            that determines what portion of traffic for the current resource
            record set is routed to the associated location. Ranges from 0-255.
        :keyword str region: *For latency-based record sets*. The Amazon EC2 region
            where the resource that is specified in this resource record set
            resides.
        :keyword str set_identifier: *For weighted and latency resource record
            sets only*. An identifier that differentiates among multiple
            resource record sets that have the same combination of DNS name
            and type. 1-128 chars.
        :keyword str alias_hosted_zone_id: Alias A records have this specified.
            It appears to be the hosted zone ID for the ELB the Alias points at.
        :keyword str alias_dns_name: Alias A records have this specified. It is
            the DNS name for the ELB that the Alias points to.
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created
            :py:class:`AResourceRecordSet <route53.resource_record_set.AResourceRecordSet>`
            instance.
        """

        arg_0._halt_if_already_deleted()

        # Grab the params/kwargs here for brevity's sake.
        arg_2 = locals()
        del arg_2['self']

        return arg_0._add_record(AResourceRecordSet, **arg_2)

Creates and returns an A record attached to this hosted zone .


(self, endpoint, url_data=None, parameters=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None ) : try : arg_4 = '%s/%s' % ( arg_0 . baseFunc , arg_0 . endpoints [ arg_1 ] ) except KeyError : raise EndPointDoesNotExist ( arg_1 ) if arg_2 : arg_4 = arg_4 % arg_2 if arg_3 : arg_4 = '%s?%s' % ( arg_4 , urllib . urlencode ( arg_3 , True ) ) return arg_4

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Generate URL on the modularized endpoints and url parameters"""
        try:
            arg_4 = '%s/%s' % (arg_0.baseFunc, arg_0.endpoints[arg_1])
        except KeyError:
            raise EndPointDoesNotExist(arg_1)
        if arg_2:
            arg_4 = arg_4 % arg_2
        if arg_3:
            # url = url?key=value&key=value&key=value...
            arg_4 = '%s?%s' % (arg_4, urllib.urlencode(arg_3, True))
        return arg_4


def Func ( arg_0 , ** arg_1 ) : arg_2 = arg_1 . pop ( 'debias' , True ) arg_3 = arg_1 . get ( 'axis' , - 1 ) if arg_2 : arg_0 = _remove_bias ( arg_0 , arg_3 ) arg_1 [ 'debias' ] = False return _crosscov ( arg_0 , arg_0 , ** arg_1 )

def Func(arg_0, **arg_1):
    """Returns the autocovariance of signal s at all lags.

    Adheres to the definition
    sxx[k] = E{S[n]S[n+k]} = cov{S[n],S[n+k]}
    where E{} is the expectation operator, and S is a zero mean process
    """
    # only remove the mean once, if needed
    arg_2 = arg_1.pop('debias', True)
    arg_3 = arg_1.get('axis', -1)
    if arg_2:
        arg_0 = _remove_bias(arg_0, arg_3)
    arg_1['debias'] = False
    return _crosscov(arg_0, arg_0, **arg_1)

Returns the autocovariance of signal s at all lags .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
arg_0
.
connection
is
and
arg_1
!=
'connect'
:
arg_0
.
reply
(
'error'
,
reason
=
'Must connect first'
)
return
if
arg_1
==
'method'
:
if
(
'method'
not
in
arg_2
)
or
(
'id'
not
in
arg_2
)
:
arg_0
.
reply
(
'error'
,
error
=
400
,
reason
=
'Malformed method invocation'
,
)
return
try
:
arg_3
=
getattr
(
arg_0
,
'recv_%s'
%
arg_1
)
except
(
AttributeError
,
UnicodeEncodeError
)
:
raise
MeteorError
(
404
,
'Method not found'
)
validate_kwargs
(
arg_3
,
arg_2
)
arg_3
(
**
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """Dispatch msg to appropriate recv_foo handler."""
        # enforce calling 'connect' first
        if arg_0.connection is None and arg_1 != 'connect':
            arg_0.reply('error', reason='Must connect first')
            return
        if arg_1 == 'method':
            if (
                'method' not in arg_2
            ) or (
                'id' not in arg_2
            ):
                arg_0.reply(
                    'error', error=400, reason='Malformed method invocation',
                )
                return

        # lookup method handler
        try:
            arg_3 = getattr(arg_0, 'recv_%s' % arg_1)
        except (AttributeError, UnicodeEncodeError):
            raise MeteorError(404, 'Method not found')

        # validate handler arguments
        validate_kwargs(arg_3, arg_2)

        # Func to handler
        arg_3(**arg_2)

Dispatch msg to appropriate recv_foo handler .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_conn ( ) . Func ( DatabaseName = arg_1 , Name = arg_2 ) return arg_3 [ 'Table' ]

def Func(arg_0, arg_1, arg_2):
        """
        Get the information of the table

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table
        :type table_name: str
        :rtype: dict

        >>> hook = AwsGlueCatalogHook()
        >>> r = hook.Func('db', 'table_foo')
        >>> r['Name'] = 'table_foo'
        """

        arg_3 = arg_0.get_conn().Func(DatabaseName=arg_1, Name=arg_2)

        return arg_3['Table']

Get the information of the table

        :param database_name: Name of hive database (schema) @table belongs to
        :type database_name: str
        :param table_name: Name of hive table
        :type table_name: str
        :rtype: dict

        >>> hook = AwsGlueCatalogHook()
        >>> r = hook.get_table('db', 'table_foo')
        >>> r['Name'] = 'table_foo'


(self, service_name, deployment_name, role_name, system_config,
                 os_virtual_hard_disk, network_config=None,
                 availability_set_name=None, data_virtual_hard_disks=None,
                 role_size=None, role_type='PersistentVMRole',
                 resource_extension_references=None,
                 provision_guest_agent=None, vm_image_name=None,
                 media_location=None)

return self._perform_post(
            self._get_role_path(service_name, deployment_name),
            _XmlSerializer.add_role_to_xml(
                role_name,
                system_config,
                os_virtual_hard_disk,
                role_type,
                network_config,
                availability_set_name,
                data_virtual_hard_disks,
                role_size,
                resource_extension_references,
                provision_guest_agent,
                vm_image_name,
                media_location),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                 arg_5, arg_6=None,
                 arg_7=None, arg_8=None,
                 arg_9=None, arg_10='PersistentVMRole',
                 arg_11=None,
                 arg_12=None, arg_13=None,
                 arg_14=None):
        '''
        Adds a virtual machine to an existing deployment.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        system_config:
            Contains the metadata required to provision a virtual machine from
            a Windows or Linux OS image.  Use an instance of
            WindowsConfigurationSet or LinuxConfigurationSet.
        os_virtual_hard_disk:
            Contains the parameters Windows Azure uses to create the operating
            system disk for the virtual machine. If you are creating a Virtual
            Machine by using a VM Image, this parameter is not used.
        network_config:
            Encapsulates the metadata required to create the virtual network
            configuration for a virtual machine. If you do not include a
            network configuration set you will not be able to access the VM
            through VIPs over the internet. If your virtual machine belongs to
            a virtual network you can not specify which subnet address space
            it resides under.
        availability_set_name:
            Specifies the name of an availability set to which to add the
            virtual machine. This value controls the virtual machine allocation
            in the Windows Azure environment. Virtual machines specified in the
            same availability set are allocated to different nodes to maximize
            availability.
        data_virtual_hard_disks:
            Contains the parameters Windows Azure uses to create a data disk
            for a virtual machine.
        role_size:
            The size of the virtual machine to allocate. The default value is
            Small. Possible values are: ExtraSmall, Small, Medium, Large,
            ExtraLarge. The specified value must be compatible with the disk
            selected in the OSVirtualHardDisk values.
        role_type:
            The type of the role for the virtual machine. The only supported
            value is PersistentVMRole.
        resource_extension_references:
            Optional. Contains a collection of resource extensions that are to
            be installed on the Virtual Machine. This element is used if
            provision_guest_agent is set to True.
        provision_guest_agent:
            Optional. Indicates whether the VM Agent is installed on the
            Virtual Machine. To run a resource extension in a Virtual Machine,
            this service must be installed.
        vm_image_name:
            Optional. Specifies the name of the VM Image that is to be used to
            create the Virtual Machine. If this is specified, the
            system_config and network_config parameters are not used.
        media_location:
            Optional. Required if the Virtual Machine is being created from a
            published VM Image. Specifies the location of the VHD file that is
            created when VMImageName specifies a published VM Image.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        return arg_0._perform_post(
            arg_0._get_role_path(arg_1, arg_2),
            _XmlSerializer.Func_to_xml(
                arg_3,
                arg_4,
                arg_5,
                arg_10,
                arg_6,
                arg_7,
                arg_8,
                arg_9,
                arg_11,
                arg_12,
                arg_13,
                arg_14),
            as_async=True)

Adds a virtual machine to an existing deployment .


def
Func
(
arg_0
)
:
if
not
arg_0
.
socket
:
logging
.
warning
(
"No active socket to close!"
)
return
arg_0
.
socket
.
close
(
)
arg_0
.
socket
=

def Func(arg_0):
        """
        Ends our server tcp connection.
        """
        # If we are not connected, return error.
        if not arg_0.socket:
            logging.warning("No active socket to close!")
            return
        # Close our socket.
        arg_0.socket.close()
        arg_0.socket = None


Return a new Streamlet by joining join_streamlet with this streamlet

(self, join_streamlet, window_config, join_function)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : from heronpy . streamlet . impl . Funcbolt import JoinStreamlet , JoinBolt arg_4 = JoinStreamlet ( JoinBolt . INNER , arg_2 , arg_3 , arg_0 , arg_1 ) arg_0 . _add_child ( arg_4 ) arg_1 . _add_child ( arg_4 ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
    """Return a new Streamlet by Funcing Func_streamlet with this streamlet
    """
    from heronpy.streamlet.impl.Funcbolt import JoinStreamlet, JoinBolt
    arg_4 = JoinStreamlet(JoinBolt.INNER, arg_2,
                                          arg_3, arg_0, arg_1)
    arg_0._add_child(arg_4)
    arg_1._add_child(arg_4)
    return arg_4


(entries, username, idfile, command, tunnel,
                     parallel=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                     arg_5=False):
    """
    Runs the given command over SSH in parallel on all hosts in `entries`.

    :param entries: The host entries the hostnames from.
    :type entries: ``list`` of :py:class:`HostEntry`
    :param username: To use a specific username.
    :type username: ``str`` or ``NoneType``
    :param idfile: The SSH identity file to use, or none.
    :type idfile: ``str`` or ``NoneType``
    :param command: The command to run.
    :type command: ``str``
    :param parallel: If true, commands will be run in parallel.
    :type parallel: ``bool``
    """
    if len(arg_0) == 0:
        print('(No hosts to run command on)')
        return 1
    if arg_3.strip() == '' or arg_3 is None:
        raise ValueError('No command given')
    print('Running command {0} on {1} matching hosts'
          .format(green(repr(arg_3)), len(arg_0)))
    arg_6 = []
    for arg_7 in arg_0:
        arg_8 = arg_7.hostname or arg_7.public_ip
        arg_9 = _build_ssh_command(arg_8, arg_1, arg_2, arg_3, arg_4)
        arg_6.append({
            'command': arg_9,
            'description': arg_7.display()
        })
    stream_commands(arg_6, arg_5=arg_5)
    print(green('All commands finished'))

Runs the given command over SSH in parallel on all hosts in entries .


return ParseNode(self.node_type,
                     children=new_children,
                     consumed=self.consumed,
                     position=self.position,
                     ignored=self.ignored)

def Func ( arg_0 , arg_1 = arg_2 ) : arg_3 = [ ] for arg_4 in arg_0 . children : if isinstance ( arg_4 , ParseNode ) : arg_5 = arg_4 . Func ( arg_1 ) else : arg_5 = arg_4 if not arg_1 ( arg_5 , arg_0 ) : arg_3 . append ( arg_5 ) return ParseNode ( arg_0 . node_type , children = arg_3 , consumed = arg_0 . consumed , position = arg_0 . position , ignored = arg_0 . ignored )

def Func(arg_0, arg_1=arg_2):
    """Trim a ParseTree.

    A node is Func if pred(node) returns True.
    """
    arg_3 = []

    for arg_4 in arg_0.children:
      if isinstance(arg_4, ParseNode):
        arg_5 = arg_4.Func(arg_1)
      else:
        arg_5 = arg_4

      if not arg_1(arg_5, arg_0):
        arg_3.append(arg_5)

    return ParseNode(arg_0.node_type,
                     children=arg_3,
                     consumed=arg_0.consumed,
                     position=arg_0.position,
                     ignored=arg_0.ignored)

Trim a ParseTree.

    A node is trimmed if pred(node) returns True.


def
Func
(
arg_0
,
arg_1
)
:
Log
.
info
(
"Start processes"
)
arg_2
=
{
}
for
(
arg_3
,
arg_4
)
in
arg_1
.
items
(
)
:
arg_5
=
arg_0
.
_run_process
(
arg_3
,
arg_4
)
arg_2
[
arg_5
.
pid
]
=
ProcessInfo
(
arg_5
,
arg_3
,
arg_4
)
log_pid_for_process
(
arg_3
,
arg_5
.
pid
)
with
arg_0
.
process_lock
:
arg_0
.
processes_to_monitor
.
update
(
arg_2
)

def Func(arg_0, arg_1):
    """Start all commands and add them to the dict of processes to be monitored """
    Log.info("Start processes")
    arg_2 = {}
    # First start all the processes
    for (arg_3, arg_4) in arg_1.items():
      arg_5 = arg_0._run_process(arg_3, arg_4)
      arg_2[arg_5.pid] = ProcessInfo(arg_5, arg_3, arg_4)

      # Log down the pid file
      log_pid_for_process(arg_3, arg_5.pid)

    with arg_0.process_lock:
      arg_0.processes_to_monitor.update(arg_2)


(self, from_node, to_node, edge_type="", **args)

def Func(arg_0, arg_1, arg_2, arg_3="", **arg_4):
        """draw an Func from a node to another.
        """
        arg_0._stream.write(
            '%s%sFunc: {sourcename:"%s" targetname:"%s"'
            % (arg_0._indent, arg_3, arg_1, arg_2)
        )
        arg_0._write_attributes(EDGE_ATTRS, **arg_4)
        arg_0._stream.write("}\n")


(self, other_trajectory, used_runs, allowed_translations, ignore_data)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Merges all links"""
        arg_5 = arg_1._linked_by
        arg_6 = set([f(-1) for f in arg_1._wildcard_functions.values()])
        if len(arg_5) > 0:
            arg_0._logger.info('Merging potential links!')
            for arg_7 in arg_1._linked_by:
                if arg_7 in arg_4:
                    continue
                arg_8 = arg_7.split('.')
                if any(arg_9 in arg_6 for arg_9 in arg_8):
                    arg_0._logger.warning('Ignoring all links linking to `%s` because '
                                     'I don`t know how to resolve links under `%s` nodes.' %
                                     (arg_7, str(arg_6)))
                    continue
                arg_10 = arg_1._linked_by[arg_7]
                arg_8 = arg_7.split('.')
                if all(arg_9 in arg_3 for arg_9 in arg_8):
                    arg_11 = arg_0._rename_full_name(arg_7,
                                                                  arg_1,
                                                                  arg_2=arg_2)
                else:
                    arg_11 = arg_7

                for arg_12, arg_13 in arg_10.values():

                    arg_14 = arg_12.v_full_name
                    arg_8 = arg_14 .split('.')
                    if any(arg_9 in arg_6 for arg_9 in arg_8):
                        arg_0._logger.warning('Ignoring links under `%s` because '
                                             'I don`t know how to resolve links '
                                             'under a `%s` node.' %
                                             (arg_14, str(arg_6)))

                    arg_8 = arg_14 .split('.')
                    if any(arg_9 in arg_3 for arg_9 in arg_8):
                        arg_15 = arg_0._rename_full_name(arg_14,
                                                                      arg_1,
                                                                      arg_2=arg_2)
                    else:
                        arg_15 = arg_14

                    for arg_16 in arg_13:
                        if (arg_14 + '.' + arg_16) in arg_4:
                            continue
                        if arg_16 in arg_6:
                            arg_0._logger.warning('Ignoring link `%s` under `%s` because '
                                                 'I don`t know how to resolve '
                                                 'links named as `%s`.' %
                                                 (arg_16,
                                                  arg_14,
                                                  str(arg_6)))
                            continue

                        try:
                            arg_17 = arg_0.f_get(arg_11,
                                                         shortcuts=False)
                            if arg_0.f_contains(arg_15):
                                arg_18 = arg_0.f_get(arg_15,
                                                              shortcuts=False)
                            else:
                                arg_18 =  arg_0.f_add_group(arg_15)
                            if arg_16 in arg_3:
                                arg_19, arg_20 = arg_1._reversed_wildcards[arg_16]
                                arg_16 = arg_0.f_wildcard(arg_20[0], arg_2[arg_19[0]])
                            if not arg_16 in arg_18._links:
                                arg_18.f_add_link(arg_16, arg_17)
                            else:
                                arg_0._logger.debug('Link `%s` exists already under `%s`.' %
                                                    (arg_16, arg_17.v_full_name))
                        except (AttributeError, ValueError) as exc:
                            arg_0._logger.error('Could not copy link `%s` under `%s` linking '
                                               'to `%s` due to `%s`' %
                                               (arg_16, arg_14, arg_7,
                                                repr(exc)))


(s, region_size=40, max_mem=1e9, **kwargs)

def Func ( arg_0 , arg_1 = 40 , arg_2 = 1e9 , ** arg_3 ) : arg_1 = np . array ( arg_1 ) . astype ( 'int' ) def calc_mem_usage ( arg_1 ) : arg_4 = np . array ( arg_1 ) arg_5 = separate_particles_into_groups ( arg_0 , arg_1 = arg_4 . tolist ( ) , ** arg_3 ) arg_6 = [ np . size ( g ) for g in arg_5 ] arg_7 = [ arg_5 [ i ] for i in np . argsort ( arg_6 ) [ - 5 : ] ] def get_tile_jsize ( arg_8 ) : arg_9 = arg_0 . param_particle ( arg_8 ) arg_10 = arg_0 . get_update_io_tiles ( arg_9 , arg_0 . get_values ( arg_9 ) ) [ 2 ] return arg_10 . shape . prod ( ) * len ( arg_9 ) arg_11 = [ 8 * get_tile_jsize ( g ) for g in arg_7 ] return np . max ( arg_11 ) arg_12 = arg_0 . oshape . shape if calc_mem_usage ( arg_1 ) > arg_2 : while ( ( calc_mem_usage ( arg_1 ) > arg_2 ) and np . any ( arg_1 > 2 ) ) : arg_1 = np . clip ( arg_1 - 1 , 2 , arg_12 ) else : while ( ( calc_mem_usage ( arg_1 ) < arg_2 ) and np . any ( arg_1 < arg_12 ) ) : arg_1 = np . clip ( arg_1 + 1 , 2 , arg_12 ) arg_1 -= 1 return arg_1

def Func(arg_0, arg_1=40, arg_2=1e9, **arg_3):
    """
    Finds the biggest region size for LM particle optimization with a
    given memory constraint.

    Input Parameters
    ----------------
        s : :class:`peri.states.ImageState`
            The state with the particles
        region_size : Int or 3-element list-like of ints, optional.
            The initial guess for the region size. Default is 40
        max_mem : Numeric, optional
            The maximum memory for the optimizer to take. Default is 1e9

    Other Parameters
    ----------------
        bounds: 2-element list-like of 3-element lists.
            The sub-region of the image over which to look for particles.
                bounds[0]: The lower-left  corner of the image region.
                bounds[1]: The upper-right corner of the image region.
            Default (None -> ([0,0,0], s.oshape.shape)) is a box of the entire
            image size, i.e. the default places every particle in the image
            somewhere in the groups.
    Returns
    -------
        region_size : numpy.ndarray of ints of the region size.
    """
    arg_1 = np.array(arg_1).astype('int')

    def calc_mem_usage(arg_1):
        arg_4 = np.array(arg_1)
        arg_5 = separate_particles_into_groups(arg_0, arg_1=
                arg_4.tolist(), **arg_3)
        # The actual mem usage is the max of the memory usage of all the
        # particle groups. However this is too slow. So instead we use the
        # max of the memory of the biggest 5 particle groups:
        arg_6 = [np.size(g) for g in arg_5]
        arg_7 = [arg_5[i] for i in np.argsort(arg_6)[-5:]]
        def get_tile_jsize(arg_8):
            arg_9 = arg_0.param_particle(arg_8)
            arg_10 = arg_0.get_update_io_tiles(arg_9, arg_0.get_values(arg_9))[2]
            return arg_10.shape.prod() * len(arg_9)
        arg_11 = [8*get_tile_jsize(g) for g in arg_7]  # 8 for bytes/float64
        return np.max(arg_11)

    arg_12 = arg_0.oshape.shape
    if calc_mem_usage(arg_1) > arg_2:
        while ((calc_mem_usage(arg_1) > arg_2) and
                np.any(arg_1 > 2)):
            arg_1 = np.clip(arg_1-1, 2, arg_12)
    else:
        while ((calc_mem_usage(arg_1) < arg_2) and
                np.any(arg_1 < arg_12)):
            arg_1 = np.clip(arg_1+1, 2, arg_12)
        arg_1 -= 1 #need to be < memory, so we undo 1 iteration

    return arg_1

Finds the biggest region size for LM particle optimization with a given memory constraint .


def Func ( arg_0 , arg_1 , arg_2 = 1 ) : arg_3 = arg_0 . _perform_request ( '/um/groups/%s/users?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) return arg_3

def Func(arg_0, arg_1, arg_2=1):
        """
        Retrieves a list of all users that are members of a particular group.

        :param      group_id: The unique ID of the group.
        :type       group_id: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        arg_3 = arg_0._perform_request(
            '/um/groups/%s/users?depth=%s' % (arg_1, str(arg_2)))

        return arg_3

Retrieves a list of all users that are members of a particular group .


return dt.date.today().year + _delta(past, min_delta, max_delta)

def Func ( arg_0 = False , arg_1 = 0 , arg_2 = 20 ) : return dt . date . today ( ) . Func + _delta ( arg_0 , arg_1 , arg_2 )

def Func(arg_0=False, arg_1=0, arg_2=20):
    """Return a random Func."""
    return dt.date.today().Func + _delta(arg_0, arg_1, arg_2)


(self, fieldnames=None, datemap=None, time_format=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''
        Output a cursor to a filename or stdout if filename is "-".
        fmt defines whether we output CSV or JSON.
        '''

        if arg_0._format == 'csv':
            arg_4 = arg_0.printCSVCursor(arg_1, arg_2, arg_3)
        else:
            arg_4 = arg_0.printJSONCursor( arg_1, arg_2, arg_3)

        return arg_4

Output a cursor to a filename or stdout if filename is - . fmt defines whether we output CSV or JSON .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . get_type ( arg_1 ) arg_4 = "format_%s" % str ( arg_2 ) if not hasattr ( arg_3 , arg_4 ) : return False return True

def Func(arg_0, arg_1, arg_2):
        """
        Check if format is known for given type.

        Returns boolean indicating if format is valid for the specified type.
        """

        arg_3 = arg_0.get_type(arg_1)

        arg_4 = "format_%s" % str(arg_2)
        if not hasattr(arg_3, arg_4):
            return False

        return True

Check if format is known for given type .


(sample_id, assembly_file, coverage_file, coverage_bp_file, bam_file,
         opts, gsize)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
         arg_5, arg_6):
    """Main executor of the process_assembly_mapping template.

    Parameters
    ----------
    sample_id : str
        Sample Identification string.
    assembly_file : str
        Path to assembly file in Fasta format.
    coverage_file : str
        Path to TSV file with coverage information for each contig.
    coverage_bp_file : str
        Path to TSV file with coverage information for each base.
    bam_file : str
        Path to BAM file.
    opts : list
        List of options for processing assembly mapping.
    gsize : int
        Expected genome size

    """

    arg_7, arg_8 = arg_5

    logger.info("Starting assembly mapping processing")

    # Get coverage info, total size and total coverage from the assembly
    logger.info("Parsing coverage table")
    arg_9, arg_10 = parse_coverage_table(arg_2)
    arg_11, arg_12 = get_assembly_size(arg_1)
    logger.info("Assembly processed with a total size of '{}' and coverage"
                " of '{}'".format(arg_11, arg_10))
    # Get number of assembled bp after filters
    logger.info("Parsing coverage per bp table")
    arg_13 = get_coverage_from_file(arg_3)

    # Assess the minimum assembly coverage
    arg_14 = evaluate_min_coverage(arg_7, arg_10, arg_11)

    # Check if filtering the assembly using the provided min_coverage will
    # reduce the final bp number to less than 80% of the estimated genome
    # size.
    # If the check below passes with True, then the filtered assembly
    # is above the 80% genome size threshold.
    arg_15 = "{}_filt.fasta".format(
        os.path.splitext(arg_1)[0])
    arg_16 = "filtered.bam"
    logger.info("Checking filtered assembly")
    if check_filtered_assembly(arg_9, arg_13, arg_14,
                               arg_6, arg_12, int(arg_8),
                               arg_0):
        # Filter assembly contigs based on the minimum coverage.
        logger.info("Filtered assembly passed minimum size threshold")
        logger.info("Writting filtered assembly")
        filter_assembly(arg_1, arg_14, arg_9,
                        arg_15)
        logger.info("Filtering BAM file according to saved contigs")
        filter_bam(arg_9, arg_4, arg_14, arg_16)
    # Could not filter the assembly as it would drop below acceptable
    # length levels. Copy the original assembly to the output assembly file
    # for compliance with the output channel
    else:
        shutil.copy(arg_1, arg_15)
        shutil.copy(arg_4, arg_16)
        shutil.copy(arg_4 + ".bai", arg_16 + ".bai")

    with open(".status", "w") as status_fh:
        status_fh.write("pass")

Main executor of the process_assembly_mapping template .


def Func(arg_0):
        """ Broadcast a transaction to the blockchain network

            :param tx tx: Signed transaction to Func
        """
        # Sign if not signed
        if not arg_0._is_signed():
            arg_0.sign()

        # Cannot Func an empty transaction
        if "operations" not in arg_0 or not arg_0["operations"]:
            log.warning("No operations in transaction! Returning")
            return

        # Obtain JS
        arg_1 = arg_0.json()

        # Debugging mode does not Func
        if arg_0.blockchain.noFunc:
            log.warning("Not Funcing anything!")
            arg_0.clear()
            return arg_1

        # Broadcast
        try:
            if arg_0.blockchain.blocking:
                arg_1 = arg_0.blockchain.rpc.Func_transaction_synchronous(
                    arg_1, api="network_Func"
                )
                arg_1.update(**arg_1.get("trx", {}))
            else:
                arg_0.blockchain.rpc.Func_transaction(arg_1, api="network_Func")
        except Exception as e:
            raise e
        finally:
            arg_0.clear()

        return arg_1

Broadcast a transaction to the blockchain network

            :param tx tx: Signed transaction to broadcast


def
Func
(
arg_0
)
:
arg_1
=
os
.
path
.
join
(
arg_0
.
profile_dir
.
pid_dir
,
arg_0
.
name
+
u'.pid'
)
if
os
.
path
.
isfile
(
arg_1
)
:
with
open
(
arg_1
,
'r'
)
as
f
:
arg_2
=
f
.
read
(
)
.
strip
(
)
try
:
arg_3
=
int
(
arg_2
)
except
:
raise
PIDFileError
(
"invalid pid file: %s (contents: %r)"
%
(
arg_1
,
arg_2
)
)
return
arg_3
else
:
raise
PIDFileError
(
'pid file not found: %s'
%
arg_1
)

def Func(arg_0):
        """Get the pid from the pid file.

        If the  pid file doesn't exist a :exc:`PIDFileError` is raised.
        """
        arg_1 = os.path.join(arg_0.profile_dir.pid_dir, arg_0.name + u'.pid')
        if os.path.isfile(arg_1):
            with open(arg_1, 'r') as f:
                arg_2 = f.read().strip()
                try:
                    arg_3 = int(arg_2)
                except:
                    raise PIDFileError("invalid pid file: %s (contents: %r)"%(arg_1, arg_2))
                return arg_3
        else:
            raise PIDFileError('pid file not found: %s' % arg_1)


def Func ( arg_0 , arg_1 , arg_2 ) : from numpy import log , array arg_3 = log ( arg_1 ) + 3. * ( arg_2 + 1. ) / float ( arg_0 ) return arg_3

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

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

    :validation: double checked versus octave.
    """
    from numpy import log, array
    arg_3 = log(arg_1) + 3. * (arg_2+1.) /float(arg_0)
    return arg_3

r"""Kullback information criterion

    .. math:: KIC(k) = log(\rho_k) + 3 \frac{k+1}{N}

    :validation: double checked versus octave.


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
re
.
match
(
"\s$"
,
arg_0
)
:
arg_0
=
"{}: "
.
format
(
arg_0
)
while
True
:
if
sys
.
version_info
[
0
]
>
2
:
arg_2
=
input
(
arg_0
)
else
:
arg_2
=
raw_input
(
arg_0
)
if
not
arg_1
or
arg_2
in
arg_1
:
break
return
arg_2

def Func(arg_0, arg_1=None):
    """echo a Func to the user and wait for an answer

    question -- string -- the Func for the user
    choices -- list -- if given, only exit when Func matches one of the choices
    return -- string -- the answer that was given by the user
    """

    if not re.match("\s$", arg_0):
        arg_0 = "{}: ".format(arg_0)

    while True:
        if sys.version_info[0] > 2:
            arg_2 = input(arg_0)

        else:
            arg_2 = raw_input(arg_0)

        if not arg_1 or arg_2 in arg_1:
            break

    return arg_2

echo a prompt to the user and wait for an answer

    question -- string -- the prompt for the user
    choices -- list -- if given, only exit when prompt matches one of the choices
    return -- string -- the answer that was given by the user


def Func(arg_0, arg_1):
        """
        Translates a register ID from the disassembler object into the
        register name based on manticore's alias in the register file

        :param int reg_id: Register ID
        """
        if arg_1 >= X86_REG_ENDING:
            logger.warning("Trying to get register name for a non-register")
            return None
        arg_2 = arg_0.cpu.instruction.reg_name(arg_1)
        if arg_2 is None or arg_2.lower() == '(invalid)':
            return None
        return arg_0.cpu._regfile._alias(arg_2.upper())

Translates a register ID from the disassembler object into the register name based on manticore s alias in the register file


def Func ( arg_0 ) : arg_1 = sum ( [ field . w for field in arg_0 . fields ] ) return arg_1

def Func(arg_0):
    """Returns the cumulative w for all the fields in the dataset"""

    arg_1 = sum([field.w for field in arg_0.fields])
    return arg_1


def Func(arg_0, arg_1, arg_2):
    """
    Takes a CryptoAPI RSA private key blob and converts it into the ASN.1
    structures for the public and private keys

    :param bit_size:
        The integer bit size of the key

    :param blob_struct:
        An instance of the advapi32.RSAPUBKEY struct

    :param blob:
        A byte string of the binary data after the header

    :return:
        A 2-element tuple of (asn1crypto.keys.PublicKeyInfo,
        asn1crypto.keys.PrivateKeyInfo)
    """

    arg_3 = arg_0 // 8
    arg_4 = arg_0 // 16

    arg_5 = arg_3
    arg_6 = arg_5 + arg_4
    arg_7 = arg_6 + arg_4
    arg_8 = arg_7 + arg_4
    arg_9 = arg_8 + arg_4
    arg_10 = arg_9 + arg_4

    arg_11 = arg_1.rsapubkey.pubexp
    arg_12 = int_from_bytes(arg_2[0:arg_5][::-1])
    arg_13 = int_from_bytes(arg_2[arg_5:arg_6][::-1])
    arg_14 = int_from_bytes(arg_2[arg_6:arg_7][::-1])
    arg_15 = int_from_bytes(arg_2[arg_7:arg_8][::-1])
    arg_16 = int_from_bytes(arg_2[arg_8:arg_9][::-1])
    arg_17 = int_from_bytes(arg_2[arg_9:arg_10][::-1])
    arg_18 = int_from_bytes(arg_2[arg_10:arg_10 + arg_3][::-1])

    arg_19 = keys.PublicKeyInfo({
        'algorithm': keys.PublicKeyAlgorithm({
            'algorithm': 'rsa',
        }),
        'public_key': keys.RSAPublicKey({
            'modulus': arg_12,
            'public_exponent': arg_11,
        }),
    })

    arg_20 = keys.RSAPrivateKey({
        'version': 'two-prime',
        'modulus': arg_12,
        'public_exponent': arg_11,
        'private_exponent': arg_18,
        'prime1': arg_13,
        'prime2': arg_14,
        'exponent1': arg_15,
        'exponent2': arg_16,
        'coefficient': arg_17,
    })

    arg_21 = keys.PrivateKeyInfo({
        'version': 0,
        'private_key_algorithm': keys.PrivateKeyAlgorithm({
            'algorithm': 'rsa',
        }),
        'private_key': arg_20,
    })

    return (arg_19, arg_21)

Takes a CryptoAPI RSA private key blob and converts it into the ASN . 1 structures for the public and private keys


def Func ( arg_0 , arg_1 = 0.0 ) : arg_2 = arg_0 . model . copy ( ) arg_2 += arg_1 * np . random . randn ( * arg_2 . shape ) arg_0 . set_image ( util . NullImage ( image = arg_2 ) )

def Func(arg_0, arg_1=0.0):
        """ Switch out the data for the model's recreation of the data. """
        arg_2 = arg_0.model.copy()
        arg_2 += arg_1*np.random.randn(*arg_2.shape)
        arg_0.set_image(util.NullImage(image=arg_2))

Switch out the data for the model s recreation of the data .


def Func ( arg_0 ) : arg_1 = anonymousmemmap ( arg_0 . shape , dtype = arg_0 . dtype ) arg_1 [ : ] = arg_0 [ : ] return arg_1

def Func(arg_0):
    """ Copy an array to the shared memory.

        Notes
        -----
        Func is not always necessary because the private memory is always Func-on-write.

        Use :code:`a = Func(a)` to immediately dereference the old 'a' on private memory
    """
    arg_1 = anonymousmemmap(arg_0.shape, dtype=arg_0.dtype)
    arg_1[:] = arg_0[:]
    return arg_1

Copy an array to the shared memory.

        Notes
        -----
        copy is not always necessary because the private memory is always copy-on-write.

        Use :code:`a = copy(a)` to immediately dereference the old 'a' on private memory


def
Func
(
arg_0
)
:
arg_1
,
arg_2
=
arg_0
.
read_next_data_block
(
)
arg_2
=
arg_2
.
view
(
'float32'
)
print
(
"AVG: %2.3f"
%
arg_2
.
mean
(
)
)
print
(
"STD: %2.3f"
%
arg_2
.
std
(
)
)
print
(
"MAX: %2.3f"
%
arg_2
.
max
(
)
)
print
(
"MIN: %2.3f"
%
arg_2
.
min
(
)
)
import
pylab
as
plt

def Func(arg_0):
        """ Compute some basic stats on the next block of data """

        arg_1, arg_2 = arg_0.read_next_data_block()
        arg_2 = arg_2.view('float32')

        print("AVG: %2.3f" % arg_2.mean())
        print("STD: %2.3f" % arg_2.std())
        print("MAX: %2.3f" % arg_2.max())
        print("MIN: %2.3f" % arg_2.min())

        import pylab as plt


def Func(arg_0, arg_1):
        """ Search the play store for an app.

        nb_result (int): is the maximum number of result to be returned

        offset (int): is used to take result starting from an index.
        """
        if arg_0.authSubToken is None:
            raise LoginError("You need to login before executing any request")

        arg_2 = SEARCH_URL + "?c=3&q={}".format(requests.utils.quote(arg_1))
        # FIXME: not sure if this toc call should be here
        arg_0.toc()
        arg_3 = arg_0.executeRequestApi2(arg_2)
        if utils.hasPrefetch(arg_3):
            arg_4 = arg_3.preFetch[0].response
        else:
            arg_4 = arg_3
        arg_5 = arg_4.payload.listResponse.doc
        return list(map(utils.parseProtobufObj, arg_5))


def Func ( arg_0 ) : arg_0 . clear ( ) for arg_1 in reversed ( arg_0 . columns ) : del arg_0 [ arg_1 . name ]

def Func(arg_0):
        "Remove all items and column headings"
        arg_0.clear()
        for arg_1 in reversed(arg_0.columns):
            del arg_0[arg_1.name]


def Func ( arg_0 , arg_1 = False , arg_2 = None ) : with tf . compat . v1 . name_scope ( arg_2 , "Func" , [ arg_0 ] ) : return amari_alpha ( arg_0 , alpha = 0. , arg_1 = arg_1 )

def Func(arg_0, arg_1=False, arg_2=None):
  """The reverse Kullback-Leibler Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  When `self_normalized = True`, the KL-reverse Csiszar-function is:

  ```none
  f(u) = -log(u) + (u - 1)
  ```

  When `self_normalized = False` the `(u - 1)` term is omitted.

  Observe that as an f-Divergence, this Csiszar-function implies:

  ```none
  D_f[p, q] = KL[q, p]
  ```

  The KL is "reverse" because in maximum likelihood we think of minimizing `q`
  as in `KL[p, q]`.

  Warning: when self_normalized = True` this function makes non-log-space
  calculations and may therefore be numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    self_normalized: Python `bool` indicating whether `f'(u=1)=0`. When
      `f'(u=1)=0` the implied Csiszar f-Divergence remains non-negative even
      when `p, q` are unnormalized measures.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    Func_of_u: `float`-like `Tensor` of the Csiszar-function evaluated at
      `u = exp(logu)`.

  Raises:
    TypeError: if `self_normalized` is `None` or a `Tensor`.
  """

  with tf.compat.v1.name_scope(arg_2, "Func", [arg_0]):
    return amari_alpha(arg_0, alpha=0., arg_1=arg_1)

The reverse Kullback-Leibler Csiszar-function in log-space.

  A Csiszar-function is a member of,

  ```none
  F = { f:R_+ to R : f convex }.
  ```

  When `self_normalized = True`, the KL-reverse Csiszar-function is:

  ```none
  f(u) = -log(u) + (u - 1)
  ```

  When `self_normalized = False` the `(u - 1)` term is omitted.

  Observe that as an f-Divergence, this Csiszar-function implies:

  ```none
  D_f[p, q] = KL[q, p]
  ```

  The KL is "reverse" because in maximum likelihood we think of minimizing `q`
  as in `KL[p, q]`.

  Warning: when self_normalized = True` this function makes non-log-space
  calculations and may therefore be numerically unstable for `|logu| >> 0`.

  Args:
    logu: `float`-like `Tensor` representing `log(u)` from above.
    self_normalized: Python `bool` indicating whether `f'(u=1)=0`. When
      `f'(u=1)=0` the implied Csiszar f-Divergence remains non-negative even
      when `p, q` are unnormalized measures.
    name: Python `str` name prefixed to Ops created by this function.

  Returns:
    kl_reverse_of_u: `float`-like `Tensor` of the Csiszar-function evaluated at
      `u = exp(logu)`.

  Raises:
    TypeError: if `self_normalized` is `None` or a `Tensor`.

The reverse Kullback - Leibler Csiszar - function in log - space .


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Apply a measure instruction to a qubit.

        Args:
            qubit (int): qubit is the qubit measured.
            cmembit (int): is the classical memory bit to store outcome in.
            cregbit (int, optional): is the classical register bit to store outcome in.
        """
        # get measure outcome
        arg_4, arg_5 = arg_0._get_measure_outcome(arg_1)
        # update classical state
        arg_6 = 1 << arg_2
        arg_0._classical_memory = (arg_0._classical_memory & (~arg_6)) | (int(arg_4) << arg_2)

        if arg_3 is not None:
            arg_8 = 1 << arg_3
            arg_0._classical_register = \
                (arg_0._classical_register & (~arg_8)) | (int(arg_4) << arg_3)

        # update quantum state
        if arg_4 == '0':
            arg_10 = [[1 / np.sqrt(arg_5), 0], [0, 0]]
        else:
            arg_10 = [[0, 0], [0, 1 / np.sqrt(arg_5)]]
        # update classical state
        arg_0._add_unitary_single(arg_10, arg_1)

Apply a measure instruction to a qubit .


def Func(arg_0, arg_1, arg_2=None):
    """Make sure that the gene panels exist in the database
        Also check if the default panels are defined in gene panels

        Args:
            adapter(MongoAdapter)
            panels(list(str)): A list with panel names

        Returns:
            panels_exists(bool)
    """
    arg_2 = arg_2 or []
    arg_3 = True
    for arg_4 in arg_2:
        if arg_4 not in arg_1:
            log.warning("Default panels have to be defined in panels")
            arg_3 = False
    for arg_4 in arg_1:
        if not arg_0.gene_panel(arg_4):
            log.warning("Panel {} does not exist in database".format(arg_4))
            arg_3 = False
    return arg_3


def Func ( arg_0 , Func ) : arg_2 = [ ] for arg_3 , arg_4 , arg_5 in os . walk ( Func ) : for arg_6 in arg_5 : arg_7 = os . path . join ( arg_3 , arg_6 ) if arg_0 . _chooses_path ( arg_7 ) : arg_2 . append ( arg_0 . path ( arg_7 ) ) return arg_2

def Func(arg_0, Func):
        """Load all files from a folder recursively.

        Depending on :meth:`chooses_path` some paths may not be loaded.
        Every loaded path is processed and returned part of the returned list.

        :param str folder: the folder to load the files from
        :rtype: list
        :return: a list of the results of the processing steps of the loaded
          files
        """
        arg_2 = []
        for arg_3, arg_4, arg_5 in os.walk(Func):
            for arg_6 in arg_5:
                arg_7 = os.path.join(arg_3, arg_6)
                if arg_0._chooses_path(arg_7):
                    arg_2.append(arg_0.path(arg_7))
        return arg_2

Load all files from a folder recursively .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 , arg_4 = institute_and_case ( store , arg_0 , arg_1 ) arg_5 = request . form . get ( 'link' ) arg_6 = request . form . get ( 'content' ) arg_7 = request . args . get ( 'variant_id' ) arg_8 = store . user ( current_user . email ) if arg_2 : store . delete_event ( arg_2 ) else : if arg_7 : arg_9 = store . variant ( arg_7 ) arg_10 = request . form . get ( 'level' , 'specific' ) store . comment ( arg_3 , arg_4 , arg_8 , arg_5 , variant = arg_9 , arg_6 = arg_6 , comment_level = arg_10 ) else : store . comment ( arg_3 , arg_4 , arg_8 , arg_5 , arg_6 = arg_6 ) return redirect ( request . referrer )

def Func(arg_0, arg_1, arg_2=None):
    """Handle Func."""
    arg_3, arg_4 = institute_and_case(store, arg_0, arg_1)
    arg_5 = request.form.get('link')
    arg_6 = request.form.get('content')
    arg_7 = request.args.get('variant_id')
    arg_8 = store.user(current_user.email)

    if arg_2:
        # delete the event
        store.delete_event(arg_2)
    else:
        if arg_7:
            # create a variant comment
            arg_9 = store.variant(arg_7)
            arg_10 = request.form.get('level', 'specific')
            store.comment(arg_3, arg_4, arg_8, arg_5,
                          variant=arg_9, arg_6=arg_6, comment_level=arg_10)
        else:
            # create a case comment
            store.comment(arg_3, arg_4, arg_8, arg_5, arg_6=arg_6)

    return redirect(request.referrer)


return {
      tf.float16: True,
      tf.float32: True,
      tf.float64: True,
      tf.int8: True,
      tf.int16: True,
      tf.int32: True,
      tf.int64: True,
  }.get(dt.base_dtype, False)

def Func ( arg_0 ) : return { tf . float16 : True , tf . float32 : True , tf . float64 : True , tf . int8 : True , tf . int16 : True , tf . int32 : True , tf . int64 : True , } . get ( arg_0 . base_dtype , False )

def Func(arg_0):
  """Helper returning True if dtype is known to be signed."""
  return {
      tf.float16: True,
      tf.float32: True,
      tf.float64: True,
      tf.int8: True,
      tf.int16: True,
      tf.int32: True,
      tf.int64: True,
  }.get(arg_0.base_dtype, False)

Helper returning True if dtype is known to be signed .


def Func(arg_0, arg_1):
        """
        Returns the value this reference is pointing to. This method uses 'ctx' to resolve the reference and return
        the value this reference references.
        If the call was already made, it returns a cached result.
        It also makes sure there's no cyclic reference, and if so raises CyclicReferenceError.
        """
        if arg_0 in arg_1.call_nodes:
            raise CyclicReferenceError(arg_1, arg_0)

        if arg_0 in arg_1.cached_results:
            return arg_1.cached_results[arg_0]

        try:
            arg_1.call_nodes.add(arg_0)
            arg_1.call_stack.append(arg_0)

            arg_2 = arg_0.evaluate(arg_1)
            arg_1.cached_results[arg_0] = arg_2
            return arg_2
        except:
            if arg_1.exception_call_stack is None:
                arg_1.exception_call_stack = list(arg_1.call_stack)
            raise
        finally:
            arg_1.call_stack.pop()
            arg_1.call_nodes.remove(arg_0)

Returns the value this reference is pointing to . This method uses ctx to resolve the reference and return the value this reference references . If the call was already made it returns a cached result . It also makes sure there s no cyclic reference and if so raises CyclicReferenceError .


def Func(arg_0):
        """ Return the broadcasted Func
        """
        if not hasattr(arg_0, "_Func") and arg_0._path is not None:
            arg_0._Func = arg_0._load(arg_0._path)
        return arg_0._Func


(self, index, climate, hold_type="nextTransition")

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
"nextTransition"
)
:
arg_4
=
{
"selection"
:
{
"selectionType"
:
"thermostats"
,
"selectionMatch"
:
arg_0
.
thermostats
[
arg_1
]
[
'identifier'
]
}
,
"functions"
:
[
{
"type"
:
"setHold"
,
"params"
:
{
"holdType"
:
arg_3
,
"holdClimateRef"
:
arg_2
}
}
]
}
arg_5
=
"set climate hold"
return
arg_0
.
make_request
(
arg_4
,
arg_5
)

def Func(arg_0, arg_1, arg_2, arg_3="nextTransition"):
        ''' Set a climate hold - ie away, home, sleep '''
        arg_4 = {"selection": {
                    "selectionType": "thermostats",
                    "selectionMatch": arg_0.thermostats[arg_1]['identifier']},
                "functions": [{"type": "setHold", "params": {
                    "holdType": arg_3,
                    "holdClimateRef": arg_2
                }}]}
        arg_5 = "set climate hold"
        return arg_0.make_request(arg_4, arg_5)


def Func(arg_0, arg_1):
    '''This imports an API key from text and writes it to the cache dir.

    Use this with the JSON text copied from the API key text box on your
    LCC-Server user home page. The API key will thus be tied to the privileges
    of that user account and can then access objects, datasets, and collections
    marked as private for the user only or shared with that user.

    Parameters
    ----------

    lcc_server : str
        The base URL of the LCC-Server to get the API key for.

    apikey_text_json : str
        The JSON string from the API key text box on the user's LCC-Server home
        page at `lcc_server/users/home`.

    Returns
    -------

    (apikey, expiry) : tuple
        This returns a tuple with the API key and its expiry date.

    '''
    arg_2 = os.path.expanduser('~')
    arg_3 = os.path.join(arg_2,
                              '.astrobase',
                              'lccs',
                              'apikey-%s' % arg_0.replace(
                                  'https://',
                                  'https-'
                              ).replace(
                                  'http://',
                                  'http-'
                              ))

    arg_4 = json.loads(arg_1)

    #
    # now that we have an API key dict, get the API key out of it and write it
    # to the APIKEYFILE
    #
    arg_5 = arg_4['apikey']
    arg_6 = arg_4['expires']

    # write this to the apikey file

    if not os.path.exists(os.path.dirname(arg_3)):
        os.makedirs(os.path.dirname(arg_3))

    with open(arg_3,'w') as outfd:
        outfd.write('%s %s\n' % (arg_5, arg_6))

    # chmod it to the correct value
    os.chmod(arg_3, 0o100600)

    LOGINFO('key fetched successfully from: %s. expires on: %s' % (arg_0,
                                                                   arg_6))
    LOGINFO('written to: %s' % arg_3)

    return arg_5, arg_6

This imports an API key from text and writes it to the cache dir .


def Func ( arg_0 , arg_1 ) : arg_0 . PC = Operators . ITEBV ( arg_0 . address_bit_size , False == arg_0 . PF , arg_1 . read ( ) , arg_0 . PC )

def Func(arg_0, arg_1):
        """
        Jumps short if not parity.

        :param cpu: current CPU.
        :param target: destination operand.
        """
        arg_0.PC = Operators.ITEBV(arg_0.address_bit_size, False == arg_0.PF, arg_1.read(), arg_0.PC)


def Func ( arg_0 , arg_1 ) : arg_2 = [ arg_0 . net_input ] if arg_0 . learning_phase is not None : arg_2 . append ( K . learning_phase ( ) ) return K . function ( arg_2 , [ arg_0 . get_layer_output ( arg_1 ) ] )

def Func(arg_0, arg_1):
        '''Create a function for the response of a layer.'''
        arg_2 = [arg_0.net_input]
        if arg_0.learning_phase is not None:
            arg_2.append(K.learning_phase())
        return K.function(arg_2, [arg_0.get_layer_output(arg_1)])

Create a function for the response of a layer .


def Func(arg_0=None):
    """ Command line tool to make a md5sum comparison of two .fil files. """

    if 'bl' in local_host:
        arg_1 = '/usr/local/sigproc/bin/header' #Current location of header command in GBT.
    else:
        raise IOError('Script only able to run in BL systems.')

    arg_2 = OptionParser()
    arg_2.set_usage('matchfils <FIL_FILE1> <FIL_FILE2>')
    arg_3, arg_0 = arg_2.parse_args(sys.argv[1:])

    arg_4 = arg_0[0]
    arg_5 = arg_0[1]

    #------------------------------------
    #Create batch script

    make_batch_script()

    #------------------------------------
    #First checksum

    arg_6 = find_header_size(arg_4)
    arg_7 = os.path.getsize(arg_4)

    #Strip header from file, and calculate the md5sum of the rest.
    #command=['tail','-c',str(file_size1-headersize1),file1,'|','md5sum']
    arg_8=['./tail_sum.sh',arg_4,str(arg_7-arg_6)]
    print('[matchfils] '+' '.join(arg_8))

    arg_9 = subprocess.Popen(arg_8, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (arg_10, arg_11) = arg_9.communicate()

    arg_12 = arg_10.split()[0]
    print('[matchfils] Checksum is:', arg_12)

    if arg_11:
        raise Error('There is an error.')

    #---
    arg_10,arg_11 = reset_outs()

    arg_8=[arg_1,arg_4]
    print('[matchfils] Header information:')

    arg_9 = subprocess.Popen(arg_8, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (arg_10, arg_11) = arg_9.communicate()

    arg_13 = arg_10
    print(arg_13)

    #------------------------------------
    #Second checksum

    arg_10,arg_11 = reset_outs()

    arg_14 = find_header_size(arg_5)
    arg_15 = os.path.getsize(arg_5)

    #Strip header from file, and calculate the md5sum of the rest.
    arg_8=['./tail_sum.sh',arg_5,str(arg_15-arg_14)]
    print('[matchfils] '+' '.join(arg_8))

    arg_9 = subprocess.Popen(arg_8, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (arg_10, arg_11) = arg_9.communicate()

    arg_16 = arg_10.split()[0]
    print('[matchfils] Checksum is:', arg_16)

    if arg_11:
        raise Error('There is an error.')

    #---
    arg_10,arg_11 = reset_outs()

    arg_8=[arg_1,arg_5]
    print('[matchfils] Header information:')

    arg_9 = subprocess.Popen(arg_8, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    (arg_10, arg_11) = arg_9.communicate()

    arg_17 = arg_10
    print(arg_17)

    #------------------------------------
    #check the checksums

    if arg_12 != arg_16:
        print('[matchfils] Booo! Checksum does not match between files.')
    else:
        print('[matchfils] Hooray! Checksum matches between files.')

    #------------------------------------
    #Remove batch script

    os.remove('tail_sum.sh')

Command line tool to make a md5sum comparison of two . fil files .


def Func ( arg_0 , arg_1 ) : arg_2 = hashlib . sha512 ( unhexlify ( arg_0 ) ) . digest ( ) arg_3 = bytes ( str ( arg_1 ) , "ascii" ) + hexlify ( arg_2 ) arg_4 = hexlify ( hashlib . sha512 ( arg_3 ) . digest ( ) ) . decode ( "ascii" ) arg_5 = unhexlify ( arg_4 [ 0 : 64 ] ) arg_6 = unhexlify ( arg_4 [ 64 : 96 ] ) return AES . new ( arg_5 , AES . MODE_CBC , arg_6 )

def Func(arg_0, arg_1):
    """ Initialize AES instance

        :param hex shared_secret: Shared Secret to use as encryption key
        :param int nonce: Random nonce
        :return: AES instance
        :rtype: AES

    """
    " Shared Secret "
    arg_2 = hashlib.sha512(unhexlify(arg_0)).digest()
    " Seed "
    arg_3 = bytes(str(arg_1), "ascii") + hexlify(arg_2)
    arg_4 = hexlify(hashlib.sha512(arg_3).digest()).decode("ascii")
    " AES "
    arg_5 = unhexlify(arg_4[0:64])
    arg_6 = unhexlify(arg_4[64:96])
    return AES.new(arg_5, AES.MODE_CBC, arg_6)


def Func ( arg_0 ) : arg_1 = arg_0 . checker . is_domain_valid ( ) arg_2 = arg_0 . checker . is_ip_valid ( ) if "current_test_data" in arg_3 . INTERN : arg_3 . INTERN [ "current_test_data" ] . update ( { "domain_syntax_validation" : arg_1 , "ip4_syntax_validation" : arg_2 , } ) if ( arg_1 and not arg_2 or arg_1 or arg_3 . CONFIGURATION [ "local" ] ) : arg_3 . INTERN . update ( { "http_code" : HTTPCode ( ) . Func ( ) , "referer" : Referer ( ) . Func ( ) } ) if not arg_3 . INTERN [ "referer" ] : return arg_3 . INTERN [ "referer" ] if arg_3 . INTERN [ "referer" ] and not arg_0 . checker . is_subdomain ( ) : return arg_0 . _extract ( ) Logs ( ) . whois ( arg_0 . whois_record ) return None if ( arg_2 and not arg_1 or arg_2 or arg_3 . CONFIGURATION [ "local" ] ) : arg_3 . INTERN [ "http_code" ] = HTTPCode ( ) . Func ( ) Logs ( ) . whois ( arg_0 . whois_record ) return None Logs ( ) . whois ( arg_0 . whois_record ) return False

def Func(arg_0):  # pragma: no cover
        """
        Execute the logic behind the meaning of ExpirationDate + return the matched status.

        :return:
            The status of the tested domain.
            Can be one of the official status.
        :rtype: str
        """

        # We Func the status of the domain validation.
        arg_1 = arg_0.checker.is_domain_valid()
        # We Func the status of the IPv4 validation.
        arg_2 = arg_0.checker.is_ip_valid()

        if "current_test_data" in arg_3.INTERN:
            # The end-user want more information whith his test.

            # We update some index.
            arg_3.INTERN["current_test_data"].update(
                {
                    "domain_syntax_validation": arg_1,
                    "ip4_syntax_validation": arg_2,
                }
            )

        if (
            arg_1
            and not arg_2
            or arg_1
            or arg_3.CONFIGURATION["local"]
        ):
            # * The element is a valid domain.
            # and
            # * The element is not ahe valid IPv4.
            # or
            # * The element is a valid domain.

            # * We Func the HTTP status code of the currently tested element.
            # and
            # * We try to Func the element status from the IANA database.
            arg_3.INTERN.update(
                {"http_code": HTTPCode().Func(), "referer": Referer().Func()}
            )

            if not arg_3.INTERN["referer"]:
                # We could not Func the referer.

                # We parse the referer status into the upstream call.
                return arg_3.INTERN["referer"]

            # The WHOIS record status is not into our list of official status.

            if arg_3.INTERN["referer"] and not arg_0.checker.is_subdomain():
                # * The iana database comparison status is not None.
                # and
                # * The domain we are testing is not a subdomain.

                # We try to extract the expiration date from the WHOIS record.
                # And we return the matched status.
                return arg_0._extract()

            # The iana database comparison status is None.

            # We log our whois record if the debug mode is activated.
            Logs().whois(arg_0.whois_record)

            # And we return None, we could not extract the expiration date.
            return None

        if (
            arg_2
            and not arg_1
            or arg_2
            or arg_3.CONFIGURATION["local"]
        ):
            # * The element is a valid IPv4.
            # and
            # * The element is not a valid domain.
            # or
            # * The element is a valid IPv4.

            # We Func the HTTP status code.
            arg_3.INTERN["http_code"] = HTTPCode().Func()

            # We log our whois record if the debug mode is activated.
            Logs().whois(arg_0.whois_record)

            # And we return None, there is no expiration date to look for.
            return None

        # The validation was not passed.

        # We log our whois record if the debug mode is activated.
        Logs().whois(arg_0.whois_record)

        # And we return False, the domain could not pass the IP and domains syntax validation.
        return False

Execute the logic behind the meaning of ExpirationDate + return the matched status .


def
Func
(
arg_0
,
arg_1
=
,
**
arg_2
)
:
if
arg_1
is
:
arg_1
=
plt
.
gca
(
)
arg_3
=
FuncFormatter
(
utils
.
percentage
)
arg_1
.
xaxis
.
set_major_formatter
(
FuncFormatter
(
arg_3
)
)
arg_1
.
tick_params
(
axis
=
'x'
,
which
=
'major'
)
arg_4
=
ep
.
aggregate_returns
(
arg_0
,
'monthly'
)
arg_1
.
hist
(
100
*
arg_4
,
color
=
'orangered'
,
alpha
=
0.80
,
bins
=
20
,
**
arg_2
)
arg_1
.
axvline
(
100
*
arg_4
.
mean
(
)
,
color
=
'gold'
,
linestyle
=
'--'
,
lw
=
4
,
alpha
=
1.0
)
arg_1
.
axvline
(
0.0
,
color
=
'black'
,
linestyle
=
'-'
,
lw
=
3
,
alpha
=
0.75
)
arg_1
.
legend
(
[
'Mean'
]
,
frameon
=
True
,
framealpha
=
0.5
)
arg_1
.
set_ylabel
(
'Number of months'
)
arg_1
.
set_xlabel
(
'Returns'
)
arg_1
.
set_title
(
"Distribution of monthly returns"
)
return
arg_1

def Func(arg_0, arg_1=None, **arg_2):
    """
    Plots a distribution of monthly returns.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    ax : matplotlib.Axes, optional
        Axes upon which to plot.
    **kwargs, optional
        Passed to plotting function.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    if arg_1 is None:
        arg_1 = plt.gca()

    arg_3 = FuncFormatter(utils.percentage)
    arg_1.xaxis.set_major_formatter(FuncFormatter(arg_3))
    arg_1.tick_params(axis='x', which='major')

    arg_4 = ep.aggregate_returns(arg_0, 'monthly')

    arg_1.hist(
        100 * arg_4,
        color='orangered',
        alpha=0.80,
        bins=20,
        **arg_2)

    arg_1.axvline(
        100 * arg_4.mean(),
        color='gold',
        linestyle='--',
        lw=4,
        alpha=1.0)

    arg_1.axvline(0.0, color='black', linestyle='-', lw=3, alpha=0.75)
    arg_1.legend(['Mean'], frameon=True, framealpha=0.5)
    arg_1.set_ylabel('Number of months')
    arg_1.set_xlabel('Returns')
    arg_1.set_title("Distribution of monthly returns")
    return arg_1

Plots a distribution of monthly returns .


def Func ( arg_0 , arg_1 ) : arg_0 . categories [ arg_1 ] = { } arg_0 . categoriesTexCache [ arg_1 ] = { } arg_0 . categoriesTexBin [ arg_1 ] = pyglet . image . atlas . TextureBin ( arg_0 . texsize , arg_0 . texsize ) arg_0 . peng . sendEvent ( "peng3d:rsrc.category.add" , { "peng" : arg_0 . peng , "category" : arg_1 } )

def Func(arg_0,arg_1):
        """
        Adds a new texture category with the given name.

        If the category already exists, it will be overridden.
        """
        arg_0.categories[arg_1]={}
        arg_0.categoriesTexCache[arg_1]={}
        arg_0.categoriesTexBin[arg_1]=pyglet.image.atlas.TextureBin(arg_0.texsize,arg_0.texsize)
        arg_0.peng.sendEvent("peng3d:rsrc.category.add",{"peng":arg_0.peng,"category":arg_1})

Adds a new texture category with the given name . If the category already exists it will be overridden .


def Func(arg_0, arg_1, arg_2, arg_3):
    """Unmajority gate."""
    arg_0.ccx(arg_1, arg_2, arg_3)
    arg_0.cx(arg_3, arg_1)
    arg_0.cx(arg_1, arg_2)