def Func ( arg_0 , arg_1 = True ) : arg_2 = IndexedRedisSave ( arg_0 . __class__ ) return arg_2 . Func ( arg_0 , arg_1 = arg_1 )

def Func(arg_0, arg_1=True):
		'''
			Func - Save this object.

			Will perform an "insert" if this object had not been Funcd before,
			  otherwise will update JUST the fields changed on THIS INSTANCE of the model.

			  i.e. If you have two processes fetch the same object and change different fields, they will not overwrite
			  eachother, but only Func the ones each process changed.

			If you want to Func multiple objects of type MyModel in a single transaction,
			and you have those objects in a list, myObjs, you can do the following:

				MyModel.Funcr.Func(myObjs)

			@param cascadeSave <bool> Default True - If True, any Foreign models linked as attributes that have been altered
			   or created will be Funcd with this object. If False, only this object (and the reference to an already-Funcd foreign model) will be Funcd.

			@see #IndexedRedisSave.Func

			@return <list> - Single element list, id of Funcd object (if successful)
		'''
		arg_2 = IndexedRedisSave(arg_0.__class__)
		return arg_2.Func(arg_0, arg_1=arg_1)

save - Save this object.

			Will perform an "insert" if this object had not been saved before,
			  otherwise will update JUST the fields changed on THIS INSTANCE of the model.

			  i.e. If you have two processes fetch the same object and change different fields, they will not overwrite
			  eachother, but only save the ones each process changed.

			If you want to save multiple objects of type MyModel in a single transaction,
			and you have those objects in a list, myObjs, you can do the following:

				MyModel.saver.save(myObjs)

			@param cascadeSave <bool> Default True - If True, any Foreign models linked as attributes that have been altered
			   or created will be saved with this object. If False, only this object (and the reference to an already-saved foreign model) will be saved.

			@see #IndexedRedisSave.save

			@return <list> - Single element list, id of saved object (if successful)

save - Save this object . Will perform an insert if this object had not been saved before otherwise will update JUST the fields changed on THIS INSTANCE of the model .


(cls, pattern, filetype=None, key='filename', root=None, ignore=[])

return FileInfo(filepattern, key, filetype, ignore=ignore)

def Func(arg_0, arg_1, arg_2=None, arg_3='filename', arg_4=None, arg_5=[]):
        """
        Convenience method to directly chain a pattern processed by
        FilePattern into a FileInfo instance.

        Note that if a default filetype has been set on FileInfo, the
        filetype argument may be omitted.
        """
        arg_6 = FilePattern(arg_3, arg_1, arg_4=arg_4)
        if FileInfo.filetype and arg_2 is None:
            arg_2 = FileInfo.filetype
        elif arg_2 is None:
            raise Exception("The filetype argument must be supplied unless "
                            "an appropriate default has been specified as "
                            "FileInfo.filetype")
        return FileInfo(arg_6, arg_3, arg_2, arg_5=arg_5)

Convenience method to directly chain a pattern processed by FilePattern into a FileInfo instance .


def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 . values ( ) : arg_1 += len ( arg_2 ) return arg_1

def Func(arg_0):
    """
    Returns the total number of data points in values of dict.

    Paramters
    ---------
    d : dict
    """
    arg_1 = 0
    for arg_2 in arg_0.values():
        arg_1 += len(arg_2)
    return arg_1

Returns the total number of data points in values of dict .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
split
(
)
if
len
(
arg_2
)
==
1
:
if
'-'
in
arg_0
:
arg_3
=
arg_0
.
split
(
'-'
)
arg_3
=
map
(
lambda
a
:
a
[
0
]
+
a
[
1
:
]
.
lower
(
)
,
arg_3
)
arg_0
=
'-'
.
join
(
arg_3
)
else
:
arg_0
=
arg_0
[
0
]
+
arg_0
[
1
:
]
.
lower
(
)
else
:
arg_3
=
[
]
for
arg_4
in
arg_2
:
if
re
.
search
(
r'[A-Z]\.'
,
arg_4
)
:
arg_3
.
append
(
arg_4
)
else
:
arg_3
.
append
(
arg_4
[
0
]
+
arg_4
[
1
:
]
.
lower
(
)
)
arg_0
=
' '
.
join
(
arg_3
)
arg_0
=
collapse_initials
(
arg_0
)
arg_3
=
[
]
for
arg_4
in
arg_1
:
if
re
.
search
(
r'[A-Z]\.'
,
arg_4
)
:
arg_3
.
append
(
arg_4
)
else
:
arg_3
.
append
(
arg_4
[
0
]
+
arg_4
[
1
:
]
.
lower
(
)
)
arg_1
=
' '
.
join
(
arg_3
)
return
arg_0
,
arg_1

def Func(arg_0, arg_1):
    """ Converts capital letters to lower keeps first letter capital. """
    arg_2 = arg_0.split()
    if len(arg_2) == 1:
        if '-' in arg_0:
            arg_3 = arg_0.split('-')
            arg_3 = map(lambda a: a[0] + a[1:].lower(), arg_3)
            arg_0 = '-'.join(arg_3)
        else:
            arg_0 = arg_0[0] + arg_0[1:].lower()
    else:
        arg_3 = []
        for arg_4 in arg_2:
            if re.search(r'[A-Z]\.', arg_4):
                arg_3.append(arg_4)
            else:
                arg_3.append(arg_4[0] + arg_4[1:].lower())
        arg_0 = ' '.join(arg_3)
        arg_0 = collapse_initials(arg_0)
    arg_3 = []
    for arg_4 in arg_1:
        if re.search(r'[A-Z]\.', arg_4):
            arg_3.append(arg_4)
        else:
            arg_3.append(arg_4[0] + arg_4[1:].lower())
    arg_1 = ' '.join(arg_3)
    return arg_0, arg_1

Converts capital letters to lower keeps first letter capital .


Wait for file descriptors or timeout.
            Adds the current process in the correspondent waiting list and
            yield the cpu to another running process.

def Func(arg_0, arg_1, arg_2, arg_3):
        """ Wait for file descriptors or timeout.
            Adds the current process in the correspondent Funcing list and
            yield the cpu to another running process.
        """
        logger.debug("WAIT:")
        logger.debug(f"\tProcess {self._current} is going to Func for [ {readfds!r} {writefds!r} {timeout!r} ]")
        logger.debug(f"\tProcess: {self.procs!r}")
        logger.debug(f"\tRunning: {self.running!r}")
        logger.debug(f"\tRWait: {self.rFunc!r}")
        logger.debug(f"\tTWait: {self.tFunc!r}")
        logger.debug(f"\tTimers: {self.timers!r}")

        for arg_4 in arg_1:
            arg_0.rFunc[arg_4].add(arg_0._current)
        for arg_4 in arg_2:
            arg_0.tFunc[arg_4].add(arg_0._current)
        if arg_3 is not None:
            arg_0.timers[arg_0._current] = arg_0.clocks + arg_3
        arg_7 = arg_0._current
        # self.sched()
        arg_8 = (arg_0.running.index(arg_7) + 1) % len(arg_0.running)
        arg_0._current = arg_0.running[arg_8]
        logger.debug(f"\tTransfer control from process {procid} to {self._current}")
        logger.debug(f"\tREMOVING {procid!r} from {self.running!r}. Current: {self._current!r}")
        arg_0.running.remove(arg_7)
        if arg_0._current not in arg_0.running:
            logger.debug("\tCurrent not running. Checking for timers...")
            arg_0._current = None
            arg_0.check_timers()

Wait for file descriptors or timeout . Adds the current process in the correspondent waiting list and yield the cpu to another running process .


return len(self._listeners[event]) + len(self._once[event])

def Func ( arg_0 , arg_1 ) : return len ( arg_0 . _listeners [ arg_1 ] ) + len ( arg_0 . _once [ arg_1 ] )

def Func(arg_0, arg_1):
        """Get the number of listeners for the event.

        Args:
            event (str): The event for which to Func all listeners.

        The resulting Func is a combination of listeners added using
        'on'/'add_listener' and 'once'.
        """
        return len(arg_0._listeners[arg_1]) + len(arg_0._once[arg_1])

Get the number of listeners for the event.

        Args:
            event (str): The event for which to count all listeners.

        The resulting count is a combination of listeners added using
        'on'/'add_listener' and 'once'.

Get the number of listeners for the event .


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
logger
.
info
(
"Fetching data for '%s'"
,
arg_0
.
keywords
)
arg_3
=
arg_0
.
client
.
hits
(
arg_0
.
keywords
)
arg_4
=
arg_0
.
__parse_hits
(
arg_3
)
yield
arg_4
logger
.
info
(
"Fetch process completed"
)

def Func(arg_0, arg_1, **arg_2):
        """Fetch Google hit items

        :param category: the category of items to fetch
        :param kwargs: backend arguments

        :returns: a generator of items
        """
        logger.info("Fetching data for '%s'", arg_0.keywords)

        arg_3 = arg_0.client.hits(arg_0.keywords)
        arg_4 = arg_0.__parse_hits(arg_3)

        yield arg_4

        logger.info("Fetch process completed")


def Func ( arg_0 , arg_1 ) : arg_2 = GoogleCloudStorageHook ( google_cloud_storage_conn_id = arg_0 . google_cloud_storage_conn_id , delegate_to = arg_0 . delegate_to ) arg_2 . upload ( bucket_name = arg_0 . bucket , object_name = arg_0 . dst , mime_type = arg_0 . mime_type , filename = arg_0 . src , gzip = arg_0 . gzip , )

def Func(arg_0, arg_1):
        """
        Uploads the file to Google cloud storage
        """
        arg_2 = GoogleCloudStorageHook(
            google_cloud_storage_conn_id=arg_0.google_cloud_storage_conn_id,
            delegate_to=arg_0.delegate_to)

        arg_2.upload(
            bucket_name=arg_0.bucket,
            object_name=arg_0.dst,
            mime_type=arg_0.mime_type,
            filename=arg_0.src,
            gzip=arg_0.gzip,
        )


return ((sign << BITS - 1) | (exp << MANT_DIG - 1)) | mant

def Func(arg_0, arg_1):
  """Convert a Python float x into a 64-bit unsigned integer
  with the same byte representation."""

  if arg_1 == 8:
    arg_2 = -1021  # = sys.float_info.min_exp
    arg_3 = 1024   # = sys.float_info.max_exp
    arg_4 = 53    # = sys.float_info.mant_dig
    arg_5 = 64
  elif arg_1 == 4:
    arg_2 = -125   # C's FLT_MIN_EXP
    arg_3 = 128    # FLT_MAX_EXP
    arg_4 = 24    # FLT_MANT_DIG
    arg_5 = 32
  else:
    raise ValueError("invalid size value")

  arg_6 = math.copysign(1.0, arg_0) < 0.0
  if math.isinf(arg_0):
    arg_7 = 0
    arg_8 = arg_3 - arg_2 + 2
  elif math.isnan(arg_0):
    arg_7 = 1 << (arg_4 - 2)  # other values possible
    arg_8 = arg_3 - arg_2 + 2
  elif arg_0 == 0.0:
    arg_7 = 0
    arg_8 = 0
  else:
    arg_9, arg_10 = math.frexp(abs(arg_0))  # abs(x) == m * 2**e
    arg_8 = arg_10 - (arg_2 - 1)
    if arg_8 > 0:
      # Normal case.
      arg_7 = round_to_nearest(arg_9 * (1 << arg_4))
      arg_7 -= 1 << arg_4 - 1
    else:
      # Subnormal case.
      if arg_8 + arg_4 - 1 >= 0:
        arg_7 = round_to_nearest(arg_9 * (1 << arg_8 + arg_4 - 1))
      else:
        arg_7 = 0
      arg_8 = 0

    # Special case: rounding produced a MANT_DIG-bit mantissa.
    assert 0 <= arg_7 <= 1 << arg_4 - 1
    if arg_7 == 1 << arg_4 - 1:
      arg_7 = 0
      arg_8 += 1

    # Raise on overflow (in some circumstances, may want to return
    # infinity instead).
    if arg_8 >= arg_3 - arg_2 + 2:
      raise OverflowError("float too large to pack in this format")

  # check constraints
  assert 0 <= arg_7 < 1 << arg_4 - 1
  assert 0 <= arg_8 <= arg_3 - arg_2 + 2
  assert 0 <= arg_6 <= 1
  return ((arg_6 << arg_5 - 1) | (arg_8 << arg_4 - 1)) | arg_7

Convert a Python float x into a 64 - bit unsigned integer with the same byte representation .


(
    mp,
    resampling="nearest",
    scale_method=None,
    scales_minmax=None
)

def Func ( arg_0 , arg_1 = "nearest" , arg_2 = None , arg_3 = None ) : with arg_0 . open ( "raster" , arg_1 = arg_1 ) as raster_file : if raster_file . is_empty ( ) : return "empty" arg_4 = ( ) arg_5 = ( ) arg_6 = raster_file . read ( ) if arg_6 . ndim == 2 : arg_6 = ma . expand_dims ( arg_6 , axis = 0 ) if not arg_2 : arg_3 = [ ( i , i ) for i in range ( len ( arg_6 ) ) ] for arg_7 , ( arg_8 , arg_9 ) in zip ( arg_6 , arg_3 ) : if arg_2 in [ "dtype_scale" , "minmax_scale" ] : arg_4 += ( _stretch_array ( arg_7 , arg_8 , arg_9 ) , ) elif arg_2 == "crop" : arg_4 += ( np . clip ( arg_7 , arg_8 , arg_9 ) , ) else : arg_4 += ( arg_7 , ) arg_5 += ( arg_7 . mask , ) return ma . masked_array ( np . stack ( arg_4 ) , np . stack ( arg_5 ) )

