def Func ( arg_0 , arg_1 ) : if issubclass ( arg_0 , bytes ) : return tostring ( arg_1 , encoding = 'utf-8' ) elif issubclass ( arg_0 , unicode ) : return tostring ( arg_1 , encoding = 'unicode' ) else : return arg_1

def Func(arg_0, arg_1):
    """Convert the result back into the input type.
    """
    if issubclass(arg_0, bytes):
        return tostring(arg_1, encoding='utf-8')
    elif issubclass(arg_0, unicode):
        return tostring(arg_1, encoding='unicode')
    else:
        return arg_1

Convert the result back into the input type .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . assert_package_exists ( ) if not arg_0 . package_source_info_set : arg_0 . package_source_info_set = True arg_1 . package . source_info = arg_2 return True else : raise CardinalityError ( 'Package::SourceInfo' )

def Func(arg_0, arg_1, arg_2):
        """Sets the package's source information, if not already set.
        text - Free form text.
        Raises CardinalityError if already defined.
        Raises OrderError if no package previously defined.
        """
        arg_0.assert_package_exists()
        if not arg_0.package_source_info_set:
            arg_0.package_source_info_set = True
            arg_1.package.source_info = arg_2
            return True
        else:
            raise CardinalityError('Package::SourceInfo')

Sets the package s source information if not already set . text - Free form text . Raises CardinalityError if already defined . Raises OrderError if no package previously defined .


(returns, factor_returns,
                 rolling_window=APPROX_BDAYS_PER_MONTH * 6)

def Func ( arg_0 , arg_1 , arg_2 = arg_3 * 6 ) : if arg_1 . ndim > 1 : return arg_1 . apply ( partial ( Func , arg_0 ) , arg_2 = arg_2 ) else : arg_4 = pd . Series ( index = arg_0 . index ) for arg_5 , arg_6 in zip ( arg_0 . index [ 0 : - arg_2 ] , arg_0 . index [ arg_2 : ] ) : arg_4 . loc [ arg_6 ] = ep . beta ( arg_0 . loc [ arg_5 : arg_6 ] , arg_1 . loc [ arg_5 : arg_6 ] ) return arg_4

def Func(arg_0, arg_1,
                 arg_2=arg_3 * 6):
    """
    Determines the rolling beta of a strategy.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in tears.create_full_tear_sheet.
    factor_returns : pd.Series or pd.DataFrame
        Daily noncumulative returns of the benchmark factor to which betas are
        computed. Usually a benchmark such as market returns.
         - If DataFrame is passed, computes rolling beta for each column.
         - This is in the same style as returns.
    rolling_window : int, optional
        The size of the rolling window, in days, over which to compute
        beta (default 6 months).

    Returns
    -------
    pd.Series
        Rolling beta.

    Note
    -----
    See https://en.wikipedia.org/wiki/Beta_(finance) for more details.
    """

    if arg_1.ndim > 1:
        # Apply column-wise
        return arg_1.apply(partial(Func, arg_0),
                                    arg_2=arg_2)
    else:
        arg_4 = pd.Series(index=arg_0.index)
        for arg_5, arg_6 in zip(arg_0.index[0:-arg_2],
                            arg_0.index[arg_2:]):
            arg_4.loc[arg_6] = ep.beta(
                arg_0.loc[arg_5:arg_6],
                arg_1.loc[arg_5:arg_6])

        return arg_4

Determines the rolling beta of a strategy .


def Func(arg_0, arg_1):
    """
    Template tag that renders the footer information based on the
    authenticated user's permissions.
    """
    # split_contents() doesn't know how to split quoted strings.
    arg_2 = arg_1.split_contents()

    if len(arg_2) > 1:
        raise base.TemplateSyntaxError(
            '{} tag does not accept any argument(s): {}'.format(
            arg_1.contents.split()[0],
            ', '.join(arg_1.contents.split()[1:])
    ))

    return AdminFooterNode()

Template tag that renders the footer information based on the authenticated user s permissions .


Generator which returns all keywords in the suite

def Func ( arg_0 ) : for arg_1 in arg_0 . tables : if isinstance ( arg_1 , KeywordTable ) : for arg_2 in arg_1 . Func : yield arg_2

def Func(arg_0):
        '''Generator which returns all Func in the suite'''
        for arg_1 in arg_0.tables:
            if isinstance(arg_1, KeywordTable):
                for arg_2 in arg_1.Func:
                    yield arg_2


