(expJsonFilePath, options, outputLabel, permWorkDir)

return runWithConfig(expJsonConfig, options, outDir=outDir,
                       outputLabel=outputLabel, permWorkDir=permWorkDir,
                       verbosity=verbosity)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if "verbosityCount" in arg_1 : arg_4 = arg_1 [ "verbosityCount" ] del arg_1 [ "verbosityCount" ] else : arg_4 = 1 _setupInterruptHandling ( ) with open ( arg_0 , "r" ) as jsonFile : arg_5 = json . loads ( jsonFile . read ( ) ) arg_6 = os . path . dirname ( arg_0 ) return runWithConfig ( arg_5 , arg_1 , arg_6 = arg_6 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3):
  """
  Starts a swarm, given a path to a JSON file containing configuration.

  This function is meant to be used with a CLI wrapper that passes command line
  arguments in through the options parameter.

  @param expJsonFilePath {string} Path to a JSON file containing the complete
                                 [swarm description](http://nupic.docs.numenta.org/0.7.0.dev0/guides/swarming/running.html#the-swarm-description).
  @param options {dict} CLI options.
  @param outputLabel {string} Label for output.
  @param permWorkDir {string} Location of working directory.

  @returns {int} Swarm job id.
  """
  if "verbosityCount" in arg_1:
    arg_4 = arg_1["verbosityCount"]
    del arg_1["verbosityCount"]
  else:
    arg_4 = 1

  _setupInterruptHandling()

  with open(arg_0, "r") as jsonFile:
    arg_5 = json.loads(jsonFile.read())

  arg_6 = os.path.dirname(arg_0)
  return runWithConfig(arg_5, arg_1, arg_6=arg_6,
                       arg_2=arg_2, arg_3=arg_3,
                       arg_4=arg_4)

Starts a swarm given a path to a JSON file containing configuration .


(self, file_path, relpath=None, mimetype=None,
                        time_origin=None, ex_from=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                        arg_4=None, arg_5=None):
        """Add a linked file.

        :param str file_path: Path of the file.
        :param str relpath: Relative path of the file.
        :param str mimetype: Mimetype of the file, if ``None`` it tries to
            guess it according to the file extension which currently only works
            for wav, mpg, mpeg and xml.
        :param int time_origin: Time origin for the media file.
        :param str ex_from: Extracted from field.
        :raises KeyError: If mimetype had to be guessed and a non standard
                          extension or an unknown mimetype.
        """
        if arg_3 is None:
            arg_3 = arg_0.MIMES[arg_1.split('.')[-1]]
        arg_0.media_descriptors.append({
            'MEDIA_URL': arg_1, 'RELATIVE_MEDIA_URL': arg_2,
            'MIME_TYPE': arg_3, 'TIME_ORIGIN': arg_4,
            'EXTRACTED_FROM': arg_5})


return self.Geometry(shape=self.shape, pixel_scales=pixel_scales, origin=origin,
                             pixel_neighbors=pixel_neighbors, pixel_neighbors_size=pixel_neighbors_size)

def Func ( arg_0 , arg_1 , arg_2 = 1e-8 ) : arg_3 = np . min ( arg_1 [ : , 0 ] ) - arg_2 arg_4 = np . max ( arg_1 [ : , 0 ] ) + arg_2 arg_5 = np . min ( arg_1 [ : , 1 ] ) - arg_2 arg_6 = np . max ( arg_1 [ : , 1 ] ) + arg_2 arg_7 = ( float ( ( arg_4 - arg_3 ) / arg_0 . shape [ 0 ] ) , float ( ( arg_6 - arg_5 ) / arg_0 . shape [ 1 ] ) ) arg_8 = ( ( arg_4 + arg_3 ) / 2.0 , ( arg_6 + arg_5 ) / 2.0 ) arg_9 , arg_10 = arg_0 . neighbors_from_pixelization ( ) return arg_0 . Geometry ( shape = arg_0 . shape , arg_7 = arg_7 , arg_8 = arg_8 , arg_9 = arg_9 , arg_10 = arg_10 )

def Func(arg_0, arg_1, arg_2=1e-8):
        """Determine the geometry of the rectangular grid, by overlaying it over a grid of coordinates such that its \
         outer-most pixels align with the grid's outer most coordinates plus a small buffer.

        Parameters
        -----------
        grid : ndarray
            The (y,x) grid of coordinates over which the rectangular pixelization is placed to determine its geometry.
        buffer : float
            The size the pixelization is buffered relative to the grid.
        """
        arg_3 = np.min(arg_1[:, 0]) - arg_2
        arg_4 = np.max(arg_1[:, 0]) + arg_2
        arg_5 = np.min(arg_1[:, 1]) - arg_2
        arg_6 = np.max(arg_1[:, 1]) + arg_2
        arg_7 = (float((arg_4 - arg_3) / arg_0.shape[0]), float((arg_6 - arg_5) / arg_0.shape[1]))
        arg_8 = ((arg_4 + arg_3) / 2.0, (arg_6 + arg_5) / 2.0)
        arg_9, arg_10 = arg_0.neighbors_from_pixelization()
        return arg_0.Geometry(shape=arg_0.shape, arg_7=arg_7, arg_8=arg_8,
                             arg_9=arg_9, arg_10=arg_10)

Determine the geometry of the rectangular grid by overlaying it over a grid of coordinates such that its \ outer - most pixels align with the grid s outer most coordinates plus a small buffer .


def Func(arg_0):
  """
  Creates all the zookeeper state_managers and returns
  them in a list
  """
  arg_1 = []
  arg_2 = arg_0.get_state_locations_of_type("zookeeper")
  for arg_3 in arg_2:
    arg_4 = arg_3['name']
    arg_5 = arg_3['hostport']
    arg_6 = []
    for arg_7 in arg_5.split(','):
      arg_8 = None
      arg_9 = None
      if ':' in arg_5:
        arg_10 = arg_7.split(':')
        if len(arg_10) == 2:
          arg_8 = arg_10[0]
          arg_9 = int(arg_10[1])
      if not arg_8 or not arg_9:
        raise Exception("Hostport for %s must be of the format 'host:port'." % (arg_4))
      arg_6.append((arg_8, arg_9))
    arg_11 = arg_3['tunnelhost']
    arg_12 = arg_3['rootpath']
    LOG.info("Connecting to zk hostports: " + str(arg_6) + " rootpath: " + arg_12)
    arg_13 = ZkStateManager(arg_4, arg_6, arg_12, arg_11)
    arg_1.append(arg_13)

  return arg_1


(positions, factor_loadings, stack_positions=True,
                      pos_in_dollars=True)

def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = True ) : if arg_2 : arg_0 = _stack_positions ( arg_0 , arg_3 = arg_3 ) return ep . Func ( arg_0 , arg_1 )

def Func(arg_0, arg_1, arg_2=True,
                      arg_3=True):
    """
    Compute daily risk factor exposures.

    Normalizes positions (if necessary) and calls ep.Func.
    See empyrical.Func for more info.

    Parameters
    ----------
    positions: pd.DataFrame or pd.Series
        Daily holdings (in dollars or percentages), indexed by date, OR
        a series of holdings indexed by date and ticker.
        - Examples:
                        AAPL  TLT  XOM  cash
            2017-01-01    34   58   10     0
            2017-01-02    22   77   18     0
            2017-01-03   -15   27   30    15

                            AAPL       TLT       XOM  cash
            2017-01-01  0.333333  0.568627  0.098039   0.0
            2017-01-02  0.188034  0.658120  0.153846   0.0
            2017-01-03  0.208333  0.375000  0.416667   0.0

            dt          ticker
            2017-01-01  AAPL      0.417582
                        TLT       0.010989
                        XOM       0.571429
            2017-01-02  AAPL      0.202381
                        TLT       0.535714
                        XOM       0.261905

    factor_loadings : pd.DataFrame
        Factor loadings for all days in the date range, with date and ticker as
        index, and factors as columns.
        - Example:
                               momentum  reversal
            dt         ticker
            2017-01-01 AAPL   -1.592914  0.852830
                       TLT     0.184864  0.895534
                       XOM     0.993160  1.149353
            2017-01-02 AAPL   -0.140009 -0.524952
                       TLT    -1.066978  0.185435
                       XOM    -1.798401  0.761549

    stack_positions : bool
        Flag indicating whether `positions` should be converted to long format.

    pos_in_dollars : bool
        Flag indicating whether `positions` are in dollars or percentages
        If True, positions are in dollars.

    Returns
    -------
    risk_exposures_portfolio : pd.DataFrame
        df indexed by datetime, with factors as columns.
        - Example:
                        momentum  reversal
            dt
            2017-01-01 -0.238655  0.077123
            2017-01-02  0.821872  1.520515
    """
    if arg_2:
        arg_0 = _stack_positions(arg_0, arg_3=arg_3)

    return ep.Func(arg_0, arg_1)

Compute daily risk factor exposures.

    Normalizes positions (if necessary) and calls ep.compute_exposures.
    See empyrical.compute_exposures for more info.

    Parameters
    ----------
    positions: pd.DataFrame or pd.Series
        Daily holdings (in dollars or percentages), indexed by date, OR
        a series of holdings indexed by date and ticker.
        - Examples:
                        AAPL  TLT  XOM  cash
            2017-01-01    34   58   10     0
            2017-01-02    22   77   18     0
            2017-01-03   -15   27   30    15

                            AAPL       TLT       XOM  cash
            2017-01-01  0.333333  0.568627  0.098039   0.0
            2017-01-02  0.188034  0.658120  0.153846   0.0
            2017-01-03  0.208333  0.375000  0.416667   0.0

            dt          ticker
            2017-01-01  AAPL      0.417582
                        TLT       0.010989
                        XOM       0.571429
            2017-01-02  AAPL      0.202381
                        TLT       0.535714
                        XOM       0.261905

    factor_loadings : pd.DataFrame
        Factor loadings for all days in the date range, with date and ticker as
        index, and factors as columns.
        - Example:
                               momentum  reversal
            dt         ticker
            2017-01-01 AAPL   -1.592914  0.852830
                       TLT     0.184864  0.895534
                       XOM     0.993160  1.149353
            2017-01-02 AAPL   -0.140009 -0.524952
                       TLT    -1.066978  0.185435
                       XOM    -1.798401  0.761549

    stack_positions : bool
        Flag indicating whether `positions` should be converted to long format.

    pos_in_dollars : bool
        Flag indicating whether `positions` are in dollars or percentages
        If True, positions are in dollars.

    Returns
    -------
    risk_exposures_portfolio : pd.DataFrame
        df indexed by datetime, with factors as columns.
        - Example:
                        momentum  reversal
            dt
            2017-01-01 -0.238655  0.077123
            2017-01-02  0.821872  1.520515


