(self, ticker, start_datetime, end_datetime, event_type, interval,
             elms=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
)
:
arg_6
=
[
]
if
not
arg_6
else
arg_6
arg_7
=
_get_logger
(
arg_0
.
debug
)
while
(
arg_0
.
_session
.
tryNextEvent
(
)
)
:
pass
arg_8
=
arg_0
.
refDataService
.
createRequest
(
'IntradayBarRequest'
)
arg_8
.
set
(
'security'
,
arg_1
)
arg_8
.
set
(
'eventType'
,
arg_4
)
arg_8
.
set
(
'interval'
,
arg_5
)
arg_8
.
set
(
'startDateTime'
,
arg_2
)
arg_8
.
set
(
'endDateTime'
,
arg_3
)
for
arg_9
,
arg_10
in
arg_6
:
arg_8
.
set
(
arg_9
,
arg_10
)
arg_7
.
info
(
'Sending Request:\n{}'
.
format
(
arg_8
)
)
arg_0
.
_session
.
sendRequest
(
arg_8
,
identity
=
arg_0
.
_identity
)
arg_11
=
[
]
arg_12
=
[
'open'
,
'high'
,
'low'
,
'close'
,
'volume'
,
'numEvents'
]
for
arg_13
in
arg_0
.
_receive_events
(
)
:
arg_14
=
arg_13
[
'element'
]
[
'IntradayBarResponse'
]
for
arg_15
in
arg_14
[
'barData'
]
[
'barTickData'
]
:
arg_11
.
append
(
arg_15
[
'barTickData'
]
)
arg_11
=
pd
.
DataFrame
(
arg_11
)
.
set_index
(
'time'
)
.
sort_index
(
)
.
loc
[
:
,
arg_12
]
return
arg_11

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
             arg_6=None):
        """
        Get Open, High, Low, Close, Volume, and numEvents for a ticker.
        Return pandas DataFrame

        Parameters
        ----------
        ticker: string
            String corresponding to ticker
        start_datetime: string
            UTC datetime in format YYYY-mm-ddTHH:MM:SS
        end_datetime: string
            UTC datetime in format YYYY-mm-ddTHH:MM:SS
        event_type: string {TRADE, BID, ASK, BID_BEST, ASK_BEST, BEST_BID,
                           BEST_ASK}
            Requested data event type
        interval: int {1... 1440}
            Length of time bars
        elms: list of tuples
            List of tuples where each tuple corresponds to the other elements
            to be set. Refer to the IntradayBarRequest section in the
            'Services & schemas reference guide' for more info on these values
        """
        arg_6 = [] if not arg_6 else arg_6

        # flush event queue in case previous call errored out
        arg_7 = _get_logger(arg_0.debug)
        while(arg_0._session.tryNextEvent()):
            pass

        # Create and fill the request for the historical data
        arg_8 = arg_0.refDataService.createRequest('IntradayBarRequest')
        arg_8.set('security', arg_1)
        arg_8.set('eventType', arg_4)
        arg_8.set('interval', arg_5)  # bar interval in minutes
        arg_8.set('startDateTime', arg_2)
        arg_8.set('endDateTime', arg_3)
        for arg_9, arg_10 in arg_6:
            arg_8.set(arg_9, arg_10)

        arg_7.info('Sending Request:\n{}'.format(arg_8))
        # Send the request
        arg_0._session.sendRequest(arg_8, identity=arg_0._identity)
        # Process received events
        arg_11 = []
        arg_12 = ['open', 'high', 'low', 'close', 'volume', 'numEvents']
        for arg_13 in arg_0._receive_events():
            arg_14 = arg_13['element']['IntradayBarResponse']
            for arg_15 in arg_14['barData']['barTickData']:
                arg_11.append(arg_15['barTickData'])
        arg_11 = pd.DataFrame(arg_11).set_index('time').sort_index().loc[:, arg_12]
        return arg_11

Get Open High Low Close Volume and numEvents for a ticker . Return pandas DataFrame


def Func(arg_0):
        """Level-2 parser for gridpositions.

        pattern:
        object 1 class gridpositions counts 97 93 99
        origin -46.5 -45.5 -48.5
        delta 1 0 0
        delta 0 1 0
        delta 0 0 1
        """
        try:
            arg_1 = arg_0.__consume()
        except DXParserNoTokens:
            return

        if arg_1.equals('counts'):
            arg_2 = []
            try:
                while True:
                    # raises exception if not an int
                    arg_0.__peek().value('INTEGER')
                    arg_1 = arg_0.__consume()
                    arg_2.append(arg_1.value('INTEGER'))
            except (DXParserNoTokens, ValueError):
                pass
            if len(arg_2) == 0:
                raise DXParseError('gridpositions: no shape parameters')
            arg_0.currentobject['shape'] = arg_2
        elif arg_1.equals('origin'):
            arg_4 = []
            try:
                while (arg_0.__peek().iscode('INTEGER') or
                       arg_0.__peek().iscode('REAL')):
                    arg_1 = arg_0.__consume()
                    arg_4.append(arg_1.value())
            except DXParserNoTokens:
                pass
            if len(arg_4) == 0:
                raise DXParseError('gridpositions: no origin parameters')
            arg_0.currentobject['origin'] = arg_4
        elif arg_1.equals('delta'):
            arg_5 = []
            try:
                while (arg_0.__peek().iscode('INTEGER') or
                       arg_0.__peek().iscode('REAL')):
                    arg_1 = arg_0.__consume()
                    arg_5.append(arg_1.value())
            except DXParserNoTokens:
                pass
            if len(arg_5) == 0:
                raise DXParseError('gridpositions: missing delta parameters')
            try:
                arg_0.currentobject['delta'].append(arg_5)
            except KeyError:
                arg_0.currentobject['delta'] = [arg_5]
        else:
            raise DXParseError('gridpositions: '+str(arg_1)+' not recognized.')


(self, user_id, amount=None, filtration=True)

def Func(arg_0, arg_1, arg_2=None, arg_3=True):
    """ Likes last user_id's medias """
    if arg_3:
        if not arg_0.check_user(arg_1):
            return False
    arg_0.logger.info("Liking user_%s's feed:" % arg_1)
    arg_1 = arg_0.convert_to_user_id(arg_1)
    arg_4 = arg_0.get_user_medias(arg_1, arg_3=arg_3)
    if not arg_4:
        arg_0.logger.info(
            "None medias received: account is closed or medias have been filtered.")
        return False
    return arg_0.like_medias(arg_4[:arg_2])


(self, batches, chunksize=None, callback=None, error_callback=None)

return self.pool.map_async(_Pool_starworker, self._handle_batch_ids(batches),
                                   chunksize=chunksize, callback=callback, error_callback=error_callback)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
        """
        Augment batches asynchonously.

        Parameters
        ----------
        batches : list of imgaug.augmentables.batches.Batch
            The batches to augment.

        chunksize : None or int, optional
            Rough indicator of how many tasks should be sent to each worker. Increasing this number can improve
            performance.

        callback : None or callable, optional
            Function to call upon finish. See `multiprocessing.Pool`.

        error_callback : None or callable, optional
            Function to call upon errors. See `multiprocessing.Pool`.

        Returns
        -------
        multiprocessing.MapResult
            Asynchonous result. See `multiprocessing.Pool`.

        """
        assert isinstance(arg_1, list), ("Expected to get a list as 'batches', got type %s. "
                                           + "Call imap_batches() if you use generators.") % (type(arg_1),)
        return arg_0.pool.map_async(_Pool_starworker, arg_0._handle_batch_ids(arg_1),
                                   arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)


updates dictionary with the next .5M reads from the super long string
    phylip file. Makes for faster reading.

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = iter ( open ( os . path . join ( arg_0 . dirs . outfiles , arg_0 . name + ".phy" ) , 'r' ) ) arg_4 , arg_5 = arg_3 . next ( ) . strip ( ) . split ( ) for arg_6 in arg_3 : arg_7 , arg_8 = arg_6 . strip ( ) . split ( ) arg_1 [ arg_7 ] = arg_1 [ arg_7 ] [ 100000 : ] arg_1 [ arg_7 ] += arg_8 [ arg_2 : arg_2 + 100000 ] del arg_6 return arg_1

def Func(arg_0, arg_1, arg_2):
    """ Funcs dictionary with the next .5M reads from the super long string
    phylip file. Makes for faster reading. """

    arg_3 = iter(open(os.path.join(arg_0.dirs.outfiles,
                     arg_0.name+".phy"), 'r'))

    arg_4, arg_5 = arg_3.next().strip().split()

    ## read in max N bp at a time
    for arg_6 in arg_3:
        arg_7, arg_8 = arg_6.strip().split()
        arg_1[arg_7] = arg_1[arg_7][100000:]
        arg_1[arg_7] += arg_8[arg_2:arg_2+100000]
    del arg_6

    return arg_1

updates dictionary with the next . 5M reads from the super long string phylip file . Makes for faster reading .


return [
        create_annotation(int(timestamp * 1000000), key, host)
        for key, timestamp in annotations.items()
    ]

def Func ( arg_0 , arg_1 ) : return [ create_annotation ( int ( arg_3 * 1000000 ) , arg_2 , arg_1 ) for arg_2 , arg_3 in arg_0 . items ( ) ]

def Func(arg_0, arg_1):
    """
    Reformat annotations dict to return list of corresponding zipkin_core objects.

    :param annotations: dict containing key as annotation name,
                        value being timestamp in seconds(float).
    :type host: :class:`zipkin_core.Endpoint`
    :returns: a list of annotation zipkin_core objects
    :rtype: list
    """
    return [
        create_annotation(int(arg_3 * 1000000), arg_2, arg_1)
        for arg_2, arg_3 in arg_0.items()
    ]

Reformat annotations dict to return list of corresponding zipkin_core objects .


def Func ( arg_0 , arg_1 : arg_2 ) -> Node : arg_0 . tag_cache [ arg_1 ] = Tag ( arg_0 . _stream , arg_0 . _stream . index ) return True

def Func(arg_0, arg_1: arg_2) -> Node:
        """Save the current index under the given name."""
        # Check if we could attach tag cache to current rule_nodes scope
        arg_0.tag_cache[arg_1] = Tag(arg_0._stream, arg_0._stream.index)
        return True

Save the current index under the given name .


def Func ( arg_0 , ** arg_1 ) : for arg_2 in arg_0 . SUPPORTED_CALLBACKS : arg_3 = arg_1 . get ( arg_2 , getattr ( arg_0 , arg_2 ) ) setattr ( arg_0 , arg_2 , arg_3 )

def Func(arg_0, **arg_1):
        ''' Set callbacks for input events '''
        for arg_2 in arg_0.SUPPORTED_CALLBACKS:
            arg_3 = arg_1.get(arg_2, getattr(arg_0, arg_2))
            setattr(arg_0, arg_2, arg_3)


def
Func
(
arg_0
)
:
try
:
with
timeout
(
seconds
=
2
)
:
arg_1
=
(
arg_0
[
0
]
,
arg_0
[
1
]
.
state
)
except
Exception
as
e
:
arg_2
=
"Celery Task ID: {}\n{}"
.
format
(
arg_0
[
0
]
,
traceback
.
format_exc
(
)
)
arg_1
=
ExceptionWithTraceback
(
e
,
arg_2
)
return
arg_1

def Func(arg_0):
    """
    Fetch and return the state of the given celery task. The scope of this function is
    global so that it can be called by subprocesses in the pool.

    :param celery_task: a tuple of the Celery task key and the async Celery object used
        to fetch the task's state
    :type celery_task: tuple(str, celery.result.AsyncResult)
    :return: a tuple of the Celery task key and the Celery state of the task
    :rtype: tuple[str, str]
    """

    try:
        with timeout(seconds=2):
            # Accessing state property of celery task will make actual network request
            # to get the current state of the task.
            arg_1 = (arg_0[0], arg_0[1].state)
    except Exception as e:
        arg_2 = "Celery Task ID: {}\n{}".format(arg_0[0],
                                                              traceback.format_exc())
        arg_1 = ExceptionWithTraceback(e, arg_2)
    return arg_1

Fetch and return the state of the given celery task . The scope of this function is global so that it can be called by subprocesses in the pool .


def Func ( arg_0 ) : for arg_1 in arg_0 : if not arg_1 . value : continue if arg_1 . recursive : if not folder_exists ( arg_1 . value ) : return False else : if not simple_pattern_exists_in_gcs ( arg_1 . value ) : return False return True

def Func(arg_0):
  """True if each output contains at least one file or no output specified."""
  # outputs are OutputFileParam (see param_util.py)

  # If outputs contain a pattern, then there is no way for `dsub` to verify
  # that *all* output is present. The best that `dsub` can do is to verify
  # that *some* output was created for each such parameter.
  for arg_1 in arg_0:
    if not arg_1.value:
      continue
    if arg_1.recursive:
      if not folder_exists(arg_1.value):
        return False
    else:
      if not simple_pattern_exists_in_gcs(arg_1.value):
        return False
  return True