def Func(
    arg_0,
    arg_1="nearest",
    arg_2=None,
    arg_3=None
):
    """
    Read, stretch and return raster data.

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

    Parameters:
    -----------
    resampling : str
        rasterio.Resampling method
    scale_method : str
        - dtype_scale: use dtype minimum and maximum values
        - minmax_scale: use dataset bands minimum and maximum values
        - crop: clip data to output dtype
    scales_minmax : tuple
        tuple of band specific scale values

    Output:
    -------
    np.ndarray
    """
    with arg_0.open("raster", arg_1=arg_1) as raster_file:

        # exit if input tile is empty
        if raster_file.is_empty():
            return "empty"

        # actually read data and iterate through bands
        arg_4 = ()
        arg_5 = ()
        arg_6 = raster_file.read()
        if arg_6.ndim == 2:
            arg_6 = ma.expand_dims(arg_6, axis=0)
        if not arg_2:
            arg_3 = [(i, i) for i in range(len(arg_6))]

        for arg_7, (arg_8, arg_9) in zip(arg_6, arg_3):
            if arg_2 in ["dtype_scale", "minmax_scale"]:
                arg_4 += (_stretch_array(arg_7, arg_8, arg_9), )
            elif arg_2 == "crop":
                arg_4 += (np.clip(arg_7, arg_8, arg_9), )
            else:
                arg_4 += (arg_7, )
            arg_5 += (arg_7.mask, )

    return ma.masked_array(np.stack(arg_4), np.stack(arg_5))


return cls(
            version=required_values[cls._KEY_VERSION],
            frequency=int(required_values[cls._KEY_FREQUENCY]),
            timestamp=int(required_values[cls._KEY_TIMESTAMP]),
            seed_value=required_values[cls._KEY_SEED_VALUE],
            previous_output_value=required_values[
                cls._KEY_PREVIOUS_OUTPUT_VALUE
            ],
            signature_value=required_values[cls._KEY_SIGNATURE_VALUE],
            output_value=required_values[cls._KEY_OUTPUT_VALUE],
            status_code=required_values[cls._KEY_STATUS_CODE],
        )

def Func ( arg_0 , arg_1 : arg_2 ) -> 'NistBeaconValue' : arg_3 = None arg_4 = { 'nist-0.1' : 'http://beacon.nist.gov/record/0.1/' , } arg_5 = { arg_0 . _KEY_FREQUENCY : None , arg_0 . _KEY_OUTPUT_VALUE : None , arg_0 . _KEY_PREVIOUS_OUTPUT_VALUE : None , arg_0 . _KEY_SEED_VALUE : None , arg_0 . _KEY_SIGNATURE_VALUE : None , arg_0 . _KEY_STATUS_CODE : None , arg_0 . _KEY_TIMESTAMP : None , arg_0 . _KEY_VERSION : None , } try : arg_6 = ElementTree . ElementTree ( ElementTree . fromstring ( arg_1 ) ) except ElementTree . ParseError : return arg_3 for arg_7 in arg_5 : arg_8 = arg_6 . find ( "{0}:{1}" . format ( 'nist-0.1' , arg_7 ) , namespaces = arg_4 , ) if not isinstance ( arg_8 , ElementTree . Element ) : continue arg_5 [ arg_7 ] = arg_8 . text if None in arg_5 . values ( ) : return arg_3 return arg_0 ( version = arg_5 [ arg_0 . _KEY_VERSION ] , frequency = int ( arg_5 [ arg_0 . _KEY_FREQUENCY ] ) , timestamp = int ( arg_5 [ arg_0 . _KEY_TIMESTAMP ] ) , seed_value = arg_5 [ arg_0 . _KEY_SEED_VALUE ] , previous_output_value = arg_5 [ arg_0 . _KEY_PREVIOUS_OUTPUT_VALUE ] , signature_value = arg_5 [ arg_0 . _KEY_SIGNATURE_VALUE ] , output_value = arg_5 [ arg_0 . _KEY_OUTPUT_VALUE ] , status_code = arg_5 [ arg_0 . _KEY_STATUS_CODE ] , )

def Func(arg_0, arg_1: arg_2) -> 'NistBeaconValue':
        """
        Convert a string of XML which represents a NIST Randomness Beacon value
        into a 'NistBeaconValue' object.

        :param input_xml: XML to build a 'NistBeaconValue' from
        :return: A 'NistBeaconValue' object, 'None' otherwise
        """

        arg_3 = None

        arg_4 = {
            'nist-0.1': 'http://beacon.nist.gov/record/0.1/',
        }

        # Our required values are "must haves". This makes it simple
        # to verify we loaded everything out of XML correctly.
        arg_5 = {
            arg_0._KEY_FREQUENCY: None,
            arg_0._KEY_OUTPUT_VALUE: None,
            arg_0._KEY_PREVIOUS_OUTPUT_VALUE: None,
            arg_0._KEY_SEED_VALUE: None,
            arg_0._KEY_SIGNATURE_VALUE: None,
            arg_0._KEY_STATUS_CODE: None,
            arg_0._KEY_TIMESTAMP: None,
            arg_0._KEY_VERSION: None,
        }

        # First attempt to load the xml, return 'None' on ParseError
        try:
            arg_6 = ElementTree.ElementTree(ElementTree.fromstring(arg_1))
        except ElementTree.ParseError:
            return arg_3

        # Using the required values, let's load the xml values in
        for arg_7 in arg_5:
            arg_8 = arg_6.find(
                "{0}:{1}".format('nist-0.1', arg_7),
                namespaces=arg_4,
            )

            if not isinstance(arg_8, ElementTree.Element):
                continue

            # Bad pylint message - https://github.com/PyCQA/pylint/issues/476
            # pylint: disable=no-member
            arg_5[arg_7] = arg_8.text

        # Confirm that the required values are set, and not 'None'
        if None in arg_5.values():
            return arg_3

        # We have all the required values, return a node object
        return arg_0(
            version=arg_5[arg_0._KEY_VERSION],
            frequency=int(arg_5[arg_0._KEY_FREQUENCY]),
            timestamp=int(arg_5[arg_0._KEY_TIMESTAMP]),
            seed_value=arg_5[arg_0._KEY_SEED_VALUE],
            previous_output_value=arg_5[
                arg_0._KEY_PREVIOUS_OUTPUT_VALUE
            ],
            signature_value=arg_5[arg_0._KEY_SIGNATURE_VALUE],
            output_value=arg_5[arg_0._KEY_OUTPUT_VALUE],
            status_code=arg_5[arg_0._KEY_STATUS_CODE],
        )

Convert a string of XML which represents a NIST Randomness Beacon value into a NistBeaconValue object .


def Func(arg_0):
    r"""Blackman Harris window

    :param N: window length

    .. math:: w(n) = a_0 - a_1 \cos\left(\frac{2\pi n}{N-1}\right)+ a_2 \cos\left(\frac{4\pi n}{N-1}\right)- a_3 \cos\left(\frac{6\pi n}{N-1}\right)

    =============== =========
    coeff            value
    =============== =========
    :math:`a_0`     0.35875
    :math:`a_1`     0.48829
    :math:`a_2`     0.14128
    :math:`a_3`     0.01168
    =============== =========

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

        from spectrum import window_visu
        window_visu(64, 'blackman_harris', mindB=-80)

    .. seealso:: :func:`spectrum.window.create_window`
    .. seealso:: :func:`create_window`, :class:`Window`
    """
    arg_1 = 0.35875
    arg_2 = 0.48829
    arg_3 = 0.14128
    arg_4 = 0.01168
    return _coeff4(arg_0, arg_1, arg_2, arg_3, arg_4)


def Func(arg_0, arg_1, arg_2):
  """Logs an error if no Copyright message appears at the top of the file."""

  # We'll say it should occur by line 10. Don't forget there's a
  # dummy line at the front.
  for arg_3 in range(1, min(len(arg_1), 11)):
    if re.search(r'Copyright', arg_1[arg_3], re.I): break
  else:                       # means no copyright line was found
    arg_2(arg_0, 0, 'legal/copyright', 5,
          'No copyright message found.  '
          'You should have a line: "Copyright [year] <Copyright Owner>"')

Logs an error if no Copyright message appears at the top of the file .


def Func ( arg_0 , * arg_1 ) : arg_2 = arg_1 [ 0 ] arg_3 = arg_2 . size arg_4 = { 8 : 'AH' , 16 : 'DX' , 32 : 'EDX' , 64 : 'RDX' } [ arg_3 ] arg_5 = { 8 : 'AL' , 16 : 'AX' , 32 : 'EAX' , 64 : 'RAX' } [ arg_3 ] arg_6 = arg_2 . read ( ) arg_7 = None arg_8 = None arg_9 = None if len ( arg_1 ) == 1 : arg_7 = arg_0 . read_register ( arg_5 ) arg_10 = ( Operators . SEXTEND ( arg_6 , arg_3 , arg_3 * 2 ) * Operators . SEXTEND ( arg_7 , arg_3 , arg_3 * 2 ) ) arg_10 = arg_10 & ( ( 1 << ( arg_3 * 2 ) ) - 1 ) arg_0 . write_register ( arg_5 , Operators . EXTRACT ( arg_10 , 0 , arg_3 ) ) arg_0 . write_register ( arg_4 , Operators . EXTRACT ( arg_10 , arg_3 , arg_3 ) ) arg_9 = Operators . EXTRACT ( arg_10 , 0 , arg_3 ) elif len ( arg_1 ) == 2 : arg_7 = arg_1 [ 1 ] . read ( ) arg_7 = Operators . SEXTEND ( arg_7 , arg_3 , arg_3 * 2 ) arg_10 = Operators . SEXTEND ( arg_6 , arg_3 , arg_3 * 2 ) * arg_7 arg_10 = arg_10 & ( ( 1 << ( arg_3 * 2 ) ) - 1 ) arg_9 = arg_2 . write ( Operators . EXTRACT ( arg_10 , 0 , arg_3 ) ) else : arg_7 = arg_1 [ 1 ] . read ( ) arg_8 = arg_1 [ 2 ] . read ( ) arg_10 = ( Operators . SEXTEND ( arg_7 , arg_3 , arg_3 * 2 ) * Operators . SEXTEND ( arg_8 , arg_1 [ 2 ] . size , arg_3 * 2 ) ) arg_10 = arg_10 & ( ( 1 << ( arg_3 * 2 ) ) - 1 ) arg_9 = arg_2 . write ( Operators . EXTRACT ( arg_10 , 0 , arg_3 ) ) arg_0 . CF = ( Operators . SEXTEND ( arg_9 , arg_3 , arg_3 * 2 ) != arg_10 ) arg_0 . OF = arg_0 . CF

def Func(arg_0, *arg_1):
        """
        Signed multiply.

        Performs a signed multiplication of two operands. This instruction has
        three forms, depending on the number of operands.
            - One-operand form. This form is identical to that used by the MUL
            instruction. Here, the source operand (in a general-purpose
            register or memory location) is multiplied by the value in the AL,
            AX, or EAX register (depending on the operand size) and the product
            is stored in the AX, DX:AX, or EDX:EAX registers, respectively.
            - Two-operand form. With this form the destination operand (the
            first operand) is multiplied by the source operand (second
            operand). The destination operand is a general-purpose register and
            the source operand is an immediate value, a general-purpose
            register, or a memory location. The product is then stored in the
            destination operand location.
            - Three-operand form. This form requires a destination operand (the
            first operand) and two source operands (the second and the third
            operands). Here, the first source operand (which can be a
            general-purpose register or a memory location) is multiplied by the
            second source operand (an immediate value). The product is then
            stored in the destination operand (a general-purpose register).

        When an immediate value is used as an operand, it is sign-extended to
        the length of the destination operand format. The CF and OF flags are
        set when significant bits are carried into the upper half of the
        result. The CF and OF flags are cleared when the result fits exactly in
        the lower half of the result. The three forms of the Func instruction
        are similar in that the length of the product is calculated to twice
        the length of the operands. With the one-operand form, the product is
        stored exactly in the destination. With the two- and three- operand
        forms, however, result is truncated to the length of the destination
        before it is stored in the destination register. Because of this
        truncation, the CF or OF flag should be tested to ensure that no
        significant bits are lost. The two- and three-operand forms may also be
        used with unsigned operands because the lower half of the product is
        the same regardless if the operands are signed or unsigned. The CF and
        OF flags, however, cannot be used to determine if the upper half of the
        result is non-zero::

        IF (NumberOfOperands == 1)
        THEN
            IF (OperandSize == 8)
            THEN
                AX = AL * SRC (* Signed multiplication *)
                IF AL == AX
                THEN
                    CF = 0; OF = 0;
                ELSE
                    CF = 1; OF = 1;
                FI;
            ELSE
                IF OperandSize == 16
                THEN
                    DX:AX = AX * SRC (* Signed multiplication *)
                    IF sign_extend_to_32 (AX) == DX:AX
                    THEN
                        CF = 0; OF = 0;
                    ELSE
                        CF = 1; OF = 1;
                    FI;
                ELSE
                    IF OperandSize == 32
                    THEN
                        EDX:EAX = EAX * SRC (* Signed multiplication *)
                        IF EAX == EDX:EAX
                        THEN
                            CF = 0; OF = 0;
                        ELSE
                            CF = 1; OF = 1;
                        FI;
                    ELSE (* OperandSize = 64 *)
                        RDX:RAX = RAX * SRC (* Signed multiplication *)
                        IF RAX == RDX:RAX
                        THEN
                            CF = 0; OF = 0;
                        ELSE
                           CF = 1; OF = 1;
                        FI;
                    FI;
                FI;
        ELSE
            IF (NumberOfOperands = 2)
            THEN
                temp = DEST * SRC (* Signed multiplication; temp is double DEST size *)
                DEST = DEST * SRC (* Signed multiplication *)
                IF temp != DEST
                THEN
                    CF = 1; OF = 1;
                ELSE
                    CF = 0; OF = 0;
                FI;
            ELSE (* NumberOfOperands = 3 *)
                DEST = SRC1 * SRC2 (* Signed multiplication *)
                temp = SRC1 * SRC2 (* Signed multiplication; temp is double SRC1 size *)
                IF temp != DEST
                THEN
                    CF = 1; OF = 1;
                ELSE
                    CF = 0; OF = 0;
                FI;
            FI;
        FI;

        :param cpu: current CPU.
        :param operands: variable list of operands.
        """
        arg_2 = arg_1[0]
        arg_3 = arg_2.size
        arg_4 = {8: 'AH', 16: 'DX', 32: 'EDX', 64: 'RDX'}[arg_3]
        arg_5 = {8: 'AL', 16: 'AX', 32: 'EAX', 64: 'RAX'}[arg_3]

        arg_6 = arg_2.read()
        arg_7 = None
        arg_8 = None
        arg_9 = None
        if len(arg_1) == 1:
            arg_7 = arg_0.read_register(arg_5)
            arg_10 = (Operators.SEXTEND(arg_6, arg_3, arg_3 * 2) *
                    Operators.SEXTEND(arg_7, arg_3, arg_3 * 2))
            arg_10 = arg_10 & ((1 << (arg_3 * 2)) - 1)
            arg_0.write_register(arg_5,
                               Operators.EXTRACT(arg_10, 0, arg_3))
            arg_0.write_register(arg_4,
                               Operators.EXTRACT(arg_10, arg_3, arg_3))
            arg_9 = Operators.EXTRACT(arg_10, 0, arg_3)
        elif len(arg_1) == 2:
            arg_7 = arg_1[1].read()
            arg_7 = Operators.SEXTEND(arg_7, arg_3, arg_3 * 2)
            arg_10 = Operators.SEXTEND(arg_6, arg_3, arg_3 * 2) * arg_7
            arg_10 = arg_10 & ((1 << (arg_3 * 2)) - 1)
            arg_9 = arg_2.write(Operators.EXTRACT(arg_10, 0, arg_3))
        else:
            arg_7 = arg_1[1].read()
            arg_8 = arg_1[2].read()
            arg_10 = (Operators.SEXTEND(arg_7, arg_3, arg_3 * 2) *
                    Operators.SEXTEND(arg_8, arg_1[2].size, arg_3 * 2))
            arg_10 = arg_10 & ((1 << (arg_3 * 2)) - 1)
            arg_9 = arg_2.write(Operators.EXTRACT(arg_10, 0, arg_3))

        arg_0.CF = (Operators.SEXTEND(arg_9, arg_3, arg_3 * 2) != arg_10)
        arg_0.OF = arg_0.CF

