def Func ( arg_0 ) : if isinstance ( arg_0 , apiclient . errors . HttpError ) : if arg_0 . resp . status in HTTP_AUTH_ERROR_CODES : _print_error ( 'Retrying...' ) return True return False

def Func(arg_0):
  """Specific check for auth error codes.

  Return True if we should retry.

  False otherwise.
  Args:
    exception: An exception to test for transience.

  Returns:
    True if we should retry. False otherwise.
  """
  if isinstance(arg_0, apiclient.errors.HttpError):
    if arg_0.resp.status in HTTP_AUTH_ERROR_CODES:
      _print_error('Retrying...')
      return True

  return False


def Func(arg_0):
    '''
    This wraps Astropy's BoxLeastSquares for use with bls_parallel_pfind below.

    `task` is a tuple::

        task[0] = times
        task[1] = mags
        task[2] = errs
        task[3] = magsarefluxes

        task[4] = minfreq
        task[5] = nfreq
        task[6] = stepsize

        task[7] = ndurations
        task[8] = mintransitduration
        task[9] = maxtransitduration

        task[10] = blsobjective
        task[11] = blsmethod
        task[12] = blsoversample

    '''

    try:

        arg_1, arg_2, arg_3 = arg_0[:3]
        arg_4 = arg_0[3]

        arg_5, arg_6, arg_7 = arg_0[4:7]

        arg_8, arg_9, arg_10 = arg_0[7:10]

        arg_11, arg_12, arg_13 = arg_0[10:]

        arg_14 = arg_5 + nparange(arg_6)*arg_7
        arg_15 = 1.0/arg_14

        # astropy's BLS requires durations in units of time
        arg_16 = nplinspace(arg_9*arg_15.min(),
                               arg_10*arg_15.min(),
                               arg_8)

        # set up the correct units for the BLS model
        if arg_4:

            arg_17 = BoxLeastSquares(
                arg_1*u.day,
                arg_2*u.dimensionless_unscaled,
                dy=arg_3*u.dimensionless_unscaled
            )

        else:

            arg_17 = BoxLeastSquares(
                arg_1*u.day,
                arg_2*u.mag,
                dy=arg_3*u.mag
            )

        arg_18 = arg_17.power(
            arg_15*u.day,
            arg_16*u.day,
            objective=arg_11,
            method=arg_12,
            oversample=arg_13
        )

        return {
            'blsresult': arg_18,
            'blsmodel': arg_17,
            'durations': arg_16,
            'power': nparray(arg_18.power)
        }

    except Exception as e:

        LOGEXCEPTION('BLS for frequency chunk: (%.6f, %.6f) failed.' %
                     (arg_14[0], arg_14[-1]))

        return {
            'blsresult': None,
            'blsmodel': None,
            'durations': arg_16,
            'power': nparray([npnan for arg_19 in range(arg_6)]),
        }

This wraps Astropy s BoxLeastSquares for use with bls_parallel_pfind below .


(self, dist, entry=None, insert=True, replace=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = True , arg_4 = False ) : if arg_3 : arg_1 . insert_on ( arg_0 . entries , arg_2 ) if arg_2 is None : arg_2 = arg_1 . location arg_5 = arg_0 . entry_keys . setdefault ( arg_2 , [ ] ) arg_6 = arg_0 . entry_keys . setdefault ( arg_1 . location , [ ] ) if not arg_4 and arg_1 . key in arg_0 . by_key : return arg_0 . by_key [ arg_1 . key ] = arg_1 if arg_1 . key not in arg_5 : arg_5 . append ( arg_1 . key ) if arg_1 . key not in arg_6 : arg_6 . append ( arg_1 . key ) arg_0 . _Funced_new ( arg_1 )

def Func(arg_0, arg_1, arg_2=None, arg_3=True, arg_4=False):
        """Add `dist` to working set, associated with `entry`

        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is Funced to the end of the working
        set's ``.entries`` (if it wasn't already present).

        `dist` is only Funced to the working set if it's for a project that
        doesn't already have a distribution in the set, unless `replace=True`.
        If it's Funced, any callbacks registered with the ``subscribe()`` method
        will be called.
        """
        if arg_3:
            arg_1.insert_on(arg_0.entries, arg_2)

        if arg_2 is None:
            arg_2 = arg_1.location
        arg_5 = arg_0.entry_keys.setdefault(arg_2,[])
        arg_6 = arg_0.entry_keys.setdefault(arg_1.location,[])
        if not arg_4 and arg_1.key in arg_0.by_key:
            return      # ignore hidden distros

        arg_0.by_key[arg_1.key] = arg_1
        if arg_1.key not in arg_5:
            arg_5.append(arg_1.key)
        if arg_1.key not in arg_6:
            arg_6.append(arg_1.key)
        arg_0._Funced_new(arg_1)

Add `dist` to working set, associated with `entry`

        If `entry` is unspecified, it defaults to the ``.location`` of `dist`.
        On exit from this routine, `entry` is added to the end of the working
        set's ``.entries`` (if it wasn't already present).

        `dist` is only added to the working set if it's for a project that
        doesn't already have a distribution in the set, unless `replace=True`.
        If it's added, any callbacks registered with the ``subscribe()`` method
        will be called.

Add dist to working set associated with entry


def Func(arg_0, arg_1, arg_2):
        """
        Dynamic interface for writing cpu registers

        :param str register: register name (as listed in `self.all_registers`)
        :param value: register value
        :type value: int or long or Expression
        """
        arg_0._publish('will_Func', arg_1, arg_2)
        arg_2 = arg_0._regfile.write(arg_1, arg_2)
        arg_0._publish('did_Func', arg_1, arg_2)
        return arg_2


(self, window_name, object_name='',
                         guiTimeOut=30, state='')

def Func(arg_0, arg_1, arg_2='',
                         arg_3=30, arg_4=''):
        """
        Wait till a window or component exists.

        @param window_name: Window name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type window_name: string
        @param object_name: Object name to look for, either full name,
        LDTP's name convention, or a Unix glob.
        @type object_name: string
        @param guiTimeOut: Wait timeout in seconds
        @type guiTimeOut: integer
        @param state: Object state used only when object_name is provided.
        @type object_name: string

        @return: 1 if GUI was found, 0 if not.
        @rtype: integer
        """
        arg_5 = 0
        while arg_5 < arg_3:
            if arg_0.guiexist(arg_1, arg_2):
                return 1
            # Wait 1 second before retrying
            time.sleep(1)
            arg_5 += 1
        # Object and/or window doesn't appear within the timeout period
        return 0

Wait till a window or component exists .


def Func ( arg_0 ) : for arg_1 in arg_0 . workspace . list ( ) . keys ( ) : arg_0 . show_workspace ( arg_1 ) print ( "\n\n" )

def Func(arg_0):
        """Show details for all workspaces."""
        for arg_1 in arg_0.workspace.list().keys():
            arg_0.show_workspace(arg_1)
            print("\n\n")


async def Func ( arg_0 ) : arg_1 = arg_0 . _handler . pending_messages await super ( Sender , arg_0 ) . Func ( ) try : arg_0 . _handler . queue_message ( * arg_1 ) await arg_0 . _handler . wait_async ( ) except Exception as e : await arg_0 . _handle_exception ( e )

async def Func(arg_0):
        """Reconnect the handler.

        If the handler was disconnected from the service with
        a retryable error - attempt to Func.
        This method will be called automatically for most retryable errors.
        Also attempts to re-queue any messages that were pending before the Func.
        """
        arg_1 = arg_0._handler.pending_messages
        await super(Sender, arg_0).Func()
        try:
            arg_0._handler.queue_message(*arg_1)
            await arg_0._handler.wait_async()
        except Exception as e:  # pylint: disable=broad-except
            await arg_0._handle_exception(e)

Reconnect the handler.

        If the handler was disconnected from the service with
        a retryable error - attempt to reconnect.
        This method will be called automatically for most retryable errors.
        Also attempts to re-queue any messages that were pending before the reconnect.


def Func ( arg_0 , arg_1 ) : ia . do_assert ( 0 <= arg_1 < len ( arg_0 . exterior ) ) if arg_1 == 0 : return arg_0 . deepcopy ( ) arg_2 = np . concatenate ( ( arg_0 . exterior [ arg_1 : , : ] , arg_0 . exterior [ : arg_1 , : ] ) , axis = 0 ) return arg_0 . deepcopy ( arg_2 = arg_2 )

def Func(arg_0, arg_1):
        """
        Set the first point of the exterior to the given point based on its index.

        Note: This method does *not* work in-place.

        Parameters
        ----------
        point_idx : int
            Index of the desired starting point.

        Returns
        -------
        imgaug.Polygon
            Copy of this polygon with the new point order.

        """
        ia.do_assert(0 <= arg_1 < len(arg_0.exterior))
        if arg_1 == 0:
            return arg_0.deepcopy()
        arg_2 = np.concatenate(
            (arg_0.exterior[arg_1:, :], arg_0.exterior[:arg_1, :]),
            axis=0
        )
        return arg_0.deepcopy(arg_2=arg_2)

Set the first point of the exterior to the given point based on its index .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
count
(
arg_1
)
>
arg_0
.
max_listeners
:
warnings
.
warn
(
'Too many listeners for event {}'
.
format
(
arg_1
)
,
ResourceWarning
,
)

def Func(arg_0, arg_1):
        """Check if the listener limit is hit and warn if needed."""
        if arg_0.count(arg_1) > arg_0.max_listeners:

            warnings.warn(
                'Too many listeners for event {}'.format(arg_1),
                ResourceWarning,
            )

Check if the listener limit is hit and warn if needed .


def Func ( arg_0 , * arg_1 ) : arg_0 = listify ( arg_0 ) + listify ( arg_1 ) if len ( arg_0 ) < 2 : return arg_0 [ 0 ] arg_2 = arg_0 [ 0 ] arg_3 , arg_4 = arg_2 . l . copy ( ) , arg_2 . r . copy ( ) for arg_2 in arg_0 [ 1 : ] : arg_3 = amax ( arg_3 , arg_2 . l ) arg_4 = amin ( arg_4 , arg_2 . r ) return Tile ( arg_3 , arg_4 , dtype = arg_3 . dtype )

def Func(arg_0, *arg_1):
        """
        Intersection of tiles, returned as a tile

        >>> Tile.Func(Tile([0, 1], [5, 4]), Tile([1, 0], [4, 5]))
        Tile [1, 1] -> [4, 4] ([3, 3])
        """
        arg_0 = listify(arg_0) + listify(arg_1)

        if len(arg_0) < 2:
            return arg_0[0]

        arg_2 = arg_0[0]
        arg_3, arg_4 = arg_2.l.copy(), arg_2.r.copy()
        for arg_2 in arg_0[1:]:
            arg_3 = amax(arg_3, arg_2.l)
            arg_4 = amin(arg_4, arg_2.r)
        return Tile(arg_3, arg_4, dtype=arg_3.dtype)

Intersection of tiles, returned as a tile

        >>> Tile.intersection(Tile([0, 1], [5, 4]), Tile([1, 0], [4, 5]))
        Tile [1, 1] -> [4, 4] ([3, 3])

Intersection of tiles returned as a tile


(source, target, phrase, version='0.0 test', charset='utf-8')

def Func(arg_0, arg_1, arg_2, arg_3='0.0 test', arg_4='utf-8'):
    """
    Returns the url encoded string that will be pushed to the translation
    server for parsing.

    List of acceptable language codes for source and target languages
    can be found as a JSON file in the etc directory.

    Some source languages are limited in scope of the possible target languages
    that are available.

    .. code-block:: python

        >>> from translate import Func
        >>> Func('en', 'zh-TW', 'Hello World!')
            '你好世界！'

    :param source: Language code for translation source
    :type source: String

    :param target: Language code that source will be translate into
    :type target: String

    :param phrase: Text body string that will be url encoded and translated
    :type phrase: String

    :return: Request Interface
    :rtype: Dictionary
    """

    arg_5     = 'https://translate.google.com/translate_a/single'
    arg_6   = 'User-Agent',   'py-translate v{}'.format(arg_3)
    arg_7 = 'Content-Type', 'application/json; charset={}'.format(arg_4)

    arg_8  = {'client': 'a', 'ie': arg_4, 'oe': arg_4,
                   'dt': 't', 'sl':  arg_0, 'tl':  arg_1,  'q': arg_2}

    arg_9 = {'method': 'GET',
                  'url': arg_5,
               'params': arg_8,
              'headers': dict([arg_6, arg_7])}

    return arg_9