True if each output contains at least one file or no output specified .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
arg_3
.
KMIPVersion
.
KMIP_1_0
)
:
super
(
LongInteger
,
arg_0
)
.
Func
(
arg_1
,
arg_2
=
arg_2
)
if
arg_0
.
length
is
not
LongInteger
.
LENGTH
:
raise
exceptions
.
InvalidPrimitiveLength
(
"invalid long integer length Func; "
"expected: {0}, observed: {1}"
.
format
(
LongInteger
.
LENGTH
,
arg_0
.
length
)
)
arg_0
.
value
=
unpack
(
'!q'
,
arg_1
.
Func
(
arg_0
.
length
)
)
[
0
]
arg_0
.
validate
(
)

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Read the encoding of the LongInteger from the input stream.

        Args:
            istream (stream): A buffer containing the encoded bytes of a
                LongInteger. Usually a BytearrayStream object. Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidPrimitiveLength: if the long integer encoding Func in has
                an invalid encoded length.
        """
        super(LongInteger, arg_0).Func(arg_1, arg_2=arg_2)

        if arg_0.length is not LongInteger.LENGTH:
            raise exceptions.InvalidPrimitiveLength(
                "invalid long integer length Func; "
                "expected: {0}, observed: {1}".format(
                    LongInteger.LENGTH, arg_0.length))

        arg_0.value = unpack('!q', arg_1.Func(arg_0.length))[0]
        arg_0.validate()

Read the encoding of the LongInteger from the input stream.

        Args:
            istream (stream): A buffer containing the encoded bytes of a
                LongInteger. Usually a BytearrayStream object. Required.
            kmip_version (KMIPVersion): An enumeration defining the KMIP
                version with which the object will be decoded. Optional,
                defaults to KMIP 1.0.

        Raises:
            InvalidPrimitiveLength: if the long integer encoding read in has
                an invalid encoded length.

Read the encoding of the LongInteger from the input stream .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
join
(
dirname
(
abspath
(
__file__
)
)
,
"templates"
)
arg_3
=
join
(
arg_2
,
arg_1
+
".nf"
)
if
not
os
.
path
.
exists
(
arg_3
)
:
raise
eh
.
ProcessError
(
"Template {} does not exist"
.
format
(
arg_3
)
)
arg_0
.
_template_path
=
join
(
arg_2
,
arg_1
+
".nf"
)

def Func(arg_0, arg_1):
        """Sets the path to the appropriate jinja template file

        When a Process instance is initialized, this method will fetch
        the location of the appropriate template file, based on the
        ``template`` argument. It will raise an exception is the template
        file is not found. Otherwise, it will set the
        :py:attr:`Process.template_path` attribute.
        """

        # Set template directory
        arg_2 = join(dirname(abspath(__file__)), "templates")

        # Set template file path
        arg_3 = join(arg_2, arg_1 + ".nf")

        if not os.path.exists(arg_3):
            raise eh.ProcessError(
                "Template {} does not exist".format(arg_3))

        arg_0._template_path = join(arg_2, arg_1 + ".nf")


def Func ( arg_0 , arg_1 ) : arg_2 = np . average ( arg_0 , arg_1 = arg_1 , axis = 0 ) arg_3 = np . dot ( arg_1 , ( arg_0 - arg_2 ) ** 2 ) / arg_1 . sum ( ) return ( arg_2 , np . sqrt ( arg_3 ) )

def Func(arg_0, arg_1):
    """
    Returns the weighted average and standard deviation.

    values, weights -- numpy ndarrays with the same shape.
    """
    arg_2 = np.average(arg_0, arg_1=arg_1, axis=0)
    arg_3 = np.dot(arg_1, (arg_0 - arg_2) ** 2) / arg_1.sum()  # Fast and numerically precise
    return (arg_2, np.sqrt(arg_3))

Returns the weighted average and standard deviation .


def Func ( arg_0 , arg_1 ) : arg_2 = wx . GCDC ( wx . PaintDC ( arg_0 . wx_obj ) ) arg_2 . SetFont ( arg_0 . wx_obj . GetFont ( ) ) arg_2 . SetTextForeground ( arg_0 . wx_obj . GetForegroundColour ( ) ) arg_2 . DrawText ( arg_0 . wx_obj . GetLabel ( ) , 0 , 0 )

def Func(arg_0, arg_1):
        "Custom draws the label when transparent background is needed"
        # use a Device Context that supports anti-aliased drawing
        # and semi-transparent colours on all platforms
        arg_2 = wx.GCDC(wx.PaintDC(arg_0.wx_obj))
        arg_2.SetFont(arg_0.wx_obj.GetFont())
        arg_2.SetTextForeground(arg_0.wx_obj.GetForegroundColour())
        arg_2.DrawText(arg_0.wx_obj.GetLabel(), 0, 0)


def Func ( arg_0 ) : if not arg_0 . _client : arg_0 . _client = TextToSpeechClient ( credentials = arg_0 . _get_credentials ( ) ) return arg_0 . _client

def Func(arg_0):
        """
        Retrieves connection to Cloud Text to Speech.

        :return: Google Cloud Text to Speech client object.
        :rtype: google.cloud.texttospeech_v1.TextToSpeechClient
        """
        if not arg_0._client:
            arg_0._client = TextToSpeechClient(credentials=arg_0._get_credentials())
        return arg_0._client

Retrieves connection to Cloud Text to Speech .


def
Func
(
arg_0
,
arg_1
=
0
,
arg_2
=
arg_3
)
:
arg_4
=
instruction_tables
[
arg_2
]
if
isinstance
(
arg_0
,
bytes
)
:
arg_0
=
bytearray
(
arg_0
)
if
isinstance
(
arg_0
,
str
)
:
arg_0
=
bytearray
(
arg_0
.
encode
(
'latin-1'
)
)
arg_0
=
iter
(
arg_0
)
try
:
arg_5
=
next
(
arg_0
)
except
StopIteration
:
return
assert
isinstance
(
arg_5
,
int
)
arg_6
=
copy
.
copy
(
arg_4
.
get
(
arg_5
,
)
)
if
arg_6
is
:
arg_6
=
Instruction
(
arg_5
,
'INVALID'
,
0
,
0
,
0
,
0
,
'Unspecified invalid instruction.'
)
arg_6
.
pc
=
arg_1
try
:
if
arg_6
.
has_operand
:
arg_6
.
parse_operand
(
arg_0
)
except
ParseError
:
arg_6
=
finally
:
return
arg_6

def Func(arg_0, arg_1=0, arg_2=arg_3):
    """ Disassemble a single instruction from a bytecode

        :param bytecode: the bytecode stream
        :type bytecode: str | bytes | bytearray | iterator
        :param pc: program counter of the instruction(optional)
        :type pc: int
        :param fork: fork name (optional)
        :type fork: str
        :return: an Instruction object
        :rtype: Instruction

        Example use::

            >>> print Func('\x60\x10')

    """
    arg_4 = instruction_tables[arg_2]
    if isinstance(arg_0, bytes):
        arg_0 = bytearray(arg_0)
    if isinstance(arg_0, str):
        arg_0 = bytearray(arg_0.encode('latin-1'))

    arg_0 = iter(arg_0)
    try:
        arg_5 = next(arg_0)
    except StopIteration:
        return

    assert isinstance(arg_5, int)

    arg_6 = copy.copy(arg_4.get(arg_5, None))
    if arg_6 is None:
        arg_6 = Instruction(arg_5, 'INVALID', 0, 0, 0, 0, 'Unspecified invalid instruction.')
    arg_6.pc = arg_1

    try:
        if arg_6.has_operand:
            arg_6.parse_operand(arg_0)
    except ParseError:
        arg_6 = None
    finally:
        return arg_6

Disassemble a single instruction from a bytecode

        :param bytecode: the bytecode stream
        :type bytecode: str | bytes | bytearray | iterator
        :param pc: program counter of the instruction(optional)
        :type pc: int
        :param fork: fork name (optional)
        :type fork: str
        :return: an Instruction object
        :rtype: Instruction

        Example use::

            >>> print disassemble_one('\x60\x10')


return Tile(pos - zsc*rad, pos + zsc*rad).pad(self.support_pad)

def Func(arg_0, arg_1):
        """ Get the tile surrounding particle `n` """
        arg_2 = np.array([1.0/arg_0.zscale, 1, 1])
        arg_3, arg_4 = arg_0.pos[arg_1], arg_0.rad[arg_1]
        arg_3 = arg_0._trans(arg_3)
        return Tile(arg_3 - arg_2*arg_4, arg_3 + arg_2*arg_4).pad(arg_0.support_pad)


(cls, connections, random, segment, nDesiredNewSynapes,
                    prevWinnerCells, initialPermanence, maxSynapsesPerSegment)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                    arg_5, arg_6, arg_7):
    """
    Creates nDesiredNewSynapes synapses on the segment passed in if
    possible, choosing random cells from the previous winner cells that are
    not already on the segment.

    :param connections:        (Object) Connections instance for the tm
    :param random:             (Object) TM object used to generate random
                                        numbers
    :param segment:            (int)    Segment to grow synapses on.
    :param nDesiredNewSynapes: (int)    Desired number of synapses to grow
    :param prevWinnerCells:    (list)   Winner cells in `t-1`
    :param initialPermanence:  (float)  Initial permanence of a new synapse.

    """
    arg_8 = list(arg_5)

    for arg_9 in arg_1.synapsesForSegment(arg_3):
      arg_10 = binSearch(arg_8, arg_9.presynapticCell)
      if arg_10 != -1:
        del arg_8[arg_10]

    arg_11 = min(arg_4, len(arg_8))

    # Check if we're going to surpass the maximum number of synapses.
    arg_12 = arg_1.numSynapses(arg_3) + arg_11 - arg_7
    if arg_12 > 0:
      arg_0._destroyMinPermanenceSynapses(arg_1, arg_2, arg_3, arg_12,
                                        arg_5)

    # Recalculate in case we weren't able to destroy as many synapses as needed.
    arg_11 = min(arg_11,
                  arg_7 - arg_1.numSynapses(arg_3))

    for arg_13 in range(arg_11):
      arg_10 = arg_2.getUInt32(len(arg_8))
      arg_1.createSynapse(arg_3, arg_8[arg_10], arg_6)
      del arg_8[arg_10]

Creates nDesiredNewSynapes synapses on the segment passed in if possible choosing random cells from the previous winner cells that are not already on the segment .


(descriptor, name, backend, **backend_options)

def Func(arg_0, arg_1, arg_2, **arg_3):
    """Pull Data Package from storage.

    All parameters should be used as keyword arguments.

    Args:
        descriptor (str): path where to store descriptor
        name (str): name of the pulled datapackage
        backend (str): backend name like `sql` or `bigquery`
        backend_options (dict): backend options mentioned in backend docs

    """

    # Deprecated
    warnings.warn(
        'Functions "push/Func" are deprecated. '
        'Please use "Package" class',
        UserWarning)

    # Save datapackage name
    arg_4 = arg_1

    # Get storage
    arg_5 = import_module('jsontableschema.plugins.%s' % arg_2)
    arg_6 = arg_5.Storage(**arg_3)

    # Iterate over tables
    arg_7 = []
    for arg_8 in arg_6.buckets:

        # Prepare
        arg_9 = arg_6.describe(arg_8)
        arg_10 = os.path.dirname(arg_0)
        arg_11, arg_1 = _restore_path(arg_8)
        arg_12 = os.path.join(arg_10, arg_11)

        # Write data
        helpers.ensure_dir(arg_12)
        with io.open(arg_12, 'wb') as file:
            arg_13 = Schema(deepcopy(arg_9))
            arg_14 = arg_6.iter(arg_8)
            arg_15 = csv.writer(file, arg_19='utf-8')
            arg_15.writerow(arg_13.headers)
            for arg_16 in arg_14:
                arg_15.writerow(arg_16)

        # Add resource
        arg_17 = {'schema': arg_9, 'path': arg_11}
        if arg_1 is not None:
            arg_17['name'] = arg_1
        arg_7.append(arg_17)

    # Write descriptor
    arg_18 = 'w'
    arg_19 = 'utf-8'
    if six.PY2:
        arg_18 = 'wb'
        arg_19 = None
    arg_7 = _restore_resources(arg_7)
    helpers.ensure_dir(arg_0)
    with io.open(arg_0,
                 arg_18=arg_18,
                 arg_19=arg_19) as file:
        arg_0 = {
            'name': arg_4,
            'resources': arg_7,
        }
        json.dump(arg_0, file, indent=4)
    return arg_6


def Func ( arg_0 , arg_1 = False ) : arg_0 = arg_0 . replace ( SEPARATOR_WINDOWS , SEPARATOR_UNIX ) if arg_1 : arg_0 = arg_0 . rstrip ( SEPARATOR_UNIX ) return arg_0

def Func(arg_0, arg_1=False):
    '''
    Replaces all slashes and backslashes with the target separator

    StandardPath:
        We are defining that the standard-path is the one with only back-slashes in it, either
        on Windows or any other platform.

    :param bool strip:
        If True, removes additional slashes from the end of the path.
    '''
    arg_0 = arg_0.replace(SEPARATOR_WINDOWS, SEPARATOR_UNIX)
    if arg_1:
        arg_0 = arg_0.rstrip(SEPARATOR_UNIX)
    return arg_0


def Func(arg_0, arg_1, arg_2={}):
        """
        Return external tools for the passed canvas account id.

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/external_tools"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(arg_5)
        return arg_4

Return external tools for the passed canvas account id .


