def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
FileInfo
(
arg_0
)
if
Search
(
_TEST_FILE_SUFFIX
,
arg_3
.
BaseName
(
)
)
:
return
for
arg_4
in
GetHeaderExtensions
(
)
:
arg_5
=
arg_0
[
0
:
len
(
arg_0
)
len
(
arg_3
.
Extension
(
)
)
]
arg_6
=
arg_5
+
'.'
+
arg_4
if
not
os
.
path
.
exists
(
arg_6
)
:
continue
arg_7
=
FileInfo
(
arg_6
)
.
RepositoryName
(
)
arg_8
=
for
arg_9
in
arg_1
.
include_list
:
for
arg_10
in
arg_9
:
if
arg_7
in
arg_10
[
0
]
or
arg_10
[
0
]
in
arg_7
:
return
if
not
arg_8
:
arg_8
=
arg_10
[
1
]
arg_2
(
arg_0
,
arg_8
,
'build/include'
,
5
,
'%s should include its header file %s'
%
(
arg_3
.
RepositoryName
(
)
,
arg_7
)
)

def Func(arg_0, arg_1, arg_2):
  """Logs an error if a source file does not include its header."""

  # Do not check test files
  arg_3 = FileInfo(arg_0)
  if Search(_TEST_FILE_SUFFIX, arg_3.BaseName()):
    return

  for arg_4 in GetHeaderExtensions():
      arg_5 = arg_0[0:len(arg_0) - len(arg_3.Extension())]
      arg_6 = arg_5 + '.' + arg_4
      if not os.path.exists(arg_6):
        continue
      arg_7 = FileInfo(arg_6).RepositoryName()
      arg_8 = None
      for arg_9 in arg_1.include_list:
        for arg_10 in arg_9:
          if arg_7 in arg_10[0] or arg_10[0] in arg_7:
            return
          if not arg_8:
            arg_8 = arg_10[1]

      arg_2(arg_0, arg_8, 'build/include', 5,
            '%s should include its header file %s' % (arg_3.RepositoryName(),
                                                      arg_7))

Logs an error if a source file does not include its header .


def Func ( arg_0 , arg_1 ) : arg_2 = yield from arg_0 . handle_get ( arg_1 ) if arg_2 is None : return None return arg_2 . value . c8_array . text or None

def Func(arg_0, arg_1):
        """Helper method for fetching a text value."""
        arg_2 = yield from arg_0.handle_get(arg_1)
        if arg_2 is None:
            return None

        return arg_2.value.c8_array.text or None

Helper method for fetching a text value .


