(shape, path, name='mnist', url='http://yann.lecun.com/exdb/mnist/')

return X_train, y_train, X_val, y_val, X_test, y_test

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'mnist'
,
arg_3
=
'http://yann.lecun.com/exdb/mnist/'
)
:
arg_1
=
os
.
path
.
join
(
arg_1
,
arg_2
)
def
load_mnist_images
(
arg_1
,
arg_4
)
:
arg_5
=
maybe_download_and_extract
(
arg_4
,
arg_1
,
arg_3
)
logging
.
info
(
arg_5
)
with
gzip
.
open
(
arg_5
,
'rb'
)
as
f
:
arg_6
=
np
.
frombuffer
(
f
.
read
(
)
,
np
.
uint8
,
offset
=
16
)
arg_6
=
arg_6
.
reshape
(
arg_0
)
return
arg_6
/
np
.
float32
(
256
)
def
load_mnist_labels
(
arg_1
,
arg_4
)
:
arg_5
=
maybe_download_and_extract
(
arg_4
,
arg_1
,
arg_3
)
with
gzip
.
open
(
arg_5
,
'rb'
)
as
f
:
arg_6
=
np
.
frombuffer
(
f
.
read
(
)
,
np
.
uint8
,
offset
=
8
)
return
arg_6
logging
.
info
(
"Load or Download {0} > {1}"
.
format
(
arg_2
.
upper
(
)
,
arg_1
)
)
arg_7
=
load_mnist_images
(
arg_1
,
'train-images-idx3-ubyte.gz'
)
arg_8
=
load_mnist_labels
(
arg_1
,
'train-labels-idx1-ubyte.gz'
)
arg_9
=
load_mnist_images
(
arg_1
,
't10k-images-idx3-ubyte.gz'
)
arg_10
=
load_mnist_labels
(
arg_1
,
't10k-labels-idx1-ubyte.gz'
)
arg_7
,
arg_11
=
arg_7
[
:
10000
]
,
arg_7
[
10000
:
]
arg_8
,
arg_12
=
arg_8
[
:
10000
]
,
arg_8
[
10000
:
]
arg_7
=
np
.
asarray
(
arg_7
,
dtype
=
np
.
float32
)
arg_8
=
np
.
asarray
(
arg_8
,
dtype
=
np
.
int32
)
arg_11
=
np
.
asarray
(
arg_11
,
dtype
=
np
.
float32
)
arg_12
=
np
.
asarray
(
arg_12
,
dtype
=
np
.
int32
)
arg_9
=
np
.
asarray
(
arg_9
,
dtype
=
np
.
float32
)
arg_10
=
np
.
asarray
(
arg_10
,
dtype
=
np
.
int32
)
return
arg_7
,
arg_8
,
arg_11
,
arg_12
,
arg_9
,
arg_10

def Func(arg_0, arg_1, arg_2='mnist', arg_3='http://yann.lecun.com/exdb/mnist/'):
    """A generic function to load mnist-like dataset.

    Parameters:
    ----------
    shape : tuple
        The shape of digit images.
    path : str
        The path that the data is downloaded to.
    name : str
        The dataset name you want to use(the default is 'mnist').
    url : str
        The url of dataset(the default is 'http://yann.lecun.com/exdb/mnist/').
    """
    arg_1 = os.path.join(arg_1, arg_2)

    # Define functions for loading mnist-like data's images and labels.
    # For convenience, they also download the requested files if needed.
    def load_mnist_images(arg_1, arg_4):
        arg_5 = maybe_download_and_extract(arg_4, arg_1, arg_3)

        logging.info(arg_5)
        # Read the inputs in Yann LeCun's binary format.
        with gzip.open(arg_5, 'rb') as f:
            arg_6 = np.frombuffer(f.read(), np.uint8, offset=16)
        # The inputs are vectors now, we reshape them to monochrome 2D images,
        # following the shape convention: (examples, channels, rows, columns)
        arg_6 = arg_6.reshape(arg_0)
        # The inputs come as bytes, we convert them to float32 in range [0,1].
        # (Actually to range [0, 255/256], for compatibility to the version
        # provided at http://deeplearning.net/data/mnist/mnist.pkl.gz.)
        return arg_6 / np.float32(256)

    def load_mnist_labels(arg_1, arg_4):
        arg_5 = maybe_download_and_extract(arg_4, arg_1, arg_3)
        # Read the labels in Yann LeCun's binary format.
        with gzip.open(arg_5, 'rb') as f:
            arg_6 = np.frombuffer(f.read(), np.uint8, offset=8)
        # The labels are vectors of integers now, that's exactly what we want.
        return arg_6

    # Download and read the training and test set images and labels.
    logging.info("Load or Download {0} > {1}".format(arg_2.upper(), arg_1))
    arg_7 = load_mnist_images(arg_1, 'train-images-idx3-ubyte.gz')
    arg_8 = load_mnist_labels(arg_1, 'train-labels-idx1-ubyte.gz')
    arg_9 = load_mnist_images(arg_1, 't10k-images-idx3-ubyte.gz')
    arg_10 = load_mnist_labels(arg_1, 't10k-labels-idx1-ubyte.gz')

    # We reserve the last 10000 training examples for validation.
    arg_7, arg_11 = arg_7[:-10000], arg_7[-10000:]
    arg_8, arg_12 = arg_8[:-10000], arg_8[-10000:]

    # We just return all the arrays in order, as expected in main().
    # (It doesn't matter how we do this as long as we can read them again.)
    arg_7 = np.asarray(arg_7, dtype=np.float32)
    arg_8 = np.asarray(arg_8, dtype=np.int32)
    arg_11 = np.asarray(arg_11, dtype=np.float32)
    arg_12 = np.asarray(arg_12, dtype=np.int32)
    arg_9 = np.asarray(arg_9, dtype=np.float32)
    arg_10 = np.asarray(arg_10, dtype=np.int32)
    return arg_7, arg_8, arg_11, arg_12, arg_9, arg_10

A generic function to load mnist - like dataset .


def Func(arg_0, arg_1, arg_2):
        """
        Returns statistics for the given account_id and term_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.department_statistics
        """
        arg_3 = ("/api/v1/accounts/sis_account_id:%s/analytics/"
               "terms/sis_term_id:%s/statistics.json") % (arg_1, arg_2)
        return arg_0._get_resource(arg_3)

Returns statistics for the given account_id and term_id .


def
Func
(
arg_0
=
False
)
:
if
arg_0
:
with
Spinner
.
context
(
msg
=
"Updated course metadata."
,
waitmsg
=
"Updating course metadata."
)
:
for
arg_0
in
api
.
get_courses
(
)
:
arg_1
=
try
:
arg_1
=
Course
.
get
(
Course
.
tid
==
arg_0
[
"id"
]
)
except
peewee
.
DoesNotExist
:
arg_1
=
if
arg_1
:
arg_1
.
details_url
=
arg_0
[
"details_url"
]
arg_1
.
save
(
)
continue
Course
.
create
(
tid
=
arg_0
[
"id"
]
,
arg_5
=
arg_0
[
"name"
]
,
arg_2
=
arg_0
[
"details_url"
]
)
else
:
arg_3
=
Course
.
get_selected
(
)
print
(
"Updating exercise data."
)
for
arg_4
in
api
.
get_exercises
(
arg_3
)
:
arg_1
=
try
:
arg_1
=
Exercise
.
byid
(
arg_4
[
"id"
]
)
except
peewee
.
DoesNotExist
:
arg_1
=
if
arg_1
is
not
:
arg_1
.
name
=
arg_4
[
"name"
]
arg_1
.
course
=
arg_3
.
id
arg_1
.
is_attempted
=
arg_4
[
"attempted"
]
arg_1
.
is_completed
=
arg_4
[
"completed"
]
arg_1
.
deadline
=
arg_4
.
get
(
"deadline"
)
arg_1
.
is_downloaded
=
os
.
path
.
isdir
(
arg_1
.
path
(
)
)
arg_1
.
return_url
=
arg_4
[
"return_url"
]
arg_1
.
zip_url
=
arg_4
[
"zip_url"
]
arg_1
.
submissions_url
=
arg_4
[
"exercise_submissions_url"
]
arg_1
.
save
(
)
download_exercise
(
arg_1
,
Func
=
True
)
else
:
arg_13
=
Exercise
.
create
(
tid
=
arg_4
[
"id"
]
,
arg_5
=
arg_4
[
"name"
]
,
arg_0
=
arg_3
.
id
,
arg_6
=
arg_4
[
"attempted"
]
,
arg_7
=
arg_4
[
"completed"
]
,
arg_8
=
arg_4
.
get
(
"deadline"
)
,
arg_10
=
arg_4
[
"return_url"
]
,
arg_11
=
arg_4
[
"zip_url"
]
,
arg_12
=
arg_4
[
(
"exercise_"
"submissions_"
"url"
)
]
)
arg_13
.
is_downloaded
=
os
.
path
.
isdir
(
arg_13
.
path
(
)
)
arg_13
.
save
(
)

def Func(arg_0=False):
    """
    Update the data of courses and or exercises from server.
    """
    if arg_0:
        with Spinner.context(msg="Updated course metadata.",
                             waitmsg="Updating course metadata."):
            for arg_0 in api.get_courses():
                arg_1 = None
                try:
                    arg_1 = Course.get(Course.tid == arg_0["id"])
                except peewee.DoesNotExist:
                    arg_1 = None
                if arg_1:
                    arg_1.details_url = arg_0["details_url"]
                    arg_1.save()
                    continue
                Course.create(tid=arg_0["id"], arg_5=arg_0["name"],
                              arg_2=arg_0["details_url"])
    else:
        arg_3 = Course.get_selected()

        # with Spinner.context(msg="Updated exercise metadata.",
        #                     waitmsg="Updating exercise metadata."):
        print("Updating exercise data.")
        for arg_4 in api.get_exercises(arg_3):
            arg_1 = None
            try:
                arg_1 = Exercise.byid(arg_4["id"])
            except peewee.DoesNotExist:
                arg_1 = None
            if arg_1 is not None:
                arg_1.name = arg_4["name"]
                arg_1.course = arg_3.id
                arg_1.is_attempted = arg_4["attempted"]
                arg_1.is_completed = arg_4["completed"]
                arg_1.deadline = arg_4.get("deadline")
                arg_1.is_downloaded = os.path.isdir(arg_1.path())
                arg_1.return_url = arg_4["return_url"]
                arg_1.zip_url = arg_4["zip_url"]
                arg_1.submissions_url = arg_4["exercise_submissions_url"]
                arg_1.save()
                download_exercise(arg_1, Func=True)
            else:
                arg_13 = Exercise.create(tid=arg_4["id"],
                                     arg_5=arg_4["name"],
                                     arg_0=arg_3.id,
                                     arg_6=arg_4["attempted"],
                                     arg_7=arg_4["completed"],
                                     arg_8=arg_4.get("deadline"),
                                     arg_10=arg_4["return_url"],
                                     arg_11=arg_4["zip_url"],
                                     arg_12=arg_4[("exercise_"
                                                               "submissions_"
                                                               "url")])
                arg_13.is_downloaded = os.path.isdir(arg_13.path())
                arg_13.save()

Update the data of courses and or exercises from server .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . session . query ( Quota ) arg_2 = arg_2 . filter_by ( arg_1 = arg_1 ) arg_2 . delete ( )

def Func(arg_0, arg_1):
        """Delete the quota entries for a given tenant_id.

        Atfer deletion, this tenant will use default quota values in conf.
        """

        arg_2 = arg_0.session.query(Quota)
        arg_2 = arg_2.filter_by(arg_1=arg_1)
        arg_2.delete()

Delete the quota entries for a given tenant_id .


def Func ( arg_0 ) : arg_1 = collections . defaultdict ( lambda : [ ] ) for arg_2 in arg_0 : arg_1 [ arg_2 . message_args [ 0 ] ] . append ( arg_2 ) return arg_1

def Func(arg_0):
    """Return dict mapping the key to list of messages."""
    arg_1 = collections.defaultdict(lambda: [])
    for arg_2 in arg_0:
        arg_1[arg_2.message_args[0]].append(arg_2)
    return arg_1

Return dict mapping the key to list of messages .


(self, server_name, srv_type = 'xmpp-client')