def
Func
(
arg_0
,
arg_1
=
1
)
:
import
os
if
not
os
.
path
.
exists
(
arg_0
)
:
import
re
import
zipimport
arg_2
=
'(.zip['
+
re
.
escape
(
os
.
path
.
sep
)
+
'/:])'
arg_3
=
re
.
split
(
arg_2
,
arg_0
,
flags
=
re
.
IGNORECASE
)
if
len
(
arg_3
)
>
2
:
arg_4
=
''
.
join
(
arg_3
[
:
1
]
)
[
:
1
]
arg_5
=
arg_3
[
1
]
arg_6
=
os
.
path
.
splitext
(
arg_5
)
[
0
]
arg_6
=
os
.
path
.
normpath
(
arg_6
)
if
os
.
path
.
exists
(
arg_4
)
:
arg_7
=
zipimport
.
zipimporter
(
arg_4
)
arg_8
=
arg_7
.
load_module
(
arg_6
)
return
arg_8
raise
IOError
(
'modpath={} does not exist'
.
format
(
arg_0
)
)
else
:
arg_8
=
_custom_import_modpath
(
arg_0
)
return
arg_8

def Func(arg_0, arg_1=-1):
    """
    Imports a module via its path

    Args:
        modpath (PathLike): path to the module on disk or within a zipfile.

    Returns:
        module: the imported module

    References:
        https://stackoverflow.com/questions/67631/import-module-given-path

    Notes:
        If the module is part of a package, the package will be imported first.
        These modules may cause problems when reloading via IPython magic

        This can import a module from within a zipfile. To do this modpath
        should specify the path to the zipfile and the path to the module
        within that zipfile separated by a colon or pathsep.
        E.g. `/path/to/archive.zip:mymodule.py`

    Warning:
        It is best to use this with paths that will not conflict with
        previously existing modules.

        If the modpath conflicts with a previously existing module name. And
        the target module does imports of its own relative to this conflicting
        path. In this case, the module that was loaded first will win.

        For example if you try to import '/foo/bar/pkg/mod.py' from the folder
        structure:
          - foo/
            +- bar/
               +- pkg/
                  +  __init__.py
                  |- mod.py
                  |- helper.py

       If there exists another module named `pkg` already in sys.modules
       and mod.py does something like `from . import helper`, Python will
       assume helper belongs to the `pkg` module already in sys.modules.
       This can cause a NameError or worse --- a incorrect helper module.

    Example:
        >>> import xdoctest
        >>> modpath = xdoctest.__file__
        >>> module = Func(modpath)
        >>> assert module is xdoctest

    Example:
        >>> # Test importing a module from within a zipfile
        >>> import zipfile
        >>> from xdoctest import utils
        >>> from os.path import join, expanduser
        >>> dpath = expanduser('~/.cache/xdoctest')
        >>> dpath = utils.ensuredir(dpath)
        >>> #dpath = utils.TempDir().ensure()
        >>> # Write to an external module named bar
        >>> external_modpath = join(dpath, 'bar.py')
        >>> open(external_modpath, 'w').write('testvar = 1')
        >>> internal = 'folder/bar.py'
        >>> # Move the external bar module into a zipfile
        >>> zippath = join(dpath, 'myzip.zip')
        >>> with zipfile.ZipFile(zippath, 'w') as myzip:
        >>>     myzip.write(external_modpath, internal)
        >>> # Import the bar module from within the zipfile
        >>> modpath = zippath + ':' + internal
        >>> modpath = zippath + os.path.sep + internal
        >>> module = Func(modpath)
        >>> assert module.__name__ == os.path.normpath('folder/bar')
        >>> assert module.testvar == 1

    Doctest:
        >>> import pytest
        >>> with pytest.raises(IOError):
        >>>     Func('does-not-exist')
        >>> with pytest.raises(IOError):
        >>>     Func('does-not-exist.zip/')
    """
    import os
    if not os.path.exists(arg_0):
        import re
        import zipimport
        # We allow (if not prefer or force) the colon to be a path.sep in order
        # to agree with the mod.__name__ attribute that will be produced

        # zip followed by colon or slash
        arg_2 = '(.zip[' + re.escape(os.path.sep) + '/:])'
        arg_3 = re.split(arg_2, arg_0, flags=re.IGNORECASE)
        if len(arg_3) > 2:
            arg_4 = ''.join(arg_3[:-1])[:-1]
            arg_5 = arg_3[-1]
            arg_6 = os.path.splitext(arg_5)[0]
            arg_6 = os.path.normpath(arg_6)
            if os.path.exists(arg_4):
                arg_7 = zipimport.zipimporter(arg_4)
                arg_8 = arg_7.load_module(arg_6)
                return arg_8
        raise IOError('modpath={} does not exist'.format(arg_0))
    else:
        # the importlib version doesnt work in pytest
        arg_8 = _custom_import_modpath(arg_0)
        # TODO: use this implementation once pytest fixes importlib
        # module = _pkgutil_import_modpath(modpath)
        return arg_8

Imports a module via its path

    Args:
        modpath (PathLike): path to the module on disk or within a zipfile.

    Returns:
        module: the imported module

    References:
        https://stackoverflow.com/questions/67631/import-module-given-path

    Notes:
        If the module is part of a package, the package will be imported first.
        These modules may cause problems when reloading via IPython magic

        This can import a module from within a zipfile. To do this modpath
        should specify the path to the zipfile and the path to the module
        within that zipfile separated by a colon or pathsep.
        E.g. `/path/to/archive.zip:mymodule.py`

    Warning:
        It is best to use this with paths that will not conflict with
        previously existing modules.

        If the modpath conflicts with a previously existing module name. And
        the target module does imports of its own relative to this conflicting
        path. In this case, the module that was loaded first will win.

        For example if you try to import '/foo/bar/pkg/mod.py' from the folder
        structure:
          - foo/
            +- bar/
               +- pkg/
                  +  __init__.py
                  |- mod.py
                  |- helper.py

       If there exists another module named `pkg` already in sys.modules
       and mod.py does something like `from . import helper`, Python will
       assume helper belongs to the `pkg` module already in sys.modules.
       This can cause a NameError or worse --- a incorrect helper module.

    Example:
        >>> import xdoctest
        >>> modpath = xdoctest.__file__
        >>> module = import_module_from_path(modpath)
        >>> assert module is xdoctest

    Example:
        >>> # Test importing a module from within a zipfile
        >>> import zipfile
        >>> from xdoctest import utils
        >>> from os.path import join, expanduser
        >>> dpath = expanduser('~/.cache/xdoctest')
        >>> dpath = utils.ensuredir(dpath)
        >>> #dpath = utils.TempDir().ensure()
        >>> # Write to an external module named bar
        >>> external_modpath = join(dpath, 'bar.py')
        >>> open(external_modpath, 'w').write('testvar = 1')
        >>> internal = 'folder/bar.py'
        >>> # Move the external bar module into a zipfile
        >>> zippath = join(dpath, 'myzip.zip')
        >>> with zipfile.ZipFile(zippath, 'w') as myzip:
        >>>     myzip.write(external_modpath, internal)
        >>> # Import the bar module from within the zipfile
        >>> modpath = zippath + ':' + internal
        >>> modpath = zippath + os.path.sep + internal
        >>> module = import_module_from_path(modpath)
        >>> assert module.__name__ == os.path.normpath('folder/bar')
        >>> assert module.testvar == 1

    Doctest:
        >>> import pytest
        >>> with pytest.raises(IOError):
        >>>     import_module_from_path('does-not-exist')
        >>> with pytest.raises(IOError):
        >>>     import_module_from_path('does-not-exist.zip/')


return {'tpr': self.rp(kwargs['s']), 'xtc': self.rp(kwargs['o'])}

def Func(arg_0, arg_1=False, **arg_2):
        """Write xtc that is Functed to the tpr reference structure.

        Runs :class:`gromacs.tools.trjconv` with appropriate arguments
        for Functing. The most important *kwargs* are listed
        here but in most cases the defaults should work.

        Note that the default settings do *not* include centering or
        periodic boundary treatment as this often does not work well
        with Functing. It is better to do this as a separate step (see
        :meth:`center_Func` or :func:`gromacs.cbook.trj_Funcandcenter`)

        :Keywords:
           *s*
             Input structure (typically the default tpr file but can be set to
             some other file with a different conformation for Functing)
           *n*
             Alternative index file.
           *o*
             Name of the output trajectory. A default name is created.
             If e.g. *dt* = 100  is one of the *kwargs* then the default name includes
             "_dt100ps".
          *xy* : boolean
             If ``True`` then only do a rot+trans Func in the xy plane
             (good for membrane simulations); default is ``False``.
          *force*
            ``True``: overwrite existing trajectories
            ``False``: throw a IOError exception
            ``None``: skip existing and log a warning [default]
          *Funcgroup*
            index group to Func on ["backbone"]

            .. Note:: If keyword *input* is supplied then it will override
                      *Funcgroup*; *input* = ``[Funcgroup, outgroup]``
          *kwargs*
             kwargs are passed to :func:`~gromacs.cbook.trj_xyFuncted`

        :Returns:
              dictionary with keys *tpr*, *xtc*, which are the names of the
              the new files
        """
        arg_2.setdefault('s', arg_0.tpr)
        arg_2.setdefault('n', arg_0.ndx)
        arg_2['f'] = arg_0.xtc
        arg_3 = arg_2.pop('force', arg_0.force)
        if arg_1:
            arg_4 = 'rotxy+transxy'
            arg_2.pop('Func', None)
            arg_5 = '_Funcxy'
        else:
            arg_4 = arg_2.pop('Func', 'rot+trans')  # user can use 'progressive', too
            arg_5 = '_Func'

        arg_6 = arg_2.get('dt')
        if arg_6:
            arg_5 += '_dt{0:d}ps'.format(int(arg_6))    # dt in ps

        arg_2.setdefault('o', arg_0.outfile(arg_0.infix_filename(None, arg_0.xtc, arg_5, 'xtc')))
        arg_7 = arg_2.pop('Funcgroup', 'backbone')
        arg_2.setdefault('input', [arg_7, "system"])

        if arg_2.get('center', False):
            logger.warn("Transformer.Func(): center=%(center)r used: centering should not be combined with Functing.", arg_2)
            if len(arg_2['inputs']) != 3:
                logger.error("If you insist on centering you must provide three groups in the 'input' kwarg: (center, Func, output)")
                raise ValuError("Insufficient index groups for centering,Functing,output")

        logger.info("Fitting trajectory %r to with xy=%r...", arg_2['f'], arg_1)
        logger.info("Fitting on index group %(Funcgroup)r", vars())
        with utilities.in_dir(arg_0.dirname):
            if arg_0.check_file_exists(arg_2['o'], resolve="indicate", arg_3=arg_3):
                logger.warn("File %r exists; force regenerating it with force=True.", arg_2['o'])
            else:
                gromacs.trjconv(Func=arg_4, **arg_2)
                logger.info("Fitted trajectory (Funcmode=%s): %r.", arg_4, arg_2['o'])
        return {'tpr': arg_0.rp(arg_2['s']), 'xtc': arg_0.rp(arg_2['o'])}

Write xtc that is fitted to the tpr reference structure.

        Runs :class:`gromacs.tools.trjconv` with appropriate arguments
        for fitting. The most important *kwargs* are listed
        here but in most cases the defaults should work.

        Note that the default settings do *not* include centering or
        periodic boundary treatment as this often does not work well
        with fitting. It is better to do this as a separate step (see
        :meth:`center_fit` or :func:`gromacs.cbook.trj_fitandcenter`)

        :Keywords:
           *s*
             Input structure (typically the default tpr file but can be set to
             some other file with a different conformation for fitting)
           *n*
             Alternative index file.
           *o*
             Name of the output trajectory. A default name is created.
             If e.g. *dt* = 100  is one of the *kwargs* then the default name includes
             "_dt100ps".
          *xy* : boolean
             If ``True`` then only do a rot+trans fit in the xy plane
             (good for membrane simulations); default is ``False``.
          *force*
            ``True``: overwrite existing trajectories
            ``False``: throw a IOError exception
            ``None``: skip existing and log a warning [default]
          *fitgroup*
            index group to fit on ["backbone"]

            .. Note:: If keyword *input* is supplied then it will override
                      *fitgroup*; *input* = ``[fitgroup, outgroup]``
          *kwargs*
             kwargs are passed to :func:`~gromacs.cbook.trj_xyfitted`

        :Returns:
              dictionary with keys *tpr*, *xtc*, which are the names of the
              the new files

Write xtc that is fitted to the tpr reference structure .


def Func ( arg_0 , arg_1 ) : from IPython . utils . syspathcontext import prepended_to_syspath if arg_1 not in sys . modules : with prepended_to_syspath ( arg_0 . ipython_extension_dir ) : __import__ ( arg_1 ) arg_2 = sys . modules [ arg_1 ] return arg_0 . _call_load_ipython_extension ( arg_2 )

def Func(arg_0, arg_1):
        """Load an IPython extension by its module name.

        If :func:`load_ipython_extension` returns anything, this function
        will return that object.
        """
        from IPython.utils.syspathcontext import prepended_to_syspath

        if arg_1 not in sys.modules:
            with prepended_to_syspath(arg_0.ipython_extension_dir):
                __import__(arg_1)
        arg_2 = sys.modules[arg_1]
        return arg_0._call_load_ipython_extension(arg_2)