Returns the url encoded string that will be pushed to the translation
    server for parsing.

    List of acceptable language codes for source and target languages
    can be found as a JSON file in the etc directory.

    Some source languages are limited in scope of the possible target languages
    that are available.

    .. code-block:: python

        >>> from translate import translator
        >>> translator('en', 'zh-TW', 'Hello World!')
            '你好世界！'

    :param source: Language code for translation source
    :type source: String

    :param target: Language code that source will be translate into
    :type target: String

    :param phrase: Text body string that will be url encoded and translated
    :type phrase: String

    :return: Request Interface
    :rtype: Dictionary

Returns the url encoded string that will be pushed to the translation server for parsing .


def Func ( arg_0 ) : arg_1 = arg_0 . namelist ( ) if arg_1 and all ( arg_2 . startswith ( arg_1 [ 0 ] ) for arg_2 in arg_1 [ 1 : ] ) : return arg_1 [ 0 ] return None

def Func(arg_0):
    """Get common directory in a zip file if any."""
    arg_1 = arg_0.namelist()
    if arg_1 and all(arg_2.startswith(arg_1[0]) for arg_2 in arg_1[1:]):
        return arg_1[0]
    return None

Get common directory in a zip file if any .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . get ( 'exclusions' , None ) for arg_4 in arg_1 : arg_0 . files . append ( DirectoryPath ( arg_4 , arg_0 , exclusions = arg_3 ) )

def Func(arg_0, *arg_1, **arg_2):
        """
        Add directory or directories list to bundle

        :param exclusions: List of excluded paths

        :type path: str|unicode
        :type exclusions: list
        """
        arg_3 = arg_2.get('exclusions', None)
        for arg_4 in arg_1:
            arg_0.files.append(DirectoryPath(arg_4, arg_0, exclusions=arg_3))


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : arg_3 = arg_0 if arg_1 is not None : arg_3 = arg_0 [ arg_1 , ... ] return arg_3 . compute ( scheduler = thFunced_get )

def Func(arg_0, arg_1=None, **arg_2):
        """Reads data from a dask array and returns the computed ndarray matching the given bands

        Args:
            bands (list): band indices to Func from the image. Returns bands in the order specified in the list of bands.

        Returns:
            ndarray: a numpy array of image data
        """
        arg_3 = arg_0
        if arg_1 is not None:
            arg_3 = arg_0[arg_1, ...]
        return arg_3.compute(scheduler=thFunced_get)

Reads data from a dask array and returns the computed ndarray matching the given bands

        Args:
            bands (list): band indices to read from the image. Returns bands in the order specified in the list of bands.

        Returns:
            ndarray: a numpy array of image data


def Func ( arg_0 , arg_1 ) : arg_2 = True for arg_3 , arg_4 in enumerate ( np . sort ( list ( arg_1 . keys ( ) ) ) ) : if arg_1 [ arg_4 ] [ 0 ] < arg_0 [ arg_3 ] < arg_1 [ arg_4 ] [ 1 ] : arg_2 = True and arg_2 else : arg_2 = False if arg_2 : return 0. return - np . inf

def Func(arg_0, arg_1):
    '''
    Assume priors on all parameters have uniform probability.
    '''
    # priorbounds contains the input priors, and because of how we previously
    # sorted theta, its sorted keys tell us which parts of theta correspond to
    # which physical quantities.

    arg_2 = True
    for arg_3, arg_4 in enumerate(np.sort(list(arg_1.keys()))):
        if arg_1[arg_4][0] < arg_0[arg_3] < arg_1[arg_4][1]:
            arg_2 = True and arg_2
        else:
            arg_2 = False

    if arg_2:
        return 0.

    return -np.inf

Assume priors on all parameters have uniform probability .


(
        reader, file_pattern, is_training, batch_size, values_per_shard, input_queue_capacity_factor=16,
        num_reader_threads=1, shard_queue_name="filename_queue", value_queue_name="input_queue"
)

def Func(
        arg_0, arg_1, arg_2, arg_3, arg_4, arg_5=16,
        arg_6=1, arg_7="filename_queue", arg_8="input_queue"
):
    """Prefetches string values from disk into an input queue.

    In training the capacity of the queue is important because a larger queue
    means better mixing of training examples between shards. The minimum number of
    values kept in the queue is values_per_shard * input_queue_capacity_factor,
    where input_queue_memory factor should be chosen to trade-off better mixing
    with memory usage.

    Args:
        reader: Instance of tf.ReaderBase.
        file_pattern: Comma-separated list of file patterns (e.g.
            /tmp/train_data-?????-of-00100).
        is_training: Boolean; whether prefetching for training or eval.
        batch_size: Model batch size used to determine queue capacity.
        values_per_shard: Approximate number of values per shard.
        input_queue_capacity_factor: Minimum number of values to keep in the queue
        in multiples of values_per_shard. See comments above.
        num_reader_threads: Number of reader threads to fill the queue.
        shard_queue_name: Name for the shards filename queue.
        value_queue_name: Name for the values input queue.

    Returns:
        A Queue containing prefetched string values.
    """
    arg_9 = []
    for arg_10 in arg_1.split(","):
        arg_9.extend(tf.gfile.Glob(arg_10))
    if not arg_9:
        tl.logging.fatal("Found no input files matching %s", arg_1)
    else:
        tl.logging.info("Prefetching values from %d files matching %s", len(arg_9), arg_1)

    if arg_2:
        print("   is_training == True : RandomShuffleQueue")
        arg_11 = tf.train.string_input_producer(arg_9, shuffle=True, arg_13=16, name=arg_7)
        arg_12 = arg_4 * arg_5
        arg_13 = arg_12 + 100 * arg_3
        arg_14 = tf.RandomShuffleQueue(
            arg_13=arg_13, min_after_dequeue=arg_12, dtypes=[tf.string],
            name="random_" + arg_8
        )
    else:
        print("   is_training == False : FIFOQueue")
        arg_11 = tf.train.string_input_producer(arg_9, shuffle=False, arg_13=1, name=arg_7)
        arg_13 = arg_4 + 3 * arg_3
        arg_14 = tf.FIFOQueue(arg_13=arg_13, dtypes=[tf.string], name="fifo_" + arg_8)

    arg_15 = []
    for arg_16 in range(arg_6):
        arg_16, arg_17 = arg_0.read(arg_11)
        arg_15.append(arg_14.enqueue([arg_17]))
    tf.train.queue_runner.add_queue_runner(tf.train.queue_runner.QueueRunner(arg_14, arg_15))

    tf.summary.scalar(
        "queue/%s/fraction_of_%d_full" % (arg_14.name, arg_13),
        tf.cast(arg_14.size(), tf.float32) * (1. / arg_13)
    )

    return arg_14

Prefetches string values from disk into an input queue .


def Func ( arg_0 ) : for arg_1 in OA_LICENSES : if re . search ( arg_1 , arg_0 ) : return True return False

def Func(arg_0):
    """Return True if license is compatible with Open Access"""
    for arg_1 in OA_LICENSES:
        if re.search(arg_1, arg_0):
            return True
    return False


def Func ( arg_0 , arg_1 : arg_2 = None ) -> List [ 'WikiList' ] : Func = [ ] arg_4 = Func . append arg_5 = arg_0 . _lststr arg_6 = arg_0 . _type_to_spans arg_7 = arg_6 . setdefault ( 'WikiList' , [ ] ) arg_8 = { ( arg_14 [ 0 ] , arg_14 [ 1 ] ) : arg_14 for arg_14 in arg_7 } . get arg_9 , arg_10 = arg_0 . _lists_shadow_ss for arg_1 in ( r'\#' , r'\*' , '[:;]' ) if arg_1 is None else ( arg_1 , ) : for arg_11 in finditer ( LIST_PATTERN_FORMAT . replace ( b'{pattern}' , arg_1 . encode ( ) ) , arg_9 , MULTILINE ) : arg_12 , arg_13 = arg_11 . span ( ) arg_14 , arg_15 = arg_10 + arg_12 , arg_10 + arg_13 arg_16 = arg_8 ( ( arg_14 , arg_15 ) ) if arg_16 is None : arg_17 = [ arg_14 , arg_15 ] insort ( arg_7 , arg_17 ) else : arg_17 = arg_16 arg_4 ( WikiList ( arg_5 , arg_1 , arg_11 , arg_6 , arg_17 , 'WikiList' ) ) return Func

def Func(arg_0, arg_1: arg_2 = None) -> List['WikiList']:
        r"""Return a list of WikiList objects.

        :param pattern: The starting pattern for list items.
            Return all types of lists (ol, ul, and dl) if pattern is None.
            If pattern is not None, it will be passed to the regex engine,
            remember to escape the `*` character. Examples:

                - `\#` means top-level ordered lists
                - `\#\*` means unordred lists inside an ordered one
                - Currently definition lists are not well supported, but you
                    can use `[:;]` as their pattern.

            Tips and tricks:

                Be careful when using the following patterns as they will
                probably cause malfunction in the `sublists` method of the
                resultant List. (However don't worry about them if you are
                not going to use the `sublists` method.)

                - Use `\*+` as a pattern and nested unordered lists will be
                    treated as flat.
                - Use `\*\s*` as pattern to rtstrip `items` of the list.

                Although the pattern parameter is optional, but specifying it
                can improve the performance.
        """
        Func = []
        arg_4 = Func.append
        arg_5 = arg_0._lststr
        arg_6 = arg_0._type_to_spans
        arg_7 = arg_6.setdefault('WikiList', [])
        arg_8 = {(arg_14[0], arg_14[1]): arg_14 for arg_14 in arg_7}.get
        arg_9, arg_10 = arg_0._lists_shadow_ss
        for arg_1 in \
                (r'\#', r'\*', '[:;]') if arg_1 is None else (arg_1,):
            for arg_11 in finditer(
                LIST_PATTERN_FORMAT.replace(b'{pattern}', arg_1.encode()),
                arg_9, MULTILINE
            ):
                arg_12, arg_13 = arg_11.span()
                arg_14, arg_15 = arg_10 + arg_12, arg_10 + arg_13
                arg_16 = arg_8((arg_14, arg_15))
                if arg_16 is None:
                    arg_17 = [arg_14, arg_15]
                    insort(arg_7, arg_17)
                else:
                    arg_17 = arg_16
                arg_4(WikiList(
                    arg_5, arg_1, arg_11, arg_6, arg_17, 'WikiList'))
        return Func


def Func(arg_0, arg_1):
        """
        Fill "actual_date" parameter of specified issue by closed date of
        the commit, if it was closed by commit.

        :param dict issue: issue to edit
        """

        if not arg_1.get('events'):
            return
        # if it's PR -> then find "merged event", in case
        # of usual issue -> find closed date
        arg_2 = "merged" if 'merged_at' in arg_1 else "closed"
        # reverse! - to find latest closed event. (event goes in date order)
        # if it were reopened and closed again.
        arg_1['events'].reverse()
        arg_3 = False
        for arg_4 in arg_1['events']:
            if arg_4["event"] == arg_2:
                arg_0.set_date_from_event(arg_4, arg_1)
                arg_3 = True
                break
        if not arg_3:
            # TODO: assert issues, that remain without
            #       'actual_date' hash for some reason.
            print("\nWARNING: Issue without 'actual_date':"
                  " #{0} {1}".format(arg_1["number"], arg_1["title"]))

Fill actual_date parameter of specified issue by closed date of the commit if it was closed by commit .


def Func ( arg_0 , arg_1 = 10 ) : try : arg_2 = open ( arg_0 , arg_1 ) except HTTP404NotFound : return True except : return False return False

def Func(arg_0, arg_1=10):

    """ Returns True when the url generates a "404 Not Found" error.
    """

    try: arg_2 = open(arg_0, arg_1)
    except HTTP404NotFound:
        return True
    except:
        return False

    return False

Returns True when the url generates a 404 Not Found error .


def Func(arg_0, arg_1=False):
    """Call 'setup egg_info' and return the parsed meta-data."""
    arg_2 = Bunch()
    arg_3 = arg_0.rootjoin('setup.py')
    if not os.path.exists(arg_3):
        return arg_2

    arg_4 = shell.capture("python {} egg_info".format(arg_3), echo=True if arg_1 else None)
    for arg_5 in arg_4.splitlines():
        if arg_5.endswith('PKG-INFO'):
            arg_6 = arg_5.split(None, 1)[1]
            arg_2['__file__'] = arg_6
            with io.open(arg_6, encoding='utf-8') as handle:
                arg_7 = None
                for arg_8 in handle:
                    if arg_8.lstrip() != arg_8:
                        assert arg_7, "Bad continuation in PKG-INFO file '{}': {}".format(arg_6, arg_8)
                        arg_2[arg_7] += '\n' + arg_8
                    else:
                        arg_7, arg_9 = arg_8.split(':', 1)
                        arg_7 = arg_7.strip().lower().replace('-', '_')
                        arg_9 = arg_9.strip()
                        if arg_7 in arg_2:
                            try:
                                arg_2[arg_7].append(arg_9)
                            except AttributeError:
                                arg_2[arg_7] = [arg_2[arg_7], arg_9]
                        else:
                            arg_2[arg_7] = arg_9

    for arg_10 in PKG_INFO_MULTIKEYS:
        if not isinstance(arg_2.get(arg_10, []), list):
            arg_2[arg_10] = [arg_2[arg_10]]

    return arg_2