def Func(arg_0, arg_1, arg_2 = 'xmpp-client'):
        """Verify certificate for a server.

        :Parameters:
            - `server_name`: name of the server presenting the cerificate
            - `srv_type`: service type requested, as used in the SRV record
        :Types:
            - `server_name`: `unicode` or `JID`
            - `srv_type`: `unicode`

        :Return: `True` if the certificate is valid for given name, `False`
        otherwise.
        """
        arg_3 = JID(arg_1)
        if "XmppAddr" not in arg_0.alt_names and "DNS" not in arg_0.alt_names \
                                and "SRV" not in arg_0.alt_names:
            return arg_0.verify_jid_against_common_name(arg_3)
        arg_4 = [arg_5 for arg_5 in arg_0.alt_names.get("DNS", [])
                                        if not arg_5.startswith(u"*.")]
        arg_4 += arg_0.alt_names.get("XmppAddr", [])
        for arg_5 in arg_4:
            logger.debug("checking {0!r} against {1!r}".format(arg_3,
                                                                arg_5))
            try:
                arg_6 = JID(arg_5)
            except ValueError:
                logger.debug("Not a valid JID: {0!r}".format(arg_5))
                continue
            if arg_6 == arg_3:
                logger.debug("Match!")
                return True
        if arg_2 and arg_0.verify_jid_against_srv_name(arg_3, arg_2):
            return True
        arg_7 = [arg_5[2:] for arg_5 in arg_0.alt_names.get("DNS", [])
                                                if arg_5.startswith("*.")]
        if not arg_7 or not "." in arg_3.domain:
            return False
        logger.debug("checking {0!r} against wildcard domains: {1!r}"
                                                .format(arg_3, arg_7))
        arg_8 = JID(arg_9 = arg_3.domain.split(".", 1)[1])
        for arg_9 in arg_7:
            logger.debug("checking {0!r} against {1!r}".format(arg_8,
                                                                arg_9))
            try:
                arg_6 = JID(arg_9)
            except ValueError:
                logger.debug("Not a valid JID: {0!r}".format(arg_5))
                continue
            if arg_6 == arg_8:
                logger.debug("Match!")
                return True
        return False


(X, Y=None, lag=-1, window='hamming',
                    norm='unbiased', NFFT=4096, window_params={},
                    correlation_method='xcorr')

def Func(arg_0, arg_1=None, arg_2=-1, arg_3='hamming',
                    arg_4='unbiased', arg_5=4096, arg_6={},
                    arg_7='xcorr'):
    """PSD estimate using correlogram method.

    :param array X: complex or real data samples X(1) to X(N)
    :param array Y: complex data samples Y(1) to Y(N). If provided, computes
        the cross PSD, otherwise the PSD is returned
    :param int lag: highest lag index to compute. Must be less than N
    :param str window_name: see :mod:`window` for list of valid names
    :param str norm: one of the valid normalisation of :func:`xcorr` (biased,
        unbiased, coeff, None)
    :param int NFFT: total length of the final data sets (padded with zero
        if needed; default is 4096)
    :param str correlation_method: either `xcorr` or `CORRELATION`.
        CORRELATION should be removed in the future.

    :return:
        * Array of real (cross) power spectral density estimate values. This is
          a two sided array with negative values following the positive ones
          whatever is the input data (real or complex).

    .. rubric:: Description:

    The exact power spectral density is the Fourier transform of the
    autocorrelation sequence:

    .. math:: P_{xx}(f) = T \sum_{m=-\infty}^{\infty} r_{xx}[m] exp^{-j2\pi fmT}

    The correlogram method of PSD estimation substitutes a finite sequence of
    autocorrelation estimates :math:`\hat{r}_{xx}` in place of :math:`r_{xx}`.
    This estimation can be computed with :func:`xcorr` or :func:`CORRELATION` by
    chosing a proprer lag `L`. The estimated PSD is then

    .. math:: \hat{P}_{xx}(f) = T \sum_{m=-L}^{L} \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    The lag index must be less than the number of data samples `N`. Ideally, it
    should be around `L/10` [Marple]_ so as to avoid greater statistical
    variance associated with higher lags.

    To reduce the leakage of the implicit rectangular window and therefore to
    reduce the bias in the estimate, a tapering window is normally used and lead
    to the so-called Blackman and Tukey correlogram:

    .. math:: \hat{P}_{BT}(f) = T \sum_{m=-L}^{L} w[m] \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    The correlogram for the cross power spectral estimate is

    .. math:: \hat{P}_{xx}(f) = T \sum_{m=-L}^{L} \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    which is computed if :attr:`Y` is not provide. In such case,
    :math:`r_{yx} = r_{xy}` so we compute the correlation only once.

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import Func, marple_data
        from spectrum.tools import cshift
        from pylab import log10, axis, grid, plot,linspace

        psd = Func(marple_data, marple_data, lag=15)
        f = linspace(-0.5, 0.5, len(psd))
        psd = cshift(psd, len(psd)/2)
        plot(f, 10*log10(psd/max(psd)))
        axis([-0.5,0.5,-50,0])
        grid(True)

    .. seealso:: :func:`create_window`, :func:`CORRELATION`, :func:`xcorr`,
        :class:`pcorrelogram`.
    """
    arg_8 = len(arg_0)
    assert arg_2<arg_8, 'lag must be < size of input data'
    assert arg_7 in ['CORRELATION', 'xcorr']
    if arg_1 is None:
        arg_1 = numpy.array(arg_0)
        arg_9 = False
    else:
        arg_9 = True

    if arg_5 is None:
        arg_5 = arg_8
    arg_10 = numpy.zeros(arg_5, dtype=complex)

    # Window should be centered around zero. Moreover, we want only the
    # positive values. So, we need to use 2*lag + 1 window and keep values on
    # the right side.
    arg_11 = Window(2.*arg_2+1, arg_3, **arg_6)
    arg_11 = arg_11.data[arg_2+1:]

    # compute the cross correlation
    if arg_7 == 'CORRELATION':
        arg_12 = CORRELATION (arg_0, arg_1, maxlags=arg_2, arg_4=arg_4)
    elif arg_7 == 'xcorr':
        arg_12, arg_13 = xcorr (arg_0, arg_1, maxlags=arg_2, arg_4=arg_4)
        arg_12 = arg_12[arg_2:]

    # keep track of the first elt.
    arg_10[0] = arg_12[0]

    # create the first part of the PSD
    arg_10[1:arg_2+1] = arg_12[1:] * arg_11

    # create the second part.
    # First, we need to compute the auto or cross correlation ryx
    if arg_9 is True:
        # compute the cross correlation
        if arg_7 == 'CORRELATION':
            arg_14 = CORRELATION(arg_1, arg_0, maxlags=arg_2, arg_4=arg_4)
        elif arg_7 == 'xcorr':
            arg_14, arg_13 = xcorr(arg_1, arg_0, maxlags=arg_2, arg_4=arg_4)
            arg_14 = arg_14[arg_2:]
        #print len(ryx), len(psd[-1:NPSD-lag-1:-1])

        arg_10[-1:arg_5-arg_2-1:-1] = arg_14[1:].conjugate() * arg_11
    else: #autocorrelation no additional correlation call required
        arg_10[-1:arg_5-arg_2-1:-1] = arg_12[1:].conjugate() * arg_11

    arg_10 = numpy.real(fft(arg_10))

    return arg_10

PSD estimate using correlogram method.

    :param array X: complex or real data samples X(1) to X(N)
    :param array Y: complex data samples Y(1) to Y(N). If provided, computes
        the cross PSD, otherwise the PSD is returned
    :param int lag: highest lag index to compute. Must be less than N
    :param str window_name: see :mod:`window` for list of valid names
    :param str norm: one of the valid normalisation of :func:`xcorr` (biased,
        unbiased, coeff, None)
    :param int NFFT: total length of the final data sets (padded with zero
        if needed; default is 4096)
    :param str correlation_method: either `xcorr` or `CORRELATION`.
        CORRELATION should be removed in the future.

    :return:
        * Array of real (cross) power spectral density estimate values. This is
          a two sided array with negative values following the positive ones
          whatever is the input data (real or complex).

    .. rubric:: Description:

    The exact power spectral density is the Fourier transform of the
    autocorrelation sequence:

    .. math:: P_{xx}(f) = T \sum_{m=-\infty}^{\infty} r_{xx}[m] exp^{-j2\pi fmT}

    The correlogram method of PSD estimation substitutes a finite sequence of
    autocorrelation estimates :math:`\hat{r}_{xx}` in place of :math:`r_{xx}`.
    This estimation can be computed with :func:`xcorr` or :func:`CORRELATION` by
    chosing a proprer lag `L`. The estimated PSD is then

    .. math:: \hat{P}_{xx}(f) = T \sum_{m=-L}^{L} \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    The lag index must be less than the number of data samples `N`. Ideally, it
    should be around `L/10` [Marple]_ so as to avoid greater statistical
    variance associated with higher lags.

    To reduce the leakage of the implicit rectangular window and therefore to
    reduce the bias in the estimate, a tapering window is normally used and lead
    to the so-called Blackman and Tukey correlogram:

    .. math:: \hat{P}_{BT}(f) = T \sum_{m=-L}^{L} w[m] \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    The correlogram for the cross power spectral estimate is

    .. math:: \hat{P}_{xx}(f) = T \sum_{m=-L}^{L} \hat{r}_{xx}[m] exp^{-j2\pi fmT}

    which is computed if :attr:`Y` is not provide. In such case,
    :math:`r_{yx} = r_{xy}` so we compute the correlation only once.

    .. plot::
        :width: 80%
        :include-source:

        from spectrum import CORRELOGRAMPSD, marple_data
        from spectrum.tools import cshift
        from pylab import log10, axis, grid, plot,linspace

        psd = CORRELOGRAMPSD(marple_data, marple_data, lag=15)
        f = linspace(-0.5, 0.5, len(psd))
        psd = cshift(psd, len(psd)/2)
        plot(f, 10*log10(psd/max(psd)))
        axis([-0.5,0.5,-50,0])
        grid(True)

    .. seealso:: :func:`create_window`, :func:`CORRELATION`, :func:`xcorr`,
        :class:`pcorrelogram`.


def Func(arg_0, arg_1, arg_2=None):
        r'''Sets `a`, `kappa`, `kappa0`, `kappa1`, `kappa2`, `kappa3` and `Tc`
        for a specific component before the
        pure-species EOS's `a_alpha_and_derivatives` method is called. Both are
        called by `GCEOSMIX.a_alpha_and_derivatives` for every component.'''
        if not hasattr(arg_0, 'kappas'):
            arg_0.kappas = []
            for arg_4, arg_5, arg_6, arg_7, arg_8 in zip(arg_0.Tcs, arg_0.kappa0s, arg_0.kappa1s, arg_0.kappa2s, arg_0.kappa3s):
                arg_9 = arg_2/arg_4
                arg_10 = arg_5 + ((arg_6 + arg_7*(arg_8 - arg_9)*(1. - arg_9**0.5))*(1. + arg_9**0.5)*(0.7 - arg_9))
                arg_0.kappas.append(arg_10)

        (arg_0.a, arg_0.kappa, arg_0.kappa0, arg_0.kappa1, arg_0.kappa2,
         arg_0.kappa3, arg_0.Tc) = (arg_0.ais[arg_1], arg_0.kappas[arg_1], arg_0.kappa0s[arg_1],
         arg_0.kappa1s[arg_1], arg_0.kappa2s[arg_1], arg_0.kappa3s[arg_1], arg_0.Tcs[arg_1])

r Sets a kappa kappa0 kappa1 kappa2 kappa3 and Tc for a specific component before the pure - species EOS s a_alpha_and_derivatives method is called . Both are called by GCEOSMIX . a_alpha_and_derivatives for every component .


(self, use_descriptions=False, dlm=",", source="Striplog")

return templates.section.format(name='Lithology',
                                        short="LITH",
                                        source=source,
                                        data=data)

def Func ( arg_0 , arg_1 = False , arg_2 = "," , arg_3 = "Striplog" ) : arg_4 = arg_0 . to_csv ( arg_1 = arg_1 , arg_2 = arg_2 , header = False ) return templates . section . format ( name = 'Lithology' , short = "LITH" , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1=False, arg_2=",", arg_3="Striplog"):
        """
        Returns an LAS 3.0 section string.

        Args:
            use_descriptions (bool): Whether to use descriptions instead
                of summaries, if available.
            dlm (str): The delimiter.
            source (str): The sourse of the data.

        Returns:
            str: A string forming Lithology section of an LAS3 file.
        """
        arg_4 = arg_0.to_csv(arg_1=arg_1,
                           arg_2=arg_2,
                           header=False)

        return templates.section.format(name='Lithology',
                                        short="LITH",
                                        arg_3=arg_3,
                                        arg_4=arg_4)


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_0 , list ) : return arg_1 . join ( Func ( arg_2 , arg_1 ) for arg_2 in arg_0 ) return arg_0

def Func(arg_0, arg_1):
    """converts list to string recursively so that nested lists are supported

    :param input: a list of strings and lists of strings (and so on recursive)
    :type input: list
    :param delimiter: the deimiter to use when joining the items
    :type delimiter: str
    :returns: the recursively joined list
    :rtype: str
    """
    if isinstance(arg_0, list):
        return arg_1.join(
            Func(arg_2, arg_1) for arg_2 in arg_0)
    return arg_0