Load an IPython extension by its module name .


Connects to Github and Asana and authenticates via OAuth.

def
Func
(
arg_0
)
:
if
arg_0
.
oauth
:
return
False
arg_0
.
settings
.
apply
(
'api-asana'
,
arg_0
.
args
.
asana_api
,
"enter asana api key"
)
arg_0
.
settings
.
apply
(
'api-github'
,
arg_0
.
args
.
github_api
,
"enter github.com token"
)
logging
.
debug
(
"authenticating asana api."
)
arg_0
.
asana
=
Client
.
basic_auth
(
arg_0
.
settings
[
'api-asana'
]
)
arg_0
.
asana_errors
=
arg_2
arg_0
.
asana_me
=
arg_0
.
asana
.
users
.
me
(
)
logging
.
debug
(
"authenticating github api"
)
arg_0
.
github
=
Github
(
arg_0
.
settings
[
'api-github'
]
)
arg_0
.
github_user
=
arg_0
.
github
.
get_user
(
)
arg_0
.
oauth
=
True

def Func(arg_0):
        """Connects to Github and Asana and Funcs via OAuth."""
        if arg_0.oauth:
            return False

        # Save asana.
        arg_0.settings.apply('api-asana', arg_0.args.asana_api,
            "enter asana api key")

        # Save github.com
        arg_0.settings.apply('api-github', arg_0.args.github_api,
            "enter github.com token")

        logging.debug("authenticating asana api.")
        arg_0.asana = Client.basic_auth(arg_0.settings['api-asana'])
        arg_0.asana_errors = arg_2
        arg_0.asana_me = arg_0.asana.users.me()
        logging.debug("authenticating github api")
        arg_0.github = Github(arg_0.settings['api-github'])
        arg_0.github_user = arg_0.github.get_user()

        arg_0.oauth = True

Connects to Github and Asana and authenticates via OAuth .


def Func(arg_0, arg_1):
        """Validate a set of samples for equality and inequality feasibility.

        Can be used to check whether the generated samples and warmup points
        are feasible.

        Parameters
        ----------
        samples : numpy.matrix
            Must be of dimension (n_samples x n_reactions). Contains the
            samples to be Funcd. Samples must be from fluxes.

        Returns
        -------
        numpy.array
            A one-dimensional numpy array of length containing
            a code of 1 to 3 letters denoting the validation result:

            - 'v' means feasible in bounds and equality constraints
            - 'l' means a lower bound violation
            - 'u' means a lower bound validation
            - 'e' means and equality constraint violation

        """

        arg_1 = np.atleast_2d(arg_1)
        arg_2 = arg_0.problem

        if arg_1.shape[1] == len(arg_0.model.reactions):
            arg_3 = create_stoichiometric_matrix(arg_0.model)
            arg_4 = np.array([arg_0.model.constraints[m.id].lb for m in
                          arg_0.model.metabolites])
            arg_5 = np.array([r.bounds for r in arg_0.model.reactions]).T
        elif arg_1.shape[1] == len(arg_0.model.variables):
            arg_3 = arg_2.equalities
            arg_4 = arg_2.b
            arg_5 = arg_2.variable_bounds
        else:
            raise ValueError("Wrong number of columns. samples must have a "
                             "column for each flux or variable defined in the "
                             "model!")

        arg_6 = np.abs(arg_3.dot(arg_1.T).T - arg_4).max(axis=1)
        arg_7 = (arg_1 - arg_5[0, ]).min(axis=1)
        arg_8 = (arg_5[1, ] - arg_1).min(axis=1)

        if (arg_1.shape[1] == len(arg_0.model.variables) and
                arg_2.inequalities.shape[0]):
            arg_9 = arg_2.inequalities.dot(arg_1.T)
            arg_7 = np.minimum(
                arg_7,
                (arg_9 - arg_2.bounds[0, ]).min(axis=1))
            arg_8 = np.minimum(
                arg_8,
                (arg_2.bounds[1, ] - arg_9).min(axis=1)
            )

        arg_10 = (
            (arg_6 < arg_0.feasibility_tol) &
            (arg_7 > -arg_0.bounds_tol) &
            (arg_8 > -arg_0.bounds_tol))
        arg_11 = np.repeat("", arg_10.shape[0]).astype(np.dtype((str, 3)))
        arg_11[arg_10] = "v"
        arg_11[arg_7 <= -arg_0.bounds_tol] = np.char.add(
            arg_11[arg_7 <= -arg_0.bounds_tol], "l")
        arg_11[arg_8 <= -arg_0.bounds_tol] = np.char.add(
            arg_11[arg_8 <= -arg_0.bounds_tol], "u")
        arg_11[arg_6 > arg_0.feasibility_tol] = np.char.add(
            arg_11[arg_6 > arg_0.feasibility_tol], "e")

        return arg_11

Validate a set of samples for equality and inequality feasibility.

        Can be used to check whether the generated samples and warmup points
        are feasible.

        Parameters
        ----------
        samples : numpy.matrix
            Must be of dimension (n_samples x n_reactions). Contains the
            samples to be validated. Samples must be from fluxes.

        Returns
        -------
        numpy.array
            A one-dimensional numpy array of length containing
            a code of 1 to 3 letters denoting the validation result:

            - 'v' means feasible in bounds and equality constraints
            - 'l' means a lower bound violation
            - 'u' means a lower bound validation
            - 'e' means and equality constraint violation

Validate a set of samples for equality and inequality feasibility .


(self, ticker,
                         startDate=None, endDate=None,
                         fmt='json', frequency='daily')

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = 'json' , arg_5 = 'daily' ) : arg_6 = arg_0 . _get_url ( arg_1 , arg_5 ) arg_7 = { 'format' : arg_4 if arg_4 != "object" else 'json' , 'resampleFreq' : arg_5 } if arg_2 : arg_7 [ 'startDate' ] = arg_2 if arg_3 : arg_7 [ 'endDate' ] = arg_3 arg_8 = arg_0 . _request ( 'GET' , arg_6 , arg_7 = arg_7 ) if arg_4 == "json" : return arg_8 . json ( ) elif arg_4 == "object" : arg_9 = arg_8 . json ( ) return [ dict_to_object ( arg_10 , "TickerPrice" ) for arg_10 in arg_9 ] else : return arg_8 . content . decode ( "utf-8" )

def Func(arg_0, arg_1,
                         arg_2=None, arg_3=None,
                         arg_4='json', arg_5='daily'):
        """By default, return latest EOD Composite Price for a stock ticker.
           On average, each feed contains 3 data sources.

            Supported tickers + Available Day Ranges are here:
            https://apimedia.tiingo.com/docs/tiingo/daily/supported_tickers.zip

            Args:
                ticker (string): Unique identifier for stock ticker
                startDate (string): Start of ticker range in YYYY-MM-DD format
                endDate (string): End of ticker range in YYYY-MM-DD format
                fmt (string): 'csv' or 'json'
                frequency (string): Resample frequency
        """
        arg_6 = arg_0._get_url(arg_1, arg_5)
        arg_7 = {
            'format': arg_4 if arg_4 != "object" else 'json',  # conversion local
            'resampleFreq': arg_5
        }

        if arg_2:
            arg_7['startDate'] = arg_2
        if arg_3:
            arg_7['endDate'] = arg_3

        # TODO: evaluate whether to stream CSV to cache on disk, or
        # load as array in memory, or just pass plain text
        arg_8 = arg_0._request('GET', arg_6, arg_7=arg_7)
        if arg_4 == "json":
            return arg_8.json()
        elif arg_4 == "object":
            arg_9 = arg_8.json()
            return [dict_to_object(arg_10, "TickerPrice") for arg_10 in arg_9]
        else:
            return arg_8.content.decode("utf-8")

By default return latest EOD Composite Price for a stock ticker . On average each feed contains 3 data sources .


(conversation, conv_event, prev_conv_event,
                                datetimefmt, watermark_users=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
)
:
arg_5
=
arg_0
.
get_user
(
arg_1
.
user_id
)
if
arg_2
is
not
:
arg_6
=
(
arg_1
.
timestamp
.
astimezone
(
tz
=
)
.
date
(
)
!=
arg_2
.
timestamp
.
astimezone
(
tz
=
)
.
date
(
)
)
else
:
arg_6
=
False
if
isinstance
(
arg_1
,
hangups
.
ChatMessageEvent
)
:
return
MessageWidget
(
arg_1
.
timestamp
,
arg_1
.
text
,
arg_3
,
arg_5
,
show_date
=
arg_6
,
arg_4
=
arg_4
)
elif
isinstance
(
arg_1
,
hangups
.
RenameEvent
)
:
if
arg_1
.
new_name
==
''
:
arg_7
=
(
'{} cleared the conversation name'
.
format
(
arg_5
.
first_name
)
)
else
:
arg_7
=
(
'{} renamed the conversation to {}'
.
format
(
arg_5
.
first_name
,
arg_1
.
new_name
)
)
return
MessageWidget
(
arg_1
.
timestamp
,
arg_7
,
arg_3
,
show_date
=
arg_6
,
arg_4
=
arg_4
)
elif
isinstance
(
arg_1
,
hangups
.
MembershipChangeEvent
)
:
arg_8
=
[
arg_0
.
get_user
(
user_id
)
for
user_id
in
arg_1
.
participant_ids
]
arg_9
=
', '
.
join
(
[
arg_5
.
full_name
for
arg_5
in
arg_8
]
)
if
arg_1
.
type_
==
hangups
.
MEMBERSHIP_CHANGE_TYPE_JOIN
:
arg_7
=
(
'{} added {} to the conversation'
.
format
(
arg_5
.
first_name
,
arg_9
)
)
else
:
arg_7
=
(
'{} left the conversation'
.
format
(
arg_9
)
)
return
MessageWidget
(
arg_1
.
timestamp
,
arg_7
,
arg_3
,
show_date
=
arg_6
,
arg_4
=
arg_4
)
elif
isinstance
(
arg_1
,
hangups
.
HangoutEvent
)
:
arg_7
=
{
hangups
.
HANGOUT_EVENT_TYPE_START
:
(
'A Hangout call is starting.'
)
,
hangups
.
HANGOUT_EVENT_TYPE_END
:
(
'A Hangout call ended.'
)
,
hangups
.
HANGOUT_EVENT_TYPE_ONGOING
:
(
'A Hangout call is ongoing.'
)
,
}
.
get
(
arg_1
.
event_type
,
'Unknown Hangout call event.'
)
return
MessageWidget
(
arg_1
.
timestamp
,
arg_7
,
arg_3
,
show_date
=
arg_6
,
arg_4
=
arg_4
)
elif
isinstance
(
arg_1
,
hangups
.
GroupLinkSharingModificationEvent
)
:
arg_10
=
hangups
.
GROUP_LINK_SHARING_STATUS_ON
arg_11
=
(
'on'
if
arg_1
.
new_status
==
arg_10
else
'off'
)
arg_7
=
'{} turned {} joining by link.'
.
format
(
arg_5
.
first_name
,
arg_11
)
return
MessageWidget
(
arg_1
.
timestamp
,
arg_7
,
arg_3
,
show_date
=
arg_6
,
arg_4
=
arg_4
)
else
:
arg_7
=
'Unknown conversation event'
return
MessageWidget
(
arg_1
.
timestamp
,
arg_7
,
arg_3
,
show_date
=
arg_6
,
arg_4
=
arg_4
)

def Func(arg_0, arg_1, arg_2,
                                arg_3, arg_4=None):
        """Return MessageWidget representing a ConversationEvent.

        Returns None if the ConversationEvent does not have a widget
        representation.
        """
        arg_5 = arg_0.get_user(arg_1.user_id)
        # Check whether the previous event occurred on the same day as this
        # event.
        if arg_2 is not None:
            arg_6 = (arg_1.timestamp.astimezone(tz=None).date() !=
                          arg_2.timestamp.astimezone(tz=None).date())
        else:
            arg_6 = False
        if isinstance(arg_1, hangups.ChatMessageEvent):
            return MessageWidget(arg_1.timestamp, arg_1.text,
                                 arg_3, arg_5, show_date=arg_6,
                                 arg_4=arg_4)
        elif isinstance(arg_1, hangups.RenameEvent):
            if arg_1.new_name == '':
                arg_7 = ('{} cleared the conversation name'
                        .format(arg_5.first_name))
            else:
                arg_7 = ('{} renamed the conversation to {}'
                        .format(arg_5.first_name, arg_1.new_name))
            return MessageWidget(arg_1.timestamp, arg_7, arg_3,
                                 show_date=arg_6,
                                 arg_4=arg_4)
        elif isinstance(arg_1, hangups.MembershipChangeEvent):
            arg_8 = [arg_0.get_user(user_id) for user_id
                           in arg_1.participant_ids]
            arg_9 = ', '.join([arg_5.full_name for arg_5 in arg_8])
            if arg_1.type_ == hangups.MEMBERSHIP_CHANGE_TYPE_JOIN:
                arg_7 = ('{} added {} to the conversation'
                        .format(arg_5.first_name, arg_9))
            else:  # LEAVE
                arg_7 = ('{} left the conversation'.format(arg_9))
            return MessageWidget(arg_1.timestamp, arg_7, arg_3,
                                 show_date=arg_6,
                                 arg_4=arg_4)
        elif isinstance(arg_1, hangups.HangoutEvent):
            arg_7 = {
                hangups.HANGOUT_EVENT_TYPE_START: (
                    'A Hangout call is starting.'
                ),
                hangups.HANGOUT_EVENT_TYPE_END: (
                    'A Hangout call ended.'
                ),
                hangups.HANGOUT_EVENT_TYPE_ONGOING: (
                    'A Hangout call is ongoing.'
                ),
            }.get(arg_1.event_type, 'Unknown Hangout call event.')
            return MessageWidget(arg_1.timestamp, arg_7, arg_3,
                                 show_date=arg_6,
                                 arg_4=arg_4)
        elif isinstance(arg_1, hangups.GroupLinkSharingModificationEvent):
            arg_10 = hangups.GROUP_LINK_SHARING_STATUS_ON
            arg_11 = ('on' if arg_1.new_status == arg_10
                           else 'off')
            arg_7 = '{} turned {} joining by link.'.format(arg_5.first_name,
                                                          arg_11)
            return MessageWidget(arg_1.timestamp, arg_7, arg_3,
                                 show_date=arg_6,
                                 arg_4=arg_4)
        else:
            # conv_event is a generic hangups.ConversationEvent.
            arg_7 = 'Unknown conversation event'
            return MessageWidget(arg_1.timestamp, arg_7, arg_3,
                                 show_date=arg_6,
                                 arg_4=arg_4)