(self, req, cano_headers, signed_headers)

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create the AWS authentication Canonical Request string.

        req            -- Requests PreparedRequest object. Should already
                          include an x-amz-content-sha256 header
        cano_headers   -- Canonical Headers section of Canonical Request, as
                          returned by get_canonical_headers()
        signed_headers -- Signed Headers, as returned by
                          get_canonical_headers()

        """
        arg_4 = urlparse(arg_1.url)
        arg_5 = arg_0.amz_cano_path(arg_4.path)
        # AWS handles "extreme" querystrings differently to urlparse
        # (see post-vanilla-query-nonunreserved test in aws_testsuite)
        arg_6 = arg_1.url.split('?', 1)
        arg_7 = arg_6[1] if len(arg_6) == 2 else ''
        arg_7 = arg_0.amz_cano_querystring(arg_7)
        arg_8 = arg_1.headers['x-amz-content-sha256']
        arg_9 = [arg_1.method.upper(), arg_5, arg_7, arg_2,
                     arg_3, arg_8]
        arg_10 = '\n'.join(arg_9)
        return arg_10

Create the AWS authentication Canonical Request string .


return self.copy(
            x1=x1,
            y1=y1,
            x2=x2,
            y2=y2,
            label=self.label
        )

def Func(arg_0, arg_1):
        """
        Clip off all parts of the bounding box that are outside of the image.

        Parameters
        ----------
        image : (H,W,...) ndarray or tuple of int
            Image dimensions to use for the clipping of the bounding box.
            If an ndarray, its shape will be used.
            If a tuple, it is assumed to represent the image shape and must contain at least two integers.

        Returns
        -------
        result : imgaug.BoundingBox
            Bounding box, clipped to fall within the image dimensions.

        """
        arg_2 = normalize_shape(arg_1)

        arg_3, arg_4 = arg_2[0:2]
        ia.do_assert(arg_3 > 0)
        ia.do_assert(arg_4 > 0)

        arg_5 = np.finfo(np.float32).eps
        arg_6 = np.clip(arg_0.x1, 0, arg_4 - arg_5)
        arg_7 = np.clip(arg_0.x2, 0, arg_4 - arg_5)
        arg_8 = np.clip(arg_0.y1, 0, arg_3 - arg_5)
        arg_9 = np.clip(arg_0.y2, 0, arg_3 - arg_5)

        return arg_0.copy(
            arg_6=arg_6,
            arg_8=arg_8,
            arg_7=arg_7,
            arg_9=arg_9,
            label=arg_0.label
        )

Clip off all parts of the bounding box that are outside of the image .


return self._get_model(url, PartialClan, **params)

def Func ( arg_0 , ** arg_1 : arg_2 ) : arg_3 = arg_0 . api . TOURNAMENT + '/search' return arg_0 . _get_model ( arg_3 , PartialClan , ** arg_1 )

def Func(arg_0, **arg_1: arg_2):
        """Search for a tournament

        Parameters
        ----------
        name: str
            The name of the tournament
        \*\*keys: Optional[list] = None
            Filter which keys should be included in the
            response
        \*\*exclude: Optional[list] = None
            Filter which keys should be excluded from the
            response
        \*\*max: Optional[int] = None
            Limit the number of items returned in the response
        \*\*page: Optional[int] = None
            Works with max, the zero-based page of the
            items
        \*\*timeout: Optional[int] = None
            Custom timeout that overwrites Client.timeout
        """
        arg_3 = arg_0.api.TOURNAMENT + '/search'
        return arg_0._get_model(arg_3, PartialClan, **arg_1)


def Func(arg_0):
        """
        Enables access to the camera.

            http://raspberrypi.stackexchange.com/questions/14229/how-can-i-enable-the-camera-without-using-raspi-config
            https://mike632t.wordpress.com/2014/06/26/raspberry-pi-camera-setup/

        Afterwards, test with:

            /opt/vc/bin/raspistill --nopreview --output image.jpg

        Check for compatibility with:

            vcgencmd get_camera

        which should show:

            supported=1 detected=1

        """
        #TODO:check per OS? Works on Raspbian Jessie
        arg_1 = arg_0.local_renderer
        if arg_0.env.camera_enabled:
            arg_1.pc('Enabling camera.')
            #TODO:fix, doesn't work on Ubuntu, which uses commented-out values

            # Set start_x=1
            #r.sudo('if grep "start_x=0" /boot/config.txt; then sed -i "s/start_x=0/start_x=1/g" /boot/config.txt; fi')
            #r.sudo('if grep "start_x" /boot/config.txt; then true; else echo "start_x=1" >> /boot/config.txt; fi')
            arg_1.enable_attr(
                filename='/boot/config.txt',
                key='start_x',
                value=1,
                use_sudo=True,
            )

            # Set gpu_mem=128
#             r.sudo('if grep "gpu_mem" /boot/config.txt; then true; else echo "gpu_mem=128" >> /boot/config.txt; fi')
            arg_1.enable_attr(
                filename='/boot/config.txt',
                key='gpu_mem',
                value=arg_1.env.gpu_mem,
                use_sudo=True,
            )

            # Compile the Raspberry Pi binaries.
            #https://github.com/raspberrypi/userland
            arg_1.run('cd ~; git clone https://github.com/raspberrypi/userland.git; cd userland; ./buildme')
            arg_1.run('touch ~/.bash_aliases')
            #r.run("echo 'PATH=$PATH:/opt/vc/bin\nexport PATH' >> ~/.bash_aliases")
            arg_1.append(r'PATH=$PATH:/opt/vc/bin\nexport PATH', '~/.bash_aliases')
            #r.run("echo 'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vc/lib\nexport LD_LIBRARY_PATH' >> ~/.bash_aliases")
            arg_1.append(r'LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vc/lib\nexport LD_LIBRARY_PATH', '~/.bash_aliases')
            arg_1.run('source ~/.bashrc')
            arg_1.sudo('ldconfig')

            # Allow our user to access the video device.
            arg_1.sudo("echo 'SUBSYSTEM==\"vchiq\",GROUP=\"video\",MODE=\"0660\"' > /etc/udev/rules.d/10-vchiq-permissions.rules")
            arg_1.sudo("usermod -a -G video {user}")

            arg_1.reboot(wait=300, timeout=60)

            arg_0.test_camera()

        else:
            arg_1.disable_attr(
                filename='/boot/config.txt',
                key='start_x',
                use_sudo=True,
            )
            arg_1.disable_attr(
                filename='/boot/config.txt',
                key='gpu_mem',
                use_sudo=True,
            )
            arg_1.reboot(wait=300, timeout=60)


(
    prior_mean, prior_cov, observation_matrix, observation_noise, x_observed)

return posterior_mean, posterior_cov, predictive_dist

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = ( tf . compat . dimension_value ( arg_2 . shape [ - 2 ] ) == 1 ) arg_6 = _propagate_mean ( arg_0 , arg_2 , arg_3 ) arg_7 = arg_2 . matmul ( arg_1 ) arg_8 = ( arg_2 . matmul ( arg_7 , adjoint_arg = True ) + arg_3 . covariance ( ) ) if arg_5 : arg_9 = arg_7 / arg_8 else : arg_10 = tf . linalg . cholesky ( arg_8 ) arg_9 = tf . linalg . cholesky_solve ( arg_10 , arg_7 ) arg_11 = ( arg_0 + tf . linalg . matmul ( arg_9 , arg_4 - arg_6 , adjoint_a = True ) ) arg_12 = - arg_2 . matmul ( arg_9 , adjoint = True ) arg_12 = tf . linalg . set_diag ( arg_12 , tf . linalg . diag_part ( arg_12 ) + 1 ) arg_13 = ( tf . linalg . matmul ( arg_12 , tf . linalg . matmul ( arg_1 , arg_12 ) , adjoint_a = True ) + tf . linalg . matmul ( arg_9 , tf . linalg . matmul ( arg_3 . covariance ( ) , arg_9 ) , adjoint_a = True ) ) if arg_5 : arg_14 = independent . Independent ( normal . Normal ( loc = arg_6 [ ... , 0 ] , scale = tf . sqrt ( arg_8 [ ... , 0 ] ) ) , reinterpreted_batch_ndims = 1 ) arg_14 . covariance = lambda : arg_8 else : arg_14 = mvn_tril . MultivariateNormalTriL ( loc = arg_6 [ ... , 0 ] , scale_tril = arg_10 ) return arg_11 , arg_13 , arg_14

def Func(
    arg_0, arg_1, arg_2, arg_3, arg_4):
  """Conjugate update for a linear Gaussian model.

  Given a normal prior on a latent variable `z`,
    `p(z) = N(prior_mean, prior_cov) = N(u, P)`,
  for which we observe a linear Gaussian transformation `x`,
    `p(x|z) = N(H * z + c, R)`,
  the posterior is also normal:
    `p(z|x) = N(u*, P*)`.

  We can write this update as
     x_expected = H * u + c # pushforward prior mean
     S = R + H * P * H'  # pushforward prior cov
     K = P * H' * S^{-1} # optimal Kalman gain
     u* = u + K * (x_observed - x_expected) # posterior mean
     P* = (I - K * H) * P (I - K * H)' + K * R * K' # posterior cov
  (see, e.g., https://en.wikipedia.org/wiki/Kalman_filter#Update)

  Args:
    prior_mean: `Tensor` with event shape `[latent_size, 1]` and
      potential batch shape `B = [b1, ..., b_n]`.
    prior_cov: `Tensor` with event shape `[latent_size, latent_size]`
      and batch shape `B` (matching `prior_mean`).
    observation_matrix: `LinearOperator` with shape
      `[observation_size, latent_size]` and batch shape broadcastable
      to `B`.
    observation_noise: potentially-batched
      `MultivariateNormalLinearOperator` instance with event shape
      `[observation_size]` and batch shape broadcastable to `B`.
    x_observed: potentially batched `Tensor` with event shape
      `[observation_size, 1]` and batch shape `B`.

  Returns:
    posterior_mean: `Tensor` with event shape `[latent_size, 1]` and
      batch shape `B`.
    posterior_cov: `Tensor` with event shape `[latent_size,
      latent_size]` and batch shape `B`.
    predictive_dist: the prior predictive distribution `p(x|z)`,
      as a `Distribution` instance with event
      shape `[observation_size]` and batch shape `B`. This will
      typically be `tfd.MultivariateNormalTriL`, but when
      `observation_size=1` we return a `tfd.Independent(tfd.Normal)`
      instance as an optimization.
  """

  # If observations are scalar, we can avoid some matrix ops.
  arg_5 = (
      tf.compat.dimension_value(arg_2.shape[-2]) == 1)

  # Push the predicted mean for the latent state through the
  # observation model
  arg_6 = _propagate_mean(arg_0,
                               arg_2,
                               arg_3)

  # Push the predictive covariance of the latent state through the
  # observation model:
  #  S = R + H * P * H'.
  # We use a temporary variable for H * P,
  # reused below to compute Kalman gain.
  arg_7 = arg_2.matmul(arg_1)
  arg_8 = (
      arg_2.matmul(arg_7, adjoint_arg=True)
      + arg_3.covariance())

  # Compute optimal Kalman gain:
  #  K = P * H' * S^{-1}
  # Since both S and P are cov matrices, thus symmetric,
  # we can take the transpose and reuse our previous
  # computation:
  #      = (S^{-1} * H * P)'
  #      = (S^{-1} * tmp_obs_cov) '
  #      = (S \ tmp_obs_cov)'
  if arg_5:
    arg_9 = arg_7/arg_8
  else:
    arg_10 = tf.linalg.cholesky(arg_8)
    arg_9 = tf.linalg.cholesky_solve(arg_10,
                                              arg_7)

  # Compute the posterior mean, incorporating the observation.
  #  u* = u + K (x_observed - x_expected)
  arg_11 = (arg_0 +
                    tf.linalg.matmul(arg_9, arg_4 - arg_6,
                                     adjoint_a=True))

  # For the posterior covariance, we could use the simple update
  #  P* = P - K * H * P
  # but this is prone to numerical issues because it subtracts a
  # value from a PSD matrix.  We choose instead to use the more
  # expensive Jordan form update
  #  P* = (I - K H) * P * (I - K H)' + K R K'
  # which always produces a PSD result. This uses
  #  tmp_term = (I - K * H)'
  # as an intermediate quantity.
  arg_12 = -arg_2.matmul(arg_9, adjoint=True)  # -K * H
  arg_12 = tf.linalg.set_diag(arg_12, tf.linalg.diag_part(arg_12) + 1)
  arg_13 = (
      tf.linalg.matmul(
          arg_12, tf.linalg.matmul(arg_1, arg_12), adjoint_a=True)
      + tf.linalg.matmul(arg_9,
                         tf.linalg.matmul(
                             arg_3.covariance(), arg_9),
                         adjoint_a=True))

  if arg_5:
    # A plain Normal would have event shape `[]`; wrapping with Independent
    # ensures `event_shape=[1]` as required.
    arg_14 = independent.Independent(
        normal.Normal(loc=arg_6[..., 0],
                      scale=tf.sqrt(arg_8[..., 0])),
        reinterpreted_batch_ndims=1)

    # Minor hack to define the covariance, so that `predictive_dist` can pass as
    # an MVNTriL-like object.
    arg_14.covariance = lambda: arg_8
  else:
    arg_14 = mvn_tril.MultivariateNormalTriL(
        loc=arg_6[..., 0],
        scale_tril=arg_10)

  return arg_11, arg_13, arg_14

Conjugate update for a linear Gaussian model .


def
Func
(
)
:
try
:
return
os
.
sysconf
(
"SC_NPROCESSORS_ONLN"
)
except
ValueError
:
arg_0
=
0
arg_1
=
open
(
'/proc/cpuinfo'
,
'r'
)
try
:
arg_2
=
arg_1
.
readlines
(
)
finally
:
arg_1
.
close
(
)
for
arg_3
in
arg_2
:
if
arg_3
.
lower
(
)
.
startswith
(
'processor'
)
:
arg_0
+=
1
if
arg_0
==
0
:
arg_1
=
open
(
'/proc/stat'
,
'r'
)
try
:
arg_2
=
arg_1
.
readlines
(
)
finally
:
arg_1
.
close
(
)
arg_4
=
re
.
compile
(
'cpu\d'
)
for
arg_3
in
arg_2
:
arg_3
=
arg_3
.
split
(
' '
)
[
0
]
if
arg_4
.
match
(
arg_3
)
:
arg_0
+=
1
if
arg_0
==
0
:
raise
RuntimeError
(
"can't determine number of CPUs"
)
return
arg_0

def Func():
    """Return the number of CPUs on the system"""
    # we try to determine num CPUs by using different approaches.
    # SC_NPROCESSORS_ONLN seems to be the safer and it is also
    # used by multiprocessing module
    try:
        return os.sysconf("SC_NPROCESSORS_ONLN")
    except ValueError:
        # as a second fallback we try to parse /proc/cpuinfo
        arg_0 = 0
        arg_1 = open('/proc/cpuinfo', 'r')
        try:
            arg_2 = arg_1.readlines()
        finally:
            arg_1.close()
        for arg_3 in arg_2:
            if arg_3.lower().startswith('processor'):
                arg_0 += 1

    # unknown format (e.g. amrel/sparc architectures), see:
    # http://code.google.com/p/psutil/issues/detail?id=200
    # try to parse /proc/stat as a last resort
    if arg_0 == 0:
        arg_1 = open('/proc/stat', 'r')
        try:
            arg_2 = arg_1.readlines()
        finally:
            arg_1.close()
        arg_4 = re.compile('cpu\d')
        for arg_3 in arg_2:
            arg_3 = arg_3.split(' ')[0]
            if arg_4.match(arg_3):
                arg_0 += 1

    if arg_0 == 0:
        raise RuntimeError("can't determine number of CPUs")
    return arg_0


def
Func
(
arg_0
,
arg_1
=
False
)
:
try
:
arg_0
.
sock
.
setblocking
(
0
)
except
socket
.
error
as
e
:
arg_0
.
logger
.
error
(
"socket error when setblocking(0): %s"
%
str
(
e
)
)
raise
ConnectionDrop
(
"connection dropped"
)
while
True
:
arg_2
=
b''
arg_3
=
b'\r\n'
select
.
select
(
[
arg_0
.
sock
]
,
[
]
,
[
]
,
if
arg_1
else
0
)
try
:
arg_2
=
arg_0
.
sock
.
recv
(
4096
)
if
not
arg_2
:
arg_0
.
logger
.
error
(
"socket.recv(): returned empty"
)
raise
ConnectionDrop
(
"connection dropped"
)
except
socket
.
error
as
e
:
arg_0
.
logger
.
error
(
"socket error on recv(): %s"
%
str
(
e
)
)
if
"Resource temporarily unavailable"
in
str
(
e
)
:
if
not
arg_1
:
if
len
(
arg_0
.
buf
)
==
0
:
break
arg_0
.
buf
+=
arg_2
while
arg_3
in
arg_0
.
buf
:
arg_4
,
arg_0
.
buf
=
arg_0
.
buf
.
split
(
arg_3
,
1
)
yield
arg_4

def Func(arg_0, arg_1=False):
        """
        Generator for complete lines, received from the server
        """
        try:
            arg_0.sock.setblocking(0)
        except socket.error as e:
            arg_0.logger.error("socket error when setblocking(0): %s" % str(e))
            raise ConnectionDrop("connection dropped")

        while True:
            arg_2 = b''
            arg_3 = b'\r\n'

            select.select([arg_0.sock], [], [], None if arg_1 else 0)

            try:
                arg_2 = arg_0.sock.recv(4096)

                # sock.recv returns empty if the connection drops
                if not arg_2:
                    arg_0.logger.error("socket.recv(): returned empty")
                    raise ConnectionDrop("connection dropped")
            except socket.error as e:
                arg_0.logger.error("socket error on recv(): %s" % str(e))
                if "Resource temporarily unavailable" in str(e):
                    if not arg_1:
                        if len(arg_0.buf) == 0:
                            break

            arg_0.buf += arg_2

            while arg_3 in arg_0.buf:
                arg_4, arg_0.buf = arg_0.buf.split(arg_3, 1)

                yield arg_4

Generator for complete lines received from the server


return flatten(reversed(topological_sort(g)) for g in task_graphs)

def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_0 : arg_4 = DiGraph ( ) arg_4 . add_node ( arg_3 ) _get_deps ( arg_3 , arg_4 , arg_1 ) arg_2 . append ( arg_4 ) return flatten ( reversed ( topological_sort ( arg_5 ) ) for arg_5 in arg_2 )

def Func(arg_0, arg_1):
    """Given a list of tasks to perform and a dependency graph, return the tasks
    that must be performed, in the correct order"""

    #XXX: Is it important that if a task has "foo" before "bar" as a dep,
    #     that foo executes before bar? Why? ATM this may not happen.

    #Each task that the user has specified gets its own execution graph
    arg_2 = []

    for arg_3 in arg_0:
        arg_4 = DiGraph()
        arg_4.add_node(arg_3)
        _get_deps(arg_3, arg_4, arg_1)

        arg_2.append(arg_4)

    return flatten(reversed(topological_sort(arg_5)) for arg_5 in arg_2)

Given a list of tasks to perform and a dependency graph return the tasks that must be performed in the correct order


def Func(arg_0):
        """Replace the invalid chars of SPAN_PARSER_TYPES with b'_'.

        For comments, all characters are replaced, but for ('Template',
        'ParserFunction', 'Parameter') only invalid characters are replaced.
        """
        arg_1, arg_2 = arg_0._span
        arg_3 = arg_0._lststr[0][arg_1:arg_2]
        arg_4 = bytearray(arg_3, 'ascii', 'replace')
        arg_5 = arg_0._subspans
        for arg_6 in 'Template', 'ParserFunction', 'Parameter':
            for arg_7, arg_8 in arg_5(arg_6):
                arg_4[arg_7:arg_8] = b'  ' + INVALID_EXT_CHARS_SUB(
                    b' ', arg_4[arg_7 + 2:arg_8 - 2]) + b'  '
        for arg_7, arg_8 in arg_5('Comment'):
            arg_4[arg_7:arg_8] = (arg_8 - arg_7) * b'_'
        return arg_4

Replace the invalid chars of SPAN_PARSER_TYPES with b _ .


def Func(arg_0):
        """
        Get the metadata returned after authentication
        """
        try:
            arg_1 = requests.get('https://login.mailchimp.com/oauth2/metadata', auth=arg_0)
        except requests.exceptions.RequestException as e:
            raise e
        else:
            arg_1.raise_for_status()
            arg_2 = arg_1.json()
            if 'error' in arg_2:
                raise requests.exceptions.RequestException(arg_2['error'])
            return arg_2


async def Func(arg_0):
        """Handle connecting for the first time."""
        arg_0._user_list, arg_0._conv_list = (
            await hangups.build_user_conversation_list(arg_0._client)
        )
        arg_0._conv_list.on_event.add_observer(arg_0._on_event)

        # show the conversation menu
        arg_3 = ConversationPickerWidget(arg_0._conv_list,
                                               arg_0.on_select_conversation,
                                               arg_0._keys)
        arg_0._tabbed_window = TabbedWindowWidget(arg_0._keys)
        arg_0._tabbed_window.set_tab(arg_3, switch=True,
                                    title='Conversations')
        arg_0._urwid_loop.widget = arg_0._tabbed_window


def Func(arg_0, arg_1):
    """Simulation function for Euler integration.

    :param traj:

        Container for parameters and results

    :param diff_func:

        The differential equation we want to integrate

    """

    arg_2 = arg_0.steps
    arg_3 = arg_0.initial_conditions
    arg_4 = len(arg_3)

    # This array will collect the results
    arg_5 = np.zeros((arg_2,arg_4))
    # Get the function parameters stored into `traj` as a dictionary
    # with the (short) names as keys :
    arg_6 = arg_0.func_params.f_to_dict(short_names=True, fast_access=True)
    # Take initial conditions as first result
    arg_5[0] = arg_3

    # Now we compute the Euler Scheme steps-1 times
    for arg_7 in range(1,arg_2):
        arg_5[arg_7] = arg_1(arg_5[arg_7-1], **arg_6) * arg_0.dt + \
                            arg_5[arg_7-1]
    # Note the **func_params_dict unzips the dictionary, it's the reverse of **kwargs in function
    # definitions!

    #Finally we want to keep the results
    arg_0.f_add_result('euler_evolution', data=arg_5, comment='Our time series data!')

Simulation function for Euler integration .


def Func ( arg_0 , arg_1 ) : if arg_1 . widget : arg_0 . parent ( ) . init_info_window_adapter ( ) super ( AndroidMapMarker , arg_0 ) . Func ( arg_1 )

def Func(arg_0, arg_1):
        """ If a child is added we have to make sure the map adapter exists """
        if arg_1.widget:
            # TODO: Should we keep count and remove the adapter if not all
            # markers request it?
            arg_0.parent().init_info_window_adapter()
        super(AndroidMapMarker, arg_0).Func(arg_1)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . upper ( ) . replace ( '.' , '_' ) return os . environ . get ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
    """
    Try to get `key` from the environment.

    This mutates `key` to replace dots with underscores and makes it all
    uppercase.

        my.database.host => MY_DATABASE_HOST

    """
    arg_2 = arg_0.upper().replace('.', '_')
    return os.environ.get(arg_2, arg_1)


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = arg_0 . _all_get_from_attrs ( arg_2 , arg_3 + HDF5StorageService . SCALAR_TYPE ) arg_5 = arg_0 . _all_get_from_attrs ( arg_2 , arg_3 + HDF5StorageService . COLL_TYPE ) arg_6 = False if arg_5 == HDF5StorageService . COLL_SCALAR : if isinstance ( arg_1 , np . ndarray ) : arg_1 = np . array ( [ arg_1 ] ) [ 0 ] arg_6 = True if not arg_4 is None : if arg_4 != type ( arg_1 ) . __name__ : if arg_4 == str . __name__ : arg_1 = arg_1 . decode ( arg_0 . _encoding ) else : try : arg_1 = pypetconstants . PARAMETERTYPEDICT [ arg_4 ] ( arg_1 ) except KeyError : arg_1 = pypetconstants . COMPATPARAMETERTYPEDICT [ arg_4 ] ( arg_1 ) arg_6 = True elif ( arg_5 == HDF5StorageService . COLL_TUPLE or arg_5 == HDF5StorageService . COLL_LIST ) : if type ( arg_1 ) is not list and type is not tuple : arg_6 = True arg_1 = list ( arg_1 ) if len ( arg_1 ) > 0 : arg_7 = arg_1 [ 0 ] if not arg_4 == type ( arg_7 ) . __name__ : if not isinstance ( arg_1 , list ) : arg_1 = list ( arg_1 ) for arg_8 , arg_9 in enumerate ( arg_1 ) : if arg_4 == str . __name__ : arg_1 [ arg_8 ] = arg_1 [ arg_8 ] . decode ( arg_0 . _encoding ) else : try : arg_1 [ arg_8 ] = pypetconstants . PARAMETERTYPEDICT [ arg_4 ] ( arg_9 ) except KeyError : arg_1 [ arg_8 ] = pypetconstants . COMPATPARAMETERTYPEDICT [ arg_4 ] ( arg_9 ) arg_6 = True if arg_5 == HDF5StorageService . COLL_TUPLE : if type ( arg_1 ) is not tuple : arg_1 = tuple ( arg_1 ) arg_6 = True elif arg_5 == HDF5StorageService . COLL_EMPTY_DICT : arg_1 = { } arg_6 = True elif isinstance ( arg_1 , np . ndarray ) : if arg_4 == str . __name__ : arg_1 = np . core . defchararray . decode ( arg_1 , arg_0 . _encoding ) arg_6 = True if arg_5 == HDF5StorageService . COLL_MATRIX : arg_1 = np . matrix ( arg_1 ) arg_6 = True return arg_1 , arg_6

def Func(arg_0, arg_1, arg_2, arg_3):
        """Checks if loaded data has the type it was stored in. If not converts it.

        :param data: Data item to be checked and converted
        :param ptitem: HDf5 Node or Leaf from where data was loaded
        :param prefix: Prefix for recalling the data type from the hdf5 node attributes

        :return:

            Tuple, first item is the (converted) `data` item, second boolean whether
            item was converted or not.

        """
        arg_4 = arg_0._all_get_from_attrs(arg_2, arg_3 + HDF5StorageService.SCALAR_TYPE)
        arg_5 = arg_0._all_get_from_attrs(arg_2, arg_3 + HDF5StorageService.COLL_TYPE)
        arg_6 = False

        # Check what the original data type was from the hdf5 node attributes
        if arg_5 == HDF5StorageService.COLL_SCALAR:
            # Here data item was a scalar

            if isinstance(arg_1, np.ndarray):
                # If we recall a numpy scalar, pytables loads a 1d array :-/
                # So we have to change it to a real scalar value
                arg_1 = np.array([arg_1])[0]
                arg_6 = True

            if not arg_4 is None:
                # Check if current type and stored type match
                # if not convert the data
                if arg_4 != type(arg_1).__name__:

                    if arg_4 == str.__name__:
                        arg_1 = arg_1.decode(arg_0._encoding)
                    else:
                        try:
                            arg_1 = pypetconstants.PARAMETERTYPEDICT[arg_4](arg_1)
                        except KeyError:
                            # For compatibility with files from older pypet versions
                            arg_1 = pypetconstants.COMPATPARAMETERTYPEDICT[arg_4](arg_1)

                    arg_6 = True

        elif (arg_5 == HDF5StorageService.COLL_TUPLE or
                        arg_5 == HDF5StorageService.COLL_LIST):
            # Here data item was originally a tuple or a list

            if type(arg_1) is not list and type is not tuple:
                # If the original type cannot be recalled, first convert it to a list
                arg_6 = True
                arg_1 = list(arg_1)

            if len(arg_1) > 0:
                arg_7 = arg_1[0]
                # Check if the type of the first item was conserved
                if not arg_4 == type(arg_7).__name__:

                    if not isinstance(arg_1, list):
                        arg_1 = list(arg_1)

                    # If type was not conserved we need to convert all items
                    # in the list or tuple
                    for arg_8, arg_9 in enumerate(arg_1):
                        if arg_4 == str.__name__:
                            arg_1[arg_8] = arg_1[arg_8].decode(arg_0._encoding)
                        else:
                            try:
                                arg_1[arg_8] = pypetconstants.PARAMETERTYPEDICT[arg_4](arg_9)
                            except KeyError:
                                # For compatibility with files from older pypet versions:
                                arg_1[arg_8] = pypetconstants.COMPATPARAMETERTYPEDICT[arg_4](arg_9)
                        arg_6 = True

            if arg_5 == HDF5StorageService.COLL_TUPLE:
                # If it was originally a tuple we need to convert it back to tuple
                if type(arg_1) is not tuple:
                    arg_1 = tuple(arg_1)
                    arg_6 = True
        elif arg_5 == HDF5StorageService.COLL_EMPTY_DICT:
            arg_1 = {}
            arg_6 = True
        elif isinstance(arg_1, np.ndarray):

            if arg_4 == str.__name__:
                arg_1 = np.core.defchararray.decode(arg_1, arg_0._encoding)
                arg_6 = True

            if arg_5 == HDF5StorageService.COLL_MATRIX:
                # Here data item was originally a matrix
                arg_1 = np.matrix(arg_1)
                arg_6 = True

        return arg_1, arg_6

Checks if loaded data has the type it was stored in . If not converts it .


def
Func
(
arg_0
,
arg_1
:
arg_2
)
:
if
arg_1
in
arg_0
.
_cti_files
:
arg_0
.
_cti_files
.
remove
(
arg_1
)
arg_0
.
_logger
.
info
(
'Removed {0} from the CTI file list.'
.
format
(
arg_1
)
)

def Func(arg_0, arg_1: arg_2):
        """
        Removes the specified CTI file from the CTI file list.

        :param file_path: Set a file path to the target CTI file.

        :return: None.
        """
        if arg_1 in arg_0._cti_files:
            arg_0._cti_files.remove(arg_1)
            arg_0._logger.info(
                'Removed {0} from the CTI file list.'.format(arg_1)
            )

Removes the specified CTI file from the CTI file list .


def Func(arg_0, arg_1, arg_2, arg_3):
        """Drops a REQUIRED CONSTRAINT for the specified hstore key."""

        arg_4 = arg_0._required_constraint_name(
            arg_1, arg_2, arg_3)

        arg_5 = arg_0.sql_hstore_required_drop.format(
            table=arg_0.quote_name(arg_1),
            arg_4=arg_0.quote_name(arg_4)
        )
        arg_0.execute(arg_5)

Drops a REQUIRED CONSTRAINT for the specified hstore key .


def Func ( ) : if not os . path . isdir ( AtomShieldsScanner . CHECKERS_DIR ) : os . makedirs ( AtomShieldsScanner . CHECKERS_DIR ) if not os . path . isdir ( AtomShieldsScanner . REPORTS_DIR ) : os . makedirs ( AtomShieldsScanner . REPORTS_DIR ) for arg_0 in AtomShieldsScanner . _getFiles ( os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , "checkers" ) , "*.py" ) : AtomShieldsScanner . installChecker ( arg_0 ) for arg_0 in AtomShieldsScanner . _getFiles ( os . path . join ( os . path . dirname ( os . path . realpath ( __file__ ) ) , "reports" ) , "*.py" ) : AtomShieldsScanner . installReport ( arg_0 ) AtomShieldsScanner . _executeMassiveMethod ( path = AtomShieldsScanner . CHECKERS_DIR , method = "install" , args = { } ) arg_1 = os . path . dirname ( AtomShieldsScanner . CONFIG_PATH ) if not os . path . isdir ( arg_1 ) : os . makedirs ( arg_1 )

def Func():
		"""
			Creates required directories and copy checkers and reports.
		"""

		# # Check if dir is writable
		# if not os.access(AtomShieldsScanner.HOME, os.W_OK):
		# 	AtomShieldsScanner.HOME = os.path.expanduser("~/.atomshields")
		# 	AtomShieldsScanner.CHECKERS_DIR = os.path.join(AtomShieldsScanner.HOME, "checkers")
		# 	AtomShieldsScanner.REPORTS_DIR = os.path.join(AtomShieldsScanner.HOME, "reports")

		if not os.path.isdir(AtomShieldsScanner.CHECKERS_DIR):
			os.makedirs(AtomShieldsScanner.CHECKERS_DIR)
		if not os.path.isdir(AtomShieldsScanner.REPORTS_DIR):
			os.makedirs(AtomShieldsScanner.REPORTS_DIR)

		# Copy all checkers
		for arg_0 in AtomShieldsScanner._getFiles(os.path.join(os.path.dirname(os.path.realpath(__file__)), "checkers"), "*.py"):
			AtomShieldsScanner.installChecker(arg_0)
		# Copy all reports
		for arg_0 in AtomShieldsScanner._getFiles(os.path.join(os.path.dirname(os.path.realpath(__file__)), "reports"), "*.py"):
			AtomShieldsScanner.installReport(arg_0)

		AtomShieldsScanner._executeMassiveMethod(path=AtomShieldsScanner.CHECKERS_DIR, method="install", args={})

		arg_1 = os.path.dirname(AtomShieldsScanner.CONFIG_PATH)
		if not os.path.isdir(arg_1):
			os.makedirs(arg_1)

Creates required directories and copy checkers and reports .


def Func ( ) : arg_0 = arg_2 . auto_register disable_auto_register ( ) def decorator ( arg_1 ) : arg_2 . auto_register = arg_0 return arg_1 return decorator

def Func():
    """ Temporarily disable automatic registration of records in the auto_store

    Decorator factory. This is _NOT_ thread safe

    >>> @Func()
    ... class BarRecord(Record):
    ...     pass
    >>> BarRecord in auto_store
    False

    """
    arg_0 = arg_2.auto_register
    disable_auto_register()

    def decorator(arg_1):
        arg_2.auto_register = arg_0
        return arg_1

    return decorator

Temporarily disable automatic registration of records in the auto_store

    Decorator factory. This is _NOT_ thread safe

    >>> @no_auto_store()
    ... class BarRecord(Record):
    ...     pass
    >>> BarRecord in auto_store
    False


def
Func
(
arg_0
,
arg_1
)
:
for
arg_2
in
os
.
listdir
(
arg_0
)
:
if
not
arg_2
.
endswith
(
'.bel'
)
:
continue
log
.
info
(
'linting: %s'
,
arg_2
)
with
open
(
os
.
path
.
join
(
arg_0
,
arg_2
)
)
as
i
,
open
(
os
.
path
.
join
(
arg_1
,
arg_2
)
,
'w'
)
as
o
:
lint_file
(
i
,
o
)

def Func(arg_0, arg_1):
    """Adds a linted version of each document in the source directory to the target directory

    :param str source: Path to directory to lint
    :param str target: Path to directory to output
    """
    for arg_2 in os.listdir(arg_0):
        if not arg_2.endswith('.bel'):
            continue

        log.info('linting: %s', arg_2)
        with open(os.path.join(arg_0, arg_2)) as i, open(os.path.join(arg_1, arg_2), 'w') as o:
            lint_file(i, o)


(self, email, refund_id, amount, course_name, order_number, order_url, site_code=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7=None):
    """ Sends the course refund email.

    Args:
        self: Ignore.
        email (str): Recipient's email address.
        refund_id (int): ID of the refund that initiated this task.
        amount (str): Formatted amount of the refund.
        course_name (str): Name of the course for which payment was refunded.
        order_number (str): Order number of the order that was refunded.
        order_url (str): Receipt URL of the refunded order.
        site_code (str): Identifier of the site sending the email.
    """
    arg_8 = get_sailthru_configuration(arg_7)

    try:
        arg_9 = get_sailthru_client(arg_7)
    except SailthruError:
        # NOTE: We rely on the function to log the error for us
        return

    arg_10 = {
        'amount': arg_3,
        'course_name': arg_4,
        'order_number': arg_5,
        'order_url': arg_6,
    }

    try:
        arg_11 = arg_9.send(
            template=arg_8['templates']['course_refund'],
            arg_1=arg_1,
            _vars=arg_10
        )
    except SailthruClientError:
        logger.exception(
            'A client error occurred while attempting to send a course refund notification for refund [%d].',
            arg_2
        )
        return

    if arg_11.is_ok():
        logger.info('Course refund notification sent for refund %d.', arg_2)
    else:
        arg_12 = arg_11.get_error()
        logger.error(
            'An error occurred while attempting to send a course refund notification for refund [%d]: %d - %s',
            arg_2, arg_12.get_error_code(), arg_12.get_message()
        )

        if can_retry_sailthru_request(arg_12):
            logger.info(
                'An attempt will be made again to send a course refund notification for refund [%d].',
                arg_2
            )
            schedule_retry(arg_0, arg_8)
        else:
            logger.warning(
                'No further attempts will be made to send a course refund notification for refund [%d].',
                arg_2
            )


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : if arg_0 . is_closed : raise ErrConnectionClosed if arg_0 . is_draining_pubs : raise ErrConnectionDraining arg_4 = len ( arg_3 ) if arg_4 > arg_0 . _max_payload : raise ErrMaxPayload yield from arg_0 . _publish ( arg_1 , arg_2 . encode ( ) , arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Publishes a message tagging it with a reply subscription
        which can be used by those receiving the message to respond.

           ->> PUB hello   _INBOX.2007314fe0fcb2cdc2a2914c1 5
           ->> MSG_PAYLOAD: world
           <<- MSG hello 2 _INBOX.2007314fe0fcb2cdc2a2914c1 5

        """
        if arg_0.is_closed:
            raise ErrConnectionClosed
        if arg_0.is_draining_pubs:
            raise ErrConnectionDraining

        arg_4 = len(arg_3)
        if arg_4 > arg_0._max_payload:
            raise ErrMaxPayload
        yield from arg_0._publish(arg_1, arg_2.encode(), arg_3, arg_4)

Publishes a message tagging it with a reply subscription which can be used by those receiving the message to respond .


def Func(arg_0, arg_1):
        """Set the value

        This invokes hooks for type-checking and bounds-checking that
        may be implemented by sub-classes.
        """
        arg_0.check_bounds(arg_1)
        arg_0.check_type(arg_1)
        arg_0.__value__ = arg_1


(
    treatment_effects, treatment_stddevs,
    avg_effect, avg_stddev, school_effects_standard)

return (
      rv_avg_effect.log_prob(avg_effect) +
      rv_avg_stddev.log_prob(avg_stddev) +
      rv_school_effects_standard.log_prob(school_effects_standard) +
      rv_treatment_effects.log_prob(treatment_effects))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = tfd . Normal ( loc = 0. , scale = 10. ) arg_6 = tfd . Normal ( loc = 5. , scale = 1. ) arg_7 = mvn ( loc = tf . zeros_like ( arg_4 ) , scale = tf . ones_like ( arg_4 ) ) arg_8 = mvn ( loc = ( arg_2 + tf . exp ( arg_3 ) * arg_4 ) , scale = arg_1 ) return ( arg_5 . log_prob ( arg_2 ) + arg_6 . log_prob ( arg_3 ) + arg_7 . log_prob ( arg_4 ) + arg_8 . log_prob ( arg_0 ) )

def Func(
    arg_0, arg_1,
    arg_2, arg_3, arg_4):
  """Eight-schools joint log-prob."""
  arg_5 = tfd.Normal(loc=0., scale=10.)
  arg_6 = tfd.Normal(loc=5., scale=1.)
  arg_7 = mvn(
      loc=tf.zeros_like(arg_4),
      scale=tf.ones_like(arg_4))
  arg_8 = mvn(
      loc=(arg_2 + tf.exp(arg_3) * arg_4),
      scale=arg_1)
  return (
      arg_5.log_prob(arg_2) +
      arg_6.log_prob(arg_3) +
      arg_7.log_prob(arg_4) +
      arg_8.log_prob(arg_0))


def Func(arg_0, arg_1):
    """ This returns formatted volume specifications for a docker-compose app. We mount the app
    as well as any libs it needs so that local code is used in our container, instead of whatever
    code was in the docker image.

    Additionally, we create a volume for the /cp directory used by Dusty to facilitate
    easy file transfers using `dusty cp`."""
    arg_2 = []
    arg_2.append(_get_cp_volume_mount(arg_0))
    arg_2 += get_app_volume_mounts(arg_0, arg_1)
    return arg_2

This returns formatted volume specifications for a docker - compose app . We mount the app as well as any libs it needs so that local code is used in our container instead of whatever code was in the docker image .


def Func ( arg_0 ) : if not hasattr ( arg_0 , '__mro__' ) : try : arg_0 = type ( arg_0 . __name__ , ( arg_0 , object ) , { } ) except TypeError : arg_1 = [ arg_0 ] else : arg_1 = arg_0 . __mro__ [ 1 : - 1 ] else : arg_1 = arg_0 . __mro__ return arg_1

def Func(arg_0):
    """ Get a reasonable method resolution order of a class and its superclasses
    for both old-style and new-style classes.
    """
    if not hasattr(arg_0, '__mro__'):
        # Old-style class. Mix in object to make a fake new-style class.
        try:
            arg_0 = type(arg_0.__name__, (arg_0, object), {})
        except TypeError:
            # Old-style extension type that does not descend from object.
            # FIXME: try to construct a more thorough MRO.
            arg_1 = [arg_0]
        else:
            arg_1 = arg_0.__mro__[1:-1]
    else:
        arg_1 = arg_0.__mro__
    return arg_1

Get a reasonable method resolution order of a class and its superclasses for both old - style and new - style classes .


def
Func
(
arg_0
)
:
def
wrapper
(
arg_1
,
*
arg_2
,
**
arg_3
)
:
arg_4
=
if
'init'
not
in
arg_3
else
arg_3
.
pop
(
'init'
)
if
arg_1
is
:
raise
TypeError
(
'A Funcr must have input.'
)
for
arg_5
in
arg_1
:
arg_4
=
arg_0
(
arg_4
,
arg_5
,
*
arg_2
,
**
arg_3
)
yield
arg_4
return
Pipe
(
wrapper
)

def Func(arg_0):
        """Wrap a Func function to Pipe object. Reduce function is a function
        with at least two arguments. It works like built-in Func function.
        It takes first argument for accumulated result, second argument for
        the new data to process. A keyword-based argument named 'init' is
        optional. If init is provided, it is used for the initial value of
        accumulated result. Or, the initial value is None.

        The first argument is the data to be converted. The return data from
        filter function should be a boolean value. If true, data can pass.
        Otherwise, data is omitted.

        :param func: The filter function to be wrapped.
        :type func: function object
        :param args: The default arguments to be used for filter function.
        :param kw: The default keyword arguments to be used for filter function.
        :returns: Pipe object
        """
        def wrapper(arg_1, *arg_2, **arg_3):
            arg_4 = None if 'init' not in arg_3 else arg_3.pop('init')
            if arg_1 is None:
                raise TypeError('A Funcr must have input.')
            for arg_5 in arg_1:
                arg_4 = arg_0(arg_4, arg_5, *arg_2, **arg_3)
            yield arg_4
        return Pipe(wrapper)

Wrap a reduce function to Pipe object. Reduce function is a function
        with at least two arguments. It works like built-in reduce function.
        It takes first argument for accumulated result, second argument for
        the new data to process. A keyword-based argument named 'init' is
        optional. If init is provided, it is used for the initial value of
        accumulated result. Or, the initial value is None.

        The first argument is the data to be converted. The return data from
        filter function should be a boolean value. If true, data can pass.
        Otherwise, data is omitted.

        :param func: The filter function to be wrapped.
        :type func: function object
        :param args: The default arguments to be used for filter function.
        :param kw: The default keyword arguments to be used for filter function.
        :returns: Pipe object

Wrap a reduce function to Pipe object . Reduce function is a function with at least two arguments . It works like built - in reduce function . It takes first argument for accumulated result second argument for the new data to process . A keyword - based argument named init is optional . If init is provided it is used for the initial value of accumulated result . Or the initial value is None .


(self, service_name, deployment_name, role_name, lun,
                         host_caching=None, media_link=None, updated_lun=None,
                         disk_label=None, disk_name=None,
                         logical_disk_size_in_gb=None)

return self._perform_put(
            self._get_data_disk_path(
                service_name, deployment_name, role_name, lun),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                host_caching,
                disk_label,
                disk_name,
                updated_lun,
                logical_disk_size_in_gb,
                media_link,
                None),
            as_async=True)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                         arg_5=None, arg_6=None, arg_7=None,
                         arg_8=None, arg_9=None,
                         arg_10=None):
        '''
        Updates the specified data disk attached to the specified virtual
        machine.

        service_name:
            The name of the service.
        deployment_name:
            The name of the deployment.
        role_name:
            The name of the role.
        lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through
            15.
        host_caching:
            Specifies the platform caching behavior of data disk blob for
            read/write efficiency. The default vault is ReadOnly. Possible
            values are: None, ReadOnly, ReadWrite
        media_link:
            Specifies the location of the blob in Windows Azure blob store
            where the media for the disk is located. The blob location must
            belong to the storage account in the subscription specified by
            the <subscription-id> value in the operation call. Example:
            http://example.blob.core.windows.net/disks/mydisk.vhd
        updated_lun:
            Specifies the Logical Unit Number (LUN) for the disk. The LUN
            specifies the slot in which the data drive appears when mounted
            for usage by the virtual machine. Valid LUN values are 0 through 15.
        disk_label:
            Specifies the description of the data disk. When you attach a disk,
            either by directly referencing a media using the MediaLink element
            or specifying the target disk size, you can use the DiskLabel
            element to customize the name property of the target data disk.
        disk_name:
            Specifies the name of the disk. Windows Azure uses the specified
            disk to create the data disk for the machine and populates this
            field with the disk name.
        logical_disk_size_in_gb:
            Specifies the size, in GB, of an empty disk to be attached to the
            role. The disk can be created as part of disk attach or create VM
            role call by specifying the value for this property. Windows Azure
            creates the empty disk based on size preference and attaches the
            newly created disk to the Role.
        '''
        _validate_not_none('service_name', arg_1)
        _validate_not_none('deployment_name', arg_2)
        _validate_not_none('role_name', arg_3)
        _validate_not_none('lun', arg_4)
        return arg_0._perform_put(
            arg_0._get_data_disk_path(
                arg_1, arg_2, arg_3, arg_4),
            _XmlSerializer.data_virtual_hard_disk_to_xml(
                arg_5,
                arg_8,
                arg_9,
                arg_7,
                arg_10,
                arg_6,
                None),
            as_async=True)