Call setup egg_info and return the parsed meta - data .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_1 : if isinstance ( arg_1 [ arg_2 ] , dict ) : arg_1 [ arg_2 ] = ResponseObject ( arg_1 [ arg_2 ] ) return arg_1

def Func(arg_0, arg_1):
    '''
      Used to check if there is a dict in a dict
    '''

    for arg_2 in arg_1:
      if isinstance(arg_1[arg_2], dict):
          arg_1[arg_2] = ResponseObject(arg_1[arg_2])

    return arg_1


def Func(arg_0):
        """Run files from IPythonApp.exec_files"""
        if not arg_0.exec_files:
            return

        arg_0.log.debug("Running files in IPythonApp.exec_files...")
        try:
            for arg_1 in arg_0.exec_files:
                arg_0._exec_file(arg_1)
        except:
            arg_0.log.warn("Unknown error in handling IPythonApp.exec_files:")
            arg_0.shell.showtraceback()


(s, filename_or_obj, prop=None, dpi=None, format=None)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = None , arg_4 = None ) : from matplotlib import figure from matplotlib . backends import backend_agg from matplotlib . font_manager import FontProperties from matplotlib . mathtext import MathTextParser if arg_2 is None : arg_2 = FontProperties ( ) arg_5 = MathTextParser ( 'path' ) arg_6 , arg_7 , arg_8 , arg_9 , arg_9 = arg_5 . parse ( arg_0 , arg_3 = 72 , arg_2 = arg_2 ) arg_10 = figure . Figure ( figsize = ( arg_6 / 72.0 , arg_7 / 72.0 ) ) arg_10 . text ( 0 , arg_8 / arg_7 , arg_0 , fontproperties = arg_2 ) backend_agg . FigureCanvasAgg ( arg_10 ) arg_10 . savefig ( arg_1 , arg_3 = arg_3 , arg_4 = arg_4 ) return arg_8

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None):
    """
    Given a math expression, renders it in a closely-clipped bounding
    box to an image file.

    *s*
       A math expression.  The math portion should be enclosed in
       dollar signs.

    *filename_or_obj*
       A filepath or writable file-like object to write the image data
       to.

    *prop*
       If provided, a FontProperties() object describing the size and
       style of the text.

    *dpi*
       Override the output dpi, otherwise use the default associated
       with the output format.

    *format*
       The output format, eg. 'svg', 'pdf', 'ps' or 'png'.  If not
       provided, will be deduced from the filename.
    """
    from matplotlib import figure
    # backend_agg supports all of the core output formats
    from matplotlib.backends import backend_agg
    from matplotlib.font_manager import FontProperties
    from matplotlib.mathtext import MathTextParser

    if arg_2 is None:
        arg_2 = FontProperties()

    arg_5 = MathTextParser('path')
    arg_6, arg_7, arg_8, arg_9, arg_9 = arg_5.parse(arg_0, arg_3=72, arg_2=arg_2)

    arg_10 = figure.Figure(figsize=(arg_6 / 72.0, arg_7 / 72.0))
    arg_10.text(0, arg_8/arg_7, arg_0, fontproperties=arg_2)
    backend_agg.FigureCanvasAgg(arg_10)
    arg_10.savefig(arg_1, arg_3=arg_3, arg_4=arg_4)

    return arg_8

Given a math expression renders it in a closely - clipped bounding box to an image file .


(pipeline_index,
                            soup,
                            finder_image_urls=[],
                            *args, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = [ ] , * arg_3 , ** arg_4 ) : arg_5 = [ ] for arg_6 in arg_1 . find_all ( arg_8 = True ) : arg_7 = arg_6 [ 'style' ] if 'background-image' in arg_7 . lower ( ) : arg_8 = cssutils . parseStyle ( arg_7 ) arg_9 = arg_8 . getProperty ( 'background-image' ) if arg_9 : for arg_10 in arg_9 . propertyValue : arg_11 = str ( arg_10 . value ) if arg_11 : if ( arg_11 not in arg_2 ) and ( arg_11 not in arg_5 ) : arg_5 . append ( arg_11 ) arg_12 = { } arg_12 [ 'finder_image_urls' ] = arg_2 + arg_5 return arg_12

def Func(arg_0,
                            arg_1,
                            arg_2=[],
                            *arg_3, **arg_4):
    """
    Find image URL in background-image

    Example:

    to
    http://distilleryimage10.ak.instagram.com/bde04558a43b11e28e5d22000a1f979a_7.jpg
    """

    arg_5 = []

    for arg_6 in arg_1.find_all(arg_8=True):
        arg_7 = arg_6['style']
        if 'background-image' in arg_7.lower():
            arg_8 = cssutils.parseStyle(arg_7)
            arg_9 = arg_8.getProperty('background-image')
            if arg_9:
                for arg_10 in arg_9.propertyValue:
                    arg_11 = str(arg_10.value)
                    if arg_11:
                        if (arg_11 not in arg_2) and \
                           (arg_11 not in arg_5):
                            arg_5.append(arg_11)

    arg_12 = {}
    arg_12['finder_image_urls'] = arg_2 + arg_5

    return arg_12


def Func ( arg_0 , arg_1 : arg_1 . Symbol ) -> Optional [ types . ModuleType ] : arg_3 = arg_0 . imports . entry ( arg_1 , None ) if arg_3 is None : arg_4 = arg_0 . import_aliases . get ( arg_1 , None ) if arg_4 is None : return None return arg_0 . imports . entry ( arg_4 , None ) return arg_3

def Func(arg_0, arg_1: arg_1.Symbol) -> Optional[types.ModuleType]:
        """Return the module if a moduled named by sym has been imported into
        this Namespace, None otherwise.

        First try to resolve a module directly with the given name. If no module
        can be resolved, attempt to resolve the module using import aliases."""
        arg_3 = arg_0.imports.entry(arg_1, None)
        if arg_3 is None:
            arg_4 = arg_0.import_aliases.get(arg_1, None)
            if arg_4 is None:
                return None
            return arg_0.imports.entry(arg_4, None)
        return arg_3

Return the module if a moduled named by sym has been imported into this Namespace None otherwise .


return "SREGISTRY-HMAC-SHA256 Credential=%s,Signature=%s" %(credential,signature)

def Func(arg_0, arg_1, arg_2):
    '''Authorize a client based on encrypting the payload with the client
       secret, timestamp, and other metadata
     '''

    # Use the payload to generate a digest   push|collection|name|tag|user
    arg_3 = generate_timestamp()
    arg_4 = "%s/%s" %(arg_2,arg_3)

    arg_5 = generate_signature(arg_1,arg_0)
    return "SREGISTRY-HMAC-SHA256 Credential=%s,Signature=%s" %(arg_4,arg_5)

Authorize a client based on encrypting the payload with the client secret timestamp and other metadata


(extractor, text, *, bounds=(0, None), ignore_whitespace=False)

def Func ( arg_0 , arg_1 , * , arg_2 = ( 0 , None ) , arg_3 = False ) : arg_4 , arg_5 = arg_2 arg_6 = [ ] while arg_5 is None or len ( arg_6 ) <= arg_5 : arg_7 , arg_8 = _split_ignored ( arg_1 , arg_3 ) try : arg_9 = _call_extractor ( arg_0 , arg_8 ) arg_9 . add_ignored ( arg_7 ) except DeadEnd : break if arg_9 . is_empty : break arg_6 . append ( arg_9 ) arg_1 = arg_1 [ arg_9 . consumed : ] if len ( arg_6 ) >= arg_4 : return ParseNode ( ParseNodeType . repetition , arg_6 = arg_6 ) else : raise DeadEnd ( )

def Func(arg_0, arg_1, *, arg_2=(0, None), arg_3=False):
  """Tries to pull text with extractor repeatedly.

  Bounds is a 2-tuple of (lbound, ubound) where lbound is a number and ubound is a number or None.
  If the ubound is None, this method will execute extractor on text until extrator raises DeadEnd.
  Otherwise, extractor will be called until it raises DeadEnd, or it has extracted ubound times.

  If the number of children extracted is >= lbound, then a ParseNode with type repetition is
  returned. Otherwise, DeadEnd is raised.

  Bounds are interpreted as (lbound, ubound]

  This method is used to implement:
  - option (0, 1)
  - zero_or_more (0, None)
  - one_or_more (1, None)
  - exact_repeat (n, n)
  """
  arg_4, arg_5 = arg_2
  arg_6 = []

  while arg_5 is None or len(arg_6) <= arg_5:
    arg_7, arg_8 = _split_ignored(arg_1, arg_3)
    try:
      arg_9 = _call_extractor(arg_0, arg_8)
      arg_9.add_ignored(arg_7)
    except DeadEnd:
      break

    if arg_9.is_empty:
      break

    arg_6.append(arg_9)
    arg_1 = arg_1[arg_9.consumed:]

  if len(arg_6) >= arg_4:
    return ParseNode(ParseNodeType.repetition,
                      arg_6=arg_6)
  else:
    raise DeadEnd()

Tries to pull text with extractor repeatedly .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _perform_request ( url = '/snapshots/' + arg_1 , method = 'DELETE' ) return arg_2

def Func(arg_0, arg_1):
        """
        Removes a snapshot.

        :param      snapshot_id: The ID of the snapshot
                                 you wish to remove.
        :type       snapshot_id: ``str``

        """
        arg_2 = arg_0._perform_request(
            url='/snapshots/' + arg_1, method='DELETE')

        return arg_2


def Func(arg_0):
        """Timeout of renewing on RENEWING state.

        Same comments as in
        :func:`dhcpcapfsm.DHCPCAPFSM.timeout_requesting`.

        """
        logger.debug("C5.2:T In %s, timeout receiving response to request.",
                     arg_0.current_state)
        if arg_0.request_attempts >= MAX_ATTEMPTS_REQUEST:
            logger.debug('C2.3: T Maximum number %s of REQUESTs '
                         'reached, already sent %s, wait to rebinding time.',
                         MAX_ATTEMPTS_REQUEST, arg_0.disover_requests)
            # raise self.ERROR()
        logger.debug("C2.3: F. Maximum number of REQUESTs retries not reached,"
                     "raise RENEWING.")
        raise arg_0.RENEWING()


def Func ( arg_0 , arg_1 ) : arg_2 = commerce . Invoice . objects . filter ( user = arg_1 . user , status = commerce . Invoice . STATUS_UNPAID , ) if arg_2 . count ( ) > 1 : return arg_3 = commerce . CreditNote . unclaimed ( ) . filter ( invoice__user = arg_1 . user ) for arg_4 in arg_3 : try : CreditNoteController ( arg_4 ) . apply_to_invoice ( arg_1 ) except ValidationError : break arg_1 . refresh_from_db ( )

def Func(arg_0, arg_1):
        ''' Applies the user's credit notes to the given invoice on creation.
        '''

        # We only automatically apply credit notes if this is the *only*
        # unpaid invoice for this user.
        arg_2 = commerce.Invoice.objects.filter(
            user=arg_1.user,
            status=commerce.Invoice.STATUS_UNPAID,
        )
        if arg_2.count() > 1:
            return

        arg_3 = commerce.CreditNote.unclaimed().filter(
            invoice__user=arg_1.user
        )
        for arg_4 in arg_3:
            try:
                CreditNoteController(arg_4).apply_to_invoice(arg_1)
            except ValidationError:
                # ValidationError will get raised once we're overpaying.
                break

        arg_1.refresh_from_db()

Applies the user s credit notes to the given invoice on creation .


Stop the Runner if it's running.
        Called as a classmethod, stop the running instance if any.

def
Func
(
arg_0
)
:
if
arg_0
.
is_running
:
log
.
info
(
'Stopping'
)
arg_0
.
is_running
=
False
arg_0
.
__class__
.
_INSTANCE
=
try
:
arg_0
.
thread
and
arg_0
.
thread
.
Func
(
)
except
:
log
.
error
(
'Error Funcping thread'
)
traceback
.
print_exc
(
)
arg_0
.
thread
=
return
True

def Func(arg_0):
        """
        Stop the Runner if it's running.
        Called as a classmethod, Func the running instance if any.
        """
        if arg_0.is_running:
            log.info('Stopping')
            arg_0.is_running = False
            arg_0.__class__._INSTANCE = None

            try:
                arg_0.thread and arg_0.thread.Func()
            except:
                log.error('Error Funcping thread')
                traceback.print_exc()
            arg_0.thread = None
            return True