Return MessageWidget representing a ConversationEvent .


def Func(arg_0, arg_1=25):
    '''This lists recent publicly visible datasets available on the LCC-Server.

    If you have an LCC-Server API key present in `~/.astrobase/lccs/` that is
    associated with an LCC-Server user account, datasets that belong to this
    user will be returned as well, even if they are not visible to the public.

    Parameters
    ----------

    lcc_server : str
        This is the base URL of the LCC-Server to talk to.

    nrecent : int
        This indicates how many recent public datasets you want to list. This is
        always capped at 1000.

    Returns
    -------

    list of dicts
        Returns a list of dicts, with each dict containing info on each dataset.

    '''

    arg_2 = {'nsets':arg_1}
    arg_3 = urlencode(arg_2)

    arg_4 = '%s/api/datasets?%s' % (arg_0, arg_3)

    try:

        LOGINFO(
            'getting list of recent publicly '
            'visible and owned datasets from %s' % (
                arg_0,
            )
        )

        # check if we have an API key already
        arg_5, arg_6, arg_7 = check_existing_apikey(arg_0)

        # if not, get a new one
        if not arg_5:
            arg_6, arg_7 = get_new_apikey(arg_0)

        # if apikey is not None, add it in as an Authorization: Bearer [apikey]
        # header
        if arg_6:
            arg_8 = {'Authorization':'Bearer: %s' % arg_6}
        else:
            arg_8 = {}

        # hit the server
        arg_9 = Request(arg_4, data=None, arg_8=arg_8)
        arg_10 = urlopen(arg_9)
        arg_11 = json.loads(arg_10.read())['result']
        return arg_11

    except HTTPError as e:

        LOGERROR('could not retrieve recent datasets list, '
                 'URL used: %s, error code: %s, reason: %s' %
                 (arg_4, e.code, e.reason))

        return None

This lists recent publicly visible datasets available on the LCC - Server .


(self, project_id, instance_id, configuration_name, node_count,
                           display_name, func)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
arg_7
=
arg_0
.
_get_client
(
arg_1
=
arg_1
)
.
instance
(
arg_2
=
arg_2
,
arg_3
=
arg_3
,
arg_4
=
arg_4
,
arg_5
=
arg_5
)
try
:
arg_8
=
arg_6
(
arg_7
)
except
GoogleAPICallError
as
e
:
arg_0
.
log
.
error
(
'An error occurred: %s. Exiting.'
,
e
.
message
)
raise
e
if
arg_8
:
arg_9
=
arg_8
.
result
(
)
arg_0
.
log
.
info
(
arg_9
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                           arg_5, arg_6):
        """
        Invokes a method on a given instance by applying a specified Callable.

        :param project_id: The ID of the  GCP project that owns the Cloud Spanner
            database.
        :type project_id: str
        :param instance_id: The ID of the instance.
        :type instance_id: str
        :param configuration_name: Name of the instance configuration defining how the
            instance will be created. Required for instances which do not yet exist.
        :type configuration_name: str
        :param node_count: (Optional) Number of nodes allocated to the instance.
        :type node_count: int
        :param display_name: (Optional) The display name for the instance in the Cloud
            Console UI. (Must be between 4 and 30 characters.) If this value is not set
            in the constructor, will fall back to the instance ID.
        :type display_name: str
        :param func: Method of the instance to be called.
        :type func: Callable
        """
        # noinspection PyUnresolvedReferences
        arg_7 = arg_0._get_client(arg_1=arg_1).instance(
            arg_2=arg_2, arg_3=arg_3,
            arg_4=arg_4, arg_5=arg_5)
        try:
            arg_8 = arg_6(arg_7)  # type: Operation
        except GoogleAPICallError as e:
            arg_0.log.error('An error occurred: %s. Exiting.', e.message)
            raise e

        if arg_8:
            arg_9 = arg_8.result()
            arg_0.log.info(arg_9)

Invokes a method on a given instance by applying a specified Callable .


def Func(arg_0, arg_1):
        """
        Send a MailChimp campaign. For RSS Campaigns, the campaign will Func
        according to its schedule. All other campaigns will Func immediately.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`
        """
        arg_0.campaign_id = arg_1
        return arg_0._mc_client._post(url=arg_0._build_path(arg_1, 'actions/Func'))

Send a MailChimp campaign. For RSS Campaigns, the campaign will send
        according to its schedule. All other campaigns will send immediately.

        :param campaign_id: The unique id for the campaign.
        :type campaign_id: :py:class:`str`

Send a MailChimp campaign . For RSS Campaigns the campaign will send according to its schedule . All other campaigns will send immediately .


async def Func(arg_0, arg_1, arg_2=None):
        """
        Send a message upstream to a de-multiplexed application.

        If stream_name is includes will send just to that upstream steam, if not included will send ot all upstream
        steams.
        """
        if arg_2 is None:
            for arg_3 in arg_0.application_streams.values():
                await arg_3.put(arg_1)
            return
        arg_3 = arg_0.application_streams.get(arg_2)
        if arg_3 is None:
            raise ValueError("Invalid multiplexed frame received (stream not mapped)")
        await arg_3.put(arg_1)

Send a message upstream to a de - multiplexed application .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , dict ) : return arg_0 . Func ( tuple ( sorted ( arg_1 . items ( ) ) ) ) elif isinstance ( arg_1 , ( list , tuple ) ) : return tuple ( map ( arg_0 . Func , arg_1 ) ) return arg_1

def Func(arg_0, arg_1):
    """Converts nested `tuple`, `list`, or `dict` to nested `tuple`."""
    if isinstance(arg_1, dict):
      return arg_0.Func(tuple(sorted(arg_1.items())))
    elif isinstance(arg_1, (list, tuple)):
      return tuple(map(arg_0.Func, arg_1))

    return arg_1

Converts nested tuple list or dict to nested tuple .


def Func(arg_0, arg_1=0, arg_2=None):  # TODO: support n
    """Slice substrings from each string element in a column.

    :param int start: The start position for the slice operation.
    :param int end: The stop position for the slice operation.
    :returns: an expression containing the sliced substrings.

    Example:

    >>> import vaex
    >>> text = ['Something', 'very pretty', 'is coming', 'our', 'way.']
    >>> df = vaex.from_arrays(text=text)
    >>> df
      #  text
      0  Something
      1  very pretty
      2  is coming
      3  our
      4  way.

    >>> df.text.str.slice(start=2, stop=5)
    Expression = str_pandas_slice(text, start=2, stop=5)
    Length: 5 dtype: str (expression)
    ---------------------------------
    0  met
    1   ry
    2   co
    3    r
    4   y.
    """
    if arg_2 is None:
        arg_3 = _to_string_sequence(arg_0).slice_string_end(arg_1)
    else:
        arg_3 = _to_string_sequence(arg_0).slice_string(arg_1, arg_2)
    return arg_3

Slice substrings from each string element in a column .


return [ v[i]/vmag  for i in range(len(v)) ]

def Func ( arg_0 ) : arg_1 = v_magnitude ( arg_0 ) return [ arg_0 [ arg_2 ] / arg_1 for arg_2 in range ( len ( arg_0 ) ) ]

def Func(arg_0):
    """
    Normalizes the given vector.

    The vector given may have any number of dimensions.
    """
    arg_1 = v_magnitude(arg_0)
    return [ arg_0[arg_2]/arg_1  for arg_2 in range(len(arg_0)) ]

Normalizes the given vector . The vector given may have any number of dimensions .


return (info1.dwVolumeSerialNumber == info2.dwVolumeSerialNumber and
            info1.nFileIndexHigh == info2.nFileIndexHigh and
            info1.nFileIndexLow == info2.nFileIndexLow)

def Func ( arg_0 , arg_1 ) : arg_2 = fs . getfileinfo ( arg_0 ) arg_3 = fs . getfileinfo ( arg_1 ) return ( arg_2 . dwVolumeSerialNumber == arg_3 . dwVolumeSerialNumber and arg_2 . nFileIndexHigh == arg_3 . nFileIndexHigh and arg_2 . nFileIndexLow == arg_3 . nFileIndexLow )

def Func(arg_0, arg_1):
    """
    Returns True if path1 and path2 refer to the same file.
    """
    # Check if both are on the same volume and have the same file ID
    arg_2 = fs.getfileinfo(arg_0)
    arg_3 = fs.getfileinfo(arg_1)
    return (arg_2.dwVolumeSerialNumber == arg_3.dwVolumeSerialNumber and
            arg_2.nFileIndexHigh == arg_3.nFileIndexHigh and
            arg_2.nFileIndexLow == arg_3.nFileIndexLow)

Returns True if path1 and path2 refer to the same file .


def Func ( arg_0 ) : arg_0 . add_config_value ( 'plot_gallery' , True , 'html' ) arg_0 . add_config_value ( 'abort_on_example_error' , False , 'html' ) arg_0 . add_config_value ( 'sphinx_gallery_conf' , gallery_conf , 'html' ) arg_0 . add_stylesheet ( 'gallery.css' ) arg_0 . connect ( 'builder-inited' , generate_gallery_rst ) arg_0 . connect ( 'build-finished' , embed_code_links )

def Func(arg_0):
    """Setup sphinx-gallery sphinx extension"""
    arg_0.add_config_value('plot_gallery', True, 'html')
    arg_0.add_config_value('abort_on_example_error', False, 'html')
    arg_0.add_config_value('sphinx_gallery_conf', gallery_conf, 'html')
    arg_0.add_stylesheet('gallery.css')

    arg_0.connect('builder-inited', generate_gallery_rst)

    arg_0.connect('build-finished', embed_code_links)


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
SUPYBOT_TIMESTAMP_REGEX
.
match
(
arg_1
)
if
not
arg_2
:
arg_3
=
"date expected on line %s"
%
(
str
(
arg_0
.
nline
)
)
raise
ParseError
(
cause
=
arg_3
)
arg_4
=
arg_2
.
group
(
'ts'
)
arg_3
=
arg_2
.
group
(
'msg'
)
return
arg_4
,
arg_3

def Func(arg_0, arg_1):
        """Parse timestamp section"""

        arg_2 = arg_0.SUPYBOT_TIMESTAMP_REGEX.match(arg_1)

        if not arg_2:
            arg_3 = "date expected on line %s" % (str(arg_0.nline))
            raise ParseError(cause=arg_3)

        arg_4 = arg_2.group('ts')
        arg_3 = arg_2.group('msg')

        return arg_4, arg_3


return types.FunctionType(
      code=fn.__code__, globals=fn.__globals__,
      name=fn.__name__, argdefs=fn.__defaults__,
      closure=fn.__closure__)

def
Func
(
arg_0
)
:
if
not
callable
(
arg_0
)
:
raise
TypeError
(
"fn is not callable: {}"
.
format
(
arg_0
)
)
return
types
.
FunctionType
(
code
=
arg_0
.
__code__
,
globals
=
arg_0
.
__globals__
,
name
=
arg_0
.
__name__
,
argdefs
=
arg_0
.
__defaults__
,
closure
=
arg_0
.
__closure__
)

def Func(arg_0):
  """Create a deep copy of fn.

  Args:
    fn: a callable

  Returns:
    A `FunctionType`: a deep copy of fn.

  Raises:
    TypeError: if `fn` is not a callable.
  """
  if not callable(arg_0):
    raise TypeError("fn is not callable: {}".format(arg_0))
  # The blessed way to copy a function. copy.deepcopy fails to create a
  # non-reference copy. Since:
  #   types.FunctionType == type(lambda: None),
  # and the docstring for the function type states:
  #
  #   function(code, globals[, name[, argdefs[, closure]]])
  #
  #   Create a function object from a code object and a dictionary.
  #   ...
  #
  # Here we can use this to create a new function with the old function's
  # code, globals, closure, etc.
  return types.FunctionType(
      code=arg_0.__code__, globals=arg_0.__globals__,
      name=arg_0.__name__, argdefs=arg_0.__defaults__,
      closure=arg_0.__closure__)