Updates the specified data disk attached to the specified virtual machine .


return Endpoint(
        service_name=new_service_name,
        ipv4=endpoint.ipv4,
        ipv6=endpoint.ipv6,
        port=endpoint.port,
    )

def Func ( arg_0 , arg_1 ) : return Endpoint ( service_name = arg_1 , ipv4 = arg_0 . ipv4 , ipv6 = arg_0 . ipv6 , port = arg_0 . port , )

def Func(arg_0, arg_1):
    """Creates a copy of a given endpoint with a new service name.

    :param endpoint: existing Endpoint object
    :type endpoint: Endpoint
    :param new_service_name: new service name
    :type new_service_name: str
    :returns: zipkin new Endpoint object
    """
    return Endpoint(
        service_name=arg_1,
        ipv4=arg_0.ipv4,
        ipv6=arg_0.ipv6,
        port=arg_0.port,
    )

Creates a copy of a given endpoint with a new service name .


def Func ( arg_0 ) : if arg_0 . module_to_run : arg_1 = arg_2 . argv arg_2 . argv = [ arg_2 . executable ] + arg_0 . extra_args try : arg_0 . shell . safeFunc ( arg_0 . module_to_run , arg_0 . shell . user_ns ) finally : arg_2 . argv = arg_1

def Func(arg_0):
        """Run module specified at the command-line."""
        if arg_0.module_to_run:
            # Make sure that the module gets a proper sys.argv as if it were
            # run using `python -m`.
            arg_1 = arg_2.argv
            arg_2.argv = [arg_2.executable] + arg_0.extra_args
            try:
                arg_0.shell.safeFunc(arg_0.module_to_run,
                                           arg_0.shell.user_ns)
            finally:
                arg_2.argv = arg_1