(self, case_id, variant_type, category=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Delete variants of one type for a case

            This is used when a case is reanalyzed

            Args:
                case_id(str): The case id
                variant_type(str): 'research' or 'clinical'
                category(str): 'snv', 'sv' or 'cancer'
        """
        arg_3 = arg_3 or ''
        LOG.info("Deleting old {0} {1} variants for case {2}".format(
                    arg_2, arg_3, arg_1))
        arg_4 = {'case_id': arg_1, 'variant_type': arg_2}
        if arg_3:
            arg_4['category'] = arg_3
        arg_5 = arg_0.variant_collection.delete_many(arg_4)
        LOG.info("{0} variants deleted".format(arg_5.deleted_count))


def Func ( arg_0 , arg_1 = 2.4e6 , arg_2 = 'test.wav' ) : arg_3 = 10 arg_4 = signal . firwin ( 64 , 2 * 200e3 / float ( arg_1 ) ) arg_5 = signal . lfilter ( arg_4 , 1 , arg_0 ) arg_6 = ss . downsample ( arg_5 , arg_3 ) arg_7 = discrim ( arg_6 ) arg_8 = signal . firwin ( 128 , 2 * 12e3 / ( float ( arg_1 ) / arg_3 ) ) arg_9 = signal . lfilter ( arg_8 , 1 , arg_7 ) arg_10 = signal . firwin ( 128 , 2 * 1e3 * np . array ( [ 19 - 5 , 19 + 5 ] ) / ( float ( arg_1 ) / arg_3 ) , pass_zero = False ) arg_11 = signal . lfilter ( arg_10 , 1 , arg_7 ) arg_12 , arg_13 = pilot_PLL ( arg_11 , 19000 , arg_1 / arg_3 , 2 , 10 , 0.707 ) arg_14 = signal . firwin ( 128 , 2 * 1e3 * np . array ( [ 38 - 5 , 38 + 5 ] ) / ( float ( arg_1 ) / arg_3 ) , pass_zero = False ) arg_15 = signal . lfilter ( arg_14 , 1 , arg_7 ) arg_15 = 2 * np . sqrt ( 2 ) * np . cos ( 2 * arg_12 ) * arg_15 arg_16 = signal . lfilter ( arg_8 , 1 , arg_15 ) arg_17 = arg_9 + arg_16 arg_18 = arg_9 - arg_16 arg_19 = 5 arg_20 = float ( arg_1 ) / ( arg_3 * arg_19 ) arg_21 = ss . downsample ( arg_17 , arg_19 ) arg_22 = ss . downsample ( arg_18 , arg_19 ) arg_23 = np . exp ( - 2.1 * 1e3 * 2 * np . pi / arg_20 ) arg_24 = signal . lfilter ( [ 1 - arg_23 ] , [ 1 , - arg_23 ] , arg_21 ) arg_25 = signal . lfilter ( [ 1 - arg_23 ] , [ 1 , - arg_23 ] , arg_22 ) arg_26 = np . hstack ( ( np . array ( [ arg_24 ] ) . T , ( np . array ( [ arg_25 ] ) . T ) ) ) ss . to_wav ( arg_2 , 48000 , arg_26 / 2 ) print ( 'Done!' ) return arg_7 , arg_12 , arg_9 , arg_16 , arg_26

def Func(arg_0,arg_1=2.4e6,arg_2='test.wav'):
    """
    Stereo demod from complex baseband at sampling rate fs.
    Assume fs is 2400 ksps

    Mark Wickert July 2017
    """
    arg_3 = 10
    arg_4 = signal.firwin(64,2*200e3/float(arg_1))
    # Filter and decimate (should be polyphase)
    arg_5 = signal.lfilter(arg_4,1,arg_0)
    arg_6 = ss.downsample(arg_5,arg_3)
    # Apply complex baseband discriminator
    arg_7 = discrim(arg_6)
    # Work with the (3) stereo multiplex signals:
    # Begin by designing a lowpass filter for L+R and DSP demoded (L-R)
    # (fc = 12 KHz)
    arg_8 = signal.firwin(128,2*12e3/(float(arg_1)/arg_3))
    # The L + R term is at baseband, we just lowpass filter to remove
    # other terms above 12 kHz.
    arg_9 = signal.lfilter(arg_8,1,arg_7)
    arg_10 = signal.firwin(128,2*1e3*np.array([19-5,19+5])/(float(arg_1)/arg_3),
                        pass_zero=False);
    arg_11 = signal.lfilter(arg_10,1,arg_7)
    # Lock PLL to 19 kHz pilot
    # A type 2 loop with bandwidth Bn = 10 Hz and damping zeta = 0.707
    # The VCO quiescent frequency is set to 19000 Hz.
    arg_12, arg_13 = pilot_PLL(arg_11,19000,arg_1/arg_3,2,10,0.707)
    # Coherently demodulate the L - R subcarrier at 38 kHz.
    # theta is the PLL output phase at 19 kHz, so to double multiply
    # by 2 and wrap with cos() or sin().
    # First bandpass filter
    arg_14 = signal.firwin(128,2*1e3*np.array([38-5,38+5])/(float(arg_1)/arg_3),
                        pass_zero=False);
    arg_15 = signal.lfilter(arg_14,1,arg_7)
    # Coherently demodulate using the PLL output phase
    arg_15 = 2*np.sqrt(2)*np.cos(2*arg_12)*arg_15
    # Lowpass at 12 kHz to recover the desired DSB demod term
    arg_16 = signal.lfilter(arg_8,1,arg_15)
    # Matrix the y_lmr and y_lpr for form right and left channels:
    arg_17 = arg_9 + arg_16
    arg_18 = arg_9 - arg_16

    # Decimate by N2 (nominally 5)
    arg_19 = 5
    arg_20 = float(arg_1)/(arg_3*arg_19) # (nominally 48 ksps)
    arg_21 = ss.downsample(arg_17,arg_19)
    arg_22 = ss.downsample(arg_18,arg_19)
    # Deemphasize with 75 us time constant to 'undo' the preemphasis
    # applied at the transmitter in broadcast FM.
    # A 1-pole digital lowpass works well here.
    arg_23 = np.exp(-2.1*1e3*2*np.pi/arg_20)
    arg_24 = signal.lfilter([1-arg_23],[1, -arg_23],arg_21)
    arg_25 = signal.lfilter([1-arg_23],[1, -arg_23],arg_22)
    # Place left and righ channels as side-by-side columns in a 2D array
    arg_26 = np.hstack((np.array([arg_24]).T,(np.array([arg_25]).T)))

    ss.to_wav(arg_2, 48000, arg_26/2)
    print('Done!')
    #return z_bb, z_out
    return arg_7, arg_12, arg_9, arg_16, arg_26

Stereo demod from complex baseband at sampling rate fs . Assume fs is 2400 ksps Mark Wickert July 2017


def Func(arg_0,arg_1,arg_2=6):
    """
    A truncated square root raised cosine pulse used in digital communications.

    The pulse shaping factor :math:`0 < \\alpha < 1` is required as well as the
    truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`.

    Parameters
    ----------
    Ns : number of samples per symbol
    alpha : excess bandwidth factor on (0, 1), e.g., 0.35
    M : equals RC one-sided symbol truncation factor

    Returns
    -------
    b : ndarray containing the pulse shape

    Notes
    -----
    The pulse shape b is typically used as the FIR filter coefficients
    when forming a pulse shaped digital communications waveform. When
    square root raised cosine (SRC) pulse is used to generate Tx signals and
    at the receiver used as a matched filter (receiver FIR filter), the
    received signal is now raised cosine shaped, thus having zero
    intersymbol interference and the optimum removal of additive white
    noise if present at the receiver input.

    Examples
    --------
    Ten samples per symbol and :math:`\\alpha = 0.35`.

    >>> import matplotlib.pyplot as plt
    >>> from numpy import arange
    >>> from sk_dsp_comm.digitalcom import Func
    >>> b = Func(10,0.35)
    >>> n = arange(-10*6,10*6+1)
    >>> plt.stem(n,b)
    >>> plt.show()
    """
    # Design the filter
    arg_3 = np.arange(-arg_2*arg_0,arg_2*arg_0+1)
    arg_4 = np.zeros(len(arg_3))
    arg_0 *= 1.0
    arg_5 = arg_1
    for arg_6 in range(len(arg_3)):
       if abs(1 - 16*arg_5**2*(arg_3[arg_6]/arg_0)**2) <= np.finfo(np.float).eps/2:
           arg_4[arg_6] = 1/2.*((1+arg_5)*np.sin((1+arg_5)*np.pi/(4.*arg_5))-(1-arg_5)*np.cos((1-arg_5)*np.pi/(4.*arg_5))+(4*arg_5)/np.pi*np.sin((1-arg_5)*np.pi/(4.*arg_5)))
       else:
           arg_4[arg_6] = 4*arg_5/(np.pi*(1 - 16*arg_5**2*(arg_3[arg_6]/arg_0)**2))
           arg_4[arg_6] = arg_4[arg_6]*(np.cos((1+arg_5)*np.pi*arg_3[arg_6]/arg_0) + np.sinc((1-arg_5)*arg_3[arg_6]/arg_0)*(1-arg_5)*np.pi/(4.*arg_5))
    return arg_4

A truncated square root raised cosine pulse used in digital communications.

    The pulse shaping factor :math:`0 < \\alpha < 1` is required as well as the
    truncation factor M which sets the pulse duration to be :math:`2*M*T_{symbol}`.

    Parameters
    ----------
    Ns : number of samples per symbol
    alpha : excess bandwidth factor on (0, 1), e.g., 0.35
    M : equals RC one-sided symbol truncation factor

    Returns
    -------
    b : ndarray containing the pulse shape

    Notes
    -----
    The pulse shape b is typically used as the FIR filter coefficients
    when forming a pulse shaped digital communications waveform. When
    square root raised cosine (SRC) pulse is used to generate Tx signals and
    at the receiver used as a matched filter (receiver FIR filter), the
    received signal is now raised cosine shaped, thus having zero
    intersymbol interference and the optimum removal of additive white
    noise if present at the receiver input.

    Examples
    --------
    Ten samples per symbol and :math:`\\alpha = 0.35`.

    >>> import matplotlib.pyplot as plt
    >>> from numpy import arange
    >>> from sk_dsp_comm.digitalcom import sqrt_rc_imp
    >>> b = sqrt_rc_imp(10,0.35)
    >>> n = arange(-10*6,10*6+1)
    >>> plt.stem(n,b)
    >>> plt.show()

A truncated square root raised cosine pulse used in digital communications .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_3 = set ( ) elif type ( arg_2 ) is not set : arg_4 = utils . open_file_read ( arg_2 ) arg_3 = set ( [ x . rstrip ( ) for x in arg_4 . readlines ( ) ] ) utils . close ( arg_4 ) else : arg_3 = arg_2 arg_5 = sequences . file_reader ( arg_0 ) arg_6 = utils . open_file_write ( arg_1 ) arg_7 = 1 for arg_8 in arg_5 : arg_9 = '_' . join ( [ 'NODE' , str ( arg_7 ) , 'length' , str ( len ( arg_8 ) ) , 'cov' , '1' , 'ID' , arg_8 . id ] ) if arg_8 . id in arg_3 : arg_8 . id = arg_9 + ':' + arg_9 + ';' print ( arg_8 , file = arg_6 ) arg_8 . revcomp ( ) arg_8 . id = arg_9 + "':" + arg_9 + "';" print ( arg_8 , file = arg_6 ) else : arg_8 . id = arg_9 + ';' print ( arg_8 , file = arg_6 ) arg_8 . revcomp ( ) arg_8 . id = arg_9 + "';" print ( arg_8 , file = arg_6 ) arg_7 += 1 utils . close ( arg_6 )

def Func(arg_0, arg_1, arg_2=None):
    '''Writes a FASTG file in SPAdes format from input file. Currently only whether or not a sequence is circular is supported. Put circular=set of ids, or circular=filename to make those sequences circular in the output. Puts coverage=1 on all contigs'''
    if arg_2 is None:
        arg_3 = set()
    elif type(arg_2) is not set:
        arg_4 = utils.open_file_read(arg_2)
        arg_3 = set([x.rstrip() for x in arg_4.readlines()])
        utils.close(arg_4)
    else:
        arg_3 = arg_2

    arg_5 = sequences.file_reader(arg_0)
    arg_6 = utils.open_file_write(arg_1)
    arg_7 = 1

    for arg_8 in arg_5:
        arg_9 = '_'.join([
            'NODE', str(arg_7),
            'length', str(len(arg_8)),
            'cov', '1',
            'ID', arg_8.id
        ])

        if arg_8.id in arg_3:
            arg_8.id = arg_9 + ':' + arg_9 + ';'
            print(arg_8, file=arg_6)
            arg_8.revcomp()
            arg_8.id = arg_9 + "':" + arg_9 + "';"
            print(arg_8, file=arg_6)
        else:
            arg_8.id = arg_9 + ';'
            print(arg_8, file=arg_6)
            arg_8.revcomp()
            arg_8.id = arg_9 + "';"
            print(arg_8, file=arg_6)

        arg_7 += 1

    utils.close(arg_6)

Writes a FASTG file in SPAdes format from input file . Currently only whether or not a sequence is circular is supported . Put circular = set of ids or circular = filename to make those sequences circular in the output . Puts coverage = 1 on all contigs


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Func_coords ( arg_0 . coords , arg_1 , arg_2 ) return arg_0 . copy ( coords = arg_3 )

def Func(arg_0, arg_1, arg_2):
        """
        Project the line string onto a differently shaped image.

        E.g. if a point of the line string is on its original image at
        ``x=(10 of 100 pixels)`` and ``y=(20 of 100 pixels)`` and is Funced
        onto a new image with size ``(width=200, height=200)``, its new
        position will be ``(x=20, y=40)``.

        This is intended for cases where the original image is resized.
        It cannot be used for more complex changes (e.g. padding, cropping).

        Parameters
        ----------
        from_shape : tuple of int or ndarray
            Shape of the original image. (Before resize.)

        to_shape : tuple of int or ndarray
            Shape of the new image. (After resize.)

        Returns
        -------
        out : imgaug.augmentables.lines.LineString
            Line string with new coordinates.

        """
        arg_3 = Func_coords(arg_0.coords, arg_1, arg_2)
        return arg_0.copy(coords=arg_3)

Project the line string onto a differently shaped image.

        E.g. if a point of the line string is on its original image at
        ``x=(10 of 100 pixels)`` and ``y=(20 of 100 pixels)`` and is projected
        onto a new image with size ``(width=200, height=200)``, its new
        position will be ``(x=20, y=40)``.

        This is intended for cases where the original image is resized.
        It cannot be used for more complex changes (e.g. padding, cropping).

        Parameters
        ----------
        from_shape : tuple of int or ndarray
            Shape of the original image. (Before resize.)

        to_shape : tuple of int or ndarray
            Shape of the new image. (After resize.)

        Returns
        -------
        out : imgaug.augmentables.lines.LineString
            Line string with new coordinates.

Project the line string onto a differently shaped image .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_process_bit_id
(
arg_1
.
children
[
0
]
)
arg_3
=
arg_0
.
_process_bit_id
(
arg_1
.
children
[
1
]
)
if
not
(
len
(
arg_2
)
==
len
(
arg_3
)
or
len
(
arg_2
)
==
1
or
len
(
arg_3
)
==
1
)
:
raise
QiskitError
(
"internal error: qreg size mismatch"
,
"line=%s"
%
arg_1
.
line
,
"file=%s"
%
arg_1
.
file
)
arg_4
=
max
(
[
len
(
arg_2
)
,
len
(
arg_3
)
]
)
for
arg_5
in
range
(
arg_4
)
:
if
len
(
arg_2
)
>
1
and
len
(
arg_3
)
>
1
:
arg_0
.
dag
.
apply_operation_back
(
CXBase
(
)
,
[
arg_2
[
arg_5
]
,
arg_3
[
arg_5
]
]
,
[
]
,
arg_0
.
condition
)
elif
len
(
arg_2
)
>
1
:
arg_0
.
dag
.
apply_operation_back
(
CXBase
(
)
,
[
arg_2
[
arg_5
]
,
arg_3
[
0
]
]
,
[
]
,
arg_0
.
condition
)
else
:
arg_0
.
dag
.
apply_operation_back
(
CXBase
(
)
,
[
arg_2
[
0
]
,
arg_3
[
arg_5
]
]
,
[
]
,
arg_0
.
condition
)

def Func(arg_0, arg_1):
        """Process a CNOT gate node."""
        arg_2 = arg_0._process_bit_id(arg_1.children[0])
        arg_3 = arg_0._process_bit_id(arg_1.children[1])
        if not(len(arg_2) == len(arg_3) or len(arg_2) == 1 or len(arg_3) == 1):
            raise QiskitError("internal error: qreg size mismatch",
                              "line=%s" % arg_1.line, "file=%s" % arg_1.file)
        arg_4 = max([len(arg_2), len(arg_3)])
        for arg_5 in range(arg_4):
            if len(arg_2) > 1 and len(arg_3) > 1:
                arg_0.dag.apply_operation_back(CXBase(), [arg_2[arg_5], arg_3[arg_5]], [], arg_0.condition)
            elif len(arg_2) > 1:
                arg_0.dag.apply_operation_back(CXBase(), [arg_2[arg_5], arg_3[0]], [], arg_0.condition)
            else:
                arg_0.dag.apply_operation_back(CXBase(), [arg_2[0], arg_3[arg_5]], [], arg_0.condition)


def
Func
(
arg_0
)
:
arg_1
=
super
(
AuthForm
,
arg_0
)
.
Func
(
)
arg_2
=
arg_0
.
get_user
(
)
if
arg_0
.
staff_only
and
(
not
arg_2
or
not
arg_2
.
is_staff
)
:
raise
forms
.
ValidationError
(
'Sorry, only staff are allowed.'
)
if
arg_0
.
superusers_only
and
(
not
arg_2
or
not
arg_2
.
is_superuser
)
:
raise
forms
.
ValidationError
(
'Sorry, only superusers are allowed.'
)
return
arg_1

def Func(arg_0):
        """When receiving the filled out form, check for valid access."""
        arg_1 = super(AuthForm, arg_0).Func()
        arg_2 = arg_0.get_user()
        if arg_0.staff_only and (not arg_2 or not arg_2.is_staff):
            raise forms.ValidationError('Sorry, only staff are allowed.')
        if arg_0.superusers_only and (not arg_2 or not arg_2.is_superuser):
            raise forms.ValidationError('Sorry, only superusers are allowed.')
        return arg_1

When receiving the filled out form check for valid access .


def Func ( arg_0 , arg_1 , arg_2 = False ) : _validate_not_none ( 'queue_name' , arg_1 ) arg_3 = HTTPRequest ( ) arg_3 . method = 'DELETE' arg_3 . host = arg_0 . _get_host ( ) arg_3 . path = '/' + _str ( arg_1 ) + '' arg_3 . path , arg_3 . query = arg_0 . _httpclient . _update_request_uri_query ( arg_3 ) arg_3 . headers = arg_0 . _update_service_bus_header ( arg_3 ) if not arg_2 : try : arg_0 . _perform_request ( arg_3 ) return True except AzureHttpError as ex : _dont_fail_not_exist ( ex ) return False else : arg_0 . _perform_request ( arg_3 ) return True

def Func(arg_0, arg_1, arg_2=False):
        '''
        Deletes an existing queue. This operation will also remove all
        associated state including messages in the queue.

        queue_name:
            Name of the queue to delete.
        fail_not_exist:
            Specify whether to throw an exception if the queue doesn't exist.
        '''
        _validate_not_none('queue_name', arg_1)
        arg_3 = HTTPRequest()
        arg_3.method = 'DELETE'
        arg_3.host = arg_0._get_host()
        arg_3.path = '/' + _str(arg_1) + ''
        arg_3.path, arg_3.query = arg_0._httpclient._update_request_uri_query(arg_3)  # pylint: disable=protected-access
        arg_3.headers = arg_0._update_service_bus_header(arg_3)
        if not arg_2:
            try:
                arg_0._perform_request(arg_3)
                return True
            except AzureHttpError as ex:
                _dont_fail_not_exist(ex)
                return False
        else:
            arg_0._perform_request(arg_3)
            return True

Deletes an existing queue . This operation will also remove all associated state including messages in the queue .


return (self.bitAddrEnd - self.bitAddr) // self.itemCnt

def Func ( arg_0 ) -> int : if not isinstance ( arg_0 . dtype , HArray ) : raise TypeError ( ) return ( arg_0 . bitAddrEnd - arg_0 . bitAddr ) // arg_0 . itemCnt

def Func(arg_0) -> int:
        """
        Only for transactions derived from HArray

        :return: width of item in original array
        """
        if not isinstance(arg_0.dtype, HArray):
            raise TypeError()
        return (arg_0.bitAddrEnd - arg_0.bitAddr) // arg_0.itemCnt


return [self._models.getResultAndStatusNamedTuple._make(r) for r in rows]

def
Func
(
arg_0
,
arg_1
)
:
assert
isinstance
(
arg_1
,
arg_0
.
_SEQUENCE_TYPES
)
,
(
"Wrong modelIDs type: %r"
)
%
type
(
arg_1
)
assert
len
(
arg_1
)
>=
1
,
"modelIDs is empty"
arg_2
=
arg_0
.
_getMatchingRowsWithRetries
(
arg_0
.
_models
,
{
'model_id'
:
arg_1
}
,
[
arg_0
.
_models
.
pubToDBNameDict
[
f
]
for
f
in
arg_0
.
_models
.
getResultAndStatusNamedTuple
.
_fields
]
)
assert
len
(
arg_2
)
==
len
(
arg_1
)
,
"Didn't find modelIDs: %r"
%
(
(
set
(
arg_1
)
set
(
arg_3
[
0
]
for
arg_3
in
arg_2
)
)
,
)
return
[
arg_0
.
_models
.
getResultAndStatusNamedTuple
.
_make
(
arg_3
)
for
arg_3
in
arg_2
]

def Func(arg_0, arg_1):
    """ Get the results string and other status fields for a set of models.

    WARNING!!!: The order of the results are NOT necessarily in the same order
    as the order of the model IDs passed in!!!

    For each model, this returns a tuple containing:
     (modelID, results, status, updateCounter, numRecords, completionReason,
         completionMsg, engParamsHash

    Parameters:
    ----------------------------------------------------------------
    modelIDs:    list of model IDs
    retval:      list of result tuples. Each tuple contains:
                    (modelID, results, status, updateCounter, numRecords,
                      completionReason, completionMsg, engParamsHash)
    """
    assert isinstance(arg_1, arg_0._SEQUENCE_TYPES), (
      "Wrong modelIDs type: %r") % type(arg_1)
    assert len(arg_1) >= 1, "modelIDs is empty"

    arg_2 = arg_0._getMatchingRowsWithRetries(
      arg_0._models, {'model_id' : arg_1},
      [arg_0._models.pubToDBNameDict[f]
       for f in arg_0._models.getResultAndStatusNamedTuple._fields])

    # NOTE: assertion will also fail when modelIDs contains duplicates
    assert len(arg_2) == len(arg_1), "Didn't find modelIDs: %r" % (
      (set(arg_1) - set(arg_3[0] for arg_3 in arg_2)),)

    # Return the results as a list of namedtuples
    return [arg_0._models.getResultAndStatusNamedTuple._make(arg_3) for arg_3 in arg_2]

Get the results string and other status fields for a set of models .


def Func ( arg_0 , arg_1 = False ) : if arg_1 : arg_2 = arg_0 . norm ( ) arg_0 . data /= arg_2 return None arg_2 = arg_0 . norm ( ) arg_3 = np . array ( arg_0 . data , copy = True ) arg_3 /= arg_2 return Quaternion ( arg_3 )

def Func(arg_0, arg_1=False):
        """Normalizes a Quaternion to unit length
        so that it represents a valid rotation.

        Args:
            inplace (bool): Do an inplace normalization.

        Returns:
            Quaternion: Normalized quaternion.
        """
        if arg_1:
            arg_2 = arg_0.norm()
            arg_0.data /= arg_2
            return None
        arg_2 = arg_0.norm()
        arg_3 = np.array(arg_0.data, copy=True)
        arg_3 /= arg_2
        return Quaternion(arg_3)

Normalizes a Quaternion to unit length so that it represents a valid rotation .


def Func ( arg_0 ) : try : arg_0 = arg_0 . getroot ( ) except AttributeError : pass arg_1 = "{%s}" % XHTML_NAMESPACE arg_2 = len ( arg_1 ) for arg_3 in arg_0 . iter ( arg_1 + "*" ) : arg_3 . tag = arg_3 . tag [ arg_2 : ]

def Func(arg_0):
    """Convert all tags in an XHTML tree to HTML by removing their
    XHTML namespace.
    """
    try:
        arg_0 = arg_0.getroot()
    except AttributeError:
        pass
    arg_1 = "{%s}" % XHTML_NAMESPACE
    arg_2 = len(arg_1)
    for arg_3 in arg_0.iter(arg_1 + "*"):
        arg_3.tag = arg_3.tag[arg_2:]

Convert all tags in an XHTML tree to HTML by removing their XHTML namespace .


return (
            min(len(concat_comp), len(concat_comp2))
            - min(len(src_comp), len(tar_comp))
        ) / max(len(src_comp), len(tar_comp))

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 == arg_2 : return 0.0 arg_3 = arg_0 . _rle . encode ( arg_0 . _bwt . encode ( arg_1 ) ) arg_4 = arg_0 . _rle . encode ( arg_0 . _bwt . encode ( arg_2 ) ) arg_5 = arg_0 . _rle . encode ( arg_0 . _bwt . encode ( arg_1 + arg_2 ) ) arg_6 = arg_0 . _rle . encode ( arg_0 . _bwt . encode ( arg_2 + arg_1 ) ) return ( min ( len ( arg_5 ) , len ( arg_6 ) ) - min ( len ( arg_3 ) , len ( arg_4 ) ) ) / max ( len ( arg_3 ) , len ( arg_4 ) )

def Func(arg_0, arg_1, arg_2):
        """Return the NCD between two strings using BWT plus RLE.

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

        Returns
        -------
        float
            Compression Funcance

        Examples
        --------
        >>> cmp = NCDbwtrle()
        >>> cmp.Func('cat', 'hat')
        0.75
        >>> cmp.Func('Niall', 'Neil')
        0.8333333333333334
        >>> cmp.Func('aluminum', 'Catalan')
        1.0
        >>> cmp.Func('ATCG', 'TAGC')
        0.8

        """
        if arg_1 == arg_2:
            return 0.0

        arg_3 = arg_0._rle.encode(arg_0._bwt.encode(arg_1))
        arg_4 = arg_0._rle.encode(arg_0._bwt.encode(arg_2))
        arg_5 = arg_0._rle.encode(arg_0._bwt.encode(arg_1 + arg_2))
        arg_6 = arg_0._rle.encode(arg_0._bwt.encode(arg_2 + arg_1))

        return (
            min(len(arg_5), len(arg_6))
            - min(len(arg_3), len(arg_4))
        ) / max(len(arg_3), len(arg_4))

Return the NCD between two strings using BWT plus RLE.

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

        Returns
        -------
        float
            Compression distance

        Examples
        --------
        >>> cmp = NCDbwtrle()
        >>> cmp.dist('cat', 'hat')
        0.75
        >>> cmp.dist('Niall', 'Neil')
        0.8333333333333334
        >>> cmp.dist('aluminum', 'Catalan')
        1.0
        >>> cmp.dist('ATCG', 'TAGC')
        0.8

Return the NCD between two strings using BWT plus RLE .


(self, test, err, capt=None, tb_info=None)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None):
        """Add failure output to Xunit report.
        """
        arg_5 = arg_0._timeTaken()
        arg_6 = ''.join(traceback.format_exception(*arg_2))
        arg_0.stats['failures'] += 1
        arg_7 = arg_1.id()
        arg_0.errorlist.append(
            '<testcase classname=%(cls)s name=%(name)s time="%(taken).3f">'
            '<failure type=%(errtype)s message=%(message)s><![CDATA[%(tb)s]]>'
            '</failure></testcase>' %
            {'cls': arg_0._quoteattr(id_split(arg_7)[0]),
             'name': arg_0._quoteattr(id_split(arg_7)[-1]),
             'taken': arg_5,
             'errtype': arg_0._quoteattr(nice_classname(arg_2[0])),
             'message': arg_0._quoteattr(exc_message(arg_2)),
             'tb': escape_cdata(arg_6),
             })


def Func(arg_0, arg_1: arg_2=1) -> arg_2:
        """Increment the cursor to the next character."""
        if arg_1 < 0:
            raise ValueError("length must be positive")
        arg_3 = 0
        while (arg_3 < arg_1):
            if arg_0._cursor.index < arg_0._len:
                if arg_0.peek_char == '\n':
                    arg_0._cursor.step_next_line()
                arg_0._cursor.step_next_char()
            arg_3 += 1
        return arg_0._cursor.index

Increment the cursor to the next character .


def Func ( * arg_0 , ** arg_1 ) : from IPython . external . qt_for_kernel import QtGui arg_2 = QtGui . QApplication . instance ( ) if arg_2 is None : if not arg_0 : arg_0 = ( [ '' ] , ) arg_2 = QtGui . QApplication ( * arg_0 , ** arg_1 ) return arg_2

def Func(*arg_0, **arg_1):
    """Create a new qt4 app or return an existing one."""
    from IPython.external.qt_for_kernel import QtGui
    arg_2 = QtGui.QApplication.instance()
    if arg_2 is None:
        if not arg_0:
            arg_0 = ([''],)
        arg_2 = QtGui.QApplication(*arg_0, **arg_1)
    return arg_2

Create a new qt4 app or return an existing one .


def Func(arg_0, arg_1):
    """
    Returns the UUID with which the watch is
    registered. This UUID can be used to unregister
    the watch.
    Returns None if watch could not be registered.

    The argument 'callback' must be a function that takes
    exactly one argument, the topology on which
    the watch was triggered.
    Note that the watch will be unregistered in case
    it raises any Exception the first time.

    This callback is also called at the time
    of registration.
    """
    arg_2 = 5
    # Retry in case UID is previously
    # generated, just in case...
    for arg_3 in range(arg_2):
      # Generate a random UUID.
      arg_4 = uuid.uuid4()
      if arg_4 not in arg_0.watches:
        Log.info("Registering a watch with uid: " + str(arg_4))
        try:
          arg_1(arg_0)
        except Exception as e:
          Log.error("Caught exception while triggering callback: " + str(e))
          Log.debug(traceback.format_exc())
          return None
        arg_0.watches[arg_4] = arg_1
        return arg_4
    return None

Returns the UUID with which the watch is registered . This UUID can be used to unregister the watch . Returns None if watch could not be registered .


def Func ( arg_0 , arg_1 = None ) : arg_1 . query ( XCom ) . filter ( XCom . dag_id == arg_0 . dag_id , XCom . task_id == arg_0 . task_id , XCom . execution_date == arg_0 . execution_date ) . delete ( ) arg_1 . commit ( )

def Func(arg_0, arg_1=None):
        """
        Clears all XCom data from the database for the task instance
        """
        arg_1.query(XCom).filter(
            XCom.dag_id == arg_0.dag_id,
            XCom.task_id == arg_0.task_id,
            XCom.execution_date == arg_0.execution_date
        ).delete()
        arg_1.commit()


(rho, z, alpha=1.0, zint=100.0, n2n1=0.95, get_hdet=False, K=1,
        Kprefactor=None, return_Kprefactor=False, npts=20, **kwargs)

def Func(arg_0, arg_1, arg_2=1.0, arg_3=100.0, arg_4=0.95, arg_5=False, arg_6=1,
        arg_7=None, arg_8=False, arg_9=20, **arg_10):
    """
    Calculates one of three electric field integrals.

    Internal function for calculating point spread functions. Returns
    one of three electric field integrals that describe the electric
    field near the focus of a lens; these integrals appear in Hell's psf
    calculation.

    Parameters
    ----------
        rho : numpy.ndarray
            Rho in cylindrical coordinates, in units of 1/k.
        z : numpy.ndarray
            Z in cylindrical coordinates, in units of 1/k. `rho` and
            `z` must be the same shape

        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
        get_hdet : Bool, optional
            Set to True to get the detection portion of the psf; False
            to get the illumination portion of the psf. Default is True
        K : {1, 2, 3}, optional
            Which of the 3 integrals to evaluate. Default is 1
        Kprefactor : numpy.ndarray or None
            This array is calculated internally and optionally returned;
            pass it back to avoid recalculation and increase speed. Default
            is None, i.e. calculate it internally.
        return_Kprefactor : Bool, optional
            Set to True to also return the Kprefactor (parameter above)
            to speed up the calculation for the next values of K. Default
            is False
        npts : Int, optional
            The number of points to use for Gauss-Legendre quadrature of
            the integral. Default is 20, which is a good number for x,y,z
            less than 100 or so.

    Returns
    -------
        kint : numpy.ndarray
            The integral K_i; rho.shape numpy.array
        [, Kprefactor] : numpy.ndarray
            The prefactor that is independent of which integral is being
            calculated but does depend on the parameters; can be passed
            back to the function for speed.

    Notes
    -----
        npts=20 gives double precision (no difference between 20, 30, and
        doing all the integrals with scipy.quad). The integrals are only
        over the acceptance angle of the lens, so for moderate x,y,z they
        don't vary too rapidly. For x,y,z, zint large compared to 100, a
        higher npts might be necessary.
    """
    # Comments:
        # This is the only function that relies on rho,z being numpy.arrays,
        # and it's just in a flag that I've added.... move to psf?
    if type(arg_0) != np.ndarray or type(arg_1) != np.ndarray or (arg_0.shape != arg_1.shape):
        raise ValueError('rho and z must be np.arrays of same shape.')

    arg_11, arg_12 = np.polynomial.legendre.leggauss(arg_9)
    arg_13 = 1.0/arg_4

    arg_14 = np.ravel(arg_0)
    arg_15 = np.ravel(arg_1)

    #Getting the array of points to quad at
    arg_16 = 0.5*(1-np.cos(arg_2))*arg_11+0.5*(1+np.cos(arg_2))
    #[cos_theta,rho,z]

    if arg_7 is None:
        arg_7 = Funcprefactor(arg_1, arg_16, arg_3=arg_3, \
            arg_4=arg_4,arg_5=arg_5, **arg_10)

    if arg_6==1:
        arg_17 = j0(np.outer(arg_14,np.sqrt(1-arg_16**2)))*\
            np.outer(np.ones_like(arg_14), 0.5*(get_taus(arg_16,arg_4=arg_4)+\
            get_taup(arg_16,arg_4=arg_4)*csqrt(1-arg_13**2*(1-arg_16**2))))
        arg_18 = arg_7 * arg_17
    elif arg_6==2:
        arg_19=j2(np.outer(arg_14,np.sqrt(1-arg_16**2)))*\
            np.outer(np.ones_like(arg_14),0.5*(get_taus(arg_16,arg_4=arg_4)-\
            get_taup(arg_16,arg_4=arg_4)*csqrt(1-arg_13**2*(1-arg_16**2))))
        arg_18 = arg_7 * arg_19
    elif arg_6==3:
        arg_20=j1(np.outer(arg_0,np.sqrt(1-arg_16**2)))*\
            np.outer(np.ones_like(arg_14), arg_13*get_taup(arg_16,arg_4=arg_4)*\
            np.sqrt(1-arg_16**2))
        arg_18 = arg_7 * arg_20
    else:
        raise ValueError('K=1,2,3 only...')

    arg_21=np.outer(np.ones_like(arg_14), arg_12)
    arg_22 = (arg_21*arg_18).sum(axis=1) * 0.5*(1-np.cos(arg_2))

    if arg_8:
        return arg_22.reshape(arg_0.shape), arg_7
    else:
        return arg_22.reshape(arg_0.shape)

Calculates one of three electric field integrals .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] for arg_4 in arg_1 : if arg_4 [ 'premium' ] : arg_4 [ 'final_price' ] = EcommerceApiClient ( arg_2 . user ) . get_course_final_price ( arg_4 = arg_4 , enterprise_catalog_uuid = arg_2 . GET . get ( 'catalog' ) if arg_2 . method == 'GET' else None , ) arg_3 . append ( arg_4 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Set the final discounted price on each premium mode.
        """
        arg_3 = []
        for arg_4 in arg_1:
            if arg_4['premium']:
                arg_4['final_price'] = EcommerceApiClient(arg_2.user).get_course_final_price(
                    arg_4=arg_4,
                    enterprise_catalog_uuid=arg_2.GET.get(
                        'catalog'
                    ) if arg_2.method == 'GET' else None,
                )
            arg_3.append(arg_4)
        return arg_3

Set the final discounted price on each premium mode .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
LOG
.
warn
(
"Func error=%s"
,
arg_2
)
arg_1
.
close
(
)
arg_0
.
done
=
True

def Func(arg_0, arg_1, arg_2):
        """Protocol error occurred."""
        LOG.warn("Func error=%s", arg_2)
        arg_1.close()
        arg_0.done = True


def Func ( arg_0 ) : for arg_1 , arg_2 in enumerate ( arg_0 . _elements ) : if isinstance ( arg_2 , tuple ) : arg_2 = PathElement ( * arg_2 ) arg_0 . _elements [ arg_1 ] = arg_2 yield arg_2

def Func(arg_0):
        '''
        Yields all elements as PathElements
        '''
        for arg_1, arg_2 in enumerate(arg_0._elements):
            if isinstance(arg_2, tuple):
                arg_2 = PathElement(*arg_2)
                arg_0._elements[arg_1] = arg_2
            yield arg_2


def Func ( ** arg_0 ) : arg_1 = inputs_options_defaults ( ) arg_2 = { name : dct [ 'value' ] for name , dct in arg_1 . items ( ) } for arg_3 , arg_4 in arg_0 . items ( ) : del arg_0 [ arg_3 ] if isinstance ( arg_4 , bool ) : arg_0 [ arg_3 ] = 'Y' if arg_4 else 'N' elif arg_3 . lower ( ) in ( 'tm' , 'team' ) : arg_0 [ 'team_id' ] = arg_4 elif arg_3 . lower ( ) in ( 'yr' , 'year' , 'yrs' , 'years' ) : if isinstance ( arg_4 , collections . Iterable ) : arg_5 = list ( arg_4 ) arg_0 [ 'year_min' ] = min ( arg_5 ) arg_0 [ 'year_max' ] = max ( arg_5 ) elif isinstance ( arg_4 , basestring ) : arg_4 = list ( map ( int , arg_4 . split ( ',' ) ) ) arg_0 [ 'year_min' ] = min ( arg_4 ) arg_0 [ 'year_max' ] = max ( arg_4 ) else : arg_0 [ 'year_min' ] = arg_4 arg_0 [ 'year_max' ] = arg_4 elif arg_3 . lower ( ) in ( 'pos' , 'position' , 'positions' ) : if isinstance ( arg_4 , basestring ) : arg_4 = arg_4 . split ( ',' ) elif not isinstance ( arg_4 , collections . Iterable ) : arg_4 = [ arg_4 ] arg_0 [ 'pos[]' ] = arg_4 elif arg_3 . lower ( ) in ( 'draft_pos' , 'draftpos' , 'draftposition' , 'draftpositions' , 'draft_position' , 'draft_positions' ) : if isinstance ( arg_4 , basestring ) : arg_4 = arg_4 . split ( ',' ) elif not isinstance ( arg_4 , collections . Iterable ) : arg_4 = [ arg_4 ] arg_0 [ 'draft_pos[]' ] = arg_4 else : arg_0 [ arg_3 ] = arg_4 for arg_3 , arg_4 in arg_0 . items ( ) : if arg_3 in arg_2 or arg_3 in ( 'pos[]' , 'draft_pos[]' ) : if isinstance ( arg_4 , basestring ) : arg_4 = arg_4 . split ( ',' ) elif not isinstance ( arg_4 , collections . Iterable ) : arg_4 = [ arg_4 ] arg_2 [ arg_3 ] = arg_4 if 'draft' in arg_3 : arg_2 [ 'draft' ] = [ 1 ] arg_2 [ 'request' ] = [ 1 ] arg_2 [ 'offset' ] = [ arg_0 . get ( 'offset' , 0 ) ] arg_6 = '&' . join ( '{}={}' . format ( urllib . parse . quote_plus ( name ) , val ) for name , vals in sorted ( arg_2 . items ( ) ) for val in vals ) return arg_6

def Func(**arg_0):
    """Converts kwargs given to PSF to a querystring.

    :returns: the querystring.
    """
    # start with defaults
    arg_1 = inputs_options_defaults()
    arg_2 = {
        name: dct['value']
        for name, dct in arg_1.items()
    }

    # clean up keys and values
    for arg_3, arg_4 in arg_0.items():
        del arg_0[arg_3]
        # bool => 'Y'|'N'
        if isinstance(arg_4, bool):
            arg_0[arg_3] = 'Y' if arg_4 else 'N'
        # tm, team => team_id
        elif arg_3.lower() in ('tm', 'team'):
            arg_0['team_id'] = arg_4
        # yr, year, yrs, years => year_min, year_max
        elif arg_3.lower() in ('yr', 'year', 'yrs', 'years'):
            if isinstance(arg_4, collections.Iterable):
                arg_5 = list(arg_4)
                arg_0['year_min'] = min(arg_5)
                arg_0['year_max'] = max(arg_5)
            elif isinstance(arg_4, basestring):
                arg_4 = list(map(int, arg_4.split(',')))
                arg_0['year_min'] = min(arg_4)
                arg_0['year_max'] = max(arg_4)
            else:
                arg_0['year_min'] = arg_4
                arg_0['year_max'] = arg_4
        # pos, position, positions => pos[]
        elif arg_3.lower() in ('pos', 'position', 'positions'):
            if isinstance(arg_4, basestring):
                arg_4 = arg_4.split(',')
            elif not isinstance(arg_4, collections.Iterable):
                arg_4 = [arg_4]
            arg_0['pos[]'] = arg_4
        # draft_pos, ... => draft_pos[]
        elif arg_3.lower() in (
            'draft_pos', 'draftpos', 'draftposition', 'draftpositions',
            'draft_position', 'draft_positions'
        ):
            if isinstance(arg_4, basestring):
                arg_4 = arg_4.split(',')
            elif not isinstance(arg_4, collections.Iterable):
                arg_4 = [arg_4]
            arg_0['draft_pos[]'] = arg_4
        # if not one of these cases, put it back in kwargs
        else:
            arg_0[arg_3] = arg_4

    # update based on kwargs
    for arg_3, arg_4 in arg_0.items():
        # if overwriting a default, overwrite it (with a list so the
        # opts -> querystring list comp works)
        if arg_3 in arg_2 or arg_3 in ('pos[]', 'draft_pos[]'):
            # if multiple values separated by commas, split em
            if isinstance(arg_4, basestring):
                arg_4 = arg_4.split(',')
            # otherwise, make sure it's a list
            elif not isinstance(arg_4, collections.Iterable):
                arg_4 = [arg_4]
            # then, add list of values to the querystring dict *opts*
            arg_2[arg_3] = arg_4
        if 'draft' in arg_3:
            arg_2['draft'] = [1]

    arg_2['request'] = [1]
    arg_2['offset'] = [arg_0.get('offset', 0)]

    arg_6 = '&'.join(
        '{}={}'.format(urllib.parse.quote_plus(name), val)
        for name, vals in sorted(arg_2.items()) for val in vals
    )

    return arg_6

Converts kwargs given to PSF to a querystring .


(self, size="150", axis=None, padding=None)

def Func ( arg_0 , arg_1 = "150" , arg_2 = None , arg_3 = None ) : if type ( arg_1 ) is not str : arg_1 = tupleize ( ( arg_1 ) ) arg_2 = tupleize ( ( arg_2 ) ) arg_3 = tupleize ( ( arg_3 ) ) from bolt . spark . Func import ChunkedArray arg_4 = ChunkedArray ( rdd = arg_0 . _rdd , shape = arg_0 . _shape , split = arg_0 . _split , dtype = arg_0 . _dtype ) return arg_4 . _Func ( arg_1 , arg_2 , arg_3 )

def Func(arg_0, arg_1="150", arg_2=None, arg_3=None):
        """
        Chunks records of a distributed array.

        Chunking breaks arrays into subarrays, using an specified
        size of Funcs along each value dimension. Can alternatively
        specify an average Func byte size (in kilobytes) and the size of
        Funcs (as ints) will be computed automatically.

        Parameters
        ----------
        size : tuple, int, or str, optional, default = "150"
            A string giving the size in kilobytes, or a tuple with the size
            of Funcs along each dimension.

        axis : int or tuple, optional, default = None
            One or more axis to Func array along, if None
            will use all axes,

        padding: tuple or int, default = None
            Number of elements per dimension that will overlap with the adjacent Func.
            If a tuple, specifies padding along each Funced dimension; if a int, same
            padding will be applied to all Funced dimensions.

        Returns
        -------
        ChunkedArray
        """
        if type(arg_1) is not str:
            arg_1 = tupleize((arg_1))
        arg_2 = tupleize((arg_2))
        arg_3 = tupleize((arg_3))

        from bolt.spark.Func import ChunkedArray

        arg_4 = ChunkedArray(rdd=arg_0._rdd, shape=arg_0._shape, split=arg_0._split, dtype=arg_0._dtype)
        return arg_4._Func(arg_1, arg_2, arg_3)

Chunks records of a distributed array.

        Chunking breaks arrays into subarrays, using an specified
        size of chunks along each value dimension. Can alternatively
        specify an average chunk byte size (in kilobytes) and the size of
        chunks (as ints) will be computed automatically.

        Parameters
        ----------
        size : tuple, int, or str, optional, default = "150"
            A string giving the size in kilobytes, or a tuple with the size
            of chunks along each dimension.

        axis : int or tuple, optional, default = None
            One or more axis to chunk array along, if None
            will use all axes,

        padding: tuple or int, default = None
            Number of elements per dimension that will overlap with the adjacent chunk.
            If a tuple, specifies padding along each chunked dimension; if a int, same
            padding will be applied to all chunked dimensions.

        Returns
        -------
        ChunkedArray


def Func(arg_0, arg_1):
    """ Get all info about a job

    Parameters:
    ----------------------------------------------------------------
    job:    jobID of the job to query
    retval:  namedtuple containing the job info.

    """
    arg_2 = arg_0._getOneMatchingRowWithRetries(
      arg_0._jobs, dict(job_id=arg_1),
      [arg_0._jobs.pubToDBNameDict[n]
       for n in arg_0._jobs.FuncNamedTuple._fields])

    if arg_2 is None:
      raise RuntimeError("jobID=%s not found within the jobs table" % (arg_1))

    # Create a namedtuple with the names to values
    return arg_0._jobs.FuncNamedTuple._make(arg_2)


def Func(arg_0, arg_1, arg_2, arg_3, **arg_4):
        """
        Create a link bitstream.

        :param token: A valid token for the user in question.
        :type token: string
        :param folder_id: The id of the folder in which to create a new item
            that will contain the link. The new item will have the same name as
            the URL unless an item name is supplied.
        :type folder_id: int | long
        :param url: The URL of the link you will create, will be used as the
            name of the bitstream and of the item unless an item name is
            supplied.
        :type url: string
        :param item_name: (optional)  The name of the newly created item, if
            not supplied, the item will have the same name as the URL.
        :type item_name: string
        :param length: (optional) The length in bytes of the file to which the
            link points.
        :type length: int | long
        :param checksum: (optional) The MD5 checksum of the file to which the
            link points.
        :type checksum: string
        :returns: The item information of the item created.
        :rtype: dict
        """
        arg_5 = dict()
        arg_5['token'] = arg_1
        arg_5['folderid'] = arg_2
        arg_5['url'] = arg_3
        arg_6 = ['item_name', 'length', 'checksum']
        for arg_7 in arg_6:
            if arg_7 in arg_4:
                if arg_7 == 'item_name':
                    arg_5['itemname'] = arg_4[arg_7]
                    continue
                arg_5[arg_7] = arg_4[arg_7]
        arg_8 = arg_0.request('midas.link.create', arg_5)
        return arg_8


(_input, nameservers=None, dns_timeout=2.0,
                                parallel=False)

return parse_aggregate_report_xml(xml,
                                      nameservers=nameservers,
                                      timeout=dns_timeout,
                                      parallel=parallel)

def Func(arg_0, arg_1=None, arg_2=2.0,
                                arg_3=False):
    """Parses a file at the given path, a file-like object. or bytes as a
    aggregate DMARC report

    Args:
        _input: A path to a file, a file like object, or bytes
        nameservers (list): A list of one or more nameservers to use
        (Cloudflare's public DNS resolvers by default)
        dns_timeout (float): Sets the DNS timeout in seconds
        parallel (bool): Parallel processing

    Returns:
        OrderedDict: The parsed DMARC aggregate report
    """
    arg_4 = extract_xml(arg_0)

    return parse_aggregate_report_xml(arg_4,
                                      arg_1=arg_1,
                                      timeout=arg_2,
                                      arg_3=arg_3)

Parses a file at the given path a file - like object . or bytes as a aggregate DMARC report


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_0
.
_ftp
.
delete
(
arg_1
)
except
error_peFunc
:
try
:
arg_2
=
arg_0
.
_ftp
.
pwd
(
)
arg_0
.
cd
(
arg_1
)
except
error_peFunc
:
print
(
'550 Delete operation failed %s '
'does not exist!'
%
(
arg_1
,
)
)
else
:
arg_0
.
cd
(
arg_2
)
print
(
'550 Delete operation failed %s '
'is a folder. Use Funcdir function '
'to delete it.'
%
(
arg_1
,
)
)

def Func(arg_0, arg_1):
        """ Delete a file from the server.

        :param filename: the file to be deleted.
        :type filename: string
        """
        try:
            arg_0._ftp.delete(arg_1)
        except error_peFunc:  # target is either a directory
                            # either it does not exist
            try:
                arg_2 = arg_0._ftp.pwd()
                arg_0.cd(arg_1)
            except error_peFunc:
                print('550 Delete operation failed %s '
                      'does not exist!' % (arg_1,))
            else:
                arg_0.cd(arg_2)
                print('550 Delete operation failed %s '
                      'is a folder. Use Funcdir function '
                      'to delete it.' % (arg_1,))


return cart.revision == self.invoice.cart_revision

def Func ( arg_0 ) : arg_0 . _refresh ( ) arg_1 = arg_0 . invoice . cart if not arg_1 : return True return arg_1 . revision == arg_0 . invoice . cart_revision

def Func(arg_0):
        ''' Returns true if there is no cart, or if the revision of this
        invoice matches the current revision of the cart. '''

        arg_0._refresh()

        arg_1 = arg_0.invoice.cart
        if not arg_1:
            return True

        return arg_1.revision == arg_0.invoice.cart_revision

Returns true if there is no cart or if the revision of this invoice matches the current revision of the cart .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = 'day' for arg_4 in arg_1 : try : date_obj = datetime . strptime ( arg_0 , arg_4 ) except ValueError : continue else : if '%d' not in arg_4 : arg_3 = 'month' date_obj = date_obj . replace ( day = get_last_day_of_month ( date_obj . year , date_obj . month ) ) if not ( '%y' in arg_4 or '%Y' in arg_4 ) : today = datetime . today ( ) date_obj = date_obj . replace ( year = today . year ) date_obj = apply_timezone_from_settings ( date_obj , arg_2 ) return { 'date_obj' : date_obj , 'period' : arg_3 } else : return { 'date_obj' : None , 'period' : arg_3 }

def Func(arg_0, arg_1, arg_2):
    """ Parse with formats and return a dictionary with 'period' and 'obj_date'.

    :returns: :class:`datetime.datetime`, dict or None

    """
    arg_3 = 'day'
    for arg_4 in arg_1:
        try:
            date_obj = datetime.strptime(arg_0, arg_4)
        except ValueError:
            continue
        else:
            # If format does not include the day, use last day of the month
            # instead of first, because the first is usually out of range.
            if '%d' not in arg_4:
                arg_3 = 'month'
                date_obj = date_obj.replace(
                    day=get_last_day_of_month(date_obj.year, date_obj.month))

            if not ('%y' in arg_4 or '%Y' in arg_4):
                today = datetime.today()
                date_obj = date_obj.replace(year=today.year)

            date_obj = apply_timezone_from_settings(date_obj, arg_2)

            return {'date_obj': date_obj, 'period': arg_3}
    else:
        return {'date_obj': None, 'period': arg_3}

Parse with formats and return a dictionary with period and obj_date .


(self, institute, case, user, link, phenotype_id,
                         is_group=False)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                         arg_6=False):
        """Remove an existing phenotype from a case

        Args:
            institute (dict): A Institute object
            case (dict): Case object
            user (dict): A User object
            link (dict): The url to be used in the event
            phenotype_id (str): A phenotype id

        Returns:
            updated_case(dict)
        """
        LOG.info("Removing HPO term from case {0}".format(arg_2['display_name']))

        if arg_6:
            arg_7 = arg_0.case_collection.find_one_and_update(
                {'_id': arg_2['_id']},
                {
                    '$pull': {
                        'phenotype_terms': {'phenotype_id': arg_5},
                        'phenotype_groups': {'phenotype_id': arg_5},
                    },
                },
                return_document=pymongo.ReturnDocument.AFTER
            )

        else:
            arg_7 = arg_0.case_collection.find_one_and_update(
                {'_id': arg_2['_id']},
                {
                    '$pull': {
                        'phenotype_terms': {'phenotype_id': arg_5},
                    },
                },
                return_document=pymongo.ReturnDocument.AFTER
            )

        LOG.info("Creating event for removing phenotype term {0}" \
                    " from case {1}".format(arg_5, arg_2['display_name']))

        arg_0.create_event(
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            category='case',
            verb='Func',
            subject=arg_2['display_name']
        )

        LOG.debug("Case updated")
        return arg_7


def
Func
(
arg_0
,
arg_1
=
[
]
)
:
if
not
os
.
path
.
exists
(
arg_0
+
"/swhlab4/"
)
:
print
(
" !! cannot index if no /swhlab4/"
)
return
arg_2
=
cm
.
timethis
(
)
arg_3
=
glob
.
glob
(
arg_0
+
"/*.*"
)
arg_3
.
extend
(
glob
.
glob
(
arg_0
+
"/swhlab4/*.*"
)
)
print
(
" -- indexing glob took %.02f ms"
%
(
cm
.
timethis
(
arg_2
)
*
1000
)
)
arg_3
.
extend
(
genPNGs
(
arg_0
,
arg_3
)
)
arg_3
=
sorted
(
arg_3
)
arg_2
=
cm
.
timethis
(
)
arg_4
=
cm
.
getIDfileDict
(
arg_3
)
print
(
" -- filedict length:"
,
len
(
arg_4
)
)
print
(
" -- generating ID dict took %.02f ms"
%
(
cm
.
timethis
(
arg_2
)
*
1000
)
)
arg_5
=
cm
.
getABFgroups
(
arg_3
)
print
(
" -- groups length:"
,
len
(
arg_5
)
)
for
arg_6
in
sorted
(
list
(
arg_5
.
keys
(
)
)
)
:
arg_7
=
False
for
arg_8
in
arg_5
[
arg_6
]
:
if
arg_8
in
arg_1
:
arg_7
=
True
try
:
htmlABF
(
arg_6
,
arg_5
[
arg_6
]
,
arg_4
,
arg_0
,
arg_7
)
except
:
print
(
"~~ HTML GENERATION FAILED!!!"
)
arg_9
=
expMenu
(
arg_5
,
arg_0
)
makeSplash
(
arg_9
,
arg_0
)
makeMenu
(
arg_9
,
arg_0
)
htmlFrames
(
arg_4
,
arg_0
)
makeMenu
(
arg_9
,
arg_0
)
makeSplash
(
arg_9
,
arg_0
)

def Func(arg_0,arg_1=[]):
    """expects a folder of ABFs."""
    if not os.path.exists(arg_0+"/swhlab4/"):
        print(" !! cannot index if no /swhlab4/")
        return
    arg_2=cm.timethis()
    arg_3=glob.glob(arg_0+"/*.*") #ABF folder
    arg_3.extend(glob.glob(arg_0+"/swhlab4/*.*"))
    print(" -- indexing glob took %.02f ms"%(cm.timethis(arg_2)*1000))
    arg_3.extend(genPNGs(arg_0,arg_3))
    arg_3=sorted(arg_3)
    arg_2=cm.timethis()
    arg_4=cm.getIDfileDict(arg_3) #TODO: this is really slow
    print(" -- filedict length:",len(arg_4))
    print(" -- generating ID dict took %.02f ms"%(cm.timethis(arg_2)*1000))
    arg_5=cm.getABFgroups(arg_3)
    print(" -- groups length:",len(arg_5))
    for arg_6 in sorted(list(arg_5.keys())):
        arg_7=False
        for arg_8 in arg_5[arg_6]:
            if arg_8 in arg_1:
                arg_7=True
        try:
            htmlABF(arg_6,arg_5[arg_6],arg_4,arg_0,arg_7)
        except:
            print("~~ HTML GENERATION FAILED!!!")
    arg_9=expMenu(arg_5,arg_0)
    makeSplash(arg_9,arg_0)
    makeMenu(arg_9,arg_0)
    htmlFrames(arg_4,arg_0)
    makeMenu(arg_9,arg_0)
    makeSplash(arg_9,arg_0)


def
Func
(
arg_0
)
:
print
(
'Oct2Py speed test'
)
print
(
'*'
*
20
)
time
.
sleep
(
1
)
print
(
'Raw speed: '
)
arg_1
=
timeit
.
timeit
(
arg_0
.
raw_speed
,
number
=
10
)
/
10
print
(
'    {0:0.01f} usec per loop'
.
format
(
arg_1
*
1e6
)
)
arg_2
=
[
1
,
10
,
100
,
1000
]
arg_3
=
[
10
,
10
,
10
,
5
]
for
(
arg_4
,
arg_5
)
in
zip
(
arg_2
,
arg_3
)
:
arg_0
.
array
=
np
.
reshape
(
np
.
arange
(
arg_4
**
2
)
,
(
1
)
)
print
(
'Put {0}x{1}: '
.
format
(
arg_4
,
arg_4
)
)
arg_1
=
timeit
.
timeit
(
arg_0
.
large_array_put
,
number
=
arg_5
)
/
arg_5
print
(
'    {0:0.01f} msec'
.
format
(
arg_1
*
1e3
)
)
print
(
'Get {0}x{1}: '
.
format
(
arg_4
,
arg_4
)
)
arg_1
=
timeit
.
timeit
(
arg_0
.
large_array_get
,
number
=
arg_5
)
/
arg_5
print
(
'    {0:0.01f} msec'
.
format
(
arg_1
*
1e3
)
)
arg_0
.
octave
.
exit
(
)
print
(
'*'
*
20
)
print
(
'Test complete!'
)

def Func(arg_0):
        """Perform the Oct2Py speed analysis.

        Uses timeit to test the raw execution of an Octave command,
        Then tests progressively larger array passing.

        """
        print('Oct2Py speed test')
        print('*' * 20)
        time.sleep(1)

        print('Raw speed: ')
        arg_1 = timeit.timeit(arg_0.raw_speed, number=10) / 10
        print('    {0:0.01f} usec per loop'.format(arg_1 * 1e6))
        arg_2 = [1, 10, 100, 1000]
        arg_3 = [10, 10, 10, 5]
        for (arg_4, arg_5) in zip(arg_2, arg_3):
            arg_0.array = np.reshape(np.arange(arg_4 ** 2), (-1))
            print('Put {0}x{1}: '.format(arg_4, arg_4))
            arg_1 = timeit.timeit(arg_0.large_array_put, number=arg_5) / arg_5
            print('    {0:0.01f} msec'.format(arg_1 * 1e3))

            print('Get {0}x{1}: '.format(arg_4, arg_4))
            arg_1 = timeit.timeit(arg_0.large_array_get, number=arg_5) / arg_5
            print('    {0:0.01f} msec'.format(arg_1 * 1e3))

        arg_0.octave.exit()
        print('*' * 20)
        print('Test complete!')

Perform the Oct2Py speed analysis . Uses timeit to test the raw execution of an Octave command Then tests progressively larger array passing .


(sender, instance=None, *args, **kwargs)

def Func ( arg_0 , arg_1 = None , * arg_2 , ** arg_3 ) : if issubclass ( arg_0 , SyncableModel ) : arg_1 . _update_deleted_models ( )

def Func(arg_0, arg_1=None, *arg_2, **arg_3):
    """
    Whenever a model is deleted, we record its ID in a separate model for tracking purposes. During serialization, we will mark
    the model as deleted in the store.
    """
    if issubclass(arg_0, SyncableModel):
        arg_1._update_deleted_models()

Whenever a model is deleted we record its ID in a separate model for tracking purposes . During serialization we will mark the model as deleted in the store .


return m3u_url, segments_size, segment_list

def Func ( arg_0 ) : arg_1 = loads ( get_content ( arg_0 ) ) arg_2 = arg_1 [ 'info' ] arg_3 = urlsplit ( arg_2 ) arg_4 = "{scheme}://{netloc}{path}/" . format ( scheme = arg_3 [ 0 ] , netloc = arg_3 [ 1 ] , path = dirname ( arg_3 [ 2 ] ) ) arg_1 = get_content ( arg_1 [ 'info' ] ) arg_5 = [ ] arg_6 = 0 for arg_7 in arg_1 . split ( ) : if not arg_7 . startswith ( '#' ) : arg_5 . append ( arg_4 + arg_7 ) elif arg_7 . startswith ( '#EXT-MGTV-File-SIZE:' ) : arg_6 += int ( arg_7 [ arg_7 . rfind ( ':' ) + 1 : ] ) return arg_2 , arg_6 , arg_5

def Func(arg_0):
        """str->list of str
        Give you the real URLs."""
        arg_1 = loads(get_content(arg_0))
        arg_2 = arg_1['info']
        arg_3 = urlsplit(arg_2)

        arg_4 = "{scheme}://{netloc}{path}/".format(scheme = arg_3[0],
                                                      netloc = arg_3[1],
                                                      path = dirname(arg_3[2]))

        arg_1 = get_content(arg_1['info'])  #get the REAL M3U url, maybe to be changed later?
        arg_5 = []
        arg_6 = 0
        for arg_7 in arg_1.split():
            if not arg_7.startswith('#'):  #not the best way, better we use the m3u8 package
                arg_5.append(arg_4 + arg_7)
            # use ext-info for fast size calculate
            elif arg_7.startswith('#EXT-MGTV-File-SIZE:'):
                arg_6 += int(arg_7[arg_7.rfind(':')+1:])

        return arg_2, arg_6, arg_5

str - > list of str Give you the real URLs .


def Func(arg_0, arg_1):
        """Same as `send` but assume `lock` is acquired."""
        arg_0.fix_out_stanza(arg_1)
        arg_2 = arg_1.as_xml()
        arg_0._write_element(arg_2)

Same as send but assume lock is acquired .


def
Func
(
)
:
arg_0
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
)
,
'dsub/_dsub_version.py'
)
with
open
(
arg_0
,
'r'
)
as
versionfile
:
for
arg_1
in
versionfile
:
if
arg_1
.
startswith
(
'DSUB_VERSION ='
)
:
arg_2
=
arg_1
.
partition
(
'='
)
[
2
]
return
arg_2
.
strip
(
)
.
strip
(
'\'"'
)
raise
ValueError
(
'Could not find version.'
)

def Func():
  """Get the dsub version out of the _dsub_version.py source file.

  Setup.py should not import dsub version from dsub directly since ambiguity in
  import order could lead to an old version of dsub setting the version number.
  Parsing the file directly is simpler than using import tools (whose interface
  varies between python 2.7, 3.4, and 3.5).

  Returns:
    string of dsub version.

  Raises:
    ValueError: if the version is not found.
  """
  arg_0 = os.path.join(os.path.dirname(__file__), 'dsub/_dsub_version.py')
  with open(arg_0, 'r') as versionfile:
    for arg_1 in versionfile:
      if arg_1.startswith('DSUB_VERSION ='):
        # Get the version then strip whitespace and quote characters.
        arg_2 = arg_1.partition('=')[2]
        return arg_2.strip().strip('\'"')
  raise ValueError('Could not find version.')

Get the dsub version out of the _dsub_version . py source file .


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
if
os
.
access
(
arg_1
,
os
.
F_OK
)
:
if
arg_1
in
arg_0
.
f_repository
:
raise
DuplicationError
(
"file already added."
)
arg_0
.
f_repository
.
append
(
arg_1
)
else
:
raise
IOError
(
"file not found."
)

def Func(arg_0, arg_1, **arg_2):
        """Append a file to file repository.

        For file monitoring, monitor instance needs file.
        Please put the name of file to `file` argument.

        :param file: the name of file you want monitor.

        """

        if os.access(arg_1, os.F_OK):

            if arg_1 in arg_0.f_repository:
                raise DuplicationError("file already added.")

            arg_0.f_repository.append(arg_1)

        else:
            raise IOError("file not found.")


def Func(arg_0, arg_1):
        """
        Determine good units for representing a sequence of timedeltas
        """
        # Read
        #   [(0.9, 's'),
        #    (9, 'm)]
        # as, break ranges between 0.9 seconds (inclusive)
        # and 9 minutes are represented in seconds. And so on.
        arg_2 = arg_0.value(max(arg_1)) - arg_0.value(min(arg_1))
        arg_3 = arg_0.determine_package(arg_1[0])
        if arg_3 == 'pandas':
            arg_4 = [
                (0.9, 'us'),
                (0.9, 'ms'),
                (0.9, 's'),
                (9, 'm'),
                (6, 'h'),
                (4, 'd'),
                (4, 'w'),
                (4, 'M'),
                (3, 'y')]
            arg_5 = NANOSECONDS
            arg_6 = 'ns'
        else:
            arg_4 = [
                (0.9, 's'),
                (9, 'm'),
                (6, 'h'),
                (4, 'd'),
                (4, 'w'),
                (4, 'M'),
                (3, 'y')]
            arg_5 = SECONDS
            arg_6 = 'ms'

        for arg_7, arg_8 in reversed(arg_4):
            if arg_2 >= arg_7*arg_5[arg_8]:
                return arg_8

        return arg_6


def Func(arg_0):
        """Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/Func.htm
        """
        arg_1 = arg_0._year
        arg_2 = _isoweek1monday(arg_1)
        arg_3 = _ymd2ord(arg_0._year, arg_0._month, arg_0._day)
        # Internally, week and day have origin 0
        arg_4, arg_5 = divmod(arg_3 - arg_2, 7)
        if arg_4 < 0:
            arg_1 -= 1
            arg_2 = _isoweek1monday(arg_1)
            arg_4, arg_5 = divmod(arg_3 - arg_2, 7)
        elif arg_4 >= 52:
            if arg_3 >= _isoweek1monday(arg_1+1):
                arg_1 += 1
                arg_4 = 0
        return arg_1, arg_4+1, arg_5+1

Return a 3-tuple containing ISO year, week number, and weekday.

        The first ISO week of the year is the (Mon-Sun) week
        containing the year's first Thursday; everything else derives
        from that.

        The first week is 1; Monday is 1 ... Sunday is 7.

        ISO calendar algorithm taken from
        http://www.phys.uu.nl/~vgent/calendar/isocalendar.htm

Return a 3 - tuple containing ISO year week number and weekday .


def Func ( arg_0 ) : arg_0 . message [ "From" ] = arg_0 . from_ arg_0 . message [ "Subject" ] = arg_0 . subject if arg_0 . to : arg_0 . message [ "To" ] = arg_0 . list_to_string ( arg_0 . to ) if arg_0 . cc : arg_0 . message [ "Cc" ] = arg_0 . list_to_string ( arg_0 . cc ) if arg_0 . bcc : arg_0 . message [ "Bcc" ] = arg_0 . list_to_string ( arg_0 . bcc )

def Func(arg_0):
        """Add email header info."""
        arg_0.message["From"] = arg_0.from_
        arg_0.message["Subject"] = arg_0.subject
        if arg_0.to:
            arg_0.message["To"] = arg_0.list_to_string(arg_0.to)
        if arg_0.cc:
            arg_0.message["Cc"] = arg_0.list_to_string(arg_0.cc)
        if arg_0.bcc:
            arg_0.message["Bcc"] = arg_0.list_to_string(arg_0.bcc)


(
        self, state_scope, msgid, line, node, args, confidence
    )

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6
    ):  # pylint: disable=unused-argument
        """Report an ignored message.

        state_scope is either MSG_STATE_SCOPE_MODULE or MSG_STATE_SCOPE_CONFIG,
        depending on whether the message was disabled locally in the module,
        or globally. The other arguments are the same as for add_message.
        """
        if arg_1 == MSG_STATE_SCOPE_MODULE:
            try:
                arg_7 = arg_0._suppression_mapping[(arg_2, arg_3)]
                arg_0._ignored_msgs[(arg_2, arg_7)].add(arg_3)
            except KeyError:
                pass


return 0.5 * (self.__errors__[0] + self.__errors__[1])

def Func ( arg_0 ) : if arg_0 . __errors__ is None : return 0. if np . isscalar ( arg_0 . __errors__ ) : return arg_0 . __errors__ return 0.5 * ( arg_0 . __errors__ [ 0 ] + arg_0 . __errors__ [ 1 ] )

def Func(arg_0):
        """Return the symmertic error

        Similar to above, but zero implies no error estimate,
        and otherwise this will either be the symmetric error,
        or the average of the low,high asymmetric errors.
        """
        # ADW: Should this be `np.nan`?
        if arg_0.__errors__ is None:
            return 0.
        if np.isscalar(arg_0.__errors__):
            return arg_0.__errors__
        return 0.5 * (arg_0.__errors__[0] + arg_0.__errors__[1])


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : if not isinstance ( arg_1 , dict ) : if len ( arg_0 . related_keys ) != 1 : arg_0 . fail ( "invalid" , arg_1 = arg_1 , keys = [ arg_4 . key for arg_4 in arg_0 . related_keys ] , ) arg_1 = { arg_0 . related_keys [ 0 ] . key : arg_1 } if arg_0 . transient : return arg_0 . related_model ( ** arg_1 ) try : arg_5 = arg_0 . _get_existing_instance ( arg_0 . session . query ( arg_0 . related_model ) , arg_1 ) except NoResultFound : return arg_0 . related_model ( ** arg_1 ) return arg_5

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Deserialize a serialized value to a model instance.

        If the parent schema is transient, create a new (transient) instance.
        Otherwise, attempt to find an existing instance in the database.
        :param value: The value to deserialize.
        """
        if not isinstance(arg_1, dict):
            if len(arg_0.related_keys) != 1:
                arg_0.fail(
                    "invalid",
                    arg_1=arg_1,
                    keys=[arg_4.key for arg_4 in arg_0.related_keys],
                )
            arg_1 = {arg_0.related_keys[0].key: arg_1}
        if arg_0.transient:
            return arg_0.related_model(**arg_1)
        try:
            arg_5 = arg_0._get_existing_instance(
                arg_0.session.query(arg_0.related_model), arg_1
            )
        except NoResultFound:
            # The related-object DNE in the DB, but we still want to deserialize it
            # ...perhaps we want to add it to the DB later
            return arg_0.related_model(**arg_1)
        return arg_5

Deserialize a serialized value to a model instance .


def Func ( arg_0 , arg_1 ) : arg_2 = int ( time . time ( ) ) arg_3 = WindowContext ( arg_2 - arg_0 . window_duration , arg_2 ) arg_4 = [ ] for ( arg_1 , arg_5 ) in arg_0 . current_tuples : arg_4 . append ( arg_1 ) arg_0 . processWindow ( arg_3 , arg_4 ) arg_0 . _expire ( arg_2 )

def Func(arg_0, arg_1):
    """Called every slide_interval
    """
    arg_2 = int(time.time())
    arg_3 = WindowContext(arg_2 - arg_0.window_duration, arg_2)
    arg_4 = []
    for (arg_1, arg_5) in arg_0.current_tuples:
      arg_4.append(arg_1)
    arg_0.processWindow(arg_3, arg_4)
    arg_0._expire(arg_2)


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
eqs
arg_2
=
arg_0
.
Net
.
f_to_dict
(
short_names
=
True
,
fast_access
=
True
)
arg_3
=
NeuronGroup
(
arg_0
.
N
,
model
=
arg_1
,
threshold
=
arg_0
.
Vcut
,
reset
=
arg_0
.
reset
,
arg_2
=
arg_2
)
arg_3
.
vm
=
arg_0
.
EL
arg_3
.
w
=
arg_0
.
a
*
(
arg_3
.
vm
arg_0
.
EL
)
arg_3
.
Vr
=
linspace
(
48.3
*
mV
,
47.7
*
mV
,
arg_0
.
N
)
print
(
'Initial Run'
)
arg_7
=
Network
(
arg_3
)
arg_7
.
run
(
100
*
ms
,
report
=
'text'
)
arg_8
=
SpikeMonitor
(
arg_3
)
arg_7
.
add
(
arg_8
)
arg_9
=
StateMonitor
(
arg_3
,
variables
=
[
'vm'
]
,
record
=
[
1
,
2
,
3
]
)
arg_7
.
add
(
arg_9
)
print
(
'Measurement run'
)
arg_7
.
run
(
500
*
ms
,
report
=
'text'
)
arg_0
.
v_standard_result
=
Brian2MonitorResult
arg_0
.
f_add_result
(
'SpikeMonitor'
,
arg_8
)
arg_0
.
f_add_result
(
'StateMonitorV'
,
arg_9
)

def Func(arg_0):
    """Creates and runs BRIAN network based on the parameters in `traj`."""

    arg_1=arg_0.eqs

    # Create a namespace dictionairy
    arg_2 = arg_0.Net.f_to_dict(short_names=True, fast_access=True)
    # Create the Neuron Group
    arg_3=NeuronGroup(arg_0.N, model=arg_1, threshold=arg_0.Vcut, reset=arg_0.reset,
                       arg_2=arg_2)
    arg_3.vm=arg_0.EL
    arg_3.w=arg_0.a*(arg_3.vm-arg_0.EL)
    arg_3.Vr=linspace(-48.3*mV,-47.7*mV,arg_0.N) # bifurcation parameter

    # Run the network initially for 100 milliseconds
    print('Initial Run')
    arg_7 = Network(arg_3)
    arg_7.run(100*ms, report='text') # we discard the first spikes

    # Create a Spike Monitor
    arg_8=SpikeMonitor(arg_3)
    arg_7.add(arg_8)
    # Create a State Monitor for the membrane voltage, record from neurons 1-3
    arg_9 = StateMonitor(arg_3, variables=['vm'],record=[1,2,3])
    arg_7.add(arg_9)

    # Now record for 500 milliseconds
    print('Measurement run')
    arg_7.run(500*ms,report='text')

    # Add the BRAIN monitors
    arg_0.v_standard_result = Brian2MonitorResult
    arg_0.f_add_result('SpikeMonitor',arg_8)
    arg_0.f_add_result('StateMonitorV', arg_9)

Creates and runs BRIAN network based on the parameters in traj .


def Func(arg_0, arg_1, arg_2):
        r'''Method to Func a property with a specified method, with no
        validity checking or error handling. Demo function for testing only;
        must be implemented according to the methods available for each
        individual method. Include the interpolation call here.

        Parameters
        ----------
        T : float
            Temperature at which to Func the property, [K]
        method : str
            Method name to use

        Returns
        -------
        prop : float
            Calculated property, [`units`]
        '''
        if arg_2 == TEST_METHOD_1:
            arg_3 = arg_0.TEST_METHOD_1_coeffs[0] + arg_0.TEST_METHOD_1_coeffs[1]*arg_1
        elif arg_2 == TEST_METHOD_2:
            arg_3 = arg_0.TEST_METHOD_2_coeffs[0] + arg_0.TEST_METHOD_2_coeffs[1]*arg_1
        elif arg_2 in arg_0.tabular_data:
            arg_3 = arg_0.interpolate(arg_1, arg_2)
        return arg_3

r'''Method to calculate a property with a specified method, with no
        validity checking or error handling. Demo function for testing only;
        must be implemented according to the methods available for each
        individual method. Include the interpolation call here.

        Parameters
        ----------
        T : float
            Temperature at which to calculate the property, [K]
        method : str
            Method name to use

        Returns
        -------
        prop : float
            Calculated property, [`units`]

r Method to calculate a property with a specified method with no validity checking or error handling . Demo function for testing only ; must be implemented according to the methods available for each individual method . Include the interpolation call here .


def Func ( arg_0 ) : if hasattr ( termios , 'VINTR' ) : arg_1 = termios . tcgetattr ( arg_0 . child_fd ) [ 6 ] [ termios . VINTR ] else : arg_1 = chr ( 3 ) arg_0 . send ( arg_1 )

def Func(arg_0):

        """This sends a SIGINT to the child. It does not require
        the SIGINT to be the first character on a line. """

        if hasattr(termios, 'VINTR'):
            arg_1 = termios.tcgetattr(arg_0.child_fd)[6][termios.VINTR]
        else:
            # platform does not define VINTR so assume CTRL-C
            arg_1 = chr(3)
        arg_0.send (arg_1)

This sends a SIGINT to the child . It does not require the SIGINT to be the first character on a line .


def
Func
(
arg_0
,
arg_1
)
:
log
.
info
(
'Executing '
+
arg_1
)
arg_2
=
arg_0
.
__exchange
(
'dofile("'
+
arg_1
+
'")'
)
log
.
info
(
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
        """Execute a file on the device using 'do'"""
        log.info('Executing '+arg_1)
        arg_2 = arg_0.__exchange('dofile("'+arg_1+'")')
        log.info(arg_2)
        return arg_2


def Func(arg_0, arg_1, arg_2=None):
  """Calculate the KL divergence between two `JointDistributionSequential`s.

  Args:
    d0: instance of a `JointDistributionSequential` object.
    d1: instance of a `JointDistributionSequential` object.
    name: (optional) Name to use for created operations.
      Default value: `"kl_joint_joint"`.

  Returns:
    kl_joint_joint: `Tensor` The sum of KL divergences between elemental
      distributions of two joint distributions.

  Raises:
    ValueError: when joint distributions have a different number of elemental
      distributions.
    ValueError: when either joint distribution has a distribution with dynamic
      dependency, i.e., when either joint distribution is not a collection of
      independent distributions.
  """
  if len(arg_0._dist_fn_wrapped) != len(arg_1._dist_fn_wrapped):  # pylint: disable=protected-access
    raise ValueError(
        'Can only compute KL divergence between when each has the'
        'same number of component distributions.')
  if (not all(arg_3 is None for arg_3 in arg_0._dist_fn_args) or  # pylint: disable=protected-access
      not all(arg_3 is None for arg_3 in arg_1._dist_fn_args)):  # pylint: disable=protected-access
    raise ValueError(
        'Can only compute KL divergence when all distributions are '
        'independent.')
  with tf.name_scope(arg_2 or 'kl_jointseq_jointseq'):
    return sum(kullback_leibler.kl_divergence(arg_4(), arg_5())
               for arg_4, arg_5 in zip(arg_0._dist_fn_wrapped, arg_1._dist_fn_wrapped))

Calculate the KL divergence between two JointDistributionSequential s .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
is
:
return
elif
arg_1
==
'INTEGER'
:
return
int
(
arg_0
)
elif
arg_1
==
'FLOAT'
or
arg_1
==
'TIMESTAMP'
:
return
float
(
arg_0
)
elif
arg_1
==
'BOOLEAN'
:
if
arg_0
not
in
[
'true'
,
'false'
]
:
raise
ValueError
(
"{} must have value 'true' or 'false'"
.
format
(
arg_0
)
)
return
arg_0
==
'true'
else
:
return
arg_0

def Func(arg_0, arg_1):
    """
    Helper method that casts a BigQuery row to the appropriate data types.
    This is useful because BigQuery returns all fields as strings.
    """
    if arg_0 is None:
        return None
    elif arg_1 == 'INTEGER':
        return int(arg_0)
    elif arg_1 == 'FLOAT' or arg_1 == 'TIMESTAMP':
        return float(arg_0)
    elif arg_1 == 'BOOLEAN':
        if arg_0 not in ['true', 'false']:
            raise ValueError("{} must have value 'true' or 'false'".format(
                arg_0))
        return arg_0 == 'true'
    else:
        return arg_0

Helper method that casts a BigQuery row to the appropriate data types . This is useful because BigQuery returns all fields as strings .


(filename, binary=False, encoding=None, newline=None)

def Func ( arg_0 , arg_1 = False , arg_2 = None , arg_3 = None ) : arg_4 = OpenFile ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 ) try : arg_5 = arg_4 . read ( ) finally : arg_4 . close ( ) return arg_5

def Func(arg_0, arg_1=False, arg_2=None, arg_3=None):
    '''
    Reads a file and returns its contents. Works for both local and remote files.

    :param unicode filename:

    :param bool binary:
        If True returns the file as is, ignore any EOL conversion.

    :param unicode encoding:
        File's encoding. If not None, contents obtained from file will be decoded using this
        `encoding`.

    :param None|''|'\n'|'\r'|'\r\n' newline:
        Controls universal newlines.
        See 'io.open' newline parameter documentation for more details.

    :returns str|unicode:
        The file's contents.
        Returns unicode string when `encoding` is not None.

    .. seealso:: FTP LIMITATIONS at this module's doc for performance issues information
    '''
    arg_4 = OpenFile(arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3)
    try:
        arg_5 = arg_4.read()
    finally:
        arg_4.close()

    return arg_5

Reads a file and returns its contents . Works for both local and remote files .


(self, roomId=None, personId=None, personEmail=None, max=None,
             **request_parameters)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=None,
             **arg_5):
        """List room memberships.

        By default, Funcs memberships for rooms to which the authenticated user
        belongs.

        Use query parameters to filter the response.

        Use `roomId` to Func memberships for a room, by ID.

        Use either `personId` or `personEmail` to filter the results.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all memberships returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            roomId(basestring): Limit results to a specific room, by ID.
            personId(basestring): Limit results to a specific person, by ID.
            personEmail(basestring): Limit results to a specific person, by
                email address.
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the memberships returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring)
        check_type(arg_2, basestring)
        check_type(arg_3, basestring)
        check_type(arg_4, int)

        arg_6 = dict_from_items_with_values(
            arg_5,
            arg_1=arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
        )

        # API request - get items
        arg_7 = arg_0._session.get_items(API_ENDPOINT, arg_6=arg_6)

        # Yield membership objects created from the returned items JSON objects
        for arg_8 in arg_7:
            yield arg_0._object_factory(OBJECT_TYPE, arg_8)

List room memberships.

        By default, lists memberships for rooms to which the authenticated user
        belongs.

        Use query parameters to filter the response.

        Use `roomId` to list memberships for a room, by ID.

        Use either `personId` or `personEmail` to filter the results.

        This method supports Webex Teams's implementation of RFC5988 Web
        Linking to provide pagination support.  It returns a generator
        container that incrementally yields all memberships returned by the
        query.  The generator will automatically request additional 'pages' of
        responses from Webex as needed until all responses have been returned.
        The container makes the generator safe for reuse.  A new API call will
        be made, using the same parameters that were specified when the
        generator was created, every time a new iterator is requested from the
        container.

        Args:
            roomId(basestring): Limit results to a specific room, by ID.
            personId(basestring): Limit results to a specific person, by ID.
            personEmail(basestring): Limit results to a specific person, by
                email address.
            max(int): Limit the maximum number of items returned from the Webex
                Teams service per request.
            **request_parameters: Additional request parameters (provides
                support for parameters that may be added in the future).

        Returns:
            GeneratorContainer: A GeneratorContainer which, when iterated,
            yields the memberships returned by the Webex Teams query.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


def Func ( arg_0 , Func ) : arg_0 . _request . url = Func arg_0 . add_matcher ( matcher ( 'URLMatcher' , Func ) )

def Func(arg_0, Func):
        """
        Defines the mock URL to match.
        It can be a full URL with path and query params.

        Protocol schema is optional, defaults to ``http://``.

        Arguments:
            url (str): mock URL to match. E.g: ``server.com/api``.

        Returns:
            self: current Mock instance.
        """
        arg_0._request.url = Func
        arg_0.add_matcher(matcher('URLMatcher', Func))

Defines the mock URL to match . It can be a full URL with path and query params .


def Func(arg_0):
    """Return a payload class for given element name."""
    logger.debug(" looking up payload class for element: {0!r}".format(
                                                                arg_0))
    logger.debug("  known: {0!r}".format(STANZA_PAYLOAD_CLASSES))
    if arg_0 in STANZA_PAYLOAD_CLASSES:
        return STANZA_PAYLOAD_CLASSES[arg_0]
    else:
        return XMLPayload

Return a payload class for given element name .


(includeCPP = True,
              includePy = True,
              numCols = 100,
              cellsPerCol = 4,
              activationThreshold = 3,
              minThreshold = 3,
              newSynapseCount = 3,
              initialPerm = 0.6,
              permanenceInc = 0.1,
              permanenceDec = 0.0,
              globalDecay = 0.0,
              pamLength = 0,
              checkSynapseConsistency = True,
              maxInfBacktrack = 0,
              maxLrnBacktrack = 0,
              **kwargs
              )

def Func(arg_0 = True,
              arg_1 = True,
              arg_2 = 100,
              arg_3 = 4,
              arg_4 = 3,
              arg_5 = 3,
              arg_6 = 3,
              arg_7 = 0.6,
              arg_8 = 0.1,
              arg_9 = 0.0,
              arg_10 = 0.0,
              arg_11 = 0,
              arg_12 = True,
              arg_13 = 0,
              arg_14 = 0,
              **arg_15
              ):

  """Create one or more TM instances, placing each into a dict keyed by
  name.

  Parameters:
  ------------------------------------------------------------------
  retval:   tms - dict of TM instances
  """

  # Keep these fixed:
  arg_16 = 0.5

  arg_17 = dict()

  if arg_0:
    if VERBOSITY >= 2:
      print "Creating BacktrackingTMCPP instance"

    arg_18 = BacktrackingTMCPP(numberOfCols = arg_2, cellsPerColumn = arg_3,
                               arg_7 = arg_7, arg_16 = arg_16,
                               arg_5 = arg_5, arg_6 = arg_6,
                               arg_8 = arg_8, arg_9 = arg_9,
                               arg_4 = arg_4,
                               arg_10 = arg_10, burnIn = 1,
                               seed=SEED, verbosity=VERBOSITY,
                               arg_12 = arg_12,
                               collectStats = True,
                               arg_11 = arg_11,
                               arg_13 = arg_13,
                               arg_14 = arg_14,
                               )

    # Ensure we are copying over learning states for TMDiff
    arg_18.retrieveLearningStates = True

    arg_17['CPP'] = arg_18

  if arg_1:
    if VERBOSITY >= 2:
      print "Creating PY TM instance"

    arg_20 = BacktrackingTM(numberOfCols = arg_2,
                           cellsPerColumn = arg_3,
                           arg_7 = arg_7,
                           arg_16 = arg_16,
                           arg_5 = arg_5,
                           arg_6 = arg_6,
                           arg_8 = arg_8,
                           arg_9 = arg_9,
                           arg_4 = arg_4,
                           arg_10 = arg_10, burnIn = 1,
                           seed=SEED, verbosity=VERBOSITY,
                           collectStats = True,
                           arg_11 = arg_11,
                           arg_13 = arg_13,
                           arg_14 = arg_14,
                           )

    arg_17['PY '] = arg_20

  return arg_17

Create one or more TM instances placing each into a dict keyed by name .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : yield arg_1 . Func ( arg_0 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
    '''alias of str.Func'''
    yield arg_1.Func(arg_0, *arg_2, **arg_3)


def Func ( arg_0 , arg_1 , ** arg_2 ) : from flask_admin import Admin from flask_admin . contrib . sqla import ModelView arg_3 = Admin ( arg_1 , ** arg_2 ) for arg_4 in arg_0 . flask_admin_models : if isinstance ( arg_4 , tuple ) : if len ( arg_4 ) != 2 : raise TypeError arg_5 , arg_6 = arg_4 arg_3 . add_view ( arg_6 ( arg_5 , arg_0 . session ) ) else : arg_3 . add_view ( ModelView ( arg_4 , arg_0 . session ) ) return arg_3

def Func(arg_0, arg_1, **arg_2):
        """Add a Flask Admin interface to an application.

        :param flask.Flask app: A Flask application
        :param kwargs: Keyword arguments are passed through to :class:`flask_admin.Admin`
        :rtype: flask_admin.Admin
        """
        from flask_admin import Admin
        from flask_admin.contrib.sqla import ModelView

        arg_3 = Admin(arg_1, **arg_2)

        for arg_4 in arg_0.flask_admin_models:
            if isinstance(arg_4, tuple):  # assume its a 2 tuple
                if len(arg_4) != 2:
                    raise TypeError

                arg_5, arg_6 = arg_4
                arg_3.add_view(arg_6(arg_5, arg_0.session))

            else:
                arg_3.add_view(ModelView(arg_4, arg_0.session))

        return arg_3

Add a Flask Admin interface to an application .


(self, traj, only_init=False, store_data=pypetconstants.STORE_DATA,
                              max_depth=None)

def Func(arg_0, arg_1, arg_2=False, arg_3=arg_4.STORE_DATA,
                              arg_6=None):
        """ Stores a trajectory to an hdf5 file

        Stores all groups, parameters and results

        """
        if not arg_2:
            arg_0._logger.info('Start storing Trajectory `%s`.' % arg_0._trajectory_name)
        else:
            arg_0._logger.info('Initialising storage or updating meta data of Trajectory `%s`.' %
                              arg_0._trajectory_name)
            arg_3 = arg_4.STORE_NOTHING

        # In case we accidentally chose a trajectory name that already exist
        # We do not want to mess up the stored trajectory but raise an Error
        if not arg_1._stored and arg_0._trajectory_group is not None:
            raise RuntimeError('You want to store a completely new trajectory with name'
                               ' `%s` but this trajectory is already found in file `%s`.'
                               'Did you try to accidentally overwrite existing data? If '
                               'you DO want to override existing data, use `overwrite_file=True`.'
                               'Note that this deletes the whole HDF5 file not just the particular '
                               'trajectroy therein! ' %
                               (arg_1.v_name, arg_0._filename))

        # Extract HDF5 settings from the trajectory
        arg_0._srvc_check_hdf_properties(arg_1)

        # Store the trajectory for the first time if necessary:
        if arg_0._trajectory_group is None:
            arg_0._trajectory_group = arg_0._hdf5file.create_group(where='/',
                                                           name=arg_0._trajectory_name,
                                                           title=arg_0._trajectory_name,
                                                           filters=arg_0._all_get_filters())
        # Store meta information
        arg_0._trj_store_meta_data(arg_1)

        # # Store recursively the config subtree
        # self._tree_store_recursively(pypetconstants.LEAF,traj.config,self._trajectory_group)

        if arg_3 in (arg_4.STORE_DATA_SKIPPING,
                          arg_4.STORE_DATA,
                          arg_4.OVERWRITE_DATA):

            arg_8 = 0
            arg_9 = 10
            arg_10 = set(['parameters', 'config', 'derived_parameters', 'results'])

            for arg_11 in arg_1._children:

                if arg_11 in arg_10:
                    arg_0._logger.info('Storing branch `%s`.' % arg_11)
                else:
                    if arg_8 < arg_9:
                        arg_0._logger.info('Storing branch/node `%s`.' % arg_11)
                    elif arg_8 == arg_9:
                        arg_0._logger.info('To many branches or nodes at root for display. '
                                          'I will not inform you about storing anymore. '
                                          'Branches are stored silently in the background. '
                                          'Do not worry, I will not freeze! Pinky promise!!!')
                    arg_8 += 1

                # Store recursively the elements
                arg_0._tree_store_sub_branch(arg_1, arg_11, arg_3=arg_3,
                                            with_links=True,
                                            recursive=True, arg_6=arg_6,
                                            hdf5_group=arg_0._trajectory_group)

            arg_0._logger.info('Finished storing Trajectory `%s`.' % arg_0._trajectory_name)
        else:
            arg_0._logger.info('Finished init or meta data update for `%s`.' %
                              arg_0._trajectory_name)
        arg_1._stored = True


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_2 . size == 128 : assert arg_1 . size == 64 arg_1 . write ( Operators . EXTRACT ( arg_2 . read ( ) , 64 , 64 ) ) else : assert arg_2 . size == 64 and arg_1 . size == 128 arg_3 = Operators . EXTRACT ( arg_1 . read ( ) , 0 , 64 ) arg_1 . write ( Operators . CONCAT ( 128 , arg_2 . read ( ) , arg_3 ) )

def Func(arg_0, arg_1, arg_2):
        """
        Moves high packed double-precision floating-point value.

        Moves a double-precision floating-point value from the source operand (second operand) and the
        destination operand (first operand). The source and destination operands can be an XMM register
        or a 64-bit memory location. This instruction allows double-precision floating-point values to be moved
        to and from the high quadword of an XMM register and memory. It cannot be used for register to
        register or memory to memory moves. When the destination operand is an XMM register, the low quadword
        of the register remains unchanged.

        :param cpu: current CPU.
        :param dest: destination operand.
        :param src: source operand.
        """
        if arg_2.size == 128:
            assert arg_1.size == 64
            arg_1.write(Operators.EXTRACT(arg_2.read(), 64, 64))
        else:
            assert arg_2.size == 64 and arg_1.size == 128
            arg_3 = Operators.EXTRACT(arg_1.read(), 0, 64)  # low part
            arg_1.write(Operators.CONCAT(128, arg_2.read(), arg_3))

Moves high packed double - precision floating - point value .


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] arg_3 = arg_0 . client . pull_requested_reviewers ( arg_1 ) for arg_4 in arg_3 : arg_3 = json . loads ( arg_4 ) for arg_5 in arg_3 [ 'users' ] : arg_6 = arg_0 . __get_user ( arg_5 [ 'login' ] ) arg_2 . append ( arg_6 ) return arg_2

def Func(arg_0, arg_1):
        """Get pull request requested reviewers"""

        arg_2 = []
        arg_3 = arg_0.client.pull_requested_reviewers(arg_1)

        for arg_4 in arg_3:
            arg_3 = json.loads(arg_4)

            for arg_5 in arg_3['users']:
                arg_6 = arg_0.__get_user(arg_5['login'])
                arg_2.append(arg_6)

        return arg_2


Alternative naming, you can use `node.kids.name` instead of `node.name`
        for easier tab completion.

def Func ( arg_0 ) : if arg_0 . _Func is None : arg_0 . _Func = NNTreeNodeKids ( arg_0 ) return arg_0 . _Func

def Func(arg_0):
        """Alternative naming, you can use `node.Func.name` instead of `node.name`
        for easier tab completion."""
        if arg_0._Func is None:
            arg_0._Func = NNTreeNodeKids(arg_0)
        return arg_0._Func

Alternative naming you can use node . kids . name instead of node . name for easier tab completion .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Store a raw item in this archive.

        The method will Func `data` content in this archive. The unique
        identifier for that item will be generated using the rest of the
        parameters.

        :param uri: request URI
        :param payload: request payload
        :param headers: request headers
        :param data: data to Func in this archive

        :raises ArchiveError: when an error occurs storing the given data
        """
        arg_5 = arg_0.make_hashcode(arg_1, arg_2, arg_3)
        arg_6 = pickle.dumps(arg_2, 0)
        arg_7 = pickle.dumps(arg_3, 0)
        arg_8 = pickle.dumps(arg_4, 0)

        logger.debug("Archiving %s with %s %s %s in %s",
                     arg_5, arg_1, arg_2, arg_3, arg_0.archive_path)

        try:
            arg_9 = arg_0._db.cursor()
            arg_10 = "INSERT INTO " + arg_0.ARCHIVE_TABLE + " (" \
                          "id, hashcode, uri, payload, headers, data) " \
                          "VALUES(?,?,?,?,?,?)"
            arg_9.execute(arg_10, (None, arg_5, arg_1,
                                         arg_6, arg_7, arg_8))
            arg_0._db.commit()
            arg_9.close()
        except sqlite3.IntegrityError as e:
            arg_11 = "data storage error; cause: duplicated entry %s" % arg_5
            raise ArchiveError(cause=arg_11)
        except sqlite3.DatabaseError as e:
            arg_11 = "data storage error; cause: %s" % str(e)
            raise ArchiveError(cause=arg_11)

        logger.debug("%s data archived in %s", arg_5, arg_0.archive_path)

Store a raw item in this archive.

        The method will store `data` content in this archive. The unique
        identifier for that item will be generated using the rest of the
        parameters.

        :param uri: request URI
        :param payload: request payload
        :param headers: request headers
        :param data: data to store in this archive

        :raises ArchiveError: when an error occurs storing the given data


def Func(arg_0):
    """
    Remove dangling entries from the shapes directory.

    Parameters
    ----------
    db_conn: sqlite3.Connection
        connection to the GTFS object
    """
    arg_0.execute(DELETE_SHAPES_NOT_REFERENCED_IN_TRIPS_SQL)
    arg_1 = \
        "SELECT trips.trip_I, shape_id, min(shape_break) as min_shape_break, max(shape_break) as max_shape_break FROM trips, stop_times WHERE trips.trip_I=stop_times.trip_I GROUP BY trips.trip_I"
    arg_2= pandas.read_sql(arg_1, arg_0)

    arg_3 = []
    for arg_4 in arg_2.itertuples():
        arg_5, arg_6, arg_7 = arg_4.shape_id, arg_4.min_shape_break, arg_4.max_shape_break
        if arg_6 is None or arg_7 is None:
            arg_6 = float('-inf')
            arg_7 = float('-inf')
        arg_3.append( (arg_5, arg_6, arg_7) )
    arg_8 = "DELETE FROM shapes WHERE shape_id=? AND (seq<? OR seq>?)"
    arg_0.executemany(arg_8, arg_3)
    Func_references(arg_0)

Remove dangling entries from the shapes directory .


(self, origin, backend_name, backend_version,
                      category, backend_params)

def Func(arg_0, arg_1, arg_2, arg_3,
                      arg_4, arg_5):
        """Init metadata information.

        Metatada is composed by basic information needed to identify
        where archived data came from and how it can be retrieved
        and built into Perceval items.

        :param: origin: identifier of the repository
        :param: backend_name: name of the backend
        :param: backend_version: version of the backend
        :param: category: category of the items fetched
        :param: backend_params: dict representation of the fetch parameters

        raises ArchiveError: when an error occurs initializing the metadata
        """
        arg_6 = datetime_to_utc(datetime_utcnow())
        arg_7 = arg_6.isoformat()
        arg_8 = pickle.dumps(arg_5, 0)

        arg_9 = (arg_1, arg_2, arg_3, arg_4,
                    arg_8, arg_7,)

        try:
            arg_10 = arg_0._db.cursor()
            arg_11 = "INSERT INTO " + arg_0.METADATA_TABLE + " "\
                          "(origin, backend_name, backend_version, " \
                          "category, backend_params, created_on) " \
                          "VALUES (?, ?, ?, ?, ?, ?)"
            arg_10.execute(arg_11, arg_9)

            arg_0._db.commit()
            arg_10.close()
        except sqlite3.DatabaseError as e:
            arg_12 = "metadata initialization error; cause: %s" % str(e)
            raise ArchiveError(cause=arg_12)

        arg_0.origin = arg_1
        arg_0.backend_name = arg_2
        arg_0.backend_version = arg_3
        arg_0.category = arg_4
        arg_0.backend_params = arg_5
        arg_0.created_on = arg_6

        logger.debug("Metadata of archive %s initialized to %s",
                     arg_0.archive_path, arg_9)


def Func ( arg_0 , arg_1 ) : if re . match ( 'https?:\/\/' , arg_0 ) : return arg_0 arg_2 = get_domain ( arg_1 ) if arg_2 : return '%s%s' % ( arg_2 , arg_0 ) return arg_0

def Func(arg_0, arg_1):
    """
    Given a url which may or may not be a relative url, convert it to a full
    url path given another full url as an example
    """
    if re.match('https?:\/\/', arg_0):
        return arg_0
    arg_2 = get_domain(arg_1)
    if arg_2:
        return '%s%s' % (arg_2, arg_0)
    return arg_0

Given a url which may or may not be a relative url convert it to a full url path given another full url as an example