Signed multiply.

        Performs a signed multiplication of two operands. This instruction has
        three forms, depending on the number of operands.
            - One-operand form. This form is identical to that used by the MUL
            instruction. Here, the source operand (in a general-purpose
            register or memory location) is multiplied by the value in the AL,
            AX, or EAX register (depending on the operand size) and the product
            is stored in the AX, DX:AX, or EDX:EAX registers, respectively.
            - Two-operand form. With this form the destination operand (the
            first operand) is multiplied by the source operand (second
            operand). The destination operand is a general-purpose register and
            the source operand is an immediate value, a general-purpose
            register, or a memory location. The product is then stored in the
            destination operand location.
            - Three-operand form. This form requires a destination operand (the
            first operand) and two source operands (the second and the third
            operands). Here, the first source operand (which can be a
            general-purpose register or a memory location) is multiplied by the
            second source operand (an immediate value). The product is then
            stored in the destination operand (a general-purpose register).

        When an immediate value is used as an operand, it is sign-extended to
        the length of the destination operand format. The CF and OF flags are
        set when significant bits are carried into the upper half of the
        result. The CF and OF flags are cleared when the result fits exactly in
        the lower half of the result. The three forms of the IMUL instruction
        are similar in that the length of the product is calculated to twice
        the length of the operands. With the one-operand form, the product is
        stored exactly in the destination. With the two- and three- operand
        forms, however, result is truncated to the length of the destination
        before it is stored in the destination register. Because of this
        truncation, the CF or OF flag should be tested to ensure that no
        significant bits are lost. The two- and three-operand forms may also be
        used with unsigned operands because the lower half of the product is
        the same regardless if the operands are signed or unsigned. The CF and
        OF flags, however, cannot be used to determine if the upper half of the
        result is non-zero::

        IF (NumberOfOperands == 1)
        THEN
            IF (OperandSize == 8)
            THEN
                AX = AL * SRC (* Signed multiplication *)
                IF AL == AX
                THEN
                    CF = 0; OF = 0;
                ELSE
                    CF = 1; OF = 1;
                FI;
            ELSE
                IF OperandSize == 16
                THEN
                    DX:AX = AX * SRC (* Signed multiplication *)
                    IF sign_extend_to_32 (AX) == DX:AX
                    THEN
                        CF = 0; OF = 0;
                    ELSE
                        CF = 1; OF = 1;
                    FI;
                ELSE
                    IF OperandSize == 32
                    THEN
                        EDX:EAX = EAX * SRC (* Signed multiplication *)
                        IF EAX == EDX:EAX
                        THEN
                            CF = 0; OF = 0;
                        ELSE
                            CF = 1; OF = 1;
                        FI;
                    ELSE (* OperandSize = 64 *)
                        RDX:RAX = RAX * SRC (* Signed multiplication *)
                        IF RAX == RDX:RAX
                        THEN
                            CF = 0; OF = 0;
                        ELSE
                           CF = 1; OF = 1;
                        FI;
                    FI;
                FI;
        ELSE
            IF (NumberOfOperands = 2)
            THEN
                temp = DEST * SRC (* Signed multiplication; temp is double DEST size *)
                DEST = DEST * SRC (* Signed multiplication *)
                IF temp != DEST
                THEN
                    CF = 1; OF = 1;
                ELSE
                    CF = 0; OF = 0;
                FI;
            ELSE (* NumberOfOperands = 3 *)
                DEST = SRC1 * SRC2 (* Signed multiplication *)
                temp = SRC1 * SRC2 (* Signed multiplication; temp is double SRC1 size *)
                IF temp != DEST
                THEN
                    CF = 1; OF = 1;
                ELSE
                    CF = 0; OF = 0;
                FI;
            FI;
        FI;

        :param cpu: current CPU.
        :param operands: variable list of operands.


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
assert
arg_0
.
cookie_monster
,
'Cookie Monster not set'
return
arg_0
.
cookie_monster
.
Func
(
arg_1
,
arg_2
)

def Func(arg_0, arg_1, arg_2=None):
        """Gets the value of the cookie with the given name, else default."""
        assert arg_0.cookie_monster, 'Cookie Monster not set'
        return arg_0.cookie_monster.Func(arg_1, arg_2)

Gets the value of the cookie with the given name else default .


def Func(arg_0):
    r'''Round a number to the nearest whole number. If the number is exactly
    between two numbers, round to the even whole number. Used by
    `viscosity_index`.

    Parameters
    ----------
    i : float
        Number, [-]

    Returns
    -------
    i : int
        Rounded number, [-]

    Notes
    -----
    Should never run with inputs from a practical function, as numbers on
    computers aren't really normally exactly between two numbers.

    Examples
    --------
    Func(116.5)
    116
    '''
    if arg_0 % .5 == 0:
        if (arg_0 + 0.5) % 2 == 0:
            arg_0 = arg_0 + 0.5
        else:
            arg_0 = arg_0 - 0.5
    else:
        arg_0 = round(arg_0, 0)
    return int(arg_0)