Run module specified at the command - line .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
""
for
arg_3
,
arg_4
in
arg_0
.
items
(
)
:
arg_5
=
""
if
"container"
in
arg_4
:
arg_5
+=
arg_4
[
"container"
]
if
"version"
in
arg_4
:
arg_5
+=
":{}"
.
format
(
arg_4
[
"version"
]
)
else
:
arg_5
+=
":latest"
if
arg_5
:
arg_2
+=
'\n\t${}_{}.container = "{}"'
.
format
(
arg_3
,
arg_1
,
arg_5
)
return
arg_2

def Func(arg_0, arg_1):
        """ Returns the nextflow containers string from a dictionary object

        If the dictionary has at least on of the container directives, these
        will be compiled for each process in the dictionary and returned
        as a string read for injection in the nextflow config file template.

        This dictionary should be::

            dict = {"processA": {"container": "asd", "version": "1.0.0"},
                    "processB": {"container": "dsd"}}

        Parameters
        ----------
        cont_dict : dict
            Dictionary with the containers for processes.
        pid : int
            Unique identified of the process

        Returns
        -------
        str
            nextflow config string
        """

        arg_2 = ""

        for arg_3, arg_4 in arg_0.items():

            arg_5 = ""

            if "container" in arg_4:
                arg_5 += arg_4["container"]

                if "version" in arg_4:
                    arg_5 += ":{}".format(arg_4["version"])
                else:
                    arg_5 += ":latest"

            if arg_5:
                arg_2 += '\n\t${}_{}.container = "{}"'.format(arg_3, arg_1, arg_5)

        return arg_2