def
Func
(
arg_0
)
:
arg_1
=
load_config
(
arg_0
.
config
)
arg_2
=
get_blockade
(
arg_1
,
arg_0
)
if
arg_0
.
json
:
arg_3
=
arg_4
=
puts
if
arg_0
.
output
is
not
:
arg_3
=
open
(
arg_0
.
output
,
"w"
)
arg_4
=
arg_3
.
write
try
:
arg_5
=
""
arg_6
=
arg_2
.
get_audit
(
)
.
read_logs
(
as_json
=
False
)
arg_4
(
'{"events": ['
)
arg_4
(
os
.
linesep
)
for
arg_7
in
arg_6
:
arg_4
(
arg_5
+
arg_7
)
arg_5
=
","
+
os
.
linesep
arg_4
(
os
.
linesep
)
arg_4
(
']}'
)
finally
:
if
arg_0
.
output
is
not
:
arg_3
.
close
(
)
else
:
puts
(
colored
.
blue
(
columns
(
[
"EVENT"
,
10
]
,
[
"TARGET"
,
16
]
,
[
"STATUS"
,
8
]
,
[
"TIME"
,
16
]
,
[
"MESSAGE"
,
25
]
)
)
)
arg_6
=
arg_2
.
get_audit
(
)
.
read_logs
(
as_json
=
True
)
for
arg_7
in
arg_6
:
puts
(
columns
(
[
arg_7
[
'event'
]
,
10
]
,
[
str
(
[
str
(
arg_8
)
for
arg_8
in
arg_7
[
'targets'
]
]
)
,
16
]
,
[
arg_7
[
'status'
]
,
8
]
,
[
str
(
arg_7
[
'timestamp'
]
)
,
16
]
,
[
arg_7
[
'message'
]
,
25
]
)
)

def Func(arg_0):
    """Get the event log for a given blockade
    """
    arg_1 = load_config(arg_0.config)
    arg_2 = get_blockade(arg_1, arg_0)

    if arg_0.json:
        arg_3 = None
        arg_4 = puts
        if arg_0.output is not None:
            arg_3 = open(arg_0.output, "w")
            arg_4 = arg_3.write
        try:
            arg_5 = ""
            arg_6 = arg_2.get_audit().read_logs(as_json=False)
            arg_4('{"events": [')
            arg_4(os.linesep)
            for arg_7 in arg_6:
                arg_4(arg_5 + arg_7)
                arg_5 = "," + os.linesep
            arg_4(os.linesep)
            arg_4(']}')
        finally:
            if arg_0.output is not None:
                arg_3.close()
    else:
        puts(colored.blue(columns(["EVENT",         10],
                                  ["TARGET",        16],
                                  ["STATUS",         8],
                                  ["TIME",          16],
                                  ["MESSAGE",       25])))

        arg_6 = arg_2.get_audit().read_logs(as_json=True)
        for arg_7 in arg_6:
            puts(columns([arg_7['event'],                          10],
                         [str([str(arg_8) for arg_8 in arg_7['targets']]), 16],
                         [arg_7['status'],                          8],
                         [str(arg_7['timestamp']),                 16],
                         [arg_7['message'],                        25]))


(self, joint, other_body=None, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = None , ** arg_3 ) : arg_0 . world . join ( arg_1 , arg_0 , arg_2 , ** arg_3 )

def Func(arg_0, arg_1, arg_2=None, **arg_3):
        '''Connect this body to another one using a joint.

        This method creates a joint to fasten this body to the other one. See
        :func:`World.join`.

        Parameters
        ----------
        joint : str
            The type of joint to use when connecting these bodies.
        other_body : :class:`Body` or str, optional
            The other body to join with this one. If not given, connects this
            body to the world.
        '''
        arg_0.world.join(arg_1, arg_0, arg_2, **arg_3)

Connect this body to another one using a joint .


(self, format='html5', deparagraph=False, mathjax=False,
                        smart=True, extra_args=None)

def Func(arg_0, arg_1='html5', arg_2=False, arg_3=False,
                        arg_4=True, arg_5=None):
        """Get the document abstract in the specified markup format.

        Parameters
        ----------
        format : `str`, optional
            Output format (such as ``'html5'`` or ``'plain'``).
        deparagraph : `bool`, optional
            Remove the paragraph tags from single paragraph content.
        mathjax : `bool`, optional
            Allow pandoc to use MathJax math markup.
        smart : `True`, optional
            Allow pandoc to create "smart" unicode punctuation.
        extra_args : `list`, optional
            Additional command line flags to pass to Pandoc. See
            `lsstprojectmeta.pandoc.convert.convert_text`.

        Returns
        -------
        output_text : `str`
            Converted content or `None` if the title is not available in
            the document.
        """
        if arg_0.abstract is None:
            return None

        arg_6 = arg_0._prep_snippet_for_pandoc(arg_0.abstract)

        arg_7 = convert_lsstdoc_tex(
            arg_6, arg_1,
            arg_2=arg_2,
            arg_3=arg_3,
            arg_4=arg_4,
            arg_5=arg_5)
        return arg_7

Get the document abstract in the specified markup format .


return QuerysetReport(
        "Payments",
        ["invoice__id", "id", "reference", "amount"],
        payments,
        link_view=views.invoice,
    )

def Func ( ) : Func = commerce . PaymentBase . objects . all ( ) return QuerysetReport ( "Payments" , [ "invoice__id" , "id" , "reference" , "amount" ] , Func , link_view = views . invoice , )

def Func():
    ''' Shows the history of payments into the system '''

    Func = commerce.PaymentBase.objects.all()
    return QuerysetReport(
        "Payments",
        ["invoice__id", "id", "reference", "amount"],
        Func,
        link_view=views.invoice,
    )


return DataView(
            view_id=data_view_id,
            name=result["name"],
            description=result["description"],
            datasets=datasets_list,
            columns=columns_list,
        )

def Func ( arg_0 , arg_1 ) : arg_2 = routes . Func ( arg_1 ) arg_3 = arg_0 . _get ( arg_2 ) . json ( ) arg_4 = arg_3 [ "data" ] [ "data_view" ] arg_5 = [ ] for arg_6 in arg_4 [ "datasets" ] : arg_5 . append ( Dataset ( name = arg_6 [ "name" ] , id = arg_6 [ "id" ] , description = arg_6 [ "description" ] ) ) arg_7 = [ ] for arg_8 in arg_4 [ "columns" ] : arg_7 . append ( ColumnFactory . from_dict ( arg_8 ) ) return DataView ( view_id = arg_1 , name = arg_4 [ "name" ] , description = arg_4 [ "description" ] , datasets = arg_5 , columns = arg_7 , )

def Func(arg_0, arg_1):
        """
        Retrieves a summary of information for a given data view
            - view id
            - name
            - description
            - columns

        :param data_view_id: The ID number of the data view to which the
            run belongs, as a string
        :type data_view_id: str
        """

        arg_2 = routes.Func(arg_1)

        arg_3 = arg_0._get(arg_2).json()

        arg_4 = arg_3["data"]["data_view"]

        arg_5 = []
        for arg_6 in arg_4["datasets"]:
            arg_5.append(Dataset(
                name=arg_6["name"],
                id=arg_6["id"],
                description=arg_6["description"]
            ))

        arg_7 = []
        for arg_8 in arg_4["columns"]:
            arg_7.append(ColumnFactory.from_dict(arg_8))

        return DataView(
            view_id=arg_1,
            name=arg_4["name"],
            description=arg_4["description"],
            datasets=arg_5,
            columns=arg_7,
        )


Returns details of the posting schedules associated with a social media
      profile.

def Func ( arg_0 ) : arg_1 = PATHS [ 'GET_SCHEDULES' ] % arg_0 . id arg_0 . __Func = arg_0 . api . get ( arg_1 = arg_1 ) return arg_0 . __Func

def Func(arg_0):
    '''
      Returns details of the posting Func associated with a social media
      profile.
    '''

    arg_1 = PATHS['GET_SCHEDULES'] % arg_0.id

    arg_0.__Func = arg_0.api.get(arg_1=arg_1)

    return arg_0.__Func

Returns details of the posting schedules associated with a social media profile .


(tree_or_item, metadata=None, parent=None,
                   lucent_id=cnxepub.TRANSLUCENT_BINDER_ID)

def Func(arg_0, arg_1=None, arg_2=None,
                   arg_3=arg_4.TRANSLUCENT_BINDER_ID):
    """Given a tree, parse to a set of models"""
    if 'contents' in arg_0:
        # It is a binder.
        arg_6 = arg_0
        arg_7 = arg_4.TranslucentBinder(arg_1=arg_6)
        for arg_8 in arg_6['contents']:
            arg_9 = Func(arg_8, arg_2=arg_7,
                                  arg_3=arg_3)
            if arg_9.metadata['title'] != arg_8['title']:
                arg_7.set_title_for_node(arg_9, arg_8['title'])
        arg_10 = arg_7
    else:
        # It is an item pointing at a document.
        arg_8 = arg_0
        arg_10 = arg_4.DocumentPointer(arg_8['id'], arg_1=arg_8)
    if arg_2 is not None:
        arg_2.append(arg_10)
    return arg_10


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . group ( 1 ) if arg_0 . convertHTMLEntities and arg_2 in name2codepoint : return unichr ( name2codepoint [ arg_2 ] ) elif arg_2 in arg_0 . XML_ENTITIES_TO_SPECIAL_CHARS : if arg_0 . convertXMLEntities : return arg_0 . XML_ENTITIES_TO_SPECIAL_CHARS [ arg_2 ] else : return u'&%s;' % arg_2 elif len ( arg_2 ) > 0 and arg_2 [ 0 ] == '#' : if len ( arg_2 ) > 1 and arg_2 [ 1 ] == 'x' : return unichr ( int ( arg_2 [ 2 : ] , 16 ) ) else : return unichr ( int ( arg_2 [ 1 : ] ) ) elif arg_0 . escapeUnrecognizedEntities : return u'&%s;' % arg_2 else : return u'&%s;' % arg_2

def Func(arg_0, arg_1):
        """Used in a call to re.sub to replace HTML, XML, and numeric
        entities with the appropriate Unicode characters. If HTML
        entities are being converted, any unrecognized entities are
        escaped."""
        arg_2 = arg_1.group(1)
        if arg_0.convertHTMLEntities and arg_2 in name2codepoint:
            return unichr(name2codepoint[arg_2])
        elif arg_2 in arg_0.XML_ENTITIES_TO_SPECIAL_CHARS:
            if arg_0.convertXMLEntities:
                return arg_0.XML_ENTITIES_TO_SPECIAL_CHARS[arg_2]
            else:
                return u'&%s;' % arg_2
        elif len(arg_2) > 0 and arg_2[0] == '#':
            # Handle numeric entities
            if len(arg_2) > 1 and arg_2[1] == 'x':
                return unichr(int(arg_2[2:], 16))
            else:
                return unichr(int(arg_2[1:]))

        elif arg_0.escapeUnrecognizedEntities:
            return u'&%s;' % arg_2
        else:
            return u'&%s;' % arg_2

Used in a call to re . sub to replace HTML XML and numeric entities with the appropriate Unicode characters . If HTML entities are being converted any unrecognized entities are escaped .


def Func ( arg_0 , arg_1 = 10 , arg_2 = 10 ) : from web import Func arg_3 = Func . search ( arg_0 ) [ : arg_2 ] arg_4 = choice ( arg_3 ) . download ( thumbnail = True , wait = 10 ) return ColorList ( arg_4 , arg_1 , name = arg_0 )

def Func(arg_0, arg_1=10, arg_2=10):
    """
    Returns a list of colors drawn from a morgueFile image.

    With the Web library installed,
    downloads a thumbnail from morgueFile and retrieves pixel colors.
    """

    from web import Func
    arg_3 = Func.search(arg_0)[:arg_2]
    arg_4 = choice(arg_3).download(thumbnail=True, wait=10)

    return ColorList(arg_4, arg_1, name=arg_0)

Returns a list of colors drawn from a morgueFile image .


def Func(arg_0):
    """
    Convert an HSV color representation to an RGB color representation.

    (h, s, v) :: h -> [0, 360)
                 s -> [0, 1]
                 v -> [0, 1]

    :param hsv: A tuple of three numeric values corresponding to the hue, saturation, and value.
    :return: RGB representation of the input HSV value.
    :rtype: tuple
    """
    arg_1, arg_2, arg_3 = arg_0
    arg_4 = arg_3 * arg_2
    arg_1 /= 60
    arg_5 = arg_4 * (1 - abs((arg_1 % 2) - 1))
    arg_6 = arg_3 - arg_4

    if arg_1 < 1:
        arg_7 = (arg_4, arg_5, 0)
    elif arg_1 < 2:
        arg_7 = (arg_5, arg_4, 0)
    elif arg_1 < 3:
        arg_7 = (0, arg_4, arg_5)
    elif arg_1 < 4:
        arg_7 = (0, arg_5, arg_4)
    elif arg_1 < 5:
        arg_7 = (arg_5, 0, arg_4)
    elif arg_1 < 6:
        arg_7 = (arg_4, 0, arg_5)
    else:
        raise ColorException("Unable to convert from HSV to RGB")

    arg_8, arg_9, arg_10 = arg_7
    return round((arg_8 + arg_6)*255, 3), round((arg_9 + arg_6)*255, 3), round((arg_10 + arg_6)*255, 3)