r'''Round a number to the nearest whole number. If the number is exactly
    between two numbers, round to the even whole number. Used by
    `viscosity_index`.

    Parameters
    ----------
    i : float
        Number, [-]

    Returns
    -------
    i : int
        Rounded number, [-]

    Notes
    -----
    Should never run with inputs from a practical function, as numbers on
    computers aren't really normally exactly between two numbers.

    Examples
    --------
    _round_whole_even(116.5)
    116

r Round a number to the nearest whole number . If the number is exactly between two numbers round to the even whole number . Used by viscosity_index .


def Func ( arg_0 , arg_1 ) : try : arg_0 . get_conn ( ) . head_bucket ( Bucket = arg_1 ) return True except ClientError as e : arg_0 . log . info ( e . response [ "Error" ] [ "Message" ] ) return False

def Func(arg_0, arg_1):
        """
        Check if bucket_name exists.

        :param bucket_name: the name of the bucket
        :type bucket_name: str
        """
        try:
            arg_0.get_conn().head_bucket(Bucket=arg_1)
            return True
        except ClientError as e:
            arg_0.log.info(e.response["Error"]["Message"])
            return False


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 in arg_1 [ 'apps' ] [ arg_0 ] [ 'depends' ] [ 'libs' ] : arg_4 = arg_1 [ 'libs' ] [ arg_3 ] arg_2 . append ( "{}:{}" . format ( Repo ( arg_4 [ 'repo' ] ) . vm_path , container_code_path ( arg_4 ) ) ) return arg_2

def Func(arg_0, arg_1):
    """ Returns a list of the formatted volume mounts for all libs that an app uses """
    arg_2 = []
    for arg_3 in arg_1['apps'][arg_0]['depends']['libs']:
        arg_4 = arg_1['libs'][arg_3]
        arg_2.append("{}:{}".format(Repo(arg_4['repo']).vm_path, container_code_path(arg_4)))
    return arg_2


def Func(arg_0, arg_1):
    """Crop the given PIL Image into four corners and the central crop.

    .. Note::
        This transform returns a tuple of images and there may be a
        mismatch in the number of inputs and targets your ``Dataset`` returns.

    Args:
       size (sequence or int): Desired output size of the crop. If size is an
           int instead of sequence like (h, w), a square crop (size, size) is
           made.

    Returns:
       tuple: tuple (tl, tr, bl, br, center)
                Corresponding top left, top right, bottom left, bottom right and center crop.
    """
    if isinstance(arg_1, numbers.Number):
        arg_1 = (int(arg_1), int(arg_1))
    else:
        assert len(arg_1) == 2, "Please provide only two dimensions (h, w) for size."

    arg_2, arg_3 = arg_0.size
    arg_4, arg_5 = arg_1
    if arg_5 > arg_2 or arg_4 > arg_3:
        raise ValueError("Requested crop size {} is bigger than input size {}".format(arg_1,
                                                                                (arg_3, arg_2)))
    arg_6 = arg_0.crop((0, 0, arg_5, arg_4))
    arg_7 = arg_0.crop((arg_2 - arg_5, 0, arg_2, arg_4))
    arg_8 = arg_0.crop((0, arg_3 - arg_4, arg_5, arg_3))
    arg_9 = arg_0.crop((arg_2 - arg_5, arg_3 - arg_4, arg_2, arg_3))
    arg_10 = center_crop(arg_0, (arg_4, arg_5))
    return (arg_6, arg_7, arg_8, arg_9, arg_10)

Crop the given PIL Image into four corners and the central crop .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = Hasher ( ) arg_3 . update ( arg_1 ) arg_0 . coverage . data . add_to_hash ( arg_2 . filename , arg_3 ) return arg_3 . digest ( )

def Func(arg_0, arg_1, arg_2):
        """Compute a hash that changes if the file needs to be re-reported."""
        arg_3 = Hasher()
        arg_3.update(arg_1)
        arg_0.coverage.data.add_to_hash(arg_2.filename, arg_3)
        return arg_3.digest()

Compute a hash that changes if the file needs to be re - reported .


def Func(arg_0, arg_1, arg_2=None):
    """ Search for items in `table` that have the same field sub-set values as in `sample`.
    Expecting it to be unique, otherwise will raise an exception.

    Parameters
    ----------
    table: tinydb.table
    sample: dict
        Sample data

    Returns
    -------
    search_result: tinydb.database.Element
        Unique item result of the search.

    Raises
    ------
    KeyError:
        If the search returns for more than one entry.
    """
    if arg_2 is None:
        arg_2 = list(arg_1.keys())

    arg_3 = _query_data(arg_1, field_names=arg_2, operators='__eq__')
    arg_4 = arg_0.search(arg_3)

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

    if len(arg_4) == 0:
        return None

    raise MoreThanOneItemError('Expected to find zero or one items, but found '
                                '{} items.'.format(len(arg_4)))

Search for items in table that have the same field sub - set values as in sample . Expecting it to be unique otherwise will raise an exception .


return ContentMetadataItemTransmission.objects.filter(
            enterprise_customer=self.enterprise_configuration.enterprise_customer,
            integrated_channel_code=self.enterprise_configuration.channel_code()
        )

def Func ( arg_0 ) : arg_1 = apps . get_model ( 'integrated_channel' , 'ContentMetadataItemTransmission' ) return arg_1 . objects . filter ( enterprise_customer = arg_0 . enterprise_configuration . enterprise_customer , integrated_channel_code = arg_0 . enterprise_configuration . channel_code ( ) )

def Func(arg_0):
        """
        Return the ContentMetadataItemTransmision models for previously
        transmitted content metadata items.
        """
        # pylint: disable=invalid-name
        arg_1 = apps.get_model(
            'integrated_channel',
            'ContentMetadataItemTransmission'
        )
        return arg_1.objects.filter(
            enterprise_customer=arg_0.enterprise_configuration.enterprise_customer,
            integrated_channel_code=arg_0.enterprise_configuration.channel_code()
        )

Return the ContentMetadataItemTransmision models for previously transmitted content metadata items .


def
Func
(
arg_0
,
arg_1
=
)
:
if
not
arg_1
:
arg_1
=
AppKit
.
NSString
if
not
isinstance
(
arg_1
,
types
.
ListType
)
:
arg_1
=
[
arg_1
]
arg_2
=
pprint
.
PrettyPrinter
(
)
logging
.
debug
(
'Desired datatypes: %s'
%
arg_2
.
pformat
(
arg_1
)
)
arg_3
=
{
}
logging
.
debug
(
'Results filter is: %s'
%
arg_2
.
pformat
(
arg_3
)
)
try
:
arg_4
=
'Request to verify pasteboard is empty'
logging
.
debug
(
arg_4
)
arg_5
=
AppKit
.
NSPasteboard
.
generalPasteboard
(
)
arg_6
=
not
bool
(
arg_5
.
canReadObjectForClasses_options_
(
arg_1
,
arg_3
)
)
except
ValueError
as
error
:
logging
.
error
(
error
)
raise
return
bool
(
arg_6
)

def Func(arg_0, arg_1=None):
        """Method to test if the general pasteboard is empty or not with respect
        to the type of object you want.

        Parameters: datatype (defaults to strings)
        Returns: Boolean True (empty) / False (has contents); Raises
                 exception (passes any raised up)
        """
        if not arg_1:
            arg_1 = AppKit.NSString
        if not isinstance(arg_1, types.ListType):
            arg_1 = [arg_1]
        arg_2 = pprint.PrettyPrinter()
        logging.debug('Desired datatypes: %s' % arg_2.pformat(arg_1))
        arg_3 = {}
        logging.debug('Results filter is: %s' % arg_2.pformat(arg_3))

        try:
            arg_4 = 'Request to verify pasteboard is empty'
            logging.debug(arg_4)
            arg_5 = AppKit.NSPasteboard.generalPasteboard()
            # canReadObjectForClasses_options_() seems to return an int (> 0 if
            # True)
            # Need to negate to get the sense we want (True if can not read the
            # data type from the pasteboard)
            arg_6 = not bool(arg_5.canReadObjectForClasses_options_(arg_1,
                                                                     arg_3))
        except ValueError as error:
            logging.error(error)
            raise

        return bool(arg_6)

Method to test if the general pasteboard is empty or not with respect to the type of object you want .


(self, origin, backend_name, category, archived_after)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """Search archives using filters."""

        for arg_5 in arg_0._search_files():
            try:
                arg_6 = Archive(arg_5)
            except ArchiveError:
                continue

            arg_7 = arg_6.origin == arg_1 and \
                arg_6.backend_name == arg_2 and \
                arg_6.category == arg_3 and \
                arg_6.created_on >= arg_4

            if not arg_7:
                continue

            yield arg_5, arg_6.created_on


def Func ( arg_0 , arg_1 ) : arg_0 . bot . _frame = 0 arg_0 . bot . _namespace . clear ( ) arg_0 . bot . _namespace . update ( arg_0 . bot . _initial_namespace )

def Func(arg_0, arg_1):
        """
        Attempt to restart the bot.
        """
        arg_0.bot._frame = 0
        arg_0.bot._namespace.clear()
        arg_0.bot._namespace.update(arg_0.bot._initial_namespace)


(annotations, fig_kw=None, meta=True, **kwargs)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
True
,
**
arg_3
)
:
if
arg_1
is
:
arg_1
=
dict
(
)
arg_1
.
setdefault
(
'sharex'
,
True
)
arg_1
.
setdefault
(
'squeeze'
,
True
)
arg_4
=
[
]
for
arg_5
in
arg_0
:
for
arg_6
in
VIZ_MAPPING
:
if
can_convert
(
arg_5
,
arg_6
)
:
arg_4
.
append
(
arg_5
)
break
if
not
len
(
arg_4
)
:
raise
ParameterError
(
'No displayable annotations found'
)
arg_7
,
arg_8
=
plt
.
subplots
(
nrows
=
len
(
arg_4
)
,
ncols
=
1
,
**
arg_1
)
if
len
(
arg_4
)
==
1
:
arg_8
=
[
arg_8
]
for
arg_5
,
arg_9
in
zip
(
arg_4
,
arg_8
)
:
arg_3
[
'ax'
]
=
arg_9
display
(
arg_5
,
arg_2
=
arg_2
,
**
arg_3
)
return
arg_7
,
arg_8

def Func(arg_0, arg_1=None, arg_2=True, **arg_3):
    '''Display multiple annotations with shared axes

    Parameters
    ----------
    annotations : jams.AnnotationArray
        A collection of annotations to display

    fig_kw : dict
        Keyword arguments to `plt.figure`

    meta : bool
        If `True`, display annotation metadata for each annotation

    kwargs
        Additional keyword arguments to the `mir_eval.display` routines

    Returns
    -------
    fig
        The created figure
    axs
        List of subplot axes corresponding to each displayed annotation
    '''
    if arg_1 is None:
        arg_1 = dict()

    arg_1.setdefault('sharex', True)
    arg_1.setdefault('squeeze', True)

    # Filter down to coercable annotations first
    arg_4 = []
    for arg_5 in arg_0:
        for arg_6 in VIZ_MAPPING:
            if can_convert(arg_5, arg_6):
                arg_4.append(arg_5)
                break

    # If there are no displayable annotations, fail here
    if not len(arg_4):
        raise ParameterError('No displayable annotations found')

    arg_7, arg_8 = plt.subplots(nrows=len(arg_4), ncols=1, **arg_1)

    # MPL is stupid when making singleton subplots.
    # We catch this and make it always iterable.
    if len(arg_4) == 1:
        arg_8 = [arg_8]

    for arg_5, arg_9 in zip(arg_4, arg_8):
        arg_3['ax'] = arg_9
        display(arg_5, arg_2=arg_2, **arg_3)

    return arg_7, arg_8


def Func ( arg_0 , arg_1 ) : arg_0 . f . write ( '\n' . join ( super ( PostgresFileWriter , arg_0 ) . Func ( arg_1 ) ) )

def Func(arg_0, arg_1):
        """Write TRIGGERs existing on `table` to the output file

        :Parameters:
          - `table`: an instance of a :py:class:`mysql2pgsql.lib.mysql_reader.MysqlReader.Table` object that represents the table to read/write.

        Returns None
        """
        arg_0.f.write('\n'.join(super(PostgresFileWriter, arg_0).Func(arg_1)))

Write TRIGGERs existing on table to the output file


def Func ( arg_0 : arg_1 . Application , ** arg_3 ) : arg_4 = Runner ( arg_0 , ** arg_3 ) arg_4 . Func ( )

def Func(arg_0: arg_1.Application, **arg_3):
    """Run an `aiohttp.web.Application` using gunicorn.

    :param app: The app to Func.
    :param str app_uri: Import path to `app`. Takes the form
        ``$(MODULE_NAME):$(VARIABLE_NAME)``.
        The module name can be a full dotted path.
        The variable name refers to the `aiohttp.web.Application` instance.
        This argument is required if ``reload=True``.
    :param str host: Hostname to listen on.
    :param int port: Port of the server.
    :param bool reload: Whether to reload the server on a code change.
        If not set, will take the same value as ``app.debug``.
        **EXPERIMENTAL**.
    :param \*\*kwargs: Extra configuration options to set on the
        ``GunicornApp's`` config object.
    """
    arg_4 = Runner(arg_0, **arg_3)
    arg_4.Func()

Run an `aiohttp.web.Application` using gunicorn.

    :param app: The app to run.
    :param str app_uri: Import path to `app`. Takes the form
        ``$(MODULE_NAME):$(VARIABLE_NAME)``.
        The module name can be a full dotted path.
        The variable name refers to the `aiohttp.web.Application` instance.
        This argument is required if ``reload=True``.
    :param str host: Hostname to listen on.
    :param int port: Port of the server.
    :param bool reload: Whether to reload the server on a code change.
        If not set, will take the same value as ``app.debug``.
        **EXPERIMENTAL**.
    :param \*\*kwargs: Extra configuration options to set on the
        ``GunicornApp's`` config object.

Run an aiohttp . web . Application using gunicorn .


def
Func
(
arg_0
,
arg_1
=
0.5
)
:
if
len
(
arg_0
.
shape
)
==
3
:
if
arg_0
.
shape
[
1
]
==
3
:
arg_2
=
arg_0
.
shape
arg_3
=
np
.
random
.
binomial
(
n
=
1
,
p
=
arg_1
,
size
=
arg_0
.
shape
[
:
1
]
)
for
arg_4
in
range
(
3
)
:
arg_0
[
:
,
:
,
arg_4
]
=
np
.
multiply
(
arg_0
[
:
,
:
,
arg_4
]
,
arg_3
)
elif
arg_0
.
shape
[
1
]
==
1
:
arg_2
=
arg_0
.
shape
arg_0
=
np
.
multiply
(
arg_0
,
np
.
random
.
binomial
(
n
=
1
,
p
=
arg_1
,
size
=
arg_2
)
)
else
:
raise
Exception
(
"Unsupported shape {}"
.
format
(
arg_0
.
shape
)
)
elif
len
(
arg_0
.
shape
)
==
2
or
1
:
arg_2
=
arg_0
.
shape
arg_0
=
np
.
multiply
(
arg_0
,
np
.
random
.
binomial
(
n
=
1
,
p
=
arg_1
,
size
=
arg_2
)
)
else
:
raise
Exception
(
"Unsupported shape {}"
.
format
(
arg_0
.
shape
)
)
return
arg_0

def Func(arg_0, arg_1=0.5):
    """Randomly set some pixels to zero by a given keeping probability.

    Parameters
    -----------
    x : numpy.array
        An image with dimension of [row, col, channel] or [row, col].
    keep : float
        The keeping probability (0, 1), the lower more values will be set to zero.

    Returns
    -------
    numpy.array
        A processed image.

    """
    if len(arg_0.shape) == 3:
        if arg_0.shape[-1] == 3:  # color
            arg_2 = arg_0.shape
            arg_3 = np.random.binomial(n=1, p=arg_1, size=arg_0.shape[:-1])
            for arg_4 in range(3):
                arg_0[:, :, arg_4] = np.multiply(arg_0[:, :, arg_4], arg_3)
        elif arg_0.shape[-1] == 1:  # greyscale image
            arg_2 = arg_0.shape
            arg_0 = np.multiply(arg_0, np.random.binomial(n=1, p=arg_1, size=arg_2))
        else:
            raise Exception("Unsupported shape {}".format(arg_0.shape))
    elif len(arg_0.shape) == 2 or 1:  # greyscale matrix (image) or vector
        arg_2 = arg_0.shape
        arg_0 = np.multiply(arg_0, np.random.binomial(n=1, p=arg_1, size=arg_2))
    else:
        raise Exception("Unsupported shape {}".format(arg_0.shape))
    return arg_0

Randomly set some pixels to zero by a given keeping probability .


def
Func
(
arg_0
:
arg_1
)
->
dict
:
arg_2
=
arg_0
.
split
(
)
arg_3
=
param
.
load_info
(
'assets'
)
if
(
arg_2
[
1
]
==
'Equity'
)
and
(
'='
not
in
arg_2
[
0
]
)
:
arg_4
=
arg_2
[
2
]
for
arg_5
in
arg_3
.
get
(
'Equity'
,
[
dict
(
)
]
)
:
if
'exch_codes'
not
in
arg_5
:
continue
if
arg_4
in
arg_5
[
'exch_codes'
]
:
return
arg_5
return
dict
(
)
if
arg_2
[
1
]
==
'Curncy'
:
for
arg_5
in
arg_3
.
get
(
'Curncy'
,
[
dict
(
)
]
)
:
if
'tickers'
not
in
arg_5
:
continue
if
(
arg_2
[
0
]
.
split
(
'+'
)
[
0
]
in
arg_5
[
'tickers'
]
)
or
(
arg_2
[
0
]
[
1
]
.
isdigit
(
)
and
(
arg_2
[
0
]
[
:
1
]
in
arg_5
[
'tickers'
]
)
)
:
return
arg_5
return
dict
(
)
if
arg_2
[
1
]
==
'Comdty'
:
for
arg_5
in
arg_3
.
get
(
'Comdty'
,
[
dict
(
)
]
)
:
if
'tickers'
not
in
arg_5
:
continue
if
arg_2
[
0
]
[
:
1
]
in
arg_5
[
'tickers'
]
:
return
arg_5
return
dict
(
)
if
(
arg_2
[
1
]
==
'Index'
)
or
(
(
arg_2
[
1
]
==
'Equity'
)
and
(
'='
in
arg_2
[
0
]
)
)
:
if
arg_2
[
1
]
==
'Equity'
:
arg_6
=
arg_2
[
0
]
.
split
(
'='
)
[
0
]
else
:
arg_6
=
' '
.
join
(
arg_2
[
:
1
]
)
for
arg_5
in
arg_3
.
get
(
'Index'
,
[
dict
(
)
]
)
:
if
'tickers'
not
in
arg_5
:
continue
if
(
arg_6
[
:
2
]
==
'UX'
)
and
(
'UX'
in
arg_5
[
'tickers'
]
)
:
return
arg_5
if
arg_6
in
arg_5
[
'tickers'
]
:
if
arg_2
[
1
]
==
'Equity'
:
return
arg_5
if
not
arg_5
.
get
(
'is_fut'
,
False
)
:
return
arg_5
if
arg_6
[
:
1
]
.
rstrip
(
)
in
arg_5
[
'tickers'
]
:
if
arg_5
.
get
(
'is_fut'
,
False
)
:
return
arg_5
return
dict
(
)
if
arg_2
[
1
]
==
'Corp'
:
for
arg_5
in
arg_3
.
get
(
'Corp'
,
[
dict
(
)
]
)
:
if
'ticker'
not
in
arg_5
:
continue
return
dict
(
)

def Func(arg_0: arg_1) -> dict:
    """
    Get info for given market

    Args:
        ticker: Bloomberg full ticker

    Returns:
        dict

    Examples:
        >>> info = Func('SHCOMP Index')
        >>> info['exch']
        'EquityChina'
        >>> info = Func('ICICIC=1 IS Equity')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> info = Func('INT1 Curncy')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> info = Func('CL1 Comdty')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> # Wrong tickers
        >>> Func('C XX Equity')
        {}
        >>> Func('XXX Comdty')
        {}
        >>> Func('Bond_ISIN Corp')
        {}
        >>> Func('XYZ Index')
        {}
        >>> Func('XYZ Curncy')
        {}
    """
    arg_2 = arg_0.split()
    arg_3 = param.load_info('assets')

    # ========================== #
    #           Equity           #
    # ========================== #

    if (arg_2[-1] == 'Equity') and ('=' not in arg_2[0]):
        arg_4 = arg_2[-2]
        for arg_5 in arg_3.get('Equity', [dict()]):
            if 'exch_codes' not in arg_5: continue
            if arg_4 in arg_5['exch_codes']: return arg_5
        return dict()

    # ============================ #
    #           Currency           #
    # ============================ #

    if arg_2[-1] == 'Curncy':
        for arg_5 in arg_3.get('Curncy', [dict()]):
            if 'tickers' not in arg_5: continue
            if (arg_2[0].split('+')[0] in arg_5['tickers']) or \
                    (arg_2[0][-1].isdigit() and (arg_2[0][:-1] in arg_5['tickers'])):
                return arg_5
        return dict()

    if arg_2[-1] == 'Comdty':
        for arg_5 in arg_3.get('Comdty', [dict()]):
            if 'tickers' not in arg_5: continue
            if arg_2[0][:-1] in arg_5['tickers']: return arg_5
        return dict()

    # =================================== #
    #           Index / Futures           #
    # =================================== #

    if (arg_2[-1] == 'Index') or (
        (arg_2[-1] == 'Equity') and ('=' in arg_2[0])
    ):
        if arg_2[-1] == 'Equity':
            arg_6 = arg_2[0].split('=')[0]
        else:
            arg_6 = ' '.join(arg_2[:-1])
        for arg_5 in arg_3.get('Index', [dict()]):
            if 'tickers' not in arg_5: continue
            if (arg_6[:2] == 'UX') and ('UX' in arg_5['tickers']): return arg_5
            if arg_6 in arg_5['tickers']:
                if arg_2[-1] == 'Equity': return arg_5
                if not arg_5.get('is_fut', False): return arg_5
            if arg_6[:-1].rstrip() in arg_5['tickers']:
                if arg_5.get('is_fut', False): return arg_5
        return dict()

    if arg_2[-1] == 'Corp':
        for arg_5 in arg_3.get('Corp', [dict()]):
            if 'ticker' not in arg_5: continue

    return dict()

Get info for given market

    Args:
        ticker: Bloomberg full ticker

    Returns:
        dict

    Examples:
        >>> info = market_info('SHCOMP Index')
        >>> info['exch']
        'EquityChina'
        >>> info = market_info('ICICIC=1 IS Equity')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> info = market_info('INT1 Curncy')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> info = market_info('CL1 Comdty')
        >>> info['freq'], info['is_fut']
        ('M', True)
        >>> # Wrong tickers
        >>> market_info('C XX Equity')
        {}
        >>> market_info('XXX Comdty')
        {}
        >>> market_info('Bond_ISIN Corp')
        {}
        >>> market_info('XYZ Index')
        {}
        >>> market_info('XYZ Curncy')
        {}


return X.map(lambda X: super(cls, self).predict(X, *args, **kwargs))

def Func ( arg_0 , arg_1 , arg_2 , * arg_3 , ** arg_4 ) : return arg_2 . map ( lambda arg_2 : super ( arg_1 , arg_0 ) . predict ( arg_2 , * arg_3 , ** arg_4 ) )

def Func(arg_0, arg_1, arg_2, *arg_3, **arg_4):
        """Wraps a Scikit-learn Linear model's predict method to use with RDD
        input.

        Parameters
        ----------
        cls : class object
            The sklearn linear model's class to wrap.
        Z : ArrayRDD
            The distributed data to predict in a DictRDD.

        Returns
        -------
        self: the wrapped class
        """
        return arg_2.map(lambda arg_2: super(arg_1, arg_0).predict(arg_2, *arg_3, **arg_4))

Wraps a Scikit - learn Linear model s predict method to use with RDD input .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
classes
(
)
:
arg_2
=
inspect
.
getmembers
(
arg_1
,
lambda
f
:
inspect
.
ismethod
(
f
)
or
inspect
.
isfunction
(
f
)
)
arg_3
=
getattr
(
arg_0
,
'method_name'
,
''
)
arg_4
=
''
if
arg_3
:
if
arg_3
.
startswith
(
arg_0
.
method_prefix
)
:
arg_4
=
re
.
compile
(
r'^{}'
.
format
(
arg_3
)
,
flags
=
re
.
I
)
else
:
if
arg_3
.
startswith
(
"*"
)
:
arg_3
=
arg_3
.
strip
(
"*"
)
arg_4
=
re
.
compile
(
r'^{}[_]{{0,1}}.*?{}'
.
format
(
arg_0
.
method_prefix
,
arg_3
)
,
flags
=
re
.
I
)
else
:
arg_4
=
re
.
compile
(
r'^{}[_]{{0,1}}{}'
.
format
(
arg_0
.
method_prefix
,
arg_3
)
,
flags
=
re
.
I
)
for
arg_5
,
arg_6
in
arg_2
:
if
not
arg_5
.
startswith
(
arg_0
.
method_prefix
)
:
continue
arg_7
=
True
if
arg_4
and
not
arg_4
.
match
(
arg_5
)
:
arg_7
=
False
if
arg_7
:
logger
.
debug
(
'method: {} matches {}'
.
format
(
arg_5
,
arg_3
)
)
yield
arg_1
,
arg_5

def Func(arg_0):
        """return the actual test methods that matched self.method_name"""
        for arg_1 in arg_0.classes():
            #ms = inspect.getmembers(c, inspect.ismethod)
            # http://stackoverflow.com/questions/17019949/
            arg_2 = inspect.getmembers(arg_1, lambda f: inspect.ismethod(f) or inspect.isfunction(f))
            arg_3 = getattr(arg_0, 'method_name', '')
            arg_4 = ''
            if arg_3:
                if arg_3.startswith(arg_0.method_prefix):
                    arg_4 = re.compile(r'^{}'.format(arg_3), flags=re.I)

                else:

                    if arg_3.startswith("*"):
                        arg_3 = arg_3.strip("*")
                        arg_4 = re.compile(
                            r'^{}[_]{{0,1}}.*?{}'.format(arg_0.method_prefix, arg_3),
                            flags=re.I
                        )
                    else:
                        arg_4 = re.compile(
                            r'^{}[_]{{0,1}}{}'.format(arg_0.method_prefix, arg_3),
                            flags=re.I
                        )

            for arg_5, arg_6 in arg_2:
                if not arg_5.startswith(arg_0.method_prefix): continue

                arg_7 = True
                if arg_4 and not arg_4.match(arg_5):
                    arg_7 = False

                if arg_7:
                    logger.debug('method: {} matches {}'.format(arg_5, arg_3))
                    yield arg_1, arg_5

return the actual test methods that matched self . method_name


def Func ( arg_0 ) : arg_0 . mul ( 300 ) arg_0 . Cpig ( 300 ) arg_1 = { 'Tb' : arg_0 . Tb ( arg_0 . counts ) , 'Tm' : arg_0 . Tm ( arg_0 . counts ) , 'Tc' : arg_0 . Tc ( arg_0 . counts , arg_0 . Tb_Funcd ) , 'Pc' : arg_0 . Pc ( arg_0 . counts , arg_0 . atom_count ) , 'Vc' : arg_0 . Vc ( arg_0 . counts ) , 'Hf' : arg_0 . Hf ( arg_0 . counts ) , 'Gf' : arg_0 . Gf ( arg_0 . counts ) , 'Hfus' : arg_0 . Hfus ( arg_0 . counts ) , 'Hvap' : arg_0 . Hvap ( arg_0 . counts ) , 'mul' : arg_0 . mul , 'mul_coeffs' : arg_0 . calculated_mul_coeffs , 'Cpig' : arg_0 . Cpig , 'Cpig_coeffs' : arg_0 . calculated_Cpig_coeffs } return arg_1

def Func(arg_0):
        '''Method to compute all available properties with the Joback method;
        returns their results as a dict. For the tempearture dependent values
        Cpig and mul, both the coefficients and objects to perform calculations
        are returned.
        '''
        # Pre-generate the coefficients or they will not be returned
        arg_0.mul(300)
        arg_0.Cpig(300)
        arg_1 = {'Tb': arg_0.Tb(arg_0.counts),
                     'Tm': arg_0.Tm(arg_0.counts),
                     'Tc': arg_0.Tc(arg_0.counts, arg_0.Tb_Funcd),
                     'Pc': arg_0.Pc(arg_0.counts, arg_0.atom_count),
                     'Vc': arg_0.Vc(arg_0.counts),
                     'Hf': arg_0.Hf(arg_0.counts),
                     'Gf': arg_0.Gf(arg_0.counts),
                     'Hfus': arg_0.Hfus(arg_0.counts),
                     'Hvap': arg_0.Hvap(arg_0.counts),
                     'mul': arg_0.mul,
                     'mul_coeffs': arg_0.calculated_mul_coeffs,
                     'Cpig': arg_0.Cpig,
                     'Cpig_coeffs': arg_0.calculated_Cpig_coeffs}
        return arg_1

Method to compute all available properties with the Joback method ; returns their results as a dict . For the tempearture dependent values Cpig and mul both the coefficients and objects to perform calculations are returned .


def Func(arg_0, arg_1, *arg_2):
        '''Returns a generator of index triples.

        Returns a generator of index keys for the ``ids_and_fcs`` pairs
        given. The index keys have the form ``(idx_name, idx_val,
        content_id)``.

        :type idx_name: unicode
        :type ids_and_fcs: ``[(content_id, FeatureCollection)]``
        :rtype: generator of ``(str, str, str)``
        '''
        arg_3 = arg_0._index(arg_1)
        arg_4, arg_5 = arg_3['create'], arg_3['transform']
        if isinstance(arg_1, unicode):
            arg_1 = arg_1.encode('utf-8')

        for arg_6 in arg_2:
            arg_7 = arg_6[0]

            # Be sure to dedup index_values or else we may
            # suffer duplicate_pkey errors down the line.
            arg_8 = set()
            for arg_9 in arg_4(arg_5, arg_6):
                if arg_9 and arg_9 not in arg_8:
                    yield (arg_9, arg_1, arg_7)
                    arg_8.add(arg_9)


(self, spotify_id, limit=20, offset=0, market='US')

def Func ( arg_0 , arg_1 , arg_2 = 20 , arg_3 = 0 , arg_4 = 'US' ) : arg_5 = Route ( 'GET' , '/albums/{spotify_id}/tracks' , arg_1 = arg_1 ) arg_6 = { 'limit' : arg_2 , 'offset' : arg_3 } if arg_4 : arg_6 [ 'market' ] = arg_4 return arg_0 . request ( arg_5 , params = arg_6 )

def Func(arg_0, arg_1, arg_2=20, arg_3=0, arg_4='US'):
        """Get an albums tracks by an ID.

        Parameters
        ----------
        spotify_id : str
            The spotify_id to search by.
        limit : Optional[int]
            The maximum number of items to return. Default: 20. Minimum: 1. Maximum: 50.
        offset : Optiona[int]
            The offset of which Spotify should start yielding from.
        market : Optional[str]
            An ISO 3166-1 alpha-2 country code.
        """
        arg_5 = Route('GET', '/albums/{spotify_id}/tracks', arg_1=arg_1)
        arg_6 = {'limit': arg_2, 'offset': arg_3}

        if arg_4:
            arg_6['market'] = arg_4

        return arg_0.request(arg_5, params=arg_6)


def Func ( arg_0 ) : with open ( arg_0 , 'r' ) as src_data : arg_1 = src_data . read ( ) if sys . version_info [ 0 ] == 3 : arg_1 = arg_1 . encode ( 'utf-8' ) arg_2 = hashlib . md5 ( arg_1 ) . hexdigest ( ) return arg_2

def Func(arg_0):
    """Returns md5sum of file"""

    with open(arg_0, 'r') as src_data:
        arg_1 = src_data.read()

        # data needs to be encoded in python3 before hashing
        if sys.version_info[0] == 3:
            arg_1 = arg_1.encode('utf-8')

        arg_2 = hashlib.md5(arg_1).hexdigest()
    return arg_2


def Func ( arg_0 , arg_1 = 0 ) : arg_2 = np . ones_like ( arg_0 ) for arg_3 , arg_4 in enumerate ( arg_0 ) : for arg_5 in reversed ( range ( len ( arg_4 ) ) ) : if arg_4 [ arg_5 ] == arg_1 : arg_2 [ arg_3 , arg_5 ] = 0 else : break return arg_2

def Func(arg_0, arg_1=0):
    """Return mask for sequences.

    Parameters
    -----------
    sequences : list of list of int
        All sequences where each row is a sequence.
    pad_val : int
        The pad value.

    Returns
    ----------
    list of list of int
        The mask.

    Examples
    ---------
    >>> sentences_ids = [[4, 0, 5, 3, 0, 0],
    ...                  [5, 3, 9, 4, 9, 0]]
    >>> mask = Func(sentences_ids, pad_val=0)
    [[1 1 1 1 0 0]
     [1 1 1 1 1 0]]

    """
    arg_2 = np.ones_like(arg_0)
    for arg_3, arg_4 in enumerate(arg_0):
        for arg_5 in reversed(range(len(arg_4))):
            if arg_4[arg_5] == arg_1:
                arg_2[arg_3, arg_5] = 0
            else:
                break  # <-- exit the for loop, prepcess next sequence
    return arg_2

Return mask for sequences.

    Parameters
    -----------
    sequences : list of list of int
        All sequences where each row is a sequence.
    pad_val : int
        The pad value.

    Returns
    ----------
    list of list of int
        The mask.

    Examples
    ---------
    >>> sentences_ids = [[4, 0, 5, 3, 0, 0],
    ...                  [5, 3, 9, 4, 9, 0]]
    >>> mask = sequences_get_mask(sentences_ids, pad_val=0)
    [[1 1 1 1 0 0]
     [1 1 1 1 1 0]]


(self, source_bucket, source_object, destination_bucket=None,
             destination_object=None)

def Func(arg_0, arg_1, arg_2, arg_3=None,
             arg_4=None):
        """
        Copies an object from a bucket to another, with renaming if requested.

        destination_bucket or destination_object can be omitted, in which case
        source bucket/object is used, but not both.

        :param source_bucket: The bucket of the object to Func from.
        :type source_bucket: str
        :param source_object: The object to Func.
        :type source_object: str
        :param destination_bucket: The destination of the object to copied to.
            Can be omitted; then the same bucket is used.
        :type destination_bucket: str
        :param destination_object: The (renamed) path of the object if given.
            Can be omitted; then the same name is used.
        :type destination_object: str
        """
        arg_3 = arg_3 or arg_1
        arg_4 = arg_4 or arg_2
        if arg_1 == arg_3 and \
                arg_2 == arg_4:

            raise ValueError(
                'Either source/destination bucket or source/destination object '
                'must be different, not both the same: bucket=%s, object=%s' %
                (arg_1, arg_2))
        if not arg_1 or not arg_2:
            raise ValueError('source_bucket and source_object cannot be empty.')

        arg_5 = arg_0.get_conn()
        arg_1 = arg_5.get_bucket(arg_1)
        arg_2 = arg_1.blob(arg_2)
        arg_3 = arg_5.get_bucket(arg_3)
        arg_4 = arg_1.Func_blob(
            blob=arg_2,
            arg_3=arg_3,
            new_name=arg_4)

        arg_0.log.info('Object %s in bucket %s copied to object %s in bucket %s',
                      arg_2.name, arg_1.name,
                      arg_4.name, arg_3.name)

Copies an object from a bucket to another, with renaming if requested.

        destination_bucket or destination_object can be omitted, in which case
        source bucket/object is used, but not both.

        :param source_bucket: The bucket of the object to copy from.
        :type source_bucket: str
        :param source_object: The object to copy.
        :type source_object: str
        :param destination_bucket: The destination of the object to copied to.
            Can be omitted; then the same bucket is used.
        :type destination_bucket: str
        :param destination_object: The (renamed) path of the object if given.
            Can be omitted; then the same name is used.
        :type destination_object: str

Copies an object from a bucket to another with renaming if requested .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . unique_fields if not arg_2 : return arg_0 . model ( ) arg_3 = dict ( [ ( f , arg_1 [ f ] ) for f in arg_2 ] ) try : arg_4 = arg_0 . model . _default_manager . get ( ** arg_3 ) except arg_0 . model . DoesNotExist : return arg_0 . model ( ) return arg_4

def Func(arg_0, arg_1):
        """
        Get an item from the database or an empty one if not found.
        """
        # Get unique fields
        arg_2 = arg_0.unique_fields

        # If there are no unique fields option, all items are new
        if not arg_2:
            return arg_0.model()

        # Build the filter
        arg_3 = dict([(f, arg_1[f]) for f in arg_2])

        # Get the instance from the DB or use a new instance
        try:
            arg_4 = arg_0.model._default_manager.get(**arg_3)
        except arg_0.model.DoesNotExist:
            return arg_0.model()

        return arg_4

Get an item from the database or an empty one if not found .


def
Func
(
arg_0
)
:
arg_1
=
LatexCommand
(
'bibliography'
,
{
'name'
:
'bib_names'
,
'required'
:
True
,
'bracket'
:
'{'
}
)
try
:
arg_2
=
next
(
arg_1
.
parse
(
arg_0
.
_tex
)
)
arg_3
=
[
n
.
strip
(
)
for
n
in
arg_2
[
'bib_names'
]
.
split
(
','
)
]
except
StopIteration
:
arg_0
.
_logger
.
warning
(
'lsstdoc has no bibliography command'
)
arg_3
=
[
]
arg_4
=
[
n
for
n
in
arg_3
if
n
not
in
KNOWN_LSSTTEXMF_BIB_NAMES
]
arg_5
=
[
]
for
arg_6
in
arg_4
:
arg_7
=
os
.
path
.
join
(
os
.
path
.
join
(
arg_0
.
_root_dir
)
,
arg_6
+
'.bib'
)
if
not
os
.
path
.
exists
(
arg_7
)
:
arg_0
.
_logger
.
warning
(
'Could not find bibliography %r'
,
arg_7
)
continue
with
open
(
arg_7
,
'r'
)
as
file_handle
:
arg_5
.
append
(
file_handle
.
read
(
)
)
if
len
(
arg_5
)
>
0
:
arg_8
=
'\n\n'
.
join
(
arg_5
)
else
:
arg_8
=
arg_9
=
get_bibliography
(
bibtex
=
arg_8
)
arg_0
.
_bib_db
=
arg_9

def Func(arg_0):
        r"""Load the BibTeX bibliography referenced by the document.

        This method triggered by the `bib_db` attribute and populates the
        `_bib_db` private attribute.

        The ``\bibliography`` command is parsed to identify the bibliographies
        referenced by the document.
        """
        # Get the names of custom bibtex files by parsing the
        # \bibliography command and filtering out the default lsstdoc
        # bibliographies.
        arg_1 = LatexCommand(
            'bibliography',
            {'name': 'bib_names', 'required': True, 'bracket': '{'})
        try:
            arg_2 = next(arg_1.parse(arg_0._tex))
            arg_3 = [n.strip() for n in arg_2['bib_names'].split(',')]
        except StopIteration:
            arg_0._logger.warning('lsstdoc has no bibliography command')
            arg_3 = []
        arg_4 = [n for n in arg_3
                            if n not in KNOWN_LSSTTEXMF_BIB_NAMES]

        # Read custom bibliographies.
        arg_5 = []
        for arg_6 in arg_4:
            arg_7 = os.path.join(
                os.path.join(arg_0._root_dir),
                arg_6 + '.bib'
            )
            if not os.path.exists(arg_7):
                arg_0._logger.warning('Could not find bibliography %r',
                                     arg_7)
                continue
            with open(arg_7, 'r') as file_handle:
                arg_5.append(file_handle.read())
        if len(arg_5) > 0:
            arg_8 = '\n\n'.join(arg_5)
        else:
            arg_8 = None

        # Get the combined pybtex bibliography
        arg_9 = get_bibliography(bibtex=arg_8)

        arg_0._bib_db = arg_9

r Load the BibTeX bibliography referenced by the document .


return trun["progress"]["UNKN"] + trun["progress"]["FAIL"]

def
Func
(
arg_0
)
:
arg_1
=
yml_fpath
(
arg_0
[
"OUTPUT"
]
)
if
os
.
path
.
exists
(
arg_1
)
:
cij
.
err
(
"Func:FAILED { fpath: %r }, exists"
%
arg_1
)
return
1
arg_2
=
trun_setup
(
arg_0
)
if
not
arg_2
:
return
1
trun_to_file
(
arg_2
)
trun_emph
(
arg_2
)
arg_3
=
0
arg_4
=
trun_enter
(
arg_2
)
for
arg_5
in
(
ts
for
ts
in
arg_2
[
"testsuites"
]
if
not
arg_4
)
:
arg_6
=
0
arg_7
=
tsuite_enter
(
arg_2
,
arg_5
)
for
arg_8
in
(
tc
for
tc
in
arg_5
[
"testcases"
]
if
not
arg_7
)
:
arg_9
=
tcase_enter
(
arg_2
,
arg_5
,
arg_8
)
if
not
arg_9
:
arg_9
+=
script_run
(
arg_2
,
arg_8
)
arg_9
+=
tcase_exit
(
arg_2
,
arg_5
,
arg_8
)
arg_8
[
"status"
]
=
"FAIL"
if
arg_9
else
"PASS"
arg_2
[
"progress"
]
[
arg_8
[
"status"
]
]
+=
1
arg_2
[
"progress"
]
[
"UNKN"
]
-=
1
arg_6
+=
arg_9
trun_to_file
(
arg_2
)
if
not
arg_7
:
arg_6
+=
tsuite_exit
(
arg_2
,
arg_5
)
arg_6
+=
arg_7
arg_3
+=
arg_6
arg_5
[
"status"
]
=
"FAIL"
if
arg_6
else
"PASS"
cij
.
emph
(
"rnr:tsuite %r"
%
arg_5
[
"status"
]
,
arg_5
[
"status"
]
!=
"PASS"
)
if
not
arg_4
:
trun_exit
(
arg_2
)
arg_3
+=
arg_4
arg_2
[
"status"
]
=
"FAIL"
if
arg_3
else
"PASS"
arg_2
[
"stamp"
]
[
"end"
]
=
int
(
time
.
time
(
)
)
+
1
trun_to_file
(
arg_2
)
cij
.
emph
(
"rnr:Func:progress %r"
%
arg_2
[
"progress"
]
)
cij
.
emph
(
"rnr:Func:trun %r"
%
arg_2
[
"status"
]
,
arg_2
[
"status"
]
!=
"PASS"
)
return
arg_2
[
"progress"
]
[
"UNKN"
]
+
arg_2
[
"progress"
]
[
"FAIL"
]

def Func(arg_0):
    """CIJ Test Runner Func entry point"""

    arg_1 = yml_fpath(arg_0["OUTPUT"])
    if os.path.exists(arg_1):   # YAML exists, we exit, it might be RUNNING!
        cij.err("Func:FAILED { fpath: %r }, exists" % arg_1)
        return 1

    arg_2 = trun_setup(arg_0)         # Construct 'trun' from 'conf'
    if not arg_2:
        return 1

    trun_to_file(arg_2)              # Persist trun
    trun_emph(arg_2)                 # Print trun before run

    arg_3 = 0
    arg_4 = trun_enter(arg_2)
    for arg_5 in (ts for ts in arg_2["testsuites"] if not arg_4):

        arg_6 = 0
        arg_7 = tsuite_enter(arg_2, arg_5)
        for arg_8 in (tc for tc in arg_5["testcases"] if not arg_7):

            arg_9 = tcase_enter(arg_2, arg_5, arg_8)
            if not arg_9:
                arg_9 += script_run(arg_2, arg_8)
                arg_9 += tcase_exit(arg_2, arg_5, arg_8)

            arg_8["status"] = "FAIL" if arg_9 else "PASS"

            arg_2["progress"][arg_8["status"]] += 1  # Update progress
            arg_2["progress"]["UNKN"] -= 1

            arg_6 += arg_9                        # Accumulate errors

            trun_to_file(arg_2)                      # Persist trun

        if not arg_7:
            arg_6 += tsuite_exit(arg_2, arg_5)

        arg_6 += arg_7                        # Accumulate errors
        arg_3 += arg_6

        arg_5["status"] = "FAIL" if arg_6 else "PASS"

        cij.emph("rnr:tsuite %r" % arg_5["status"], arg_5["status"] != "PASS")

    if not arg_4:
        trun_exit(arg_2)

    arg_3 += arg_4
    arg_2["status"] = "FAIL" if arg_3 else "PASS"

    arg_2["stamp"]["end"] = int(time.time()) + 1         # END STAMP
    trun_to_file(arg_2)                                  # PERSIST

    cij.emph("rnr:Func:progress %r" % arg_2["progress"])
    cij.emph("rnr:Func:trun %r" % arg_2["status"], arg_2["status"] != "PASS")

    return arg_2["progress"]["UNKN"] + arg_2["progress"]["FAIL"]


def
Func
(
arg_0
)
:
print
(
'Cleaning up'
)
for
arg_1
in
arg_0
:
print
(
'Removing %s'
%
arg_1
)
os
.
unlink
(
arg_1
)

def Func(arg_0):
    """
    Clean up after ourselves, removing created files.
    @param {[String]} A list of file paths specifying the files we've created
        during run. Will all be deleted.
    @return {None}
    """
    print('Cleaning up')
    # Iterate over the given paths, unlinking them
    for arg_1 in arg_0:
        print('Removing %s' % arg_1)
        os.unlink(arg_1)

Clean up after ourselves removing created files .


def Func(arg_0):
        """Setup channel borders
        """

        if arg_0.header[b'foff'] < 0:
            arg_1 = arg_0.f_end
        else:
            arg_1 = arg_0.f_begin

        arg_2, arg_3 = 0, arg_0.n_channels_in_file
        if arg_0.f_start:
            arg_2 = np.round((arg_0.f_start - arg_1) / arg_0.header[b'foff'])
        if arg_0.f_stop:
            arg_3  = np.round((arg_0.f_stop - arg_1)  / arg_0.header[b'foff'])

        #calculate closest true index value
        arg_4 = np.int(arg_2)
        arg_5  = np.int(arg_3)

        if arg_5 < arg_4:
            arg_5, arg_4 = arg_4,arg_5

        arg_0.chan_start_idx =  arg_4
        arg_0.chan_stop_idx = arg_5


def Func ( arg_0 , arg_1 = None ) : arg_2 = ( os . path . splitext ( arg_0 ) [ 1 ] [ 1 : ] or arg_0 ) . lower ( ) arg_1 = arg_1 or ImageDriver . registry if arg_2 else { } for arg_3 , arg_4 in arg_1 . items ( ) : if arg_2 == arg_4 . get ( 'DMD_EXTENSION' , '' ) . lower ( ) : return ImageDriver ( arg_3 ) return None

def Func(arg_0, arg_1=None):
    """Returns the gdal.Driver for a path or None based on the file extension.

    Arguments:
    path -- file path as str with a GDAL supported file extension
    """
    arg_2 = (os.path.splitext(arg_0)[1][1:] or arg_0).lower()
    arg_1 = arg_1 or ImageDriver.registry if arg_2 else {}
    for arg_3, arg_4 in arg_1.items():
        if arg_2 == arg_4.get('DMD_EXTENSION', '').lower():
            return ImageDriver(arg_3)
    return None

Returns the gdal . Driver for a path or None based on the file extension .


def Func ( arg_0 , arg_1 : "IfContainer" ) -> None : arg_2 = arg_0 . _merge_statement_lists arg_3 = [ ] for ( arg_4 , arg_5 ) , ( arg_6 , arg_7 ) in zip ( arg_0 . cases , arg_1 . cases ) : arg_3 . append ( ( arg_4 , arg_2 ( arg_5 , arg_7 ) ) ) arg_0 . cases = arg_3 if arg_0 . default is not None : arg_0 . default = arg_2 ( arg_0 . default , arg_1 . default ) arg_0 . _on_merge ( arg_1 )

def Func(arg_0, arg_1: "IfContainer") -> None:
        """
        Merge other statement to this statement
        """
        arg_2 = arg_0._merge_statement_lists
        arg_3 = []
        for (arg_4, arg_5), (arg_6, arg_7) in zip(arg_0.cases, arg_1.cases):
            arg_3.append((arg_4, arg_2(arg_5, arg_7)))

        arg_0.cases = arg_3

        if arg_0.default is not None:
            arg_0.default = arg_2(arg_0.default, arg_1.default)

        arg_0._on_merge(arg_1)


return super().sys_transmit(cpu, fd, buf, count, tx_bytes)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """
        Symbolic version of Decree.Func
        """
        if issymbolic(arg_2):
            logger.info("Ask to write to a symbolic file descriptor!!")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 0)

        if issymbolic(arg_3):
            logger.info("Ask to write to a symbolic buffer")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 1)

        if issymbolic(arg_4):
            logger.info("Ask to write a symbolic number of bytes ")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 2)

        if issymbolic(arg_5):
            logger.info("Ask to return size to a symbolic address ")
            arg_1.PC = arg_1.PC - arg_1.instruction.size
            raise SymbolicSyscallArgument(arg_1, 3)

        return super().Func(arg_1, arg_2, arg_3, arg_4, arg_5)

Symbolic version of Decree . sys_transmit


(prop, value, minimum=1, timeout=FOREVER)

return [StreamInfo(handle=buffer[k]) for k in range(num_found)]

def Func ( arg_0 , arg_1 , arg_2 = 1 , arg_3 = arg_4 ) : arg_5 = ( c_void_p * 1024 ) ( ) arg_6 = lib . lsl_Func ( byref ( arg_5 ) , 1024 , c_char_p ( str . encode ( arg_0 ) ) , c_char_p ( str . encode ( arg_1 ) ) , arg_2 , c_double ( arg_3 ) ) return [ StreamInfo ( handle = arg_5 [ arg_7 ] ) for arg_7 in range ( arg_6 ) ]

def Func(arg_0, arg_1, arg_2=1, arg_3=arg_4):
    """Resolve all streams with a specific value for a given property.

    If the goal is to resolve a specific stream, this method is preferred over
    resolving all streams and then selecting the desired one.

    Keyword arguments:
    prop -- The StreamInfo property that should have a specific value (e.g.,
            "name", "type", "source_id", or "desc/manufaturer").
    value -- The string value that the property should have (e.g., "EEG" as
             the type property).
    minimum -- Return at least this many streams. (default 1)
    timeout -- Optionally a timeout of the operation, in seconds. If the
               timeout expires, less than the desired number of streams
               (possibly none) will be returned. (default FOREVER)

    Returns a list of matching StreamInfo objects (with empty desc field), any
    of which can subsequently be used to open an inlet.

    Example: results = resolve_Stream_byprop("type","EEG")

    """
    # noinspection PyCallingNonCallable
    arg_5 = (c_void_p*1024)()
    arg_6 = lib.lsl_Func(byref(arg_5), 1024,
                                       c_char_p(str.encode(arg_0)),
                                       c_char_p(str.encode(arg_1)),
                                       arg_2,
                                       c_double(arg_3))
    return [StreamInfo(handle=arg_5[arg_7]) for arg_7 in range(arg_6)]

Resolve all streams with a specific value for a given property .


def Func(arg_0, arg_1):
        """Write a credentials to the SQLAlchemy datastore.

        Args:
            credentials: :class:`oauth2client.Credentials`
        """
        arg_2 = {arg_0.key_name: arg_0.key_value}
        arg_3 = arg_0.session.query(arg_0.model_class).filter_by(**arg_2)
        arg_4 = arg_3.first()

        if not arg_4:
            arg_4 = arg_0.model_class(**arg_2)

        setattr(arg_4, arg_0.property_name, arg_1)
        arg_0.session.add(arg_4)

Write a credentials to the SQLAlchemy datastore .


def Func ( arg_0 ) : try : return arg_0 . total_seconds ( ) except AttributeError : return 1e-6 * ( arg_0 . microseconds + ( arg_0 . seconds + arg_0 . days * 24 * 3600 ) * 10 ** 6 )

def Func(arg_0):
    """timedelta.total_seconds was added in 2.7"""
    try:
        # Python >= 2.7
        return arg_0.total_seconds()
    except AttributeError:
        # Python 2.6
        return 1e-6 * (arg_0.microseconds + (arg_0.seconds + arg_0.days * 24 * 3600) * 10**6)

timedelta . total_seconds was added in 2 . 7


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , File ) : arg_2 = arg_1 . get_directory ( ) arg_2 . create ( ) arg_1 = arg_1 . filename elif isinstance ( arg_1 , Directory ) : arg_1 = arg_1 . dirname shutil . Func2 ( arg_0 . filename , arg_1 )

def Func(arg_0, arg_1):
        """ Copy file to destination """
        if isinstance(arg_1, File):
            arg_2 = arg_1.get_directory()
            arg_2.create()
            arg_1 = arg_1.filename
        elif isinstance(arg_1, Directory):
            arg_1 = arg_1.dirname

        shutil.Func2(arg_0.filename, arg_1)


def Func(arg_0, arg_1):
        """
        Set the parent path and the path from the new parent path.

        :param value: The path to the object's parent
        """

        arg_0._parent_path = arg_1
        arg_0.path = arg_1 + r'/' + arg_0.name
        arg_0._update_childrens_parent_path()

Set the parent path and the path from the new parent path .


def Func ( arg_0 ) : if current_app : arg_0 . setdefault ( 'cls' , current_app . json_decoder ) else : arg_0 . setdefault ( 'cls' , JSONDecoder )

def Func(arg_0):
    """Inject default arguments for load functions."""
    if current_app:
        arg_0.setdefault('cls', current_app.json_decoder)
    else:
        arg_0.setdefault('cls', JSONDecoder)

Inject default arguments for load functions .


def Func(arg_0, arg_1=None):
    """Removes all filtered Media and subdirs from an Album"""
    arg_2 = os.path.join(arg_0.src_path, ".nomedia")

    if os.path.isfile(arg_2):
        if os.path.getsize(arg_2) == 0:
            logger.info("Ignoring album '%s' because of present 0-byte "
                        ".nomedia file", arg_0.name)

            # subdirs have been added to the gallery already, remove them
            # there, too
            _remove_albums_with_subdirs(arg_0.gallery.albums, [arg_0.path])
            try:
                os.rmdir(arg_0.dst_path)
            except OSError as e:
                # directory was created and populated with images in a
                # previous run => keep it
                pass

            # cannot set albums => empty subdirs so that no albums are
            # generated
            arg_0.subdirs = []
            arg_0.medias = []

        else:
            with open(arg_2, "r") as nomediaFile:
                logger.info("Found a .nomedia file in %s, ignoring its "
                            "entries", arg_0.name)
                arg_5 = nomediaFile.read().split("\n")

                arg_0.medias = [media for media in arg_0.medias
                                if media.src_filename not in arg_5]
                arg_0.subdirs = [dirname for dirname in arg_0.subdirs
                                 if dirname not in arg_5]

                # subdirs have been added to the gallery already, remove
                # them there, too
                _remove_albums_with_subdirs(arg_0.gallery.albums,
                                            arg_5, arg_0.path + os.path.sep)


(img, size, return_scale=False, interpolation='bilinear')

def Func(arg_0, arg_1, arg_2=False, arg_3='bilinear'):
    """Resize image to a given size.

    Args:
        img (ndarray): The input image.
        size (tuple): Target (w, h).
        return_scale (bool): Whether to return `w_scale` and `h_scale`.
        interpolation (str): Interpolation method, accepted values are
            "nearest", "bilinear", "bicubic", "area", "lanczos".

    Returns:
        tuple or ndarray: (`resized_img`, `w_scale`, `h_scale`) or
            `resized_img`.
    """
    arg_4, arg_5 = arg_0.shape[:2]
    arg_6 = cv2.resize(
        arg_0, arg_1, arg_3=interp_codes[arg_3])
    if not arg_2:
        return arg_6
    else:
        arg_7 = arg_1[0] / arg_5
        arg_8 = arg_1[1] / arg_4
        return arg_6, arg_7, arg_8


return self._nn_interface._add_generic(self, type_name=DERIVED_PARAMETER,
                                               group_type_name=DERIVED_PARAMETER_GROUP,
                                               args=args, kwargs=kwargs)

def Func(arg_0, *arg_1, **arg_2):
        """Adds a derived parameter under the current group.

        Similar to
        :func:`~pypet.naturalnaming.ParameterGroup.f_add_parameter`

        Naming prefixes are added as in
        :func:`~pypet.naturalnaming.DerivedParameterGroup.Func_group`

        """
        return arg_0._nn_interface._add_generic(arg_0, type_name=DERIVED_PARAMETER,
                                               group_type_name=DERIVED_PARAMETER_GROUP,
                                               arg_1=arg_1, arg_2=arg_2)

Adds a derived parameter under the current group.

        Similar to
        :func:`~pypet.naturalnaming.ParameterGroup.f_add_parameter`

        Naming prefixes are added as in
        :func:`~pypet.naturalnaming.DerivedParameterGroup.f_add_derived_parameter_group`

Adds a derived parameter under the current group .


def Func ( arg_0, arg_1, arg_2, arg_3 ):
        """ Sets up or removes a listener for children being replaced on a
            specified object.
        """
        arg_1.on_trait_change( arg_2, "subgraphs", arg_3 = arg_3,
                                dispatch = "fast_ui" )
        arg_1.on_trait_change( arg_2, "clusters", arg_3 = arg_3,
                                dispatch = "fast_ui" )
        arg_1.on_trait_change( arg_2, "nodes", arg_3 = arg_3,
                                dispatch = "fast_ui" )
        arg_1.on_trait_change( arg_2, "edges", arg_3 = arg_3,
                                dispatch = "fast_ui" )

Sets up or removes a listener for children being replaced on a specified object .


def Func(arg_0, arg_1):
        """Import the given rule file"""
        if not (os.path.exists(arg_1)):
            sys.stderr.write("rflint: %s: No such file or directory\n" % arg_1)
            return
        try:
            arg_2 = os.path.basename(arg_1)
            (arg_3, arg_4) = os.path.splitext(arg_2)
            imp.load_source(arg_3, arg_1)
        except Exception as e:
            sys.stderr.write("rflint: %s: exception while loading: %s\n" % (arg_1, str(e)))


(fname, dtype=None, delimiter=' ', newline='\n', comment_character='#',
        skiplines=0)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
' '
,
arg_3
=
'\n'
,
arg_4
=
'#'
,
arg_5
=
0
)
:
arg_6
=
[
,
,
]
def
preparedtype
(
arg_1
)
:
arg_6
[
0
]
=
arg_1
arg_7
=
flatten_dtype
(
arg_1
)
arg_6
[
1
]
=
arg_7
arg_6
[
2
]
=
numpy
.
dtype
(
[
(
'a'
,
(
numpy
.
int8
,
arg_7
.
itemsize
)
)
]
)
arg_8
=
numpy
.
empty
(
(
)
,
arg_1
=
arg_6
[
1
]
)
arg_9
=
[
_default_conv
[
arg_7
[
arg_17
]
.
char
]
for
arg_17
in
arg_7
.
names
]
return
arg_8
,
arg_9
,
arg_7
.
names
def
fileiter
(
arg_10
)
:
arg_9
=
[
]
arg_8
=
if
arg_1
is
not
:
arg_8
,
arg_9
,
arg_11
=
preparedtype
(
arg_1
)
yield
for
arg_12
,
arg_13
in
enumerate
(
arg_10
)
:
if
arg_12
<
arg_5
:
continue
if
arg_13
[
0
]
in
arg_4
:
if
arg_8
is
and
arg_13
[
1
]
==
'?'
:
arg_14
=
pickle
.
loads
(
base64
.
b64decode
(
arg_13
[
2
:
]
)
)
arg_8
,
arg_9
,
arg_11
=
preparedtype
(
arg_14
)
yield
continue
for
arg_15
,
arg_16
,
arg_17
in
zip
(
arg_13
.
split
(
)
,
arg_9
,
arg_11
)
:
arg_8
[
arg_17
]
=
arg_16
(
arg_15
)
arg_18
=
arg_8
.
copy
(
)
.
view
(
arg_1
=
arg_6
[
2
]
)
yield
arg_18
if
isinstance
(
arg_0
,
basestring
)
:
arg_10
=
file
(
arg_10
,
'r'
)
arg_19
=
lambda
:
arg_10
.
close
(
)
else
:
arg_10
=
iter
(
arg_0
)
arg_19
=
lambda
:
try
:
arg_20
=
fileiter
(
arg_10
)
arg_20
.
next
(
)
return
numpy
.
fromiter
(
arg_20
,
arg_1
=
arg_6
[
2
]
)
.
view
(
arg_1
=
arg_6
[
0
]
)
finally
:
arg_19
(
)

def Func(arg_0, arg_1=None, arg_2=' ', arg_3='\n', arg_4='#',
        arg_5=0):
    """ Known issues delimiter and newline is not respected.
        string quotation with space is broken.
    """
    arg_6 = [None, None, None]
    def preparedtype(arg_1):
        arg_6[0] = arg_1
        arg_7 = flatten_dtype(arg_1)
        arg_6[1] = arg_7
        arg_6[2] = numpy.dtype([('a', (numpy.int8,
            arg_7.itemsize))])
        arg_8 = numpy.empty((), arg_1=arg_6[1])
        arg_9 = [_default_conv[arg_7[arg_17].char] for arg_17 in arg_7.names]
        return arg_8, arg_9, arg_7.names

    def fileiter(arg_10):
        arg_9 = []
        arg_8 = None

        if arg_1 is not None:
            arg_8, arg_9, arg_11 = preparedtype(arg_1)
            yield None

        for arg_12, arg_13 in enumerate(arg_10):
            if arg_12 < arg_5: continue
            if arg_13[0] in arg_4:
                if arg_8 is None and arg_13[1] == '?':
                    arg_14 = pickle.loads(base64.b64decode(arg_13[2:]))
                    arg_8, arg_9, arg_11 = preparedtype(arg_14)
                    yield None
                continue
            for arg_15, arg_16, arg_17 in zip(arg_13.split(), arg_9, arg_11):
                arg_8[arg_17] = arg_16(arg_15)
            arg_18 = arg_8.copy().view(arg_1=arg_6[2])
            yield arg_18

    if isinstance(arg_0, basestring):
        arg_10 = file(arg_10, 'r')
        arg_19 = lambda : arg_10.close()
    else:
        arg_10 = iter(arg_0)
        arg_19 = lambda : None
    try:
        arg_20 = fileiter(arg_10)
        arg_20.next()
        return numpy.fromiter(arg_20, arg_1=arg_6[2]).view(arg_1=arg_6[0])
    finally:
        arg_19()

Known issues delimiter and newline is not respected . string quotation with space is broken .


def Func ( arg_0 ) : with tf . compat . v1 . name_scope ( 'maybe_expand_trailing_dim' , values = [ arg_0 ] ) : if ( arg_0 . shape . ndims is not None and tf . compat . dimension_value ( arg_0 . shape [ - 1 ] ) is not None ) : arg_1 = ( arg_0 if arg_0 . shape [ - 1 ] == 1 else arg_0 [ ... , tf . newaxis ] ) else : arg_1 = tf . cond ( pred = tf . equal ( tf . shape ( input = arg_0 ) [ - 1 ] , 1 ) , true_fn = lambda : arg_0 , false_fn = lambda : arg_0 [ ... , tf . newaxis ] ) return arg_1

def Func(arg_0):
  """Ensures `observed_time_series_tensor` has a trailing dimension of size 1.

  The `tfd.LinearGaussianStateSpaceModel` Distribution has event shape of
  `[num_timesteps, observation_size]`, but canonical BSTS models
  are univariate, so their observation_size is always `1`. The extra trailing
  dimension gets annoying, so this method allows arguments with or without the
  extra dimension. There is no ambiguity except in the trivial special case
  where  `num_timesteps = 1`; this can be avoided by specifying any unit-length
  series in the explicit `[num_timesteps, 1]` style.

  Most users should not call this method directly, and instead call
  `canonicalize_observed_time_series_with_mask`, which handles converting
  to `Tensor` and specifying an optional missingness mask.

  Args:
    observed_time_series_tensor: `Tensor` of shape
      `batch_shape + [num_timesteps, 1]` or `batch_shape + [num_timesteps]`,
      where `num_timesteps > 1`.

  Returns:
    expanded_time_series: `Tensor` of shape `batch_shape + [num_timesteps, 1]`.
  """

  with tf.compat.v1.name_scope(
      'maybe_expand_trailing_dim', values=[arg_0]):
    if (arg_0.shape.ndims is not None and
        tf.compat.dimension_value(
            arg_0.shape[-1]) is not None):
      arg_1 = (
          arg_0
          if arg_0.shape[-1] == 1
          else arg_0[..., tf.newaxis])
    else:
      arg_1 = tf.cond(
          pred=tf.equal(tf.shape(input=arg_0)[-1], 1),
          true_fn=lambda: arg_0,
          false_fn=lambda: arg_0[..., tf.newaxis])
    return arg_1

Ensures observed_time_series_tensor has a trailing dimension of size 1 .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : if arg_2 == "edges_items" : arg_5 = arg_4 . added elif arg_2 == "edges" : arg_5 = arg_4 else : arg_5 = [ ] arg_6 = [ n for g in arg_0 . all_graphs for n in g . nodes ] for arg_7 in arg_5 : if arg_7 . tail_node not in arg_6 : arg_1 . nodes . append ( arg_7 . tail_node ) if arg_7 . head_node not in arg_6 : arg_1 . nodes . append ( arg_7 . head_node ) arg_7 . _nodes = arg_6

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """ Handles the list of edges for any graph changing.
        """
        if arg_2 == "edges_items":
            arg_5 = arg_4.added
        elif arg_2 == "edges":
            arg_5 = arg_4
        else:
            arg_5 = []

        arg_6 = [n for g in arg_0.all_graphs for n in g.nodes]

        for arg_7 in arg_5:
            # Ensure the edge's nodes exist in the graph.
            if arg_7.tail_node not in arg_6:
                arg_1.nodes.append( arg_7.tail_node )

            if arg_7.head_node not in arg_6:
                arg_1.nodes.append( arg_7.head_node )

            # Initialise the edge's list of available nodes.
            arg_7._nodes = arg_6

Handles the list of edges for any graph changing .


return get_file_fingerprint(abspath, hashlib.sha256, nbytes=nbytes, chunk_size=chunk_size)

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """
    Return sha256 hash value of a piece of a file

    Estimate processing time on:

    :param abspath: the absolute path to the file
    :param nbytes: only has first N bytes of the file. if 0 or None,
      hash all file
    """
    return get_file_fingerprint(arg_0, hashlib.sha256, arg_1=arg_1, arg_2=arg_2)


def Func ( arg_0 ) : if arg_0 . body : arg_1 = MIMEText ( "text" , "plain" ) arg_1 . set_payload ( arg_0 . body ) arg_0 . message . attach ( arg_1 )

def Func(arg_0):
        """Add body content of email."""
        if arg_0.body:
            arg_1 = MIMEText("text", "plain")
            arg_1.set_payload(arg_0.body)
            arg_0.message.attach(arg_1)


def Func(arg_0, arg_1, arg_2=1):
        """
        Add a record check function.

        Arguments
        ---------

        `record_check` - a function that accepts a single argument (a record as
        a dictionary of values indexed by field name) and raises a
        `RecordError` if the record is not valid

        `modulus` - apply the check to every nth record, defaults to 1 (check
        every record)

        """

        assert callable(arg_1), 'record check must be a callable function'

        arg_3 = arg_1, arg_2
        arg_0._record_checks.append(arg_3)


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
.
workspace
.
exists
(
arg_1
)
:
raise
ValueError
(
"Workspace `%s` doesn't exists."
%
arg_1
)
arg_2
=
Color
(
)
arg_3
=
arg_0
.
workspace
.
list
(
)
arg_0
.
logger
.
info
(
"<== %s workspace ==>"
%
arg_2
.
colored
(
arg_1
,
"green"
)
)
arg_0
.
logger
.
info
(
"\tPath: %s"
%
arg_3
[
arg_1
]
[
"path"
]
)
arg_0
.
logger
.
info
(
"\tNumber of repositories: %s"
%
arg_2
.
colored
(
len
(
arg_3
[
arg_1
]
[
"repositories"
]
)
,
"yellow"
)
)
arg_4
=
arg_2
.
colored
(
"Repositories"
,
"blue"
)
arg_5
=
arg_2
.
colored
(
"Path"
,
"blue"
)
arg_6
=
PrettyTable
(
[
arg_4
,
arg_5
,
arg_2
.
colored
(
"+"
,
"blue"
)
]
)
arg_6
.
align
[
arg_4
]
=
"l"
arg_6
.
align
[
arg_5
]
=
"l"
for
arg_8
in
arg_3
[
arg_1
]
[
"repositories"
]
:
arg_9
=
"%s/%s"
%
(
arg_1
,
arg_8
)
arg_10
=
find_path
(
arg_9
,
arg_0
.
config
)
[
arg_9
]
try
:
arg_11
=
Repository
(
arg_10
)
arg_12
=
arg_11
.
get_scm
(
)
except
RepositoryAdapterNotFound
:
arg_12
=
arg_6
.
add_row
(
[
arg_2
.
colored
(
arg_8
,
"cyan"
)
,
arg_10
,
arg_12
]
)
arg_0
.
logger
.
info
(
arg_6
)

def Func(arg_0, arg_1):
        """Show specific workspace."""
        if not arg_0.workspace.exists(arg_1):
            raise ValueError("Workspace `%s` doesn't exists." % arg_1)

        arg_2 = Color()
        arg_3 = arg_0.workspace.list()

        arg_0.logger.info("<== %s workspace ==>" % arg_2.colored(arg_1, "green"))
        arg_0.logger.info("\tPath: %s" % arg_3[arg_1]["path"])
        arg_0.logger.info("\tNumber of repositories: %s"
                         % arg_2.colored(
                             len(arg_3[arg_1]["repositories"]),
                             "yellow"))

        arg_4 = arg_2.colored("Repositories", "blue")
        arg_5 = arg_2.colored("Path", "blue")
        arg_6 = PrettyTable(
            [arg_4, arg_5, arg_2.colored("+", "blue")])
        arg_6.align[arg_4] = "l"
        arg_6.align[arg_5] = "l"

        for arg_8 in arg_3[arg_1]["repositories"]:
            arg_9 = "%s/%s" % (arg_1, arg_8)
            arg_10 = find_path(arg_9, arg_0.config)[arg_9]
            try:
                arg_11 = Repository(arg_10)
                arg_12 = arg_11.get_scm()
            except RepositoryAdapterNotFound:
                arg_12 = None
            arg_6.add_row(
                [arg_2.colored(arg_8, "cyan"), arg_10, arg_12])

        arg_0.logger.info(arg_6)


(self, name=None, store=None, workspace=None)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None ) : arg_4 = arg_0 . Funcs ( names = arg_1 , stores = arg_2 , workspaces = arg_3 ) return arg_0 . _return_first_item ( arg_4 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        '''
          returns a single resource object.
          Will return None if no resource is found.
          Will raise an error if more than one resource with the same name is found.
        '''

        arg_4 = arg_0.Funcs(names=arg_1, stores=arg_2, workspaces=arg_3)
        return arg_0._return_first_item(arg_4)

returns a single resource object . Will return None if no resource is found . Will raise an error if more than one resource with the same name is found .


def Func ( arg_0 ) : if arg_0 . endswith ( '.gz' ) : try : with gzip . open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd ) except UnicodeDecodeError : with gzip . open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd , encoding = 'latin1' ) else : try : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd ) except UnicodeDecodeError : with open ( arg_0 , 'rb' ) as infd : arg_1 = pickle . load ( infd , encoding = 'latin1' ) return arg_1

def Func(arg_0):
    '''
    This just reads a light curve pickle file.

    Parameters
    ----------

    lcfile : str
        The file name of the pickle to open.

    Returns
    -------

    dict
        This returns an lcdict.

    '''

    if arg_0.endswith('.gz'):

        try:
            with gzip.open(arg_0,'rb') as infd:
                arg_1 = pickle.load(infd)
        except UnicodeDecodeError:
            with gzip.open(arg_0,'rb') as infd:
                arg_1 = pickle.load(infd, encoding='latin1')

    else:

        try:
            with open(arg_0,'rb') as infd:
                arg_1 = pickle.load(infd)
        except UnicodeDecodeError:
            with open(arg_0,'rb') as infd:
                arg_1 = pickle.load(infd, encoding='latin1')

    return arg_1

This just reads a light curve pickle file .


Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the search method. Note that this will return a generator

(term=None, phrase=None, limit=DEFAULT_SEARCH_LIMIT,
           api_key=GIPHY_PUBLIC_KEY, strict=False, rating=None)

return Giphy(api_key=api_key, strict=strict).search(
        term=term, phrase=phrase, limit=limit, rating=rating)

def Func(arg_0=None, arg_1=None, arg_2=arg_3,
           arg_4=arg_5, arg_6=False, arg_7=None):
    """
    Shorthand for creating a Giphy api wrapper with the given api key
    and then calling the Func method. Note that this will return a generator
    """
    return Giphy(arg_4=arg_4, arg_6=arg_6).Func(
        arg_0=arg_0, arg_1=arg_1, arg_2=arg_2, arg_7=arg_7)

Shorthand for creating a Giphy api wrapper with the given api key and then calling the search method . Note that this will return a generator