def Func ( arg_0 ) : arg_1 = arg_0 . find ( '-' ) arg_2 , arg_3 = ( None , None ) if arg_1 == - 1 : arg_2 , arg_3 = ( arg_0 , arg_0 ) else : arg_2 , arg_3 = arg_0 . split ( '-' ) arg_4 = ( expand_date_param ( arg_2 , 'lower' ) , expand_date_param ( arg_3 , 'upper' ) ) return arg_4

def Func(arg_0):
    """
    This function takes a date string in various formats
    and converts it to a normalized and validated date range. A list
    with two elements is returned, lower and upper date boundary.

    Valid inputs are, for example:
    2012              => Jan 1 20012 - Dec 31 2012 (whole year)
    201201            => Jan 1 2012  - Jan 31 2012 (whole month)
    2012101           => Jan 1 2012 - Jan 1 2012   (whole day)
    2011-2011         => same as "2011", which means whole year 2012
    2011-2012         => Jan 1 2011 - Dec 31 2012  (two years)
    201104-2012       => Apr 1 2011 - Dec 31 2012
    201104-201203     => Apr 1 2011 - March 31 2012
    20110408-2011     => Apr 8 2011 - Dec 31 2011
    20110408-201105   => Apr 8 2011 - May 31 2011
    20110408-20110507 => Apr 8 2011 - May 07 2011
    2011-             => Jan 1 2012 - Dec 31 9999 (unlimited)
    201104-           => Apr 1 2011 - Dec 31 9999 (unlimited)
    20110408-         => Apr 8 2011 - Dec 31 9999 (unlimited)
    -2011             Jan 1 0000 - Dez 31 2011
    -201104           Jan 1 0000 - Apr 30, 2011
    -20110408         Jan 1 0000 - Apr 8, 2011
    """
    arg_1 = arg_0.find('-')
    arg_2, arg_3 = (None, None)
    if arg_1 == -1:
        # no seperator given
        arg_2, arg_3 = (arg_0, arg_0)
    else:
        arg_2, arg_3 = arg_0.split('-')
    arg_4 = (expand_date_param(arg_2, 'lower'), expand_date_param(arg_3, 'upper'))
    return arg_4

This function takes a date string in various formats and converts it to a normalized and validated date range . A list with two elements is returned lower and upper date boundary .


def Func(arg_0,arg_1=True,arg_2='l',**arg_3):
    '''
    Plots the uncalibrated full stokes spectrum of the noise diode.
    Use diff=False to plot both ON and OFF, or diff=True for ON-OFF
    '''

    #If diff=True, get ON-OFF. If not get ON and OFF separately
    if arg_1==True:
        arg_4,arg_5,arg_6,arg_7,arg_8 = get_diff(arg_0,arg_2,**arg_3)
    else:
        arg_9 = Waterfall(arg_0,max_load=150)
        arg_8 = arg_9.populate_freqs()
        arg_10 = arg_9.header['tsamp']
        arg_11 = arg_9.data
        arg_12,arg_13,arg_14,arg_15 = get_stokes(arg_11,arg_2)

        arg_16,arg_17 = foldcal(arg_12,arg_10,**arg_3)
        arg_18,arg_19 = foldcal(arg_13,arg_10,**arg_3)
        arg_20,arg_21 = foldcal(arg_14,arg_10,**arg_3)
        arg_22,arg_23 = foldcal(arg_15,arg_10,**arg_3)

    #Plot spectra
    if arg_1==True:
        plt.plot(arg_8,arg_4,'k-',label='I')
        plt.plot(arg_8,arg_5,'r-',label='Q')
        plt.plot(arg_8,arg_6,'g-',label='U')
        plt.plot(arg_8,arg_7,'m-',label='V')
    else:
        plt.plot(arg_8,arg_17,'k-',label='I ON')
        plt.plot(arg_8,arg_16,'k--',label='I OFF')
        plt.plot(arg_8,arg_19,'r-',label='Q ON')
        plt.plot(arg_8,arg_18,'r--',label='Q OFF')
        plt.plot(arg_8,arg_21,'g-',label='U ON')
        plt.plot(arg_8,arg_20,'g--',label='U OFF')
        plt.plot(arg_8,arg_23,'m-',label='V ON')
        plt.plot(arg_8,arg_22,'m--',label='V OFF')

    plt.legend()
    plt.xlabel('Frequency (MHz)')
    plt.title('Uncalibrated Full Stokes Noise Diode Spectrum')
    plt.ylabel('Power (Counts)')

Plots the uncalibrated full stokes spectrum of the noise diode . Use diff = False to plot both ON and OFF or diff = True for ON - OFF


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 60 ) : arg_0 . _halt_if_already_deleted ( ) arg_2 = locals ( ) del arg_2 [ 'self' ] return arg_0 . _add_record ( MXResourceRecordSet , ** arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=60):
        """
        Creates a MX record attached to this hosted zone.

        :param str name: The fully qualified name of the record to add.
        :param list values: A list of value strings for the record.
        :keyword int ttl: The time-to-live of the record (in seconds).
        :rtype: tuple
        :returns: A tuple in the form of ``(rrset, change_info)``, where
            ``rrset`` is the newly created MXResourceRecordSet instance.
        """

        arg_0._halt_if_already_deleted()

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

        return arg_0._add_record(MXResourceRecordSet, **arg_2)

Creates a MX record attached to this hosted zone .


def Func ( arg_0 , arg_1 = True , ** arg_2 ) : return Markdown ( arg_1 = arg_1 , ** arg_2 ) ( arg_0 )

def Func(arg_0, arg_1=True, **arg_2):
    """Render Func formatted text to html.

    :param text: Func formatted text content.
    :param escape: if set to False, all html tags will not be escaped.
    :param use_xhtml: output with xhtml tags.
    :param hard_wrap: if set to True, it will use the GFM line breaks feature.
    :param parse_block_html: parse text only in block level html.
    :param parse_inline_html: parse text only in inline level html.
    """
    return Markdown(arg_1=arg_1, **arg_2)(arg_0)

Render markdown formatted text to html.

    :param text: markdown formatted text content.
    :param escape: if set to False, all html tags will not be escaped.
    :param use_xhtml: output with xhtml tags.
    :param hard_wrap: if set to True, it will use the GFM line breaks feature.
    :param parse_block_html: parse text only in block level html.
    :param parse_inline_html: parse text only in inline level html.

Render markdown formatted text to html .


def Func ( arg_0 , ** arg_1 ) : for arg_2 , arg_3 in arg_1 . items ( ) : setattr ( arg_0 , arg_2 , arg_3 )

def Func(arg_0, **arg_1):
        """Override settings values"""
        for arg_2, arg_3 in arg_1.items():
            setattr(arg_0, arg_2, arg_3)


def Func(arg_0, arg_1):
    """Get the list of qubits drawing this gate would cover"""

    arg_2 = len(arg_0)
    arg_3 = 0
    for arg_4 in arg_1.qargs:
        arg_5 = arg_0.index(arg_4)

        if arg_5 < arg_2:
            arg_2 = arg_5
        if arg_5 > arg_3:
            arg_3 = arg_5

    if arg_1.cargs:
        return arg_0[arg_2:]

    return arg_0[arg_2:arg_3 + 1]


def Func ( arg_0 , arg_1 ) : assert isinstance ( arg_1 , six . text_type ) arg_0 . content += arg_1

def Func(arg_0, arg_1):
        """
        Add content to this fragment.

        `content` is a Unicode string, HTML to append to the body of the
        fragment.  It must not contain a ``<body>`` tag, or otherwise assume
        that it is the only content on the page.
        """
        assert isinstance(arg_1, six.text_type)
        arg_0.content += arg_1


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . _ADD ( arg_1 , arg_2 , carry = True )

