(x, y, z, normalize=False, kfki=0.889,
        sigkf=0.1, zint=100., nkpts=3, dist_type='gaussian', wrap=True,
        **kwargs)

return hdet if normalize else hdet / hdet.sum()

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=0.889,
        arg_5=0.1, arg_6=100., arg_7=3, arg_8='gaussian', arg_9=True,
        **arg_10):
    """
    Calculates the point spread function of a line-scanning confocal with
    polydisperse dye emission.

    Make x,y,z  __1D__ numpy.arrays, with x the direction along the
    scan line. (to make the calculation faster since I dont' need the line
    ilm for each x).

    Parameters
    ----------
        x : numpy.ndarray
            _One_dimensional_ array of the x grid points (along the line
            illumination) at which to evaluate the psf. In units of
            1/k_incoming.
        y : numpy.ndarray
            _One_dimensional_ array of the y grid points (in plane,
            perpendicular to the line illumination) at which to evaluate
            the psf. In units of 1/k_incoming.
        z : numpy.ndarray
            _One_dimensional_ array of the z grid points (along the
            optical axis) at which to evaluate the psf. In units of
            1/k_incoming.
        normalize : Bool, optional
            Set to True to include the effects of PSF normalization on
            the image intensity. Default is False.
        kfki : Float, optional
            The mean of the ratio of the final light's wavevector to the
            incoming. Default is 0.889
        sigkf : Float, optional
            The standard deviation of the ratio of the final light's
            wavevector to the incoming. Default is 0.1
        zint : Float, optional
            The position of the optical interface, in units of 1/k_incoming
            Default is 100.
        dist_type : {`gaussian`, `gamma`}, optional
            The distribution of the outgoing light. If 'gaussian' the
            resulting k-values are taken in absolute value. Default
            is `gaussian`
        wrap : Bool, optional
            If True, wraps the psf calculation for speed, assuming that
            the input x, y are regularly-spaced points. If x,y are not
            regularly spaced then `wrap` must be set to False. Default is True.

    Other Parameters
    ----------------
        polar_angle : Float, optional
            The polarization angle of the light (radians) with respect to
            the line direction (x). Default is 0.
        alpha : Float
            The opening angle of the lens. Default is 1.
        n2n1 : Float
            The ratio of the index in the 2nd medium to that in the first.
            Default is 0.95

    Returns
    -------
        numpy.ndarray
            A 3D- numpy.array of the point-spread function. Indexing is
            psf[x,y,z]; shape is [x.size, y,size, z.size]
    Notes
    -----
        Neither distribution type is perfect. If sigkf/k0 is big (>0.5ish)
        then part of the Gaussian is negative. To avoid issues an abs() is
        taken, but then the actual mean and variance are not what is
        supplied. Conversely, if sigkf/k0 is small (<0.0815), then the
        requisite associated Laguerre quadrature becomes unstable. To
        prevent this sigkf/k0 is effectively clipped to be > 0.0815.
    """
    arg_11, arg_12 = get_polydisp_pts_wts(arg_4, arg_5, arg_8=arg_8,
            arg_7=arg_7)

    #0. Set up vecs
    if arg_9:
        arg_13 = vec_to_halfvec(arg_0)
        arg_14 = vec_to_halfvec(arg_1)
        arg_15, arg_16, arg_17 = np.meshgrid(arg_13, arg_14, arg_2, indexing='ij')
    else:
        arg_15,arg_16,arg_17 = np.meshgrid(arg_0, arg_1, arg_2, indexing='ij')
    arg_18 = np.sqrt(arg_15*arg_15 + arg_16*arg_16)

    #1. Hilm
    if arg_9:
        arg_19,arg_20 = np.meshgrid(arg_14, arg_2, indexing='ij')
        arg_21 = calculate_linescan_ilm_psf(arg_19, arg_20, arg_6=arg_6, **arg_10)
        if arg_14[0] == 0:
            arg_22 = np.append(arg_21[-1:0:-1], arg_21, axis=0)
        else:
            arg_22 = np.append(arg_21[::-1], arg_21, axis=0)
    else:
        arg_19,arg_20 = np.meshgrid(arg_1, arg_2, indexing='ij')
        arg_22 = calculate_linescan_ilm_psf(arg_19, arg_20, arg_6=arg_6, **arg_10)

    #2. Hdet
    if arg_9:
        #Lambda function that ignores its args but still returns correct values
        arg_23 = lambda arg_0,arg_1,arg_2, arg_4=1.: get_hsym_asym(arg_18*arg_4, arg_17*arg_4,
                arg_6=arg_4*arg_6, get_hdet=True, **arg_10)[0]
        arg_24 = lambda arg_4: wrap_and_calc_psf(arg_13,arg_14,arg_2, arg_23, arg_4=arg_4)
    else:
        arg_24 = lambda arg_4: get_hsym_asym(arg_18*arg_4, arg_17*arg_4,
                arg_6=arg_4*arg_6, get_hdet=True, **arg_10)[0]
    #####
    arg_25 = [arg_12[arg_27] * arg_24(arg_11[arg_27]) for arg_27 in range(arg_7)]
    arg_26 = np.sum(arg_25, axis=0)

    if arg_3:
        arg_22 /= arg_22.sum()
        arg_26 /= arg_26.sum()
    for arg_27 in range(arg_0.size):
        arg_26[arg_27] *= arg_22

    return arg_26 if arg_3 else arg_26 / arg_26.sum()

Calculates the point spread function of a line - scanning confocal with polydisperse dye emission .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . get_serializer ( arg_1 . user ) return Response ( arg_2 . data , status = status . HTTP_200_OK )

def Func(arg_0, arg_1):
        """
        Retrieve logged in user info
        """
        arg_2 = arg_0.get_serializer(arg_1.user)
        return Response(arg_2.data, status=status.HTTP_200_OK)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . split ( arg_1 ) arg_3 = [ len ( findall ( r'(?:^|[^"\\]|(?:\\\\|\\")+)(")' , part ) ) for part in arg_2 ] arg_4 = 0 for arg_5 , arg_6 in enumerate ( arg_3 ) : arg_4 += arg_6 if arg_4 % 2 == 0 : return arg_1 . join ( arg_2 [ : arg_5 + 1 ] ) . rstrip ( ) else : return arg_0 . rstrip ( )

def Func(arg_0, arg_1):
    """Strip comments from line string.
    """
    arg_2 = arg_0.split(arg_1)
    arg_3 = [len(findall(r'(?:^|[^"\\]|(?:\\\\|\\")+)(")', part))
              for part in arg_2]
    arg_4 = 0
    for arg_5, arg_6 in enumerate(arg_3):
        arg_4 += arg_6
        if arg_4 % 2 == 0:
            return arg_1.join(arg_2[:arg_5 + 1]).rstrip()
    else:  # pragma: no cover
        return arg_0.rstrip()


(
        cls, data_to_print, header_separator="-", column_separator=" "
    )

return [header_size % tuple(header_data)]

def Func(
        arg_0, arg_1, arg_2="-", arg_3=" "
    ):
        """
        Construct header of the table according to template.

        :param data_to_print:
            The list of data to print into the header of the table.
        :type data_to_print: list

        :param header_separator:
            The separator to use between the table header and our data.
        :type header_separator: str

        :param colomn_separator: The separator to use between each colomns.
        :type colomn_separator: str

        :return: The data to print in a list format.
        :rtype: list
        """

        # We initiate a variable which will save the header data.
        arg_4 = []

        # We initiate a variable which will save the header sizes.
        arg_5 = ""

        # We initiate the glue to set before the size.
        arg_6 = "%-"

        # We initiate the glue to set after the size.
        arg_7 = "s"

        if arg_2:
            # The header separator is not empty.

            # We initiate a variable which will save the list of
            # separator data.
            arg_8 = []

        # We get the length of the data to print.
        arg_9 = len(arg_1) - 1

        # We initiate an iterator.
        arg_10 = 0

        for arg_11 in arg_1:
            # We loop through the list of data.

            # We get the size of the currently read data.
            arg_12 = arg_1[arg_11]

            # We append the data to the header data list.
            arg_4.append(arg_11)

            # We construct the header size.
            # Note: our header size is formatted line %s-sizes
            # (the s at the end is part of the formatting.)
            arg_5 += arg_6 + str(arg_12) + arg_7

            if arg_10 < arg_9:
                # The iterator is less than the length of data to print.

                # We append the the colomn separator to the header size.
                arg_5 += arg_3

            if arg_2:
                # The header separator is given.

                # We append the right size of separator to the list of
                # separator data.
                arg_8.append(arg_2 * arg_12)

            # We increase the iterator.
            arg_10 += 1

        if arg_2:
            # The header separator is given.

            return [
                # We return the formatted header (like we will do with print('%s' % 'hello'))
                arg_5 % tuple(arg_4),
                # We return the formatted header separator.
                arg_5 % tuple(arg_8),
            ]

        # The header separator is not given.

        # We return the formetted header.
        return [arg_5 % tuple(arg_4)]

Construct header of the table according to template .


def Func(arg_0, arg_1, arg_2):
        """
        Extend a course with more details needed for the program landing page.

        In particular, we add the following:

        * `course_image_uri`
        * `course_title`
        * `course_level_type`
        * `course_short_description`
        * `course_full_description`
        * `course_effort`
        * `expected_learning_items`
        * `staff`
        """
        arg_3 = arg_0['course_runs'][0]['key']
        try:
            arg_4 = CourseCatalogApiServiceClient(arg_1.site)
        except ImproperlyConfigured:
            arg_5 = 'ENTPEV000'
            LOGGER.error(
                'CourseCatalogApiServiceClient is improperly configured. '
                'Returned error code {error_code} to user {userid} '
                'and enterprise_customer {enterprise_customer} '
                'for course_run_id {course_run_id}'.format(
                    arg_5=arg_5,
                    userid=arg_2.user.id,
                    arg_1=arg_1.uuid,
                    arg_3=arg_3,
                )
            )
            messages.add_generic_error_message_with_code(arg_2, arg_5)
            return ({}, arg_5)

        arg_6, arg_7 = arg_4.get_course_and_course_run(arg_3)
        if not arg_6 or not arg_7:
            arg_5 = 'ENTPEV001'
            LOGGER.error(
                'User {userid} of enterprise customer {enterprise_customer} encountered an error.'
                'No course_details or course_run_details found for '
                'course_run_id {course_run_id}. '
                'The following error code reported to the user: {error_code}'.format(
                    userid=arg_2.user.id,
                    arg_1=arg_1.uuid,
                    arg_3=arg_3,
                    arg_5=arg_5,
                )
            )
            messages.add_generic_error_message_with_code(arg_2, arg_5)
            return ({}, arg_5)

        arg_8 = arg_7['weeks_to_complete']
        arg_9 = arg_7['image'] or {}
        arg_0.update({
            'course_image_uri': arg_9.get('src', ''),
            'course_title': arg_7['title'],
            'course_level_type': arg_7.get('level_type', ''),
            'course_short_description': arg_7['short_description'] or '',
            'course_full_description': clean_html_for_template_rendering(arg_7['full_description'] or ''),
            'expected_learning_items': arg_6.get('expected_learning_items', []),
            'staff': arg_7.get('staff', []),
            'course_effort': ungettext_min_max(
                '{} hour per week',
                '{} hours per week',
                '{}-{} hours per week',
                arg_7['min_effort'] or None,
                arg_7['max_effort'] or None,
            ) or '',
            'weeks_to_complete': ungettext(
                '{} week',
                '{} weeks',
                arg_8
            ).format(arg_8) if arg_8 else '',
        })
        return arg_0, None

Extend a course with more details needed for the program landing page .


return DataSet(name="continuous xor", examples=examples)

def
Func
(
arg_0
)
:
arg_1
=
[
]
for
arg_2
in
range
(
arg_0
)
:
arg_3
,
arg_4
=
[
random
.
uniform
(
0.0
,
2.0
)
for
arg_2
in
'12'
]
arg_1
.
append
(
[
arg_3
,
arg_4
,
int
(
arg_3
)
!=
int
(
arg_4
)
]
)
return
DataSet
(
name
=
"continuous xor"
,
arg_1
=
arg_1
)

def Func(arg_0):
    "2 inputs are chosen uniformly from (0.0 .. 2.0]; output is xor of ints."
    arg_1 = []
    for arg_2 in range(arg_0):
        arg_3, arg_4 = [random.uniform(0.0, 2.0) for arg_2 in '12']
        arg_1.append([arg_3, arg_4, int(arg_3) != int(arg_4)])
    return DataSet(name="continuous xor", arg_1=arg_1)

2 inputs are chosen uniformly from ( 0 . 0 .. 2 . 0 ] ; output is xor of ints .