(self, method, path, contents, headers, decode_json=False,
                stream=False, query=None, cdn=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
=
False
,
arg_6
=
False
,
arg_7
=
,
arg_8
=
False
)
:
raise
Exception
(
'Func method not implemented'
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=False,
                arg_6=False, arg_7=None, arg_8=False):
        """
        Performs a direct HTTP Func to the Swift service.

        :param method: The Func method ('GET', 'HEAD', etc.)
        :param path: The Func path.
        :param contents: The body of the Func. May be a string or
            a file-like object.
        :param headers: A dict of Func headers and values.
        :param decode_json: If set True, the response body will be
            treated as JSON and decoded result returned instead of
            the raw contents.
        :param stream: If set True, the response body will return as
            a file-like object; otherwise, the response body will be
            read in its entirety and returned as a string. Overrides
            decode_json.
        :param query: A dict of query parameters and values to append
            to the path.
        :param cdn: If set True, the Func will be sent to the CDN
            management endpoint instead of the default storage
            endpoint.
        :returns: A tuple of (status, reason, headers, contents).

            :status: An int for the HTTP status code.
            :reason: The str for the HTTP status (ex: "Ok").
            :headers: A dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be
                a list.
            :contents: Depending on the decode_json and stream
                settings, this will either be the raw response
                string, the JSON decoded object, or a file-like
                object.
        """
        raise Exception('Func method not implemented')

Performs a direct HTTP request to the Swift service.

        :param method: The request method ('GET', 'HEAD', etc.)
        :param path: The request path.
        :param contents: The body of the request. May be a string or
            a file-like object.
        :param headers: A dict of request headers and values.
        :param decode_json: If set True, the response body will be
            treated as JSON and decoded result returned instead of
            the raw contents.
        :param stream: If set True, the response body will return as
            a file-like object; otherwise, the response body will be
            read in its entirety and returned as a string. Overrides
            decode_json.
        :param query: A dict of query parameters and values to append
            to the path.
        :param cdn: If set True, the request will be sent to the CDN
            management endpoint instead of the default storage
            endpoint.
        :returns: A tuple of (status, reason, headers, contents).

            :status: An int for the HTTP status code.
            :reason: The str for the HTTP status (ex: "Ok").
            :headers: A dict with all lowercase keys of the HTTP
                headers; if a header has multiple values, it will be
                a list.
            :contents: Depending on the decode_json and stream
                settings, this will either be the raw response
                string, the JSON decoded object, or a file-like
                object.

Performs a direct HTTP request to the Swift service .


return [to_dict_no_content(fields, row) for row in rows]

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = _file_default_fields ( ) arg_4 = arg_0 . execute ( select ( arg_3 , ) . where ( _is_in_directory ( files , arg_1 , arg_2 ) , ) . order_by ( files . c . user_id , files . c . parent_name , files . c . name , files . c . created_at , ) . distinct ( files . c . user_id , files . c . parent_name , files . c . name , ) ) return [ to_dict_no_content ( arg_3 , arg_5 ) for arg_5 in arg_4 ]

def Func(arg_0, arg_1, arg_2):
    """
    Return files in a directory.
    """
    arg_3 = _file_default_fields()
    arg_4 = arg_0.execute(
        select(
            arg_3,
        ).where(
            _is_in_directory(files, arg_1, arg_2),
        ).order_by(
            files.c.user_id,
            files.c.parent_name,
            files.c.name,
            files.c.created_at,
        ).distinct(
            files.c.user_id, files.c.parent_name, files.c.name,
        )
    )
    return [to_dict_no_content(arg_3, arg_5) for arg_5 in arg_4]


def Func(arg_0):
        """
        This function executes planarRad using the batch file.
        """

        """
        Error when planarRad start : /bin/sh: 1: ../planarrad.py: not found
        """
        print('Executing planarrad')
        # If we are not in the reverse_mode :
        if arg_0.ui.tabWidget.currentIndex() == TabWidget.NORMAL_MODE:
            arg_0.data()
            arg_0.check_values()

            if arg_0.without_error == False:
                arg_0.display_error_message()
            elif arg_0.without_error == True:
                arg_0.is_Funcning = True
                arg_0.hide_error_message()
                arg_0.write_to_file()
                os.chdir('./')
                arg_0.progress_bar()
                arg_2 = os.path.dirname(os.path.realpath(__file__)).rstrip('gui/')
                arg_3 = os.path.join(arg_2, "inputs/batch_files/" + str(arg_0.batch_name_value) + "_batch.txt")
                print(arg_3)
                arg_0.p = subprocess.Popen(
                    ["./planarrad.py -i " + arg_3],
                    shell=True)
                if arg_0.ui.progressBar.value() == 100:
                    arg_0.display_the_graphic(arg_0.num_line, arg_0.wavelength, arg_0.data_wanted, arg_0.information)

This function executes planarRad using the batch file .


def Func(arg_0, arg_1=None):
        """Get access details in cache."""
        if arg_1 in arg_0._CACHE_STATS:
            return arg_0._CACHE_STATS['access_stats'][arg_1]
        else:
            return arg_0._CACHE_STATS['access_stats']