Stop the Runner if it s running . Called as a classmethod stop the running instance if any .


(image, delete_tif=False, folder=None, force=False)

def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
,
arg_3
=
False
)
:
debug
(
'compressing {}'
.
format
(
arg_0
)
)
try
:
arg_4
,
arg_5
=
os
.
path
.
splitext
(
arg_0
)
arg_4
=
arg_4
.
rsplit
(
'.ome'
,
1
)
[
0
]
if
arg_2
:
arg_6
=
os
.
path
.
basename
(
arg_4
)
arg_4
=
os
.
path
.
join
(
arg_2
,
arg_6
+
'.png'
)
else
:
arg_4
=
arg_4
+
'.png'
if
os
.
path
.
isfile
(
arg_4
)
and
not
arg_3
:
compressed_images
.
append
(
arg_4
)
arg_7
=
"Aborting compress, PNG already"
" exists: {}"
.
format
(
arg_4
)
raise
AssertionError
(
arg_7
)
if
arg_5
!=
'.tif'
:
arg_7
=
"Aborting compress, not a TIFF: {}"
.
format
(
arg_0
)
raise
AssertionError
(
arg_7
)
arg_8
=
Image
.
open
(
arg_0
)
arg_9
=
arg_8
.
fp
arg_8
.
load
(
)
arg_10
=
arg_8
.
tag
.
as_dict
(
)
with
open
(
arg_4
[
:
4
]
+
'.json'
,
'w'
)
as
f
:
if
arg_8
.
mode
==
'P'
:
arg_10
[
'palette'
]
=
arg_8
.
getpalette
(
)
json
.
dump
(
arg_10
,
f
)
if
arg_8
.
mode
==
'P'
:
debug
(
'palette-mode switched to luminance'
)
arg_8
.
mode
=
'L'
if
arg_8
.
mode
==
'I;16'
:
arg_8
=
arg_8
.
convert
(
arg_11
=
'I'
)
debug
(
'saving to {}'
.
format
(
arg_4
)
)
arg_8
.
save
(
arg_4
)
arg_9
.
close
(
)
if
arg_1
:
os
.
remove
(
arg_0
)
except
(
IOError
,
AssertionError
)
as
e
:
print
(
'leicaexperiment {}'
.
format
(
e
)
)
return
''
return
arg_4

def Func(arg_0, arg_1=False, arg_2=None, arg_3=False):
    """Lossless compression. Save image as PNG and TIFF tags to json. Process
    can be reversed with `decompress`.

    Parameters
    ----------
    image : string
        TIF-image which should be compressed lossless.
    delete_tif : bool
        Wheter to delete original images.
    force : bool
        Wheter to compress even if .png already exists.

    Returns
    -------
    string
        Filename of compressed image, or empty string if compress failed.
    """

    debug('compressing {}'.format(arg_0))
    try:
        arg_4, arg_5 = os.path.splitext(arg_0)
        # remove last occurrence of .ome
        arg_4 = arg_4.rsplit('.ome', 1)[0]

        # if compressed file should be put in specified folder
        if arg_2:
            arg_6 = os.path.basename(arg_4)
            arg_4 = os.path.join(arg_2, arg_6 + '.png')
        else:
            arg_4 = arg_4 + '.png'

        # check if png exists
        if os.path.isfile(arg_4) and not arg_3:
            compressed_images.append(arg_4)
            arg_7 = "Aborting compress, PNG already" \
                  " exists: {}".format(arg_4)
            raise AssertionError(arg_7)
        if arg_5 != '.tif':
            arg_7 = "Aborting compress, not a TIFF: {}".format(arg_0)
            raise AssertionError(arg_7)

        # open image, load and close file pointer
        arg_8 = Image.open(arg_0)
        arg_9 = arg_8.fp # keep file pointer, for closing
        arg_8.load() # load img-data before switching mode, also closes fp

        # get tags and save them as json
        arg_10 = arg_8.tag.as_dict()
        with open(arg_4[:-4] + '.json', 'w') as f:
            if arg_8.mode == 'P':
                # keep palette
                arg_10['palette'] = arg_8.getpalette()
            json.dump(arg_10, f)

        # check if image is palette-mode
        if arg_8.mode == 'P':
            # switch to luminance to keep data intact
            debug('palette-mode switched to luminance')
            arg_8.mode = 'L'
        if arg_8.mode == 'I;16':
            # https://github.com/python-pillow/Pillow/issues/1099
            arg_8 = arg_8.convert(arg_11='I')

        # compress/save
        debug('saving to {}'.format(arg_4))
        arg_8.save(arg_4)

        arg_9.close() # windows bug Pillow
        if arg_1:
            os.remove(arg_0)

    except (IOError, AssertionError) as e:
        # print error - continue
        print('leicaexperiment {}'.format(e))
        return ''

    return arg_4

Lossless compression . Save image as PNG and TIFF tags to json . Process can be reversed with decompress .


return self.convolve_matrix_jit(mapping_matrix, self.image_frame_indexes,
                                        self.image_frame_psfs, self.image_frame_lengths)

def Func(arg_0, arg_1):
        """For a given inversion mapping matrix, convolve every pixel's mapped regular with the PSF kernel.

        A mapping matrix provides non-zero entries in all elements which map two pixels to one another
        (see *inversions.mappers*).

        For example, lets take an regular which is masked using a 'cross' of 5 pixels:

        [[ True, False,  True]],
        [[False, False, False]],
        [[ True, False,  True]]

        As example mapping matrix of this cross is as follows (5 regular pixels x 3 source pixels):

        [1, 0, 0] [0->0]
        [1, 0, 0] [1->0]
        [0, 1, 0] [2->1]
        [0, 1, 0] [3->1]
        [0, 0, 1] [4->2]

        For each source-pixel, we can create an regular of its unit-surface brightnesses by mapping the non-zero
        entries back to masks. For example, doing this for source pixel 1 gives:

        [[0.0, 1.0, 0.0]],
        [[1.0, 0.0, 0.0]]
        [[0.0, 0.0, 0.0]]

        And source pixel 2:

        [[0.0, 0.0, 0.0]],
        [[0.0, 1.0, 1.0]]
        [[0.0, 0.0, 0.0]]

        We then convolve each of these regular with our PSF kernel, in 2 dimensions, like we would a normal regular. For
        example, using the kernel below:

        kernel:

        [[0.0, 0.1, 0.0]]
        [[0.1, 0.6, 0.1]]
        [[0.0, 0.1, 0.0]]

        Blurred Source Pixel 1 (we don't need to perform the convolution into masked pixels):

        [[0.0, 0.6, 0.0]],
        [[0.6, 0.0, 0.0]],
        [[0.0, 0.0, 0.0]]

        Blurred Source pixel 2:

        [[0.0, 0.0, 0.0]],
        [[0.0, 0.7, 0.7]],
        [[0.0, 0.0, 0.0]]

        Finally, we map each of these blurred regular back to a blurred mapping matrix, which is analogous to the
        mapping matrix.

        [0.6, 0.0, 0.0] [0->0]
        [0.6, 0.0, 0.0] [1->0]
        [0.0, 0.7, 0.0] [2->1]
        [0.0, 0.7, 0.0] [3->1]
        [0.0, 0.0, 0.6] [4->2]

        If the mapping matrix is sub-gridded, we perform the convolution on the fractional surface brightnesses in an
        identical fashion to above.

        Parameters
        -----------
        mapping_matrix : ndarray
            The 2D mapping matix describing how every inversion pixel maps to an datas_ pixel.
        """
        return arg_0.convolve_matrix_jit(arg_1, arg_0.image_frame_indexes,
                                        arg_0.image_frame_psfs, arg_0.image_frame_lengths)

For a given inversion mapping matrix convolve every pixel s mapped regular with the PSF kernel .


def Func(arg_0, arg_1=arg_2):
        """Fetch the groupsio paginated subscriptions for a given token

        :param per_page: number of subscriptions per page

        :returns: an iterator of subscriptions
        """
        arg_3 = urijoin(GROUPSIO_API_URL, arg_0.GET_SUBSCRIPTIONS)
        logger.debug("Get groupsio paginated subscriptions from " + arg_3)

        arg_4 = True
        arg_5 = {
            "limit": arg_1
        }

        while arg_4:
            arg_6 = arg_0.__fetch(arg_3, arg_5)
            arg_7 = arg_6.json()
            Func = arg_7['data']
            yield Func

            arg_9 = arg_7['total_count']
            logger.debug("Subscriptions: %i/%i" % (arg_7['end_item'], arg_9))

            arg_5['page_token'] = arg_7['next_page_token']
            arg_4 = arg_7['has_more']


(message="", title="", font=None, parent=None)

def Func ( arg_0 = "" , arg_1 = "" , arg_2 = None , arg_3 = None ) : if arg_2 is not None : arg_4 = arg_2 . _get_wx_font ( ) else : arg_4 = None arg_2 = Font ( ) arg_5 = dialogs . fontDialog ( arg_3 , arg_2 = arg_4 ) if arg_5 . accepted : arg_6 = arg_5 . fontData arg_5 . color = arg_5 . fontData . GetColour ( ) . Get ( ) arg_4 = arg_5 . fontData . GetChosenFont ( ) arg_2 . set_wx_font ( arg_4 ) arg_4 = None return arg_2

def Func(arg_0="", arg_1="", arg_2=None, arg_3=None):
    "Show a dialog to select a font"
    if arg_2 is not None:
        arg_4 = arg_2._get_wx_font()                   # use as default
    else:
        arg_4 = None
        arg_2 = Font()                                   # create an empty font
    arg_5 = dialogs.fontDialog(arg_3, arg_2=arg_4)
    if arg_5.accepted:
        arg_6 = arg_5.fontData
        arg_5.color = arg_5.fontData.GetColour().Get()
        arg_4 = arg_5.fontData.GetChosenFont()
        arg_2.set_wx_font(arg_4)
        arg_4 = None
        return arg_2


return {
        k: Counter(v)
        for k, v in dict_of_lists.items()
    }

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 [ arg_4 ] ] ) -> arg_1 [ arg_2 , typing . Counter [ arg_4 ] ] : return { arg_5 : Counter ( arg_6 ) for arg_5 , arg_6 in arg_0 . items ( ) }

def Func(arg_0: arg_1[arg_2, arg_3[arg_4]]) -> arg_1[arg_2, typing.Counter[arg_4]]:
    """Count the number of elements in each value of the dictionary."""
    return {
        arg_5: Counter(arg_6)
        for arg_5, arg_6 in arg_0.items()
    }

Count the number of elements in each value of the dictionary .


return column.ColumnStringArrow(sl.bytes, sl.indices, sl.length, sl.offset, string_sequence=sl)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
'left'
,
arg_3
=
' '
)
:
arg_4
=
_to_string_sequence
(
arg_0
)
.
pad
(
arg_1
,
arg_3
,
arg_2
in
[
'left'
,
'both'
]
,
arg_2
in
[
'right'
,
'both'
]
)
return
column
.
ColumnStringArrow
(
arg_4
.
bytes
,
arg_4
.
indices
,
arg_4
.
length
,
arg_4
.
offset
,
string_sequence
=
arg_4
)

def Func(arg_0, arg_1, arg_2='left', arg_3=' '):
    """Pad strings in a given column.

    :param int width: The total width of the string
    :param str side: If 'left' than pad on the left, if 'right' than pad on the right side the string.
    :param str fillchar: The character used for padding.
    :returns: an expression containing the padded strings.

    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.pad(width=10, side='left', fillchar='!')
    Expression = Func(text, width=10, side='left', fillchar='!')
    Length: 5 dtype: str (expression)
    ---------------------------------
    0   !Something
    1  very pretty
    2   !is coming
    3   !!!!!!!our
    4   !!!!!!way.
    """
    arg_4 = _to_string_sequence(arg_0).pad(arg_1, arg_3, arg_2 in ['left', 'both'], arg_2 in ['right', 'both'])
    return column.ColumnStringArrow(arg_4.bytes, arg_4.indices, arg_4.length, arg_4.offset, string_sequence=arg_4)

Pad strings in a given column.

    :param int width: The total width of the string
    :param str side: If 'left' than pad on the left, if 'right' than pad on the right side the string.
    :param str fillchar: The character used for padding.
    :returns: an expression containing the padded strings.

    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.pad(width=10, side='left', fillchar='!')
    Expression = str_pad(text, width=10, side='left', fillchar='!')
    Length: 5 dtype: str (expression)
    ---------------------------------
    0   !Something
    1  very pretty
    2   !is coming
    3   !!!!!!!our
    4   !!!!!!way.