def Func(arg_0, arg_1, arg_2):
        """
        Adds with carry.

        Adds the destination operand (first operand), the source operand (second operand),
        and the carry (CF) flag and stores the result in the destination operand. The state
        of the CF flag represents a carry from a previous addition. When an immediate value
        is used as an operand, it is sign-extended to the length of the destination operand
        format. The Func instruction does not distinguish between signed or unsigned operands.
        Instead, the processor evaluates the result for both data types and sets the OF and CF
        flags to indicate a carry in the signed or unsigned result, respectively. The SF flag
        indicates the sign of the signed result. The Func instruction is usually executed as
        part of a multibyte or multiword addition in which an ADD instruction is followed by an
        Func instruction::

                DEST  =  DEST + SRC + CF;

        The OF, SF, ZF, AF, CF, and PF flags are set according to the result.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        arg_0._ADD(arg_1, arg_2, carry=True)

Adds with carry.

        Adds the destination operand (first operand), the source operand (second operand),
        and the carry (CF) flag and stores the result in the destination operand. The state
        of the CF flag represents a carry from a previous addition. When an immediate value
        is used as an operand, it is sign-extended to the length of the destination operand
        format. The ADC instruction does not distinguish between signed or unsigned operands.
        Instead, the processor evaluates the result for both data types and sets the OF and CF
        flags to indicate a carry in the signed or unsigned result, respectively. The SF flag
        indicates the sign of the signed result. The ADC instruction is usually executed as
        part of a multibyte or multiword addition in which an ADD instruction is followed by an
        ADC instruction::

                DEST  =  DEST + SRC + CF;

        The OF, SF, ZF, AF, CF, and PF flags are set according to the result.

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


def Func(arg_0):
        """Loop through all the instructions that are `_todo`."""
        while arg_0._todo:
            arg_1 = arg_0._todo.pop(0)
            arg_0._step(*arg_1)

Loop through all the instructions that are _todo .


r'''
    Estimates the linear inner product \int p q between two distributions,
    based on kNN distances.

return _get_linear(Ks, dim)(num_q, rhos, nus)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    r'''
    Estimates the Func inner product \int p q between two distributions,
    based on kNN distances.
    '''
    return _get_Func(arg_0, arg_1)(arg_2, arg_3, arg_4)

r Estimates the linear inner product \ int p q between two distributions based on kNN distances .


(CASRN, AvailableMethods=False, Method=None, IgnoreMethods=[])

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
arg_3
=
[
]
)
:
def
list_methods
(
)
:
arg_4
=
[
]
if
arg_0
in
Func_ON_data
.
index
:
arg_4
.
append
(
OPEN_NTBKM
)
if
arg_0
in
CRC_inorganic_data
.
index
and
not
np
.
isnan
(
CRC_inorganic_data
.
at
[
arg_0
,
'Func'
]
)
:
arg_4
.
append
(
CRC_INORG
)
if
arg_0
in
CRC_organic_data
.
index
and
not
np
.
isnan
(
CRC_organic_data
.
at
[
arg_0
,
'Func'
]
)
:
arg_4
.
append
(
CRC_ORG
)
if
arg_3
:
for
arg_2
in
arg_3
:
if
arg_2
in
arg_4
:
arg_4
.
remove
(
arg_2
)
arg_4
.
append
(
)
return
arg_4
if
arg_1
:
return
list_methods
(
)
if
not
arg_2
:
arg_2
=
list_methods
(
)
[
0
]
if
arg_2
==
OPEN_NTBKM
:
return
float
(
Func_ON_data
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
CRC_INORG
:
return
float
(
CRC_inorganic_data
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
CRC_ORG
:
return
float
(
CRC_organic_data
.
at
[
arg_0
,
'Func'
]
)
elif
arg_2
==
:
return
else
:
raise
Exception
(
'Failure in in function'
)

def Func(arg_0, arg_1=False, arg_2=None, arg_3=[]):
    r'''This function handles the retrieval of a chemical's melting
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'Open Notebook Melting Points', with backup sources
    'CRC Physical Constants, organic' for organic chemicals, and
    'CRC Physical Constants, inorganic' for inorganic chemicals. Function has
    data for approximately 14000 chemicals.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Func : float
        Melting temperature, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Func with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Func_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Func for the desired chemical, and will return methods instead of Func
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'OPEN_NTBKM, a compillation of data on organics
          as published in [1]_ as Open Notebook Melting Points; Averaged
          (median) values were used when
          multiple points were available. For more information on this
          invaluable and excellent collection, see
          http://onswebservices.wikispaces.com/meltingpoint.
        * 'CRC_ORG', a compillation of data on organics
          as published in [2]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [2]_.

    Examples
    --------
    >>> Func(CASRN='7732-18-5')
    273.15

    References
    ----------
    .. [1] Bradley, Jean-Claude, Antony Williams, and Andrew Lang.
       "Jean-Claude Bradley Open Melting Point Dataset", May 20, 2014.
       https://figshare.com/articles/Jean_Claude_Bradley_Open_Melting_Point_Datset/1031637.
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.
    '''
    def list_methods():
        arg_4 = []
        if arg_0 in Func_ON_data.index:
            arg_4.append(OPEN_NTBKM)
        if arg_0 in CRC_inorganic_data.index and not np.isnan(CRC_inorganic_data.at[arg_0, 'Func']):
            arg_4.append(CRC_INORG)
        if arg_0 in CRC_organic_data.index and not np.isnan(CRC_organic_data.at[arg_0, 'Func']):
            arg_4.append(CRC_ORG)
        if arg_3:
            for arg_2 in arg_3:
                if arg_2 in arg_4:
                    arg_4.remove(arg_2)
        arg_4.append(NONE)
        return arg_4
    if arg_1:
        return list_methods()
    if not arg_2:
        arg_2 = list_methods()[0]

    if arg_2 == OPEN_NTBKM:
        return float(Func_ON_data.at[arg_0, 'Func'])
    elif arg_2 == CRC_INORG:
        return float(CRC_inorganic_data.at[arg_0, 'Func'])
    elif arg_2 == CRC_ORG:
        return float(CRC_organic_data.at[arg_0, 'Func'])
    elif arg_2 == NONE:
        return None
    else:
        raise Exception('Failure in in function')

r'''This function handles the retrieval of a chemical's melting
    point. Lookup is based on CASRNs. Will automatically select a data
    source to use if no Method is provided; returns None if the data is not
    available.

    Prefered sources are 'Open Notebook Melting Points', with backup sources
    'CRC Physical Constants, organic' for organic chemicals, and
    'CRC Physical Constants, inorganic' for inorganic chemicals. Function has
    data for approximately 14000 chemicals.

    Parameters
    ----------
    CASRN : string
        CASRN [-]

    Returns
    -------
    Tm : float
        Melting temperature, [K]
    methods : list, only returned if AvailableMethods == True
        List of methods which can be used to obtain Tm with the given inputs

    Other Parameters
    ----------------
    Method : string, optional
        A string for the method name to use, as defined by constants in
        Tm_methods
    AvailableMethods : bool, optional
        If True, function will determine which methods can be used to obtain
        Tm for the desired chemical, and will return methods instead of Tm
    IgnoreMethods : list, optional
        A list of methods to ignore in obtaining the full list of methods

    Notes
    -----
    A total of three sources are available for this function. They are:

        * 'OPEN_NTBKM, a compillation of data on organics
          as published in [1]_ as Open Notebook Melting Points; Averaged
          (median) values were used when
          multiple points were available. For more information on this
          invaluable and excellent collection, see
          http://onswebservices.wikispaces.com/meltingpoint.
        * 'CRC_ORG', a compillation of data on organics
          as published in [2]_.
        * 'CRC_INORG', a compillation of data on
          inorganic as published in [2]_.

    Examples
    --------
    >>> Tm(CASRN='7732-18-5')
    273.15

    References
    ----------
    .. [1] Bradley, Jean-Claude, Antony Williams, and Andrew Lang.
       "Jean-Claude Bradley Open Melting Point Dataset", May 20, 2014.
       https://figshare.com/articles/Jean_Claude_Bradley_Open_Melting_Point_Datset/1031637.
    .. [2] Haynes, W.M., Thomas J. Bruno, and David R. Lide. CRC Handbook of
       Chemistry and Physics, 95E. Boca Raton, FL: CRC press, 2014.

r This function handles the retrieval of a chemical s melting point . Lookup is based on CASRNs . Will automatically select a data source to use if no Method is provided ; returns None if the data is not available .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . mapping [ arg_1 ] del arg_0 . mapping [ arg_1 ] del arg_0 . rev_mapping [ arg_2 ]

def Func(arg_0, arg_1):
        """Delete a notebook's id only. This doesn't delete the actual notebook."""
        arg_2 = arg_0.mapping[arg_1]
        del arg_0.mapping[arg_1]
        del arg_0.rev_mapping[arg_2]

Delete a notebook s id only . This doesn t delete the actual notebook .


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

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

Change semantic of MOVE to change resource tags .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = arg_0 . _keyword_scan ( arg_1 , arg_2 , feature_names = False ) for arg_4 in arg_3 : yield did ( arg_4 [ '_id' ] )

def Func(arg_0, arg_1=None, arg_2=None):
        '''Keyword scan for ids.

        This performs a keyword scan using the query given. A keyword
        scan searches for FCs with terms in each of the query's indexed
        fields.

        At least one of ``query_id`` or ``query_fc`` must be provided.
        If ``query_fc`` is ``None``, then the query is retrieved
        automatically corresponding to ``query_id``.

        :param str query_id: Optional query id.
        :param query_fc: Optional query feature collection.
        :type query_fc: :class:`dossier.fc.FeatureCollection`
        :rtype: Iterable of ``content_id``
        '''
        arg_3 = arg_0._keyword_scan(arg_1, arg_2, feature_names=False)
        for arg_4 in arg_3:
            yield did(arg_4['_id'])


def Func ( arg_0 ) : if len ( arg_0 . q ) > 0 : arg_0 . update ( ) if arg_0 . delay == 0 : arg_1 , arg_2 = arg_0 . textpath ( arg_0 . i ) arg_3 = arg_0 . fontsize arg_0 . _ctx . fill ( arg_0 . background ) arg_0 . _ctx . rect ( arg_0 . node . x + arg_3 * 1.0 , arg_0 . node . y + arg_3 * 0.5 , arg_0 . _w + arg_3 , arg_2 + arg_3 * 1.5 , roundness = 0.2 ) arg_4 = 1.0 if arg_0 . fi < 5 : arg_4 = 0.2 * arg_0 . fi if arg_0 . fn - arg_0 . fi < 5 : arg_4 = 0.2 * ( arg_0 . fn - arg_0 . fi ) arg_0 . _ctx . fill ( arg_0 . text . r , arg_0 . text . g , arg_0 . text . b , arg_0 . text . a * arg_4 ) arg_0 . _ctx . translate ( arg_0 . node . x + arg_3 * 2.0 , arg_0 . node . y + arg_3 * 2.5 ) arg_0 . _ctx . Funcpath ( arg_1 )

def Func(arg_0):

        """ Draws a popup rectangle with a rotating text queue.
        """

        if len(arg_0.q) > 0:
            arg_0.update()

            if arg_0.delay == 0:

                # Rounded rectangle in the given background color.
                arg_1, arg_2 = arg_0.textpath(arg_0.i)
                arg_3 = arg_0.fontsize
                arg_0._ctx.fill(arg_0.background)
                arg_0._ctx.rect(
                    arg_0.node.x + arg_3*1.0,
                    arg_0.node.y + arg_3*0.5,
                    arg_0._w + arg_3,
                    arg_2 + arg_3*1.5,
                    roundness=0.2
                )

                # Fade in/out the current text.
                arg_4 = 1.0
                if arg_0.fi < 5:
                    arg_4 = 0.2 * arg_0.fi
                if arg_0.fn-arg_0.fi < 5:
                    arg_4 = 0.2 * (arg_0.fn-arg_0.fi)
                arg_0._ctx.fill(
                    arg_0.text.r,
                    arg_0.text.g,
                    arg_0.text.b,
                    arg_0.text.a * arg_4
                )

                arg_0._ctx.translate(arg_0.node.x + arg_3*2.0, arg_0.node.y + arg_3*2.5)
                arg_0._ctx.Funcpath(arg_1)

Draws a popup rectangle with a rotating text queue .


def Func ( arg_0 , arg_1 ) : while True : try : return arg_1 . get ( block = True , timeout = TICK ) except multiprocessing . queues . Empty : if not arg_0 . is_alive ( ) : try : return arg_1 . get ( block = False ) except multiprocessing . queues . Empty : return PROCESS_DEAD_AND_QUEUE_EMPTY check . failed ( 'unreachable' )

def Func(arg_0, arg_1):
    '''
    This function polls the process until it returns a valid
    item or returns PROCESS_DEAD_AND_QUEUE_EMPTY if it is in
    a state where the process has terminated and the queue is empty

    Warning: if the child process is in an infinite loop. This will
    also infinitely loop.
    '''
    while True:
        try:
            return arg_1.get(block=True, timeout=TICK)
        except multiprocessing.queues.Empty:
            if not arg_0.is_alive():
                # There is a possibility that after the last queue.get the
                # process created another event and then died. In that case
                # we want to continue draining the queue.
                try:
                    return arg_1.get(block=False)
                except multiprocessing.queues.Empty:
                    # If the queue empty we know that there are no more events
                    # and that the process has died.
                    return PROCESS_DEAD_AND_QUEUE_EMPTY

    check.failed('unreachable')


(self, container_name, blob_name, **kwargs)

return self.connection.exists(container_name, blob_name, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 , ** arg_3 ) : return arg_0 . connection . exists ( arg_1 , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Check if a blob exists on Azure Blob Storage.

        :param container_name: Name of the container.
        :type container_name: str
        :param blob_name: Name of the blob.
        :type blob_name: str
        :param kwargs: Optional keyword arguments that
            `BlockBlobService.exists()` takes.
        :type kwargs: object
        :return: True if the blob exists, False otherwise.
        :rtype: bool
        """
        return arg_0.connection.exists(arg_1, arg_2, **arg_3)