(current_state_parts,
                                       proposed_state_parts,
                                       current_volatility_parts,
                                       proposed_volatility_parts,
                                       current_drift_parts,
                                       proposed_drift_parts,
                                       step_size_parts,
                                       independent_chain_ndims,
                                       name=None)

def Func(arg_0,
                                       arg_1,
                                       arg_2,
                                       arg_3,
                                       arg_4,
                                       arg_5,
                                       arg_6,
                                       arg_7,
                                       arg_8=None):
  r"""Helper to `kernel` which computes the log acceptance-correction.

  Computes `log_acceptance_correction` as described in `MetropolisHastings`
  class. The proposal density is normal. More specifically,

   ```none
  q(proposed_state | current_state) \sim N(current_state + current_drift,
  step_size * current_volatility**2)

  q(current_state | proposed_state) \sim N(proposed_state + proposed_drift,
  step_size * proposed_volatility**2)
  ```

  The `log_acceptance_correction` is then

  ```none
  log_acceptance_correctio = q(current_state | proposed_state)
  - q(proposed_state | current_state)
  ```

  Args:
    current_state_parts: Python `list` of `Tensor`s representing the value(s) of
      the current state of the chain.
    proposed_state_parts:  Python `list` of `Tensor`s representing the value(s)
      of the proposed state of the chain. Must broadcast with the shape of
      `current_state_parts`.
    current_volatility_parts: Python `list` of `Tensor`s representing the value
      of `volatility_fn(*current_volatility_parts)`. Must broadcast with the
      shape of `current_state_parts`.
    proposed_volatility_parts: Python `list` of `Tensor`s representing the value
      of `volatility_fn(*proposed_volatility_parts)`. Must broadcast with the
      shape of `current_state_parts`
    current_drift_parts: Python `list` of `Tensor`s representing value of the
      drift `_get_drift(*current_state_parts, ..)`. Must broadcast with the
      shape of `current_state_parts`.
    proposed_drift_parts: Python `list` of `Tensor`s representing value of the
      drift `_get_drift(*proposed_drift_parts, ..)`. Must broadcast with the
      shape of `current_state_parts`.
    step_size_parts: Python `list` of `Tensor`s representing the step size for
      Euler-Maruyama method. Must broadcast with the shape of
      `current_state_parts`.
    independent_chain_ndims: Scalar `int` `Tensor` representing the number of
      leftmost `Tensor` dimensions which index independent chains.
    name: Python `str` name prefixed to Ops created by this function.
      Default value: `None` (i.e., 'compute_log_acceptance_correction').

  Returns:
    log_acceptance_correction: `Tensor` representing the `log`
      acceptance-correction.  (See docstring for mathematical definition.)
  """

  with tf.compat.v1.name_scope(arg_8, 'compute_log_acceptance_correction', [
      arg_0, arg_1, arg_2,
      arg_3, arg_4, arg_5,
      arg_6, arg_7
  ]):

    arg_9 = []
    arg_10 = []

    for [
        arg_11,
        arg_12,
        arg_13,
        arg_14,
        arg_15,
        arg_16,
        arg_17,
    ] in zip(
        arg_0,
        arg_1,
        arg_2,
        arg_3,
        arg_4,
        arg_5,
        arg_6,
    ):
      arg_18 = tf.range(arg_7, tf.rank(arg_11))

      arg_19 = arg_12 - arg_11

      arg_13 *= tf.sqrt(arg_17)

      arg_20 = (arg_19 - arg_15) / arg_13

      arg_14 *= tf.sqrt(arg_17)
      # Compute part of `q(proposed_state | current_state)`
      arg_20 = (
          tf.reduce_sum(
              input_tensor=mcmc_util.safe_sum(
                  [tf.math.log(arg_13),
                   0.5 * (arg_20**2)]),
              arg_18=arg_18))
      arg_9.append(-arg_20)

      # Compute part of `q(current_state | proposed_state)`
      arg_21 = (arg_19 + arg_16) / arg_14
      arg_21 = (
          tf.reduce_sum(
              input_tensor=mcmc_util.safe_sum(
                  [tf.math.log(arg_14), 0.5 * (arg_21**2)]),
              arg_18=arg_18))
      arg_10.append(-arg_21)

    # Compute `q(proposed_state | current_state)`
    arg_22 = tf.reduce_sum(
        input_tensor=tf.stack(arg_9, arg_18=-1), arg_18=-1)
    # Compute `q(current_state | proposed_state)`
    arg_23 = tf.reduce_sum(
        input_tensor=tf.stack(arg_10, arg_18=-1), arg_18=-1)

    return mcmc_util.safe_sum([arg_23,
                               -arg_22])

r Helper to kernel which computes the log acceptance - correction .


def Func ( arg_0 , arg_1 ) -> str : arg_2 = arg_0 . _get_model_field ( arg_1 ) return arg_0 . qn ( arg_2 . column )

def Func(arg_0, arg_1) -> str:
        """Formats a field's name for usage in SQL.

        Arguments:
            field_name:
                The field name to format.

        Returns:
            The specified field name formatted for
            usage in SQL.
        """

        arg_2 = arg_0._get_model_field(arg_1)
        return arg_0.qn(arg_2.column)

Formats a field s name for usage in SQL .


def Func(arg_0, arg_1):
        """
        Creates a normal matrix from modelview matrix

        Args:
            modelview: The modelview matrix

        Returns:
            A 3x3 Normal matrix as a :py:class:`numpy.array`
        """
        arg_2 = Matrix33.from_matrix44(arg_1)
        arg_2 = arg_2.inverse
        arg_2 = arg_2.transpose()
        return arg_2


def Func(arg_0, arg_1):
        """
        get parent directory info of a file or directory from the Repository.

        :Parameters:
            #. relativePath (string): The relative to the repository path of the file or directory of which the parent directory info is requested.

        :Returns:
            #. info (None, dictionary): The directory information dictionary.
               If None, it means an error has occurred.
            #. error (string): The error message if any error occurred.
        """
        arg_1 = os.path.normpath(arg_1)
        # if root directory
        if arg_1 in ('','.'):
            return arg_0, "relativePath is empty pointing to the repostitory itself."
        # split path
        arg_2, arg_3 = os.path.split(arg_1)
        # get parent directory info
        return arg_0.get_directory_info(arg_2)

get parent directory info of a file or directory from the Repository .


def Func(arg_0, arg_1, arg_2):
        """Set some commonly used variables."""
        arg_0.wkday_not_today = '
' % (
            arg_0.cssclasses[arg_2])

        arg_0.wkday_today = (
            '
' % (
                arg_0.cssclasses[arg_2])
        )
        if URLS_NAMESPACE:
            arg_5 = '%s:day_list' % (URLS_NAMESPACE)
        else:
            arg_5 = 'day_list'

        arg_0.day_url = reverse(arg_5, args=(arg_0.yr, arg_0.mo, arg_1))
        arg_0.day = arg_1

        arg_0.anch = '%d' % (
            arg_0.day_url, arg_1
        )

        arg_0.end = '
	'


def Func ( arg_0 ) : arg_1 = time . time ( ) for arg_2 in arg_0 . jwts . keys ( ) : if ( arg_1 - arg_0 . jwts [ arg_2 ] ) > ( arg_0 . age * 2 ) : del arg_0 . jwts [ arg_2 ]

def Func(arg_0):
        """Run by housekeeper thread"""
        arg_1 = time.time()
        for arg_2 in arg_0.jwts.keys():
            if (arg_1 - arg_0.jwts[arg_2]) > (arg_0.age * 2):
                del arg_0.jwts[arg_2]