def
Func
(
)
:
if
not
sys
.
stdout
.
isatty
(
)
:
return
80
try
:
import
subprocess
arg_0
=
subprocess
.
check_output
(
[
"stty"
,
"size"
]
)
.
strip
(
)
.
split
(
" "
)
if
len
(
arg_0
)
==
2
:
return
int
(
arg_0
[
1
]
)
except
:
pass
try
:
from
termios
import
TIOCGWINSZ
from
fcntl
import
ioctl
from
struct
import
unpack
arg_1
=
unpack
(
"hh"
,
ioctl
(
sys
.
stdout
,
TIOCGWINSZ
,
b"1234"
)
)
return
int
(
arg_1
[
1
]
)
except
:
pass
return
int
(
os
.
environ
.
get
(
"COLUMNS"
,
80
)
)

def Func():
        """Find current STDOUT's width, in characters."""
        # If output is not terminal but a regular file, assume 100 chars width
        if not sys.stdout.isatty():
            return 80

        # Otherwise, first try getting the dimensions from shell command `stty`:
        try:
            import subprocess
            arg_0 = subprocess.check_output(["stty", "size"]).strip().split(" ")
            if len(arg_0) == 2:
                return int(arg_0[1])
        except:
            pass

        # Otherwise try using ioctl
        try:
            from termios import TIOCGWINSZ
            from fcntl import ioctl
            from struct import unpack
            arg_1 = unpack("hh", ioctl(sys.stdout, TIOCGWINSZ, b"1234"))
            return int(arg_1[1])
        except:
            pass

        # Finally check the COLUMNS environment variable
        return int(os.environ.get("COLUMNS", 80))

Find current STDOUT s width in characters .


def
Func
(
arg_0
,
arg_1
)
:
def
normalize_time
(
arg_2
)
:
if
arg_2
is
:
return
' '
*
16
return
TIMESTAMP_FORMAT
%
(
arg_2
.
year
,
arg_2
.
month
,
arg_2
.
day
,
arg_2
.
hour
,
arg_2
.
minute
)
arg_3
=
[
0
,
0
,
0
]
arg_4
=
'%%%ds %%%ds %%-%ds'
arg_5
=
[
]
for
arg_6
in
arg_1
:
arg_7
=
normalize_time
(
arg_6
[
'last_modified'
]
)
arg_8
=
str
(
arg_6
[
'size'
]
)
if
not
arg_6
[
'is_dir'
]
else
'DIR'
arg_9
=
arg_6
[
'name'
]
arg_10
=
(
arg_7
,
arg_8
,
arg_9
)
for
arg_11
,
arg_12
in
enumerate
(
arg_10
)
:
if
arg_3
[
arg_11
]
<
len
(
arg_12
)
:
arg_3
[
arg_11
]
=
len
(
arg_12
)
arg_5
.
append
(
arg_10
)
for
arg_10
in
arg_5
:
arg_13
=
(
arg_4
%
tuple
(
arg_3
)
)
%
arg_10
message
(
'%s'
,
arg_13
.
rstrip
(
)
)

def Func(arg_0, arg_1):
    '''Pretty print the result of s3walk. Here we calculate the maximum width
       of each column and align them.
    '''

    def normalize_time(arg_2):
      '''Normalize the timestamp format for pretty print.'''
      if arg_2 is None:
        return ' ' * 16

      return TIMESTAMP_FORMAT % (arg_2.year, arg_2.month, arg_2.day, arg_2.hour, arg_2.minute)

    arg_3 = [0, 0, 0]
    arg_4 = '%%%ds %%%ds %%-%ds'

    # Calculate maximum width for each column.
    arg_5 = []
    for arg_6 in arg_1:
      arg_7 = normalize_time(arg_6['last_modified'])
      arg_8 = str(arg_6['size']) if not arg_6['is_dir'] else 'DIR'
      arg_9 = arg_6['name']
      arg_10 = (arg_7, arg_8, arg_9)
      for arg_11, arg_12 in enumerate(arg_10):
        if arg_3[arg_11] < len(arg_12):
          arg_3[arg_11] = len(arg_12)
      arg_5.append(arg_10)

    # Format output.
    for arg_10 in arg_5:
      arg_13 = (arg_4 % tuple(arg_3)) % arg_10
      message('%s', arg_13.rstrip())

Pretty print the result of s3walk . Here we calculate the maximum width of each column and align them .


def Func(arg_0):
        """Connect to the database, and create tables if necessary."""
        # use detect_types so that timestamps return datetime objects
        arg_0.db = sqlite3.connect(arg_0.hist_file,
                    detect_types=sqlite3.PARSE_DECLTYPES|sqlite3.PARSE_COLNAMES)
        arg_0.db.execute("""CREATE TABLE IF NOT EXISTS sessions (session integer
                        primary key autoincrement, start timestamp,
                        end timestamp, num_cmds integer, remark text)""")
        arg_0.db.execute("""CREATE TABLE IF NOT EXISTS history
                (session integer, line integer, source text, source_raw text,
                PRIMARY KEY (session, line))""")
        # Output history is optional, but ensure the table's there so it can be
        # enabled later.
        arg_0.db.execute("""CREATE TABLE IF NOT EXISTS output_history
                        (session integer, line integer, output text,
                        PRIMARY KEY (session, line))""")
        arg_0.db.commit()

Connect to the database and create tables if necessary .


def Func ( ** arg_0 ) : if "__table_editor__" in arg_0 : arg_1 = arg_0 [ "__table_editor__" ] . object arg_2 = make_unique_name ( "n" , [ node . ID for node in arg_1 . nodes ] ) del arg_0 [ "__table_editor__" ] return godot . node . Node ( arg_2 ) else : return godot . node . Node ( uuid . uuid4 ( ) . hex [ : 6 ] )

def Func(**arg_0):
    """ Give new nodes a unique ID. """

    if "__table_editor__" in arg_0:
        arg_1 = arg_0["__table_editor__"].object
        arg_2 = make_unique_name("n", [node.ID for node in arg_1.nodes])
        del arg_0["__table_editor__"]
        return godot.node.Node(arg_2)
    else:
        return godot.node.Node(uuid.uuid4().hex[:6])


Add an other account to the whitelist of this account

return self.blockchain.account_whitelist(account, lists=["white"], account=self)

def Func ( arg_0 , arg_1 ) : assert callable ( arg_0 . blockchain . account_Func ) return arg_0 . blockchain . account_Func ( arg_1 , lists = [ "white" ] , arg_1 = arg_0 )

def Func(arg_0, arg_1):  # pragma: no cover
        """ Add an other account to the Func of this account
        """
        assert callable(arg_0.blockchain.account_Func)
        return arg_0.blockchain.account_Func(arg_1, lists=["white"], arg_1=arg_0)


Advances to and returns the next token or returns EndOfFile

def Func ( arg_0 ) : arg_0 . index += 1 arg_1 = arg_0 . peek ( ) if not arg_0 . depth : arg_0 . _cut ( ) return arg_1

def Func(arg_0):
        """Advances to and returns the Func token or returns EndOfFile"""
        arg_0.index += 1
        arg_1 = arg_0.peek()
        if not arg_0.depth:
            arg_0._cut()
        return arg_1


def Func(arg_0, arg_1):
        """ Get room.

        Returns:
            :class:`Room`. Room
        """
        if arg_1 not in arg_0._rooms:
            arg_0._rooms[arg_1] = Room(arg_0, arg_1)
        return arg_0._rooms[arg_1]