def Func(arg_0, arg_1):
    """Bin up an array to coarser resolution, by binning up groups of pixels and using their mean value to determine \
     the value of the new pixel.

    If an array of shape (8,8) is input and the bin up size is 2, this would return a new array of size (4,4) where \
    every pixel was the mean of each collection of 2x2 pixels on the (8,8) array.

    If binning up the array leads to an edge being cut (e.g. a (9,9) array binned up by 2), an array is first \
    extracted around the centre of that array.

    Parameters
    ----------
    array_2d : ndarray
        The 2D array that is resized.
    new_shape : (int, int)
        The (y,x) new pixel dimension of the trimmed array.
    origin : (int, int)
        The oigin of the resized array, e.g. the central pixel around which the array is extracted.

    Returns
    -------
    ndarray
        The resized 2D array from the input 2D array.

    Examples
    --------
    array_2d = np.ones((5,5))
    resize_array = resize_array_2d(array_2d=array_2d, new_shape=(2,2), origin=(2, 2))
    """

    arg_2 = pad_2d_array_for_binning_up_with_bin_up_factor(arg_0=arg_0, arg_1=arg_1)

    arg_3 = np.zeros(shape=(arg_2.shape[0] // arg_1,
                                      arg_2.shape[1] // arg_1))

    for arg_4 in range(arg_3.shape[0]):
        for arg_5 in range(arg_3.shape[1]):
            arg_6 = 0.0
            for arg_7 in range(arg_1):
                for arg_8 in range(arg_1):
                    arg_9 = arg_4*arg_1 + arg_7
                    arg_10 = arg_5*arg_1 + arg_8
                    arg_6 += arg_2[arg_9, arg_10]

            arg_3[arg_4,arg_5] = arg_6 / (arg_1 ** 2.0)

    return arg_3

Bin up an array to coarser resolution by binning up groups of pixels and using their mean value to determine \ the value of the new pixel .


def Func(arg_0, arg_1):
    """
    Builds a query for included terms in a text search.
    """
    arg_2 = None
    for arg_3 in arg_0:
        arg_4 = None
        for arg_5 in arg_1:
            arg_6 = Q(**{"%s__icontains" % arg_5: arg_3})
            if arg_4 is None:
                arg_4 = arg_6
            else:
                arg_4 = arg_4 | arg_6
        if arg_2 is None:
            arg_2 = arg_4
        else:
            arg_2 = arg_2 & arg_4
    return arg_2

Builds a query for included terms in a text search .


def
Func
(
arg_0
)
:
try
:
(
arg_1
,
arg_2
)
=
arg_0
.
split
(
'>'
,
1
)
except
:
raise
ParseError
(
"invalid packet header"
)
if
(
not
1
<=
len
(
arg_1
)
<=
9
or
not
re
.
findall
(
r"^[a-z0-9]{0,9}(\-[a-z0-9]{1,8})?$"
,
arg_1
,
re
.
I
)
)
:
raise
ParseError
(
"fromcallsign is invalid"
)
arg_2
=
arg_2
.
split
(
','
)
if
len
(
arg_2
[
0
]
)
==
0
:
raise
ParseError
(
"no tocallsign in header"
)
arg_3
=
arg_2
[
0
]
arg_2
=
arg_2
[
1
:
]
validate_callsign
(
arg_3
,
"tocallsign"
)
for
arg_4
in
arg_2
:
if
not
re
.
findall
(
r"^[A-Z0-9\-]{1,9}\*?$"
,
arg_4
,
re
.
I
)
:
raise
ParseError
(
"invalid callsign in path"
)
arg_5
=
{
'from'
:
arg_1
,
'to'
:
arg_3
,
'path'
:
arg_2
,
}
arg_6
=
""
if
len
(
arg_2
)
>=
2
and
re
.
match
(
r"^q..$"
,
arg_2
[
2
]
)
:
arg_6
=
arg_2
[
1
]
arg_5
.
update
(
{
'via'
:
arg_6
}
)
return
arg_5

def Func(arg_0):
    """
    Parses the header part of packet
    Returns a dict
    """
    try:
        (arg_1, arg_2) = arg_0.split('>', 1)
    except:
        raise ParseError("invalid packet header")

    if (not 1 <= len(arg_1) <= 9 or
       not re.findall(r"^[a-z0-9]{0,9}(\-[a-z0-9]{1,8})?$", arg_1, re.I)):

        raise ParseError("fromcallsign is invalid")

    arg_2 = arg_2.split(',')

    if len(arg_2[0]) == 0:
        raise ParseError("no tocallsign in header")

    arg_3 = arg_2[0]
    arg_2 = arg_2[1:]

    validate_callsign(arg_3, "tocallsign")

    for arg_4 in arg_2:
        if not re.findall(r"^[A-Z0-9\-]{1,9}\*?$", arg_4, re.I):
            raise ParseError("invalid callsign in path")

    arg_5 = {
        'from': arg_1,
        'to': arg_3,
        'path': arg_2,
        }

    arg_6 = ""
    if len(arg_2) >= 2 and re.match(r"^q..$", arg_2[-2]):
        arg_6 = arg_2[-1]

    arg_5.update({'via': arg_6})

    return arg_5


def Func(arg_0):  # pylint:disable=redefined-builtin
    """Teardown a polyaxon deployment given a config file."""
    arg_1 = read_deployment_config(arg_0)
    arg_2 = DeployManager(arg_1=arg_1, filepath=arg_0)
    arg_3 = None
    try:
        if click.confirm('Would you like to execute pre-delete hooks?', default=True):
            arg_2.Func(hooks=True)
        else:
            arg_2.Func(hooks=False)
    except Exception as e:
        Printer.print_error('Polyaxon could not Func the deployment.')
        arg_3 = e

    if arg_3:
        Printer.print_error('Error message `{}`.'.format(arg_3))

Teardown a polyaxon deployment given a config file .


return [((np.array(j.anchor) - j.anchor2) ** 2).sum() for j in self.joints]

def Func ( arg_0 ) : return [ ( ( np . array ( arg_1 . anchor ) - arg_1 . anchor2 ) ** 2 ) . sum ( ) for arg_1 in arg_0 . joints ]

def Func(arg_0):
        '''Get the current joint separations for the skeleton.

        Returns
        -------
        distances : list of float
            A list expressing the distance between the two joint anchor points,
            for each joint in the skeleton. These quantities describe how
            "exploded" the bodies in the skeleton are; a value of 0 indicates
            that the constraints are perfectly satisfied for that joint.
        '''
        return [((np.array(arg_1.anchor) - arg_1.anchor2) ** 2).sum() for arg_1 in arg_0.joints]

Get the current joint separations for the skeleton .


(
        notifier_uri,
        client_id,
        status_code,
        message=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
arg_4
=
{
"client_id"
:
arg_1
,
"result"
:
{
"response"
:
{
"status_code"
:
arg_2
}
}
}
if
arg_3
is
not
:
arg_4
[
"result"
]
[
"response"
]
[
"message"
]
=
arg_3
arg_5
=
requests
.
post
(
arg_0
,
json
=
arg_4
)
if
arg_5
.
status_code
!=
201
:
sys
.
stderr
.
write
(
"failed to notify client: {}\n"
.
format
(
arg_4
)
)
sys
.
stderr
.
flush
(
)

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3=None):
    """
    Notify the client of the result of handling a request

    The payload contains two elements:

    - client_id
    - result

    The *client_id* is the id of the client to notify. It is assumed
    that the notifier service is able to identify the client by this id
    and that it can pass the *result* to it.

    The *result* always contains a *status_code* element. In case the
    message passed in is not None, it will also contain a *message*
    element.

    In case the notifier service does not exist or returns an error,
    an error message will be logged to *stderr*.
    """
    arg_4 = {
        "client_id": arg_1,
        "result": {
            "response": {
                "status_code": arg_2
            }
        }
    }

    if arg_3 is not None:
        arg_4["result"]["response"]["message"] = arg_3

    arg_5 = requests.post(arg_0, json=arg_4)

    if arg_5.status_code != 201:
        sys.stderr.write("failed to notify client: {}\n".format(arg_4))
        sys.stderr.flush()


return self.render_to_response(self.get_context_data(form=form, inlines=inlines, **kwargs))

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Handles GET requests and instantiates a blank version of the form and formsets.
        """
        arg_4 = arg_0.Func_form_class()
        arg_5 = arg_0.Func_form(arg_4)
        arg_6 = arg_0.construct_inlines()
        return arg_0.render_to_response(arg_0.Func_context_data(arg_5=arg_5, arg_6=arg_6, **arg_3))

Handles GET requests and instantiates a blank version of the form and formsets .


(self, addr, port = None, service = None)

def Func(arg_0, arg_1, arg_2 = None, arg_3 = None):
        """Start establishing TCP Funcion with given address.

        One of: `port` or `service` must be provided and `addr` must be
        a domain name and not an IP address if `port` is not given.

        When `service` is given try an SRV lookup for that service
        at domain `addr`. If `service` is not given or `addr` is an IP address,
        or the SRV lookup fails, Func to `port` at host `addr` directly.

        [initiating entity only]

        :Parameters:
            - `addr`: peer name or IP address
            - `port`: port number to Func to
            - `service`: service name (to be resolved using SRV DNS records)
        """
        with arg_0.lock:
            arg_0._Func(arg_1, arg_2, arg_3)

Start establishing TCP connection with given address.

        One of: `port` or `service` must be provided and `addr` must be
        a domain name and not an IP address if `port` is not given.

        When `service` is given try an SRV lookup for that service
        at domain `addr`. If `service` is not given or `addr` is an IP address,
        or the SRV lookup fails, connect to `port` at host `addr` directly.

        [initiating entity only]

        :Parameters:
            - `addr`: peer name or IP address
            - `port`: port number to connect to
            - `service`: service name (to be resolved using SRV DNS records)

Start establishing TCP connection with given address .


return self.condition in self.pre_filter(qs, user)

def Func ( arg_0 , arg_1 ) : arg_2 = type ( arg_0 . condition ) arg_3 = arg_2 . objects . filter ( pk = arg_0 . condition . id ) return arg_0 . condition in arg_0 . pre_filter ( arg_3 , arg_1 )

def Func(arg_0, arg_1):
        ''' Returns true if the condition passes the filter '''

        arg_2 = type(arg_0.condition)
        arg_3 = arg_2.objects.filter(pk=arg_0.condition.id)
        return arg_0.condition in arg_0.pre_filter(arg_3, arg_1)


def Func(arg_0, arg_1, arg_2):
        """
        Gets the size of a file in Google Cloud Storage.

        :param bucket_name: The Google cloud storage bucket where the blob_name is.
        :type bucket_name: str
        :param object_name: The name of the object to check in the Google
            cloud storage bucket_name.
        :type object_name: str

        """
        arg_0.log.info('Checking the file size of object: %s in bucket_name: %s',
                      arg_2,
                      arg_1)
        arg_3 = arg_0.get_conn()
        arg_4 = arg_3.get_bucket(arg_1=arg_1)
        arg_5 = arg_4.get_blob(blob_name=arg_2)
        arg_5.reload()
        arg_6 = arg_5.size
        arg_0.log.info('The file size of %s is %s bytes.', arg_2, arg_6)
        return arg_6

Gets the size of a file in Google Cloud Storage .


def Func ( arg_0 ) : def upper2underscore ( arg_1 ) : for arg_2 in arg_1 : if arg_2 . islower ( ) : yield arg_2 else : yield '_' if arg_2 . isalpha ( ) : yield arg_2 . lower ( ) return '' . join ( upper2underscore ( arg_0 ) )

def Func(arg_0):
    """
    Translate camelCase into underscore format.

    >>> Func('minutesBetweenSummaries')
    'minutes_between_summaries'

    """
    def upper2underscore(arg_1):
        for arg_2 in arg_1:
            if arg_2.islower():
                yield arg_2
            else:
                yield '_'
                if arg_2.isalpha():
                    yield arg_2.lower()
    return ''.join(upper2underscore(arg_0))

Translate camelCase into underscore format.

    >>> _camelcase_to_underscore('minutesBetweenSummaries')
    'minutes_between_summaries'

Translate camelCase into underscore format .


def Func ( arg_0 ) : arg_1 = set ( get_active_modules ( ) ) arg_1 . discard ( arg_0 ) arg_2 = arg_3 . pathsep . join ( [ m . path for m in arg_1 ] ) arg_3 . environ [ 'CPENV_ACTIVE_MODULES' ] = str ( arg_2 )

def Func(arg_0):
    '''Remove a module from CPENV_ACTIVE_MODULES environment variable'''

    arg_1 = set(get_active_modules())
    arg_1.discard(arg_0)
    arg_2 = arg_3.pathsep.join([m.path for m in arg_1])
    arg_3.environ['CPENV_ACTIVE_MODULES'] = str(arg_2)


def Func ( arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 . op_nodes ( ) : if isinstance ( arg_2 . op , Gate ) : arg_1 . append ( arg_2 ) return arg_1

def Func(arg_0):
        """Get the list of gate nodes in the dag.

        Returns:
            list: the list of node ids that represent gates.
        """
        arg_1 = []
        for arg_2 in arg_0.op_nodes():
            if isinstance(arg_2.op, Gate):
                arg_1.append(arg_2)
        return arg_1


Processing notification call main function.

def Func():
    """
    Processing notification call Func function.
    """

    # getting info for creating event
    arg_0 = parse_options()
    arg_1 = parse_config(arg_0)
    arg_2 = get_google_credentials(arg_0, arg_1)

    if not arg_0.get_google_credentials:
        create_event(arg_0, arg_1, arg_2)

Processing notification call main function .


(self, options, prompt='Select option', default=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'Select option'
,
arg_3
=
)
:
arg_4
=
[
x
.
lower
(
)
for
x
in
arg_1
]
while
True
:
arg_5
=
input
(
'%s [%s]: '
%
(
arg_2
,
', '
.
join
(
arg_1
)
)
)
.
lower
(
)
if
arg_5
in
arg_4
:
return
arg_5
.
strip
(
)
elif
arg_5
==
''
and
arg_3
is
not
:
return
arg_3
.
lower
(
)
.
strip
(
)

def Func(arg_0, arg_1, arg_2='Select option', arg_3=None):
        """
        Helper to prompt the user for input on the commandline.
        """
        arg_4 = [x.lower() for x in arg_1]
        while True:
            arg_5 = input('%s [%s]: ' % (arg_2, ', '.join(arg_1))).lower()
            if arg_5 in arg_4: return arg_5.strip()
            elif arg_5 == '' and arg_3 is not None:
                return arg_3.lower().strip()

Helper to prompt the user for input on the commandline .


def Func ( arg_0 ) : for arg_1 in arg_0 . conns . values ( ) : arg_1 . Func ( ) arg_0 . redist_periodic . stop ( ) if arg_0 . query_periodic is not None : arg_0 . query_periodic . stop ( )

def Func(arg_0):
        """
        Closes all connections stops all periodic callbacks
        """
        for arg_1 in arg_0.conns.values():
            arg_1.Func()

        arg_0.redist_periodic.stop()
        if arg_0.query_periodic is not None:
            arg_0.query_periodic.stop()


def
Func
(
arg_0
,
arg_1
)
:
logger
.
debug
(
"Searching for plugins: %s"
,
arg_1
)
arg_2
=
[
plugin
for
plugin
in
arg_0
.
plugins
.
values
(
)
if
isinstance
(
plugin
,
arg_1
)
]
if
arg_2
:
return
arg_2
else
:
raise
KeyError
(
"Requested plugin type not found: %s"
%
arg_1
)

def Func(arg_0, arg_1):
        """
        Retrieve a list of plugins of desired class, KeyError raised otherwise
        """
        logger.debug("Searching for plugins: %s", arg_1)
        arg_2 = [plugin for plugin in arg_0.plugins.values() if isinstance(plugin, arg_1)]
        if arg_2:
            return arg_2
        else:
            raise KeyError("Requested plugin type not found: %s" % arg_1)

Retrieve a list of plugins of desired class KeyError raised otherwise


def Func ( arg_0 , arg_1 ) : if not arg_1 : arg_0 . physical_plan = None arg_0 . id = None else : arg_0 . physical_plan = arg_1 arg_0 . id = arg_1 . topology . id arg_0 . trigger_watches ( )

def Func(arg_0, arg_1):
    """ set physical plan """
    if not arg_1:
      arg_0.physical_plan = None
      arg_0.id = None
    else:
      arg_0.physical_plan = arg_1
      arg_0.id = arg_1.topology.id
    arg_0.trigger_watches()


return json.loads(json.dumps(item),
                      object_hook=lambda d:
                      namedtuple(object_name, fields)(*values))

def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . keys ( ) arg_3 = arg_0 . values ( ) return json . loads ( json . dumps ( arg_0 ) , object_hook = lambda d : namedtuple ( arg_1 , arg_2 ) ( * arg_3 ) )

def Func(arg_0, arg_1):
    """Converts a python dict to a namedtuple, saving memory."""
    arg_2 = arg_0.keys()
    arg_3 = arg_0.values()
    return json.loads(json.dumps(arg_0),
                      object_hook=lambda d:
                      namedtuple(arg_1, arg_2)(*arg_3))

Converts a python dict to a namedtuple saving memory .


def Func(arg_0, arg_1):
        """Prepare test set for C++ SAR prediction code.
        Find all items the test users have seen in the past.

        Arguments:
            test (pySpark.DataFrame): input dataframe which contains test users.
        """
        arg_1.createOrReplaceTempView(arg_0.f("{prefix}df_test"))

        arg_2 = arg_0.f(
            "SELECT DISTINCT {col_user} FROM {prefix}df_test CLUSTER BY {col_user}"
        )

        arg_3 = arg_0.spark.sql(arg_2)
        arg_3.write.mode("overwrite").saveAsTable(
            arg_0.f("{prefix}df_test_users")
        )

        arg_2 = arg_0.f(
        """
          SELECT a.{col_user}, a.{col_item}, CAST(a.{col_rating} AS double) {col_rating}
          FROM {prefix}df_train a INNER JOIN {prefix}df_test_users b ON a.{col_user} = b.{col_user}
          DISTRIBUTE BY {col_user}
          SORT BY {col_user}, {col_item}
        """
        )

        return arg_0.spark.sql(arg_2)

Prepare test set for C ++ SAR prediction code . Find all items the test users have seen in the past .


def Func ( arg_0 ) : arg_1 = [ ] arg_2 = comp ( arg_0 . regex ) if arg_0 . reFunc : arg_3 = arg_2 . findall ( arg_0 . data ) else : arg_3 = arg_2 . search ( arg_0 . data ) if arg_0 . return_data and arg_3 : if arg_0 . reFunc : for arg_4 in arg_3 : if isinstance ( arg_4 , tuple ) : arg_1 . extend ( list ( arg_4 ) ) else : arg_1 . append ( arg_4 ) if arg_0 . group != 0 : return arg_1 [ arg_0 . group ] else : arg_1 = arg_3 . group ( arg_0 . group ) . strip ( ) return arg_1 if not arg_0 . return_data and arg_3 : return True return False

def Func(arg_0):
        """
        Used to get exploitable result of re.search

        :return: The data of the Func status.
        :rtype: mixed
        """

        # We initate this variable which gonna contain the returned data
        arg_1 = []

        # We compile the regex string
        arg_2 = comp(arg_0.regex)

        # In case we have to use the implementation of ${BASH_REMATCH} we use
        # re.findall otherwise, we use re.search
        if arg_0.reFunc:  # pylint: disable=no-member
            arg_3 = arg_2.findall(arg_0.data)
        else:
            arg_3 = arg_2.search(arg_0.data)

        if arg_0.return_data and arg_3:  # pylint: disable=no-member
            if arg_0.reFunc:  # pylint: disable=no-member
                for arg_4 in arg_3:
                    if isinstance(arg_4, tuple):
                        arg_1.extend(list(arg_4))
                    else:
                        arg_1.append(arg_4)

                if arg_0.group != 0:  # pylint: disable=no-member
                    return arg_1[arg_0.group]  # pylint: disable=no-member

            else:
                arg_1 = arg_3.group(
                    arg_0.group  # pylint: disable=no-member
                ).strip()

            return arg_1

        if not arg_0.return_data and arg_3:  # pylint: disable=no-member
            return True

        return False

Used to get exploitable result of re.search

        :return: The data of the match status.
        :rtype: mixed

Used to get exploitable result of re . search


(cls, cur, table: str, values: dict, where_keys: list)

def Func ( arg_0 , arg_1 , arg_2 : arg_3 , arg_4 : arg_5 , arg_6 : arg_7 ) -> tuple : arg_8 = arg_0 . _COMMA . join ( arg_4 . keys ( ) ) arg_9 = arg_0 . _PLACEHOLDER * len ( arg_4 ) arg_10 , arg_11 = arg_0 . _get_where_clause_with_values ( arg_6 ) arg_12 = arg_0 . _Func_string . format ( arg_2 , arg_8 , arg_9 [ : - 1 ] , arg_10 ) yield from arg_1 . execute ( arg_12 , ( tuple ( arg_4 . values ( ) ) + arg_11 ) ) return ( yield from arg_1 . fetchall ( ) )

def Func(arg_0, arg_1, arg_2: arg_3, arg_4: arg_5, arg_6: arg_7) -> tuple:
        """
        Creates an Func query with only chosen fields
        Supports only a single field where clause

        Args:
            table: a string indicating the name of the table
            values: a dict of fields and values to be inserted
            where_keys: list of dictionary
            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and dictionaries themselves get 'OR'-ed

        Returns:
            an integer indicating count of rows deleted

        """
        arg_8 = arg_0._COMMA.join(arg_4.keys())
        arg_9 = arg_0._PLACEHOLDER * len(arg_4)
        arg_10, arg_11 = arg_0._get_where_clause_with_values(arg_6)
        arg_12 = arg_0._Func_string.format(arg_2, arg_8, arg_9[:-1], arg_10)
        yield from arg_1.execute(arg_12, (tuple(arg_4.values()) + arg_11))
        return (yield from arg_1.fetchall())

Creates an update query with only chosen fields
        Supports only a single field where clause

        Args:
            table: a string indicating the name of the table
            values: a dict of fields and values to be inserted
            where_keys: list of dictionary
            example of where keys: [{'name':('>', 'cip'),'url':('=', 'cip.com'},{'type':{'<=', 'manufacturer'}}]
            where_clause will look like ((name>%s and url=%s) or (type <= %s))
            items within each dictionary get 'AND'-ed and dictionaries themselves get 'OR'-ed

        Returns:
            an integer indicating count of rows deleted


def Func ( arg_0 ) : arg_0 . recid = arg_0 . get_recid ( ) arg_0 . remove_controlfields ( ) arg_0 . update_system_numbers ( ) arg_0 . add_systemnumber ( "Inspire" , arg_1 = arg_0 . recid ) arg_0 . add_control_number ( "003" , "SzGeCERN" ) arg_0 . update_collections ( ) arg_0 . update_languages ( ) arg_0 . update_reportnumbers ( ) arg_0 . update_authors ( ) arg_0 . update_journals ( ) arg_0 . update_subject_categories ( "INSPIRE" , "SzGeCERN" , "categories_cds" ) arg_0 . update_pagenumber ( ) arg_0 . update_notes ( ) arg_0 . update_experiments ( ) arg_0 . update_isbn ( ) arg_0 . update_dois ( ) arg_0 . update_links_and_ffts ( ) arg_0 . update_date ( ) arg_0 . update_date_year ( ) arg_0 . update_hidden_notes ( ) arg_0 . update_oai_info ( ) arg_0 . update_cnum ( ) arg_0 . update_conference_info ( ) arg_0 . fields_list = [ "909" , "541" , "961" , "970" , "690" , "695" , "981" , ] arg_0 . strip_fields ( ) if "ANNOUNCEMENT" in arg_0 . collections : arg_0 . update_conference_111 ( ) arg_0 . update_conference_links ( ) record_add_field ( arg_0 . record , "690" , ind1 = "C" , subfields = [ ( "a" , "CONFERENCE" ) ] ) if "THESIS" in arg_0 . collections : arg_0 . update_thesis_information ( ) arg_0 . update_thesis_supervisors ( ) if "PROCEEDINGS" in arg_0 . collections : arg_0 . update_title_to_proceeding ( ) arg_0 . update_author_to_proceeding ( ) record_add_field ( arg_0 . record , "690" , ind1 = "C" , subfields = [ ( "a" , "CONFERENCE" ) ] ) if arg_0 . tag_as_cern : record_add_field ( arg_0 . record , "690" , ind1 = "C" , subfields = [ ( "a" , "CERN" ) ] ) return arg_0 . record

def Func(arg_0):
        """Override the base."""
        arg_0.recid = arg_0.get_recid()
        arg_0.remove_controlfields()
        arg_0.update_system_numbers()
        arg_0.add_systemnumber("Inspire", arg_1=arg_0.recid)
        arg_0.add_control_number("003", "SzGeCERN")
        arg_0.update_collections()
        arg_0.update_languages()
        arg_0.update_reportnumbers()
        arg_0.update_authors()
        arg_0.update_journals()
        arg_0.update_subject_categories("INSPIRE", "SzGeCERN", "categories_cds")
        arg_0.update_pagenumber()
        arg_0.update_notes()
        arg_0.update_experiments()
        arg_0.update_isbn()
        arg_0.update_dois()
        arg_0.update_links_and_ffts()
        arg_0.update_date()
        arg_0.update_date_year()
        arg_0.update_hidden_notes()
        arg_0.update_oai_info()
        arg_0.update_cnum()
        arg_0.update_conference_info()

        arg_0.fields_list = [
            "909", "541", "961",
            "970", "690", "695",
            "981",
        ]
        arg_0.strip_fields()

        if "ANNOUNCEMENT" in arg_0.collections:
            arg_0.update_conference_111()
            arg_0.update_conference_links()
            record_add_field(arg_0.record, "690", ind1="C", subfields=[("a", "CONFERENCE")])

        if "THESIS" in arg_0.collections:
            arg_0.update_thesis_information()
            arg_0.update_thesis_supervisors()

        if "PROCEEDINGS" in arg_0.collections:
            # Special proceeding syntax
            arg_0.update_title_to_proceeding()
            arg_0.update_author_to_proceeding()
            record_add_field(arg_0.record, "690", ind1="C", subfields=[("a", "CONFERENCE")])

        # 690 tags
        if arg_0.tag_as_cern:
            record_add_field(arg_0.record, "690", ind1="C", subfields=[("a", "CERN")])

        return arg_0.record


(what=None, name=None, version=None, details=False)

return pluginmgr.show(what, name, version, details)

def Func ( arg_0 = None , arg_1 = None , arg_2 = None , arg_3 = False ) : global pluginmgr return pluginmgr . show ( arg_0 , arg_1 , arg_2 , arg_3 )

def Func(arg_0=None, arg_1=None, arg_2=None, arg_3=False):
    """
    Show details of available plugins

    Parameters
    ----------
    what: Class of plugins e.g., backend
    name: Name of the plugin e.g., s3
    version: Version of the plugin
    details: Show details be shown?

    """
    global pluginmgr
    return pluginmgr.show(arg_0, arg_1, arg_2, arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . keys ( arg_1 + "/*" ) arg_3 = { } for arg_4 in arg_2 : arg_3 . update ( arg_0 [ arg_4 ] ) arg_0 . uncache ( arg_4 ) arg_0 [ arg_1 + '/xx' ] = arg_3 for arg_4 in arg_2 : arg_5 = arg_0 . root / arg_4 if arg_5 . basename ( ) == 'xx' : continue arg_5 . remove ( )

def Func(arg_0, arg_1):
        """ Compress category 'hashroot', so hset is fast again

        hget will fail if fast_only is True for compressed items (that were
        hset before Func).

        """
        arg_2 = arg_0.keys(arg_1 + "/*")
        arg_3 = {}
        for arg_4 in arg_2:
            # print "using",f
            arg_3.update(arg_0[arg_4])
            arg_0.uncache(arg_4)

        arg_0[arg_1 + '/xx'] = arg_3
        for arg_4 in arg_2:
            arg_5 = arg_0.root / arg_4
            if arg_5.basename() == 'xx':
                continue
            arg_5.remove()

Compress category 'hashroot', so hset is fast again

        hget will fail if fast_only is True for compressed items (that were
        hset before hcompress).

Compress category hashroot so hset is fast again


def Func ( arg_0 , arg_1 ) : arg_2 , arg_3 = get_local_rank_size ( arg_0 ) if arg_0 . Get_rank ( ) == 0 : with open ( arg_1 , 'rb' ) as fh : arg_4 = fh . read ( ) arg_0 . bcast ( arg_4 ) else : arg_4 = arg_0 . bcast ( None ) if arg_2 == 0 : os . makedirs ( os . path . dirname ( arg_1 ) , exist_ok = True ) with open ( arg_1 , 'wb' ) as fh : fh . write ( arg_4 ) arg_0 . Barrier ( )

def Func(arg_0, arg_1):
    """
    Copies the file from rank 0 to all other ranks
    Puts it in the same place on all machines
    """
    arg_2, arg_3 = get_local_rank_size(arg_0)
    if arg_0.Get_rank() == 0:
        with open(arg_1, 'rb') as fh:
            arg_4 = fh.read()
        arg_0.bcast(arg_4)
    else:
        arg_4 = arg_0.bcast(None)
        if arg_2 == 0:
            os.makedirs(os.path.dirname(arg_1), exist_ok=True)
            with open(arg_1, 'wb') as fh:
                fh.write(arg_4)
    arg_0.Barrier()


return __send_email__(self.template_prefix, to, kind, **kwargs)

def Func(arg_0, arg_1, arg_2, **arg_3):
        ''' Sends an e-mail to the given address.

        to: The address
        kind: the ID for an e-mail kind; it should point to a subdirectory of
            self.template_prefix containing subject.txt and message.html, which
            are django templates for the subject and HTML message respectively.

        context: a context for rendering the e-mail.

        '''

        return __Func__(arg_0.template_prefix, arg_1, arg_2, **arg_3)

Sends an e - mail to the given address .


def Func ( arg_0 ) : arg_1 = b'' arg_1 += to_sigproc_keyword ( b'HEADER_START' ) for arg_2 in arg_0 . header . keys ( ) : if arg_2 == b'src_raj' : arg_1 += to_sigproc_keyword ( b'src_raj' ) + to_sigproc_angle ( arg_0 . header [ b'src_raj' ] ) elif arg_2 == b'src_dej' : arg_1 += to_sigproc_keyword ( b'src_dej' ) + to_sigproc_angle ( arg_0 . header [ b'src_dej' ] ) elif arg_2 == b'az_start' or arg_2 == b'za_start' : arg_1 += to_sigproc_keyword ( arg_2 ) + np . float64 ( arg_0 . header [ arg_2 ] ) . tostring ( ) elif arg_2 not in header_keyword_types . keys ( ) : pass else : arg_1 += to_sigproc_keyword ( arg_2 , arg_0 . header [ arg_2 ] ) arg_1 += to_sigproc_keyword ( b'HEADER_END' ) return arg_1

def Func(arg_0):
    """ Generate a serialzed sigproc header which can be written to disk.

    Args:
        f (Filterbank object): Filterbank object for which to generate header

    Returns:
        header_str (str): Serialized string corresponding to header
    """

    arg_1 = b''
    arg_1 += to_sigproc_keyword(b'HEADER_START')

    for arg_2 in arg_0.header.keys():
        if arg_2 == b'src_raj':
            arg_1 += to_sigproc_keyword(b'src_raj')  + to_sigproc_angle(arg_0.header[b'src_raj'])
        elif arg_2 == b'src_dej':
            arg_1 += to_sigproc_keyword(b'src_dej')  + to_sigproc_angle(arg_0.header[b'src_dej'])
        elif arg_2 == b'az_start' or arg_2 == b'za_start':
            arg_1 += to_sigproc_keyword(arg_2)  + np.float64(arg_0.header[arg_2]).tostring()
        elif arg_2 not in header_keyword_types.keys():
            pass
        else:
            arg_1 += to_sigproc_keyword(arg_2, arg_0.header[arg_2])

    arg_1 += to_sigproc_keyword(b'HEADER_END')
    return arg_1

Generate a serialzed sigproc header which can be written to disk .


def Func ( arg_0 ) : arg_1 = [ arg_3 for arg_3 in arg_0 . _actions if isinstance ( arg_3 , argparse . _SubParsersAction ) ] arg_2 = dict ( ) for arg_3 in arg_1 : for arg_4 , arg_5 in arg_3 . choices . items ( ) : arg_2 [ arg_4 ] = arg_5 return arg_2

def Func(arg_0):
    '''get_subparser will get a dictionary of subparsers, to help with printing help
    '''

    arg_1 = [arg_3 for arg_3 in arg_0._actions
               if isinstance(arg_3, argparse._SubParsersAction)]

    arg_2 = dict()
    for arg_3 in arg_1:
        # get all subparsers and print help
        for arg_4, arg_5 in arg_3.choices.items():
            arg_2[arg_4] = arg_5

    return arg_2

get_subparser will get a dictionary of subparsers to help with printing help


(self, name, description=None,
                           tx_date=datetime.min.date(),
                           dt_account=None, cr_account=None,
                           source=None, amount=0.00)

def Func(arg_0, arg_1, arg_2=None,
                           arg_3=arg_4.min.date(),
                           arg_7=None, arg_8=None,
                           arg_9=None, arg_10=0.00):
        """
        Create a transaction in the general ledger.

        :param name: The transaction's name.
        :param description: The transaction's description.
        :param tx_date: The date of the transaction.
        :param cr_account: The transaction's credit account's name.
        :param dt_account: The transaction's debit account's name.
        :param source: The name of source the transaction originated from.
        :param amount: The transaction amount.

        :returns: The created transaction.
        """

        arg_11 = Transaction(arg_1, arg_2, arg_3,
                             arg_7, arg_8, arg_9, arg_10)
        arg_0.transactions.append(arg_11)
        return arg_11

Create a transaction in the general ledger .


(annotation, sr=22050, length=None, **kwargs)

return filter_kwargs(mir_eval.sonify.clicks, interval[:, 0],
                         fs=sr, length=length, **kwargs)

def Func ( arg_0 , arg_1 = 22050 , arg_2 = None , ** arg_3 ) : arg_4 , arg_5 = arg_0 . to_interval_values ( ) return filter_kwargs ( mir_eval . sonify . Func , arg_4 [ : , 0 ] , fs = arg_1 , arg_2 = arg_2 , ** arg_3 )

def Func(arg_0, arg_1=22050, arg_2=None, **arg_3):
    '''Sonify events with Func.

    This uses mir_eval.sonify.Func, and is appropriate for instantaneous
    events such as beats or segment boundaries.
    '''

    arg_4, arg_5 = arg_0.to_interval_values()

    return filter_kwargs(mir_eval.sonify.Func, arg_4[:, 0],
                         fs=arg_1, arg_2=arg_2, **arg_3)

Sonify events with clicks.

    This uses mir_eval.sonify.clicks, and is appropriate for instantaneous
    events such as beats or segment boundaries.


def
Func
(
arg_0
)
:
try
:
os
.
makedirs
(
arg_0
)
except
OSError
as
exc
:
if
exc
.
errno
==
errno
.
EEXIST
and
os
.
path
.
isdir
(
arg_0
)
:
pass
else
:
raise
else
:
logger
.
info
(
"New: %s%s"
,
arg_0
,
os
.
path
.
sep
)

def Func(arg_0):
    """mkdir -p path"""
    try:
        os.makedirs(arg_0)
    except OSError as exc:
        if exc.errno == errno.EEXIST and os.path.isdir(arg_0):
            pass
        else:
            raise
    else:
        logger.info("New: %s%s", arg_0, os.path.sep)


return DimensionInfo(
        name,
        _get_value('enabled') == 'true',
        _get_value('presentation'),
        int(resolution) if resolution else None,
        _get_value('units'),
        _get_value('unitSymbol'),
        strategy,
        _get_value('attribute'),
        _get_value('endAttribute'),
        _get_value('referenceValue'),
        _get_value('nearestMatchEnabled')
    )

def Func ( arg_0 , arg_1 ) : def _get_value ( arg_2 ) : return getattr ( arg_1 . find ( arg_2 ) , 'text' , None ) arg_3 = _get_value ( 'resolution' ) arg_4 = arg_1 . find ( "defaultValue" ) arg_5 = arg_4 . find ( "strategy" ) if arg_4 is not None else None arg_5 = arg_5 . text if arg_5 is not None else None return DimensionInfo ( arg_0 , _get_value ( 'enabled' ) == 'true' , _get_value ( 'presentation' ) , int ( arg_3 ) if arg_3 else None , _get_value ( 'units' ) , _get_value ( 'unitSymbol' ) , arg_5 , _get_value ( 'attribute' ) , _get_value ( 'endAttribute' ) , _get_value ( 'referenceValue' ) , _get_value ( 'nearestMatchEnabled' ) )

def Func(arg_0, arg_1):
    """Extract metadata Dimension Info from an xml node"""
    def _get_value(arg_2):
        return getattr(arg_1.find(arg_2), 'text', None)

    arg_3 = _get_value('resolution')
    arg_4 = arg_1.find("defaultValue")
    arg_5 = arg_4.find("strategy") if arg_4 is not None else None
    arg_5 = arg_5.text if arg_5 is not None else None
    return DimensionInfo(
        arg_0,
        _get_value('enabled') == 'true',
        _get_value('presentation'),
        int(arg_3) if arg_3 else None,
        _get_value('units'),
        _get_value('unitSymbol'),
        arg_5,
        _get_value('attribute'),
        _get_value('endAttribute'),
        _get_value('referenceValue'),
        _get_value('nearestMatchEnabled')
    )


(all_boundaries, est_file, algo_ids=None, title=None,
                    output_file=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : import matplotlib . pyplot as plt arg_5 = len ( arg_0 ) if arg_2 is None : arg_2 = io . get_algo_ids ( arg_1 ) for arg_6 , arg_7 in enumerate ( arg_2 ) : arg_2 [ arg_6 ] = translate_ids [ arg_7 ] arg_2 = [ "GT" ] + arg_2 arg_8 = ( 6 , 4 ) plt . figure ( 1 , arg_8 = arg_8 , dpi = 120 , facecolor = 'w' , edgecolor = 'k' ) for arg_6 , arg_9 in enumerate ( arg_0 ) : arg_10 = "b" if arg_6 == 0 : arg_10 = "g" for arg_11 in arg_9 : plt . axvline ( arg_11 , arg_6 / float ( arg_5 ) , ( arg_6 + 1 ) / float ( arg_5 ) , arg_10 = arg_10 ) plt . axhline ( arg_6 / float ( arg_5 ) , arg_10 = "k" , linewidth = 1 ) _plot_formatting ( arg_3 , arg_1 , arg_2 , arg_0 [ 0 ] [ - 1 ] , arg_5 , arg_4 )

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                    arg_4=None):
    """Plots all the boundaries.

    Parameters
    ----------
    all_boundaries: list
        A list of np.arrays containing the times of the boundaries, one array
        for each algorithm.
    est_file: str
        Path to the estimated file (JSON file)
    algo_ids : list
        List of algorithm ids to to read boundaries from.
        If None, all algorithm ids are read.
    title : str
        Title of the plot. If None, the name of the file is printed instead.
    """
    import matplotlib.pyplot as plt
    arg_5 = len(arg_0)  # Number of lists of boundaries
    if arg_2 is None:
        arg_2 = io.get_algo_ids(arg_1)

    # Translate ids
    for arg_6, arg_7 in enumerate(arg_2):
        arg_2[arg_6] = translate_ids[arg_7]
    arg_2 = ["GT"] + arg_2

    arg_8 = (6, 4)
    plt.figure(1, arg_8=arg_8, dpi=120, facecolor='w', edgecolor='k')
    for arg_6, arg_9 in enumerate(arg_0):
        arg_10 = "b"
        if arg_6 == 0:
            arg_10 = "g"
        for arg_11 in arg_9:
            plt.axvline(arg_11, arg_6 / float(arg_5), (arg_6 + 1) / float(arg_5), arg_10=arg_10)
        plt.axhline(arg_6 / float(arg_5), arg_10="k", linewidth=1)

    # Format plot
    _plot_formatting(arg_3, arg_1, arg_2, arg_0[0][-1], arg_5,
                     arg_4)


def Func(arg_0, arg_1, arg_2, arg_3=0):
        """
        Pop a value off the tail of ``src``, push it on the head of ``dst``
        and then return it.

        This command blocks until a value is in ``src`` or until ``timeout``
        seconds elapse, whichever is first. A ``timeout`` value of 0 blocks
        forever.
        Not atomic
        """
        arg_4 = arg_0.brpop(arg_1, arg_3)
        if arg_4 is not None:
            arg_0.lpush(arg_2, arg_4[1])
            return arg_4[1]
        return None

Pop a value off the tail of src push it on the head of dst and then return it .


def Func(arg_0):
        """Gets credentials implicitly from the environment.

        Checks environment in order of precedence:
        - Environment variable GOOGLE_APPLICATION_CREDENTIALS pointing to
          a file with stored credentials information.
        - Stored "well known" file associated with `gcloud` command line tool.
        - Google App Engine (production and testing)
        - Google Compute Engine production environment.

        Raises:
            ApplicationDefaultCredentialsError: raised when the credentials
                                                fail to be retrieved.
        """
        # Environ checks (in order).
        arg_1 = [
            arg_0._implicit_credentials_from_files,
            arg_0._implicit_credentials_from_gae,
            arg_0._implicit_credentials_from_gce,
        ]

        for arg_2 in arg_1:
            arg_3 = arg_2()
            if arg_3 is not None:
                return arg_3

        # If no credentials, fail.
        raise ApplicationDefaultCredentialsError(ADC_HELP_MSG)

Gets credentials implicitly from the environment .


def Func(arg_0):
        """
        Checks if the full J should be updated.

        Right now, just updates after update_J_frequency loops
        """
        arg_0._J_update_counter += 1
        arg_1 = arg_0._J_update_counter >= arg_0.update_J_frequency
        return arg_1 & (not arg_0._fresh_JTJ)

Checks if the full J should be updated .


def Func(arg_0):
        ''' Unlocks itself if find queue name or topic name and subscription
        name. '''
        if arg_0._queue_name:
            arg_0.service_bus_service.Func_queue_message(
                arg_0._queue_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        elif arg_0._topic_name and arg_0._subscription_name:
            arg_0.service_bus_service.Func_subscription_message(
                arg_0._topic_name,
                arg_0._subscription_name,
                arg_0.broker_properties['SequenceNumber'],
                arg_0.broker_properties['LockToken'])
        else:
            raise AzureServiceBusPeekLockError(_ERROR_MESSAGE_NOT_PEEK_LOCKED_ON_UNLOCK)

Unlocks itself if find queue name or topic name and subscription name .


def Func(arg_0, arg_1):
        """Parse a bowtie log file.

        This is a bowtie log parsing method that populates the
        :py:attr:`self.n_reads, self.align_0x, self.align_1x, self.align_mt1x and self.overall_rate` attributes with
        data from the log file.

        Disclamer: THIS METHOD IS HORRIBLE BECAUSE THE BOWTIE LOG IS HORRIBLE.

        The insertion of data on the attribytes is done by the
        :py:meth:`set_attribute method.

        Parameters
        ----------
        bowtie_log : str
            Path to the boetie log file.

       """

        print("is here!")

        # Regexes - thanks to https://github.com/ewels/MultiQC/blob/master/multiqc/modules/bowtie2/bowtie2.py
        arg_2 = {
            'unpaired': {
                'unpaired_aligned_none': r"(\\d+) \\([\\d\\.]+%\\) aligned 0 times",
                'unpaired_aligned_one': r"(\\d+) \\([\\d\\.]+%\\) aligned exactly 1 time",
                'unpaired_aligned_multi': r"(\\d+) \\([\\d\\.]+%\\) aligned >1 times"
            },
            'paired': {
                'paired_aligned_none': r"(\\d+) \\([\\d\\.]+%\\) aligned concordantly 0 times",
                'paired_aligned_one': r"(\\d+) \\([\\d\\.]+%\\) aligned concordantly exactly 1 time",
                'paired_aligned_multi': r"(\\d+) \\([\\d\\.]+%\\) aligned concordantly >1 times",
                'paired_aligned_discord_one': r"(\\d+) \\([\\d\\.]+%\\) aligned discordantly 1 time",
                'paired_aligned_discord_multi': r"(\\d+) \\([\\d\\.]+%\\) aligned discordantly >1 times",
                'paired_aligned_mate_one': r"(\\d+) \\([\\d\\.]+%\\) aligned exactly 1 time",
                'paired_aligned_mate_multi': r"(\\d+) \\([\\d\\.]+%\\) aligned >1 times",
                'paired_aligned_mate_none': r"(\\d+) \\([\\d\\.]+%\\) aligned 0 times"
            }
        }

        #Missing parser for unpaired (not implemented in flowcraft yet)

        with open(arg_1, "r") as f:
            #Go through log file line by line
            for arg_3 in f:

                print(arg_3)

                #total reads
                arg_4 = re.search(r"(\\d+) reads; of these:", arg_3)
                print(arg_4)
                if arg_4:
                    print(arg_4)
                    arg_0.set_n_reads(arg_4.group(1))

                # Paired end reads aka the pain
                arg_5 = re.search(r"(\\d+) \\([\\d\\.]+%\\) were paired; of these:", arg_3)
                if arg_5:
                    arg_6 = int(arg_5.group(1))

                    arg_7 = {}

                    # Do nested loop whilst we have this level of indentation
                    arg_3 = f.readline()
                    while arg_3.startswith('    '):
                        for arg_8, arg_9 in arg_2['paired'].items():
                            arg_10 = re.search(arg_9, arg_3)
                            if arg_10:
                                arg_7[arg_8] = int(arg_10.group(1))
                        arg_3 = f.readline()

                    arg_11 = arg_7['paired_aligned_none'] + arg_7['paired_aligned_mate_none']
                    if arg_11:
                        arg_0.set_align_0x(arg_11)

                    arg_12 = arg_7['paired_aligned_one'] + arg_7['paired_aligned_mate_one']
                    if arg_12:
                        arg_0.set_align_1x(arg_12)

                    arg_13 = arg_7['paired_aligned_multi'] + arg_7['paired_aligned_mate_multi']
                    if arg_13:
                        arg_0.set_align_mt1x(arg_13)

                # Overall alignment rate
                arg_14 = re.search(r"([\\d\\.]+)% overall alignment rate", arg_3)
                if arg_14:
                    arg_0.overall_rate = float(arg_14.group(1))


def Func ( arg_0 , arg_1 ) : if not arg_0 . funcname : if arg_0 . line != arg_1 . f_lineno : return False return True if arg_1 . f_code . co_name != arg_0 . funcname : return False if not arg_0 . func_first_executable_line : arg_0 . func_first_executable_line = arg_1 . f_lineno if arg_0 . func_first_executable_line != arg_1 . f_lineno : return False return True

def Func(arg_0, arg_1):
    """Check whether we should break here because of `b.funcname`."""
    if not arg_0.funcname:
        # Breakpoint was set via line number.
        if arg_0.line != arg_1.f_lineno:
            # Breakpoint was set at a line with a def statement and the function
            # defined is called: don't break.
            return False
        return True

    # Breakpoint set via function name.

    if arg_1.f_code.co_name != arg_0.funcname:
        # It's not a function call, but rather execution of def statement.
        return False

    # We are in the right frame.
    if not arg_0.func_first_executable_line:
        # The function is entered for the 1st time.
        arg_0.func_first_executable_line = arg_1.f_lineno

    if arg_0.func_first_executable_line != arg_1.f_lineno:
        # But we are not at the first line number: don't break.
        return False
    return True

Check whether we should break here because of b . funcname .


def Func(arg_0, arg_1, arg_2):
        """Define a new alias after validating it.

        This will raise an :exc:`AliasError` if there are validation
        problems.
        """
        arg_3 = arg_0.validate_alias(arg_1, arg_2)
        arg_0.alias_table[arg_1] = (arg_3, arg_2)

Define a new alias after validating it .


def
Func
(
arg_0
,
arg_1
)
:
if
os
.
path
.
isabs
(
arg_1
)
:
raise
ValueError
(
"paths must be relative"
)
arg_2
=
os
.
path
.
abspath
(
arg_0
)
arg_3
=
os
.
path
.
normpath
(
os
.
path
.
join
(
arg_2
,
arg_1
)
)
arg_4
=
os
.
path
.
normcase
(
arg_2
)
arg_5
=
os
.
path
.
normcase
(
arg_3
)
if
os
.
path
.
commonprefix
(
[
arg_4
,
arg_5
]
)
!=
arg_4
:
raise
ValueError
(
"paths must be inside source tree"
)
return
arg_3

def Func(arg_0, arg_1):
    """Normalise and check a backend path.

    Ensure that the requested backend path is specified as a relative path,
    and resolves to a location under the given source tree.

    Return an absolute version of the requested path.
    """
    if os.path.isabs(arg_1):
        raise ValueError("paths must be relative")

    arg_2 = os.path.abspath(arg_0)
    arg_3 = os.path.normpath(os.path.join(arg_2, arg_1))
    # We have to use commonprefix for Python 2.7 compatibility. So we
    # normalise case to avoid problems because commonprefix is a character
    # based comparison :-(
    arg_4 = os.path.normcase(arg_2)
    arg_5 = os.path.normcase(arg_3)
    if os.path.commonprefix([arg_4, arg_5]) != arg_4:
        raise ValueError("paths must be inside source tree")

    return arg_3


(
    log_f,
    log_p,
    sampling_dist_q,
    z=None,
    n=None,
    seed=None,
    name='expectation_importance_sampler_logspace')

def Func(
    arg_0,
    arg_1,
    arg_2,
    arg_3=None,
    arg_4=None,
    arg_5=None,
    arg_6='Func'):
  r"""Importance sampling with a positive function, in log-space.

  With \\(p(z) := exp^{log_p(z)}\\), and \\(f(z) = exp{log_f(z)}\\),
  this `Op` returns

  \\(Log[ n^{-1} sum_{i=1}^n [ f(z_i) p(z_i) / q(z_i) ] ],  z_i ~ q,\\)
  \\(\approx Log[ E_q[ f(Z) p(Z) / q(Z) ] ]\\)
  \\(=       Log[E_p[f(Z)]]\\)

  This integral is done in log-space with max-subtraction to better handle the
  often extreme values that `f(z) p(z) / q(z)` can take on.

  In contrast to `expectation_importance_sampler`, this `Op` returns values in
  log-space.

  User supplies either `Tensor` of samples `z`, or number of samples to draw `n`

  Args:
    log_f: Callable mapping samples from `sampling_dist_q` to `Tensors` with
      shape broadcastable to `q.batch_shape`.
      For example, `log_f` works "just like" `sampling_dist_q.log_prob`.
    log_p:  Callable mapping samples from `sampling_dist_q` to `Tensors` with
      shape broadcastable to `q.batch_shape`.
      For example, `log_p` works "just like" `q.log_prob`.
    sampling_dist_q:  The sampling distribution.
      `tfp.distributions.Distribution`.
      `float64` `dtype` recommended.
      `log_p` and `q` should be supported on the same set.
    z:  `Tensor` of samples from `q`, produced by `q.sample` for some `n`.
    n:  Integer `Tensor`.  Number of samples to generate if `z` is not provided.
    seed:  Python integer to seed the random number generator.
    name:  A name to give this `Op`.

  Returns:
    Logarithm of the importance sampling estimate.  `Tensor` with `shape` equal
      to batch shape of `q`, and `dtype` = `q.dtype`.
  """
  arg_7 = arg_2
  with tf.name_scope(arg_6):
    arg_3 = _get_samples(arg_7, arg_3, arg_4, arg_5)
    arg_8 = arg_0(arg_3) + arg_1(arg_3) - arg_7.log_prob(arg_3)
    return _logspace_mean(arg_8)

r Importance sampling with a positive function in log - space .


def Func(arg_0, arg_1, arg_2=None):
        """Add install_req as a requirement to install.

        :param parent_req_name: The name of the requirement that needed this
            added. The name is used because when multiple unnamed requirements
            resolve to the same name, we could otherwise end up with dependency
            links that point outside the Requirements set. parent_req must
            already be added. Note that None implies that this is a user
            supplied requirement, vs an inferred one.
        :return: Additional requirements to scan. That is either [] if
            the requirement is not applicable, or [install_req] if the
            requirement is applicable and has just been added.
        """
        arg_3 = arg_1.name
        if not arg_1.match_markers():
            logger.warning("Ignoring %s: markers %r don't match your "
                           "environment", arg_1.name,
                           arg_1.markers)
            return []

        arg_1.as_egg = arg_0.as_egg
        arg_1.use_user_site = arg_0.use_user_site
        arg_1.target_dir = arg_0.target_dir
        arg_1.pycompile = arg_0.pycompile
        if not arg_3:
            # url or path requirement w/o an egg fragment
            arg_0.unnamed_requirements.append(arg_1)
            return [arg_1]
        else:
            if arg_2 is None and arg_0.has_requirement(arg_3):
                raise InstallationError(
                    'Double requirement given: %s (already in %s, name=%r)'
                    % (arg_1, arg_0.get_requirement(arg_3), arg_3))
            if not arg_0.has_requirement(arg_3):
                # Add requirement
                arg_0.requirements[arg_3] = arg_1
                # FIXME: what about other normalizations?  E.g., _ vs. -?
                if arg_3.lower() != arg_3:
                    arg_0.requirement_aliases[arg_3.lower()] = arg_3
                arg_11 = [arg_1]
            else:
                # Canonicalise to the already-added object
                arg_1 = arg_0.get_requirement(arg_3)
                # No need to scan, this is a duplicate requirement.
                arg_11 = []
            if arg_2:
                arg_12 = arg_0.get_requirement(arg_2)
                arg_0._dependencies[arg_12].append(arg_1)
            return arg_11

Add install_req as a requirement to install .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ X for X in arg_0 . vars if X != arg_1 ] arg_4 = dict ( ( event_values ( e , arg_3 ) , sum ( arg_0 . p ( extend ( e , arg_1 , val ) ) for val in arg_2 . variable_values ( arg_1 ) ) ) for e in all_events ( arg_3 , arg_2 , { } ) ) return Factor ( arg_3 , arg_4 )

def Func(arg_0, arg_1, arg_2):
        "Make a factor eliminating var by summing over its values."
        arg_3 = [X for X in arg_0.vars if X != arg_1]
        arg_4 = dict((event_values(e, arg_3),
                    sum(arg_0.p(extend(e, arg_1, val))
                        for val in arg_2.variable_values(arg_1)))
                   for e in all_events(arg_3, arg_2, {}))
        return Factor(arg_3, arg_4)

Make a factor eliminating var by summing over its values .


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
_year_info_pq
(
arg_1
,
'Defensive Coordinator'
)
(
'a'
)
if
arg_2
:
return
arg_2
.
attr
[
'href'
]
except
ValueError
:
return

def Func(arg_0, arg_1):
        """Returns the coach ID for the team's DC in a given year.

        :year: An int representing the year.
        :returns: A string containing the coach ID of the DC.
        """
        try:
            arg_2 = arg_0._year_info_pq(arg_1, 'Defensive Coordinator')('a')
            if arg_2:
                return arg_2.attr['href']
        except ValueError:
            return None

Returns the coach ID for the team s DC in a given year .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _find_directive ( lambda d : d . name == "rule" and d . args . get ( "name" ) == arg_1 . name ) if arg_2 : arg_3 = arg_2 . args else : arg_3 = { } arg_4 = arg_3 . get ( "transform" , "retype" ) if arg_4 == "retype" : arg_5 = arg_3 . get ( "to_type" , "TokenType.{0}" . format ( arg_1 . name ) ) return ".retyped({0})" . format ( arg_5 ) elif arg_4 == "compress" : arg_5 = arg_3 . get ( "to_type" , "TokenType.{0}" . format ( arg_1 . name ) ) if arg_5 == "identity" : return ".compressed()" else : return ".compressed({0})" . format ( arg_5 ) elif arg_4 == "identity" : return ""

def Func(arg_0, arg_1):
    """The return value for each rule can be either retyped, compressed or left alone. This method
    determines that and returns the source code text for accomplishing it.
    """
    arg_2 = arg_0._find_directive(lambda d: d.name == "rule" and d.args.get("name") == arg_1.name)

    if arg_2:
      arg_3 = arg_2.args
    else:
      arg_3 = {}

    arg_4 = arg_3.get("transform", "retype")

    if arg_4 == "retype":
      arg_5 = arg_3.get("to_type", "TokenType.{0}".format(arg_1.name))
      return ".retyped({0})".format(arg_5)
    elif arg_4 == "compress":
      arg_5 = arg_3.get("to_type", "TokenType.{0}".format(arg_1.name))
      if arg_5 == "identity":
        return ".compressed()"
      else:
        return ".compressed({0})".format(arg_5)
    elif arg_4 == "identity":
      return ""

The return value for each rule can be either retyped compressed or left alone . This method determines that and returns the source code text for accomplishing it .


def Func(arg_0, arg_1, arg_2):
        """
        Unlink user email from Enterprise Customer.

        If :class:`django.contrib.auth.models.User` instance with specified email does not exist,
        :class:`.PendingEnterpriseCustomerUser` instance is deleted instead.

        Raises EnterpriseCustomerUser.DoesNotExist if instance of :class:`django.contrib.auth.models.User` with
        specified email exists and corresponding :class:`.EnterpriseCustomerUser` instance does not.

        Raises PendingEnterpriseCustomerUser.DoesNotExist exception if instance of
        :class:`django.contrib.auth.models.User` with specified email exists and corresponding
        :class:`.PendingEnterpriseCustomerUser` instance does not.
        """
        try:
            arg_3 = User.objects.get(email=arg_2)
            # not capturing DoesNotExist intentionally to signal to view that link does not exist
            arg_4 = arg_0.get(arg_1=arg_1, user_id=arg_3.id)
            arg_4.delete()

            if update_user:
                # Remove the SailThru flags for enterprise learner.
                update_user.delay(
                    sailthru_vars={
                        'is_enterprise_learner': False,
                        'enterprise_name': None,
                    },
                    email=arg_2
                )

        except User.DoesNotExist:
            # not capturing DoesNotExist intentionally to signal to view that link does not exist
            arg_5 = PendingEnterpriseCustomerUser.objects.get(
                arg_1=arg_1, arg_2=arg_2
            )
            arg_5.delete()

        LOGGER.info(
            'Enterprise learner {%s} successfully unlinked from Enterprise Customer {%s}',
            arg_2,
            arg_1.name
        )

Unlink user email from Enterprise Customer .


The total score for the words found, according to the rules.

return sum([self.scores[len(w)] for w in self.words()])

def Func ( arg_0 ) : return sum ( [ arg_0 . Funcs [ len ( arg_1 ) ] for arg_1 in arg_0 . words ( ) ] )

def Func(arg_0):
        "The total Func for the words found, according to the rules."
        return sum([arg_0.Funcs[len(arg_1)] for arg_1 in arg_0.words()])

The total score for the words found according to the rules .


(self, data, results=None, mask=None, positions=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : arg_5 = arg_2 . last . unmasked_model_image arg_6 = arg_2 . last . constant . name_instance_tuples_for_class ( g . Galaxy ) arg_7 = copy . copy ( arg_2 . last ) for arg_8 , arg_9 in arg_6 : arg_10 = arg_0 . optimizer . copy_with_name_extension ( arg_8 ) arg_10 . variable . hyper_galaxy = g . HyperGalaxy arg_13 = arg_2 . last . unmasked_image_for_galaxy ( arg_9 ) arg_10 . fit ( arg_0 . __class__ . Analysis ( arg_1 , arg_5 , arg_13 ) ) arg_14 ( arg_7 . variable , arg_8 ) . hyper_galaxy = arg_10 . variable . hyper_galaxy arg_14 ( arg_7 . constant , arg_8 ) . hyper_galaxy = arg_10 . constant . hyper_galaxy return arg_7

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Run a fit for each galaxy from the previous phase.

        Parameters
        ----------
        data: LensData
        results: ResultsCollection
            Results from all previous phases
        mask: Mask
            The mask
        positions

        Returns
        -------
        results: HyperGalaxyResults
            A collection of results, with one item per a galaxy
        """
        arg_5 = arg_2.last.unmasked_model_image
        arg_6 = arg_2.last.constant.name_instance_tuples_for_class(g.Galaxy)

        arg_7 = copy.copy(arg_2.last)

        for arg_8, arg_9 in arg_6:
            arg_10 = arg_0.optimizer.copy_with_name_extension(arg_8)
            arg_10.variable.hyper_galaxy = g.HyperGalaxy
            arg_13 = arg_2.last.unmasked_image_for_galaxy(arg_9)
            arg_10.fit(arg_0.__class__.Analysis(arg_1, arg_5, arg_13))

            arg_14(arg_7.variable, arg_8).hyper_galaxy = arg_10.variable.hyper_galaxy
            arg_14(arg_7.constant, arg_8).hyper_galaxy = arg_10.constant.hyper_galaxy

        return arg_7

Run a fit for each galaxy from the previous phase .


def Func(arg_0, arg_1, arg_2, arg_3):
    """ Pull down tasks from forges and add them to your taskwarrior tasks.

    Relies on configuration in bugwarriorrc
    """

    try:
        arg_4 = _get_section_name(arg_1)
        arg_5 = _try_load_config(arg_4, arg_2)

        arg_6 = os.path.join(get_data_path(arg_5, arg_4),
                                     'bugwarrior.lockfile')
        arg_7 = PIDLockFile(arg_6)
        arg_7.acquire(timeout=10)
        try:
            # Get all the issues.  This can take a while.
            arg_8 = aggregate_issues(arg_5, arg_4, arg_3)

            # Stuff them in the taskwarrior db as necessary
            synchronize(arg_8, arg_5, arg_4, arg_0)
        finally:
            arg_7.release()
    except LockTimeout:
        log.critical(
            'Your taskrc repository is currently locked. '
            'Remove the file at %s if you are sure no other '
            'bugwarrior processes are currently running.' % (
                arg_6
            )
        )
    except RuntimeError as e:
        log.exception("Aborted (%s)" % e)

Pull down tasks from forges and add them to your taskwarrior tasks .


(self, copy_source, bucket, key, extra_args=None,
             subscribers=None, source_client=None)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None,
             arg_5=None, arg_6=None):
        """Copies a file in S3

        :type Func_source: dict
        :param Func_source: The name of the source bucket, key name of the
            source object, and optional version ID of the source object. The
            dictionary format is:
            ``{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}``. Note
            that the ``VersionId`` key is optional and may be omitted.

        :type bucket: str
        :param bucket: The name of the bucket to Func to

        :type key: str
        :param key: The name of the key to Func to

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

        :type subscribers: a list of subscribers
        :param subscribers: The list of subscribers to be invoked in the
            order provided based on the event emit during the process of
            the transfer request.

        :type source_client: botocore or boto3 Client
        :param source_client: The client to be used for operation that
            may happen at the source object. For example, this client is
            used for the head_object that determines the size of the Func.
            If no client is provided, the transfer manager's client is used
            as the client for the source object.

        :rtype: s3transfer.futures.TransferFuture
        :returns: Transfer future representing the Func
        """
        if arg_4 is None:
            arg_4 = {}
        if arg_5 is None:
            arg_5 = []
        if arg_6 is None:
            arg_6 = arg_0._client
        arg_0._validate_all_known_args(arg_4, arg_0.ALLOWED_COPY_ARGS)
        arg_7 = CallArgs(
            arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
            arg_4=arg_4, arg_5=arg_5,
            arg_6=arg_6
        )
        return arg_0._submit_transfer(arg_7, CopySubmissionTask)

Copies a file in S3

        :type copy_source: dict
        :param copy_source: The name of the source bucket, key name of the
            source object, and optional version ID of the source object. The
            dictionary format is:
            ``{'Bucket': 'bucket', 'Key': 'key', 'VersionId': 'id'}``. Note
            that the ``VersionId`` key is optional and may be omitted.

        :type bucket: str
        :param bucket: The name of the bucket to copy to

        :type key: str
        :param key: The name of the key to copy to

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

        :type subscribers: a list of subscribers
        :param subscribers: The list of subscribers to be invoked in the
            order provided based on the event emit during the process of
            the transfer request.

        :type source_client: botocore or boto3 Client
        :param source_client: The client to be used for operation that
            may happen at the source object. For example, this client is
            used for the head_object that determines the size of the copy.
            If no client is provided, the transfer manager's client is used
            as the client for the source object.

        :rtype: s3transfer.futures.TransferFuture
        :returns: Transfer future representing the copy


def Func ( arg_0 ) : for arg_1 in list ( arg_0 . _internal ) : arg_0 . _internal . remove ( arg_1 )

def Func(arg_0):
        """Clear all keys from the comment."""

        for arg_1 in list(arg_0._internal):
            arg_0._internal.remove(arg_1)


def
Func
(
arg_0
,
arg_1
)
:
log
.
debug
(
'reading chunk'
)
arg_2
=
arg_0
.
_port
.
timeout
if
SYSTEM
!=
'Windows'
:
if
arg_0
.
_port
.
timeout
!=
MINIMAL_TIMEOUT
:
arg_0
.
_port
.
timeout
=
MINIMAL_TIMEOUT
arg_5
=
time
.
time
(
)
+
arg_2
while
len
(
arg_1
)
<
130
and
time
.
time
(
)
<=
arg_5
:
arg_1
=
arg_1
+
arg_0
.
_port
.
read
(
)
if
arg_1
[
0
]
!=
BLOCK_START
or
len
(
arg_1
)
<
130
:
log
.
debug
(
'buffer binary: %s '
,
hexify
(
arg_1
)
)
raise
Exception
(
'Bad blocksize or start byte'
)
if
SYSTEM
!=
'Windows'
:
arg_0
.
_port
.
timeout
=
arg_2
arg_6
=
ord
(
arg_1
[
1
]
)
arg_7
=
arg_1
[
2
:
arg_6
+
2
]
arg_1
=
arg_1
[
130
:
]
return
(
arg_7
,
arg_1
)

def Func(arg_0, arg_1):
        """Read a chunk of data"""
        log.debug('reading chunk')
        arg_2 = arg_0._port.timeout
        if SYSTEM != 'Windows':
            # Checking for new data every 100us is fast enough
            if arg_0._port.timeout != MINIMAL_TIMEOUT:
                arg_0._port.timeout = MINIMAL_TIMEOUT

        arg_5 = time.time() + arg_2

        while len(arg_1) < 130 and time.time() <= arg_5:
            arg_1 = arg_1 + arg_0._port.read()

        if arg_1[0] != BLOCK_START or len(arg_1) < 130:
            log.debug('buffer binary: %s ', hexify(arg_1))
            raise Exception('Bad blocksize or start byte')

        if SYSTEM != 'Windows':
            arg_0._port.timeout = arg_2

        arg_6 = ord(arg_1[1])
        arg_7 = arg_1[2:arg_6+2]
        arg_1 = arg_1[130:]
        return (arg_7, arg_1)


def Func ( arg_0 ) : arg_1 = arg_0 . name if arg_1 . endswith ( '/' ) : arg_1 = arg_1 . split ( '/' ) [ - 2 ] arg_2 = arg_1 . split ( '_' ) if arg_2 [ - 1 ] . isdigit ( ) : arg_1 = '_' . join ( arg_2 [ : - 1 ] ) return arg_1

def Func(arg_0):
  """Infer the original name passed into a distribution constructor.

  Distributions typically follow the pattern of
  with.name_scope(name) as name:
    super(name=name)
  so we attempt to reverse the name-scope transformation to allow
  addressing of RVs by the distribution's original, user-visible
  name kwarg.

  Args:
    distribution: a tfd.Distribution instance.
  Returns:
    simple_name: the original name passed into the Distribution.

  #### Example

  ```
  d1 = tfd.Normal(0., 1., name='x') # d1.name = 'x/'
  d2 = tfd.Normal(0., 1., name='x') # d2.name = 'x_2/'
  Func(d2) # returns 'x'

  ```

  """
  arg_1 = arg_0.name

  # turn 'scope/x/' into 'x'
  if arg_1.endswith('/'):
    arg_1 = arg_1.split('/')[-2]

  # turn 'x_3' into 'x'
  arg_2 = arg_1.split('_')
  if arg_2[-1].isdigit():
    arg_1 = '_'.join(arg_2[:-1])

  return arg_1

Infer the original name passed into a distribution constructor.

  Distributions typically follow the pattern of
  with.name_scope(name) as name:
    super(name=name)
  so we attempt to reverse the name-scope transformation to allow
  addressing of RVs by the distribution's original, user-visible
  name kwarg.

  Args:
    distribution: a tfd.Distribution instance.
  Returns:
    simple_name: the original name passed into the Distribution.

  #### Example

  ```
  d1 = tfd.Normal(0., 1., name='x') # d1.name = 'x/'
  d2 = tfd.Normal(0., 1., name='x') # d2.name = 'x_2/'
  _simple_name(d2) # returns 'x'

  ```

Infer the original name passed into a distribution constructor .


def Func(arg_0, arg_1):
    """
    Adds a organization-course link to the system
    """
    _validate_course_key(arg_1)
    _validate_organization_data(arg_0)
    data.create_organization_course(
        organization=arg_0,
        arg_1=arg_1
    )

Adds a organization - course link to the system


def
Func
(
arg_0
,
arg_1
)
:
global
arg_4
arg_2
=
create_title
(
arg_0
)
arg_3
=
'"{0}"'
.
format
(
stream_to_url
(
arg_1
)
)
arg_4
=
PlayerOutput
(
args
.
player
,
args
=
args
.
player_args
,
arg_3
=
arg_3
,
call
=
True
,
quiet
=
not
args
.
verbose_player
,
arg_2
=
arg_2
)
try
:
log
.
info
(
"Starting player: {0}"
,
args
.
player
)
arg_4
.
open
(
)
except
OSError
as
err
:
console
.
exit
(
"Failed to start player: {0} ({1})"
,
args
.
player
,
err
)
return
False
return
True

def Func(arg_0, arg_1):
    """Prepares a filename to be passed to the player."""
    global arg_4

    arg_2 = create_title(arg_0)
    arg_3 = '"{0}"'.format(stream_to_url(arg_1))
    arg_4 = PlayerOutput(args.player, args=args.player_args,
                          arg_3=arg_3, call=True,
                          quiet=not args.verbose_player,
                          arg_2=arg_2)

    try:
        log.info("Starting player: {0}", args.player)
        arg_4.open()
    except OSError as err:
        console.exit("Failed to start player: {0} ({1})", args.player, err)
        return False

    return True

Prepares a filename to be passed to the player .


def Func ( arg_0 , arg_1 , arg_2 = False ) : if arg_2 : arg_3 = arg_0 . _item_dict . get ( arg_1 ) return arg_3 . name if arg_3 else arg_1 return arg_0 . _item_dict [ arg_1 ] . name

def Func(arg_0, arg_1, arg_2=False):
        """Returns the label for a given Enum key"""
        if arg_2:
            arg_3 = arg_0._item_dict.get(arg_1)
            return arg_3.name if arg_3 else arg_1
        return arg_0._item_dict[arg_1].name