Convert an HSV color representation to an RGB color representation .


(lclist,
                        sortby='rjd',
                        normalize=True)

def Func(arg_0,
                        arg_1='rjd',
                        arg_2=True):
    '''This concatenates a list of light curves.

    Does not care about overlaps or duplicates. The light curves must all be
    from the same aperture.

    The intended use is to concatenate light curves across CCDs or instrument
    changes for a single object. These can then be normalized later using
    standard astrobase tools to search for variablity and/or periodicity.

    sortby is a column to sort the final concatenated light curve by in
    ascending order.

    If normalize is True, then each light curve's magnitude columns are
    normalized to zero.

    The returned lcdict has an extra column: 'lcn' that tracks which measurement
    belongs to which input light curve. This can be used with
    lcdict['concatenated'] which relates input light curve index to input light
    curve filepath. Finally, there is an 'nconcatenated' key in the lcdict that
    contains the total number of concatenated light curves.

    '''

    # read the first light curve
    arg_3 = read_hatpi_textlc(arg_0[0])

    # track which LC goes where
    # initial LC
    arg_4 = 0
    arg_3['concatenated'] = {arg_4: os.path.abspath(arg_0[0])}
    arg_3['lcn'] = np.full_like(arg_3['rjd'], arg_4)

    # normalize if needed
    if arg_2:

        for arg_5 in MAGCOLS:

            if arg_5 in arg_3:
                arg_6 = np.nanmedian(arg_3[arg_5])

                # handle fluxes
                if arg_5 in ('ifl1','ifl2','ifl3'):
                    arg_3[arg_5] = arg_3[arg_5] / arg_6
                # handle mags
                else:
                    arg_3[arg_5] = arg_3[arg_5] - arg_6

    # now read the rest
    for arg_7 in arg_0[1:]:

        arg_8 = read_hatpi_textlc(arg_7)

        # if the columns don't agree, skip this LC
        if arg_8['columns'] != arg_3['columns']:
            LOGERROR('file %s does not have the '
                     'same columns as first file %s, skipping...'
                     % (arg_7, arg_0[0]))
            continue

        # otherwise, go ahead and start concatenatin'
        else:

            LOGINFO('adding %s (ndet: %s) to %s (ndet: %s)'
                    % (arg_7,
                       arg_8['objectinfo']['ndet'],
                       arg_0[0],
                       arg_3[arg_3['columns'][0]].size))

            # update LC tracking
            arg_4 = arg_4 + 1
            arg_3['concatenated'][arg_4] = os.path.abspath(arg_7)
            arg_3['lcn'] = np.concatenate((
                arg_3['lcn'],
                np.full_like(arg_8['rjd'],arg_4)
            ))

            # concatenate the columns
            for arg_5 in arg_3['columns']:

                # handle normalization for magnitude columns
                if arg_2 and arg_5 in MAGCOLS:

                    arg_6 = np.nanmedian(arg_8[arg_5])

                    # handle fluxes
                    if arg_5 in ('ifl1','ifl2','ifl3'):
                        arg_8[arg_5] = arg_8[arg_5] / arg_6
                    # handle mags
                    else:
                        arg_8[arg_5] = arg_8[arg_5] - arg_6

                # concatenate the values
                arg_3[arg_5] = np.concatenate((arg_3[arg_5], arg_8[arg_5]))

    #
    # now we're all done concatenatin'
    #

    # make sure to add up the ndet
    arg_3['objectinfo']['ndet'] = arg_3[arg_3['columns'][0]].size

    # update the stations
    arg_3['objectinfo']['stations'] = [
        'HP%s' % arg_9 for arg_9 in np.unique(arg_3['stf']).tolist()
    ]

    # update the total LC count
    arg_3['nconcatenated'] = arg_4 + 1

    # if we're supposed to sort by a column, do so
    if arg_1 and arg_1 in [arg_9[0] for arg_9 in COLDEFS]:

        LOGINFO('sorting concatenated light curve by %s...' % arg_1)
        arg_10 = np.argsort(arg_3[arg_1])

        # sort all the measurement columns by this index
        for arg_5 in arg_3['columns']:
            arg_3[arg_5] = arg_3[arg_5][arg_10]

        # make sure to sort the lcn index as well
        arg_3['lcn'] = arg_3['lcn'][arg_10]

    LOGINFO('done. concatenated light curve has %s detections' %
            arg_3['objectinfo']['ndet'])
    return arg_3

This concatenates a list of light curves .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_0
.
_build_mutect_dict
(
arg_1
.
metaheaders
)
arg_3
=
[
]
arg_4
=
set
(
[
arg_0
.
_NORMAL_SAMPLE_KEY
,
arg_0
.
_TUMOR_SAMPLE_KEY
]
)
arg_5
=
set
(
arg_2
.
keys
(
)
)
if
not
arg_4
.
issubset
(
arg_5
)
:
raise
utils
.
JQException
(
"Unable to determine normal "
"and tumor sample ordering "
"based on MuTect metaheader."
)
for
arg_6
in
arg_1
.
column_header
.
split
(
"\t"
)
:
if
arg_6
==
arg_2
[
arg_0
.
_NORMAL_SAMPLE_KEY
]
:
arg_6
=
"NORMAL"
elif
arg_6
==
arg_2
[
arg_0
.
_TUMOR_SAMPLE_KEY
]
:
arg_6
=
"TUMOR"
arg_3
.
append
(
arg_6
)
return
"\t"
.
join
(
arg_3
)

def Func(arg_0, arg_1):
        """Returns a standardized column header.

        MuTect sample headers include the name of input alignment, which is
        nice, but doesn't match up with the sample names reported in Strelka
        or VarScan. To fix this, we replace with NORMAL and TUMOR using the
        MuTect metadata command line to replace them correctly."""
        arg_2 = arg_0._build_mutect_dict(arg_1.metaheaders)

        arg_3 = []
        arg_4 = set([arg_0._NORMAL_SAMPLE_KEY, arg_0._TUMOR_SAMPLE_KEY])
        arg_5 = set(arg_2.keys())

        if not arg_4.issubset(arg_5):
            raise utils.JQException("Unable to determine normal "
                                    "and tumor sample ordering "
                                    "based on MuTect metaheader.")

        for arg_6 in arg_1.column_header.split("\t"):
            if arg_6 == arg_2[arg_0._NORMAL_SAMPLE_KEY]:
                arg_6 = "NORMAL"
            elif arg_6 == arg_2[arg_0._TUMOR_SAMPLE_KEY]:
                arg_6 = "TUMOR"
            arg_3.append(arg_6)

        return "\t".join(arg_3)


def Func ( arg_0 , arg_1 , arg_2 = None ) : if isinstance ( arg_1 , ( list , tuple ) ) : return [ BusinessDate . Func ( arg_0 , arg_3 ) for arg_3 in arg_1 ] elif isinstance ( arg_1 , str ) : arg_4 = BusinessPeriod ( arg_1 ) else : arg_4 = arg_1 arg_5 = arg_0 arg_5 = BusinessDate . add_months ( arg_5 , arg_4 . months ) arg_5 = BusinessDate . add_years ( arg_5 , arg_4 . years ) arg_5 = BusinessDate . add_days ( arg_5 , arg_4 . days ) if arg_4 . businessdays : if arg_2 : arg_5 = BusinessDate . add_business_days ( arg_5 , arg_4 . businessdays , arg_2 ) else : arg_5 = BusinessDate . add_business_days ( arg_5 , arg_4 . businessdays , arg_4 . holiday ) return arg_5

def Func(arg_0, arg_1, arg_2=None):
        """
        addition of a period object

        :param BusinessDate d:
        :param p:
        :type p: BusinessPeriod or str
        :param list holiday_obj:
        :return bankdate:
        """

        if isinstance(arg_1, (list, tuple)):
            return [BusinessDate.Func(arg_0, arg_3) for arg_3 in arg_1]
        elif isinstance(arg_1, str):
            arg_4 = BusinessPeriod(arg_1)
        else:
            arg_4 = arg_1

        arg_5 = arg_0
        arg_5 = BusinessDate.add_months(arg_5, arg_4.months)
        arg_5 = BusinessDate.add_years(arg_5, arg_4.years)
        arg_5 = BusinessDate.add_days(arg_5, arg_4.days)

        if arg_4.businessdays:
            if arg_2:
                arg_5 = BusinessDate.add_business_days(arg_5, arg_4.businessdays, arg_2)
            else:
                arg_5 = BusinessDate.add_business_days(arg_5, arg_4.businessdays, arg_4.holiday)

        return arg_5


def
Func
(
arg_0
)
:
arg_1
=
safe_path
(
os
.
path
.
expanduser
(
os
.
path
.
join
(
'~'
,
'.{0}'
.
format
(
__script__
)
)
)
)
if
not
os
.
path
.
isdir
(
arg_1
)
:
os
.
mkdir
(
arg_1
)
arg_2
=
os
.
path
.
join
(
arg_1
,
'{0}.log'
.
format
(
__script__
)
)
with
open
(
arg_2
,
'a+'
)
as
handler
:
traceback
.
print_exc
(
file
=
handler
)
arg_3
=
(
'User aborted workflow'
if
isinstance
(
arg_0
,
KeyboardInterrupt
)
else
'Unexpected error catched'
)
print_error
(
arg_3
)
print_error
(
'Full log stored to {0}'
.
format
(
arg_2
)
,
False
)
return
True

def Func(arg_0):
    """Save error traceback to bootstrapper log file.

    :param err: Catched exception.
    """
    # Store logs to ~/.bootstrapper directory
    arg_1 = safe_path(os.path.expanduser(
        os.path.join('~', '.{0}'.format(__script__))
    ))

    # But ensure that directory exists
    if not os.path.isdir(arg_1):
        os.mkdir(arg_1)

    # Now we ready to put traceback to log file
    arg_2 = os.path.join(arg_1, '{0}.log'.format(__script__))

    with open(arg_2, 'a+') as handler:
        traceback.print_exc(file=handler)

    # And show colorized message
    arg_3 = ('User aborted workflow'
               if isinstance(arg_0, KeyboardInterrupt)
               else 'Unexpected error catched')
    print_error(arg_3)
    print_error('Full log stored to {0}'.format(arg_2), False)

    return True

Save error traceback to bootstrapper log file .