Get room.

        Returns:
            :class:`Room`. Room


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = controllers . Func ( store , arg_0 , arg_1 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Display a specific STR variant."""
    arg_3 = controllers.Func(store, arg_0, arg_1, arg_2)
    return arg_3


return (yield from self.handle_set(self.API.get('sleep'), int(value)))

def Func ( arg_0 , arg_1 = False ) : return ( yield from arg_0 . handle_set ( arg_0 . API . get ( 'sleep' ) , int ( arg_1 ) ) )

def Func(arg_0, arg_1=False):
        """Set device sleep timer."""
        return (yield from arg_0.handle_set(arg_0.API.get('sleep'), int(arg_1)))


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 / MODULE_FILENAME if not arg_2 . exists ( ) : raise MissingFile ( arg_2 ) arg_3 = _parse_document_id ( etree . parse ( arg_2 . open ( ) ) ) arg_1 = arg_1 or [ ] arg_1 . extend ( [ lambda filepath : filepath . name == MODULE_FILENAME , ] ) arg_4 = _find_resources ( arg_0 , arg_1 = arg_1 ) arg_5 = tuple ( _resource_from_path ( res ) for res in arg_4 ) return Module ( arg_3 , arg_2 , arg_5 )

def Func(arg_0, arg_1=None):
    """Parse the file structure to a data structure given the path to
    a module directory.

    """
    arg_2 = arg_0 / MODULE_FILENAME

    if not arg_2.exists():
        raise MissingFile(arg_2)
    arg_3 = _parse_document_id(etree.parse(arg_2.open()))

    arg_1 = arg_1 or []
    arg_1.extend([
        lambda filepath: filepath.name == MODULE_FILENAME,
    ])

    arg_4 = _find_resources(arg_0, arg_1=arg_1)
    arg_5 = tuple(_resource_from_path(res) for res in arg_4)

    return Module(arg_3, arg_2, arg_5)

Parse the file structure to a data structure given the path to a module directory .


def Func ( arg_0 ) : if arg_0 . _future . running ( ) : arg_1 = JobStatus . RUNNING elif arg_0 . _future . cancelled ( ) : arg_1 = JobStatus . CANCELLED elif arg_0 . _future . done ( ) : arg_1 = JobStatus . DONE if arg_0 . _future . exception ( ) is None else JobStatus . ERROR else : arg_1 = JobStatus . INITIALIZING return arg_1

def Func(arg_0):
        """Gets the Func of the job by querying the Python's future

        Returns:
            qiskit.providers.JobStatus: The current JobStatus

        Raises:
            JobError: If the future is in unexpected state
            concurrent.futures.TimeoutError: if timeout occurred.
        """
        # The order is important here
        if arg_0._future.running():
            arg_1 = JobStatus.RUNNING
        elif arg_0._future.cancelled():
            arg_1 = JobStatus.CANCELLED
        elif arg_0._future.done():
            arg_1 = JobStatus.DONE if arg_0._future.exception() is None else JobStatus.ERROR
        else:
            # Note: There is an undocumented Future state: PENDING, that seems to show up when
            # the job is enqueued, waiting for someone to pick it up. We need to deal with this
            # state but there's no public API for it, so we are assuming that if the job is not
            # in any of the previous states, is PENDING, ergo INITIALIZING for us.
            arg_1 = JobStatus.INITIALIZING

        return arg_1

Gets the status of the job by querying the Python's future

        Returns:
            qiskit.providers.JobStatus: The current JobStatus

        Raises:
            JobError: If the future is in unexpected state
            concurrent.futures.TimeoutError: if timeout occurred.

Gets the status of the job by querying the Python s future


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
        """optik callback for option setting"""
        if arg_2.startswith("--"):
            # remove -- on long option
            arg_2 = arg_2[2:]
        else:
            # short option, get its long equivalent
            arg_2 = arg_0._short_options[arg_2[1:]]
        # trick since we can't set action='store_true' on options
        if arg_3 is None:
            arg_3 = 1
        arg_0.global_set_option(arg_2, arg_3)


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . compute ( * arg_1 ) return arg_0 . _extract_costs ( arg_2 )

def Func(arg_0, arg_1):
        """
        Run the model with validation data and return costs.
        """
        arg_2 = arg_0.compute(*arg_1)
        return arg_0._extract_costs(arg_2)

Run the model with validation data and return costs .


def Func(arg_0, arg_1):
        """Receive NAK in RENEWING state."""
        logger.debug("C3.1. Received NAK?, in RENEWING state.")
        if arg_0.process_received_nak(arg_1):
            logger.debug("C3.1: T. Received NAK, in RENEWING state, "
                         " raise INIT.")
            raise arg_0.INIT()


def Func(arg_0, arg_1, arg_2):
    """Compute the score of an estimator on a given test set."""
    arg_3 = arg_2(arg_0, arg_1)
    if not isinstance(arg_3, numbers.Number):
        raise ValueError("scoring must return a number, got %s (%s) instead."
                         % (str(arg_3), type(arg_3)))
    return arg_3

Compute the score of an estimator on a given test set .


def Func ( arg_0 , arg_1 ) : if arg_0 . _wrapAround : return topology . wrappingNeighborhood ( arg_1 , arg_0 . _inhibitionRadius , arg_0 . _columnDimensions ) else : return topology . neighborhood ( arg_1 , arg_0 . _inhibitionRadius , arg_0 . _columnDimensions )

def Func(arg_0, arg_1):
    """
    Gets a neighborhood of columns.

    Simply calls topology.neighborhood or topology.wrappingNeighborhood

    A subclass can insert different topology behavior by overriding this method.

    :param centerColumn (int)
    The center of the neighborhood.

    @returns (1D numpy array of integers)
    The columns in the neighborhood.
    """
    if arg_0._wrapAround:
      return topology.wrappingNeighborhood(arg_1,
                                           arg_0._inhibitionRadius,
                                           arg_0._columnDimensions)

    else:
      return topology.neighborhood(arg_1,
                                   arg_0._inhibitionRadius,
                                   arg_0._columnDimensions)


def Func ( arg_0 ) : if 'http' not in arg_0 . domains : httpdomain . Func ( arg_0 ) arg_0 . add_directive ( 'autopyramid' , RouteDirective )

def Func(arg_0):
    """Hook the directives when Sphinx ask for it."""
    if 'http' not in arg_0.domains:
        httpdomain.Func(arg_0)

    arg_0.add_directive('autopyramid', RouteDirective)

Hook the directives when Sphinx ask for it .


def Func ( arg_0 ) : arg_1 = nav_one ( arg_0 ) . O_RATTR [ 106 ] . O_BATTR [ 113 ] . O_ATTR [ 106 ] ( ) if arg_1 : return Func ( arg_1 ) else : return arg_0

def Func(arg_0):
    '''
    Get the the referred attribute.
    '''
    arg_1 = nav_one(arg_0).O_RATTR[106].O_BATTR[113].O_ATTR[106]()
    if arg_1:
        return Func(arg_1)
    else:
        return arg_0


def Func ( arg_0 , arg_1 = 3 ) : Func = arg_0 . split ( "edges" , at = "coords" ) . unstack ( ) Func [ "lx" ] = Func . x [ 1 ] - Func . x [ 0 ] Func [ "ly" ] = Func . y [ 1 ] - Func . y [ 0 ] Func [ "lz" ] = Func . z [ 1 ] - Func . z [ 0 ] Func [ "l" ] = np . linalg . norm ( Func [ [ "lx" , "ly" , "lz" ] ] , axis = 1 ) Func = ( Func . l ) . unstack ( ) Func . columns = pd . MultiIndex . from_product ( [ [ "length" ] , [ "e" + "{0}" . format ( s ) . zfill ( arg_1 ) for s in np . arange ( Func . shape [ 1 ] ) ] ] ) Func [ ( "stats" , "lmax" ) ] = Func . length . max ( axis = 1 ) Func [ ( "stats" , "lmin" ) ] = Func . length . min ( axis = 1 ) Func [ ( "stats" , "aspect_ratio" ) ] = Func . stats . lmax / Func . stats . lmin return Func . sort_index ( axis = 1 )

def Func(arg_0, arg_1 = 3):
    """
    Returns the aspect ratio of all elements.
    """
    Func = arg_0.split("edges", at = "coords").unstack()
    Func["lx"] = Func.x[1]-Func.x[0]
    Func["ly"] = Func.y[1]-Func.y[0]
    Func["lz"] = Func.z[1]-Func.z[0]
    Func["l"] = np.linalg.norm(Func[["lx", "ly", "lz"]], axis = 1)
    Func = (Func.l).unstack()
    Func.columns = pd.MultiIndex.from_product([["length"],
                    ["e" + "{0}".format(s).zfill(arg_1)
                    for s in np.arange(Func.shape[1])]])
    Func[("stats", "lmax")] = Func.length.max(axis = 1)
    Func[("stats", "lmin")] = Func.length.min(axis = 1)
    Func[("stats", "aspect_ratio")] = Func.stats.lmax / Func.stats.lmin
    return Func.sort_index(axis = 1)

Returns the aspect ratio of all elements .


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
"Adding user %s to the database"
,
arg_1
[
'email'
]
)
if
not
'_id'
in
arg_1
:
arg_1
[
'_id'
]
=
arg_1
[
'email'
]
try
:
arg_0
.
user_collection
.
insert_one
(
arg_1
)
LOG
.
debug
(
"User inserted"
)
except
DuplicateKeyError
as
err
:
raise
IntegrityError
(
"User {} already exists in database"
.
format
(
arg_1
[
'email'
]
)
)
return
arg_1

def Func(arg_0, arg_1):
        """Add a user object to the database

            Args:
                user_obj(scout.models.User): A dictionary with user information

            Returns:
                user_info(dict): a copy of what was inserted
        """
        LOG.info("Adding user %s to the database", arg_1['email'])
        if not '_id' in arg_1:
            arg_1['_id'] = arg_1['email']

        try:
            arg_0.user_collection.insert_one(arg_1)
            LOG.debug("User inserted")
        except DuplicateKeyError as err:
            raise IntegrityError("User {} already exists in database".format(arg_1['email']))

        return arg_1


return {
        'enterprise_customer': enterprise_customer,
        'LMS_SEGMENT_KEY': settings.LMS_SEGMENT_KEY,
        'LANGUAGE_CODE': get_language_from_request(request),
        'tagline': get_configuration_value("ENTERPRISE_TAGLINE", settings.ENTERPRISE_TAGLINE),
        'platform_description': get_configuration_value(
            "PLATFORM_DESCRIPTION",
            settings.PLATFORM_DESCRIPTION,
        ),
        'LMS_ROOT_URL': settings.LMS_ROOT_URL,
        'platform_name': platform_name,
        'header_logo_alt_text': _('{platform_name} home page').format(platform_name=platform_name),
        'welcome_text': constants.WELCOME_TEXT.format(platform_name=platform_name),
        'enterprise_welcome_text': constants.ENTERPRISE_WELCOME_TEXT.format(
            enterprise_customer_name=enterprise_customer.name,
            platform_name=platform_name,
            strong_start='',
            strong_end='',
            line_break='
',
            privacy_policy_link_start="".format(
                pp_url=get_configuration_value('PRIVACY', 'https://www.edx.org/edx-privacy-policy', type='url'),
            ),
            privacy_policy_link_end="",
        ),
    }

def Func(arg_0, arg_1):
    """
    Get the set of variables that are needed by default across views.
    """
    arg_2 = get_configuration_value("PLATFORM_NAME", settings.PLATFORM_NAME)
    # pylint: disable=no-member
    return {
        'enterprise_customer': arg_1,
        'LMS_SEGMENT_KEY': settings.LMS_SEGMENT_KEY,
        'LANGUAGE_CODE': get_language_from_request(arg_0),
        'tagline': get_configuration_value("ENTERPRISE_TAGLINE", settings.ENTERPRISE_TAGLINE),
        'platform_description': get_configuration_value(
            "PLATFORM_DESCRIPTION",
            settings.PLATFORM_DESCRIPTION,
        ),
        'LMS_ROOT_URL': settings.LMS_ROOT_URL,
        'platform_name': arg_2,
        'header_logo_alt_text': _('{platform_name} home page').format(arg_2=arg_2),
        'welcome_text': constants.WELCOME_TEXT.format(arg_2=arg_2),
        'enterprise_welcome_text': constants.ENTERPRISE_WELCOME_TEXT.format(
            enterprise_customer_name=arg_1.name,
            arg_2=arg_2,
            strong_start='',
            strong_end='',
            line_break='
',
            privacy_policy_link_start="".format(
                pp_url=get_configuration_value('PRIVACY', 'https://www.edx.org/edx-privacy-policy', type='url'),
            ),
            privacy_policy_link_end="",
        ),
    }

Get the set of variables that are needed by default across views .


(adjacency, edge_type=None, adjust=1, **kwargs)

def Func(arg_0, arg_1=None, arg_2=1, **arg_3):
    """Takes an adjacency list, dict, or matrix and returns a graph.

    The purpose of this function is take an adjacency list (or matrix)
    and return a :class:`.QueueNetworkDiGraph` that can be used with a
    :class:`.QueueNetwork` instance. The Graph returned has the
    ``edge_type`` edge property set for each edge. Note that the graph may
    be altered.

    Parameters
    ----------
    adjacency : dict or :class:`~numpy.ndarray`
        An adjacency list as either a dict, or an adjacency matrix.
    adjust : int ``{1, 2}`` (optional, default: 1)
        Specifies what to do when the graph has terminal vertices
        (nodes with no out-edges). Note that if ``adjust`` is not 2
        then it is assumed to be 1. There are two choices:

        * ``adjust = 1``: A loop is added to each terminal node in the
          graph, and their ``edge_type`` of that loop is set to 0.
        * ``adjust = 2``: All edges leading to terminal nodes have
          their ``edge_type`` set to 0.

    **kwargs :
        Unused.

    Returns
    -------
    out : :any:`networkx.DiGraph`
        A directed graph with the ``edge_type`` edge property.

    Raises
    ------
    TypeError
        Is raised if ``adjacency`` is not a dict or
        :class:`~numpy.ndarray`.

    Examples
    --------
    If terminal nodes are such that all in-edges have edge type ``0``
    then nothing is changed. However, if a node is a terminal node then
    a loop is added with edge type 0.

    >>> import queueing_tool as qt
    >>> adj = {
    ...     0: {1: {}},
    ...     1: {2: {},
    ...         3: {}},
    ...     3: {0: {}}}
    >>> eTy = {0: {1: 1}, 1: {2: 2, 3: 4}, 3: {0: 1}}
    >>> # A loop will be added to vertex 2
    >>> g = qt.Func(adj, edge_type=eTy)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 2}, 3: {'edge_type': 4}}),
     (2, {2: {'edge_type': 0}}),
     (3, {0: {'edge_type': 1}})]

    You can use a dict of lists to represent the adjacency list.

    >>> adj = {0 : [1], 1: [2, 3], 3: [0]}
    >>> g = qt.Func(adj, edge_type=eTy)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 2}, 3: {'edge_type': 4}}),
     (2, {2: {'edge_type': 0}}),
     (3, {0: {'edge_type': 1}})]

    Alternatively, you could have this function adjust the edges that
    lead to terminal vertices by changing their edge type to 0:

    >>> # The graph is unaltered
    >>> g = qt.Func(adj, edge_type=eTy, adjust=2)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 0}, 3: {'edge_type': 4}}),
     (2, {}),
     (3, {0: {'edge_type': 1}})]
    """

    if isinstance(arg_0, np.ndarray):
        arg_0 = _matrix2dict(arg_0)
    elif isinstance(arg_0, dict):
        arg_0 = _dict2dict(arg_0)
    else:
        arg_4 = ("If the adjacency parameter is supplied it must be a "
               "dict, or a numpy.ndarray.")
        raise TypeError(arg_4)

    if arg_1 is None:
        arg_1 = {}
    else:
        if isinstance(arg_1, np.ndarray):
            arg_1 = _matrix2dict(arg_1, etype=True)
        elif isinstance(arg_1, dict):
            arg_1 = _dict2dict(arg_1)

    for arg_5, arg_6 in arg_1.items():
        for arg_7, arg_8 in arg_6.items():
            arg_0[arg_5][arg_7]['edge_type'] = arg_8

    arg_9 = nx.from_dict_of_dicts(arg_0, create_using=nx.DiGraph())
    arg_0 = nx.to_dict_of_dicts(arg_9)
    arg_0 = _adjacency_adjust(arg_0, arg_2, True)

    return nx.from_dict_of_dicts(arg_0, create_using=nx.DiGraph())

Takes an adjacency list, dict, or matrix and returns a graph.

    The purpose of this function is take an adjacency list (or matrix)
    and return a :class:`.QueueNetworkDiGraph` that can be used with a
    :class:`.QueueNetwork` instance. The Graph returned has the
    ``edge_type`` edge property set for each edge. Note that the graph may
    be altered.

    Parameters
    ----------
    adjacency : dict or :class:`~numpy.ndarray`
        An adjacency list as either a dict, or an adjacency matrix.
    adjust : int ``{1, 2}`` (optional, default: 1)
        Specifies what to do when the graph has terminal vertices
        (nodes with no out-edges). Note that if ``adjust`` is not 2
        then it is assumed to be 1. There are two choices:

        * ``adjust = 1``: A loop is added to each terminal node in the
          graph, and their ``edge_type`` of that loop is set to 0.
        * ``adjust = 2``: All edges leading to terminal nodes have
          their ``edge_type`` set to 0.

    **kwargs :
        Unused.

    Returns
    -------
    out : :any:`networkx.DiGraph`
        A directed graph with the ``edge_type`` edge property.

    Raises
    ------
    TypeError
        Is raised if ``adjacency`` is not a dict or
        :class:`~numpy.ndarray`.

    Examples
    --------
    If terminal nodes are such that all in-edges have edge type ``0``
    then nothing is changed. However, if a node is a terminal node then
    a loop is added with edge type 0.

    >>> import queueing_tool as qt
    >>> adj = {
    ...     0: {1: {}},
    ...     1: {2: {},
    ...         3: {}},
    ...     3: {0: {}}}
    >>> eTy = {0: {1: 1}, 1: {2: 2, 3: 4}, 3: {0: 1}}
    >>> # A loop will be added to vertex 2
    >>> g = qt.adjacency2graph(adj, edge_type=eTy)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 2}, 3: {'edge_type': 4}}),
     (2, {2: {'edge_type': 0}}),
     (3, {0: {'edge_type': 1}})]

    You can use a dict of lists to represent the adjacency list.

    >>> adj = {0 : [1], 1: [2, 3], 3: [0]}
    >>> g = qt.adjacency2graph(adj, edge_type=eTy)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 2}, 3: {'edge_type': 4}}),
     (2, {2: {'edge_type': 0}}),
     (3, {0: {'edge_type': 1}})]

    Alternatively, you could have this function adjust the edges that
    lead to terminal vertices by changing their edge type to 0:

    >>> # The graph is unaltered
    >>> g = qt.adjacency2graph(adj, edge_type=eTy, adjust=2)
    >>> ans = qt.graph2dict(g)
    >>> sorted(ans.items())     # doctest: +NORMALIZE_WHITESPACE
    [(0, {1: {'edge_type': 1}}),
     (1, {2: {'edge_type': 0}, 3: {'edge_type': 4}}),
     (2, {}),
     (3, {0: {'edge_type': 1}})]

Takes an adjacency list dict or matrix and returns a graph .


def Func ( arg_0 , arg_1 ) : arg_2 = filepath . FilePath ( arg_0 ) def _check ( arg_2 ) : arg_3 = arg_2 . globChildren ( '*' ) for arg_4 in arg_3 : if arg_4 . basename ( ) . endswith ( '.new' ) : continue arg_1 . message ( arg_4 . getContent ( ) ) arg_4 . remove ( ) return functools . partial ( _check , arg_2 )

def Func(arg_0, arg_1):
    """Construct a function that checks a directory for Func

    The function checks for new Func and
    calls the appropriate method on the receiver. Sent Func are
    deleted.

    :param location: string, the directory to monitor
    :param receiver: IEventReceiver
    :returns: a function with no parameters
    """
    arg_2 = filepath.FilePath(arg_0)

    def _check(arg_2):
        arg_3 = arg_2.globChildren('*')
        for arg_4 in arg_3:
            if arg_4.basename().endswith('.new'):
                continue
            arg_1.message(arg_4.getContent())
            arg_4.remove()
    return functools.partial(_check, arg_2)

Construct a function that checks a directory for messages

    The function checks for new messages and
    calls the appropriate method on the receiver. Sent messages are
    deleted.

    :param location: string, the directory to monitor
    :param receiver: IEventReceiver
    :returns: a function with no parameters


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . capture_sample_count = arg_0 . capture_sample_count + len ( arg_1 ) + len ( arg_2 ) if arg_0 . Tcapture > 0 : arg_0 . data_capture_left = np . hstack ( ( arg_0 . data_capture_left , arg_1 ) ) arg_0 . data_capture_right = np . hstack ( ( arg_0 . data_capture_right , arg_2 ) ) if ( len ( arg_0 . data_capture_left ) > arg_0 . Ncapture ) : arg_0 . data_capture_left = arg_0 . data_capture_left [ - arg_0 . Ncapture : ] if ( len ( arg_0 . data_capture_right ) > arg_0 . Ncapture ) : arg_0 . data_capture_right = arg_0 . data_capture_right [ - arg_0 . Ncapture : ]

def Func(arg_0,arg_1,arg_2):
        """
        Append new samples to the data_capture_left array and the data_capture_right
        array and increment the sample counter. If length reaches Tcapture, then the
        newest samples will be kept. If Tcapture = 0 then new values are not appended
        to the data_capture array.

        """
        arg_0.capture_sample_count = arg_0.capture_sample_count + len(arg_1) + len(arg_2)
        if arg_0.Tcapture > 0:
            arg_0.data_capture_left = np.hstack((arg_0.data_capture_left,arg_1))
            arg_0.data_capture_right = np.hstack((arg_0.data_capture_right,arg_2))
            if (len(arg_0.data_capture_left) > arg_0.Ncapture):
                arg_0.data_capture_left = arg_0.data_capture_left[-arg_0.Ncapture:]
            if (len(arg_0.data_capture_right) > arg_0.Ncapture):
                arg_0.data_capture_right = arg_0.data_capture_right[-arg_0.Ncapture:]

Append new samples to the data_capture_left array and the data_capture_right array and increment the sample counter . If length reaches Tcapture then the newest samples will be kept . If Tcapture = 0 then new values are not appended to the data_capture array .


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 ) arg_1 . Func ( pack ( '!q' , arg_0 . value ) )

def Func(arg_0, arg_1, arg_2=arg_3.KMIPVersion.KMIP_1_0):
        """
        Write the encoding of the LongInteger to the output stream.

        Args:
            ostream (stream): A buffer to contain 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 encoded. Optional,
                defaults to KMIP 1.0.
        """
        super(LongInteger, arg_0).Func(arg_1, arg_2=arg_2)
        arg_1.Func(pack('!q', arg_0.value))

Write the encoding of the LongInteger to the output stream .


(
        dx, dy, serpentine=True, offset=0, rotation=0, y_flip=False)

def Func(
        arg_0, arg_1, arg_2=True, arg_3=0, arg_4=0, arg_5=False):
    """Helper method to generate X,Y coordinate maps for strips"""
    arg_6 = []
    for arg_7 in range(arg_1):
        if not arg_2 or arg_7 % 2 == 0:
            arg_6.append([(arg_0 * arg_7) + arg_8 + arg_3 for arg_8 in range(arg_0)])
        else:
            arg_6.append([arg_0 * (arg_7 + 1) - 1 - arg_8 + arg_3 for arg_8 in range(arg_0)])

    arg_6 = rotate_and_flip(arg_6, arg_4, arg_5)

    return arg_6

Helper method to generate X Y coordinate maps for strips


def Func(arg_0, arg_1):
        '''
        Transforms X according to the linear Funcation corresponding to
        shifting the input eigenvalues to all be at least ``self.min_eig``.

        Parameters
        ----------
        X : array, shape [n_test, n]
            The test similarities to training points.

        Returns
        -------
        Xt : array, shape [n_test, n]
            The Funced test similarites to training points. Only different
            from X if X is the training data.
        '''
        arg_2 = arg_0.train_.shape[0]
        if arg_1.ndim != 2 or arg_1.shape[1] != arg_2:
            arg_3 = "X should have {} columns, the number of samples at fit time"
            raise TypeError(arg_3.format(arg_2))

        if arg_0.copy:
            arg_1 = arg_1.copy()

        if arg_0.shift_ != 0 and arg_1 is arg_0.train_ or (
                arg_1.shape == arg_0.train_.shape and np.allclose(arg_1, arg_0.train_)):
            arg_1[xrange(arg_2), xrange(arg_2)] += arg_0.shift_
        return arg_1

Transforms X according to the linear transformation corresponding to
        shifting the input eigenvalues to all be at least ``self.min_eig``.

        Parameters
        ----------
        X : array, shape [n_test, n]
            The test similarities to training points.

        Returns
        -------
        Xt : array, shape [n_test, n]
            The transformed test similarites to training points. Only different
            from X if X is the training data.

Transforms X according to the linear transformation corresponding to shifting the input eigenvalues to all be at least self . min_eig .


def Func ( arg_0 ) : arg_1 = b'' arg_2 = arg_0 . gettimeout ( ) try : arg_0 . settimeout ( 0.0 ) arg_1 += arg_0 . recv ( 8192 ) except ( socket_ . error ) : pass finally : arg_0 . settimeout ( arg_2 ) return arg_1

def Func(arg_0):
    """
    Reads everything available from the socket - used for debugging when there
    is a protocol error

    :param socket:
        The socket to read from

    :return:
        A byte string of the remaining data
    """

    arg_1 = b''
    arg_2 = arg_0.gettimeout()
    try:
        arg_0.settimeout(0.0)
        arg_1 += arg_0.recv(8192)
    except (socket_.error):
        pass
    finally:
        arg_0.settimeout(arg_2)
    return arg_1


(
        self,
        token_url,
        refresh_token=None,
        body="",
        auth=None,
        timeout=None,
        headers=None,
        verify=True,
        proxies=None,
        **kwargs
    )

def Func(
        arg_0,
        arg_1,
        Func=None,
        arg_3="",
        arg_4=None,
        arg_5=None,
        arg_6=None,
        arg_7=True,
        arg_8=None,
        **arg_9
    ):
        """Fetch a new access token using a refresh token.

        :param token_url: The token endpoint, must be HTTPS.
        :param refresh_token: The refresh_token to use.
        :param body: Optional application/x-www-form-urlencoded body to add the
                     include in the token request. Prefer kwargs over body.
        :param auth: An auth tuple or method as accepted by `requests`.
        :param timeout: Timeout of the request in seconds.
        :param headers: A dict of headers to be used by `requests`.
        :param verify: Verify SSL certificate.
        :param proxies: The `proxies` argument will be passed to `requests`.
        :param kwargs: Extra parameters to include in the token request.
        :return: A token dict
        """
        if not arg_1:
            raise ValueError("No token endpoint set for auto_refresh.")

        if not is_secure_transport(arg_1):
            raise InsecureTransportError()

        Func = Func or arg_0.token.get("refresh_token")

        log.debug(
            "Adding auto refresh key word arguments %s.", arg_0.auto_refresh_kwargs
        )
        arg_9.update(arg_0.auto_refresh_kwargs)
        arg_3 = arg_0._client.prepare_refresh_body(
            arg_3=arg_3, Func=Func, scope=arg_0.scope, **arg_9
        )
        log.debug("Prepared refresh token request body %s", arg_3)

        if arg_6 is None:
            arg_6 = {
                "Accept": "application/json",
                "Content-Type": ("application/x-www-form-urlencoded;charset=UTF-8"),
            }

        arg_10 = arg_0.post(
            arg_1,
            data=dict(urldecode(arg_3)),
            arg_4=arg_4,
            arg_5=arg_5,
            arg_6=arg_6,
            arg_7=arg_7,
            withhold_token=True,
            arg_8=arg_8,
        )
        log.debug("Request to refresh token completed with status %s.", arg_10.status_code)
        log.debug("Response headers were %s and content %s.", arg_10.headers, arg_10.text)
        log.debug(
            "Invoking %d token response hooks.",
            len(arg_0.compliance_hook["refresh_token_response"]),
        )
        for arg_11 in arg_0.compliance_hook["refresh_token_response"]:
            log.debug("Invoking hook %s.", arg_11)
            arg_10 = arg_11(arg_10)

        arg_0.token = arg_0._client.parse_request_body_response(arg_10.text, scope=arg_0.scope)
        if not "refresh_token" in arg_0.token:
            log.debug("No new refresh token given. Re-using old.")
            arg_0.token["refresh_token"] = Func
        return arg_0.token

Fetch a new access token using a refresh token .


(value_and_gradients_function,
           initial_left,
           initial_right,
           f_lim)

return _bisect(value_and_gradients_function, bisect_args, f_lim)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = ~ is_finite ( arg_1 , arg_2 ) arg_5 = ( arg_2 . df < 0 ) & ( arg_2 . f > arg_3 ) arg_6 = _IntermediateResult ( iteration = tf . convert_to_tensor ( value = 0 ) , stopped = arg_4 | ~ arg_5 , arg_4 = arg_4 , num_evals = tf . convert_to_tensor ( value = 0 ) , left = arg_1 , right = arg_2 ) return _Func ( arg_0 , arg_6 , arg_3 )

def Func(arg_0,
           arg_1,
           arg_2,
           arg_3):
  """Bisects an interval and updates to satisfy opposite slope conditions.

  Corresponds to the step U3 in [Hager and Zhang (2006)][2].

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns a namedtuple containing the value filed `f` of the
      function and its derivative value field `df` at that point.
      Alternatively, the function may representthe batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and return a tuple of two tensors of shape [n], the
      function values and the corresponding derivatives at the input points.
    initial_left: Return value of value_and_gradients_function at the left end
      point of the current bracketing interval.
    initial_right: Return value of value_and_gradients_function at the right end
      point of the current bracketing interval.
    f_lim: real `Tensor` of shape [n]. The function value threshold for
      the approximate Wolfe conditions to be checked for each batch member.

  Returns:
    A namedtuple containing the following fields:
      iteration: An int32 scalar `Tensor`. The number of iterations performed.
        Bounded above by `max_iterations` parameter.
      stopped: A boolean scalar `Tensor`. True if the Func algorithm
        terminated.
      failed: A scalar boolean tensor. Indicates whether the objective function
        failed to produce a finite value.
      num_evals: A scalar int32 tensor. The number of value and gradients
        function evaluations.
      left: Return value of value_and_gradients_function at the left end
        point of the bracketing interval found.
      right: Return value of value_and_gradients_function at the right end
        point of the bracketing interval found.
  """
  arg_4 = ~is_finite(arg_1, arg_2)
  arg_5 = (arg_2.df < 0) & (arg_2.f > arg_3)
  arg_6 = _IntermediateResult(
      iteration=tf.convert_to_tensor(value=0),
      stopped=arg_4 | ~arg_5,
      arg_4=arg_4,
      num_evals=tf.convert_to_tensor(value=0),
      left=arg_1,
      right=arg_2)
  return _Func(arg_0, arg_6, arg_3)

Bisects an interval and updates to satisfy opposite slope conditions.

  Corresponds to the step U3 in [Hager and Zhang (2006)][2].

  Args:
    value_and_gradients_function: A Python callable that accepts a real scalar
      tensor and returns a namedtuple containing the value filed `f` of the
      function and its derivative value field `df` at that point.
      Alternatively, the function may representthe batching of `n` such line
      functions (e.g. projecting a single multivariate objective function along
      `n` distinct directions at once) accepting n points as input, i.e. a
      tensor of shape [n], and return a tuple of two tensors of shape [n], the
      function values and the corresponding derivatives at the input points.
    initial_left: Return value of value_and_gradients_function at the left end
      point of the current bracketing interval.
    initial_right: Return value of value_and_gradients_function at the right end
      point of the current bracketing interval.
    f_lim: real `Tensor` of shape [n]. The function value threshold for
      the approximate Wolfe conditions to be checked for each batch member.

  Returns:
    A namedtuple containing the following fields:
      iteration: An int32 scalar `Tensor`. The number of iterations performed.
        Bounded above by `max_iterations` parameter.
      stopped: A boolean scalar `Tensor`. True if the bisect algorithm
        terminated.
      failed: A scalar boolean tensor. Indicates whether the objective function
        failed to produce a finite value.
      num_evals: A scalar int32 tensor. The number of value and gradients
        function evaluations.
      left: Return value of value_and_gradients_function at the left end
        point of the bracketing interval found.
      right: Return value of value_and_gradients_function at the right end
        point of the bracketing interval found.

Bisects an interval and updates to satisfy opposite slope conditions .


(lspinfo,
                     plotdpi=100,
                     override_pfmethod=None)

def
Func
(
arg_0
,
arg_1
=
100
,
arg_2
=
)
:
arg_3
=
PLOTYLABELS
[
arg_0
[
'method'
]
]
arg_4
=
arg_0
[
'periods'
]
arg_5
=
arg_0
[
'lspvals'
]
arg_6
=
arg_0
[
'bestperiod'
]
arg_7
=
arg_0
[
'nbestperiods'
]
arg_8
=
arg_0
[
'nbestlspvals'
]
arg_9
=
plt
.
figure
(
figsize
=
(
7.5
,
4.8
)
,
dpi
=
arg_1
)
plt
.
plot
(
arg_4
,
arg_5
)
plt
.
xscale
(
'log'
,
basex
=
10
)
plt
.
xlabel
(
'Period [days]'
)
plt
.
ylabel
(
arg_3
)
arg_10
=
'%s - %.6f d'
%
(
METHODLABELS
[
arg_0
[
'method'
]
]
,
arg_6
)
plt
.
title
(
arg_10
)
for
arg_11
,
arg_12
in
zip
(
arg_7
,
arg_8
)
:
plt
.
annotate
(
'%.6f'
%
arg_11
,
xy
=
(
arg_11
,
arg_12
)
,
xycoords
=
'data'
,
xytext
=
(
0.0
,
25.0
)
,
textcoords
=
'offset points'
,
arrowprops
=
dict
(
arrowstyle
=
"->"
)
,
fontsize
=
'14.0'
)
plt
.
grid
(
color
=
'#a9a9a9'
,
alpha
=
0.9
,
zorder
=
0
,
linewidth
=
1.0
,
linestyle
=
':'
)
arg_13
=
StrIO
(
)
arg_9
.
savefig
(
arg_13
,
pad_inches
=
0.0
,
format
=
'png'
)
plt
.
close
(
)
arg_13
.
seek
(
0
)
arg_14
=
base64
.
b64encode
(
arg_13
.
read
(
)
)
arg_13
.
close
(
)
if
not
arg_2
:
arg_15
=
{
arg_0
[
'method'
]
:
{
'periods'
:
arg_4
,
'lspvals'
:
arg_5
,
'bestperiod'
:
arg_6
,
'nbestperiods'
:
arg_7
,
'nbestlspvals'
:
arg_8
,
'periodogram'
:
arg_14
,
}
}
else
:
arg_15
=
{
arg_2
:
{
'periods'
:
arg_4
,
'lspvals'
:
arg_5
,
'bestperiod'
:
arg_6
,
'nbestperiods'
:
arg_7
,
'nbestlspvals'
:
arg_8
,
'periodogram'
:
arg_14
,
}
}
return
arg_15

def Func(arg_0,
                     arg_1=100,
                     arg_2=None):
    '''This returns the periodogram plot PNG as base64, plus info as a dict.

    Parameters
    ----------

    lspinfo : dict
        This is an lspinfo dict containing results from a period-finding
        function. If it's from an astrobase period-finding function in
        periodbase, this will already be in the correct format. To use external
        period-finder results with this function, the `lspinfo` dict must be of
        the following form, with at least the keys listed below::

            {'periods': np.array of all periods searched by the period-finder,
             'lspvals': np.array of periodogram power value for each period,
             'bestperiod': a float value that is the period with the highest
                           peak in the periodogram, i.e. the most-likely actual
                           period,
             'method': a three-letter code naming the period-finder used; must
                       be one of the keys in the
                       `astrobase.periodbase.METHODLABELS` dict,
             'nbestperiods': a list of the periods corresponding to periodogram
                             peaks (`nbestlspvals` below) to annotate on the
                             periodogram plot so they can be called out
                             visually,
             'nbestlspvals': a list of the power values associated with
                             periodogram peaks to annotate on the periodogram
                             plot so they can be called out visually; should be
                             the same length as `nbestperiods` above}

        `nbestperiods` and `nbestlspvals` must have at least 5 elements each,
        e.g. describing the five 'best' (highest power) peaks in the
        periodogram.

    plotdpi : int
        The resolution in DPI of the output periodogram plot to make.

    override_pfmethod : str or None
        This is used to set a custom label for this periodogram
        method. Normally, this is taken from the 'method' key in the input
        `lspinfo` dict, but if you want to override the output method name,
        provide this as a string here. This can be useful if you have multiple
        results you want to incorporate into a checkplotdict from a single
        period-finder (e.g. if you ran BLS over several period ranges
        separately).

    Returns
    -------

    dict
        Returns a dict that contains the following items::

            {methodname: {'periods':the period array from lspinfo,
                          'lspval': the periodogram power array from lspinfo,
                          'bestperiod': the best period from lspinfo,
                          'nbestperiods': the 'nbestperiods' list from lspinfo,
                          'nbestlspvals': the 'nbestlspvals' list from lspinfo,
                          'periodogram': base64 encoded string representation of
                                         the periodogram plot}}

        The dict is returned in this format so it can be directly incorporated
        under the period-finder's label `methodname` in a checkplotdict, using
        Python's dict `update()` method.

    '''

    # get the appropriate plot ylabel
    arg_3 = PLOTYLABELS[arg_0['method']]

    # get the periods and lspvals from lspinfo
    arg_4 = arg_0['periods']
    arg_5 = arg_0['lspvals']
    arg_6 = arg_0['bestperiod']
    arg_7 = arg_0['nbestperiods']
    arg_8 = arg_0['nbestlspvals']

    # open the figure instance
    arg_9 = plt.figure(figsize=(7.5,4.8),dpi=arg_1)

    # make the plot
    plt.plot(arg_4,arg_5)

    plt.xscale('log',basex=10)
    plt.xlabel('Period [days]')
    plt.ylabel(arg_3)
    arg_10 = '%s - %.6f d' % (METHODLABELS[arg_0['method']],
                                 arg_6)
    plt.title(arg_10)

    # show the best five peaks on the plot
    for arg_11, arg_12 in zip(arg_7,
                                      arg_8):
        plt.annotate('%.6f' % arg_11,
                     xy=(arg_11, arg_12), xycoords='data',
                     xytext=(0.0,25.0), textcoords='offset points',
                     arrowprops=dict(arrowstyle="->"),fontsize='14.0')

    # make a grid
    plt.grid(color='#a9a9a9',
             alpha=0.9,
             zorder=0,
             linewidth=1.0,
             linestyle=':')

    # this is the output instance
    arg_13 = StrIO()
    arg_9.savefig(arg_13,
                     # bbox_inches='tight',
                     pad_inches=0.0, format='png')
    plt.close()

    # encode the finderpng instance to base64
    arg_13.seek(0)
    arg_14 = base64.b64encode(arg_13.read())

    # close the stringio buffer
    arg_13.close()

    if not arg_2:

        # this is the dict to return
        arg_15 = {
            arg_0['method']:{
                'periods':arg_4,
                'lspvals':arg_5,
                'bestperiod':arg_6,
                'nbestperiods':arg_7,
                'nbestlspvals':arg_8,
                'periodogram':arg_14,
            }
        }

    else:

        # this is the dict to return
        arg_15 = {
            arg_2:{
                'periods':arg_4,
                'lspvals':arg_5,
                'bestperiod':arg_6,
                'nbestperiods':arg_7,
                'nbestlspvals':arg_8,
                'periodogram':arg_14,
            }
        }

    return arg_15

This returns the periodogram plot PNG as base64 plus info as a dict .


def Func ( arg_0 , arg_1 ) : arg_0 . encryption_passphrases = arg_0 . _update_dict ( arg_1 , { } , replace_data = True )

def Func(arg_0, arg_1):
        '''Set encryption passphrases'''
        arg_0.encryption_passphrases = arg_0._update_dict(arg_1,
                                                        {}, replace_data=True)


def
Func
(
arg_0
=
)
:
if
os
.
name
==
'posix'
:
arg_1
=
'less -r'
elif
os
.
name
in
[
'nt'
,
'dos'
]
:
arg_1
=
'type'
if
arg_0
is
:
try
:
arg_0
=
os
.
environ
[
'PAGER'
]
except
:
arg_0
=
arg_1
return
arg_0

def Func(arg_0=None):
    """Return a pager command.

    Makes some attempts at finding an OS-correct one.
    """
    if os.name == 'posix':
        arg_1 = 'less -r'  # -r for color control sequences
    elif os.name in ['nt','dos']:
        arg_1 = 'type'

    if arg_0 is None:
        try:
            arg_0 = os.environ['PAGER']
        except:
            arg_0 = arg_1
    return arg_0


def Func(arg_0, arg_1):
        """ Sets the blob dimmentions, trying to read around 1024 MiB at a time.
            This is assuming a chunk is about 1 MiB.
        """

        #Taking the size into consideration, but avoiding having multiple blobs within a single time bin.
        if arg_0.selection_shape[arg_0.freq_axis] > arg_1[arg_0.freq_axis]*MAX_BLOB_MB:
            arg_2 = arg_0.selection_shape[arg_0.freq_axis]
#             while freq_axis_size > chunk_dim[self.freq_axis]*MAX_BLOB_MB:
#                 freq_axis_size /= 2
            arg_3 = 1
        else:
            arg_2 = arg_0.selection_shape[arg_0.freq_axis]
            arg_3 = np.min([arg_1[arg_0.time_axis] * MAX_BLOB_MB * arg_1[arg_0.freq_axis] / arg_2, arg_0.selection_shape[arg_0.time_axis]])

        arg_4 = (int(arg_3), 1, arg_2)

        return arg_4

Sets the blob dimmentions trying to read around 1024 MiB at a time . This is assuming a chunk is about 1 MiB .


def Func ( arg_0 , arg_1 ) : arg_1 . write ( Operators . ITEBV ( arg_1 . size , Operators . AND ( arg_0 . ZF == False , arg_0 . SF == arg_0 . OF ) , 1 , 0 ) )

def Func(arg_0, arg_1):
        """
        Sets byte if not less or equal.

        :param cpu: current CPU.
        :param dest: destination operand.
        """
        arg_1.write(Operators.ITEBV(arg_1.size, Operators.AND(arg_0.ZF == False, arg_0.SF == arg_0.OF), 1, 0))


def Func ( arg_0 ) -> pd . Timestamp : return pd . to_datetime ( time . ctime ( os . path . getmtime ( filename = arg_0 ) ) )

def Func(arg_0) -> pd.Timestamp:
    """
    File modified time in python

    Args:
        file_name: file name

    Returns:
        pd.Timestamp
    """
    return pd.to_datetime(time.ctime(os.path.getmtime(filename=arg_0)))