(adapter, genemap_lines, genes=None, hpo_disease_lines=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """Load the omim phenotypes into the database

    Parse the phenotypes from genemap2.txt and find the associated hpo terms
    from ALL_SOURCES_ALL_FREQUENCIES_diseases_to_genes_to_phenotypes.txt.

    Args:
        adapter(MongoAdapter)
        genemap_lines(iterable(str))
        genes(dict): Dictionary with all genes found in database
        hpo_disease_lines(iterable(str))

    """
    # Get a map with hgnc symbols to hgnc ids from scout
    if not arg_2:
        arg_2 = arg_0.genes_by_alias()

    # Fetch the disease terms from omim
    arg_4 = get_mim_phenotypes(arg_1=arg_1)

    if not arg_3:
        arg_3 = fetch_hpo_phenotype_to_terms()
    arg_5 = parse_hpo_diseases(arg_3)

    arg_6 = datetime.now()
    arg_7 = None

    LOG.info("Loading the hpo disease...")
    for arg_7, arg_8 in enumerate(arg_4):
        arg_9 = arg_4[arg_8]
        arg_10 = "OMIM:{0}".format(arg_8)

        if arg_10 in arg_5:
            arg_11 = arg_5[arg_10]['hpo_terms']
            if arg_11:
                arg_9['hpo_terms'] = arg_11
        arg_12 = build_disease_term(arg_9, arg_2)

        arg_0.load_disease_term(arg_12)

    LOG.info("Loading done. Nr of diseases loaded {0}".format(arg_7))
    LOG.info("Time to load diseases: {0}".format(datetime.now() - arg_6))


def Func(arg_0):
        """Enable MPSSE mode on the FTDI device."""
        # Reset MPSSE by sending mask = 0 and mode = 0
        arg_0._check(ftdi.set_bitmode, 0, 0)
        # Enable MPSSE by sending mask = 0 and mode = 2
        arg_0._check(ftdi.set_bitmode, 0, 2)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
global
DEBUG
arg_4
=
" "
.
join
(
[
w
.
raw
for
w
in
arg_0
]
)
if
DEBUG
:
print
(
"sent:"
,
arg_4
)
for
arg_5
in
arg_3
(
arg_4
)
.
ents
:
if
DEBUG
:
print
(
"NER:"
,
arg_5
.
label_
,
arg_5
.
text
)
if
(
arg_5
.
label_
not
in
[
"CARDINAL"
]
)
and
(
arg_5
.
text
.
lower
(
)
not
in
arg_2
)
:
arg_6
,
arg_7
=
find_entity
(
arg_0
,
arg_1
,
arg_5
.
text
.
split
(
" "
)
,
0
)
if
arg_6
and
arg_7
:
arg_8
=
RankedLexeme
(
text
=
arg_5
.
text
.
lower
(
)
,
rank
=
arg_6
,
ids
=
arg_7
,
pos
=
"np"
,
count
=
1
)
if
DEBUG
:
print
(
arg_8
)
yield
arg_8

def Func (arg_0, arg_1, arg_2, arg_3):
    """
    iterator for collecting the named-entities
    """
    global DEBUG
    arg_4 = " ".join([w.raw for w in arg_0])

    if DEBUG:
        print("sent:", arg_4)

    for arg_5 in arg_3(arg_4).ents:
        if DEBUG:
            print("NER:", arg_5.label_, arg_5.text)

        if (arg_5.label_ not in ["CARDINAL"]) and (arg_5.text.lower() not in arg_2):
            arg_6, arg_7 = find_entity(arg_0, arg_1, arg_5.text.split(" "), 0)

            if arg_6 and arg_7:
                arg_8 = RankedLexeme(text=arg_5.text.lower(), rank=arg_6, ids=arg_7, pos="np", count=1)

                if DEBUG:
                    print(arg_8)

                yield arg_8

iterator for collecting the named - entities


def Func ( arg_0 , arg_1 = None ) : global arg_2 if not arg_2 : arg_2 = DeepcutTokenizer ( ) return arg_2 . Func ( arg_0 , arg_1 = arg_1 )

def Func(arg_0, arg_1=None):
    """
    Tokenize given Thai text string

    Input
    =====
    text: str, Thai text string
    custom_dict: str (or list), path to customized dictionary file
        It allows the function not to Func given dictionary wrongly.
        The file should contain custom words separated by line.
        Alternatively, you can provide list of custom words too.

    Output
    ======
    tokens: list, list of Funcd words

    Example
    =======
    >> deepcut.Func('ตัดคำได้ดีมาก')
    >> ['ตัดคำ','ได้','ดี','มาก']

    """
    global arg_2
    if not arg_2:
        arg_2 = DeepcutTokenizer()
    return arg_2.Func(arg_0, arg_1=arg_1)

Tokenize given Thai text string

    Input
    =====
    text: str, Thai text string
    custom_dict: str (or list), path to customized dictionary file
        It allows the function not to tokenize given dictionary wrongly.
        The file should contain custom words separated by line.
        Alternatively, you can provide list of custom words too.

    Output
    ======
    tokens: list, list of tokenized words

    Example
    =======
    >> deepcut.tokenize('ตัดคำได้ดีมาก')
    >> ['ตัดคำ','ได้','ดี','มาก']


def Func ( arg_0 , arg_1 = 0 , arg_2 = None , arg_3 = 1 ) : if arg_2 == None : arg_2 = len ( arg_0 ) arg_4 = lambda i : arg_0 [ i ] return map ( arg_4 , xrange ( arg_1 , arg_2 , arg_3 ) )

def Func(arg_0, arg_1=0, arg_2=None, arg_3=1):
    """Get a slice of a sequence with variable step. Specify start,stop,step."""
    if arg_2 == None:
        arg_2 = len(arg_0)
    arg_4 = lambda i: arg_0[i]
    return map(arg_4,xrange(arg_1,arg_2,arg_3))

Get a slice of a sequence with variable step . Specify start stop step .


Wait for x seconds
            each wait command is 100ms

def Func ( arg_0 , arg_1 = 0.1 ) : arg_1 = max ( arg_1 , 0 ) arg_2 = int ( floor ( arg_1 / 0.1 ) ) arg_3 = [ ] for arg_4 in range ( 0 , arg_2 ) : arg_3 . append ( Command ( 0x00 , Func = True ) ) return tuple ( arg_3 )

def Func(arg_0, arg_1=0.1):
        """ Wait for x seconds
            each Func command is 100ms """
        arg_1 = max(arg_1, 0)
        arg_2 = int(floor(arg_1 / 0.1))
        arg_3 = []
        for arg_4 in range(0, arg_2):
            arg_3.append(Command(0x00, Func=True))
        return tuple(arg_3)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ( ( arg_1 , arg_2 ) , ( arg_1 , None ) , ( None , arg_2 ) , ( None , None ) ) arg_4 = set ( ) for arg_5 in arg_3 : arg_4 . update ( arg_0 . observers . get ( arg_5 , set ( ) ) ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """Find all registered observers that should recieve notification"""

        arg_3 = (
                   (arg_1,arg_2),
                   (arg_1, None),
                   (None, arg_2),
                   (None,None)
               )

        arg_4 = set()
        for arg_5 in arg_3:
            arg_4.update(arg_0.observers.get(arg_5, set()))

        return arg_4


Returns only the first result from the query, if any.

def Func(arg_0):
        '''
        Returns only the Func result from the query, if any.
        '''
        arg_1 = [0, 1]
        if arg_0._limit:
            arg_1[0] = arg_0._limit[0]
        if not arg_0._filters and not arg_0._order_by:
            for arg_2 in arg_0:
                return arg_2
            return None
        arg_3 = arg_0.limit(*arg_1)._search()
        if arg_3:
            return arg_0._model.get(arg_3[0])
        return None

Returns only the first result from the query if any .


def
Func
(
arg_0
)
:
arg_1
=
getattr
(
settings
,
arg_0
)
secho
(
'%s: '
%
arg_0
,
fg
=
'magenta'
,
bold
=
True
,
nl
=
False
)
secho
(
six
.
text_type
(
arg_1
)
,
bold
=
True
,
fg
=
'white'
if
isinstance
(
arg_1
,
six
.
text_type
)
else
'cyan'
,
)

def Func(arg_0):
    """Echo a setting to the CLI."""
    arg_1 = getattr(settings, arg_0)
    secho('%s: ' % arg_0, fg='magenta', bold=True, nl=False)
    secho(
        six.text_type(arg_1),
        bold=True,
        fg='white' if isinstance(arg_1, six.text_type) else 'cyan',
    )


def Func ( arg_0 , arg_1 , arg_2 ) : try : arg_3 = arg_0 . _get_object_handle ( arg_1 , arg_2 ) if arg_3 . AXOrientation == "AXHorizontalOrientation" : return 1 except : pass return 0

def Func(arg_0, arg_1, arg_2):
        """
        Verify scrollbar is horizontal

        @param window_name: Window name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to type in, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string

        @return: 1 on success.
        @rtype: integer
        """
        try:
            arg_3 = arg_0._get_object_handle(arg_1, arg_2)
            if arg_3.AXOrientation == "AXHorizontalOrientation":
                return 1
        except:
            pass
        return 0


def Func ( arg_0 , arg_1 ) : arg_2 = signal . sosfilt ( arg_0 . sos , arg_1 ) return arg_2

def Func(arg_0,arg_1):
        """
        Filter the signal using second-order sections
        """
        arg_2 = signal.sosfilt(arg_0.sos,arg_1)
        return arg_2

Filter the signal using second - order sections


def
Func
(
arg_0
,
arg_1
:
arg_2
)
->
list
:
if
not
isinstance
(
arg_1
,
arg_2
)
:
raise
Exception
(
"Take a TypeName as parameter not a %s"
%
type
(
arg_1
)
)
arg_3
=
[
]
for
arg_4
in
arg_1
.
components
:
if
arg_4
not
in
arg_0
.
resolution
:
raise
Exception
(
"Unknown type %s in a EvalCtx"
%
arg_4
)
arg_5
=
arg_0
.
resolution
[
arg_4
]
if
arg_5
is
not
:
arg_5
=
arg_5
(
)
.
show_name
(
)
else
:
arg_5
=
arg_4
arg_3
.
append
(
arg_5
)
return
arg_3

def Func(arg_0, arg_1: arg_2) -> list:
        """
        Use self.resolution to subsitute type_name.
        Allow to instanciate polymorphic type ?1, ?toto
        """
        if not isinstance(arg_1, arg_2):
            raise Exception("Take a TypeName as parameter not a %s"
                            % type(arg_1))
        arg_3 = []
        for arg_4 in arg_1.components:
            if arg_4 not in arg_0.resolution:
                raise Exception("Unknown type %s in a EvalCtx" % arg_4)
            arg_5 = arg_0.resolution[arg_4]
            if arg_5 is not None:
                arg_5 = arg_5().show_name()
            else:
                arg_5 = arg_4
            arg_3.append(arg_5)
        return arg_3

Use self . resolution to subsitute type_name . Allow to instanciate polymorphic type ?1 ?toto


def Func(arg_0: arg_1) -> arg_1:
    """Sampler decorator base method.

    Samplers are used for converting an continuous function to a discretized pulse.

    They operate on a function with the signature:
        `def f(times: np.ndarray, *args, **kwargs) -> np.ndarray`
    Where `times` is a numpy array of floats with length n_times and the output array
    is a complex numpy array with length n_times. The output of the decorator is an
    instance of `FunctionalPulse` with signature:
        `def g(duration: int, *args, **kwargs) -> SamplePulse`

    Note if your continuous pulse function outputs a `complex` scalar rather than a
    `np.ndarray`, you should first vectorize it before applying a Func.

    This class implements the Func boilerplate for the Func.

    Args:
        sample_function: A Func function to be decorated.
    """

    def generate_Func(arg_2: arg_1) -> arg_1:
        """Return a decorated Func function."""

        @functools.wraps(arg_2)
        def arg_8(arg_3: arg_4, *arg_5, **arg_6) -> commands.SamplePulse:
            """Replace the call to the continuous function with a call to the Func applied
            to the anlytic pulse function."""
            arg_7 = arg_0(arg_2, arg_3, *arg_5, **arg_6)
            return np.asarray(arg_7, dtype=np.complex_)

        # Update type annotations for wrapped continuous function to be discrete
        arg_8 = _update_annotations(arg_8)
        # Update docstring with that of the Func and include sampled function documentation.
        arg_8 = _update_docstring(arg_8, arg_0)
        # Unset wrapped to return base Func signature
        # but still get rest of benefits of wraps
        # such as __name__, __qualname__
        arg_8.__dict__.pop('__wrapped__')
        # wrap with functional pulse
        return commands.functional_pulse(arg_8)

    return generate_Func

Sampler decorator base method.

    Samplers are used for converting an continuous function to a discretized pulse.

    They operate on a function with the signature:
        `def f(times: np.ndarray, *args, **kwargs) -> np.ndarray`
    Where `times` is a numpy array of floats with length n_times and the output array
    is a complex numpy array with length n_times. The output of the decorator is an
    instance of `FunctionalPulse` with signature:
        `def g(duration: int, *args, **kwargs) -> SamplePulse`

    Note if your continuous pulse function outputs a `complex` scalar rather than a
    `np.ndarray`, you should first vectorize it before applying a sampler.

    This class implements the sampler boilerplate for the sampler.

    Args:
        sample_function: A sampler function to be decorated.


def Func ( arg_0 ) : arg_1 = PATHS [ 'PUBLISH' ] % arg_0 . id return arg_0 . api . post ( arg_1 = arg_1 )

def Func(arg_0):
    '''
      Immediately shares a single pending update and recalculates times for
      updates remaining in the queue.
    '''

    arg_1 = PATHS['PUBLISH'] % arg_0.id
    return arg_0.api.post(arg_1=arg_1)

Immediately shares a single pending update and recalculates times for updates remaining in the queue .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
try
:
arg_3
=
base64
.
b64decode
(
arg_0
)
if
arg_2
:
arg_4
=
StrIO
(
arg_3
)
return
arg_4
else
:
with
open
(
arg_1
,
'wb'
)
as
outfd
:
outfd
.
write
(
arg_3
)
if
os
.
path
.
exists
(
arg_1
)
:
return
arg_1
else
:
LOGERROR
(
'could not write output file: %s'
%
arg_1
)
return
except
Exception
as
e
:
LOGEXCEPTION
(
'failed while trying to convert '
'b64 string to file %s'
%
arg_1
)
return

def Func(arg_0, arg_1, arg_2=False):
    '''This converts the base64 encoded string to a file.

    Parameters
    ----------

    b64str : str
        A base64 encoded strin that is the output of `base64.b64encode`.

    outfpath : str
        The path to where the file will be written. This should include an
        appropriate extension for the file (e.g. a base64 encoded string that
        represents a PNG should have its `outfpath` end in a '.png') so the OS
        can open these files correctly.

    writetostrio : bool
        If this is True, will return a StringIO object with the binary stream
        decoded from the base64-encoded input string `b64str`. This can be
        useful to embed these into other files without having to write them to
        disk.

    Returns
    -------

    str or StringIO object
        If `writetostrio` is False, will return the output file's path as a
        str. If it is True, will return a StringIO object directly. If writing
        the file fails in either case, will return None.

    '''

    try:

        arg_3 = base64.b64decode(arg_0)

        # if we're writing back to a stringio object
        if arg_2:

            arg_4 = StrIO(arg_3)
            return arg_4

        # otherwise, we're writing to an actual file
        else:

            with open(arg_1,'wb') as outfd:
                outfd.write(arg_3)

            if os.path.exists(arg_1):
                return arg_1
            else:
                LOGERROR('could not write output file: %s' % arg_1)
                return None

    except Exception as e:

        LOGEXCEPTION('failed while trying to convert '
                     'b64 string to file %s' % arg_1)
        return None

This converts the base64 encoded string to a file .


(tomo_data, weights=None, trace=None, beta=None)

return __tomo_linear_inv(freqs, ops, weights, trace=trace)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : if arg_2 is None : arg_2 = 1. arg_4 = arg_0 [ 'data' ] arg_5 = arg_4 [ 0 ] [ 'circuit' ] . keys ( ) arg_6 = [ ] arg_7 = [ ] arg_8 = [ ] for arg_9 in arg_4 : for arg_10 in arg_5 : arg_6 . append ( arg_9 [ 'counts' ] [ arg_10 ] ) arg_7 . append ( arg_9 [ 'shots' ] ) arg_11 = arg_9 [ 'circuit' ] [ arg_10 ] arg_12 = __projector ( arg_11 [ 'meas' ] , arg_0 [ 'meas_basis' ] ) if 'prep' in arg_11 : arg_13 = __projector ( arg_11 [ 'prep' ] , arg_0 [ 'prep_basis' ] ) arg_12 = np . kron ( arg_13 . conj ( ) , arg_12 ) arg_8 . append ( arg_12 ) arg_6 = np . array ( arg_6 ) arg_7 = np . array ( arg_7 ) arg_14 = arg_6 / arg_7 if arg_1 is None : if arg_3 is None : arg_3 = 0.50922 arg_15 = len ( arg_5 ) arg_16 = ( arg_6 + arg_3 ) / ( arg_7 + arg_15 * arg_3 ) arg_1 = np . sqrt ( arg_7 / ( arg_16 * ( 1 - arg_16 ) ) ) return __tomo_linear_inv ( arg_14 , arg_8 , arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
    """
    Reconstruct a state from unconstrained least-squares fitting.

    Args:
        tomo_data (list[dict]): state or process tomography data.
        weights (list or array or None): weights to use for least squares
            fitting. The default is standard deviation from a binomial
            distribution.
        trace (float or None): trace of returned operator. The default is 1.
        beta (float or None): hedge parameter (>=0) for computing frequencies
            from zero-count data. The default value is 0.50922.

    Returns:
        numpy.array: A numpy array of the reconstructed operator.
    """
    if arg_2 is None:
        arg_2 = 1.  # default to unit trace

    arg_4 = arg_0['data']
    arg_5 = arg_4[0]['circuit'].keys()

    # Get counts and shots
    arg_6 = []
    arg_7 = []
    arg_8 = []
    for arg_9 in arg_4:
        for arg_10 in arg_5:
            arg_6.append(arg_9['counts'][arg_10])
            arg_7.append(arg_9['shots'])
            arg_11 = arg_9['circuit'][arg_10]
            arg_12 = __projector(arg_11['meas'], arg_0['meas_basis'])
            if 'prep' in arg_11:
                arg_13 = __projector(arg_11['prep'],
                                      arg_0['prep_basis'])
                arg_12 = np.kron(arg_13.conj(), arg_12)
            arg_8.append(arg_12)

    # Convert counts to frequencies
    arg_6 = np.array(arg_6)
    arg_7 = np.array(arg_7)
    arg_14 = arg_6 / arg_7

    # Use hedged frequencies to calculate least squares fitting weights
    if arg_1 is None:
        if arg_3 is None:
            arg_3 = 0.50922
        arg_15 = len(arg_5)
        arg_16 = (arg_6 + arg_3) / (arg_7 + arg_15 * arg_3)
        arg_1 = np.sqrt(arg_7 / (arg_16 * (1 - arg_16)))

    return __tomo_linear_inv(arg_14, arg_8, arg_1, arg_2=arg_2)

Reconstruct a state from unconstrained least - squares fitting .


Implements the missing_some operator for finding missing variables.

def Func(arg_0, arg_1, arg_2):
    """Implements the Func operator for finding missing variables."""
    if arg_1 < 1:
        return []
    arg_3 = 0
    arg_4 = object()
    arg_5 = []
    for arg_6 in arg_2:
        if get_var(arg_0, arg_6, arg_4) is arg_4:
            arg_5.append(arg_6)
        else:
            arg_3 += 1
            if arg_3 >= arg_1:
                return []
    return arg_5

Implements the missing_some operator for finding missing variables .


def Func(arg_0, arg_1):
    """
    Sets the autoDetectWaitRecords.
    """
    if not isinstance(arg_1, int):
      raise HTMPredictionModelInvalidArgument("Invalid argument type \'%s\'. WaitRecord "
        "must be a number." % (type(arg_1)))

    if len(arg_0.saved_states) > 0 and arg_1 < arg_0.saved_states[0].ROWID:
      raise HTMPredictionModelInvalidArgument("Invalid value. autoDetectWaitRecord value "
        "must be valid record within output stream. Current minimum ROWID in "
        "output stream is %d." % (arg_0.saved_states[0].ROWID))

    arg_0._autoDetectWaitRecords = arg_1

    # Update all the states in the classifier's cache
    for arg_3 in arg_0.saved_states:
      arg_0._updateState(arg_3)


def Func ( arg_0 ) : for arg_1 in arg_0 . args : copy_type_comment_to_annotation ( arg_1 ) if arg_0 . vararg : copy_type_comment_to_annotation ( arg_0 . vararg ) for arg_1 in arg_0 . kwonlyargs : copy_type_comment_to_annotation ( arg_1 ) if arg_0 . kwarg : copy_type_comment_to_annotation ( arg_0 . kwarg )

def Func(arg_0):
    """Copies argument type comments from the legacy long form to annotations
    in the entire function signature.
    """
    for arg_1 in arg_0.args:
        copy_type_comment_to_annotation(arg_1)

    if arg_0.vararg:
        copy_type_comment_to_annotation(arg_0.vararg)

    for arg_1 in arg_0.kwonlyargs:
        copy_type_comment_to_annotation(arg_1)

    if arg_0.kwarg:
        copy_type_comment_to_annotation(arg_0.kwarg)

Copies argument type comments from the legacy long form to annotations in the entire function signature .


def Func ( arg_0 , arg_1 ) : if arg_0 . _executing : arg_0 . _input_buffer_pending = arg_1 return arg_3 = arg_0 . _get_end_cursor ( ) arg_3 . beginEditBlock ( ) arg_3 . setPosition ( arg_0 . _prompt_pos , QtGui . QTextCursor . KeepAnchor ) arg_3 . removeSelectedText ( ) arg_0 . _insert_plain_text_into_buffer ( arg_0 . _get_prompt_cursor ( ) , arg_1 ) arg_3 . endEditBlock ( ) arg_0 . _control . moveCursor ( QtGui . QTextCursor . End )

def Func(arg_0, arg_1):
        """ Sets the text in the input buffer.

        If the console is currently executing, this call has no *immediate*
        effect. When the execution is finished, the input buffer will be updated
        appropriately.
        """
        # If we're executing, store the text for later.
        if arg_0._executing:
            arg_0._input_buffer_pending = arg_1
            return

        # Remove old text.
        arg_3 = arg_0._get_end_cursor()
        arg_3.beginEditBlock()
        arg_3.setPosition(arg_0._prompt_pos, QtGui.QTextCursor.KeepAnchor)
        arg_3.removeSelectedText()

        # Insert new text with continuation prompts.
        arg_0._insert_plain_text_into_buffer(arg_0._get_prompt_cursor(), arg_1)
        arg_3.endEditBlock()
        arg_0._control.moveCursor(QtGui.QTextCursor.End)


def Func(arg_0, arg_1, arg_2):
        """Visit named imports."""
        arg_0.newline(arg_1)
        arg_0.write('included_template = environment.get_template(')
        arg_0.visit(arg_1.template, arg_2)
        arg_0.write(', %r).' % arg_0.name)
        if arg_1.with_context:
            arg_0.write('make_module(context.parent, True)')
        else:
            arg_0.write('module')

        arg_3 = []
        arg_4 = []
        for arg_5 in arg_1.names:
            if isinstance(arg_5, tuple):
                arg_5, arg_6 = arg_5
            else:
                arg_6 = arg_5
            arg_0.writeline('l_%s = getattr(included_template, '
                           '%r, missing)' % (arg_6, arg_5))
            arg_0.writeline('if l_%s is missing:' % arg_6)
            arg_0.indent()
            arg_0.writeline('l_%s = environment.undefined(%r %% '
                           'included_template.__name__, '
                           'name=%r)' %
                           (arg_6, 'the template %%r (imported on %s) does '
                           'not export the requested name %s' % (
                                arg_0.position(arg_1),
                                repr(arg_5)
                           ), arg_5))
            arg_0.outdent()
            if arg_2.toplevel:
                arg_3.append(arg_6)
                if not arg_6.startswith('_'):
                    arg_4.append(arg_6)
            arg_2.assigned_names.add(arg_6)

        if arg_3:
            if len(arg_3) == 1:
                arg_5 = arg_3[0]
                arg_0.writeline('context.vars[%r] = l_%s' % (arg_5, arg_5))
            else:
                arg_0.writeline('context.vars.update({%s})' % ', '.join(
                    '%r: l_%s' % (arg_5, arg_5) for arg_5 in arg_3
                ))
        if arg_4:
            if len(arg_4) == 1:
                arg_0.writeline('context.exported_vars.discard(%r)' %
                               arg_4[0])
            else:
                arg_0.writeline('context.exported_vars.difference_'
                               'update((%s))' % ', '.join(imap(repr, arg_4)))


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        The standard lookAt method

        :param pos: current position
        :param target: target position to look at
        :param up: direction up
        """
        arg_4 = vector.normalise(arg_1 - arg_2)
        arg_5 = vector.normalise(vector3.cross(vector.normalise(arg_3), arg_4))
        arg_6 = vector3.cross(arg_4, arg_5)

        arg_7 = matrix44.create_identity()
        arg_7[3][0] = -arg_1.x
        arg_7[3][1] = -arg_1.y
        arg_7[3][2] = -arg_1.z

        arg_8 = matrix44.create_identity()
        arg_8[0][0] = arg_5[0]  # -- X
        arg_8[1][0] = arg_5[1]
        arg_8[2][0] = arg_5[2]
        arg_8[0][1] = arg_6[0]  # -- Y
        arg_8[1][1] = arg_6[1]
        arg_8[2][1] = arg_6[2]
        arg_8[0][2] = arg_4[0]  # -- Z
        arg_8[1][2] = arg_4[1]
        arg_8[2][2] = arg_4[2]

        return matrix44.multiply(arg_7, arg_8)


def Func ( arg_0 ) : arg_1 , arg_2 = arg_0 . fetch_published ( ) arg_3 = arg_2 . revisions [ arg_0 [ '_deposit' ] [ 'pid' ] [ 'revision_id' ] ] arg_4 = [ arg_3 . dumps ( ) , arg_2 . dumps ( ) , arg_0 . dumps ( ) ] for arg_5 in arg_4 : del arg_5 [ '$schema' ] , arg_5 [ '_deposit' ] arg_4 . append ( { } ) arg_6 = Merger ( * arg_4 ) try : arg_6 . run ( ) except UnresolvedConflictsException : raise MergeConflict ( ) return patch ( arg_6 . unified_patches , arg_3 )

def Func(arg_0):
        """Merge changes with latest published version."""
        arg_1, arg_2 = arg_0.fetch_published()
        arg_3 = arg_2.revisions[arg_0['_deposit']['pid']['revision_id']]
        # ignore _deposit and $schema field
        arg_4 = [arg_3.dumps(), arg_2.dumps(), arg_0.dumps()]
        for arg_5 in arg_4:
            del arg_5['$schema'], arg_5['_deposit']
        arg_4.append({})
        arg_6 = Merger(*arg_4)
        try:
            arg_6.run()
        except UnresolvedConflictsException:
            raise MergeConflict()
        return patch(arg_6.unified_patches, arg_3)

Merge changes with latest published version .


(self, url, payload, method='post', **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3='post', **arg_4):
        # type: (Text, Optional[Text], Text, dict) -> Response
        """
        Sends the actual HTTP request.

        Split into its own method so that it can be mocked during unit
        tests.
        """
        arg_4.setdefault(
            'timeout',
            arg_0.timeout if arg_0.timeout else get_default_timeout(),
        )

        if arg_0.authentication:
            arg_4.setdefault('auth', auth.HTTPBasicAuth(*arg_0.authentication))

        arg_0._log(
            level=DEBUG,

            message='Sending {method} to {url}: {payload!r}'.format(
                arg_3=arg_3,
                arg_2=arg_2,
                arg_1=arg_1,
            ),

            context={
                'request_method': arg_3,
                'request_kwargs': arg_4,
                'request_payload': arg_2,
                'request_url': arg_1,
            },
        )

        arg_5 = request(arg_3=arg_3, arg_1=arg_1, data=arg_2, **arg_4)

        arg_0._log(
            level=DEBUG,

            message='Receiving {method} from {url}: {response!r}'.format(
                arg_3=arg_3,
                arg_5=arg_5.content,
                arg_1=arg_1,
            ),

            context={
                'request_method': arg_3,
                'request_kwargs': arg_4,
                'request_payload': arg_2,
                'request_url': arg_1,

                'response_headers': arg_5.headers,
                'response_content': arg_5.content,
            },
        )

        return arg_5


def Func ( arg_0 ) : with arg_0 . open ( "file1" , resampling = "bilinear" ) as raster_file : if raster_file . is_empty ( ) : return "empty" arg_1 = raster_file . read ( ) return arg_1

def Func(arg_0):
    """
    Example process for testing.

    Inputs:
    -------
    file1
        raster file

    Parameters:
    -----------

    Output:
    -------
    np.ndarray
    """
    # Reading and writing data works like this:
    with arg_0.open("file1", resampling="bilinear") as raster_file:
        if raster_file.is_empty():
            return "empty"
            # This assures a transparent tile instead of a pink error tile
            # is returned when using mapchete serve.
        arg_1 = raster_file.read()
    return arg_1


wait until all event loops end and returns the results.

def Func(arg_0):
        """wait until all event loops Func and returns the results.

        """

        arg_1 = arg_0.communicationChannel.receive()

        if arg_0.nruns != len(arg_1):
            import logging
            arg_2 = logging.getLogger(__name__)
            # logger.setLevel(logging.DEBUG)
            arg_2.warning(
                'too few results received: {} results received, {} expected'.format(
                    len(arg_1),
                    arg_0.nruns
                ))

        return arg_1

wait until all event loops end and returns the results .


def Func ( arg_0 ) : arg_0 . shut_down_instance ( arg_0 . instances ) arg_0 . instances = [ ] try : arg_0 . client . delete_internet_gateway ( InternetGatewayId = arg_0 . internet_gateway ) arg_0 . internet_gateway = None arg_0 . client . delete_route_table ( RouteTableId = arg_0 . route_table ) arg_0 . route_table = None for arg_4 in list ( arg_0 . sn_ids ) : arg_0 . client . delete_subnet ( SubnetId = arg_4 ) arg_0 . sn_ids . remove ( arg_4 ) arg_0 . client . delete_security_group ( GroupId = arg_0 . sg_id ) arg_0 . sg_id = None arg_0 . client . delete_vpc ( VpcId = arg_0 . vpc_id ) arg_0 . vpc_id = None except Exception as e : logger . error ( "{}" . format ( e ) ) raise e arg_0 . show_summary ( ) os . remove ( arg_0 . config [ 'state_file_path' ] )

def Func(arg_0):
        """Teardown the EC2 infastructure.

        Terminate all EC2 instances, delete all subnets, delete security group, delete VPC,
        and reset all instance variables.
        """

        arg_0.shut_down_instance(arg_0.instances)
        arg_0.instances = []
        try:
            arg_0.client.delete_internet_gateway(InternetGatewayId=arg_0.internet_gateway)
            arg_0.internet_gateway = None
            arg_0.client.delete_route_table(RouteTableId=arg_0.route_table)
            arg_0.route_table = None
            for arg_4 in list(arg_0.sn_ids):
                # Cast to list ensures that this is a copy
                # Which is important because it means that
                # the length of the list won't change during iteration
                arg_0.client.delete_subnet(SubnetId=arg_4)
                arg_0.sn_ids.remove(arg_4)
            arg_0.client.delete_security_group(GroupId=arg_0.sg_id)
            arg_0.sg_id = None
            arg_0.client.delete_vpc(VpcId=arg_0.vpc_id)
            arg_0.vpc_id = None
        except Exception as e:
            logger.error("{}".format(e))
            raise e
        arg_0.show_summary()
        os.remove(arg_0.config['state_file_path'])


read_json reads in a json file and returns
       the data structure as dict.

def Func ( arg_0 , arg_1 = 'r' ) : with open ( arg_0 , arg_1 ) as filey : arg_2 = json . load ( filey ) return arg_2

def Func(arg_0, arg_1='r'):
    '''Func reads in a json file and returns
       the data structure as dict.
    '''
    with open(arg_0, arg_1) as filey:
        arg_2 = json.load(filey)
    return arg_2

read_json reads in a json file and returns the data structure as dict .


def
Func
(
arg_0
)
:
arg_0
.
start
(
test_connection
=
False
)
while
True
:
arg_1
,
arg_2
=
arg_0
.
_req_rep_retry
(
LockerServer
.
LOCK
)
arg_3
=
arg_1
.
split
(
LockerServer
.
DELIMITER
)
if
arg_3
[
0
]
==
LockerServer
.
GO
:
return
True
elif
arg_3
[
0
]
==
LockerServer
.
LOCK_ERROR
and
arg_2
>
0
:
arg_0
.
_logger
.
error
(
arg_1
+
'; Probably due to retry'
)
return
True
elif
arg_3
[
0
]
==
LockerServer
.
WAIT
:
time
.
sleep
(
arg_0
.
SLEEP
)
else
:
raise
RuntimeError
(
'Response `%s` not understood'
%
arg_3
)

def Func(arg_0):
        """Acquires lock and returns `True`

        Blocks until lock is available.

        """
        arg_0.start(test_connection=False)
        while True:
            arg_1, arg_2 = arg_0._req_rep_retry(LockerServer.LOCK)
            arg_3 = arg_1.split(LockerServer.DELIMITER)
            if arg_3[0] == LockerServer.GO:
                return True
            elif arg_3[0] == LockerServer.LOCK_ERROR and arg_2 > 0:
                # Message was sent but Server response was lost and we tried again
                arg_0._logger.error(arg_1 + '; Probably due to retry')
                return True
            elif arg_3[0] == LockerServer.WAIT:
                time.sleep(arg_0.SLEEP)
            else:
                raise RuntimeError('Response `%s` not understood' % arg_3)


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
GET
.
get
(
"status"
)
arg_2
=
arg_0
.
GET
.
get
(
"id"
)
if
arg_1
==
"200"
and
arg_2
:
arg_3
=
Video
(
)
arg_3
.
user
=
arg_0
.
user
arg_3
.
video_id
=
arg_2
arg_3
.
save
(
)
video_created
.
send
(
sender
=
arg_3
,
arg_3
=
arg_3
)
try
:
arg_5
=
settings
.
YOUTUBE_UPLOAD_REDIRECT_URL
except
AttributeError
:
arg_5
=
reverse
(
"django_youtube.views.video"
,
kwargs
=
{
"video_id"
:
arg_2
}
)
return
HttpResponseRedirect
(
arg_5
)
else
:
from
django
.
contrib
import
messages
messages
.
add_message
(
arg_0
,
messages
.
ERROR
,
_
(
'Upload failed, Please try again.'
)
)
return
HttpResponseRedirect
(
reverse
(
"django_youtube.views.upload"
)
)

def Func(arg_0):
    """
    The upload result page
    Youtube will redirect to this page after upload is finished
    Saves the video data and redirects to the next page

    Params:
        status: status of the upload (200 for success)
        id: id number of the video
    """
    arg_1 = arg_0.GET.get("status")
    arg_2 = arg_0.GET.get("id")

    if arg_1 == "200" and arg_2:
        # upload is successful

        # save the video entry
        arg_3 = Video()
        arg_3.user = arg_0.user
        arg_3.video_id = arg_2
        arg_3.save()

        # send a signal
        video_created.send(sender=arg_3, arg_3=arg_3)

        # Redirect to the video page or the specified page
        try:
            arg_5 = settings.YOUTUBE_UPLOAD_REDIRECT_URL
        except AttributeError:
            arg_5 = reverse(
                "django_youtube.views.video", kwargs={"video_id": arg_2})

        return HttpResponseRedirect(arg_5)
    else:
        # upload failed, redirect to upload page
        from django.contrib import messages
        messages.add_message(
            arg_0, messages.ERROR, _('Upload failed, Please try again.'))
        return HttpResponseRedirect(reverse("django_youtube.views.upload"))


def Func ( arg_0 , arg_1 ) : if not arg_1 : return [ [ 'line' , arg_2 + 1 , arg_3 ] for arg_2 , arg_3 in enumerate ( arg_0 ) ] arg_4 , arg_5 = [ ] , 0 for arg_6 , arg_7 in arg_1 : arg_4 . extend ( [ 'line' , arg_5 + arg_2 + 1 , arg_3 ] for arg_2 , arg_3 in enumerate ( arg_0 [ arg_5 : arg_6 ] ) ) if ( arg_4 and arg_4 [ - 1 ] [ 0 ] == 'skip' ) : arg_4 [ - 1 ] [ 1 ] += arg_7 else : arg_4 . append ( [ 'skip' , arg_7 ] ) arg_5 = arg_6 + arg_7 arg_4 . extend ( [ 'line' , arg_5 + arg_2 + 1 , arg_3 ] for arg_2 , arg_3 in enumerate ( arg_0 [ arg_5 : ] ) ) return arg_4

def Func(arg_0, arg_1):
        """Skips lines in src_code specified by skip map."""
        if not arg_1:
            return [['line', arg_2 + 1, arg_3] for arg_2, arg_3 in enumerate(arg_0)]
        arg_4, arg_5 = [], 0
        for arg_6, arg_7 in arg_1:
            arg_4.extend(
                ['line', arg_5 + arg_2 + 1, arg_3] for arg_2, arg_3 in enumerate(arg_0[arg_5:arg_6]))
            if (arg_4
                    and arg_4[-1][0] == 'skip'):  # Merge skips.
                arg_4[-1][1] += arg_7
            else:
                arg_4.append(['skip', arg_7])
            arg_5 = arg_6 + arg_7
        arg_4.extend(
            ['line', arg_5 + arg_2 + 1, arg_3] for arg_2, arg_3 in enumerate(arg_0[arg_5:]))
        return arg_4

Skips lines in src_code specified by skip map .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . doc if not arg_2 : return arg_3 = arg_1 . lineno + 1 for arg_4 , arg_5 in enumerate ( arg_2 . splitlines ( ) ) : arg_0 . _check_spelling ( "wrong-spelling-in-docstring" , arg_5 , arg_3 + arg_4 )

def Func(arg_0, arg_1):
        """check the node has any spelling errors"""
        arg_2 = arg_1.doc
        if not arg_2:
            return

        arg_3 = arg_1.lineno + 1

        # Go through lines of docstring
        for arg_4, arg_5 in enumerate(arg_2.splitlines()):
            arg_0._check_spelling("wrong-spelling-in-docstring", arg_5, arg_3 + arg_4)


def Func ( arg_0 , arg_1 ) : if arg_1 == arg_0 . SHUFFLE or arg_1 == arg_0 . ALL or arg_1 == arg_0 . LOWEST or arg_1 == arg_0 . NONE : return True elif isinstance ( arg_1 , arg_0 . FIELDS ) : return arg_1 . gtype == topology_pb2 . Grouping . Value ( "FIELDS" ) and arg_1 . fields is not None elif isinstance ( arg_1 , arg_0 . CUSTOM ) : return arg_1 . gtype == topology_pb2 . Grouping . Value ( "CUSTOM" ) and arg_1 . python_serialized is not None else : return False

def Func(arg_0, arg_1):
    """Checks if a given gtype is sane"""
    if arg_1 == arg_0.SHUFFLE or arg_1 == arg_0.ALL or arg_1 == arg_0.LOWEST or arg_1 == arg_0.NONE:
      return True
    elif isinstance(arg_1, arg_0.FIELDS):
      return arg_1.gtype == topology_pb2.Grouping.Value("FIELDS") and \
             arg_1.fields is not None
    elif isinstance(arg_1, arg_0.CUSTOM):
      return arg_1.gtype == topology_pb2.Grouping.Value("CUSTOM") and \
             arg_1.python_serialized is not None
    else:
      #pylint: disable=fixme
      #TODO: DIRECT are not supported yet
      return False


(self, sap_search_student_url, all_inactive_learners, page_size, start_at)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """
        Make recursive GET calls to traverse the paginated API response for search students.
        """
        arg_5 = '{sap_search_student_url}&{pagination_criterion}'.format(
            arg_1=arg_1,
            pagination_criterion='$count=true&$top={page_size}&$skip={start_at}'.format(
                arg_3=arg_3,
                arg_4=arg_4,
            ),
        )
        try:
            arg_6 = arg_0.session.get(arg_5)
            arg_7 = arg_6.json()
        except (ConnectionError, Timeout):
            LOGGER.warning(
                'Unable to fetch inactive learners from SAP searchStudent API with url '
                '"{%s}".', arg_5,
            )
            return None

        if 'error' in arg_7:
            LOGGER.warning(
                'SAP searchStudent API for customer %s and base url %s returned response with '
                'error message "%s" and with error code "%s".',
                arg_0.enterprise_configuration.enterprise_customer.name,
                arg_0.enterprise_configuration.sapsf_base_url,
                arg_7['error'].get('message'),
                arg_7['error'].get('code'),
            )
            return None

        arg_8 = arg_3 + arg_4
        arg_2 += arg_7['value']
        if arg_7['@odata.count'] > arg_8:
            return arg_0.Func(
                arg_1,
                arg_2,
                arg_3=arg_3,
                arg_4=arg_8,
            )

        return arg_2

Make recursive GET calls to traverse the paginated API response for search students .


return sorted(map(_GroupTuple, groupby(sorted(value, key=expr), expr)))

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = make_attrgetter ( arg_0 , arg_2 ) return sorted ( map ( _GroupTuple , groupby ( sorted ( arg_1 , key = arg_3 ) , arg_3 ) ) )

def Func(arg_0, arg_1, arg_2):
    """Group a sequence of objects by a common attribute.

    If you for example have a list of dicts or objects that represent persons
    with `gender`, `first_name` and `last_name` attributes and you want to
    group all users by genders you can do something like the following
    snippet:

    .. sourcecode:: html+jinja

        {% for group in persons|groupby('gender') %}

{{ group.grouper }}

            {% for person in group.list %}

{{ person.first_name }} {{ person.last_name }}

            {% endfor %}

        {% endfor %}

    Additionally it's possible to use tuple unpacking for the grouper and
    list:

    .. sourcecode:: html+jinja

        {% for grouper, list in persons|groupby('gender') %}
            ...
        {% endfor %}

    As you can see the item we're grouping by is stored in the `grouper`
    attribute and the `list` contains all the objects that have this grouper
    in common.

    .. versionchanged:: 2.6
       It's now possible to use dotted notation to group by the child
       attribute of another attribute.
    """
    arg_3 = make_attrgetter(arg_0, arg_2)
    return sorted(map(_GroupTuple, groupby(sorted(arg_1, key=arg_3), arg_3)))

Group a sequence of objects by a common attribute .


def Func ( arg_0 ) : if Crates . metadata_category ( arg_0 ) == CATEGORY_CRATES : arg_1 = arg_0 [ 'updated_at' ] else : arg_1 = arg_0 [ 'fetched_on' ] arg_1 = str_to_datetime ( arg_1 ) return arg_1 . timestamp ( )

def Func(arg_0):
        """Extracts the update time from an item.

        Depending on the item, the timestamp is extracted from the
        'updated_at' or 'fetched_on' fields.
        This date is converted to UNIX timestamp format.

        :param item: item generated by the backend

        :returns: a UNIX timestamp
        """
        if Crates.metadata_category(arg_0) == CATEGORY_CRATES:
            arg_1 = arg_0['updated_at']
        else:
            arg_1 = arg_0['fetched_on']

        arg_1 = str_to_datetime(arg_1)

        return arg_1.timestamp()


(self, url=None, token=None, test=False)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
,
arg_3
=
False
)
:
if
arg_1
is
:
arg_1
=
Config
.
get_value
(
"url"
)
if
arg_2
is
:
arg_2
=
Config
.
get_value
(
"token"
)
arg_0
.
server_url
=
arg_1
arg_0
.
auth_header
=
{
"Authorization"
:
"Basic {0}"
.
format
(
arg_2
)
}
arg_0
.
Funcd
=
True
if
arg_3
:
arg_0
.
test_connection
(
)
Config
.
set
(
"url"
,
arg_1
)
Config
.
set
(
"token"
,
arg_2
)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=False):
        """
        Configure the api to use given url and token or to get them from the
        Config.
        """

        if arg_1 is None:
            arg_1 = Config.get_value("url")
        if arg_2 is None:
            arg_2 = Config.get_value("token")

        arg_0.server_url = arg_1
        arg_0.auth_header = {"Authorization": "Basic {0}".format(arg_2)}
        arg_0.Funcd = True

        if arg_3:
            arg_0.test_connection()

        Config.set("url", arg_1)
        Config.set("token", arg_2)

Configure the api to use given url and token or to get them from the Config .


def Func(arg_0, arg_1):
        """Assign parameters to values yielding a new circuit.

        Args:
            value_dict (dict): {parameter: value, ...}

        Raises:
            QiskitError: If value_dict contains parameters not present in the circuit

        Returns:
            QuantumCircuit: copy of self with assignment substitution.
        """
        arg_2 = arg_0.copy()

        if arg_1.keys() > arg_0.parameters:
            raise QiskitError('Cannot bind parameters ({}) not present in the circuit.'.format(
                [str(arg_3) for arg_3 in arg_1.keys() - arg_0.parameters]))

        for arg_4, arg_5 in arg_1.items():
            arg_2._bind_parameter(arg_4, arg_5)
        # clear evaluated expressions
        for arg_4 in arg_1:
            del arg_2._parameter_table[arg_4]
        return arg_2

Assign parameters to values yielding a new circuit .


def Func ( arg_0 ) : arg_1 = QueueNetwork ( None ) arg_1 . g = arg_0 . g . Func ( ) arg_1 . max_agents = Func . deepFunc ( arg_0 . max_agents ) arg_1 . nV = Func . deepFunc ( arg_0 . nV ) arg_1 . nE = Func . deepFunc ( arg_0 . nE ) arg_1 . num_agents = Func . deepFunc ( arg_0 . num_agents ) arg_1 . num_events = Func . deepFunc ( arg_0 . num_events ) arg_1 . _t = Func . deepFunc ( arg_0 . _t ) arg_1 . _initialized = Func . deepFunc ( arg_0 . _initialized ) arg_1 . _prev_edge = Func . deepFunc ( arg_0 . _prev_edge ) arg_1 . _blocking = Func . deepFunc ( arg_0 . _blocking ) arg_1 . colors = Func . deepFunc ( arg_0 . colors ) arg_1 . out_edges = Func . deepFunc ( arg_0 . out_edges ) arg_1 . in_edges = Func . deepFunc ( arg_0 . in_edges ) arg_1 . edge2queue = Func . deepFunc ( arg_0 . edge2queue ) arg_1 . _route_probs = Func . deepFunc ( arg_0 . _route_probs ) if arg_1 . _initialized : arg_17 = [ q . _key ( ) for q in arg_1 . edge2queue if q . _time < np . infty ] arg_1 . _fancy_heap = PriorityQueue ( arg_17 , arg_1 . nE ) return arg_1

def Func(arg_0):
        """Returns a deep Func of itself."""
        arg_1 = QueueNetwork(None)
        arg_1.g = arg_0.g.Func()
        arg_1.max_agents = Func.deepFunc(arg_0.max_agents)
        arg_1.nV = Func.deepFunc(arg_0.nV)
        arg_1.nE = Func.deepFunc(arg_0.nE)
        arg_1.num_agents = Func.deepFunc(arg_0.num_agents)
        arg_1.num_events = Func.deepFunc(arg_0.num_events)
        arg_1._t = Func.deepFunc(arg_0._t)
        arg_1._initialized = Func.deepFunc(arg_0._initialized)
        arg_1._prev_edge = Func.deepFunc(arg_0._prev_edge)
        arg_1._blocking = Func.deepFunc(arg_0._blocking)
        arg_1.colors = Func.deepFunc(arg_0.colors)
        arg_1.out_edges = Func.deepFunc(arg_0.out_edges)
        arg_1.in_edges = Func.deepFunc(arg_0.in_edges)
        arg_1.edge2queue = Func.deepFunc(arg_0.edge2queue)
        arg_1._route_probs = Func.deepFunc(arg_0._route_probs)

        if arg_1._initialized:
            arg_17 = [q._key() for q in arg_1.edge2queue if q._time < np.infty]
            arg_1._fancy_heap = PriorityQueue(arg_17, arg_1.nE)

        return arg_1


return models.Organization(
        id=organization_dict.get('id'),
        name=organization_dict.get('name', ''),
        short_name=organization_dict.get('short_name', ''),
        description=organization_dict.get('description', ''),
        logo=organization_dict.get('logo', '')
    )

def Func ( arg_0 ) : return models . Organization ( id = arg_0 . get ( 'id' ) , name = arg_0 . get ( 'name' , '' ) , short_name = arg_0 . get ( 'short_name' , '' ) , description = arg_0 . get ( 'description' , '' ) , logo = arg_0 . get ( 'logo' , '' ) )

def Func(arg_0):
    """
    Organization dict-to-object serialization
    """
    return models.Organization(
        id=arg_0.get('id'),
        name=arg_0.get('name', ''),
        short_name=arg_0.get('short_name', ''),
        description=arg_0.get('description', ''),
        logo=arg_0.get('logo', '')
    )

Organization dict - to - object serialization


(self, url=None, post_data={}, parse_data=False, key=None, parameters=None, listener=None)

return self._fetch("POST", url, post_data=post_data, parse_data=parse_data, key=key, parameters=parameters, listener=listener, full_return=True)

def Func(arg_0, arg_1=None, arg_2={}, arg_3=False, arg_4=None, arg_5=None, arg_6=None):
        """ Issue a POST request.

        Kwargs:
            url (str): Destination URL
            Func_data (dict): Dictionary of parameter and values
            parse_data (bool): If true, parse response data
            key (string): If parse_data==True, look for this key when parsing data
            parameters (dict): Additional GET parameters to append to the URL
            listener (func): callback called when uploading a file

        Returns:
            dict. Response (a dict with keys: success, data, info, body)

        Raises:
            AuthenticationError, ConnectionError, urllib2.HTTPError, ValueError, Exception
        """
        return arg_0._fetch("POST", arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6, full_return=True)

Issue a POST request.

        Kwargs:
            url (str): Destination URL
            post_data (dict): Dictionary of parameter and values
            parse_data (bool): If true, parse response data
            key (string): If parse_data==True, look for this key when parsing data
            parameters (dict): Additional GET parameters to append to the URL
            listener (func): callback called when uploading a file

        Returns:
            dict. Response (a dict with keys: success, data, info, body)

        Raises:
            AuthenticationError, ConnectionError, urllib2.HTTPError, ValueError, Exception


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . upperCase1 return eval ( arg_0 . actionList [ arg_2 ] , locals ( ) )

def Func(arg_0, arg_1, arg_2):
        """Perform the proper action
        """
        #set environment for the UpperCaseFirst
        arg_3 = arg_0.upperCase1
        return eval(arg_0.actionList[arg_2], locals())


return "/" + compat.unquote(util.lstripstr(ref_url, self.share_path)).lstrip(
            "/"
        )

def Func ( arg_0 , arg_1 ) : return "/" + compat . unquote ( util . lstripstr ( arg_1 , arg_0 . share_path ) ) . lstrip ( "/" )

def Func(arg_0, arg_1):
        """Convert a refUrl to a path, by stripping the share prefix.

        Used to calculate the <path> from a storage key by inverting get_ref_url().
        """
        return "/" + compat.unquote(util.lstripstr(arg_1, arg_0.share_path)).lstrip(
            "/"
        )

Convert a refUrl to a path by stripping the share prefix .


(self,
                                  signals: List[RtlSignalBase],
                                  seen: set, ctx: SensitivityCtx)

def Func(arg_0,
                                  arg_1: arg_2[arg_3],
                                  arg_4: arg_5, arg_6: arg_7)\
            -> None:
        """
        Discover sensitivity for list of signals

        """
        arg_8 = arg_5()
        for arg_9 in arg_1:
            arg_9._walk_sensitivity(arg_8, arg_4, arg_6)
            if arg_6.contains_ev_dependency:
                break

        # if event dependent sensitivity found do not add other sensitivity
        if not arg_6.contains_ev_dependency:
            arg_6.extend(arg_8)


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . markups : if arg_2 . tag == string . lower ( arg_1 ) : return arg_2 return None

def  Func( arg_0, arg_1 ):
        """return the DocMarkup corresponding to a given tag in a block"""
        for arg_2 in arg_0.markups:
            if arg_2.tag == string.lower( arg_1 ):
                return arg_2
        return None


def
Func
(
arg_0
,
arg_1
=
" "
)
:
if
arg_1
is
:
arg_1
=
" "
arg_2
=
H2OFrame
.
_expr
(
expr
=
ExprNode
(
"Func"
,
arg_0
,
arg_1
)
)
arg_2
.
_ex
.
_cache
.
nrows
=
arg_0
.
nrow
arg_2
.
_ex
.
_cache
.
ncol
=
arg_0
.
ncol
return
arg_2

def Func(arg_0, arg_1=" "):
        """
        Return a copy of the column with leading characters removed.

        The set argument is a string specifying the set of characters to be removed.
        If omitted, the set argument defaults to removing whitespace.

        :param character set: The set of characters to Func from strings in column.
        :returns: a new H2OFrame with the same shape as the original frame and having all its values
            trimmed from the left (equivalent of Python's ``str.Func()``).
        """
        # work w/ None; parity with python Func
        if arg_1 is None: arg_1 = " "

        arg_2 = H2OFrame._expr(expr=ExprNode("Func", arg_0, arg_1))
        arg_2._ex._cache.nrows = arg_0.nrow
        arg_2._ex._cache.ncol = arg_0.ncol
        return arg_2

Return a copy of the column with leading characters removed.

        The set argument is a string specifying the set of characters to be removed.
        If omitted, the set argument defaults to removing whitespace.

        :param character set: The set of characters to lstrip from strings in column.
        :returns: a new H2OFrame with the same shape as the original frame and having all its values
            trimmed from the left (equivalent of Python's ``str.lstrip()``).

Return a copy of the column with leading characters removed .


(self, path, relativePath, name=None,
                        description=None,
                        replace=False, verbose=False)

def Func(arg_0, arg_1, arg_2, arg_3=None,
                        arg_4=None,
                        arg_5=False, arg_6=False):
        """
        Copy an exisitng system file to the repository.
        attribute in the Repository with utc timestamp.

        :Parameters:
            #. path (str): The full path of the file to copy into the repository.
            #. relativePath (str): The relative to the repository path of the directory where the file should be dumped.
               If relativePath does not exist, it will be created automatically.
            #. name (string): The file name.
               If None is given, name will be split from path.
            #. description (None, string, pickable object): Any random description about the file.
            #. replace (boolean): Whether to replace any existing file with the same name if existing.
            #. verbose (boolean): Whether to be warn and informed about any abnormalities.
        """
        arg_2 = os.path.normpath(arg_2)
        if arg_2 == '.':
            arg_2 = ''
        if arg_3 is None:
            arg_7,arg_3 = os.path.split(arg_1)
        # ensure directory added
        arg_0.add_directory(arg_2)
        # ger real path
        arg_8 = os.path.join(arg_0.__path, arg_2)
        # get directory info dict
        arg_9, arg_10 = arg_0.get_directory_info(arg_2)
        assert arg_9 is not None, arg_10
        if arg_3 in arg_14.__getitem__(arg_9, "files"):
            if not arg_5:
                if arg_6:
                    warnings.warn("a file with the name '%s' is already defined in repository dictionary info. Set replace flag to True if you want to replace the existing file"%(arg_3))
                return
        # convert dump and pull methods to strings
        arg_11 = "raise Exception(\"dump is ambiguous for copied file '$FILE_PATH' \")"
        arg_12 = "raise Exception(\"pull is ambiguous for copied file '$FILE_PATH' \")"
        # dump file
        try:
            shutil.copyfile(arg_1, os.path.join(arg_8,arg_3))
        except Exception as e:
            if arg_6:
                warnings.warn(e)
            return
        # set info
        arg_13 = None
        # save the new file to the repository
        arg_14.__getitem__(arg_9, "files")[arg_3] = {"dump":arg_11,
                                                        "pull":arg_12,
                                                        "timestamp":datetime.utcnow(),
                                                        "id":str(uuid.uuid1()),
                                                        "class": arg_13,
                                                        "description":arg_4}
        # save repository
        arg_0.save()

Copy an exisitng system file to the repository . attribute in the Repository with utc timestamp .


(
      kernel,
      inducing_index_points,
      observation_index_points,
      observations,
      observation_noise_variance,
      mean_fn=None,
      jitter=1e-6,
      name=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
=
,
arg_6
=
1e-6
,
arg_7
=
)
:
with
tf
.
name_scope
(
arg_7
or
'Func'
)
:
arg_8
=
dtype_util
.
common_dtype
(
[
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_6
]
,
tf
.
float32
)
arg_1
=
tf
.
convert_to_tensor
(
value
=
arg_1
,
arg_8
=
arg_8
,
arg_7
=
'inducing_index_points'
)
arg_2
=
tf
.
convert_to_tensor
(
value
=
arg_2
,
arg_8
=
arg_8
,
arg_7
=
'observation_index_points'
)
arg_3
=
tf
.
convert_to_tensor
(
value
=
arg_3
,
arg_8
=
arg_8
,
arg_7
=
'observations'
)
arg_4
=
tf
.
convert_to_tensor
(
value
=
arg_4
,
arg_8
=
arg_8
,
arg_7
=
'observation_noise_variance'
)
arg_6
=
tf
.
convert_to_tensor
(
value
=
arg_6
,
arg_8
=
arg_8
,
arg_7
=
'jitter'
)
if
arg_5
is
:
arg_5
=
lambda
x
:
tf
.
zeros
(
[
1
]
,
arg_8
=
arg_8
)
else
:
if
not
callable
(
arg_5
)
:
raise
ValueError
(
'`mean_fn` must be a Python callable'
)
arg_9
=
arg_0
.
matrix
(
arg_1
,
arg_1
)
arg_10
=
arg_0
.
matrix
(
arg_1
,
arg_2
)
arg_11
=
tf
.
math
.
reciprocal
(
arg_4
)
arg_12
=
_add_diagonal_shift
(
arg_9
+
arg_11
*
tf
.
matmul
(
arg_10
,
arg_10
,
adjoint_b
=
True
)
,
arg_6
)
arg_13
=
tf
.
linalg
.
cholesky
(
arg_12
)
arg_14
=
tf
.
linalg
.
LinearOperatorFullMatrix
(
arg_10
)
arg_15
=
arg_14
.
matvec
(
arg_3
arg_5
(
arg_2
)
)
arg_16
=
tf
.
linalg
.
LinearOperatorFullMatrix
(
arg_9
)
arg_17
=
(
arg_5
(
arg_1
)
+
arg_11
*
arg_16
.
matvec
(
_solve_cholesky_factored_system_vec
(
arg_13
,
arg_15
)
)
)
arg_18
=
tf
.
linalg
.
LinearOperatorLowerTriangular
(
arg_13
)
arg_19
=
arg_18
.
solve
(
arg_9
)
return
arg_17
,
arg_19

def Func(
      arg_0,
      arg_1,
      arg_2,
      arg_3,
      arg_4,
      arg_5=None,
      arg_6=1e-6,
      arg_7=None):
    """Model selection for optimal variational hyperparameters.

    Given the full training set (parameterized by `observations` and
    `observation_index_points`), compute the optimal variational
    location and scale for the VGP. This is based of the method suggested
    in [Titsias, 2009][1].

    Args:
      kernel: `PositiveSemidefiniteKernel`-like instance representing the
        GP's covariance function.
      inducing_index_points: `float` `Tensor` of locations of inducing points in
        the index set. Shape has the form `[b1, ..., bB, e2, f1, ..., fF]`, just
        like `observation_index_points`. The batch shape components needn't be
        identical to those of `observation_index_points`, but must be broadcast
        compatible with them.
      observation_index_points: `float` `Tensor` representing finite (batch of)
        vector(s) of points where observations are defined. Shape has the
        form `[b1, ..., bB, e1, f1, ..., fF]` where `F` is the number of feature
        dimensions and must equal `kernel.feature_ndims` and `e1` is the number
        (size) of index points in each batch (we denote it `e1` to distinguish
        it from the numer of inducing index points, denoted `e2` below).
      observations: `float` `Tensor` representing collection, or batch of
        collections, of observations corresponding to
        `observation_index_points`. Shape has the form `[b1, ..., bB, e]`, which
        must be brodcastable with the batch and example shapes of
        `observation_index_points`. The batch shape `[b1, ..., bB]` must be
        broadcastable with the shapes of all other batched parameters
        (`kernel.batch_shape`, `observation_index_points`, etc.).
      observation_noise_variance: `float` `Tensor` representing the variance
        of the noise in the Normal likelihood distribution of the model. May be
        batched, in which case the batch shape must be broadcastable with the
        shapes of all other batched parameters (`kernel.batch_shape`,
        `index_points`, etc.).
        Default value: `0.`
      mean_fn: Python `callable` that acts on index points to produce a (batch
        of) vector(s) of mean values at those index points. Takes a `Tensor` of
        shape `[b1, ..., bB, f1, ..., fF]` and returns a `Tensor` whose shape is
        (broadcastable with) `[b1, ..., bB]`. Default value: `None` implies
        constant zero function.
      jitter: `float` scalar `Tensor` added to the diagonal of the covariance
        matrix to ensure positive definiteness of the covariance matrix.
        Default value: `1e-6`.
      name: Python `str` name prefixed to Ops created by this class.
        Default value: "Func".
    Returns:
      loc, scale: Tuple representing the variational location and scale.
    Raises:
      ValueError: if `mean_fn` is not `None` and is not callable.

    #### References

    [1]: Titsias, M. "Variational Model Selection for Sparse Gaussian Process
         Regression", 2009.
         http://proceedings.mlr.press/v5/titsias09a/titsias09a.pdf
    """

    with tf.name_scope(arg_7 or 'Func'):
      arg_8 = dtype_util.common_dtype(
          [arg_1,
           arg_2,
           arg_3,
           arg_4,
           arg_6], tf.float32)

      arg_1 = tf.convert_to_tensor(
          value=arg_1,
          arg_8=arg_8, arg_7='inducing_index_points')
      arg_2 = tf.convert_to_tensor(
          value=arg_2, arg_8=arg_8,
          arg_7='observation_index_points')
      arg_3 = tf.convert_to_tensor(
          value=arg_3, arg_8=arg_8, arg_7='observations')
      arg_4 = tf.convert_to_tensor(
          value=arg_4,
          arg_8=arg_8,
          arg_7='observation_noise_variance')
      arg_6 = tf.convert_to_tensor(
          value=arg_6, arg_8=arg_8, arg_7='jitter')

      # Default to a constant zero function.
      if arg_5 is None:
        arg_5 = lambda x: tf.zeros([1], arg_8=arg_8)
      else:
        if not callable(arg_5):
          raise ValueError('`mean_fn` must be a Python callable')

      # z are the inducing points and x are the observation index points.
      arg_9 = arg_0.matrix(arg_1, arg_1)
      arg_10 = arg_0.matrix(arg_1, arg_2)

      arg_11 = tf.math.reciprocal(arg_4)

      arg_12 = _add_diagonal_shift(
          arg_9 + arg_11 * tf.matmul(arg_10, arg_10, adjoint_b=True),
          arg_6)

      arg_13 = tf.linalg.cholesky(arg_12)

      arg_14 = tf.linalg.LinearOperatorFullMatrix(arg_10)
      arg_15 = arg_14.matvec(
          arg_3 - arg_5(arg_2))
      arg_16 = tf.linalg.LinearOperatorFullMatrix(arg_9)
      arg_17 = (arg_5(arg_1) +
             arg_11 * arg_16.matvec(
                 _solve_cholesky_factored_system_vec(arg_13, arg_15)))

      arg_18 = tf.linalg.LinearOperatorLowerTriangular(
          arg_13)
      arg_19 = arg_18.solve(arg_9)

      return arg_17, arg_19

Model selection for optimal variational hyperparameters.

    Given the full training set (parameterized by `observations` and
    `observation_index_points`), compute the optimal variational
    location and scale for the VGP. This is based of the method suggested
    in [Titsias, 2009][1].

    Args:
      kernel: `PositiveSemidefiniteKernel`-like instance representing the
        GP's covariance function.
      inducing_index_points: `float` `Tensor` of locations of inducing points in
        the index set. Shape has the form `[b1, ..., bB, e2, f1, ..., fF]`, just
        like `observation_index_points`. The batch shape components needn't be
        identical to those of `observation_index_points`, but must be broadcast
        compatible with them.
      observation_index_points: `float` `Tensor` representing finite (batch of)
        vector(s) of points where observations are defined. Shape has the
        form `[b1, ..., bB, e1, f1, ..., fF]` where `F` is the number of feature
        dimensions and must equal `kernel.feature_ndims` and `e1` is the number
        (size) of index points in each batch (we denote it `e1` to distinguish
        it from the numer of inducing index points, denoted `e2` below).
      observations: `float` `Tensor` representing collection, or batch of
        collections, of observations corresponding to
        `observation_index_points`. Shape has the form `[b1, ..., bB, e]`, which
        must be brodcastable with the batch and example shapes of
        `observation_index_points`. The batch shape `[b1, ..., bB]` must be
        broadcastable with the shapes of all other batched parameters
        (`kernel.batch_shape`, `observation_index_points`, etc.).
      observation_noise_variance: `float` `Tensor` representing the variance
        of the noise in the Normal likelihood distribution of the model. May be
        batched, in which case the batch shape must be broadcastable with the
        shapes of all other batched parameters (`kernel.batch_shape`,
        `index_points`, etc.).
        Default value: `0.`
      mean_fn: Python `callable` that acts on index points to produce a (batch
        of) vector(s) of mean values at those index points. Takes a `Tensor` of
        shape `[b1, ..., bB, f1, ..., fF]` and returns a `Tensor` whose shape is
        (broadcastable with) `[b1, ..., bB]`. Default value: `None` implies
        constant zero function.
      jitter: `float` scalar `Tensor` added to the diagonal of the covariance
        matrix to ensure positive definiteness of the covariance matrix.
        Default value: `1e-6`.
      name: Python `str` name prefixed to Ops created by this class.
        Default value: "optimal_variational_posterior".
    Returns:
      loc, scale: Tuple representing the variational location and scale.
    Raises:
      ValueError: if `mean_fn` is not `None` and is not callable.

    #### References

    [1]: Titsias, M. "Variational Model Selection for Sparse Gaussian Process
         Regression", 2009.
         http://proceedings.mlr.press/v5/titsias09a/titsias09a.pdf

Model selection for optimal variational hyperparameters .


(amazon_cert: crypto.X509, signature: str, request_body: bytes)

def Func(arg_0: arg_1.X509, arg_3: arg_4, arg_5: arg_6) -> bool:
    """Verifies Alexa request signature.

    Args:
        amazon_cert: Pycrypto X509 Amazon certificate.
        signature: Base64 decoded Alexa request signature from Signature HTTP header.
        request_body: full HTTPS request body
    Returns:
        result: True if verification was successful, False if not.
    """
    arg_3 = base64.b64decode(arg_3)

    try:
        arg_1.verify(arg_0, arg_3, arg_5, 'sha1')
        arg_7 = True
    except arg_1.Error:
        arg_7 = False

    return arg_7


def Func ( arg_0 , arg_1 = ( arg_2 , ) ) : def decorator ( arg_3 ) : def function ( * arg_4 , ** arg_5 ) : arg_6 = arg_0 while arg_6 > 0 : try : arg_6 -= 1 return arg_3 ( * arg_4 , ** arg_5 ) except arg_1 as exc : if isinstance ( exc , PandoraException ) : raise if arg_6 > 0 : time . sleep ( delay_exponential ( 0.5 , 2 , arg_0 - arg_6 ) ) else : raise return function return decorator

def Func(arg_0, arg_1=(arg_2,)):
    """Function decorator implementing retrying logic.

    exceptions: A tuple of exception classes; default (Exception,)

    The decorator will call the function up to max_tries times if it raises
    an exception.

    By default it catches instances of the Exception class and subclasses.
    This will recover after all but the most fatal errors. You may specify a
    custom tuple of exception classes with the 'exceptions' argument; the
    function will only be retried if it raises one of the specified
    exceptions.
    """
    def decorator(arg_3):
        def function(*arg_4, **arg_5):

            arg_6 = arg_0
            while arg_6 > 0:
                try:
                    arg_6 -= 1
                    return arg_3(*arg_4, **arg_5)

                except arg_1 as exc:
                    # Don't retry for PandoraExceptions - unlikely that result
                    # will change for same set of input parameters.
                    if isinstance(exc, PandoraException):
                        raise
                    if arg_6 > 0:
                        time.sleep(delay_exponential(
                            0.5, 2, arg_0 - arg_6))
                    else:
                        raise

        return function

    return decorator

Function decorator implementing retrying logic .


def Func(arg_0, arg_1):
        """Handle successufl jobs"""

        arg_2 = arg_1.result
        arg_3 = arg_1.kwargs['task_id']

        try:
            arg_4 = arg_0.registry.get(arg_3)
        except NotFoundError:
            logger.warning("Task %s not found; related job #%s will not be rescheduled",
                           arg_3, arg_1.id)
            return

        if arg_4.archiving_cfg and arg_4.archiving_cfg.fetch_from_archive:
            logger.info("Job #%s (task: %s) successfully finished", arg_1.id, arg_3)
            return

        if arg_2.nitems > 0:
            arg_4.backend_args['next_from_date'] = unixtime_to_datetime(arg_2.max_date)

            if arg_2.offset:
                arg_4.backend_args['next_offset'] = arg_2.offset

        arg_6 = arg_0._build_job_arguments(arg_4)

        arg_7 = arg_4.scheduling_cfg.delay if arg_4.scheduling_cfg else WAIT_FOR_QUEUING

        arg_8 = arg_0._scheduler.schedule_job_task(Q_UPDATING_JOBS,
                                                   arg_3, arg_6,
                                                   arg_7=arg_7)

        logger.info("Job #%s (task: %s, old job: %s) re-scheduled",
                    arg_8, arg_3, arg_1.id)


(y,z, polar_angle=0., nlpts=1,
        pinhole_width=1, use_laggauss=False, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = 0. , arg_3 = 1 , arg_4 = 1 , arg_5 = False , ** arg_6 ) : if arg_5 : arg_7 , arg_8 = calc_pts_lag ( ) else : arg_7 , arg_8 = calc_pts_hg ( ) arg_9 , arg_10 , arg_11 = [ np . zeros ( list ( arg_0 . shape ) + [ arg_7 . size ] ) for arg_13 in range ( 3 ) ] arg_12 = np . zeros ( arg_9 . shape ) for arg_13 in range ( arg_7 . size ) : arg_9 [ ... , arg_13 ] = arg_7 [ arg_13 ] arg_10 [ ... , arg_13 ] = arg_0 . copy ( ) arg_11 [ ... , arg_13 ] = arg_1 . copy ( ) arg_14 , arg_15 = np . polynomial . hermite . hermgauss ( arg_3 ) arg_14 *= np . sqrt ( 2 ) * arg_4 arg_15 /= np . sqrt ( np . pi ) for arg_16 , arg_17 in zip ( arg_14 , arg_15 ) : arg_18 = np . sqrt ( arg_9 * arg_9 + ( arg_10 - arg_16 ) * ( arg_10 - arg_16 ) ) arg_19 = np . arctan2 ( arg_10 , arg_9 ) arg_20 , arg_21 = get_hsym_asym ( arg_18 , arg_11 , get_hdet = False , ** arg_6 ) arg_12 += arg_17 * ( arg_20 + np . cos ( 2 * ( arg_19 - arg_2 ) ) * arg_21 ) for arg_13 in range ( arg_7 . size ) : arg_12 [ ... , arg_13 ] *= arg_8 [ arg_13 ] return arg_12 . sum ( axis = - 1 ) * 2.

def Func(arg_0,arg_1, arg_2=0., arg_3=1,
        arg_4=1, arg_5=False, **arg_6):
    """
    Calculates the illumination PSF for a line-scanning confocal with the
    confocal line oriented along the x direction.

    Parameters
    ----------
        y : numpy.ndarray
            The y points (in-plane, perpendicular to the line direction)
            at which to evaluate the illumination PSF, in units of 1/k.
            Arbitrary shape.
        z : numpy.ndarray
            The z points (optical axis) at which to evaluate the illum-
            ination PSF, in units of 1/k. Must be the same shape as `y`
        polar_angle : Float, optional
            The angle of the illuminating light's polarization with
            respect to the line's orientation along x. Default is 0.
        pinhole_width : Float, optional
            The width of the geometric image of the line projected onto
            the sample, in units of 1/k. Default is 1. The perfect line
            image is assumed to be a Gaussian. If `nlpts` is set to 1,
            the line will always be of zero width.
        nlpts : Int, optional
            The number of points to use for Hermite-gauss quadrature over
            the line's width. Default is 1, corresponding to a zero-width
            line.
        use_laggauss : Bool, optional
            Set to True to use a more-accurate sinh'd Laguerre-Gauss
            quadrature for integration over the line's length (more accurate
            in the same amount of time). Default is False for backwards
            compatibility.  FIXME what did we do here?

    Other Parameters
    ----------------
        alpha : Float, optional
            The acceptance angle of the lens, on (0,pi/2). Default is 1.
        zint : Float, optional
            The distance of the len's unaberrated focal point from the
            optical interface, in units of 1/k. Default is 100.
        n2n1 : Float, optional
            The ratio n2/n1 of the index mismatch between the sample
            (index n2) and the optical train (index n1). Must be on
            [0,inf) but should be near 1. Default is 0.95

    Returns
    -------
        hilm : numpy.ndarray
            The line illumination, of the same shape as y and z.
    """
    if arg_5:
        arg_7, arg_8 = calc_pts_lag()
    else:
        arg_7, arg_8 = calc_pts_hg()

    #I'm assuming that y,z are already some sort of meshgrid
    arg_9, arg_10, arg_11 = [np.zeros( list(arg_0.shape) + [arg_7.size] ) for arg_13 in range(3)]
    arg_12 = np.zeros(arg_9.shape)

    for arg_13 in range(arg_7.size):
        arg_9[...,arg_13] = arg_7[arg_13]
        arg_10[...,arg_13] = arg_0.copy()
        arg_11[...,arg_13] = arg_1.copy()

    arg_14, arg_15 = np.polynomial.hermite.hermgauss(arg_3)
    arg_14 *= np.sqrt(2)*arg_4
    arg_15 /= np.sqrt(np.pi)

    #Pinhole hermgauss first:
    for arg_16, arg_17 in zip(arg_14, arg_15):
        arg_18 = np.sqrt(arg_9*arg_9 + (arg_10-arg_16)*(arg_10-arg_16))
        arg_19 = np.arctan2(arg_10,arg_9)

        arg_20, arg_21 = get_hsym_asym(arg_18,arg_11,get_hdet = False, **arg_6)
        arg_12 += arg_17*(arg_20 + np.cos(2*(arg_19-arg_2))*arg_21)

    #Now line hermgauss
    for arg_13 in range(arg_7.size):
        arg_12[...,arg_13] *= arg_8[arg_13]

    return arg_12.sum(axis=-1)*2.

Calculates the illumination PSF for a line - scanning confocal with the confocal line oriented along the x direction .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
yield
getInstancePid
(
arg_1
,
arg_2
)
try
:
arg_4
=
tornado
.
httpclient
.
AsyncHTTPClient
(
)
arg_5
=
json
.
loads
(
arg_3
)
arg_6
=
arg_5
[
'stdout'
]
.
strip
(
)
if
arg_6
==
''
:
raise
Exception
(
'Failed to get pid'
)
arg_7
=
utils
.
make_shell_endpoint
(
arg_1
,
arg_2
)
arg_8
=
"%s/jstack/%s"
%
(
arg_7
,
arg_6
)
arg_9
=
yield
arg_4
.
fetch
(
arg_8
)
Log
.
debug
(
"HTTP call for url: %s"
,
arg_8
)
raise
tornado
.
gen
.
Return
(
arg_9
.
body
)
except
tornado
.
httpclient
.
HTTPError
as
e
:
raise
Exception
(
str
(
e
)
)

def Func(arg_0, arg_1, arg_2):
    """
    Fetches Instance jstack from heron-shell.
    """
    arg_3 = yield getInstancePid(arg_1, arg_2)
    try:
      arg_4 = tornado.httpclient.AsyncHTTPClient()
      arg_5 = json.loads(arg_3)
      arg_6 = arg_5['stdout'].strip()
      if arg_6 == '':
        raise Exception('Failed to get pid')
      arg_7 = utils.make_shell_endpoint(arg_1, arg_2)
      arg_8 = "%s/jstack/%s" % (arg_7, arg_6)
      arg_9 = yield arg_4.fetch(arg_8)
      Log.debug("HTTP call for url: %s", arg_8)
      raise tornado.gen.Return(arg_9.body)
    except tornado.httpclient.HTTPError as e:
      raise Exception(str(e))

Fetches Instance jstack from heron - shell .


(variant_specific, variant_id, user_id, user_name,
                     institute_id, case_id, classification, criteria)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 , arg_7 ) : arg_7 = arg_7 or [ ] arg_8 = dict ( arg_0 = arg_0 , arg_1 = arg_1 , arg_4 = arg_4 , arg_5 = arg_5 , arg_6 = arg_6 , arg_2 = arg_2 , arg_3 = arg_3 , created_at = datetime . datetime . now ( ) , ) arg_9 = [ ] for arg_10 in arg_7 : arg_11 = { } arg_11 [ 'term' ] = arg_10 [ 'term' ] if 'comment' in arg_10 : arg_11 [ 'comment' ] = arg_10 [ 'comment' ] if 'links' in arg_10 : arg_11 [ 'links' ] = arg_10 [ 'links' ] arg_9 . append ( arg_11 ) arg_8 [ 'criteria' ] = arg_9 return arg_8

def Func(arg_0, arg_1, arg_2, arg_3,
                     arg_4, arg_5, arg_6, arg_7):
    """Build a evaluation object ready to be inserted to database

    Args:
        variant_specific(str): md5 string for the specific variant
        variant_id(str): md5 string for the common variant
        user_id(str)
        user_name(str)
        institute_id(str)
        case_id(str)
        classification(str): The ACMG classification
        criteria(list(dict)): A list of dictionaries with ACMG criterias

    Returns:
        evaluation_obj(dict): Correctly formatted evaluation object

    """
    arg_7 = arg_7 or []
    arg_8 = dict(
        arg_0 = arg_0,
        arg_1 = arg_1,
        arg_4 = arg_4,
        arg_5 = arg_5,
        arg_6 = arg_6,
        arg_2 = arg_2,
        arg_3 = arg_3,
        created_at = datetime.datetime.now(),
    )
    arg_9 = []
    for arg_10 in arg_7:
        arg_11 = {}
        # This allways has to exist
        # We might want to check if the term is valid here...
        arg_11['term'] = arg_10['term']
        if 'comment' in arg_10:
            arg_11['comment'] = arg_10['comment']
        if 'links' in arg_10:
            arg_11['links'] = arg_10['links']
        arg_9.append(arg_11)

    arg_8['criteria'] = arg_9

    return arg_8


def Func ( arg_0 ) : arg_1 = [ ] if PyFunceble . CONFIGURATION [ "mining" ] : if PyFunceble . INTERN [ "file_to_test" ] in PyFunceble . INTERN [ "mined" ] : for arg_2 in PyFunceble . INTERN [ "mined" ] [ PyFunceble . INTERN [ "file_to_test" ] ] : arg_1 . extend ( PyFunceble . INTERN [ "mined" ] [ PyFunceble . INTERN [ "file_to_test" ] ] [ arg_2 ] ) arg_1 = List ( arg_1 ) . format ( ) return arg_1

def Func(arg_0):
        """
        Provide the list of mined so they can be added to the list
        queue.

        :return: The list of mined domains or URL.
        :rtype: list
        """

        # We initiate a variable which will return the result.
        arg_1 = []

        if PyFunceble.CONFIGURATION["mining"]:
            # The mining is activated.

            if PyFunceble.INTERN["file_to_test"] in PyFunceble.INTERN["mined"]:
                # The file we are testing is into our mining database.

                for arg_2 in PyFunceble.INTERN["mined"][
                    PyFunceble.INTERN["file_to_test"]
                ]:
                    # We loop through the list of index of the file we are testing.

                    # We append the element of the currently read index to our result.
                    arg_1.extend(
                        PyFunceble.INTERN["mined"][PyFunceble.INTERN["file_to_test"]][
                            arg_2
                        ]
                    )

                # We format our result.
                arg_1 = List(arg_1).format()

        # We return the result.
        return arg_1

Provide the list of mined so they can be added to the list queue .