(response, endpoint, content_filter_query, query_params)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . get ( 'results' , [ ] ) arg_5 = 1 while arg_0 . get ( 'next' ) : arg_5 += 1 arg_0 = arg_1 ( ) . post ( arg_2 , ** dict ( arg_3 , arg_5 = arg_5 ) ) arg_4 += arg_0 . get ( 'results' , [ ] ) return arg_4

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Traverse a paginated API response and extracts and concatenates "results" returned by API.

        Arguments:
            response (dict): API response object.
            endpoint (Slumber.Resource): API endpoint object.
            content_filter_query (dict): query parameters used to filter catalog results.
            query_params (dict): query parameters used to paginate results.

        Returns:
            list: all the results returned by the API.
        """
        arg_4 = arg_0.get('results', [])

        arg_5 = 1
        while arg_0.get('next'):
            arg_5 += 1
            arg_0 = arg_1().post(arg_2, **dict(arg_3, arg_5=arg_5))
            arg_4 += arg_0.get('results', [])

        return arg_4

Traverse a paginated API response and extracts and concatenates results returned by API .


def Func ( arg_0 , arg_1 , arg_2 ) : if six . PY2 : arg_3 = 'next' else : arg_3 = '__next__' arg_4 = len ( arg_2 ) arg_5 = itertools . cycle ( getattr ( iter ( D . transform ( arg_1 ) ) , arg_3 ) for ( name , D ) in arg_2 ) while arg_4 : try : for arg_6 in arg_5 : yield arg_6 ( ) except StopIteration : arg_4 -= 1 arg_5 = itertools . cycle ( itertools . islice ( arg_5 , arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        '''A serial transformation union'''
        # This uses the round-robin itertools recipe

        if six.PY2:
            arg_3 = 'next'
        else:
            arg_3 = '__next__'

        arg_4 = len(arg_2)
        arg_5 = itertools.cycle(getattr(iter(D.transform(arg_1)), arg_3)
                                for (name, D) in arg_2)

        while arg_4:
            try:
                for arg_6 in arg_5:
                    yield arg_6()
            except StopIteration:
                arg_4 -= 1
                arg_5 = itertools.cycle(itertools.islice(arg_5, arg_4))


(distribution, expected_base_dtype,
                                    validate_args)

def Func(arg_0, arg_1,
                                    arg_2):
  """Helper which checks validity of a scalar `distribution` init arg.

  Valid here means:

  * `distribution` has scalar batch and event shapes.
  * `distribution` is `FULLY_REPARAMETERIZED`
  * `distribution` has expected dtype.

  Args:
    distribution:  `Distribution`-like object.
    expected_base_dtype:  `TensorFlow` `dtype`.
    validate_args:  Python `bool`.  Whether to do additional checks: (i)  check
      that reparameterization_type is `FULLY_REPARAMETERIZED`. (ii) add
      `tf.Assert` ops to the graph to enforce that distribution is scalar in the
      event that this cannot be determined statically.

  Returns:
    List of `tf.Assert` ops to run to enforce validity checks that could not
      be statically determined.  Empty if `not validate_args`.

  Raises:
    ValueError:  If validate_args and distribution is not FULLY_REPARAMETERIZED
    ValueError:  If distribution is statically determined to not have both
      scalar batch and scalar event shapes.
  """
  if arg_0.dtype != arg_1:
    raise TypeError("dtype mismatch; "
                    "distribution.dtype=\"{}\" is not \"{}\"".format(
                        dtype_util.name(arg_0.dtype),
                        dtype_util.name(arg_1)))

  # Although `reparameterization_type` is a static property, we guard it by
  # `validate_args`. This allows users to use a `distribution` which is not
  # reparameterized itself. However, we tacitly assume that although the
  # distribution is not reparameterized, it only depends on non-trainable
  # variables.
  if arg_2 and (arg_0.reparameterization_type !=
                        reparameterization.FULLY_REPARAMETERIZED):
    raise ValueError("Base distribution should be reparameterized or be "
                     "a function of non-trainable variables; "
                     "distribution.reparameterization_type = \"{}\" "
                     "!= \"FULLY_REPARAMETERIZED\".".format(
                         arg_0.reparameterization_type))
  with tf.name_scope("check_distribution"):
    arg_3 = []

    def check_is_scalar(arg_4, arg_5):
      arg_6 = tf.get_static_value(arg_4)
      if arg_6 is not None:
        if not arg_6:
          raise ValueError("distribution must be scalar; "
                           "distribution.{}=False is not True".format(arg_5))
      elif arg_2:
        arg_3.append(
            assert_util.assert_equal(
                arg_4,
                True,
                message=("distribution must be scalar; "
                         "distribution.{}=False is not True".format(arg_5))))

    check_is_scalar(arg_0.is_scalar_event(), "is_scalar_event")
    check_is_scalar(arg_0.is_scalar_batch(), "is_scalar_batch")
    return arg_3

Helper which checks validity of a scalar distribution init arg .


(x,
              num_quantiles,
              axis=None,
              interpolation=None,
              keep_dims=False,
              validate_args=False,
              name=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = False , arg_5 = False , arg_6 = None ) : with tf . compat . v1 . name_scope ( arg_6 , 'Func' , values = [ arg_0 , arg_1 , arg_2 ] ) : arg_0 = tf . convert_to_tensor ( value = arg_0 , arg_6 = 'x' ) return percentile ( arg_0 , q = tf . linspace ( tf . convert_to_tensor ( value = 0 , dtype = tf . float64 ) , tf . convert_to_tensor ( value = 100 , dtype = tf . float64 ) , num = arg_1 + 1 ) , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 , arg_5 = arg_5 , preserve_gradients = False )

def Func(arg_0,
              arg_1,
              arg_2=None,
              arg_3=None,
              arg_4=False,
              arg_5=False,
              arg_6=None):
  """Compute Func of `x` along `axis`.

  The Func of a distribution are cut points dividing the range into
  intervals with equal probabilities.

  Given a vector `x` of samples, this function estimates the cut points by
  returning `num_Func + 1` cut points, `(c0, ..., cn)`, such that, roughly
  speaking, equal number of sample points lie in the `num_Func` intervals
  `[c0, c1), [c1, c2), ..., [c_{n-1}, cn]`.  That is,

  * About `1 / n` fraction of the data lies in `[c_{k-1}, c_k)`, `k = 1, ..., n`
  * About `k / n` fraction of the data lies below `c_k`.
  * `c0` is the sample minimum and `cn` is the maximum.

  The exact number of data points in each interval depends on the size of
  `x` (e.g. whether the size is divisible by `n`) and the `interpolation` kwarg.

  Args:
    x:  Numeric `N-D` `Tensor` with `N > 0`.  If `axis` is not `None`,
      `x` must have statically known number of dimensions.
    num_Func:  Scalar `integer` `Tensor`.  The number of intervals the
      returned `num_Func + 1` cut points divide the range into.
    axis:  Optional `0-D` or `1-D` integer `Tensor` with constant values. The
      axis that index independent samples over which to return the desired
      percentile.  If `None` (the default), treat every dimension as a sample
      dimension, returning a scalar.
    interpolation : {'nearest', 'linear', 'lower', 'higher', 'midpoint'}.
      Default value: 'nearest'.  This specifies the interpolation method to
      use when the fractions `k / n` lie between two data points `i < j`:
        * linear: i + (j - i) * fraction, where fraction is the fractional part
          of the index surrounded by i and j.
        * lower: `i`.
        * higher: `j`.
        * nearest: `i` or `j`, whichever is nearest.
        * midpoint: (i + j) / 2. `linear` and `midpoint` interpolation do not
          work with integer dtypes.
    keep_dims:  Python `bool`. If `True`, the last dimension is kept with size 1
      If `False`, the last dimension is removed from the output shape.
    validate_args:  Whether to add runtime checks of argument validity. If
      False, and arguments are incorrect, correct behavior is not guaranteed.
    name:  A Python string name to give this `Op`.  Default is 'percentile'

  Returns:
    cut_points:  A `rank(x) + 1 - len(axis)` dimensional `Tensor` with same
    `dtype` as `x` and shape `[num_Func + 1, ...]` where the trailing shape
    is that of `x` without the dimensions in `axis` (unless `keep_dims is True`)

  Raises:
    ValueError:  If argument 'interpolation' is not an allowed type.
    ValueError:  If interpolation type not compatible with `dtype`.

  #### Examples

  ```python
  # Get quartiles of x with various interpolation choices.
  x = [0.,  1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.]

  tfp.stats.Func(x, num_Func=4, interpolation='nearest')
  ==> [  0.,   2.,   5.,   8.,  10.]

  tfp.stats.Func(x, num_Func=4, interpolation='linear')
  ==> [  0. ,   2.5,   5. ,   7.5,  10. ]

  tfp.stats.Func(x, num_Func=4, interpolation='lower')
  ==> [  0.,   2.,   5.,   7.,  10.]

  # Get deciles of columns of an R x C data set.
  data = load_my_columnar_data(...)
  tfp.stats.Func(data, num_Func=10)
  ==> Shape [11, C] Tensor
  ```

  """
  with tf.compat.v1.name_scope(
      arg_6, 'Func', values=[arg_0, arg_1, arg_2]):
    arg_0 = tf.convert_to_tensor(value=arg_0, arg_6='x')
    return percentile(
        arg_0,
        q=tf.linspace(
            # percentile casts q to float64 before using it...so may as well use
            # float64 here. Note that  using x.dtype won't work with linspace
            # if x is integral type (which is anothe motivation for hard-coding
            # float64).
            tf.convert_to_tensor(value=0, dtype=tf.float64),
            tf.convert_to_tensor(value=100, dtype=tf.float64),
            num=arg_1 + 1),
        arg_2=arg_2,
        arg_3=arg_3,
        arg_4=arg_4,
        arg_5=arg_5,
        preserve_gradients=False)

Compute quantiles of `x` along `axis`.

  The quantiles of a distribution are cut points dividing the range into
  intervals with equal probabilities.

  Given a vector `x` of samples, this function estimates the cut points by
  returning `num_quantiles + 1` cut points, `(c0, ..., cn)`, such that, roughly
  speaking, equal number of sample points lie in the `num_quantiles` intervals
  `[c0, c1), [c1, c2), ..., [c_{n-1}, cn]`.  That is,

  * About `1 / n` fraction of the data lies in `[c_{k-1}, c_k)`, `k = 1, ..., n`
  * About `k / n` fraction of the data lies below `c_k`.
  * `c0` is the sample minimum and `cn` is the maximum.

  The exact number of data points in each interval depends on the size of
  `x` (e.g. whether the size is divisible by `n`) and the `interpolation` kwarg.

  Args:
    x:  Numeric `N-D` `Tensor` with `N > 0`.  If `axis` is not `None`,
      `x` must have statically known number of dimensions.
    num_quantiles:  Scalar `integer` `Tensor`.  The number of intervals the
      returned `num_quantiles + 1` cut points divide the range into.
    axis:  Optional `0-D` or `1-D` integer `Tensor` with constant values. The
      axis that index independent samples over which to return the desired
      percentile.  If `None` (the default), treat every dimension as a sample
      dimension, returning a scalar.
    interpolation : {'nearest', 'linear', 'lower', 'higher', 'midpoint'}.
      Default value: 'nearest'.  This specifies the interpolation method to
      use when the fractions `k / n` lie between two data points `i < j`:
        * linear: i + (j - i) * fraction, where fraction is the fractional part
          of the index surrounded by i and j.
        * lower: `i`.
        * higher: `j`.
        * nearest: `i` or `j`, whichever is nearest.
        * midpoint: (i + j) / 2. `linear` and `midpoint` interpolation do not
          work with integer dtypes.
    keep_dims:  Python `bool`. If `True`, the last dimension is kept with size 1
      If `False`, the last dimension is removed from the output shape.
    validate_args:  Whether to add runtime checks of argument validity. If
      False, and arguments are incorrect, correct behavior is not guaranteed.
    name:  A Python string name to give this `Op`.  Default is 'percentile'

  Returns:
    cut_points:  A `rank(x) + 1 - len(axis)` dimensional `Tensor` with same
    `dtype` as `x` and shape `[num_quantiles + 1, ...]` where the trailing shape
    is that of `x` without the dimensions in `axis` (unless `keep_dims is True`)

  Raises:
    ValueError:  If argument 'interpolation' is not an allowed type.
    ValueError:  If interpolation type not compatible with `dtype`.

  #### Examples

  ```python
  # Get quartiles of x with various interpolation choices.
  x = [0.,  1.,   2.,   3.,   4.,   5.,   6.,   7.,   8.,   9.,  10.]

  tfp.stats.quantiles(x, num_quantiles=4, interpolation='nearest')
  ==> [  0.,   2.,   5.,   8.,  10.]

  tfp.stats.quantiles(x, num_quantiles=4, interpolation='linear')
  ==> [  0. ,   2.5,   5. ,   7.5,  10. ]

  tfp.stats.quantiles(x, num_quantiles=4, interpolation='lower')
  ==> [  0.,   2.,   5.,   7.,  10.]

  # Get deciles of columns of an R x C data set.
  data = load_my_columnar_data(...)
  tfp.stats.quantiles(data, num_quantiles=10)
  ==> Shape [11, C] Tensor
  ```


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
PurePath
(
'/'
,
arg_1
)
arg_3
=
tuple
(
[
arg_2
]
+
list
(
arg_2
.
parents
)
)
for
arg_4
in
arg_0
.
ignore_patterns
:
for
arg_5
in
arg_3
:
if
arg_5
.
match
(
arg_4
)
:
logger
.
debug
(
'"%s" ignored ("%s" matched "%s")'
,
arg_1
,
arg_5
,
arg_4
)
return
True
return
False

def Func(arg_0, arg_1):
        ''' Test if this module Func the file at "path", which must be a
            path relative to the root of the module.

            If a file is within a directory that is ignored, the file is also
            ignored.
        '''
        arg_2 = PurePath('/', arg_1)

        # also check any parent directories of this path against the ignore
        # patterns:
        arg_3 = tuple([arg_2] + list(arg_2.parents))

        for arg_4 in arg_0.ignore_patterns:
            for arg_5 in arg_3:
                if arg_5.match(arg_4):
                    logger.debug('"%s" ignored ("%s" matched "%s")', arg_1, arg_5, arg_4)
                    return True
        return False

Test if this module ignores the file at "path", which must be a
            path relative to the root of the module.

            If a file is within a directory that is ignored, the file is also
            ignored.

Test if this module ignores the file at path which must be a path relative to the root of the module .


return {
        'type': tag,
        'coordinates': coordinates
    }

def Func(arg_0):
    """Translates a deprecated GML 2.0 geometry to GeoJSON"""
    arg_1 = arg_0.tag.replace('{%s}' % NS_GML, '')
    if arg_1 == 'Point':
        arg_2 = [float(c) for c in arg_0.findtext('{%s}coordinates' % NS_GML).split(',')]
    elif arg_1 == 'LineString':
        arg_2 = [
            [float(arg_4) for arg_4 in arg_5.split(',')]
            for arg_5 in arg_0.findtext('{%s}coordinates' % NS_GML).split(' ')
        ]
    elif arg_1 == 'Polygon':
        arg_2 = []
        for arg_3 in arg_0.xpath('gml:outerBoundaryIs/gml:LinearRing/gml:coordinates', namespaces=NSMAP) \
                + arg_0.xpath('gml:innerBoundaryIs/gml:LinearRing/gml:coordinates', namespaces=NSMAP):
            arg_2.append([
                [float(arg_4) for arg_4 in arg_5.split(',')]
                for arg_5 in arg_3.text.split(' ')
            ])
    elif arg_1 in ('MultiPoint', 'MultiLineString', 'MultiPolygon', 'MultiCurve'):
        if arg_1 == 'MultiCurve':
            arg_6 = 'LineString'
            arg_7 = 'curveMember'
        else:
            arg_6 = arg_1[5:]
            arg_7 = arg_6[0].lower() + arg_6[1:] + 'Member'
        arg_2 = [
            gml_to_geojson(member)['coordinates']
            for member in arg_0.xpath('gml:%s/gml:%s' % (arg_7, arg_6), namespaces=NSMAP)
        ]
    else:
        raise NotImplementedError

    return {
        'type': arg_1,
        'coordinates': arg_2
    }

Translates a deprecated GML 2 . 0 geometry to GeoJSON


def Func ( arg_0 , arg_1 , arg_2 = arg_3 ) : if arg_2 is not arg_3 : arg_4 = arg_0 . _data . Func ( arg_1 . lower ( ) , arg_2 ) else : arg_4 = arg_0 . _data . Func ( arg_1 . lower ( ) ) if arg_4 is not arg_2 : return arg_4 [ 1 ] else : return arg_2

def Func(arg_0, arg_1, arg_2=arg_3):
        """
        Removes the specified key and returns the corresponding value.
        If key is not found, the default is returned if given, otherwise KeyError is raised.

        :param key: The key
        :param default: The default value
        :return: The value
        """
        if arg_2 is not arg_3:
            arg_4 = arg_0._data.Func(arg_1.lower(), arg_2)
        else:
            arg_4 = arg_0._data.Func(arg_1.lower())
        if arg_4 is not arg_2:
            return arg_4[1]
        else:
            return arg_2

Removes the specified key and returns the corresponding value . If key is not found the default is returned if given otherwise KeyError is raised .


def Func ( arg_0 ) : arg_1 = arg_0 . copy ( ) arg_1 . index = arg_1 . index . map ( pd . Timestamp ) arg_3 = OrderedDict ( ) for arg_4 , ( arg_5 , arg_6 ) in PERIODS . items ( ) : try : arg_7 = arg_1 . loc [ arg_5 : arg_6 ] if len ( arg_7 ) == 0 : continue arg_3 [ arg_4 ] = arg_7 except BaseException : continue return arg_3

def Func(arg_0):
    """
    Extracts returns based on interesting events. See
    gen_date_range_interesting.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.

    Returns
    -------
    ranges : OrderedDict
        Date ranges, with returns, of all valid events.
    """

    arg_1 = arg_0.copy()
    arg_1.index = arg_1.index.map(pd.Timestamp)
    arg_3 = OrderedDict()
    for arg_4, (arg_5, arg_6) in PERIODS.items():
        try:
            arg_7 = arg_1.loc[arg_5:arg_6]
            if len(arg_7) == 0:
                continue
            arg_3[arg_4] = arg_7
        except BaseException:
            continue

    return arg_3

Extracts returns based on interesting events . See gen_date_range_interesting .


def Func ( arg_0 ) : arg_1 = src ( arg_0 ) if not arg_1 . endswith ( '.py' ) and not ispackage ( arg_1 ) : return None arg_2 , arg_3 = os . path . splitext ( os . path . basename ( arg_1 ) ) if arg_2 == '__init__' : arg_4 = [ ] else : arg_4 = [ arg_2 ] arg_5 , arg_6 = os . path . split ( os . path . split ( arg_1 ) [ 0 ] ) while arg_6 : if ispackage ( os . path . join ( arg_5 , arg_6 ) ) : arg_4 . append ( arg_6 ) else : break arg_5 , arg_6 = os . path . split ( arg_5 ) arg_4 . reverse ( ) return '.' . join ( arg_4 )

def Func(arg_0):
    """
    Find the full dotted package name for a given python source file
    name. Returns None if the file is not a python source file.

    >>> Func('foo.py')
    'foo'
    >>> Func('biff/baf.py')
    'baf'
    >>> Func('nose/util.py')
    'nose.util'

    Works for directories too.

    >>> Func('nose')
    'nose'
    >>> Func('nose/plugins')
    'nose.plugins'

    And __init__ files stuck onto directories

    >>> Func('nose/plugins/__init__.py')
    'nose.plugins'

    Absolute paths also work.

    >>> path = os.path.abspath(os.path.join('nose', 'plugins'))
    >>> Func(path)
    'nose.plugins'
    """
    arg_1 = src(arg_0)
    if not arg_1.endswith('.py') and not ispackage(arg_1):
        return None
    arg_2, arg_3 = os.path.splitext(os.path.basename(arg_1))
    if arg_2 == '__init__':
        arg_4 = []
    else:
        arg_4 = [arg_2]
    arg_5, arg_6 = os.path.split(os.path.split(arg_1)[0])
    while arg_6:
        if ispackage(os.path.join(arg_5, arg_6)):
            arg_4.append(arg_6)
        else:
            break
        arg_5, arg_6 = os.path.split(arg_5)
    arg_4.reverse()
    return '.'.join(arg_4)

Find the full dotted package name for a given python source file
    name. Returns None if the file is not a python source file.

    >>> getpackage('foo.py')
    'foo'
    >>> getpackage('biff/baf.py')
    'baf'
    >>> getpackage('nose/util.py')
    'nose.util'

    Works for directories too.

    >>> getpackage('nose')
    'nose'
    >>> getpackage('nose/plugins')
    'nose.plugins'

    And __init__ files stuck onto directories

    >>> getpackage('nose/plugins/__init__.py')
    'nose.plugins'

    Absolute paths also work.

    >>> path = os.path.abspath(os.path.join('nose', 'plugins'))
    >>> getpackage(path)
    'nose.plugins'

Find the full dotted package name for a given python source file name . Returns None if the file is not a python source file .


def
Func
(
arg_0
)
:
def
split_header
(
arg_1
,
arg_2
=
True
)
:
arg_1
=
arg_1
.
lstrip
(
)
.
rstrip
(
)
arg_3
=
arg_1
.
splitlines
(
)
if
arg_3
[
0
]
.
startswith
(
'#'
)
:
if
arg_2
:
arg_4
=
re
.
sub
(
'#+\s*'
,
''
,
arg_3
.
pop
(
0
)
)
if
not
arg_3
:
return
arg_4
,
''
else
:
arg_4
=
''
arg_5
=
'\n'
.
join
(
arg_3
)
.
lstrip
(
)
.
split
(
'\n\n'
)
arg_6
=
arg_5
[
0
]
.
replace
(
'\n'
,
' '
)
return
arg_4
,
arg_6
else
:
if
arg_2
:
if
arg_3
[
0
]
.
startswith
(
(
'='
,
'-'
)
)
:
arg_3
=
arg_3
[
1
:
]
arg_4
=
arg_3
.
pop
(
0
)
if
arg_3
and
arg_3
[
0
]
.
startswith
(
(
'='
,
'-'
)
)
:
arg_3
.
pop
(
0
)
if
not
arg_3
:
return
arg_4
,
''
else
:
arg_4
=
''
arg_5
=
'\n'
.
join
(
arg_3
)
.
lstrip
(
)
.
split
(
'\n\n'
)
arg_6
=
arg_5
[
0
]
.
replace
(
'\n'
,
' '
)
return
arg_4
,
arg_6
arg_7
=
arg_0
.
nb
[
'cells'
]
[
0
]
if
not
arg_7
[
'cell_type'
]
==
'markdown'
:
return
''
,
''
arg_4
,
arg_6
=
split_header
(
arg_7
[
'source'
]
)
if
not
arg_6
and
len
(
arg_0
.
nb
[
'cells'
]
)
>
1
:
arg_8
=
arg_0
.
nb
[
'cells'
]
[
1
]
if
arg_8
[
'cell_type'
]
==
'markdown'
:
arg_9
,
arg_6
=
split_header
(
arg_8
[
'source'
]
,
False
)
return
arg_4
,
arg_6

def Func(arg_0):
        """Get summary and description of this notebook"""
        def split_header(arg_1, arg_2=True):
            arg_1 = arg_1.lstrip().rstrip()
            arg_3 = arg_1.splitlines()
            if arg_3[0].startswith('#'):
                if arg_2:
                    arg_4 = re.sub('#+\s*', '', arg_3.pop(0))
                    if not arg_3:
                        return arg_4, ''
                else:
                    arg_4 = ''
                arg_5 = '\n'.join(arg_3).lstrip().split('\n\n')
                arg_6 = arg_5[0].replace('\n', ' ')
                return arg_4, arg_6
            else:
                if arg_2:
                    if arg_3[0].startswith(('=', '-')):
                        arg_3 = arg_3[1:]
                    arg_4 = arg_3.pop(0)
                    if arg_3 and arg_3[0].startswith(('=', '-')):
                        arg_3.pop(0)
                    if not arg_3:
                        return arg_4, ''
                else:
                    arg_4 = ''
                arg_5 = '\n'.join(arg_3).lstrip().split('\n\n')
                arg_6 = arg_5[0].replace('\n', ' ')
                return arg_4, arg_6

        arg_7 = arg_0.nb['cells'][0]

        if not arg_7['cell_type'] == 'markdown':
            return '', ''
        arg_4, arg_6 = split_header(arg_7['source'])
        if not arg_6 and len(arg_0.nb['cells']) > 1:
            arg_8 = arg_0.nb['cells'][1]
            if arg_8['cell_type'] == 'markdown':
                arg_9, arg_6 = split_header(arg_8['source'], False)
        return arg_4, arg_6


def Func ( arg_0 ) : if arg_0 . query . options [ "count" ] is not None : arg_1 = int ( arg_0 . query . options [ "count" ] ) arg_0 . _cache_at_least ( arg_1 + 1 ) return cmp ( len ( arg_0 . _result_cache ) , arg_1 ) if arg_0 . query . options [ "minimum" ] is not None : arg_2 = int ( arg_0 . query . options [ "minimum" ] ) if not arg_0 . _cache_at_least ( arg_2 ) : return - 1 if arg_0 . query . options [ "maximum" ] is not None : arg_3 = int ( arg_0 . query . options [ "maximum" ] ) if arg_0 . _cache_at_least ( arg_3 + 1 ) : return 1 if arg_0 . query . options [ "between" ] is not None : arg_4 = arg_0 . query . options [ "between" ] arg_2 , arg_3 = arg_4 [ 0 ] , arg_4 [ - 1 ] if not arg_0 . _cache_at_least ( arg_2 ) : return - 1 if arg_0 . _cache_at_least ( arg_3 + 1 ) : return 1 return 0 return 0

def Func(arg_0):
        """
        Returns how the result count compares to the query options.

        The return value is negative if too few results were found, zero if enough were found, and
        positive if too many were found.

        Returns:
            int: -1, 0, or 1.
        """

        if arg_0.query.options["count"] is not None:
            arg_1 = int(arg_0.query.options["count"])
            arg_0._cache_at_least(arg_1 + 1)
            return cmp(len(arg_0._result_cache), arg_1)

        if arg_0.query.options["minimum"] is not None:
            arg_2 = int(arg_0.query.options["minimum"])
            if not arg_0._cache_at_least(arg_2):
                return -1

        if arg_0.query.options["maximum"] is not None:
            arg_3 = int(arg_0.query.options["maximum"])
            if arg_0._cache_at_least(arg_3 + 1):
                return 1

        if arg_0.query.options["between"] is not None:
            arg_4 = arg_0.query.options["between"]
            arg_2, arg_3 = arg_4[0], arg_4[-1]
            if not arg_0._cache_at_least(arg_2):
                return -1
            if arg_0._cache_at_least(arg_3 + 1):
                return 1
            return 0

        return 0

Returns how the result count compares to the query options .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_0
.
proc
.
intf
[
1
]
.
errmsg
(
(
'Undefined "%s" subcommand: "%s". '
+
'Try "help %s *".'
)
%
(
arg_1
,
arg_2
,
arg_1
)
)
return

def Func(arg_0, arg_1, arg_2):
        """Error message when subcommand asked for but doesn't exist"""
        arg_0.proc.intf[-1].errmsg(('Undefined "%s" subcommand: "%s". ' +
                                  'Try "help %s *".') % (arg_1, arg_2, arg_1))
        return