A generic wrapper around Django's manage command.

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        A generic wrapper around Django's Func command.
        """
        arg_4 = arg_0.local_renderer
        arg_5 = arg_3.pop('environs', '').strip()
        if arg_5:
            arg_5 = ' '.join('export %s=%s;' % tuple(_.split('=')) for _ in arg_5.split(','))
            arg_5 = ' ' + arg_5 + ' '
        arg_4.env.cmd = arg_1
        arg_4.env.SITE = arg_4.genv.SITE or arg_4.genv.default_site
        arg_4.env.args = ' '.join(map(str, arg_2))
        arg_4.env.kwargs = ' '.join(
            ('--%s' % _k if _v in (True, 'True') else '--%s=%s' % (_k, _v))
            for _k, _v in arg_3.items())
        arg_4.env.environs = arg_5
        if arg_0.is_local:
            arg_4.env.project_dir = arg_4.env.local_project_dir
        arg_4.run_or_local('export SITE={SITE}; export ROLE={ROLE};{environs} cd {project_dir}; {Func_cmd} {cmd} {args} {kwargs}')

A generic wrapper around Django s manage command .


def
Func
(
arg_0
)
:
try
:
return
_bls_runner
(
*
arg_0
)
except
Exception
as
e
:
LOGEXCEPTION
(
'BLS failed for task %s'
%
repr
(
arg_0
[
2
:
]
)
)
return
{
'power'
:
nparray
(
[
npnan
for
arg_1
in
range
(
arg_0
[
2
]
)
]
)
,
'bestperiod'
:
npnan
,
'bestpower'
:
npnan
,
'transdepth'
:
npnan
,
'transduration'
:
npnan
,
'transingressbin'
:
npnan
,
'transegressbin'
:
npnan
}

def Func(arg_0):
    '''
    This wraps the BLS function for the parallel driver below.

    Parameters
    ----------

    tasks : tuple
        This is of the form::

            task[0] = times
            task[1] = mags
            task[2] = nfreq
            task[3] = freqmin
            task[4] = stepsize
            task[5] = nbins
            task[6] = minduration
            task[7] = maxduration

    Returns
    -------

    dict
        Returns a dict of the form::

            {
                'power':           the periodogram power array,
                'bestperiod':      the best period found,
                'bestpower':       the highest peak of the periodogram power,
                'transdepth':      transit depth found by eebls.f,
                'transduration':   transit duration found by eebls.f,
                'transingressbin': transit ingress bin found by eebls.f,
                'transegressbin':  transit egress bin found by eebls.f,
            }

    '''

    try:

        return _bls_runner(*arg_0)

    except Exception as e:

        LOGEXCEPTION('BLS failed for task %s' % repr(arg_0[2:]))

        return {
            'power':nparray([npnan for arg_1 in range(arg_0[2])]),
            'bestperiod':npnan,
            'bestpower':npnan,
            'transdepth':npnan,
            'transduration':npnan,
            'transingressbin':npnan,
            'transegressbin':npnan
        }

This wraps the BLS function for the parallel driver below .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
arg_4
=
etypes
[
arg_1
]
[
'fmt'
]
if
isinstance
(
arg_2
,
Sequence
)
:
if
arg_4
==
's'
or
arg_3
:
if
isinstance
(
arg_2
,
bytes
)
:
if
arg_3
and
len
(
arg_2
)
>
31
:
raise
ValueError
(
'Name "{}" is too long (max. 31 '
'characters allowed)'
.
format
(
arg_2
)
)
arg_4
=
'{}s'
.
format
(
len
(
arg_2
)
)
arg_2
=
(
arg_2
,
)
else
:
arg_4
=
''
.
join
(
'{}s'
.
format
(
len
(
s
)
)
for
s
in
arg_2
)
else
:
arg_5
=
len
(
arg_2
)
if
arg_5
==
0
:
arg_4
=
''
if
arg_5
>
1
:
arg_4
=
'{}{}'
.
format
(
arg_5
,
arg_4
)
else
:
arg_2
=
(
arg_2
,
)
arg_6
=
struct
.
calcsize
(
arg_4
)
if
arg_6
<=
4
:
if
arg_6
<
4
:
arg_4
+=
'{}x'
.
format
(
4
arg_6
)
arg_0
.
write
(
struct
.
pack
(
'hh'
+
arg_4
,
etypes
[
arg_1
]
[
'n'
]
,
*
chain
(
[
arg_6
]
,
arg_2
)
)
)
return
arg_0
.
write
(
struct
.
pack
(
'b3xI'
,
etypes
[
arg_1
]
[
'n'
]
,
arg_6
)
)
arg_7
=
arg_6
%
8
if
arg_7
:
arg_4
+=
'{}x'
.
format
(
8
arg_7
)
arg_0
.
write
(
struct
.
pack
(
arg_4
,
*
arg_2
)
)

def Func(arg_0, arg_1, arg_2, arg_3=False):
    """Write data element tag and data.

    The tag contains the array type and the number of
    bytes the array data will occupy when written to file.

    If data occupies 4 bytes or less, it is written immediately
    as a Small Data Element (SDE).
    """
    arg_4 = etypes[arg_1]['fmt']
    if isinstance(arg_2, Sequence):
        if arg_4 == 's' or arg_3:
            if isinstance(arg_2, bytes):
                if arg_3 and len(arg_2) > 31:
                    raise ValueError(
                        'Name "{}" is too long (max. 31 '
                        'characters allowed)'.format(arg_2))
                arg_4 = '{}s'.format(len(arg_2))
                arg_2 = (arg_2,)
            else:
                arg_4 = ''.join('{}s'.format(len(s)) for s in arg_2)
        else:
            arg_5 = len(arg_2)
            if arg_5 == 0:
                # empty array
                arg_4 = ''
            if arg_5 > 1:
                # more than one element to be written
                arg_4 = '{}{}'.format(arg_5, arg_4)
    else:
        arg_2 = (arg_2,)
    arg_6 = struct.calcsize(arg_4)
    if arg_6 <= 4:
        # write SDE
        if arg_6 < 4:
            # add pad bytes
            arg_4 += '{}x'.format(4 - arg_6)
        arg_0.write(struct.pack('hh' + arg_4, etypes[arg_1]['n'],
                 *chain([arg_6], arg_2)))
        return
    # write tag: element type and number of bytes
    arg_0.write(struct.pack('b3xI', etypes[arg_1]['n'], arg_6))
    # add pad bytes to fmt, if needed
    arg_7 = arg_6 % 8
    if arg_7:
        arg_4 += '{}x'.format(8 - arg_7)
    # write data
    arg_0.write(struct.pack(arg_4, *arg_2))


return [self.user_ns, self.user_global_ns,
                self._user_main_module.__dict__] + self._main_ns_cache.values()

def Func ( arg_0 ) : return [ arg_0 . user_ns , arg_0 . user_global_ns , arg_0 . _user_main_module . __dict__ ] + arg_0 . _main_ns_cache . values ( )

def Func(arg_0):
        """Get a list of references to all the namespace dictionaries in which
        IPython might store a user-created object.

        Note that this does not include the displayhook, which also caches
        objects from the output."""
        return [arg_0.user_ns, arg_0.user_global_ns,
                arg_0._user_main_module.__dict__] + arg_0._main_ns_cache.values()

Get a list of references to all the namespace dictionaries in which IPython might store a user - created object . Note that this does not include the displayhook which also caches objects from the output .


def Func ( arg_0 ) : arg_1 = { } @ wraps ( arg_0 ) def inner ( arg_2 ) : if arg_2 not in arg_1 : arg_1 [ arg_2 ] = arg_0 ( arg_2 ) return arg_1 [ arg_2 ] return inner

def Func(arg_0):
    """Cache result of function call."""
    arg_1 = {}

    @wraps(arg_0)
    def inner(arg_2):
        if arg_2 not in arg_1:
            arg_1[arg_2] = arg_0(arg_2)
        return arg_1[arg_2]
    return inner


def Func ( arg_0 , * arg_1 : arg_2 [ arg_3 ] ) -> int : return arg_0 . timeslots . Func ( * arg_1 )

def Func(arg_0, *arg_1: arg_2[arg_3]) -> int:
        """Return maximum start time for supplied channels.

        Args:
            *channels: Supplied channels
        """
        return arg_0.timeslots.Func(*arg_1)

Return maximum start time for supplied channels .


def Func ( arg_0 , arg_1 = None , arg_2 = 1 ) : if arg_1 is not None : arg_3 = arg_0 . _perform_request ( '/um/resources/%s?depth=%s' % ( arg_1 , str ( arg_2 ) ) ) else : arg_3 = arg_0 . _perform_request ( '/um/resources?depth=' + str ( arg_2 ) ) return arg_3

def Func(arg_0, arg_1=None, arg_2=1):
        """
        Retrieves a list of all resources.

        :param      resource_type: The resource type: datacenter, image,
                                   snapshot or ipblock. Default is None,
                                   i.e., all resources are listed.
        :type       resource_type: ``str``

        :param      depth: The depth of the response data.
        :type       depth: ``int``

        """
        if arg_1 is not None:
            arg_3 = arg_0._perform_request(
                '/um/resources/%s?depth=%s' % (arg_1, str(arg_2)))
        else:
            arg_3 = arg_0._perform_request(
                '/um/resources?depth=' + str(arg_2))

        return arg_3


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
int
(
arg_1
[
"s"
]
)
arg_0
.
pen
.
font
=
"%s %d"
%
(
arg_1
[
"b"
]
,
arg_2
)
return
[
]

def Func(arg_0, arg_1):
        """ Sets the font. """

        arg_2 = int(arg_1["s"])
        arg_0.pen.font = "%s %d" % (arg_1["b"], arg_2)
        return []


def Func ( arg_0 ) : for arg_1 in arg_0 . images : arg_2 = arg_0 . session . _add_object ( ) arg_1 . _set_number ( arg_2 . id ) arg_1 . _output ( )

def Func(arg_0):
        """ Creates reference images, that can be
            drawn throughout the document."""
        for arg_1 in arg_0.images:
            arg_2 = arg_0.session._add_object()
            arg_1._set_number(arg_2.id)
            arg_1._output()

Creates reference images that can be drawn throughout the document .


def Func ( arg_0 , arg_1 ) : from os import path import sys try : arg_2 = sys . _MEIPASS except Exception : arg_2 = path . dirname ( path . abspath ( __file__ ) ) return path . join ( arg_2 , arg_1 )

def Func(arg_0, arg_1):
        """ Get absolute path to resource, works for dev and for PyInstaller """
        from os import path
        import sys

        try:
            # PyInstaller creates a temp folder and stores path in _MEIPASS
            arg_2 = sys._MEIPASS
        except Exception:
            arg_2 = path.dirname(path.abspath(__file__))
        return path.join(arg_2, arg_1)

Get absolute path to resource works for dev and for PyInstaller


def Func(arg_0=arg_1.argv):
    arg_2 = parse(arg_0)
    """Serve up some ponies."""
    arg_3 = arg_2.listen
    arg_4 = arg_2.port
    print(
        "Making all your dreams for a pony come true on http://{0}:{1}.\n"
        "Press Ctrl+C to quit.\n".format(arg_3, arg_4))

    # Hush, werkzeug.
    logging.getLogger('werkzeug').setLevel(logging.CRITICAL)

    plugin_manager.load_installed_plugins()
    arg_5 = make_app()
    run_simple(arg_3, arg_4, arg_5)


(self, section, option, remove_default=True)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = True ) : if super ( ) . has_option ( arg_1 , arg_2 ) : super ( ) . Func ( arg_1 , arg_2 ) if arg_0 . airflow_defaults . has_option ( arg_1 , arg_2 ) and arg_3 : arg_0 . airflow_defaults . Func ( arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2, arg_3=True):
        """
        Remove an option if it exists in config from a file or
        default config. If both of config have the same option, this removes
        the option in both configs unless remove_default=False.
        """
        if super().has_option(arg_1, arg_2):
            super().Func(arg_1, arg_2)

        if arg_0.airflow_defaults.has_option(arg_1, arg_2) and arg_3:
            arg_0.airflow_defaults.Func(arg_1, arg_2)

Remove an option if it exists in config from a file or default config . If both of config have the same option this removes the option in both configs unless remove_default = False .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_2 . get ( PATTERNS , [ ] ) for arg_4 in arg_3 : arg_5 = arg_0 . _pattern ( arg_4 ) arg_1 . append ( arg_5 )

def Func(arg_0, arg_1, arg_2):
        """Fill a pattern collection."""
        arg_3 = arg_2.get(PATTERNS, [])
        for arg_4 in arg_3:
            arg_5 = arg_0._pattern(arg_4)
            arg_1.append(arg_5)


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . _clone ( ) arg_3 . _qsl = [ qb for qb in arg_0 . _qsl if qb != ( arg_1 , str ( arg_2 ) ) ] return arg_3

def Func(arg_0, arg_1, arg_2):
        """ Remove a value from multiple value parameter. """
        arg_3 = arg_0._clone()
        arg_3._qsl = [qb for qb in arg_0._qsl if qb != (arg_1, str(arg_2))]
        return arg_3

Remove a value from multiple value parameter .


def Func ( arg_0 ) : for arg_1 in arg_0 : if isinstance ( arg_1 , set ) : arg_1 = list ( arg_1 ) if isinstance ( arg_1 , list ) : if not Func ( arg_1 ) : return False elif not isinstance ( arg_1 , ( int , float , complex ) ) : return False return True

def Func(arg_0):
    """Test if a list contains simple numeric data."""
    for arg_1 in arg_0:
        if isinstance(arg_1, set):
            arg_1 = list(arg_1)
        if isinstance(arg_1, list):
            if not Func(arg_1):
                return False
        elif not isinstance(arg_1, (int, float, complex)):
            return False
    return True

Test if a list contains simple numeric data .


def Func ( arg_0 , arg_1 ) : Func = deepcopy ( arg_0 ) arg_0 [ arg_1 ] = Func return Func

def Func(arg_0,arg_1):
        '''
        Create fork and store it in current instance
        '''
        Func=deepcopy(arg_0)
        arg_0[arg_1]=Func
        return Func


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
", "
arg_3
=
[
]
for
arg_4
,
arg_5
in
sorted
(
arg_1
.
items
(
)
,
key
=
lambda
arg_5
:
arg_0
.
stream_weight
(
arg_5
[
0
]
)
)
:
if
arg_4
in
STREAM_SYNONYMS
:
continue
def
synonymfilter
(
arg_6
)
:
return
arg_5
is
arg_1
[
arg_6
]
and
arg_6
is
not
arg_4
arg_7
=
list
(
filter
(
synonymfilter
,
arg_1
.
keys
(
)
)
)
if
len
(
arg_7
)
>
0
:
arg_8
=
arg_2
.
join
(
arg_7
)
arg_4
=
"{0} ({1})"
.
format
(
arg_4
,
arg_8
)
arg_3
.
append
(
arg_4
)
return
arg_2
.
join
(
arg_3
)

def Func(arg_0, arg_1):
    """Formats a dict of streams.

    Filters out synonyms and displays them next to
    the stream they point to.

    Streams are sorted according to their quality
    (based on plugin.stream_weight).

    """

    arg_2 = ", "
    arg_3 = []

    for arg_4, arg_5 in sorted(arg_1.items(),
                               key=lambda arg_5: arg_0.stream_weight(arg_5[0])):
        if arg_4 in STREAM_SYNONYMS:
            continue

        def synonymfilter(arg_6):
            return arg_5 is arg_1[arg_6] and arg_6 is not arg_4

        arg_7 = list(filter(synonymfilter, arg_1.keys()))

        if len(arg_7) > 0:
            arg_8 = arg_2.join(arg_7)
            arg_4 = "{0} ({1})".format(arg_4, arg_8)

        arg_3.append(arg_4)

    return arg_2.join(arg_3)