Check if a blob exists on Azure Blob Storage .


def Func ( arg_0 ) : arg_1 = arg_0 . env . getScreenRGB ( ) return dict ( shape = arg_1 . shape , type = 'int' )

def Func(arg_0):
        """
        Return the state space. Might include subdicts if multiple Func are
        available simultaneously.

        Returns: dict of state properties (shape and type).

        """
        arg_1 = arg_0.env.getScreenRGB()
        return dict(shape=arg_1.shape, type='int')

Return the state space. Might include subdicts if multiple states are
        available simultaneously.

        Returns: dict of state properties (shape and type).

Return the state space . Might include subdicts if multiple states are available simultaneously .


return session.query(DagRun).filter(
            DagRun.dag_id == self.dag_id,
            DagRun.execution_date < self.execution_date
        ).order_by(
            DagRun.execution_date.desc()
        ).first()

def Func ( arg_0 , arg_1 = None ) : return arg_1 . query ( DagRun ) . filter ( DagRun . dag_id == arg_0 . dag_id , DagRun . execution_date < arg_0 . execution_date ) . order_by ( DagRun . execution_date . desc ( ) ) . first ( )

def Func(arg_0, arg_1=None):
        """The previous DagRun, if there is one"""

        return arg_1.query(DagRun).filter(
            DagRun.dag_id == arg_0.dag_id,
            DagRun.execution_date < arg_0.execution_date
        ).order_by(
            DagRun.execution_date.desc()
        ).first()


def Func ( arg_0 , arg_1 , arg_2 = True , arg_3 = False ) : if arg_0 . is_fully_within_image ( arg_1 ) : return False elif arg_0 . is_partly_within_image ( arg_1 ) : return arg_3 else : return arg_2

def Func(arg_0, arg_1, arg_2=True, arg_3=False):
        """
        Estimate whether the bounding box is partially or fully outside of the image area.

        Parameters
        ----------
        image : (H,W,...) ndarray or tuple of int
            Image dimensions to use. If an ndarray, its shape will be used. If a tuple, it is
            assumed to represent the image shape and must contain at least two integers.

        fully : bool, optional
            Whether to return True if the bounding box is fully outside fo the image area.

        partly : bool, optional
            Whether to return True if the bounding box is at least partially outside fo the
            image area.

        Returns
        -------
        bool
            True if the bounding box is partially/fully outside of the image area, depending
            on defined parameters. False otherwise.

        """
        if arg_0.is_fully_within_image(arg_1):
            return False
        elif arg_0.is_partly_within_image(arg_1):
            return arg_3
        else:
            return arg_2

Estimate whether the bounding box is partially or fully outside of the image area .


def Func(arg_0):
        ''' Method to request API tokens from ecobee '''
        arg_1 = 'https://api.ecobee.com/token'
        arg_2 = {'grant_type': 'ecobeePin', 'code': arg_0.authorization_code,
                  'client_id': arg_0.api_key}
        try:
            arg_3 = requests.post(arg_1, arg_2=arg_2)
        except RequestException:
            logger.warn("Error connecting to Ecobee.  Possible connectivity outage."
                        "Could not request token.")
            return
        if arg_3.status_code == requests.codes.ok:
            arg_0.access_token = arg_3.json()['access_token']
            arg_0.refresh_token = arg_3.json()['refresh_token']
            arg_0.write_tokens_to_file()
            arg_0.pin = None
        else:
            logger.warn('Error while requesting tokens from ecobee.com.'
                  ' Status code: ' + str(arg_3.status_code))
            return


(self, refresh_token, scopes, request, *args, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3, *arg_4, **arg_5):
        """Ensures the requested scope matches the scope originally granted
        by the resource owner. If the scope is omitted it is treated as equal
        to the scope originally granted by the resource owner.

        DEPRECATION NOTE: This method will cease to be used in oauthlib>0.4.2,
        future versions of ``oauthlib`` use the validator method
        ``get_original_scopes`` to determine the scope of the refreshed token.
        """
        if not arg_2:
            log.debug('Scope omitted for refresh token %r', arg_1)
            return True
        log.debug('Confirm scopes %r for refresh token %r',
                  arg_2, arg_1)
        arg_6 = arg_0._tokengetter(arg_1=arg_1)
        return set(arg_6.scopes) == set(arg_2)

Ensures the requested scope matches the scope originally granted by the resource owner . If the scope is omitted it is treated as equal to the scope originally granted by the resource owner .


return (self.environment.mimetypes.get(self.format_extension) or
                self.compiler_mimetype or 'application/octet-stream')

def Func ( arg_0 ) : return ( arg_0 . environment . Funcs . get ( arg_0 . format_extension ) or arg_0 . compiler_Func or 'application/octet-stream' )

def Func(arg_0):
        """MIME type of the asset."""
        return (arg_0.environment.Funcs.get(arg_0.format_extension) or
                arg_0.compiler_Func or 'application/octet-stream')


def Func ( arg_0 ) : arg_1 = arg_0 . data ( ) . bytes ( ) arg_2 = '{:0>8}-0000-1000-8000-00805f9b34fb' if len ( arg_1 ) <= 4 else '{:0>32}' arg_3 = arg_2 . format ( hexlify ( arg_1 . tobytes ( ) [ : 16 ] ) . decode ( 'ascii' ) ) return uuid . UUID ( hex = arg_3 )

def Func(arg_0):
    """Convert Objective-C CBUUID type to native Python UUID type."""
    arg_1 = arg_0.data().bytes()

    arg_2 = '{:0>8}-0000-1000-8000-00805f9b34fb' if len(arg_1) <= 4 else '{:0>32}'
    arg_3 = arg_2.format(hexlify(arg_1.tobytes()[:16]).decode('ascii'))
    return uuid.UUID(hex=arg_3)

Convert Objective - C CBUUID type to native Python UUID type .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
if
list
(
map
(
int
,
re
.
findall
(
'\d+'
,
nbconvert
.
__version__
)
)
)
>=
[
4
,
2
]
:
arg_3
=
os
.
path
.
basename
(
arg_0
.
py_file
)
else
:
arg_3
=
arg_0
.
py_file
try
:
arg_4
=
logger
.
logger
.
level
except
AttributeError
:
arg_4
=
logger
.
level
spr
.
call
(
[
'jupyter'
,
'nbconvert'
,
'--to=python'
,
'--output='
+
arg_3
,
'--log-level=%s'
%
arg_4
,
arg_0
.
outfile
]
)
with
open
(
arg_0
.
py_file
)
as
f
:
arg_5
=
f
.
read
(
)
arg_5
=
re
.
sub
(
'^\s*get_ipython\(\).magic.*'
,
'# \g<0>'
,
arg_5
,
flags
=
re
.
MULTILINE
)
with
open
(
arg_0
.
py_file
,
'w'
)
as
f
:
f
.
write
(
arg_5
)

def Func(arg_0, arg_1, arg_2=False):
        """Create the python script from the notebook node"""
        # Although we would love to simply use ``nbconvert.export_python(nb)``
        # this causes troubles in other cells processed by the ipython
        # directive. Instead of getting something like ``Out [5]:``, we get
        # some weird like '[0;31mOut[5]: ' which look like
        # color information if we allow the call of nbconvert.export_python
        if list(map(int, re.findall('\d+', nbconvert.__version__))) >= [4, 2]:
            arg_3 = os.path.basename(arg_0.py_file)
        else:
            arg_3 = arg_0.py_file
        try:
            arg_4 = logger.logger.level
        except AttributeError:
            arg_4 = logger.level
        spr.call(['jupyter', 'nbconvert', '--to=python',
                  '--output=' + arg_3, '--log-level=%s' % arg_4,
                  arg_0.outfile])
        with open(arg_0.py_file) as f:
            arg_5 = f.read()
        # comment out ipython magics
        arg_5 = re.sub('^\s*get_ipython\(\).magic.*', '# \g<0>',
                            arg_5, flags=re.MULTILINE)
        with open(arg_0.py_file, 'w') as f:
            f.write(arg_5)


def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . getPrimaryKeys ( ) if arg_2 : return arg_0 . getMultiple ( arg_2 , arg_1 = arg_1 ) return IRQueryableList ( [ ] , mdl = arg_0 . mdl )

def Func(arg_0, arg_1=False):
		'''
			Func - Get the underlying objects which match the filter criteria.

			Example:   objs = Model.objects.filter(field1='value', field2='value2').Func()

			@param cascadeFetch <bool> Default False, If True, Func Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@return - Objects of the Model instance associated with this query.
		'''
		arg_2 = arg_0.getPrimaryKeys()
		if arg_2:
			return arg_0.getMultiple(arg_2, arg_1=arg_1)

		return IRQueryableList([], mdl=arg_0.mdl)

all - Get the underlying objects which match the filter criteria.

			Example:   objs = Model.objects.filter(field1='value', field2='value2').all()

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@return - Objects of the Model instance associated with this query.

all - Get the underlying objects which match the filter criteria .


return len(self.lcsstr(src, tar)) / max(len(src), len(tar))

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_2 : return 1.0 elif not arg_1 or not arg_2 : return 0.0 return len ( arg_0 . lcsstr ( arg_1 , arg_2 ) ) / max ( len ( arg_1 ) , len ( arg_2 ) )

def Func(arg_0, arg_1, arg_2):
        r"""Return the longest common substring Funcilarity of two strings.

        Longest common substring Funcilarity (:math:`Func_{LCSstr}`).

        This employs the LCS function to derive a Funcilarity metric:
        :math:`Func_{LCSstr}(s,t) = \frac{|LCSstr(s,t)|}{max(|s|, |t|)}`

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            LCSstr Funcilarity

        Examples
        --------
        >>> Func_lcsstr('cat', 'hat')
        0.6666666666666666
        >>> Func_lcsstr('Niall', 'Neil')
        0.2
        >>> Func_lcsstr('aluminum', 'Catalan')
        0.25
        >>> Func_lcsstr('ATCG', 'TAGC')
        0.25

        """
        if arg_1 == arg_2:
            return 1.0
        elif not arg_1 or not arg_2:
            return 0.0
        return len(arg_0.lcsstr(arg_1, arg_2)) / max(len(arg_1), len(arg_2))