Error message when subcommand asked for but doesn t exist


Frees the memory used by all of the dynamically allocated C arrays.

def Func(arg_0):
    '''
    Funcs the memory used by all of the dynamically allocated C arrays.

    '''

    if arg_0.arrays._calloc:
      _dbl_free(arg_0.arrays._time)
      _dbl_free(arg_0.arrays._flux)
      _dbl_free(arg_0.arrays._bflx)
      _dbl_free(arg_0.arrays._M)
      _dbl_free(arg_0.arrays._E)
      _dbl_free(arg_0.arrays._f)
      _dbl_free(arg_0.arrays._r)
      _dbl_free(arg_0.arrays._x)
      _dbl_free(arg_0.arrays._y)
      _dbl_free(arg_0.arrays._z)
      arg_0.arrays._calloc = 0
    if arg_0.arrays._balloc:
      _dbl_free(arg_0.arrays._b)
      arg_0.arrays._balloc = 0
    if arg_0.arrays._ialloc:
      _dbl_free(arg_0.arrays._iarr)
      arg_0.arrays._ialloc = 0

Frees the memory used by all of the dynamically allocated C arrays .


(self, arg_str, opt_str, *long_opts, **kw)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
*
arg_3
,
**
arg_4
)
:
arg_5
=
sys
.
_getframe
(
1
)
.
f_code
.
co_name
arg_1
=
'%s %s'
%
(
arg_0
.
options_table
.
get
(
arg_5
,
''
)
,
arg_1
)
arg_6
=
arg_4
.
get
(
'mode'
,
'string'
)
if
arg_6
not
in
[
'string'
,
'list'
]
:
raise
ValueError
,
'incorrect mode given: %s'
%
arg_6
arg_7
=
arg_4
.
get
(
'list_all'
,
0
)
arg_8
=
arg_4
.
get
(
'posix'
,
os
.
name
==
'posix'
)
arg_9
=
arg_4
.
get
(
'strict'
,
True
)
arg_10
=
{
}
arg_11
=
arg_1
.
split
(
)
if
len
(
arg_11
)
>=
1
:
arg_12
=
arg_split
(
arg_1
,
arg_8
,
arg_9
)
try
:
arg_13
,
arg_11
=
getopt
(
arg_12
,
arg_2
,
arg_3
)
except
GetoptError
,
e
:
raise
UsageError
(
'%s ( allowed: "%s" %s)'
%
(
e
.
msg
,
arg_2
,
" "
.
join
(
arg_3
)
)
)
for
arg_14
,
arg_15
in
arg_13
:
if
arg_14
.
startswith
(
'--'
)
:
arg_14
=
arg_14
[
2
:
]
else
:
arg_14
=
arg_14
[
1
:
]
try
:
arg_10
[
arg_14
]
.
append
(
arg_15
)
except
AttributeError
:
arg_10
[
arg_14
]
=
[
arg_10
[
arg_14
]
,
arg_15
]
except
KeyError
:
if
arg_7
:
arg_10
[
arg_14
]
=
[
arg_15
]
else
:
arg_10
[
arg_14
]
=
arg_15
arg_13
=
Struct
(
arg_10
)
if
arg_6
==
'string'
:
arg_11
=
' '
.
join
(
arg_11
)
return
arg_13
,
arg_11

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Parse options passed to an argument string.

        The interface is similar to that of getopt(), but it returns back a
        Struct with the options as keys and the stripped argument string still
        as a string.

        arg_str is quoted as a true sys.argv vector by using shlex.split.
        This allows us to easily expand variables, glob files, quote
        arguments, etc.

        Options:
          -mode: default 'string'. If given as 'list', the argument string is
          returned as a list (split on whitespace) instead of a string.

          -list_all: put all option values in lists. Normally only options
          appearing more than once are put in a list.

          -posix (True): whether to split the input line in POSIX mode or not,
          as per the conventions outlined in the shlex module from the
          standard library."""

        # inject default options at the beginning of the input line
        arg_5 = sys._getframe(1).f_code.co_name
        arg_1 = '%s %s' % (arg_0.options_table.get(arg_5,''),arg_1)

        arg_6 = arg_4.get('mode','string')
        if arg_6 not in ['string','list']:
            raise ValueError,'incorrect mode given: %s' % arg_6
        # Get options
        arg_7 = arg_4.get('list_all',0)
        arg_8 = arg_4.get('posix', os.name == 'posix')
        arg_9 = arg_4.get('strict', True)

        # Check if we have more than one argument to warrant extra processing:
        arg_10 = {}  # Dictionary with options
        arg_11 = arg_1.split()
        if len(arg_11) >= 1:
            # If the list of inputs only has 0 or 1 thing in it, there's no
            # need to look for options
            arg_12 = arg_split(arg_1, arg_8, arg_9)
            # Do regular option processing
            try:
                arg_13,arg_11 = getopt(arg_12, arg_2, arg_3)
            except GetoptError,e:
                raise UsageError('%s ( allowed: "%s" %s)' % (e.msg,arg_2,
                                        " ".join(arg_3)))
            for arg_14,arg_15 in arg_13:
                if arg_14.startswith('--'):
                    arg_14 = arg_14[2:]
                else:
                    arg_14 = arg_14[1:]
                try:
                    arg_10[arg_14].append(arg_15)
                except AttributeError:
                    arg_10[arg_14] = [arg_10[arg_14],arg_15]
                except KeyError:
                    if arg_7:
                        arg_10[arg_14] = [arg_15]
                    else:
                        arg_10[arg_14] = arg_15

        # Prepare opts,args for return
        arg_13 = Struct(arg_10)
        if arg_6 == 'string':
            arg_11 = ' '.join(arg_11)

        return arg_13,arg_11

Parse options passed to an argument string .


def Func ( arg_0 , arg_1 , arg_2 ) : if "/by_tag/" not in arg_1 : raise DAVError ( HTTP_FORBIDDEN ) arg_3 , arg_4 , arg_5 = util . save_split ( arg_1 . strip ( "/" ) , "/" , 2 ) assert arg_3 == "by_tag" if arg_4 not in arg_0 . data [ "tags" ] : arg_0 . data [ "tags" ] . append ( arg_4 ) return True

def Func(arg_0, arg_1, arg_2):
        """Change semantic of COPY to add resource tags."""
        # destPath must be '/by_tag/<tag>/<resname>'
        if "/by_tag/" not in arg_1:
            raise DAVError(HTTP_FORBIDDEN)
        arg_3, arg_4, arg_5 = util.save_split(arg_1.strip("/"), "/", 2)
        assert arg_3 == "by_tag"
        if arg_4 not in arg_0.data["tags"]:
            arg_0.data["tags"].append(arg_4)
        return True

Change semantic of COPY to add resource tags .


def Func ( arg_0 ) : try : arg_1 = int ( str ( arg_0 ) , 8 ) except ( TypeError , ValueError ) : return False if arg_1 > 0o37777777777 or arg_1 < 0 : return False return True

def Func(arg_0):
    """Return true if the IP address is in octal notation."""
    try:
        arg_1 = int(str(arg_0), 8)
    except (TypeError, ValueError):
        return False
    if arg_1 > 0o37777777777 or arg_1 < 0:
        return False
    return True

Return true if the IP address is in octal notation .


def Func(arg_0, arg_1: arg_2=None):
        """Get a list of all locations

        Parameters
        ----------
        timeout: Optional[int] = None
            Custom timeout that overwrites Client.timeout
        """
        arg_3 = arg_0.api.LOCATIONS
        return arg_0._get_model(arg_3, arg_1=arg_1)


def Func(arg_0, arg_1):
        """
        Returns NetSpeed name from hostname. Can be Unknown, Dial-up,
        Cable, or Corporate.

        :arg hostname: Hostname (e.g. example.com)
        """
        arg_2 = arg_0._gethostbyname(arg_1)
        return arg_0.netspeed_by_addr(arg_2)

Returns NetSpeed name from hostname . Can be Unknown Dial - up Cable or Corporate .


def Func(arg_0):
    """Convert reflection coefficients to inverse sine parameters.

    :param k: reflection coefficients
    :return: inverse sine parameters

    .. seealso:: :func:`is2rc`, :func:`rc2poly`, :func:`rc2acC`, :func:`rc2lar`.

    Reference: J.R. Deller, J.G. Proakis, J.H.L. Hansen, "Discrete-Time
       Processing of Speech Signals", Prentice Hall, Section 7.4.5.

    """
    assert numpy.isrealobj(arg_0), 'Inverse sine parameters not defined for complex reflection coefficients.'
    if max(numpy.abs(arg_0)) >= 1:
        raise ValueError('All reflection coefficients should have magnitude less than unity.')

    return (2/numpy.pi)*numpy.arcsin(arg_0)

Convert reflection coefficients to inverse sine parameters .


def Func(arg_0):
        """Return archive name without extension"""

        arg_1, arg_2, arg_3 = arg_0.get_tag()

        arg_4 = "%s-%s-%s-%s" % (
            arg_0.wheel_dist_name,
            arg_1,
            arg_2,
            arg_3)
        return arg_4


return ('ihhHH%dH' % ndigits, [2 * len(data)] + data)

def Func(arg_0, arg_1):
    """
    NBASE = 1000
    ndigits = total number of base-NBASE digits
    weight = base-NBASE weight of first digit
    sign = 0x0000 if positive, 0x4000 if negative, 0xC000 if nan
    dscale = decimal digits after decimal place
    """
    try:
        arg_2 = arg_1.as_tuple()
    except AttributeError:
        raise TypeError('Func field requires Decimal value (got %r)' % arg_1)
    arg_3 = []
    if isinstance(arg_2.exponent, str):
        # NaN, Inf, -Inf
        arg_4 = 0
        arg_5 = 0
        arg_6 = 0xC000
        arg_7 = 0
    else:
        arg_8 = list(reversed(arg_2.digits + (arg_2.exponent % 4) * (0,)))
        arg_5 = 0
        while arg_8:
            if any(arg_8[:4]):
                break
            arg_5 += 1
            del arg_8[:4]
        while arg_8:
            arg_3.insert(0, ndig(arg_8[:4]))
            del arg_8[:4]
        arg_4 = len(arg_3)
        arg_5 += arg_2.exponent // 4 + arg_4 - 1
        arg_6 = arg_2.sign * 0x4000
        arg_7 = -min(0, arg_2.exponent)
    arg_9 = [arg_4, arg_5, arg_6, arg_7] + arg_3
    return ('ihhHH%dH' % arg_4, [2 * len(arg_9)] + arg_9)

NBASE = 1000 ndigits = total number of base - NBASE digits weight = base - NBASE weight of first digit sign = 0x0000 if positive 0x4000 if negative 0xC000 if nan dscale = decimal digits after decimal place


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
urllib2
.
urlopen
(
arg_1
)
arg_3
=
[
BeautifulSoup
(
arg_2
)
]
arg_4
=
arg_3
[
0
]
.
body
.
findAll
(
'span'
,
attrs
=
{
'class'
:
'number-of-pages'
}
)
if
len
(
arg_4
)
>
0
:
if
re
.
search
(
'^\d+$'
,
arg_4
[
0
]
.
string
)
:
for
arg_5
in
range
(
int
(
arg_4
[
0
]
.
string
)
1
)
:
arg_2
=
urllib2
.
urlopen
(
'%s/page/%i'
%
(
arg_1
,
arg_5
+
2
)
)
arg_3
.
append
(
BeautifulSoup
(
arg_2
)
)
else
:
print
(
"number of pages %s not an integer"
%
(
arg_4
[
0
]
.
string
)
)
arg_6
=
getDOMImplementation
(
)
arg_7
=
arg_6
.
createDocument
(
,
"collection"
,
)
arg_8
=
[
]
for
arg_2
in
arg_3
:
arg_8
+=
arg_2
.
body
.
findAll
(
'p'
,
attrs
=
{
'class'
:
'title'
}
)
arg_8
+=
arg_2
.
body
.
findAll
(
'h3'
,
attrs
=
{
'class'
:
'title'
}
)
for
arg_9
in
arg_8
:
arg_10
=
arg_0
.
_get_record
(
arg_9
)
arg_7
.
firstChild
.
appendChild
(
arg_10
)
return
arg_7
.
toprettyxml
(
)

def Func(arg_0, arg_1):
        """
        Returns the records listed in the webpage given as
        parameter as a xml String.

        @param url: the url of the Journal, Book, Protocol or Reference work
        """
        arg_2 = urllib2.urlopen(arg_1)
        arg_3 = [BeautifulSoup(arg_2)]
        #content spread over several pages?
        arg_4 = arg_3[0].body.findAll('span', attrs={'class': 'number-of-pages'})
        if len(arg_4) > 0:
            if re.search('^\d+$', arg_4[0].string):
                for arg_5 in range(int(arg_4[0].string)-1):
                    arg_2 = urllib2.urlopen('%s/page/%i' % (arg_1, arg_5+2))
                    arg_3.append(BeautifulSoup(arg_2))
            else:
                print("number of pages %s not an integer" % (arg_4[0].string))
        arg_6 = getDOMImplementation()
        arg_7 = arg_6.createDocument(None, "collection", None)
        arg_8 = []
        for arg_2 in arg_3:
            arg_8 += arg_2.body.findAll('p', attrs={'class': 'title'})
            arg_8 += arg_2.body.findAll('h3', attrs={'class': 'title'})
        for arg_9 in arg_8:
            arg_10 = arg_0._get_record(arg_9)
            arg_7.firstChild.appendChild(arg_10)
        return arg_7.toprettyxml()

Returns the records listed in the webpage given as parameter as a xml String .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = arg_2 or arg_1 . get ( 'title' , '' ) or arg_1 . get ( 'name' , '' ) arg_4 = arg_0 . json_pointer + arg_3 arg_0 . parameter_registry [ arg_3 ] = arg_1 return { '$ref' : arg_4 }

def Func(arg_0, arg_1, arg_2=None):
        """
        Store a parameter schema and return a reference to it.

        :param schema:
            Swagger parameter definition.
        :param base_name:
            Name that should be used for the reference.

        :rtype: dict
        :returns: JSON pointer to the original parameter definition.
        """

        arg_3 = arg_2 or arg_1.get('title', '') or arg_1.get('name', '')

        arg_4 = arg_0.json_pointer + arg_3
        arg_0.parameter_registry[arg_3] = arg_1

        return {'$ref': arg_4}

Store a parameter schema and return a reference to it .


def Func(arg_0, arg_1='__and__'):
    """Create a tinyDB Query object that is the concatenation of each query in `queries`.
    The concatenation operator is taken from `operators`.

    Parameters
    ----------
    queries: list of tinydb.Query
        The list of tinydb.Query to be joined.

    operators: str or list of str
        List of binary operators to join `queries` into one query.
        Check TinyDB.Query class for possible choices.

    Returns
    -------
    query: tinydb.database.Query
    """
    # checks first
    if not arg_0:
        raise ValueError('Expected some `queries`, got {}.'.format(arg_0))

    if len(arg_0) == 1:
        return arg_0[0]

    if isinstance(arg_1, str):
        arg_1 = [arg_1] * (len(arg_0) - 1)

    if len(arg_0) - 1 != len(arg_1):
        raise ValueError('Expected `operators` to be a string or a list with the same'
                         ' length as `field_names` ({}), got {}.'.format(len(arg_0),
                                                                         arg_1))

    # recursively build the query
    arg_2, arg_3, arg_4 = arg_0[0], arg_0[1:-1], arg_0[-1:][0]
    arg_5 = getattr(arg_2, arg_1[0])
    for arg_6, arg_7 in enumerate(arg_3):
        arg_5 = getattr(arg_5(arg_7), arg_1[arg_6])

    return arg_5(arg_4)

Create a tinyDB Query object that is the concatenation of each query in queries . The concatenation operator is taken from operators .


return self.get_enrollments_for_course(
            self._sis_id(sis_course_id, sis_field="course"), params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_enrollments_for_course ( arg_0 . _sis_id ( arg_1 , sis_field = "course" ) , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of all enrollments for the passed course sis id.
        """
        return arg_0.get_enrollments_for_course(
            arg_0._sis_id(arg_1, sis_field="course"), arg_2)

Return a list of all enrollments for the passed course sis id .


def Func ( arg_0 ) : if not arg_0 . _client : arg_0 . _client = SpeechClient ( credentials = arg_0 . _get_credentials ( ) ) return arg_0 . _client

def Func(arg_0):
        """
        Retrieves connection to Cloud Speech.

        :return: Google Cloud Speech client object.
        :rtype: google.cloud.speech_v1.SpeechClient
        """
        if not arg_0._client:
            arg_0._client = SpeechClient(credentials=arg_0._get_credentials())
        return arg_0._client


def Func(arg_0, arg_1, arg_2, arg_3):
        """Save verifier to database.

        A verifiersetter is required. It would be better to combine request
        token and verifier together::

            def verifiersetter(token, verifier, request):
                tok = Grant.query.filter_by(token=token).first()
                tok.verifier = verifier['oauth_verifier']
                tok.user = get_current_user()
                return tok.save()

        .. admonition:: Note:

            A user is required on verifier, remember to attach current
            user to verifier.
        """
        log.debug('Save verifier %r for %r', arg_2, arg_1)
        arg_0._verifiersetter(
            arg_1=arg_1, arg_2=arg_2, arg_3=arg_3
        )


def Func(arg_0):
        """Extracts the category from a GitHub item.

        This backend generates two types of item which are
        'issue' and 'pull_request'.
        """

        if "base" in arg_0:
            arg_1 = CATEGORY_PULL_REQUEST
        elif "forks_count" in arg_0:
            arg_1 = CATEGORY_REPO
        else:
            arg_1 = CATEGORY_ISSUE

        return arg_1