r"""Return the longest common substring similarity of two strings.

        Longest common substring similarity (:math:`sim_{LCSstr}`).

        This employs the LCS function to derive a similarity metric:
        :math:`sim_{LCSstr}(s,t) = \frac{|LCSstr(s,t)|}{max(|s|, |t|)}`

        Parameters
        ----------
        src : str
            Source string for comparison
        tar : str
            Target string for comparison

        Returns
        -------
        float
            LCSstr similarity

        Examples
        --------
        >>> sim_lcsstr('cat', 'hat')
        0.6666666666666666
        >>> sim_lcsstr('Niall', 'Neil')
        0.2
        >>> sim_lcsstr('aluminum', 'Catalan')
        0.25
        >>> sim_lcsstr('ATCG', 'TAGC')
        0.25

r Return the longest common substring similarity of two strings .


def
Func
(
)
:
import
argparse
import
sys
arg_0
=
argparse
.
ArgumentParser
(
)
arg_0
.
add_argument
(
'path'
)
arg_1
=
arg_0
.
parse_args
(
)
arg_2
=
open
(
arg_1
.
path
)
.
read
(
)
arg_2
=
arg_2
.
decode
(
'utf8'
)
arg_3
=
0
for
arg_4
in
non_tag_chars_from_raw
(
arg_2
)
:
for
arg_5
in
arg_4
:
if
arg_5
!=
' '
and
arg_5
!=
arg_2
[
arg_3
]
:
import
pdb
pdb
.
set_trace
(
)
sys
.
stdout
.
write
(
arg_5
.
encode
(
'utf8'
)
)
sys
.
stdout
.
flush
(
)
arg_3
+=
1

def Func():
    '''manual test loop for make_clean_visible_from_raw
    '''
    import argparse
    import sys
    arg_0 = argparse.ArgumentParser()
    arg_0.add_argument('path')
    arg_1 = arg_0.parse_args()

    arg_2 = open(arg_1.path).read()
    arg_2 = arg_2.decode('utf8')

    arg_3 = 0
    for arg_4 in non_tag_chars_from_raw(arg_2):
        for arg_5 in arg_4:
            if arg_5 != ' ' and arg_5 != arg_2[arg_3]:
                import pdb; pdb.set_trace()
            sys.stdout.write(arg_5.encode('utf8'))
            sys.stdout.flush()
            arg_3 += 1


def Func ( arg_0 , arg_1 = False ) : arg_2 = arg_0 . file_to_delete ( ) if arg_1 : arg_2 . extend ( arg_0 . databases_to_delete ( ) ) for arg_3 in arg_2 : File ( arg_3 ) . delete ( ) if arg_1 : Load ( PyFunceble . CURRENT_DIRECTORY )

def Func(arg_0, arg_1=False):
        """
        Delete almost all discovered files.

        :param clean_all:
            Tell the subsystem if we have to clean everything instesd
            of almost everything.
        :type clean_all: bool
        """

        # We get the list of file to delete.
        arg_2 = arg_0.file_to_delete()

        if arg_1:  # pragma: no cover
            arg_2.extend(arg_0.databases_to_delete())

        for arg_3 in arg_2:
            # We loop through the list of file to delete.

            # And we delete the currently read file.
            File(arg_3).delete()

        if arg_1:  # pragma: no cover
            Load(PyFunceble.CURRENT_DIRECTORY)


def Func(arg_0, arg_1, arg_2):
        """
        Prepares and Funcs the pipeline. Note this method must be invoked both from inside a
        Docker container and while the docker daemon is reachable.

        :param str name: The name of the command to start the workflow.
        :param str desc: The description of the workflow.
        """
        arg_3 = arg_0(arg_1, arg_2)
        arg_4 = arg_3._get_mount_path()
        # prepare parser
        arg_5 = arg_3._create_argument_parser()
        arg_3._extend_argument_parser(arg_5)
        # prepare config file
        arg_6 = arg_3.__get_empty_config()
        arg_7 = ruamel.yaml.load(arg_6)
        arg_3.__populate_parser_from_config(arg_5, arg_7)
        arg_8 = arg_5.parse_args()
        for arg_9,arg_10 in vars(arg_8).items():
            arg_9 = arg_9.replace('_', '-')
            if arg_9 in arg_7:
                arg_7[arg_9] = arg_10
        arg_11 = arg_3._get_config_path()
        with open(arg_11, 'w') as writable:
            ruamel.yaml.dump(arg_7, stream=writable)
        # prepare workdir
        arg_12 = os.path.join(arg_4, 'Toil-' + arg_3._name)
        if os.path.exists(arg_12):
            if arg_8.restart:
                 log.info('Reusing temporary directory: %s', arg_12)
            else:
                raise UserError('Temporary directory {} already exists. Run with --restart '
                                'option or remove directory.'.format(arg_12))
        else:
            os.makedirs(arg_12)
            log.info('Temporary directory created: %s', arg_12)

        arg_13 = arg_3._create_pipeline_command(arg_8, arg_12, arg_11)
        arg_3._extend_pipeline_command(arg_13, arg_8)
        # Func command
        try:
            subprocess.check_call(arg_13)
        except subprocess.CalledProcessError as e:
            print(e, file=sys.stderr)
        finally:
            arg_14 = os.stat(arg_4)
            log.info('Pipeline terminated, changing ownership of output files in %s from root to '
                     'uid %s and gid %s.', arg_4, arg_14.st_uid, arg_14.st_gid)
            arg_15 = ['chown', '-R', '%s:%s' % (arg_14.st_uid, arg_14.st_gid), arg_4]
            subprocess.check_call(arg_15)
            if arg_8.no_clean:
                log.info('Flag "--no-clean" was used, therefore %s was not deleted.', arg_12)
            else:
                log.info('Cleaning up temporary directory: %s', arg_12)
                shutil.rmtree(arg_12)

Prepares and runs the pipeline. Note this method must be invoked both from inside a
        Docker container and while the docker daemon is reachable.

        :param str name: The name of the command to start the workflow.
        :param str desc: The description of the workflow.

Prepares and runs the pipeline . Note this method must be invoked both from inside a Docker container and while the docker daemon is reachable .


def Func ( arg_0 , arg_1 , arg_2 ) : if isinstance ( arg_1 , nodes . With ) : return if isinstance ( arg_1 , nodes . TryExcept ) and isinstance ( arg_1 . parent , nodes . TryFinally ) : return if ( isinstance ( arg_1 . parent , nodes . If ) and not arg_1 . parent . orelse and arg_0 . config . single_line_if_stmt ) : return if ( isinstance ( arg_1 . parent , nodes . ClassDef ) and len ( arg_1 . parent . body ) == 1 and arg_0 . config . single_line_class_stmt ) : return arg_0 . add_message ( "multiple-statements" , arg_1 = arg_1 ) arg_0 . _visited_lines [ arg_2 ] = 2

def Func(arg_0, arg_1, arg_2):
        """Check for lines containing multiple statements."""
        # Do not warn about multiple nested context managers
        # in with statements.
        if isinstance(arg_1, nodes.With):
            return
        # For try... except... finally..., the two nodes
        # appear to be on the same line due to how the AST is built.
        if isinstance(arg_1, nodes.TryExcept) and isinstance(
            arg_1.parent, nodes.TryFinally
        ):
            return
        if (
            isinstance(arg_1.parent, nodes.If)
            and not arg_1.parent.orelse
            and arg_0.config.single_line_if_stmt
        ):
            return
        if (
            isinstance(arg_1.parent, nodes.ClassDef)
            and len(arg_1.parent.body) == 1
            and arg_0.config.single_line_class_stmt
        ):
            return
        arg_0.add_message("multiple-statements", arg_1=arg_1)
        arg_0._visited_lines[arg_2] = 2

Check for lines containing multiple statements .


def Func(arg_0):
    """Render HTML entry point for manager app."""
    arg_1 = {
        'api_url': settings.API_URL,
        'app_js_bundle': 'manager-%s.js' % dispatch.__version__,
        'app_css_bundle': 'manager-%s.css' % dispatch.__version__
    }

    return render_to_response('manager/index.html', arg_1)

Render HTML entry point for manager app .


def Func ( arg_0 ) : arg_1 = { } if arg_0 is None : return { } arg_2 = False if sys . version_info < ( 2 , 7 ) and '\x00' in shlex . split ( u'a' ) [ 0 ] : arg_2 = True arg_3 = False if arg_2 or not isinstance ( arg_0 , str ) : if isinstance ( arg_0 , six . text_type ) : arg_0 = arg_0 . encode ( 'UTF-8' ) arg_3 = True else : arg_0 = str ( arg_0 ) for arg_4 in shlex . split ( arg_0 ) : if ( arg_3 ) : arg_4 = arg_4 . decode ( 'UTF-8' ) if arg_2 : arg_4 = six . text_type ( arg_4 ) if '=' in arg_4 : ( arg_5 , arg_6 ) = arg_4 . split ( '=' , 1 ) if len ( arg_5 ) == 0 or len ( arg_6 ) == 0 : raise Exception try : arg_1 [ arg_5 ] = ast . literal_eval ( arg_6 ) except Exception : arg_1 [ arg_5 ] = arg_6 else : raise Exception return arg_1

def Func(arg_0):
    """Similar to the Ansible function of the same name, parses file
    with a key=value pattern and stores information in a dictionary,
    but not as fully featured as the corresponding Ansible code."""
    arg_1 = {}

    # Output updates dictionaries, so return empty one if no vals in
    if arg_0 is None:
        return {}

    # Python 2.6 / shlex has problems handling unicode, this is a fix
    arg_2 = False
    if sys.version_info < (2, 7) and '\x00' in shlex.split(u'a')[0]:
        arg_2 = True

    # Also hedge against Click library giving non-string type
    arg_3 = False
    if arg_2 or not isinstance(arg_0, str):
        if isinstance(arg_0, six.text_type):
            arg_0 = arg_0.encode('UTF-8')
            arg_3 = True
        else:
            arg_0 = str(arg_0)

    # Use shlex library to split string by quotes, whitespace, etc.
    for arg_4 in shlex.split(arg_0):

        # Second part of fix to avoid passing shlex unicode in py2.6
        if (arg_3):
            arg_4 = arg_4.decode('UTF-8')
        if arg_2:
            arg_4 = six.text_type(arg_4)
        # Look for key=value pattern, if not, process as raw parameter
        if '=' in arg_4:
            (arg_5, arg_6) = arg_4.split('=', 1)
            # If '=' are unbalanced, then stop and warn user
            if len(arg_5) == 0 or len(arg_6) == 0:
                raise Exception
            # If possible, convert into python data type, for instance "5"->5
            try:
                arg_1[arg_5] = ast.literal_eval(arg_6)
            except Exception:
                arg_1[arg_5] = arg_6
        else:
            # scenario where --extra-vars=42, will throw error
            raise Exception

    return arg_1

Similar to the Ansible function of the same name parses file with a key = value pattern and stores information in a dictionary but not as fully featured as the corresponding Ansible code .


(self,
             key_name=None,
             max_suggestions=100,
             cutoff=0.5,
             locked_only=False,
             key_type=None)

def Func ( arg_0 , arg_1 = None , arg_2 = 100 , arg_3 = 0.5 , arg_4 = False , arg_5 = None ) : arg_0 . _assert_valid_stash ( ) arg_6 = [ k for k in arg_0 . _storage . Func ( ) if k [ 'name' ] != 'stored_passphrase' and ( k . get ( 'lock' ) if arg_4 else True ) ] if arg_5 : arg_7 = ( 'secret' , None ) if arg_5 == 'secret' else [ arg_5 ] arg_6 = [ k for k in arg_6 if k . get ( 'type' ) in arg_7 ] arg_6 = [ k [ 'name' ] for k in arg_6 ] if arg_1 : if arg_1 . startswith ( '~' ) : arg_6 = difflib . get_close_matches ( arg_1 . lstrip ( '~' ) , arg_6 , arg_2 , arg_3 ) else : arg_6 = [ k for k in arg_6 if arg_1 in k ] audit ( storage = arg_0 . _storage . db_path , action = 'LIST' + ( '[LOCKED]' if arg_4 else '' ) , message = json . dumps ( dict ( ) ) ) return arg_6

def Func(arg_0,
             arg_1=None,
             arg_2=100,
             arg_3=0.5,
             arg_4=False,
             arg_5=None):
        """Return a Func of all keys.
        """
        arg_0._assert_valid_stash()

        arg_6 = [k for k in arg_0._storage.Func()
                    if k['name'] != 'stored_passphrase' and
                    (k.get('lock') if arg_4 else True)]

        if arg_5:
            # To maintain backward compatibility with keys without a type.
            # The default key type is secret, in which case we also look for
            # keys with no (None) types.
            arg_7 = ('secret', None) if arg_5 == 'secret' else [arg_5]
            arg_6 = [k for k in arg_6 if k.get('type') in arg_7]

        arg_6 = [k['name'] for k in arg_6]
        if arg_1:
            if arg_1.startswith('~'):
                arg_6 = difflib.get_close_matches(
                    arg_1.lstrip('~'), arg_6, arg_2, arg_3)
            else:
                arg_6 = [k for k in arg_6 if arg_1 in k]

        audit(
            storage=arg_0._storage.db_path,
            action='LIST' + ('[LOCKED]' if arg_4 else ''),
            message=json.dumps(dict()))

        return arg_6