Extracts the category from a GitHub item .


def Func(arg_0):
        """Enter the new span context. All annotations logged inside this
        context will be attributed to this span. All new spans generated
        inside this context will have this span as their parent.

        In the unsampled case, this context still generates new span IDs and
        pushes them onto the threadlocal stack, so downstream services calls
        made will pass the correct headers. However, the logging handler is
        never attached in the unsampled case, so the spans are never logged.
        """
        arg_0.do_pop_attrs = False

        arg_2, arg_0.zipkin_attrs = arg_0._get_current_context()

        # If zipkin_attrs are not set up by now, that means this span is not
        # configured to perform logging itself, and it's not in an existing
        # Zipkin trace. That means there's nothing else to do and it can exit
        # early.
        if not arg_0.zipkin_attrs:
            return arg_0

        arg_0.get_tracer().push_zipkin_attrs(arg_0.zipkin_attrs)
        arg_0.do_pop_attrs = True

        arg_0.Func_timestamp = time.time()

        if arg_0._is_local_root_span:
            # Don't set up any logging if we're not sampling
            if not arg_0.zipkin_attrs.is_sampled and not arg_0.firehose_handler:
                return arg_0
            # If transport is already configured don't override it. Doing so would
            # cause all previously recorded spans to never be emitted as exiting
            # the inner logging context will reset transport_configured to False.
            if arg_0.get_tracer().is_transport_configured():
                log.info('Transport was already configured, ignoring override'
                         'from span {}'.format(arg_0.span_name))
                return arg_0
            arg_5 = create_endpoint(arg_0.port, arg_0.service_name, arg_0.host)
            arg_0.logging_context = ZipkinLoggingContext(
                arg_0.zipkin_attrs,
                arg_5,
                arg_0.span_name,
                arg_0.transport_handler,
                arg_2 or arg_0.report_root_timestamp_override,
                arg_0.get_tracer,
                arg_0.service_name,
                binary_annotations=arg_0.binary_annotations,
                add_logging_annotation=arg_0.add_logging_annotation,
                client_context=arg_0.kind == Kind.CLIENT,
                max_span_batch_size=arg_0.max_span_batch_size,
                firehose_handler=arg_0.firehose_handler,
                encoding=arg_0.encoding,
            )
            arg_0.logging_context.Func()
            arg_0.get_tracer().set_transport_configured(configured=True)

        return arg_0

Enter the new span context . All annotations logged inside this context will be attributed to this span . All new spans generated inside this context will have this span as their parent .


(X, indices, Ks, max_K, save_all_Ks, min_dist)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
    "Gets within-bag distances for each bag."
    logger.info("Getting within-bag distances...")

    if arg_3 >= arg_0.n_pts.min():
        arg_6 = "asked for K = {}, but there's a bag with only {} points"
        raise ValueError(arg_6.format(arg_3, arg_0.n_pts.min()))

    # need to throw away the closest neighbor, which will always be self
    # thus K=1 corresponds to column 1 in the result array
    arg_7 = slice(1, None) if arg_4 else arg_2

    arg_1 = plog(arg_1, name="within-bag distances")
    arg_8 = [None] * len(arg_0)
    for arg_9, (arg_10, arg_11) in enumerate(zip(arg_1, arg_0)):
        arg_12 = np.sqrt(arg_10.nn_index(arg_11, arg_3 + 1)[1][:, arg_7])
        np.maximum(arg_5, arg_12, out=arg_12)
        arg_8[arg_9] = arg_12
    return arg_8

Gets within - bag distances for each bag .


def Func ( arg_0 ) : arg_1 = arg_0 [ OBJ ] arg_2 = arg_0 [ KEY ] arg_3 = arg_1 . formula . signature . bind ( * arg_2 ) arg_3 . apply_defaults ( ) return arg_3 . arguments

def Func(arg_0):
    """Return an ordered mapping from params to args"""
    arg_1 = arg_0[OBJ]
    arg_2 = arg_0[KEY]
    arg_3 = arg_1.formula.signature.bind(*arg_2)
    arg_3.apply_defaults()
    return arg_3.arguments


return self.get_roles_in_account(self._sis_id(account_sis_id,
                                                      sis_field="account"),
                                         params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_roles_in_account ( arg_0 . _sis_id ( arg_1 , sis_field = "account" ) , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        List the roles for an account, for the passed account SIS ID.
        """
        return arg_0.get_roles_in_account(arg_0._sis_id(arg_1,
                                                      sis_field="account"),
                                         arg_2)

List the roles for an account for the passed account SIS ID .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
b"# {}"
)
:
if
not
arg_1
.
endswith
(
b"\n"
)
:
arg_1
+=
b"\n"
arg_3
=
hashlib
.
sha1
(
arg_1
)
.
hexdigest
(
)
with
open
(
arg_0
.
filename
,
"wb"
)
as
f
:
f
.
Func
(
arg_1
)
f
.
Func
(
arg_2
.
decode
(
"utf8"
)
.
format
(
arg_3
)
.
encode
(
"utf8"
)
)
f
.
Func
(
b"\n"
)

def Func(arg_0, arg_1, arg_2=b"# {}"):
        u"""
        Write `text` to the file.

        Writes the text to the file, with a final line checksumming the
        contents.  The entire file must be written with one `.Func()` call.

        The last line is written with the `hashline` format string, which can
        be changed to accommodate different file syntaxes.

        Both arguments are UTF8 byte strings.

        Arguments:
            text (UTF8 byte string): the contents of the file to Func.

            hashline (UTF8 byte string): the format of the last line to append
                to the file, with "{}" replaced with the hash.

        """
        if not arg_1.endswith(b"\n"):
            arg_1 += b"\n"

        arg_3 = hashlib.sha1(arg_1).hexdigest()

        with open(arg_0.filename, "wb") as f:
            f.Func(arg_1)
            f.Func(arg_2.decode("utf8").format(arg_3).encode("utf8"))
            f.Func(b"\n")

u"""
        Write `text` to the file.

        Writes the text to the file, with a final line checksumming the
        contents.  The entire file must be written with one `.write()` call.

        The last line is written with the `hashline` format string, which can
        be changed to accommodate different file syntaxes.

        Both arguments are UTF8 byte strings.

        Arguments:
            text (UTF8 byte string): the contents of the file to write.

            hashline (UTF8 byte string): the format of the last line to append
                to the file, with "{}" replaced with the hash.


def
Func
(
arg_0
,
arg_1
=
True
,
arg_2
=
False
)
:
arg_3
=
{
}
for
arg_4
in
arg_0
.
subsets
[
'All_Samples'
]
:
arg_5
=
arg_0
.
data
[
arg_4
]
arg_3
[
arg_4
]
=
arg_5
.
filt_nremoved
(
arg_1
)
if
not
arg_2
:
arg_6
=
max
(
[
len
(
arg_5
)
for
arg_5
in
arg_3
.
keys
(
)
]
)
print
(
'{string:{number}s}'
.
format
(
string
=
'Sample '
,
number
=
arg_6
+
3
)
+
'{total:4s}'
.
format
(
total
=
'tot'
)
+
'{removed:4s}'
.
format
(
removed
=
'flt'
)
+
'{percent:4s}'
.
format
(
percent
=
'%rm'
)
)
for
arg_7
,
(
arg_8
,
arg_9
,
arg_10
)
in
arg_3
.
items
(
)
:
print
(
'{string:{number}s}'
.
format
(
string
=
arg_7
,
number
=
arg_6
+
3
)
+
'{total:4.0f}'
.
format
(
total
=
arg_8
)
+
'{removed:4.0f}'
.
format
(
removed
=
arg_9
)
+
'{percent:4.0f}'
.
format
(
percent
=
arg_10
)
)
return
arg_3

def Func(arg_0, arg_1=True, arg_2=False):
        """
        Report how many data are removed by the active filters.
        """
        arg_3 = {}
        for arg_4 in arg_0.subsets['All_Samples']:
            arg_5 = arg_0.data[arg_4]
            arg_3[arg_4] = arg_5.filt_nremoved(arg_1)
        if not arg_2:
            arg_6 = max([len(arg_5) for arg_5 in arg_3.keys()])
            print('{string:{number}s}'.format(string='Sample ', number=arg_6 + 3) +
                  '{total:4s}'.format(total='tot') +
                  '{removed:4s}'.format(removed='flt') +
                  '{percent:4s}'.format(percent='%rm'))
            for arg_7, (arg_8, arg_9, arg_10) in arg_3.items():
                print('{string:{number}s}'.format(string=arg_7, number=arg_6 + 3) +
                      '{total:4.0f}'.format(total=arg_8) +
                      '{removed:4.0f}'.format(removed=arg_9) +
                      '{percent:4.0f}'.format(percent=arg_10))

        return arg_3

Report how many data are removed by the active filters .


(graph: BELGraph,
                 data: Mapping[BaseEntity, Any],
                 label: Optional[str] = None,
                 overwrite: bool = False,
                 )

def
Func
(
arg_0
:
arg_1
,
arg_2
:
arg_3
[
arg_4
,
arg_5
]
,
arg_6
:
arg_7
[
arg_8
]
=
,
arg_9
:
arg_10
=
False
,
)
->
:
if
arg_6
is
:
arg_6
=
WEIGHT
for
arg_11
,
arg_12
in
arg_2
.
items
(
)
:
if
arg_11
not
in
arg_0
:
log
.
debug
(
'%s not in graph'
,
arg_11
)
continue
if
arg_6
in
arg_0
.
nodes
[
arg_11
]
and
not
arg_9
:
log
.
debug
(
'%s already on %s'
,
arg_6
,
arg_11
)
continue
arg_0
.
nodes
[
arg_11
]
[
arg_6
]
=
arg_12

def Func(arg_0: arg_1,
                 arg_2: arg_3[arg_4, arg_5],
                 arg_6: arg_7[arg_8] = None,
                 arg_9: arg_10 = False,
                 ) -> None:
    """Overlays tabular data on the network

    :param graph: A BEL Graph
    :param data: A dictionary of {tuple node: data for that node}
    :param label: The annotation label to put in the node dictionary
    :param overwrite: Should old annotations be overwritten?
    """
    if arg_6 is None:
        arg_6 = WEIGHT

    for arg_11, arg_12 in arg_2.items():
        if arg_11 not in arg_0:
            log.debug('%s not in graph', arg_11)
            continue

        if arg_6 in arg_0.nodes[arg_11] and not arg_9:
            log.debug('%s already on %s', arg_6, arg_11)
            continue

        arg_0.nodes[arg_11][arg_6] = arg_12


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . _meta . concrete_fields : if arg_2 . related_model in arg_1 : return True if arg_2 . related_model == arg_0 : arg_1 . append ( arg_0 ) return False

def Func(arg_0):
    """
    We check whether a class has more than 1 FK reference to itself.
    """
    arg_1 = []
    for arg_2 in arg_0._meta.concrete_fields:
        if arg_2.related_model in arg_1:
            return True
        if arg_2.related_model == arg_0:
            arg_1.append(arg_0)
    return False

We check whether a class has more than 1 FK reference to itself .


return (logFactorial(n) - numpy.sum([logFactorial(k) for k in x]) +
      numpy.sum(x * numpy.log(self.dist.pmf)))

def Func ( arg_0 , arg_1 ) : arg_2 = numpy . asarray ( arg_1 ) arg_3 = arg_2 . sum ( ) return ( logFactorial ( arg_3 ) - numpy . sum ( [ logFactorial ( arg_4 ) for arg_4 in arg_2 ] ) + numpy . sum ( arg_2 * numpy . log ( arg_0 . dist . pmf ) ) )

def Func(arg_0, arg_1):
    """Form of distribution must be an array of counts in order of self.keys."""
    arg_2 = numpy.asarray(arg_1)
    arg_3 = arg_2.sum()
    return (logFactorial(arg_3) - numpy.sum([logFactorial(arg_4) for arg_4 in arg_2]) +
      numpy.sum(arg_2 * numpy.log(arg_0.dist.pmf)))

Form of distribution must be an array of counts in order of self . keys .


def Func(arg_0):
        """ Sets the chunking dimmentions depending on the file type.
        """

        #Usually '.0000.' is in self.filename
        if np.abs(arg_0.header[b'foff']) < 1e-5:
            logger.info('Detecting high frequency resolution data.')
            arg_1 = (1,1,1048576) #1048576 is the number of channels in a coarse channel.
            return arg_1
        #Usually '.0001.' is in self.filename
        elif np.abs(arg_0.header[b'tsamp']) < 1e-3:
            logger.info('Detecting high time resolution data.')
            arg_1 = (2048,1,512) #512 is the total number of channels per single band (ie. blc00)
            return arg_1
        #Usually '.0002.' is in self.filename
        elif np.abs(arg_0.header[b'foff']) < 1e-2 and np.abs(arg_0.header[b'foff'])  >= 1e-5:
            logger.info('Detecting intermediate frequency and time resolution data.')
            arg_1 = (10,1,65536)  #65536 is the total number of channels per single band (ie. blc00)
#            chunk_dim = (1,1,65536/4)
            return arg_1
        else:
            logger.warning('File format not known. Will use minimum chunking. NOT OPTIMAL.')
            arg_1 = (1,1,512)
            return arg_1

Sets the chunking dimmentions depending on the file type .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . intersection ( arg_1 ) if arg_2 is None : return 0.0 else : arg_3 = arg_0 . area + arg_1 . area - arg_2 . area return arg_2 . area / arg_3 if arg_3 > 0 else 0.0

def Func(arg_0, arg_1):
        """
        Compute the IoU of this bounding box with another one.

        IoU is the intersection over union, defined as::

            ``area(intersection(A, B)) / area(union(A, B))``
            ``= area(intersection(A, B)) / (area(A) + area(B) - area(intersection(A, B)))``

        Parameters
        ----------
        other : imgaug.BoundingBox
            Other bounding box with which to compare.

        Returns
        -------
        float
            IoU between the two bounding boxes.

        """
        arg_2 = arg_0.intersection(arg_1)
        if arg_2 is None:
            return 0.0
        else:
            arg_3 = arg_0.area + arg_1.area - arg_2.area
            return arg_2.area / arg_3 if arg_3 > 0 else 0.0

Compute the IoU of this bounding box with another one .


def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . feed_forward ( arg_1 , ** arg_2 ) [ arg_0 . layers [ - 1 ] . output_name ]

def Func(arg_0, arg_1, **arg_2):
        '''Compute class posterior probabilities for the given set of data.

        Parameters
        ----------
        x : ndarray (num-examples, num-variables)
            An array containing examples to predict. Examples are given as the
            rows in this array.

        Returns
        -------
        p : ndarray (num-examples, num-classes)
            An array of class posterior probability values, one per row of input
            data.
        '''
        return arg_0.feed_forward(arg_1, **arg_2)[arg_0.layers[-1].output_name]

Compute class posterior probabilities for the given set of data .


def Func ( ) : with open ( temple . constants . TEMPLE_CONFIG_FILE ) as temple_config_file : return yaml . load ( temple_config_file , Loader = yaml . SafeLoader )

def Func():
    """Reads the temple YAML configuration file in the repository"""
    with open(temple.constants.TEMPLE_CONFIG_FILE) as temple_config_file:
        return yaml.load(temple_config_file, Loader=yaml.SafeLoader)


def Func ( arg_0 ) : if arg_0 . _has_state ( arg_0 . COMPLETED ) or arg_0 . _has_state ( arg_0 . CANCELLED ) : return arg_0 . _set_state ( arg_0 . READY ) arg_0 . task_spec . _onFunc ( arg_0 )

def Func(arg_0):
        """
        Marks the task as ready for execution.
        """
        if arg_0._has_state(arg_0.COMPLETED) or arg_0._has_state(arg_0.CANCELLED):
            return
        arg_0._set_state(arg_0.READY)
        arg_0.task_spec._onFunc(arg_0)


def Func ( arg_0 ) : arg_1 = arg_0 . image_set . count ( ) arg_2 = arg_0 . update_set . values_list ( 'id' , flat = True ) arg_3 = UpdateImage . objects . filter ( update__id__in = arg_2 ) . count ( ) arg_4 = arg_1 + arg_3 return arg_4

def Func(arg_0):
        """
        Gets count of all images from both event and updates.
        """
        arg_1 = arg_0.image_set.count()
        arg_2 = arg_0.update_set.values_list('id', flat=True)
        arg_3 = UpdateImage.objects.filter(update__id__in=arg_2).count()
        arg_4 = arg_1 + arg_3

        return arg_4

Gets count of all images from both event and updates .


async def Func ( arg_0 ) -> Player : arg_0 . _player = player = Player ( arg_0 . __client , arg_0 , await arg_0 . http . current_player ( ) ) return player

async def Func(arg_0) -> Player:
        """Get information about the users current playback.

        Returns
        -------
        player : Player
            A player object representing the current playback.
        """
        arg_0._player = player = Player(arg_0.__client, arg_0, await arg_0.http.current_player())
        return player

Get information about the users current playback .


def Func ( arg_0 ) : arg_1 = arg_0 . cancel arg_2 = [ ] for arg_3 , arg_4 in arg_0 . _submitted . itervalues ( ) : try : arg_2 . append ( arg_1 ( arg_3 ) ) except OSError as exc : if exc . errno != errno . EINVAL : raise return arg_2

def Func(arg_0):
        """
        Cancel all submitted IO blocks.

        Blocks until all submitted transfers have been finalised.
        Submitting more transfers or processing completion events while this
        method is running produces undefined behaviour.
        Returns the list of values returned by individual cancellations.
        See "cancel" documentation.
        """
        arg_1 = arg_0.cancel
        arg_2 = []
        for arg_3, arg_4 in arg_0._submitted.itervalues():
            try:
                arg_2.append(arg_1(arg_3))
            except OSError as exc:
                # EINVAL should mean we requested to cancel a not-in-flight
                # transfer - maybe it was just completed and we just did
                # not process its completion event yet.
                if exc.errno != errno.EINVAL:
                    raise
        return arg_2


def
Func
(
arg_0
:
arg_1
,
arg_2
,
arg_3
,
arg_4
=
True
)
:
arg_5
=
count_functions
(
arg_0
)
arg_6
=
count_relations
(
arg_0
)
arg_7
=
pd
.
DataFrame
.
from_dict
(
dict
(
arg_5
)
,
orient
=
'index'
)
arg_8
=
pd
.
DataFrame
.
from_dict
(
dict
(
arg_6
)
,
orient
=
'index'
)
arg_7
.
sort_values
(
0
,
ascending
=
True
)
.
plot
(
kind
=
'barh'
,
arg_4
=
arg_4
,
ax
=
arg_2
)
arg_2
.
set_title
(
'Number of nodes: {}'
.
format
(
arg_0
.
number_of_nodes
(
)
)
)
arg_8
.
sort_values
(
0
,
ascending
=
True
)
.
plot
(
kind
=
'barh'
,
arg_4
=
arg_4
,
ax
=
arg_3
)
arg_3
.
set_title
(
'Number of edges: {}'
.
format
(
arg_0
.
number_of_edges
(
)
)
)

def Func(arg_0: arg_1, arg_2, arg_3, arg_4=True):
    """Plots your graph summary statistics on the given axes.

    After, you should run :func:`plt.tight_layout` and you must run :func:`plt.show` to view.

    Shows:
    1. Count of nodes, grouped by function type
    2. Count of edges, grouped by relation type

    :param pybel.BELGraph graph: A BEL graph
    :param lax: An axis object from matplotlib
    :param rax: An axis object from matplotlib

    Example usage:

    >>> import matplotlib.pyplot as plt
    >>> from pybel import from_pickle
    >>> from pybel_tools.summary import Func
    >>> graph = from_pickle('~/dev/bms/aetionomy/parkinsons.gpickle')
    >>> fig, axes = plt.subplots(1, 2, figsize=(10, 4))
    >>> Func(graph, axes[0], axes[1])
    >>> plt.tight_layout()
    >>> plt.show()
    """
    arg_5 = count_functions(arg_0)
    arg_6 = count_relations(arg_0)

    arg_7 = pd.DataFrame.from_dict(dict(arg_5), orient='index')
    arg_8 = pd.DataFrame.from_dict(dict(arg_6), orient='index')

    arg_7.sort_values(0, ascending=True).plot(kind='barh', arg_4=arg_4, ax=arg_2)
    arg_2.set_title('Number of nodes: {}'.format(arg_0.number_of_nodes()))

    arg_8.sort_values(0, ascending=True).plot(kind='barh', arg_4=arg_4, ax=arg_3)
    arg_3.set_title('Number of edges: {}'.format(arg_0.number_of_edges()))

Plots your graph summary statistics on the given axes.

    After, you should run :func:`plt.tight_layout` and you must run :func:`plt.show` to view.

    Shows:
    1. Count of nodes, grouped by function type
    2. Count of edges, grouped by relation type

    :param pybel.BELGraph graph: A BEL graph
    :param lax: An axis object from matplotlib
    :param rax: An axis object from matplotlib

    Example usage:

    >>> import matplotlib.pyplot as plt
    >>> from pybel import from_pickle
    >>> from pybel_tools.summary import plot_summary_axes
    >>> graph = from_pickle('~/dev/bms/aetionomy/parkinsons.gpickle')
    >>> fig, axes = plt.subplots(1, 2, figsize=(10, 4))
    >>> plot_summary_axes(graph, axes[0], axes[1])
    >>> plt.tight_layout()
    >>> plt.show()

Plots your graph summary statistics on the given axes .


def Func():
    """Popup with information about how to register a new GUI

    In the event of no GUI being registered or available,
    this information dialog will appear to guide the user
    through how to get set up with one.

    """

    arg_0 = QtWidgets.QMessageBox()
    arg_0.setIcon(arg_0.Warning)
    arg_0.setWindowIcon(QtGui.QIcon(os.path.join(
        os.path.dirname(pyblish.__file__),
        "icons",
        "logo-32x32.svg"))
    )

    arg_1 = QtWidgets.QWidget()
    arg_1.setMinimumSize(400, 0)
    arg_1.setSizePolicy(QtWidgets.QSizePolicy.Minimum,
                         QtWidgets.QSizePolicy.Expanding)

    arg_2 = arg_0.layout()
    arg_2.addWidget(arg_1, arg_2.rowCount(), 0, 1, arg_2.columnCount())

    arg_0.setWindowTitle("Uh oh")

    arg_3 = "No registered GUI found.\n\n"

    if not pyblish.api.registered_guis():
        arg_3 += (
            "In order to show you a GUI, one must first be registered. "
            "\n"
            "Pyblish supports one or more graphical user interfaces "
            "to be registered at once, the next acting as a fallback to "
            "the previous."
            "\n"
            "\n"
            "For example, to use Pyblish Lite, first install it:"
            "\n"
            "\n"
            "$ pip install pyblish-lite"
            "\n"
            "\n"
            "Then register it, like so:"
            "\n"
            "\n"
            ">>> import pyblish.api\n"
            ">>> pyblish.api.register_gui(\"pyblish_lite\")"
            "\n"
            "\n"
            "The next time you try running this, Lite will appear."
            "\n"
            "See http://api.pyblish.com/register_gui.html for "
            "more information."
        )
    else:
        arg_3 += (
            "None of the registered graphical user interfaces "
            "could be found."
            "\n"
            "These interfaces are currently registered:"
            "\n"
            "%s" % "\n".join(pyblish.api.registered_guis())
        )

    arg_0.setText(arg_3)
    arg_0.setStandardButtons(arg_0.Ok)
    arg_0.exec_()


def Func ( arg_0 , arg_1 = None ) : if arg_1 : arg_0 . api . unsub ( arg_1 ) else : arg_0 . reply ( 'nosub' )

def Func(arg_0, arg_1=None):
        """DDP unsub handler."""
        if arg_1:
            arg_0.api.unsub(arg_1)
        else:
            arg_0.reply('nosub')


def
Func
(
)
:
arg_0
=
"$ {org:s}.{application:s}"
.
format
(
org
=
IDA_SETTINGS_ORGANIZATION
,
application
=
IDA_SETTINGS_APPLICATION
)
return
netnode
.
Netnode
(
arg_0
)

def Func():
    """
    Get the netnode used to store settings metadata in the current IDB.
    Note that this implicitly uses the open IDB via the idc iterface.
    """
    arg_0 = "$ {org:s}.{application:s}".format(
        org=IDA_SETTINGS_ORGANIZATION,
        application=IDA_SETTINGS_APPLICATION)
    return netnode.Netnode(arg_0)

Get the netnode used to store settings metadata in the current IDB . Note that this implicitly uses the open IDB via the idc iterface .


def Func ( arg_0 ) : global arg_1 if arg_1 : return '' try : import Func except ImportError : arg_1 = True return '' arg_2 = lambda s : template . Template ( s ) . render ( arg_0 ) arg_3 = get_variables ( arg_0 ) for arg_4 in arg_3 : arg_5 ( ) [ arg_4 ] = arg_0 [ arg_4 ] try : Func . settrace ( ) except socket . error : arg_1 = True return ''

def Func(arg_0):
    """
    Start a pydev settrace
    """
    global arg_1
    if arg_1:
        return ''
    try:
        import Func
    except ImportError:
        arg_1 = True
        return ''
    arg_2 = lambda s: template.Template(s).render(arg_0)
    arg_3 = get_variables(arg_0)
    for arg_4 in arg_3:
        arg_5()[arg_4] = arg_0[arg_4]
    #catch the case where no client is listening
    try:
        Func.settrace()
    except socket.error:
        arg_1 = True
    return ''


def Func(arg_0, arg_1, arg_2):
    """Initializes a topology protobuf"""
    if arg_1 == 'Topology':
      # Base class can't initialize protobuf
      return
    arg_3 = TopologyType.get_heron_options_from_env()
    arg_4 = arg_3.get("cmdline.topology.initial.state", "RUNNING")
    arg_5 = arg_3.get("cmdline.topologydefn.tmpdirectory")
    if arg_5 is None:
      raise RuntimeError("Topology definition temp directory not specified")

    arg_6 = arg_3.get("cmdline.topology.name", arg_1)
    arg_7 = arg_6 + str(uuid.uuid4())

    # create protobuf
    arg_8 = topology_pb2.Topology()
    arg_8.id = arg_7
    arg_8.name = arg_6
    arg_8.state = topology_pb2.TopologyState.Value(arg_4)
    arg_8.topology_config.CopyFrom(TopologyType.get_topology_config_protobuf(arg_2))

    TopologyType.add_bolts_and_spouts(arg_8, arg_2)

    arg_2['topology_name'] = arg_6
    arg_2['topology_id'] = arg_7
    arg_2['protobuf_topology'] = arg_8
    arg_2['topologydefn_tmpdir'] = arg_5
    arg_2['heron_runtime_options'] = arg_3


return render_template(
		'publications/publication.html', context['request'], {'publication': pbl[0]})

def Func ( arg_0 , arg_1 ) : arg_2 = Publication . objects . filter ( pk = int ( arg_1 ) ) if len ( arg_2 ) < 1 : return '' arg_2 [ 0 ] . links = arg_2 [ 0 ] . customlink_set . all ( ) arg_2 [ 0 ] . files = arg_2 [ 0 ] . customfile_set . all ( ) return render_template ( 'publications/publication.html' , arg_0 [ 'request' ] , { 'publication' : arg_2 [ 0 ] } )

def Func(arg_0, arg_1):
	"""
	Get a single publication.
	"""

	arg_2 = Publication.objects.filter(pk=int(arg_1))

	if len(arg_2) < 1:
		return ''

	arg_2[0].links = arg_2[0].customlink_set.all()
	arg_2[0].files = arg_2[0].customfile_set.all()

	return render_template(
		'publications/publication.html', arg_0['request'], {'publication': arg_2[0]})


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . _baseattrs for arg_3 in arg_1 : if hasattr ( arg_0 , arg_3 ) : arg_2 [ arg_3 ] = getattr ( arg_0 , arg_3 ) . Func ( arg_1 ) return arg_2

def Func(arg_0, arg_1=None):
        """Get extra attributes"""
        arg_2 = arg_0._baseattrs

        for arg_3 in arg_1:
            if hasattr(arg_0, arg_3):
                arg_2[arg_3] = getattr(arg_0, arg_3).Func(arg_1)

        return arg_2


(self, blocks=0, machines=0, strategy=None)

def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
0
,
arg_3
=
)
:
arg_4
=
0
arg_5
=
arg_0
.
client
.
servers
.
list
(
)
for
arg_6
in
arg_5
[
0
:
arg_2
]
:
print
(
"Deleting : "
,
arg_6
)
arg_6
.
delete
(
)
arg_4
+=
1
return
arg_4

def Func(arg_0, arg_1=0, arg_2=0, arg_3=None):
        ''' Scale in resources
        '''
        arg_4 = 0
        arg_5 = arg_0.client.servers.list()
        for arg_6 in arg_5[0:arg_2]:
            print("Deleting : ", arg_6)
            arg_6.delete()
            arg_4 += 1

        return arg_4


def
Func
(
arg_0
,
arg_1
=
0.001
)
:
validate_input_file
(
arg_0
)
arg_2
=
stat
(
arg_0
)
arg_3
=
arg_2
[
'Mean    norm'
]
if
arg_3
is
not
float
(
'nan'
)
:
if
arg_3
>=
arg_1
:
return
False
else
:
return
True
else
:
return
True

def Func(arg_0, arg_1=0.001):
    '''
    Determine if an input file is Func.

    Parameters
    ----------
    input_filepath : str
        The input filepath.
    threshold : float
        Threshold for determining silence

    Returns
    -------
    is_Func : bool
        True if file is determined Func.
    '''
    validate_input_file(arg_0)
    arg_2 = stat(arg_0)
    arg_3 = arg_2['Mean    norm']
    if arg_3 is not float('nan'):
        if arg_3 >= arg_1:
            return False
        else:
            return True
    else:
        return True

Determine if an input file is silent.

    Parameters
    ----------
    input_filepath : str
        The input filepath.
    threshold : float
        Threshold for determining silence

    Returns
    -------
    is_silent : bool
        True if file is determined silent.


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 is COMMENT : write_comment ( arg_0 , arg_2 ) return _require_string ( arg_1 , 'keys' ) _require_string ( arg_2 , 'values' ) arg_0 . write ( _escape_key ( arg_1 ) ) arg_0 . write ( b'=' ) arg_0 . write ( _escape_value ( arg_2 ) ) arg_0 . write ( b'\n' )

def Func(arg_0, arg_1, arg_2):
  """
    Write a single property to the file in Java properties format.

    :param fh: a writable file-like object
    :param key: the key to write
    :param value: the value to write
  """
  if arg_1 is COMMENT:
    write_comment(arg_0, arg_2)
    return

  _require_string(arg_1, 'keys')
  _require_string(arg_2, 'values')

  arg_0.write(_escape_key(arg_1))
  arg_0.write(b'=')
  arg_0.write(_escape_value(arg_2))
  arg_0.write(b'\n')

Write a single property to the file in Java properties format .


return len(self.clip_out_of_image(image)) > 0

def Func ( arg_0 , arg_1 , arg_2 = False ) : if len ( arg_0 . coords ) == 0 : return arg_2 arg_3 = arg_0 . get_pointwise_inside_image_mask ( arg_1 ) if np . any ( arg_3 ) : return True return len ( arg_0 . clip_out_of_image ( arg_1 ) ) > 0

def Func(arg_0, arg_1, arg_2=False):
        """
        Estimate whether the line string is at least partially inside the image.

        Parameters
        ----------
        image : ndarray or tuple of int
            Either an image with shape ``(H,W,[C])`` or a tuple denoting
            such an image shape.

        default
            Default value to return if the line string contains no points.

        Returns
        -------
        bool
            True if the line string is at least partially inside the image area.
            False otherwise.

        """
        if len(arg_0.coords) == 0:
            return arg_2
        # check mask first to avoid costly computation of intersection points
        # whenever possible
        arg_3 = arg_0.get_pointwise_inside_image_mask(arg_1)
        if np.any(arg_3):
            return True
        return len(arg_0.clip_out_of_image(arg_1)) > 0

Estimate whether the line string is at least partially inside the image .


return {met.compartment for met in self.metabolites
                if met.compartment is not None}

def
Func
(
arg_0
)
:
warn
(
'use Model.compartments instead'
,
DeprecationWarning
)
return
{
arg_1
.
compartment
for
arg_1
in
arg_0
.
metabolites
if
arg_1
.
compartment
is
not
}

def Func(arg_0):
        """Return all metabolites' compartments."""
        warn('use Model.compartments instead', DeprecationWarning)
        return {arg_1.compartment for arg_1 in arg_0.metabolites
                if arg_1.compartment is not None}


return ascii_art.ascii_art_to_game(
      GAME_ART, what_lies_beneath=' ',
      sprites=dict(
          [('P', PlayerSprite)] +
          [(c, UpwardLaserBoltSprite) for c in UPWARD_BOLT_CHARS] +
          [(c, DownwardLaserBoltSprite) for c in DOWNWARD_BOLT_CHARS]),
      drapes=dict(X=MarauderDrape,
                  B=BunkerDrape),
      update_schedule=['P', 'B', 'X'] + list(_ALL_BOLT_CHARS))

def
Func
(
)
:
return
ascii_art
.
ascii_art_to_game
(
GAME_ART
,
what_lies_beneath
=
' '
,
sprites
=
dict
(
[
(
'P'
,
PlayerSprite
)
]
+
[
(
arg_0
,
UpwardLaserBoltSprite
)
for
arg_0
in
UPWARD_BOLT_CHARS
]
+
[
(
arg_0
,
DownwardLaserBoltSprite
)
for
arg_0
in
DOWNWARD_BOLT_CHARS
]
)
,
drapes
=
dict
(
X
=
MarauderDrape
,
B
=
BunkerDrape
)
,
update_schedule
=
[
'P'
,
'B'
,
'X'
]
+
list
(
_ALL_BOLT_CHARS
)
)

def Func():
  """Builds and returns an Extraterrestrial Marauders game."""
  return ascii_art.ascii_art_to_game(
      GAME_ART, what_lies_beneath=' ',
      sprites=dict(
          [('P', PlayerSprite)] +
          [(arg_0, UpwardLaserBoltSprite) for arg_0 in UPWARD_BOLT_CHARS] +
          [(arg_0, DownwardLaserBoltSprite) for arg_0 in DOWNWARD_BOLT_CHARS]),
      drapes=dict(X=MarauderDrape,
                  B=BunkerDrape),
      update_schedule=['P', 'B', 'X'] + list(_ALL_BOLT_CHARS))

Builds and returns an Extraterrestrial Marauders game .


def Func(arg_0, arg_1, arg_2):
        """
        Set a specific setting value.

        This will overwrite the current setting value for the specified
        setting.

        Args:
            setting (string): The name of the setting to set (e.g.,
                'certificate_path', 'hostname'). Required.
            value (misc): The value of the setting to set. Type varies based
                on setting. Required.
        Raises:
            ConfigurationError: Raised if the setting is not supported or if
                the setting value is invalid.
        """
        if arg_1 not in arg_0._expected_settings + arg_0._optional_settings:
            raise exceptions.ConfigurationError(
                "Setting '{0}' is not supported.".format(arg_1)
            )

        if arg_1 == 'hostname':
            arg_0._set_hostname(arg_2)
        elif arg_1 == 'port':
            arg_0._set_port(arg_2)
        elif arg_1 == 'certificate_path':
            arg_0._set_certificate_path(arg_2)
        elif arg_1 == 'key_path':
            arg_0._set_key_path(arg_2)
        elif arg_1 == 'ca_path':
            arg_0._set_ca_path(arg_2)
        elif arg_1 == 'auth_suite':
            arg_0._set_auth_suite(arg_2)
        elif arg_1 == 'policy_path':
            arg_0._set_policy_path(arg_2)
        elif arg_1 == 'enable_tls_client_auth':
            arg_0._set_enable_tls_client_auth(arg_2)
        elif arg_1 == 'tls_cipher_suites':
            arg_0._set_tls_cipher_suites(arg_2)
        elif arg_1 == 'logging_level':
            arg_0._set_logging_level(arg_2)
        else:
            arg_0._set_database_path(arg_2)


def Func ( arg_0 , arg_1 ) : arg_1 = iter2array ( arg_1 , dtype = ReactionContainer ) arg_0 . _train_signatures = { arg_0 . __get_signature ( x ) for x in arg_1 } return arg_0

def Func(arg_0, arg_1):
        """Fit structure-based AD. The training model  memorizes the unique set of reaction signature.

        Parameters
        ----------
        X : after read rdf file

        Returns
        -------
        self : object
        """
        arg_1 = iter2array(arg_1, dtype=ReactionContainer)
        arg_0._train_signatures = {arg_0.__get_signature(x) for x in arg_1}
        return arg_0

Fit structure - based AD . The training model memorizes the unique set of reaction signature .


def Func(arg_0="unknown options"):
    """
    Print any parsing error and exit with status -1
    """
    sys.stderr.write("Error parsing command line: %s\ntry 'mongotail --help' for more information\n" % arg_0)
    sys.stderr.flush()
    exit(EINVAL)

Print any parsing error and exit with status - 1


Returns the length of the element, including the box around.

return max(len(self.top), len(self.mid), len(self.bot))

def Func ( arg_0 ) : return max ( len ( arg_0 . top ) , len ( arg_0 . mid ) , len ( arg_0 . bot ) )

def Func(arg_0):
        """ Returns the Func of the element, including the box around."""
        return max(len(arg_0.top), len(arg_0.mid), len(arg_0.bot))

Returns the length of the element including the box around .


Returns True if the current context matches, False if it doesn't and
        None if matching is not finished, ie must be resumed after child
        contexts have been matched.

def Func(arg_0, arg_1):
        """Returns True if the current context Funces, False if it doesn't and
        None if Funcing is not finished, ie must be resumed after child
        contexts have been Funced."""
        while arg_1.remaining_codes() > 0 and arg_1.has_Funced is None:
            arg_2 = arg_1.peek_code()
            if not arg_0.dispatch(arg_2, arg_1):
                return None
        if arg_1.has_Funced is None:
            arg_1.has_Funced = False
        return arg_1.has_Funced

Returns True if the current context matches False if it doesn t and None if matching is not finished ie must be resumed after child contexts have been matched .


def Func(arg_0, arg_1, arg_2=None):
        """ Migrate an expression created for a different constraint set to self.
            Returns an expression that can be used with this constraintSet

            All the foreign variables used in the expression are replaced by
            variables of this constraint set. If the variable was replaced before
            the replacement is taken from the provided migration map.

            The migration mapping is updated with new replacements.

            :param expression: the potentially foreign expression
            :param name_migration_map: mapping of already Funcd variables. maps from string name of foreign variable to its currently existing Funcd string name. this is updated during this migration.
            :return: a Funcd expression where all the variables are local. name_migration_map is updated

        """
        if arg_2 is None:
            arg_2 = {}

        #  name_migration_map -> object_migration_map
        #  Based on the name mapping in name_migration_map build an object to
        #  object mapping to be used in the replacing of variables
        #  inv: object_migration_map's keys should ALWAYS be external/foreign
        #  expressions, and its values should ALWAYS be internal/local expressions
        arg_3 = {}

        #List of foreign vars used in expression
        arg_4 = itertools.filterfalse(arg_0.is_declared, get_variables(arg_1))
        for arg_5 in arg_4:
            # If a variable with the same name was previously Funcd
            if arg_5.name in arg_2:
                arg_6 = arg_2[arg_5.name]
                arg_7 = arg_0.get_variable(arg_6)
                assert arg_7 is not None, "name_migration_map contains a variable that does not exist in this ConstraintSet"
                arg_3[arg_5] = arg_7
            else:
                # foreign_var was not found in the local declared variables nor
                # any variable with the same name was previously Funcd
                # let's make a new unique internal name for it
                arg_6 = arg_5.name
                if arg_6 in arg_0._declarations:
                    arg_6 = arg_0._make_unique_name(f'{foreign_var.name}_Funcd')
                # Create and declare a new variable of given type
                if isinstance(arg_5, Bool):
                    arg_8 = arg_0.new_bool(arg_9=arg_6)
                elif isinstance(arg_5, BitVec):
                    arg_8 = arg_0.new_bitvec(arg_5.size, arg_9=arg_6)
                elif isinstance(arg_5, Array):
                    # Note that we are discarding the ArrayProxy encapsulation
                    arg_8 = arg_0.new_array(index_max=arg_5.index_max, index_bits=arg_5.index_bits, value_bits=arg_5.value_bits, arg_9=arg_6).array
                else:
                    raise NotImplemented(f"Unknown expression type {type(var)} encountered during expression migration")
                # Update the var to var mapping
                arg_3[arg_5] = arg_8
                # Update the name to name mapping
                arg_2[arg_5.name] = arg_8.name

        #  Actually replace each appearance of Funcd variables by the new ones
        arg_10 = replace(arg_1, arg_3)
        return arg_10

Migrate an expression created for a different constraint set to self.
            Returns an expression that can be used with this constraintSet

            All the foreign variables used in the expression are replaced by
            variables of this constraint set. If the variable was replaced before
            the replacement is taken from the provided migration map.

            The migration mapping is updated with new replacements.

            :param expression: the potentially foreign expression
            :param name_migration_map: mapping of already migrated variables. maps from string name of foreign variable to its currently existing migrated string name. this is updated during this migration.
            :return: a migrated expression where all the variables are local. name_migration_map is updated

Migrate an expression created for a different constraint set to self . Returns an expression that can be used with this constraintSet


def
Func
(
arg_0
,
arg_1
=
,
**
arg_2
)
:
if
arg_0
.
app
.
debug
:
print
(
crayons
.
yellow
(
'Booting Flask development Funcr...'
)
)
arg_0
.
app
.
run
(
)
else
:
print
(
crayons
.
yellow
(
'Booting Gunicorn...'
)
)
arg_3
=
GunicornServer
(
arg_0
.
app
,
arg_1
=
arg_1
or
number_of_gunicorn_workers
(
)
,
worker_class
=
'egg:meinheld#gunicorn_worker'
,
**
arg_2
)
arg_3
.
run
(
)

def Func(arg_0, arg_1=None, **arg_2):
        """Serves the Flask application."""
        if arg_0.app.debug:
            print(crayons.yellow('Booting Flask development Funcr...'))
            arg_0.app.run()

        else:
            print(crayons.yellow('Booting Gunicorn...'))

            # Start the web Funcr.
            arg_3 = GunicornServer(
                arg_0.app, arg_1=arg_1 or number_of_gunicorn_workers(),
                worker_class='egg:meinheld#gunicorn_worker', **arg_2)
            arg_3.run()


(self, version=None, support=None, session=None)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
)
:
del
arg_3
if
arg_0
.
connection
is
not
:
raise
MeteorError
(
400
,
'Session already established.'
,
arg_0
.
connection
.
connection_id
,
)
elif
in
(
arg_1
,
arg_2
)
or
arg_1
not
in
arg_0
.
versions
:
arg_0
.
reply
(
'failed'
,
arg_1
=
arg_0
.
versions
[
0
]
)
elif
arg_1
not
in
arg_2
:
raise
MeteorError
(
400
,
'Client version/support mismatch.'
)
else
:
from
dddp
.
models
import
Connection
arg_4
=
arg_7
.
cursor
(
)
arg_4
.
execute
(
'SELECT pg_backend_pid()'
)
(
arg_5
,
)
=
arg_4
.
fetchone
(
)
arg_6
.
version
=
arg_1
arg_6
.
support
=
arg_2
arg_0
.
connection
=
Connection
.
objects
.
create
(
server_addr
=
'%d:%s'
%
(
arg_5
,
arg_0
.
ws
.
handler
.
socket
.
getsockname
(
)
,
)
,
remote_addr
=
arg_0
.
remote_addr
,
arg_1
=
arg_1
,
)
arg_0
.
pgworker
.
connections
[
arg_0
.
connection
.
pk
]
=
arg_0
atexit
.
register
(
arg_0
.
on_close
,
'Shutting down.'
)
arg_0
.
reply
(
'connected'
,
arg_3
=
arg_0
.
connection
.
connection_id
)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """DDP connect handler."""
        del arg_3  # Meteor doesn't even use this!
        if arg_0.connection is not None:
            raise MeteorError(
                400, 'Session already established.',
                arg_0.connection.connection_id,
            )
        elif None in (arg_1, arg_2) or arg_1 not in arg_0.versions:
            arg_0.reply('failed', arg_1=arg_0.versions[0])
        elif arg_1 not in arg_2:
            raise MeteorError(400, 'Client version/support mismatch.')
        else:
            from dddp.models import Connection
            arg_4 = arg_7.cursor()
            arg_4.execute('SELECT pg_backend_pid()')
            (arg_5,) = arg_4.fetchone()
            arg_6.version = arg_1
            arg_6.support = arg_2
            arg_0.connection = Connection.objects.create(
                server_addr='%d:%s' % (
                    arg_5,
                    arg_0.ws.handler.socket.getsockname(),
                ),
                remote_addr=arg_0.remote_addr,
                arg_1=arg_1,
            )
            arg_0.pgworker.connections[arg_0.connection.pk] = arg_0
            atexit.register(arg_0.on_close, 'Shutting down.')
            arg_0.reply('connected', arg_3=arg_0.connection.connection_id)


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
30
)
:
if
arg_0
.
_Funced
:
return
while
True
:
try
:
arg_0
.
_Func
(
)
if
not
arg_0
.
skip_login
:
arg_0
.
_send_login
(
)
break
except
(
LoginError
,
ConnectionError
)
:
if
not
arg_1
:
raise
arg_0
.
logger
.
info
(
"Retrying Funcion is %d seconds."
%
arg_2
)
time
.
sleep
(
arg_2
)

def Func(arg_0, arg_1=False, arg_2=30):
        """
        Initiate Funcion to APRS server and attempt to login

        blocking = False     - Should we block until Funced and logged-in
        retry = 30           - Retry interval in seconds
        """

        if arg_0._Funced:
            return

        while True:
            try:
                arg_0._Func()
                if not arg_0.skip_login:
                    arg_0._send_login()
                break
            except (LoginError, ConnectionError):
                if not arg_1:
                    raise

            arg_0.logger.info("Retrying Funcion is %d seconds." % arg_2)
            time.sleep(arg_2)

Initiate connection to APRS server and attempt to login

        blocking = False     - Should we block until connected and logged-in
        retry = 30           - Retry interval in seconds


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . setRTS ( arg_1 ) arg_0 . setDTR ( arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Set RTS and DTR to the requested state."""
    arg_0.setRTS(arg_1)
    arg_0.setDTR(arg_2)

Set RTS and DTR to the requested state .