(
            self, app_id, event_type, timespan=None, filter=None, search=None, orderby=None, select=None, skip=None, top=None, format=None, count=None, apply=None, custom_headers=None, raw=False, **operation_config)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = None , arg_4 = None , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , arg_11 = None , arg_12 = None , arg_13 = None , arg_14 = False , ** arg_15 ) : arg_16 = arg_0 . Func . metadata [ 'url' ] arg_17 = { 'appId' : arg_0 . _serialize . url ( "app_id" , arg_1 , 'str' ) , 'eventType' : arg_0 . _serialize . url ( "event_type" , arg_2 , 'str' ) } arg_16 = arg_0 . _client . format_url ( arg_16 , ** arg_17 ) arg_18 = { } if arg_3 is not None : arg_18 [ 'timespan' ] = arg_0 . _serialize . query ( "timespan" , arg_3 , 'str' ) if arg_4 is not None : arg_18 [ '$filter' ] = arg_0 . _serialize . query ( "filter" , arg_4 , 'str' ) if arg_5 is not None : arg_18 [ '$search' ] = arg_0 . _serialize . query ( "search" , arg_5 , 'str' ) if arg_6 is not None : arg_18 [ '$orderby' ] = arg_0 . _serialize . query ( "orderby" , arg_6 , 'str' ) if arg_7 is not None : arg_18 [ '$select' ] = arg_0 . _serialize . query ( "select" , arg_7 , 'str' ) if arg_8 is not None : arg_18 [ '$skip' ] = arg_0 . _serialize . query ( "skip" , arg_8 , 'int' ) if arg_9 is not None : arg_18 [ '$top' ] = arg_0 . _serialize . query ( "top" , arg_9 , 'int' ) if arg_10 is not None : arg_18 [ '$format' ] = arg_0 . _serialize . query ( "format" , arg_10 , 'str' ) if arg_11 is not None : arg_18 [ '$count' ] = arg_0 . _serialize . query ( "count" , arg_11 , 'bool' ) if arg_12 is not None : arg_18 [ '$apply' ] = arg_0 . _serialize . query ( "apply" , arg_12 , 'str' ) arg_19 = { } arg_19 [ 'Accept' ] = 'application/json' if arg_13 : arg_19 . update ( arg_13 ) arg_20 = arg_0 . _client . get ( arg_16 , arg_18 , arg_19 ) arg_21 = arg_0 . _client . send ( arg_20 , stream = False , ** arg_15 ) if arg_21 . status_code not in [ 200 ] : raise models . ErrorResponseException ( arg_0 . _deserialize , arg_21 ) arg_22 = None if arg_21 . status_code == 200 : arg_22 = arg_0 . _deserialize ( 'EventsResults' , arg_21 ) if arg_14 : arg_23 = ClientRawResponse ( arg_22 , arg_21 ) return arg_23 return arg_22

def Func(
            arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=None, arg_9=None, arg_10=None, arg_11=None, arg_12=None, arg_13=None, arg_14=False, **arg_15):
        """Execute OData query.

        Executes an OData query for events.

        :param app_id: ID of the application. This is Application ID from the
         API Access settings blade in the Azure portal.
        :type app_id: str
        :param event_type: The type of events to query; either a standard
         event type (`traces`, `customEvents`, `pageViews`, `requests`,
         `dependencies`, `exceptions`, `availabilityResults`) or `$all` to
         query across all event types. Possible values include: '$all',
         'traces', 'customEvents', 'pageViews', 'browserTimings', 'requests',
         'dependencies', 'exceptions', 'availabilityResults',
         'performanceCounters', 'customMetrics'
        :type event_type: str or ~azure.applicationinsights.models.EventType
        :param timespan: Optional. The timespan over which to retrieve events.
         This is an ISO8601 time period value.  This timespan is applied in
         addition to any that are specified in the Odata expression.
        :type timespan: str
        :param filter: An expression used to filter the returned events
        :type filter: str
        :param search: A free-text search expression to match for whether a
         particular event should be returned
        :type search: str
        :param orderby: A comma-separated list of properties with \\"asc\\"
         (the default) or \\"desc\\" to control the order of returned events
        :type orderby: str
        :param select: Limits the properties to just those requested on each
         returned event
        :type select: str
        :param skip: The number of items to skip over before returning events
        :type skip: int
        :param top: The number of events to return
        :type top: int
        :param format: Format for the returned events
        :type format: str
        :param count: Request a count of matching items included with the
         returned events
        :type count: bool
        :param apply: An expression used for aggregation over returned events
        :type apply: str
        :param dict custom_headers: headers that will be added to the request
        :param bool raw: returns the direct response alongside the
         deserialized response
        :param operation_config: :ref:`Operation configuration
         overrides<msrest:optionsforoperations>`.
        :return: EventsResults or ClientRawResponse if raw=true
        :rtype: ~azure.applicationinsights.models.EventsResults or
         ~msrest.pipeline.ClientRawResponse
        :raises:
         :class:`ErrorResponseException<azure.applicationinsights.models.ErrorResponseException>`
        """
        # Construct URL
        arg_16 = arg_0.Func.metadata['url']
        arg_17 = {
            'appId': arg_0._serialize.url("app_id", arg_1, 'str'),
            'eventType': arg_0._serialize.url("event_type", arg_2, 'str')
        }
        arg_16 = arg_0._client.format_url(arg_16, **arg_17)

        # Construct parameters
        arg_18 = {}
        if arg_3 is not None:
            arg_18['timespan'] = arg_0._serialize.query("timespan", arg_3, 'str')
        if arg_4 is not None:
            arg_18['$filter'] = arg_0._serialize.query("filter", arg_4, 'str')
        if arg_5 is not None:
            arg_18['$search'] = arg_0._serialize.query("search", arg_5, 'str')
        if arg_6 is not None:
            arg_18['$orderby'] = arg_0._serialize.query("orderby", arg_6, 'str')
        if arg_7 is not None:
            arg_18['$select'] = arg_0._serialize.query("select", arg_7, 'str')
        if arg_8 is not None:
            arg_18['$skip'] = arg_0._serialize.query("skip", arg_8, 'int')
        if arg_9 is not None:
            arg_18['$top'] = arg_0._serialize.query("top", arg_9, 'int')
        if arg_10 is not None:
            arg_18['$format'] = arg_0._serialize.query("format", arg_10, 'str')
        if arg_11 is not None:
            arg_18['$count'] = arg_0._serialize.query("count", arg_11, 'bool')
        if arg_12 is not None:
            arg_18['$apply'] = arg_0._serialize.query("apply", arg_12, 'str')

        # Construct headers
        arg_19 = {}
        arg_19['Accept'] = 'application/json'
        if arg_13:
            arg_19.update(arg_13)

        # Construct and send request
        arg_20 = arg_0._client.get(arg_16, arg_18, arg_19)
        arg_21 = arg_0._client.send(arg_20, stream=False, **arg_15)

        if arg_21.status_code not in [200]:
            raise models.ErrorResponseException(arg_0._deserialize, arg_21)

        arg_22 = None

        if arg_21.status_code == 200:
            arg_22 = arg_0._deserialize('EventsResults', arg_21)

        if arg_14:
            arg_23 = ClientRawResponse(arg_22, arg_21)
            return arg_23

        return arg_22


def Func ( arg_0 ) : arg_1 = 0 for arg_2 in arg_0 . nodes : arg_1 += arg_0 . weights . get ( arg_2 , 1 ) for arg_2 in arg_0 . nodes : arg_3 = 1 if arg_2 in arg_0 . weights : arg_3 = arg_0 . weights . get ( arg_2 ) arg_4 = math . floor ( ( 40 * len ( arg_0 . nodes ) * arg_3 ) / arg_1 ) for arg_5 in range ( 0 , int ( arg_4 ) ) : arg_6 = bytearray ( arg_0 . _hash_digest ( '%s-%s' % ( arg_2 , arg_5 ) ) ) for arg_7 in range ( 0 , 3 ) : arg_8 = arg_0 . _hash_val ( arg_6 , lambda x : x + arg_7 * 4 ) arg_0 . ring [ arg_8 ] = arg_2 arg_0 . _sorted_keys . append ( arg_8 ) arg_0 . _sorted_keys . sort ( )

def Func(arg_0):
        """Generates the circle.
        """
        arg_1 = 0
        for arg_2 in arg_0.nodes:
            arg_1 += arg_0.weights.get(arg_2, 1)

        for arg_2 in arg_0.nodes:
            arg_3 = 1

            if arg_2 in arg_0.weights:
                arg_3 = arg_0.weights.get(arg_2)

            arg_4 = math.floor((40 * len(arg_0.nodes) * arg_3) / arg_1)

            for arg_5 in range(0, int(arg_4)):
                arg_6 = bytearray(arg_0._hash_digest('%s-%s' % (arg_2, arg_5)))

                for arg_7 in range(0, 3):
                    arg_8 = arg_0._hash_val(arg_6, lambda x: x + arg_7 * 4)
                    arg_0.ring[arg_8] = arg_2
                    arg_0._sorted_keys.append(arg_8)

        arg_0._sorted_keys.sort()


Applies a proximal operator to the columns of a matrix

def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = np . zeros_like ( arg_0 ) for arg_4 in range ( arg_0 . shape [ 1 ] ) : arg_3 [ : , arg_4 ] = arg_2 ( arg_0 [ : , arg_4 ] , arg_1 ) return arg_3

def Func(arg_0, arg_1, arg_2):
    """Applies a proximal operator to the Func of a matrix"""

    arg_3 = np.zeros_like(arg_0)

    for arg_4 in range(arg_0.shape[1]):
        arg_3[:, arg_4] = arg_2(arg_0[:, arg_4], arg_1)

    return arg_3


return tfd.MixtureSameFamily(
      components_distribution=tfd.MultivariateNormalDiag(
          loc=loc,
          scale_diag=tf.nn.softplus(raw_scale_diag)),
      mixture_distribution=tfd.Categorical(logits=mixture_logits),
      name="prior")

def Func ( arg_0 , arg_1 ) : if arg_1 == 1 : return tfd . MultivariateNormalDiag ( arg_2 = tf . zeros ( [ arg_0 ] ) , scale_identity_multiplier = 1.0 ) arg_2 = tf . compat . v1 . get_variable ( name = "loc" , shape = [ arg_1 , arg_0 ] ) arg_3 = tf . compat . v1 . get_variable ( name = "raw_scale_diag" , shape = [ arg_1 , arg_0 ] ) arg_4 = tf . compat . v1 . get_variable ( name = "mixture_logits" , shape = [ arg_1 ] ) return tfd . MixtureSameFamily ( components_distribution = tfd . MultivariateNormalDiag ( arg_2 = arg_2 , scale_diag = tf . nn . softplus ( arg_3 ) ) , mixture_distribution = tfd . Categorical ( logits = arg_4 ) , name = "prior" )

def Func(arg_0, arg_1):
  """Creates the mixture of Gaussians prior distribution.

  Args:
    latent_size: The dimensionality of the latent representation.
    mixture_components: Number of elements of the mixture.

  Returns:
    random_prior: A `tfd.Distribution` instance representing the distribution
      over encodings in the absence of any evidence.
  """
  if arg_1 == 1:
    # See the module docstring for why we don't learn the parameters here.
    return tfd.MultivariateNormalDiag(
        arg_2=tf.zeros([arg_0]),
        scale_identity_multiplier=1.0)

  arg_2 = tf.compat.v1.get_variable(
      name="loc", shape=[arg_1, arg_0])
  arg_3 = tf.compat.v1.get_variable(
      name="raw_scale_diag", shape=[arg_1, arg_0])
  arg_4 = tf.compat.v1.get_variable(
      name="mixture_logits", shape=[arg_1])

  return tfd.MixtureSameFamily(
      components_distribution=tfd.MultivariateNormalDiag(
          arg_2=arg_2,
          scale_diag=tf.nn.softplus(arg_3)),
      mixture_distribution=tfd.Categorical(logits=arg_4),
      name="prior")

Creates the mixture of Gaussians prior distribution .


def Func ( arg_0 , * arg_1 , ** arg_2 ) : if arg_0 . polychromatic : arg_3 = psfcalc . calculate_polychrome_linescan_psf else : arg_3 = psfcalc . calculate_linescan_psf return arg_3 ( * arg_1 , ** arg_2 )

def Func(arg_0, *arg_1, **arg_2):
        """Calculates a linescan psf"""
        if arg_0.polychromatic:
            arg_3 = psfcalc.calculate_polychrome_linescan_psf
        else:
            arg_3 = psfcalc.calculate_linescan_psf
        return arg_3(*arg_1, **arg_2)


def
Func
(
arg_0
)
->
bool
:
arg_0
.
_stream
.
save_context
(
)
while
not
arg_0
.
read_eof
(
)
:
arg_1
=
arg_0
.
_stream
.
index
if
arg_0
.
_stream
.
peek_char
in
" \t\v\f\r\n"
:
while
(
not
arg_0
.
read_eof
(
)
and
arg_0
.
_stream
.
peek_char
in
" \t\v\f\r\n"
)
:
arg_0
.
_stream
.
incpos
(
)
if
arg_0
.
peek_text
(
"//"
)
:
while
not
arg_0
.
read_eof
(
)
and
not
arg_0
.
peek_char
(
"\n"
)
:
arg_0
.
_stream
.
incpos
(
)
if
not
arg_0
.
read_char
(
"\n"
)
and
arg_0
.
read_eof
(
)
:
return
arg_0
.
_stream
.
validate_context
(
)
if
arg_0
.
peek_text
(
"/*"
)
:
while
not
arg_0
.
read_eof
(
)
and
not
arg_0
.
peek_text
(
"*/"
)
:
arg_0
.
_stream
.
incpos
(
)
if
not
arg_0
.
read_text
(
"*/"
)
and
arg_0
.
read_eof
(
)
:
return
arg_0
.
_stream
.
restore_context
(
)
if
arg_1
==
arg_0
.
_stream
.
index
:
break
return
arg_0
.
_stream
.
validate_context
(
)

def Func(arg_0) -> bool:
    """Consume comments and whitespace characters."""
    arg_0._stream.save_context()
    while not arg_0.read_eof():
        arg_1 = arg_0._stream.index
        if arg_0._stream.peek_char in " \t\v\f\r\n":
            while (not arg_0.read_eof()
                    and arg_0._stream.peek_char in " \t\v\f\r\n"):
                arg_0._stream.incpos()
        if arg_0.peek_text("//"):
            while not arg_0.read_eof() and not arg_0.peek_char("\n"):
                arg_0._stream.incpos()
            if not arg_0.read_char("\n") and arg_0.read_eof():
                return arg_0._stream.validate_context()
        if arg_0.peek_text("/*"):
            while not arg_0.read_eof() and not arg_0.peek_text("*/"):
                arg_0._stream.incpos()
            if not arg_0.read_text("*/") and arg_0.read_eof():
                return arg_0._stream.restore_context()
        if arg_1 == arg_0._stream.index:
            break
    return arg_0._stream.validate_context()

Consume comments and whitespace characters .


def Func(arg_0):
    """
    Given a duration in seconds, determines the best units and multiplier to
    use to display the time. Return value is a 2-tuple of units and multiplier.
    """
    for arg_1, arg_2, arg_3 in units_table:
        if arg_0 < arg_1:
            break
    return arg_2, arg_3

Given a duration in seconds determines the best units and multiplier to use to display the time . Return value is a 2 - tuple of units and multiplier .


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Convert the specified mass of the source compound to the target using
    element as basis.

    :param mass: Mass of from_compound. [kg]
    :param source: Formula and phase of the original compound, e.g.
      'Fe2O3[S1]'.
    :param target: Formula and phase of the target compound, e.g. 'Fe[S1]'.
    :param element: Element to use as basis for the conversion, e.g. 'Fe' or
      'O'.

    :returns: Mass of target. [kg]
    """

    # Perform the conversion.
    arg_4 = element_mass_fraction(arg_2, arg_3)
    if arg_4 == 0.0:
        # If target_formula does not contain element, just return 0.0.
        return 0.0
    else:
        arg_5 = element_mass_fraction(arg_1, arg_3)
        return arg_0 * arg_5 / arg_4

Convert the specified mass of the source compound to the target using element as basis .


(strings, pattern, n=1, lookup_func=re.match)

def Func(arg_0, arg_1, arg_2=1, arg_3=arg_4.match):
    """Return index of the nth match found of pattern in strings

    Parameters
    ----------
    strings: list of str
        List of strings

    pattern: str
        Pattern to be matched

    nth: int
        Number of times the match must happen to return the item index.

    lookup_func: callable
        Function to match each item in strings to the pattern, e.g., re.match or re.search.

    Returns
    -------
    index: int
        Index of the nth item that matches the pattern.
        If there are no n matches will return -1
    """
    arg_6 = 0
    for arg_7, arg_8 in enumerate(arg_0):
        if arg_3(arg_1, arg_8):
            arg_6 += 1
            if arg_6 == arg_2:
                return arg_7
    return -1


return self._get_resource_url(full_url, True, data_key)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Canvas GET method. Return representation of the requested resource.
        """
        if not arg_2:
            arg_2 = {}

        arg_0._set_as_user(arg_2)

        arg_4 = arg_1 + arg_0._params(arg_2)

        return arg_0.Func_url(arg_4, True, arg_3)

Canvas GET method . Return representation of the requested resource .


def Func ( arg_0 , arg_1 = 1.0 ) : arg_2 = time . time ( ) + arg_1 for arg_3 in xrange ( 2 ) : arg_0 . _Funced = False arg_0 . ioloop . add_callback ( arg_0 . _Func ) while not arg_0 . _Funced and time . time ( ) < arg_2 : time . sleep ( 0.01 )

def Func(arg_0, arg_1=1.0):
        """Immediately processes all pending messages on the SUB channel.

        Callers should use this method to ensure that :method:`call_handlers`
        has been called for all messages that have been received on the
        0MQ SUB socket of this channel.

        This method is thread safe.

        Parameters
        ----------
        timeout : float, optional
            The maximum amount of time to spend Funcing, in seconds. The
            default is one second.
        """
        # We do the IOLoop callback process twice to ensure that the IOLoop
        # gets to perform at least one full poll.
        arg_2 = time.time() + arg_1
        for arg_3 in xrange(2):
            arg_0._Funced = False
            arg_0.ioloop.add_callback(arg_0._Func)
            while not arg_0._Funced and time.time() < arg_2:
                time.sleep(0.01)

Immediately processes all pending messages on the SUB channel.

        Callers should use this method to ensure that :method:`call_handlers`
        has been called for all messages that have been received on the
        0MQ SUB socket of this channel.

        This method is thread safe.

        Parameters
        ----------
        timeout : float, optional
            The maximum amount of time to spend flushing, in seconds. The
            default is one second.

Immediately processes all pending messages on the SUB channel .


def Func ( arg_0 , arg_1 = None ) : if arg_0 . hasher is None : return None else : arg_2 = arg_0 . _rectify_products ( arg_1 ) arg_3 = [ util_hash . hash_file ( p , hasher = arg_0 . hasher , base = 'hex' ) for p in arg_2 ] return arg_3

def Func(arg_0, arg_1=None):
        """
        Get the hash of the each product file
        """
        if arg_0.hasher is None:
            return None
        else:
            arg_2 = arg_0._rectify_products(arg_1)
            arg_3 = [
                util_hash.hash_file(p, hasher=arg_0.hasher, base='hex')
                for p in arg_2
            ]
            return arg_3


def Func ( arg_0 ) : for arg_1 in arg_0 . tracers : arg_1 . start ( ) threading . settrace ( arg_0 . _installation_trace )

def Func(arg_0):
        """Resume tracing after a `pause`."""
        for arg_1 in arg_0.tracers:
            arg_1.start()
        threading.settrace(arg_0._installation_trace)


def Func ( arg_0 , arg_1 ) : arg_2 = [ ] for arg_3 , arg_4 in arg_1 . attributes . items ( ) : arg_5 = VBOInfo ( * arg_4 . info ( ) ) arg_5 . attributes . append ( ( arg_3 , arg_5 . components ) ) if arg_2 and arg_2 [ - 1 ] . buffer_view == arg_5 . buffer_view : if arg_2 [ - 1 ] . interleaves ( arg_5 ) : arg_2 [ - 1 ] . merge ( arg_5 ) continue arg_2 . append ( arg_5 ) return arg_2

def Func(arg_0, arg_1):
        """Pre-parse buffer mappings for each VBO to detect interleaved data for a primitive"""
        arg_2 = []
        for arg_3, arg_4 in arg_1.attributes.items():
            arg_5 = VBOInfo(*arg_4.info())
            arg_5.attributes.append((arg_3, arg_5.components))

            if arg_2 and arg_2[-1].buffer_view == arg_5.buffer_view:
                if arg_2[-1].interleaves(arg_5):
                    arg_2[-1].merge(arg_5)
                    continue

            arg_2.append(arg_5)

        return arg_2

Pre - parse buffer mappings for each VBO to detect interleaved data for a primitive


return (
        isinstance(func, astroid.BoundMethod)
        and isinstance(func.bound, astroid.Instance)
        and (func.bound.name in types if types else True)
        and (func.name in methods if methods else True)
    )

def Func ( arg_0 , arg_1 = ( ) , arg_2 = ( ) ) : return ( isinstance ( arg_0 , astroid . BoundMethod ) and isinstance ( arg_0 . bound , astroid . Instance ) and ( arg_0 . bound . name in arg_1 if arg_1 else True ) and ( arg_0 . name in arg_2 if arg_2 else True ) )

def Func(arg_0, arg_1=(), arg_2=()):
    """Determines if a BoundMethod node represents a method call.

    Args:
      func (astroid.BoundMethod): The BoundMethod AST node to check.
      types (Optional[String]): Optional sequence of caller type names to restrict check.
      methods (Optional[String]): Optional sequence of method names to restrict check.

    Returns:
      bool: true if the node represents a method call for the given type and
      method names, False otherwise.
    """
    return (
        isinstance(arg_0, astroid.BoundMethod)
        and isinstance(arg_0.bound, astroid.Instance)
        and (arg_0.bound.name in arg_1 if arg_1 else True)
        and (arg_0.name in arg_2 if arg_2 else True)
    )

Determines if a BoundMethod node represents a method call .


(
        m: lmap.Map, sym: sym.Symbol, new_var: Var, force: bool = False
    )

def Func ( arg_0 : arg_1 . Map , arg_3 : arg_3 . Symbol , arg_5 : arg_6 , arg_7 : arg_8 = False ) -> arg_1 . Map : arg_9 = arg_0 . entry ( arg_3 , None ) if arg_9 is None or arg_7 : return arg_0 . assoc ( arg_3 , arg_5 ) return arg_0

def Func(
        arg_0: arg_1.Map, arg_3: arg_3.Symbol, arg_5: arg_6, arg_7: arg_8 = False
    ) -> arg_1.Map:
        """Swap function used by intern to atomically intern a new variable in
        the symbol mapping for this Namespace."""
        arg_9 = arg_0.entry(arg_3, None)
        if arg_9 is None or arg_7:
            return arg_0.assoc(arg_3, arg_5)
        return arg_0

Swap function used by intern to atomically intern a new variable in the symbol mapping for this Namespace .


(self, traj, network, current_subrun, subrun_list, network_dict)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """Extracts monitor data and plots.

        Data extraction is done if all subruns have been completed,
        i.e. `len(subrun_list)==0`

        First, extracts results from the monitors and stores them into `traj`.

        Next, uses the extracted data for plots.

        :param traj:

            Trajectory container

            Adds:

            Data from monitors

        :param network: The BRIAN network

        :param current_subrun: BrianParameter

        :param subrun_list: List of coming subruns

        :param network_dict: Dictionary of items shared among all components

        """
        if len(arg_4)==0:

            arg_1.f_add_result(Brian2MonitorResult, 'monitors.spikes_e', arg_0.spike_monitor,
                              comment = 'The spiketimes of the excitatory population')

            arg_1.f_add_result(Brian2MonitorResult, 'monitors.V', arg_0.V_monitor,
                              comment = 'Membrane voltage of four neurons from 2 clusters')

            arg_1.f_add_result(Brian2MonitorResult, 'monitors.I_syn_e', arg_0.I_syn_e_monitor,
                              comment = 'I_syn_e of four neurons from 2 clusters')

            arg_1.f_add_result(Brian2MonitorResult, 'monitors.I_syn_i', arg_0.I_syn_i_monitor,
                              comment = 'I_syn_i of four neurons from 2 clusters')

            print('Plotting')

            if arg_1.parameters.analysis.make_plots:
                arg_0._print_graphs(arg_1)


(self, zcf, cmd, grouping, add_help=True)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
=
True
)
:
if
arg_4
:
if
arg_3
:
print
(
"+ '(help)'"
,
end
=
BLK
,
file
=
arg_1
)
print
(
"'--help[show help message]'"
,
end
=
BLK
,
file
=
arg_1
)
print
(
"'-h[show help message]'"
,
end
=
BLK
,
file
=
arg_1
)
arg_5
=
(
'store_true'
,
'store_false'
)
arg_6
=
arg_0
.
_opt_cmds
[
arg_2
]
if
arg_2
else
arg_0
.
_opt_bare
for
arg_7
,
arg_8
in
arg_6
.
items
(
)
:
arg_9
=
arg_0
.
_conf
[
arg_8
]
.
def_
[
arg_7
]
if
arg_9
.
cmd_kwargs
.
get
(
'action'
)
==
'append'
:
arg_10
,
arg_11
=
"+ '{}'"
,
"'*{}[{}]{}'"
if
arg_9
.
comprule
is
:
arg_9
.
comprule
=
''
else
:
arg_10
,
arg_11
=
"+ '({})'"
,
"'{}[{}]{}'"
if
arg_9
.
cmd_kwargs
.
get
(
'action'
)
in
arg_5
or
arg_9
.
cmd_kwargs
.
get
(
'nargs'
)
==
0
:
arg_9
.
comprule
=
if
arg_9
.
comprule
is
:
arg_13
=
''
elif
arg_9
.
comprule
==
''
:
arg_11
=
arg_11
.
split
(
'['
)
arg_11
=
arg_11
[
0
]
+
'=['
+
arg_11
[
1
]
arg_13
=
': :( )'
else
:
arg_11
=
arg_11
.
split
(
'['
)
arg_11
=
arg_11
[
0
]
+
'=['
+
arg_11
[
1
]
arg_13
=
': :{}'
.
format
(
arg_9
.
comprule
)
if
arg_3
:
print
(
arg_10
.
format
(
arg_7
)
,
end
=
BLK
,
file
=
arg_1
)
for
arg_14
in
_names
(
arg_0
.
_conf
[
arg_8
]
,
arg_7
)
:
print
(
arg_11
.
format
(
arg_14
,
arg_9
.
help
.
replace
(
"'"
,
"'\"'\"'"
)
,
arg_13
)
,
end
=
BLK
,
file
=
arg_1
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4=True):
        """Write zsh _arguments compdef for a given command.

        Args:
            zcf (file): zsh compdef file.
            cmd (str): command name, set to None or '' for bare command.
            grouping (bool): group options (zsh>=5.4).
            add_help (bool): add an help option.
        """
        if arg_4:
            if arg_3:
                print("+ '(help)'", end=BLK, file=arg_1)
            print("'--help[show help message]'", end=BLK, file=arg_1)
            print("'-h[show help message]'", end=BLK, file=arg_1)
        # could deal with duplicate by iterating in reverse and keep set of
        # already defined opts.
        arg_5 = ('store_true', 'store_false')
        arg_6 = arg_0._opt_cmds[arg_2] if arg_2 else arg_0._opt_bare
        for arg_7, arg_8 in arg_6.items():
            arg_9 = arg_0._conf[arg_8].def_[arg_7]
            if arg_9.cmd_kwargs.get('action') == 'append':
                arg_10, arg_11 = "+ '{}'", "'*{}[{}]{}'"
                if arg_9.comprule is None:
                    arg_9.comprule = ''
            else:
                arg_10, arg_11 = "+ '({})'", "'{}[{}]{}'"
            if arg_9.cmd_kwargs.get('action') in arg_5 \
               or arg_9.cmd_kwargs.get('nargs') == 0:
                arg_9.comprule = None
            if arg_9.comprule is None:
                arg_13 = ''
            elif arg_9.comprule == '':
                arg_11 = arg_11.split('[')
                arg_11 = arg_11[0] + '=[' + arg_11[1]
                arg_13 = ': :( )'
            else:
                arg_11 = arg_11.split('[')
                arg_11 = arg_11[0] + '=[' + arg_11[1]
                arg_13 = ': :{}'.format(arg_9.comprule)
            if arg_3:
                print(arg_10.format(arg_7), end=BLK, file=arg_1)
            for arg_14 in _names(arg_0._conf[arg_8], arg_7):
                print(arg_11.format(arg_14, arg_9.help.replace("'", "'\"'\"'"),
                                    arg_13), end=BLK, file=arg_1)

Write zsh _arguments compdef for a given command .


def Func ( arg_0 ) : arg_1 = arg_0 . __class__ if arg_1 . _client is None : arg_2 = { } if arg_0 . tls_config : arg_2 [ 'tls' ] = docker . tls . TLSConfig ( ** arg_0 . tls_config ) arg_2 . update ( kwargs_from_env ( ) ) Func = docker . APIClient ( version = 'auto' , ** arg_2 ) arg_1 . _client = Func return arg_1 . _client

def Func(arg_0):
        """single global client instance"""
        arg_1 = arg_0.__class__

        if arg_1._client is None:
            arg_2 = {}
            if arg_0.tls_config:
                arg_2['tls'] = docker.tls.TLSConfig(**arg_0.tls_config)
            arg_2.update(kwargs_from_env())
            Func = docker.APIClient(version='auto', **arg_2)

            arg_1._client = Func
        return arg_1._client


def Func(arg_0, arg_1):
        """Uses cached client or create new one with specific token."""
        arg_2 = getattr(arg_0, 'clients', None)
        arg_3 = _hash_token(arg_0, arg_1)

        if arg_2 and arg_3 in arg_2:
            return arg_2[arg_3]

        arg_4 = arg_0.make_client(arg_1)  # implemented in subclasses
        if arg_2:
            arg_2[arg_3] = arg_4

        return arg_4

Uses cached client or create new one with specific token .


return convert_constants(jmag,hmag,kmag,
                             SDSSG_JHK,
                             SDSSG_JH, SDSSG_JK, SDSSG_HK,
                             SDSSG_J, SDSSG_H, SDSSG_K)

def Func(arg_0,arg_1,arg_2):
    '''Converts given J, H, Ks mags to an SDSS g magnitude value.

    Parameters
    ----------

    jmag,hmag,kmag : float
        2MASS J, H, Ks mags of the object.

    Returns
    -------

    float
        The converted SDSS g band magnitude.

    '''

    return convert_constants(arg_0,arg_1,arg_2,
                             SDSSG_JHK,
                             SDSSG_JH, SDSSG_JK, SDSSG_HK,
                             SDSSG_J, SDSSG_H, SDSSG_K)

Converts given J H Ks mags to an SDSS g magnitude value .


def Func ( arg_0 ) : with arg_0 . _idle_lock : if arg_0 . _idle : arg_0 . _idle = False return True return False

def Func(arg_0):
        """
        Returns True if state was successfully changed from idle to scheduled.
        """
        with arg_0._idle_lock:
            if arg_0._idle:
                arg_0._idle = False
                return True
        return False

Returns True if state was successfully changed from idle to scheduled .


def Func(arg_0):
    """ Retrieve password from the given command """
    arg_1 = subprocess.Popen(
        arg_0, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    arg_1.wait()
    if arg_1.returncode == 0:
        return arg_1.stdout.readline().strip().decode('utf-8')
    else:
        die(
            "Error retrieving password: `{command}` returned '{error}'".format(
                arg_0=arg_0, error=arg_1.stderr.read().strip()))


Useful for defining weather data published to the server. Parameters
        not set will be reset and not sent to server. Unknown keyword args will
        be silently ignored, so be careful. This is necessary for publishers
        that support more fields than others.

( self, pressure='NA', dewpoint='NA', humidity='NA', tempf='NA',
            rainin='NA', rainday='NA', dateutc='NA', windgust='NA',
            windgustdir='NA', windspeed='NA', winddir='NA',
            clouds='NA', weather='NA', *args, **kw)

def Func ( arg_0 , arg_1 = 'NA' , arg_2 = 'NA' , arg_3 = 'NA' , arg_4 = 'NA' , arg_5 = 'NA' , arg_6 = 'NA' , arg_7 = 'NA' , arg_8 = 'NA' , arg_9 = 'NA' , arg_10 = 'NA' , arg_11 = 'NA' , arg_12 = 'NA' , arg_13 = 'NA' , * arg_14 , ** arg_15 ) : arg_0 . args . update ( { 'baromin' : arg_1 , 'clouds' : arg_12 , 'dailyrainin' : arg_6 , 'dateutc' : arg_7 , 'dewptf' : arg_2 , 'humidity' : arg_3 , 'rainin' : arg_5 , 'tempf' : arg_4 , 'weather' : arg_13 , 'winddir' : arg_11 , 'windgustdir' : arg_9 , 'windgustmph' : arg_8 , 'windspeedmph' : arg_10 , } ) log . debug ( arg_0 . args )

def Func( arg_0, arg_1='NA', arg_2='NA', arg_3='NA', arg_4='NA',
            arg_5='NA', arg_6='NA', arg_7='NA', arg_8='NA',
            arg_9='NA', arg_10='NA', arg_11='NA',
            arg_12='NA', arg_13='NA', *arg_14, **arg_15):
        '''
        Useful for defining weather data published to the server. Parameters
        not Func will be reFunc and not sent to server. Unknown keyword args will
        be silently ignored, so be careful. This is necessary for publishers
        that support more fields than others.
        '''
        # see: http://wiki.wunderground.com/index.php/PWS_-_Upload_Protocol
        # unused, but valid, parameters are:
        #   windspdmph_avg2m, winddir_avg2m, windgustmph_10m, windgusdir_10m
        #   soiltempf, soilmoisture, leafwetness, solarradiation, UV
        #   indoortempf, indoorhumidity
        arg_0.args.update( {
                'baromin':arg_1,
                'clouds':arg_12,
                'dailyrainin':arg_6,
                'dateutc':arg_7,
                'dewptf':arg_2,
                'humidity':arg_3,
                'rainin':arg_5,
                'tempf':arg_4,
                'weather':arg_13,
                'winddir':arg_11,
                'windgustdir':arg_9,
                'windgustmph':arg_8,
                'windspeedmph':arg_10,
            } )
        log.debug( arg_0.args )

Useful for defining weather data published to the server . Parameters not set will be reset and not sent to server . Unknown keyword args will be silently ignored so be careful . This is necessary for publishers that support more fields than others .


def Func ( arg_0 ) : arg_1 = len ( arg_0 . rstrip ( ) ) - len ( arg_0 ) if not arg_1 : return '' else : return arg_0 [ arg_1 : ]

def Func(arg_0):
    """Return line ending."""
    arg_1 = len(arg_0.rstrip()) - len(arg_0)
    if not arg_1:
        return ''
    else:
        return arg_0[arg_1:]


return ':'.join((algorithm, salt, h.hexdigest()))

def Func(arg_0=None, arg_1='sha1'):
    """Generate hashed password and salt for use in notebook configuration.

    In the notebook configuration, set `c.NotebookApp.password` to
    the generated string.

    Parameters
    ----------
    passphrase : str
        Password to hash.  If unspecified, the user is asked to input
        and verify a password.
    algorithm : str
        Hashing algorithm to use (e.g, 'sha1' or any argument supported
        by :func:`hashlib.new`).

    Returns
    -------
    hashed_passphrase : str
        Hashed password, in the format 'hash_algorithm:salt:passphrase_hash'.

    Examples
    --------
    In [1]: Func('mypassword')
    Out[1]: 'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12'

    """
    if arg_0 is None:
        for arg_2 in range(3):
            p0 = getpass.getpass('Enter password: ')
            p1 = getpass.getpass('Verify password: ')
            if p0 == p1:
                arg_0 = p0
                break
            else:
                print('Passwords do not match.')
        else:
            raise UsageError('No matching passwords found. Giving up.')

    arg_3 = hashlib.new(arg_1)
    arg_4 = ('%0' + str(salt_len) + 'x') % random.getrandbits(4 * salt_len)
    arg_3.update(cast_bytes(arg_0, 'utf-8') + str_to_bytes(arg_4, 'ascii'))

    return ':'.join((arg_1, arg_4, arg_3.hexdigest()))

Generate hashed password and salt for use in notebook configuration.

    In the notebook configuration, set `c.NotebookApp.password` to
    the generated string.

    Parameters
    ----------
    passphrase : str
        Password to hash.  If unspecified, the user is asked to input
        and verify a password.
    algorithm : str
        Hashing algorithm to use (e.g, 'sha1' or any argument supported
        by :func:`hashlib.new`).

    Returns
    -------
    hashed_passphrase : str
        Hashed password, in the format 'hash_algorithm:salt:passphrase_hash'.

    Examples
    --------
    In [1]: passwd('mypassword')
    Out[1]: 'sha1:7cf3:b7d6da294ea9592a9480c8f52e63cd42cfb9dd12'

Generate hashed password and salt for use in notebook configuration .


def Func(arg_0, arg_1):
    """
    loads assembly or creates a new one and set its params from
    parsedict. Does not launch ipcluster.
    """

    ## Creating an assembly with a full path in the name will "work"
    ## but it is potentially dangerous, so here we have assembly_name
    ## and assembly_file, name is used for creating new in cwd, file is
    ## used for loading existing.
    ##
    ## Be nice if the user includes the extension.
    #project_dir = ip.core.assembly._expander(parsedict['1'])
    #assembly_name = parsedict['0']
    arg_2 = ip.core.assembly._expander(arg_1['project_dir'])
    arg_3 = arg_1['assembly_name']
    arg_4 = os.path.join(arg_2, arg_3)

    ## Assembly creation will handle error checking  on
    ## the format of the assembly_name

    ## make sure the working directory exists.
    if not os.path.exists(arg_2):
        os.mkdir(arg_2)

    try:
        ## If 1 and force then go ahead and create a new assembly
        if ('1' in arg_0.steps) and arg_0.force:
            arg_5 = ip.Assembly(arg_3, cli=True)
        else:
            arg_5 = ip.load_json(arg_4, cli=True)
            arg_5._cli = True

    except IPyradWarningExit as _:
        ## if no assembly is found then go ahead and make one
        if '1' not in arg_0.steps:
            raise IPyradWarningExit(\
                "  Error: You must first run step 1 on the assembly: {}"\
                .format(arg_4))
        else:
            ## create a new assembly object
            arg_5 = ip.Assembly(arg_3, cli=True)

    ## for entering some params...
    for arg_7 in arg_1:

        ## trap assignment of assembly_name since it is immutable.
        if arg_7 == "assembly_name":
            ## Raise error if user tried to change assembly name
            if arg_1[arg_7] != arg_5.name:
                arg_5.set_params(arg_7, arg_1[arg_7])
        else:
            ## all other params should be handled by set_params
            try:
                arg_5.set_params(arg_7, arg_1[arg_7])
            except IndexError as _:
                print("  Malformed params file: {}".format(arg_0.params))
                print("  Bad parameter {} - {}".format(arg_7, arg_1[arg_7]))
                sys.exit(-1)
    return arg_5

loads assembly or creates a new one and set its params from parsedict . Does not launch ipcluster .


def Func ( arg_0 , arg_1 ) : if arg_0 is None : return None arg_2 = copy . deepcopy ( arg_0 ) for arg_3 in xrange ( 0 , len ( arg_2 ) ) : arg_2 [ arg_3 ] [ arg_1 ] = '"%s"' % arg_2 [ arg_3 ] [ arg_1 ] arg_2 [ arg_3 ] [ arg_1 ] = arg_2 [ arg_3 ] [ arg_1 ] . replace ( ";" , "\;" ) return arg_2

def Func(arg_0, arg_1):
    """
    Quote a field in a list of DNS records.
    Return the new data records.
    """
    if arg_0 is None:
        return None

    arg_2 = copy.deepcopy(arg_0)
    for arg_3 in xrange(0, len(arg_2)):
        arg_2[arg_3][arg_1] = '"%s"' % arg_2[arg_3][arg_1]
        arg_2[arg_3][arg_1] = arg_2[arg_3][arg_1].replace(";", "\;")

    return arg_2

Quote a field in a list of DNS records . Return the new data records .


return zipkin_core.Endpoint(
        ipv4=endpoint.ipv4,
        port=endpoint.port,
        service_name=service_name,
    )

def Func ( arg_0 , arg_1 ) : return zipkin_core . Endpoint ( ipv4 = arg_0 . ipv4 , port = arg_0 . port , arg_1 = arg_1 , )

def Func(arg_0, arg_1):
    """Copies a copy of a given endpoint with a new service name.
    This should be very fast, on the order of several microseconds.

    :param endpoint: existing zipkin_core.Endpoint object
    :param service_name: str of new service name
    :returns: zipkin Endpoint object
    """
    return zipkin_core.Endpoint(
        ipv4=arg_0.ipv4,
        port=arg_0.port,
        arg_1=arg_1,
    )

Copies a copy of a given endpoint with a new service name . This should be very fast on the order of several microseconds .


def Func(arg_0, arg_1):
    """
    Calculates all of the metrics associated with the registered gadgets.
    """
    arg_2 = ensure_list(arg_0)
    arg_1 = ensure_list(arg_1)

    for arg_0 in arg_2:
        for arg_3 in arg_1:
            print "Calculating %s (%s)..." % (arg_0.__name__, settings.STATISTIC_FREQUENCY_DICT[arg_3])
            arg_0.calculate(arg_3)

Calculates all of the metrics associated with the registered gadgets .


def Func(arg_0, arg_1=30, arg_2=100):
    """
    This is designed to work with prettified output from Beautiful Soup which indents with a single space.

    :param line: The line to split
    :param min_line_length: The minimum desired line length
    :param max_line_length: The maximum desired line length

    :return: A list of lines
    """
    if len(arg_0) <= arg_2:
        # No need to split!
        return [arg_0]

    # First work out the indentation on the beginning of the line
    arg_3 = 0
    while arg_0[arg_3] == ' ' and arg_3 < len(arg_0):
        arg_3 += 1

    # Try to split the line
    # Start looking for a space at character max_line_length working backwards
    arg_4 = arg_2
    arg_5 = None
    while arg_4 > arg_1:
        if arg_0[arg_4] == ' ':
            arg_5 = arg_4
            break
        arg_4 -= 1

    if arg_5 is None:
        # We didn't find a split point - search beyond the end of the line
        arg_4 = arg_2 + 1
        while arg_4 < len(arg_0):
            if arg_0[arg_4] == ' ':
                arg_5 = arg_4
                break
            arg_4 += 1

    if arg_5 is None:
        # There is nowhere to split the line!
        return [arg_0]
    else:
        # Split it!
        arg_6 = arg_0[:arg_5]
        arg_7 = ' ' * arg_3 + arg_0[arg_5 + 1:]
        return [arg_6] + Func(arg_7, arg_1, arg_2)

This is designed to work with prettified output from Beautiful Soup which indents with a single space .


def Func(arg_0):
        """
        Starts image acquisition.

        :return: None.
        """
        if not arg_0._create_ds_at_connection:
            arg_0._setup_data_streams()

        #
        arg_1 = arg_0._num_buffers
        for arg_2 in arg_0._data_streams:
            try:
                arg_3 = arg_2.buffer_announce_min
                if arg_3 < arg_1:
                    arg_3 = arg_1
            except InvalidParameterException as e:
                arg_3 = arg_1
                arg_0._logger.debug(e, exc_info=True)

            if arg_2.defines_payload_size():
                arg_4 = arg_2.payload_size
            else:
                arg_4 = arg_0.device.node_map.PayloadSize.value

            arg_5 = arg_0._create_raw_buffers(
                arg_3, arg_4
            )

            arg_6 = arg_0._create_buffer_tokens(
                arg_5
            )

            arg_0._announced_buffers = arg_0._announce_buffers(
                arg_2=arg_2, _buffer_tokens=arg_6
            )

            arg_0._queue_announced_buffers(
                arg_2=arg_2, buffers=arg_0._announced_buffers
            )

        # Reset the number of images to acquire.
        try:
            arg_8 = arg_0.device.node_map.AcquisitionMode.value
            if arg_8 == 'Continuous':
                arg_9 = -1
            elif arg_8 == 'SingleFrame':
                arg_9 = 1
            elif arg_8 == 'MultiFrame':
                arg_9 = arg_0.device.node_map.AcquisitionFrameCount.value
            else:
                arg_9 = -1
        except LogicalErrorException as e:
            # The node doesn't exist.
            arg_9 = -1
            arg_0._logger.debug(e, exc_info=True)

        arg_0._num_images_to_acquire = arg_9

        try:
            # We're ready to start image acquisition. Lock the device's
            # transport layer related features:
            arg_0.device.node_map.TLParamsLocked.value = 1
        except LogicalErrorException:
            # SFNC < 2.0
            pass

        # Start image acquisition.
        arg_0._is_acquiring_images = True

        for arg_2 in arg_0._data_streams:
            arg_2.start_acquisition(
                ACQ_START_FLAGS_LIST.ACQ_START_FLAGS_DEFAULT,
                arg_0._num_images_to_acquire
            )

        #
        if arg_0.thread_image_acquisition:
            arg_0.thread_image_acquisition.start()

        #
        arg_0.device.node_map.AcquisitionStart.execute()

        arg_0._logger.info(
            '{0} started image acquisition.'.format(arg_0._device.id_)
        )

        if arg_0._profiler:
            arg_0._profiler.print_diff()


def Func ( arg_0 , arg_1 ) : with open ( arg_1 , "rb" ) as fout : memmove ( arg_0 . m_buf , fout . Func ( arg_0 . m_size ) , arg_0 . m_size )

def Func(arg_0, arg_1):
        """Read file to buffer"""

        with open(arg_1, "rb") as fout:
            memmove(arg_0.m_buf, fout.Func(arg_0.m_size), arg_0.m_size)


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
if
not
is_valid_name
(
arg_1
)
:
raise
ValueError
(
"Invalid name '%s'"
%
arg_1
)
if
arg_1
in
arg_0
.
namespace
:
if
arg_1
in
arg_0
.
refs
:
if
arg_1
in
arg_0
.
self_refs
:
arg_0
.
new_ref
(
arg_1
,
arg_2
)
else
:
raise
KeyError
(
"Ref '%s' cannot be changed"
%
arg_1
)
elif
arg_1
in
arg_0
.
cells
:
if
arg_0
.
cells
[
arg_1
]
.
is_scalar
(
)
:
arg_0
.
cells
[
arg_1
]
.
set_value
(
(
)
,
arg_2
)
else
:
raise
AttributeError
(
"Cells '%s' is not a scalar."
%
arg_1
)
else
:
raise
ValueError
else
:
arg_0
.
new_ref
(
arg_1
,
arg_2
)

def Func(arg_0, arg_1, arg_2):
        """Implementation of attribute setting

        ``space.name = value`` by user script
        Called from ``Space.__setattr__``
        """
        if not is_valid_name(arg_1):
            raise ValueError("Invalid name '%s'" % arg_1)

        if arg_1 in arg_0.namespace:
            if arg_1 in arg_0.refs:
                if arg_1 in arg_0.self_refs:
                    arg_0.new_ref(arg_1, arg_2)
                else:
                    raise KeyError("Ref '%s' cannot be changed" % arg_1)

            elif arg_1 in arg_0.cells:
                if arg_0.cells[arg_1].is_scalar():
                    arg_0.cells[arg_1].set_value((), arg_2)
                else:
                    raise AttributeError("Cells '%s' is not a scalar." % arg_1)
            else:
                raise ValueError
        else:
            arg_0.new_ref(arg_1, arg_2)


Compute a score for this word on this docid.

return (math.log(1 + self.index[word][docid])
                / math.log(1 + self.documents[docid].nwords))

def Func ( arg_0 , arg_1 , arg_2 ) : return ( math . log ( 1 + arg_0 . index [ arg_1 ] [ arg_2 ] ) / math . log ( 1 + arg_0 . documents [ arg_2 ] . nwords ) )

def Func(arg_0, arg_1, arg_2):
        "Compute a Func for this word on this docid."
        ## There are many options; here we take a very simple approach
        return (math.log(1 + arg_0.index[arg_1][arg_2])
                / math.log(1 + arg_0.documents[arg_2].nwords))

Compute a score for this word on this docid .


def Func(arg_0):
        """
        Returns the data of the X509 extension, encoded as ASN.1.

        :return: The ASN.1 encoded data of this X509 extension.
        :rtype: :py:data:`bytes`

        .. versionadded:: 0.12
        """
        arg_1 = _lib.X509_EXTENSION_Func(arg_0._extension)
        arg_2 = _ffi.cast('ASN1_STRING*', arg_1)
        arg_3 = _lib.ASN1_STRING_data(arg_2)
        arg_4 = _lib.ASN1_STRING_length(arg_2)
        return _ffi.buffer(arg_3, arg_4)[:]

Returns the data of the X509 extension encoded as ASN . 1 .


(self, major_axis, unit_mass='angular', kpc_per_arcsec=None,
                                     critical_surface_density=None)

def Func(arg_0, arg_1, arg_2='angular', arg_3=None,
                                     arg_4=None):
        """ Integrate the mass profiles's convergence profile to compute the total angular mass within an ellipse of \
        specified major axis. This is centred on the mass profile.

        The following units for mass can be specified and output:

        - Dimensionless angular units (default) - 'angular'.
        - Solar masses - 'angular' (multiplies the angular mass by the critical surface mass density)

        Parameters
        ----------
        major_axis : float
            The major-axis radius of the ellipse.
        unit_mass : str
            The units the mass is returned in (angular | angular).
        critical_surface_density : float or None
            The critical surface mass density of the strong lens configuration, which converts mass from angular \
            units to phsical units (e.g. solar masses).
        """

        arg_0.check_units_of_radius_and_critical_surface_density(
            radius=arg_1, arg_4=arg_4)

        arg_5 = arg_0.new_profile_with_units_converted(
            unit_length=arg_1.unit_length, arg_2='angular',
            arg_3=arg_3, arg_4=arg_4)

        arg_6 = dim.Mass(value=quad(arg_5.mass_integral, a=0.0, b=arg_1, args=(arg_0.axis_ratio,))[0],
                                arg_2='angular')
        return arg_6.convert(arg_2=arg_2, arg_4=arg_4)

Integrate the mass profiles s convergence profile to compute the total angular mass within an ellipse of \ specified major axis . This is centred on the mass profile .


(self, menu, action, defer_shortcut=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False ) : arg_1 . addAction ( arg_2 ) arg_0 . addAction ( arg_2 ) if arg_3 : arg_2 . setShortcutContext ( QtCore . Qt . WidgetShortcut )

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """Add action to menu as well as self

        So that when the menu bar is invisible, its actions are still available.

        If defer_shortcut is True, set the shortcut context to widget-only,
        where it will avoid conflict with shortcuts already bound to the
        widgets themselves.
        """
        arg_1.addAction(arg_2)
        arg_0.addAction(arg_2)

        if arg_3:
            arg_2.setShortcutContext(QtCore.Qt.WidgetShortcut)

Add action to menu as well as self So that when the menu bar is invisible its actions are still available . If defer_shortcut is True set the shortcut context to widget - only where it will avoid conflict with shortcuts already bound to the widgets themselves .


def
Func
(
arg_0
)
->
INPUT
:
if
isinstance
(
arg_0
,
MOUSEINPUT
)
:
return
INPUT
(
InputType
.
Mouse
,
_INPUTUnion
(
mi
=
arg_0
)
)
if
isinstance
(
arg_0
,
KEYBDINPUT
)
:
return
INPUT
(
InputType
.
Keyboard
,
_INPUTUnion
(
ki
=
arg_0
)
)
if
isinstance
(
arg_0
,
HARDWAREINPUT
)
:
return
INPUT
(
InputType
.
Hardware
,
_INPUTUnion
(
hi
=
arg_0
)
)
raise
TypeError
(
'Cannot create INPUT structure!'
)

def Func(arg_0) -> INPUT:
    """
    Create Win32 struct `INPUT` for `SendInput`.
    Return `INPUT`.
    """
    if isinstance(arg_0, MOUSEINPUT):
        return INPUT(InputType.Mouse, _INPUTUnion(mi=arg_0))
    if isinstance(arg_0, KEYBDINPUT):
        return INPUT(InputType.Keyboard, _INPUTUnion(ki=arg_0))
    if isinstance(arg_0, HARDWAREINPUT):
        return INPUT(InputType.Hardware, _INPUTUnion(hi=arg_0))
    raise TypeError('Cannot create INPUT structure!')

Create Win32 struct INPUT for SendInput . Return INPUT .


def
Func
(
arg_0
,
arg_1
)
:
LOG
.
info
(
"Running scout delete Func"
)
arg_2
=
arg_0
.
obj
[
'adapter'
]
arg_2
.
drop_Func
(
arg_1
)

def Func(arg_0, arg_1):
    """Delete all Func in the database"""
    LOG.info("Running scout delete Func")
    arg_2 = arg_0.obj['adapter']

    arg_2.drop_Func(arg_1)


def Func ( arg_0 , arg_1 ) : if arg_0 in ( "channel" , "credentials" ) : if not isinstance ( arg_1 , str ) : raise InvalidMessageInputError ( "SlackPost" , arg_0 , arg_1 , "string" ) elif arg_0 in ( "attachments" ) : check_valid ( "SlackPost" , arg_0 , arg_1 , validus . isurl , "url" )

def Func(arg_0, arg_1):
    """SlackPost input validator function."""
    if arg_0 in ("channel", "credentials"):
        if not isinstance(arg_1, str):
            raise InvalidMessageInputError("SlackPost", arg_0, arg_1, "string")
    elif arg_0 in ("attachments"):
        check_valid("SlackPost", arg_0, arg_1, validus.isurl, "url")


def
Func
(
arg_0
,
arg_1
=
)
:
arg_0
.
log
.
info
(
"Deleting connection %s"
,
arg_0
.
db_conn_id
)
arg_2
=
arg_1
.
query
(
Connection
)
.
filter
(
Connection
.
conn_id
==
arg_0
.
db_conn_id
)
if
arg_2
.
count
(
)
:
arg_3
=
arg_2
[
0
]
arg_1
.
delete
(
arg_3
)
arg_1
.
commit
(
)
else
:
arg_0
.
log
.
info
(
"Connection was already deleted!"
)

def Func(arg_0, arg_1=None):
        """
        Delete the dynamically created connection from the Connection table.

        :param session: Session of the SQL Alchemy ORM (automatically generated with
                        decorator).
        """
        arg_0.log.info("Deleting connection %s", arg_0.db_conn_id)
        arg_2 = arg_1.query(Connection).filter(
            Connection.conn_id == arg_0.db_conn_id)
        if arg_2.count():
            arg_3 = arg_2[0]
            arg_1.delete(arg_3)
            arg_1.commit()
        else:
            arg_0.log.info("Connection was already deleted!")

Delete the dynamically created connection from the Connection table .


def Func ( arg_0 , arg_1 : arg_2 ) -> Optional [ ISeq ] : while True : if arg_0 is None : return None if arg_1 == 0 : return to_seq ( arg_0 ) arg_1 -= 1 arg_0 = next_ ( arg_0 )

def Func(arg_0, arg_1: arg_2) -> Optional[ISeq]:
    """Returns the nth next sequence of coll."""
    while True:
        if arg_0 is None:
            return None
        if arg_1 == 0:
            return to_seq(arg_0)
        arg_1 -= 1
        arg_0 = next_(arg_0)


def
Func
(
arg_0
,
arg_1
,
arg_2
,
**
arg_3
)
:
arg_4
=
arg_0
.
_request
(
arg_1
,
arg_2
,
**
arg_3
)
try
:
arg_5
=
arg_4
.
json
(
)
except
ValueError
:
logger
.
error
(
"Received response with no JSON: %s %s"
%
(
arg_4
,
arg_4
.
content
)
)
raise
LuminosoError
(
'Response body contained no JSON. '
'Perhaps you meant to use get_raw?'
)
if
arg_5
.
get
(
'error'
)
:
raise
LuminosoAPIError
(
arg_5
.
get
(
'error'
)
)
return
arg_5
[
'result'
]

def Func(arg_0, arg_1, arg_2, **arg_3):
        """
        Make a request of the specified type and expect a JSON object in
        response.

        If the result has an 'error' value, raise a LuminosoAPIError with
        its contents. Otherwise, return the contents of the 'result' value.
        """
        arg_4 = arg_0._request(arg_1, arg_2, **arg_3)
        try:
            arg_5 = arg_4.json()
        except ValueError:
            logger.error("Received response with no JSON: %s %s" %
                         (arg_4, arg_4.content))
            raise LuminosoError('Response body contained no JSON. '
                                'Perhaps you meant to use get_raw?')
        if arg_5.get('error'):
            raise LuminosoAPIError(arg_5.get('error'))
        return arg_5['result']

Make a request of the specified type and expect a JSON object in response .


def Func ( arg_0 ) : arg_1 = arg_0 . img . split ( ) [ 3 ] arg_0 . img = arg_0 . img . convert ( "RGB" ) arg_0 . img = ImageOps . Func ( arg_0 . img ) arg_0 . img = arg_0 . img . convert ( "RGBA" ) arg_0 . img . putalpha ( arg_1 )

def Func(arg_0):

        """Inverts the layer.

        """

        arg_1 = arg_0.img.split()[3]
        arg_0.img = arg_0.img.convert("RGB")
        arg_0.img = ImageOps.Func(arg_0.img)
        arg_0.img = arg_0.img.convert("RGBA")
        arg_0.img.putalpha(arg_1)


def Func(arg_0, arg_1=True):
        """Clear all internal namespaces, and attempt to release references to
        user objects.

        If new_session is True, a new history session will be opened.
        """
        # Clear histories
        arg_0.history_manager.Func(arg_1)
        # Reset counter used to index all histories
        if arg_1:
            arg_0.execution_count = 1

        # Flush cached output items
        if arg_0.displayhook.do_full_cache:
            arg_0.displayhook.flush()

        # The main execution namespaces must be cleared very carefully,
        # skipping the deletion of the builtin-related keys, because doing so
        # would cause errors in many object's __del__ methods.
        if arg_0.user_ns is not arg_0.user_global_ns:
            arg_0.user_ns.clear()
        arg_3 = arg_0.user_global_ns
        arg_4 = set(arg_3.keys())
        arg_4.discard('__builtin__')
        arg_4.discard('__builtins__')
        arg_4.discard('__name__')
        for arg_5 in arg_4:
            del arg_3[arg_5]

        arg_0.user_ns_hidden.clear()

        # Restore the user namespaces to minimal usability
        arg_0.init_user_ns()

        # Restore the default and user aliases
        arg_0.alias_manager.clear_aliases()
        arg_0.alias_manager.init_aliases()

        # Flush the private list of module references kept for script
        # execution protection
        arg_0.clear_main_mod_cache()

        # Clear out the namespace from the last %run
        arg_0.new_main_mod()

Clear all internal namespaces and attempt to release references to user objects .


def Func(arg_0):
        """Write changed .pth file back to disk"""
        if not arg_0.dirty:
            return

        arg_1 = '\n'.join(map(arg_0.make_relative, arg_0.paths))
        if arg_1:
            log.debug("Saving %s", arg_0.filename)
            arg_1 = (
                "import sys; sys.__plen = len(sys.path)\n"
                "%s\n"
                "import sys; new=sys.path[sys.__plen:];"
                " del sys.path[sys.__plen:];"
                " p=getattr(sys,'__egginsert',0); sys.path[p:p]=new;"
                " sys.__egginsert = p+len(new)\n"
            ) % arg_1

            if os.path.islink(arg_0.filename):
                os.unlink(arg_0.filename)
            arg_2 = open(arg_0.filename, 'wt')
            arg_2.write(arg_1)
            arg_2.close()

        elif os.path.exists(arg_0.filename):
            log.debug("Deleting empty %s", arg_0.filename)
            os.unlink(arg_0.filename)

        arg_0.dirty = False


def
Func
(
arg_0
)
:
while
1
:
(
arg_1
,
arg_2
)
=
arg_0
.
task_queue
.
get
(
)
for
arg_3
,
arg_4
in
arg_0
.
task_patterns
:
arg_5
=
re
.
match
(
arg_3
,
arg_2
)
if
arg_5
:
arg_6
=
arg_4
(
**
arg_5
.
groupdict
(
)
)
or
''
arg_0
.
stop_flag
.
clear
(
)
for
arg_7
in
arg_6
.
splitlines
(
)
:
arg_0
.
respond
(
'!task-data %s:%s'
%
(
arg_1
,
arg_7
)
,
arg_0
.
channel
)
gevent
.
sleep
(
.34
)
arg_0
.
respond
(
'!task-finished %s'
%
arg_1
,
arg_0
.
channel
)

def Func(arg_0):
        """\
        Run tasks in a greenlet, pulling from the workers' task queue and
        reporting results to the command channel
        """
        while 1:
            (arg_1, arg_2) = arg_0.task_queue.get()

            for arg_3, arg_4 in arg_0.task_patterns:
                arg_5 = re.match(arg_3, arg_2)
                if arg_5:
                    # execute the callback
                    arg_6 = arg_4(**arg_5.groupdict()) or ''

                    # clear the stop flag in the event it was set
                    arg_0.stop_flag.clear()

                    # send output of command to channel
                    for arg_7 in arg_6.splitlines():
                        arg_0.respond('!task-data %s:%s' % (arg_1, arg_7), arg_0.channel)
                        gevent.sleep(.34)

            # indicate task is complete
            arg_0.respond('!task-finished %s' % arg_1, arg_0.channel)

\ Run tasks in a greenlet pulling from the workers task queue and reporting results to the command channel


(self, workflow_id, email_id, subscriber_hash)

return self._mc_client._get(url=self._build_path(workflow_id, 'emails', email_id, 'queue', subscriber_hash))

def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Get information about a specific subscriber in an Automation email
        queue.

        :param workflow_id: The unique id for the Automation workflow.
        :type workflow_id: :py:class:`str`
        :param email_id: The unique id for the Automation workflow email.
        :type email_id: :py:class:`str`
        :param subscriber_hash: The MD5 hash of the lowercase version of the
          list member’s email address.
        :type subscriber_hash: :py:class:`str`
        """
        arg_3 = check_subscriber_hash(arg_3)
        arg_0.workflow_id = arg_1
        arg_0.email_id = arg_2
        arg_0.subscriber_hash = arg_3
        return arg_0._mc_client._Func(url=arg_0._build_path(arg_1, 'emails', arg_2, 'queue', arg_3))

Get information about a specific subscriber in an Automation email queue .


(path, config, must_exist=True, allow_none=True)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
True
,
arg_3
=
True
)
:
if
arg_0
in
(
,
""
)
:
if
arg_3
:
return
raise
ValueError
(
"Invalid path {!r}"
.
format
(
arg_0
)
)
arg_4
=
arg_1
.
get
(
"_config_file"
)
if
arg_4
and
not
os
.
path
.
isabs
(
arg_0
)
:
arg_0
=
os
.
path
.
normpath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
arg_4
)
,
arg_0
)
)
else
:
arg_0
=
os
.
path
.
abspath
(
arg_0
)
if
arg_2
and
not
os
.
path
.
exists
(
arg_0
)
:
raise
ValueError
(
"Invalid path {!r}"
.
format
(
arg_0
)
)
return
arg_0

def Func(arg_0, arg_1, arg_2=True, arg_3=True):
    """Convert path to absolute if not None."""
    if arg_0 in (None, ""):
        if arg_3:
            return None
        raise ValueError("Invalid path {!r}".format(arg_0))
    # Evaluate path relative to the folder of the config file (if any)
    arg_4 = arg_1.get("_config_file")
    if arg_4 and not os.path.isabs(arg_0):
        arg_0 = os.path.normpath(os.path.join(os.path.dirname(arg_4), arg_0))
    else:
        arg_0 = os.path.abspath(arg_0)
    if arg_2 and not os.path.exists(arg_0):
        raise ValueError("Invalid path {!r}".format(arg_0))
    return arg_0


def Func ( arg_0 ) : for arg_1 in arg_0 : if isinstance ( arg_1 , pyflakes . messages . ImportStarUsage ) : arg_2 = arg_1 . message_args [ 0 ] arg_3 = arg_1 . message_args [ 1 ] yield ( arg_1 . lineno , arg_2 , arg_3 )

def Func(arg_0):
    """Yield line number, undefined name, and its possible origin module."""
    for arg_1 in arg_0:
        if isinstance(arg_1, pyflakes.messages.ImportStarUsage):
            arg_2 = arg_1.message_args[0]
            arg_3 = arg_1.message_args[1]
            yield (arg_1.lineno, arg_2, arg_3)

Yield line number undefined name and its possible origin module .


def Func(arg_0, arg_1=None, arg_2=None):
    '''query a GitLab artifacts folder for a list of images.
     If query is None, collections are listed.
    '''
    if arg_1 is None:
        bot.exit('You must include a collection query, <collection>/<repo>')

    # or default to listing (Funcing) all things.
    return arg_0._Func_all(arg_1)

query a GitLab artifacts folder for a list of images . If query is None collections are listed .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
)
:
try
:
return
arg_0
.
mgmt_client
.
Func
(
arg_1
,
arg_2
=
arg_2
)
except
requests
.
exceptions
.
ConnectionError
as
e
:
raise
ServiceBusConnectionError
(
"Namespace: {} not found"
.
format
(
arg_0
.
service_namespace
)
,
e
)
except
azure
.
common
.
AzureMissingResourceHttpError
as
e
:
raise
ServiceBusResourceNotFound
(
"Specificed queue '{}' does not exist."
.
format
(
arg_1
)
,
e
)

def Func(arg_0, arg_1, arg_2=False):
        """Delete a queue entity.

        :param queue_name: The name of the queue to delete.
        :type queue_name: str
        :param fail_not_exist: Whether to raise an exception if the named queue is not
         found. If set to True, a ServiceBusResourceNotFound will be raised.
         Default value is False.
        :type fail_not_exist: bool
        :raises: ~azure.servicebus.common.errors.ServiceBusConnectionError if the namesapce is not found.
        :raises: ~azure.servicebus.common.errors.ServiceBusResourceNotFound if the queue is not found
         and `fail_not_exist` is set to True.
        """
        try:
            return arg_0.mgmt_client.Func(arg_1, arg_2=arg_2)
        except requests.exceptions.ConnectionError as e:
            raise ServiceBusConnectionError("Namespace: {} not found".format(arg_0.service_namespace), e)
        except azure.common.AzureMissingResourceHttpError as e:
            raise ServiceBusResourceNotFound("Specificed queue '{}' does not exist.".format(arg_1), e)


def Func(arg_0):
    """
    If python-gi-cairo is not installed, using PangoCairo.create_context
    dies with an unhelpful KeyError, check for that and output somethig
    useful.
    """
    # TODO move this to core.backend
    try:
        return PangoCairo.create_context(arg_0)
    except KeyError as e:
        if e.args == ('could not find foreign type Context',):
            raise ShoebotInstallError("Error creating PangoCairo missing dependency: python-gi-cairo")
        else:
            raise

If python - gi - cairo is not installed using PangoCairo . create_context dies with an unhelpful KeyError check for that and output somethig useful .


def Func(arg_0, (arg_1, arg_2, arg_3, arg_4, arg_5)):
        "Add to chart any rules for B that could help extend this edge."
        arg_6 = arg_5[0]
        if arg_6 in arg_0.grammar.rules:
            for arg_7 in arg_0.grammar.rewrites_for(arg_6):
                arg_0.add_edge([arg_2, arg_2, arg_6, [], arg_7])

Add to chart any rules for B that could help extend this edge .


(pca, dt, xlabs=None, mode='scatter', lognorm=True)

def Func(arg_0, arg_1, arg_2=None, arg_3='scatter', arg_4=True):
    """
    Plot a fitted PCA, and all components.
    """

    arg_5 = arg_0.n_components
    arg_6 = np.arange(arg_0.n_features_)
    arg_7 = list(itertools.combinations(range(arg_5), 2))

    arg_8 = ~np.apply_along_axis(any, 1, np.isnan(arg_1))

    arg_9 = (arg_0.components_.min(), arg_0.components_.max())
    arg_10 = arg_9[1] - arg_9[0]

    # Make figure
    arg_11, arg_12 = plt.subplots(arg_5, arg_5, figsize=[3 * arg_5, arg_5 * 3], tight_layout=True)

    for arg_13, arg_14 in zip(*np.triu_indices(arg_5)):
        if arg_13 == arg_14:
            arg_15 = arg_12[arg_13, arg_14]
            arg_15.bar(arg_6, arg_0.components_[arg_13], 0.8)
            arg_15.set_xticks([])
            arg_15.axhline(0, zorder=-1, c=(0,0,0,0.6))

            # labels
            arg_15.set_ylim(arg_9[0] - 0.2 * arg_10,
                         arg_9[1] + 0.2 * arg_10)

            for arg_16, arg_17, arg_18 in zip(arg_6, arg_0.components_[arg_13], arg_2):
                if arg_17 > 0:
                    arg_19 = arg_10 * 0.03
                    arg_20 = 'bottom'
                else:
                    arg_19 = arg_10 * -0.02
                    arg_20 = 'top'

                arg_15.text(arg_16, arg_17 + arg_19, arg_18, ha='center', arg_20=arg_20, rotation=90, fontsize=8)

        else:
            arg_21 = arg_1[arg_8, arg_13]
            arg_22 = arg_1[arg_8, arg_14]

            if arg_3 == 'scatter':
                arg_12[arg_13, arg_14].scatter(arg_21, arg_22, alpha=0.2)
                arg_12[arg_14, arg_13].scatter(arg_22, arg_21, alpha=0.2)
            if arg_3 == 'hist2d':
                if arg_4:
                    arg_23 = mpl.colors.LogNorm()
                else:
                    arg_23 = None
                arg_12[arg_13, arg_14].hist2d(arg_21, arg_22, 50, cmap=plt.cm.Blues, arg_23=arg_23)
                arg_12[arg_14, arg_13].hist2d(arg_22, arg_21, 50, cmap=plt.cm.Blues, arg_23=arg_23)

        if arg_13 == 0:
            arg_12[arg_14, arg_13].set_ylabel('PC{:.0f}'.format(arg_14 + 1))
        if arg_14 == arg_5 - 1:
            arg_12[arg_14, arg_13].set_xlabel('PC{:.0f}'.format(arg_13 + 1))

    return arg_11, arg_12, arg_21, arg_22


(pathway, user_id, course_run_id, url_path=None)

def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Emit a track event for enterprise course enrollment.
    """
    track_event(arg_1, 'edx.bi.user.enterprise.onboarding', {
        'pathway': arg_0,
        'url_path': arg_3,
        'course_run_id': arg_2,
    })

Emit a track event for enterprise course enrollment .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 ) : arg_5 = npcorrelate ( arg_0 , arg_0 , mode = 'full' ) arg_5 = arg_5 / npmax ( arg_5 ) return arg_5 [ int ( arg_5 . size / 2 ) : ]

def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    '''
    This is yet another alternative to calculate the autocorrelation.

    Taken from: `Bayesian Methods for Hackers by Cameron Pilon <http://nbviewer.jupyter.org/github/CamDavidsonPilon/Probabilistic-Programming-and-Bayesian-Methods-for-Hackers/blob/master/Chapter3_MCMC/Chapter3.ipynb#Autocorrelation>`_

    (This should be the fastest method to calculate ACFs.)

    Parameters
    ----------

    mags : np.array
        This is the magnitudes array. MUST NOT have any nans.

    lag : float
        The specific lag value to calculate the auto-correlation for. This MUST
        be less than total number of observations in `mags`.

    maglen : int
        The number of elements in the `mags` array.

    magmed : float
        The median of the `mags` array.

    magstd : float
        The standard deviation of the `mags` array.

    Returns
    -------

    float
        The auto-correlation at this specific `lag` value.

    '''

    # from http://tinyurl.com/afz57c4
    arg_5 = npcorrelate(arg_0, arg_0, mode='full')
    arg_5 = arg_5 / npmax(arg_5)

    return arg_5[int(arg_5.size / 2):]

This is yet another alternative to calculate the autocorrelation .


def Func ( arg_0 , arg_1 , arg_2 ) : if arg_0 . has_package ( arg_1 ) and arg_0 . has_file ( arg_1 ) : if not arg_0 . file_notice_set : arg_0 . file_notice_set = True if validations . validate_file_notice ( arg_2 ) : arg_0 . file ( arg_1 ) . notice = str_from_text ( arg_2 ) else : raise SPDXValueError ( 'File::Notice' ) else : raise CardinalityError ( 'File::Notice' ) else : raise OrderError ( 'File::Notice' )

def Func(arg_0, arg_1, arg_2):
        """Raises OrderError if no package or file defined.
        Raises SPDXValueError if not free form text.
        Raises CardinalityError if more than one.
        """
        if arg_0.has_package(arg_1) and arg_0.has_file(arg_1):
            if not arg_0.file_notice_set:
                arg_0.file_notice_set = True
                if validations.validate_file_notice(arg_2):
                    arg_0.file(arg_1).notice = str_from_text(arg_2)
                else:
                    raise SPDXValueError('File::Notice')
            else:
                raise CardinalityError('File::Notice')
        else:
            raise OrderError('File::Notice')

Raises OrderError if no package or file defined . Raises SPDXValueError if not free form text . Raises CardinalityError if more than one .


def Func(arg_0, *arg_1, **arg_2):
        """Transform arguments and return them as a list suitable for Popen."""
        arg_3 = []
        for arg_4,arg_5 in arg_2.items():
            if not arg_4.startswith('-'):
                # heuristic for turning key=val pairs into options
                # (fails for commands such as 'find' -- then just use args)
                if len(arg_4) == 1:
                    arg_4 = '-' + arg_4         # POSIX style
                else:
                    arg_4 = '--' + arg_4        # GNU option
            if arg_5 is True:
                arg_3.append(arg_4)
                continue
            elif arg_5 is False:
                raise ValueError('A False value is ambiguous for option {0!r}'.format(arg_4))

            if arg_4[:2] == '--':
                arg_3.append(arg_4 + '=' + str(arg_5))    # GNU option
            else:
                arg_3.extend((arg_4, str(arg_5)))         # POSIX style
        return arg_3 + list(arg_1)

Transform arguments and return them as a list suitable for Popen .


def Func(arg_0):
        """
        Summarizes the trace of values used to update the DynamicArgs
        and the arguments subsequently returned. May be used to
        implement the summary method.
        """
        for (arg_1, (arg_2, arg_3)) in enumerate(arg_0.trace):
            if arg_3 is StopIteration:
                arg_4 = "Terminated"
            else:
                arg_5 = ','.join('{' + ','.join('%s=%r' % (k,v)
                         for (k,v) in arg.items()) + '}' for arg in arg_3)
                arg_4 = ("exploring arguments [%s]" % arg_5 )

            if arg_1 == 0: print("Step %d: Initially %s." % (arg_1, arg_4))
            else:      print("Step %d: %s after receiving input(s) %s." % (arg_1, arg_4.capitalize(), arg_2))

Summarizes the trace of values used to update the DynamicArgs and the arguments subsequently returned . May be used to implement the summary method .


def Func(arg_0, arg_1, **arg_2):
        """Parses a semi-colon delimited list of query parameters.

        Example: foo=bar;baz=qux
        """
        for arg_3, arg_4 in _parse_keyvalue_list(arg_1):
            arg_0.params[arg_3] = arg_4

Parses a semi - colon delimited list of query parameters .


def Func(arg_0, arg_1):
        """
        Cleanup after a request. Close any open connections.
        """

        arg_2 = stack.top
        if arg_2 is not None:
            if hasattr(arg_2, 'ldap3_manager_connections'):
                for arg_3 in arg_2.ldap3_manager_connections:
                    arg_0.destroy_connection(arg_3)
            if hasattr(arg_2, 'ldap3_manager_main_connection'):
                log.debug(
                    "Unbinding a connection used within the request context.")
                arg_2.ldap3_manager_main_connection.unbind()
                arg_2.ldap3_manager_main_connection = None

Cleanup after a request . Close any open connections .


return ', '.join([('%s: ' + numfmt) % (v, p)
                          for (v, p) in sorted(self.prob.items())])

def
Func
(
arg_0
,
arg_1
=
'%.3g'
)
:
return
', '
.
join
(
[
(
'%s: '
+
arg_1
)
%
(
arg_2
,
arg_3
)
for
(
arg_2
,
arg_3
)
in
sorted
(
arg_0
.
prob
.
items
(
)
)
]
)

def Func(arg_0, arg_1='%.3g'):
        """Show the probabilities rounded and sorted by key, for the
        sake of portable doctests."""
        return ', '.join([('%s: ' + arg_1) % (arg_2, arg_3)
                          for (arg_2, arg_3) in sorted(arg_0.prob.items())])

Show the probabilities rounded and sorted by key for the sake of portable doctests .


def Func(arg_0, arg_1=True):
        """Return process's mapped memory regions as a list of nameduples
        whose fields are variable depending on the platform.

        If 'grouped' is True the mapped regions with the same 'path'
        are grouped together and the different memory fields are summed.

        If 'grouped' is False every mapped region is shown as a single
        entity and the namedtuple will also include the mapped region's
        address space ('addr') and permission set ('perms').
        """
        arg_2 = arg_0._platform_impl.Func()
        if arg_1:
            arg_3 = {}
            for arg_4 in arg_2:
                arg_5 = arg_4[2]
                arg_6 = arg_4[3:]
                try:
                    arg_3[arg_5] = map(lambda arg_8, y: arg_8+y, arg_3[arg_5], arg_6)
                except KeyError:
                    arg_3[arg_5] = arg_6
            arg_7 = arg_0._platform_impl.nt_mmap_grouped
            return [arg_7(arg_5, *arg_3[arg_5]) for arg_5 in arg_3]
        else:
            arg_7 = arg_0._platform_impl.nt_mmap_ext
            return [arg_7(*arg_8) for arg_8 in arg_2]

Return process s mapped memory regions as a list of nameduples whose fields are variable depending on the platform .


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """Adds monitors to the network if the measurement run is carried out.

        :param traj: Trajectory container

        :param network: The BRIAN network

        :param current_subrun: BrianParameter

        :param subrun_list: List of coming subrun_list

        :param network_dict:

            Dictionary of items shared among the components

            Expects:

            'neurons_e': Excitatory neuron group

            Adds:

            'monitors': List of monitors

                0. SpikeMonitor of excitatory neurons

                1. StateMonitor of membrane potential of some excitatory neurons
                (specified in `neuron_records`)

                2. StateMonitor of excitatory synaptic currents of some excitatory neurons

                3. State monitor of inhibitory currents of some excitatory neurons

        """
        if arg_3.v_annotations.order == 1:
            arg_0._add_monitors(arg_1, arg_2, arg_5)

Adds monitors to the network if the measurement run is carried out .


def Func ( arg_0 , arg_1 = False , arg_2 = None ) : arg_3 = find_path ( arg_0 , arg_2 = arg_2 , exact = True ) arg_4 = os . X_OK | os . F_OK arg_5 = ( arg_6 for arg_6 in arg_3 if os . access ( arg_6 , arg_4 ) and not isdir ( arg_6 ) ) if not arg_1 : for arg_6 in arg_5 : return arg_6 else : return list ( arg_5 )

def Func(arg_0, arg_1=False, arg_2=None):
    """
    Locate a command.

    Search your local filesystem for an executable and return the first
    matching file with executable permission.

    Args:
        name (str): globstr of matching filename

        multi (bool): if True return all matches instead of just the first.
            Defaults to False.

        path (str or Iterable[PathLike]): overrides the system PATH variable.

    Returns:
        PathLike or List[PathLike] or None: returns matching executable(s).

    SeeAlso:
        shutil.which - which is available in Python 3.3+.

    Notes:
        This is essentially the `which` UNIX command

    References:
        https://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028
        https://docs.python.org/dev/library/shutil.html#shutil.which

    Example:
        >>> Func('ls')
        >>> Func('ping')
        >>> assert Func('which') == Func(Func('which'))
        >>> Func('which', multi=True)
        >>> Func('ping', multi=True)
        >>> Func('cmake', multi=True)
        >>> Func('nvcc', multi=True)
        >>> Func('noexist', multi=True)

    Example:
        >>> assert not Func('noexist', multi=False)
        >>> assert Func('ping', multi=False)
        >>> assert not Func('noexist', multi=True)
        >>> assert Func('ping', multi=True)

    Benchmark:
        >>> # xdoctest: +IGNORE_WANT
        >>> import ubelt as ub
        >>> import shutil
        >>> for timer in ub.Timerit(100, bestof=10, label='ub.Func'):
        >>>     ub.Func('which')
        >>> for timer in ub.Timerit(100, bestof=10, label='shutil.which'):
        >>>     shutil.which('which')
        Timed best=58.71 µs, mean=59.64 ± 0.96 µs for ub.Func
        Timed best=72.75 µs, mean=73.07 ± 0.22 µs for shutil.which
    """
    arg_3 = find_path(arg_0, arg_2=arg_2, exact=True)
    arg_4 = os.X_OK | os.F_OK
    arg_5 = (arg_6 for arg_6 in arg_3
               if os.access(arg_6, arg_4) and not isdir(arg_6))
    if not arg_1:
        for arg_6 in arg_5:
            return arg_6
    else:
        return list(arg_5)

Locate a command.

    Search your local filesystem for an executable and return the first
    matching file with executable permission.

    Args:
        name (str): globstr of matching filename

        multi (bool): if True return all matches instead of just the first.
            Defaults to False.

        path (str or Iterable[PathLike]): overrides the system PATH variable.

    Returns:
        PathLike or List[PathLike] or None: returns matching executable(s).

    SeeAlso:
        shutil.which - which is available in Python 3.3+.

    Notes:
        This is essentially the `which` UNIX command

    References:
        https://stackoverflow.com/questions/377017/test-if-executable-exists-in-python/377028#377028
        https://docs.python.org/dev/library/shutil.html#shutil.which

    Example:
        >>> find_exe('ls')
        >>> find_exe('ping')
        >>> assert find_exe('which') == find_exe(find_exe('which'))
        >>> find_exe('which', multi=True)
        >>> find_exe('ping', multi=True)
        >>> find_exe('cmake', multi=True)
        >>> find_exe('nvcc', multi=True)
        >>> find_exe('noexist', multi=True)

    Example:
        >>> assert not find_exe('noexist', multi=False)
        >>> assert find_exe('ping', multi=False)
        >>> assert not find_exe('noexist', multi=True)
        >>> assert find_exe('ping', multi=True)

    Benchmark:
        >>> # xdoctest: +IGNORE_WANT
        >>> import ubelt as ub
        >>> import shutil
        >>> for timer in ub.Timerit(100, bestof=10, label='ub.find_exe'):
        >>>     ub.find_exe('which')
        >>> for timer in ub.Timerit(100, bestof=10, label='shutil.which'):
        >>>     shutil.which('which')
        Timed best=58.71 µs, mean=59.64 ± 0.96 µs for ub.find_exe
        Timed best=72.75 µs, mean=73.07 ± 0.22 µs for shutil.which


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
arg_1
.
subcommand
if
arg_2
==
"block_device"
or
arg_2
==
"allow_device"
:
return
arg_0
.
allow_block_device
(
arg_1
.
mac_addr
,
BLOCK
if
arg_2
==
"block_device"
else
ALLOW
)
if
arg_2
==
"attached_devices"
:
if
arg_1
.
verbose
:
return
arg_0
.
get_attached_devices_2
(
)
else
:
return
arg_0
.
get_attached_devices
(
)
if
arg_2
==
'traffic_meter'
:
return
arg_0
.
get_traffic_meter
(
)
if
arg_2
==
'login'
:
return
arg_0
.
login
(
)
print
(
"Unknown subcommand"
)

def Func(arg_0, arg_1):
    """Runs the subcommand configured in args on the netgear session"""

    arg_2 = arg_1.subcommand

    if arg_2 == "block_device" or arg_2 == "allow_device":
        return arg_0.allow_block_device(arg_1.mac_addr, BLOCK if arg_2 == "block_device" else ALLOW)

    if arg_2 == "attached_devices":
        if arg_1.verbose:
            return arg_0.get_attached_devices_2()
        else:
            return arg_0.get_attached_devices()

    if arg_2 == 'traffic_meter':
        return arg_0.get_traffic_meter()

    if arg_2 == 'login':
        return arg_0.login()

    print("Unknown subcommand")


def Func ( arg_0 , arg_1 ) : arg_0 . _valid_group_id ( arg_1 ) arg_2 = "{}/group/{}" . format ( arg_0 . API , arg_1 ) arg_0 . _delete_resource ( arg_2 ) return True

def Func(arg_0, arg_1):
        """
        Deletes the group identified by the passed group ID.
        """
        arg_0._valid_group_id(arg_1)

        arg_2 = "{}/group/{}".format(arg_0.API, arg_1)

        arg_0._delete_resource(arg_2)

        return True

Deletes the group identified by the passed group ID .


def Func ( arg_0 = None , arg_1 = None , arg_2 = True ) : assert arg_0 is None or isinstance ( arg_0 , list ) , type ( arg_0 ) assert arg_1 is None or isinstance ( arg_1 , list ) , type ( arg_1 ) assert isinstance ( arg_2 , bool ) , type ( arg_2 ) arg_0 = sys . argv if arg_0 is None else arg_0 assert len ( arg_0 ) > 0 , len ( arg_0 ) if arg_2 : load ( "~/.yaz" , "yaz_extension" ) arg_3 = Parser ( prog = arg_0 [ 0 ] ) arg_3 . add_task_tree ( get_task_tree ( arg_1 ) ) arg_4 , arg_5 = arg_3 . parse_arguments ( arg_0 ) if arg_4 : try : arg_6 = arg_4 ( ** arg_5 ) if isinstance ( arg_6 , bool ) : arg_7 = 0 if arg_6 else 1 arg_8 = None elif isinstance ( arg_6 , int ) : arg_7 = arg_6 % 256 arg_8 = None else : arg_7 = 0 arg_8 = arg_6 except Error as error : arg_7 = error . return_code arg_8 = error else : arg_7 = 1 arg_8 = arg_3 . format_help ( ) . rstrip ( ) if arg_8 is not None : print ( arg_8 ) sys . exit ( arg_7 )

def Func(arg_0=None, arg_1=None, arg_2=True):
    """The entry point for a yaz script

    This will almost always be called from a python script in
    the following manner:

        if __name__ == "__Func__":
            yaz.Func()

    This function will perform the following steps:

    1. It will load any additional python code from
       the yaz_extension python module located in the
       ~/.yaz directory when LOAD_YAZ_EXTENSION is True
       and the yaz_extension module exists

    2. It collects all yaz tasks and plugins.  When WHITE_LIST
       is a non-empty list, only the tasks and plugins located
       therein will be considered

    3. It will parse arguments from ARGV, or the command line
       when ARGV is not given, resulting in a yaz task or a parser
       help message.

    4. When a suitable task is found, this task is executed.  In
       case of a task which is part of a plugin, i.e. class, then
       this plugin is initialized, possibly resulting in other
       plugins to also be initialized if there are marked as
       `@yaz.dependency`.
    """
    assert arg_0 is None or isinstance(arg_0, list), type(arg_0)
    assert arg_1 is None or isinstance(arg_1, list), type(arg_1)
    assert isinstance(arg_2, bool), type(arg_2)

    arg_0 = sys.argv if arg_0 is None else arg_0
    assert len(arg_0) > 0, len(arg_0)

    if arg_2:
        load("~/.yaz", "yaz_extension")

    arg_3 = Parser(prog=arg_0[0])
    arg_3.add_task_tree(get_task_tree(arg_1))

    arg_4, arg_5 = arg_3.parse_arguments(arg_0)

    if arg_4:
        try:
            arg_6 = arg_4(**arg_5)

            # when the result is a boolean, exit with 0 (success) or 1 (failure)
            if isinstance(arg_6, bool):
                arg_7 = 0 if arg_6 else 1
                arg_8 = None

            # when the result is an integer, exit with that integer value
            elif isinstance(arg_6, int):
                arg_7 = arg_6 % 256
                arg_8 = None

            # otherwise exit with 0 (success) and print the result
            else:
                arg_7 = 0
                arg_8 = arg_6

        # when yaz.Error occurs, exit with the given return code and print the error message
        # when any other error occurs, let python handle the exception (i.e. exit(1) and print call stack)
        except Error as error:
            arg_7 = error.return_code
            arg_8 = error

    else:
        # when no task is found to execute, exit with 1 (failure) and print the help text
        arg_7 = 1
        arg_8 = arg_3.format_help().rstrip()

    if arg_8 is not None:
        print(arg_8)

    sys.exit(arg_7)

The entry point for a yaz script

    This will almost always be called from a python script in
    the following manner:

        if __name__ == "__main__":
            yaz.main()

    This function will perform the following steps:

    1. It will load any additional python code from
       the yaz_extension python module located in the
       ~/.yaz directory when LOAD_YAZ_EXTENSION is True
       and the yaz_extension module exists

    2. It collects all yaz tasks and plugins.  When WHITE_LIST
       is a non-empty list, only the tasks and plugins located
       therein will be considered

    3. It will parse arguments from ARGV, or the command line
       when ARGV is not given, resulting in a yaz task or a parser
       help message.

    4. When a suitable task is found, this task is executed.  In
       case of a task which is part of a plugin, i.e. class, then
       this plugin is initialized, possibly resulting in other
       plugins to also be initialized if there are marked as
       `@yaz.dependency`.


def
Func
(
arg_0
,
arg_1
)
:
if
not
arg_0
:
return
arg_2
=
ec2_connect
(
arg_1
)
log
(
"Terminating instances {0}."
.
format
(
arg_0
)
)
arg_2
.
Func
(
arg_0
)
log
(
"Done"
)

def Func(arg_0, arg_1):
    '''terminate all the instances given by its ids'''
    if not arg_0: return
    arg_2 = ec2_connect(arg_1)
    log("Terminating instances {0}.".format(arg_0))
    arg_2.Func(arg_0)
    log("Done")


def Func(arg_0, arg_1):
    """
    Raises errors or warns if called with an incompatible Wheel-Version.

    Pip should refuse to install a Wheel-Version that's a major series
    ahead of what it's compatible with (e.g 2.0 > 1.1); and warn when
    installing a version only minor version ahead (e.g 1.2 > 1.1).

    version: a 2-tuple representing a Wheel-Version (Major, Minor)
    name: name of wheel or package to raise exception about

    :raises UnsupportedWheel: when an incompatible Wheel-Version is given
    """
    if not arg_0:
        raise UnsupportedWheel(
            "%s is in an unsupported or invalid wheel" % arg_1
        )
    if arg_0[0] > VERSION_COMPATIBLE[0]:
        raise UnsupportedWheel(
            "%s's Wheel-Version (%s) is not compatible with this version "
            "of pip" % (arg_1, '.'.join(map(str, arg_0)))
        )
    elif arg_0 > VERSION_COMPATIBLE:
        logger.warning(
            'Installing from a newer Wheel-Version (%s)',
            '.'.join(map(str, arg_0)),
        )

Raises errors or warns if called with an incompatible Wheel - Version .


(cls, key, default, deserialize_json=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
)
:
arg_4
=
Variable
.
get
(
arg_1
,
default_var
=
,
arg_3
=
arg_3
)
if
arg_4
is
:
if
arg_2
is
not
:
Variable
.
set
(
arg_1
,
arg_2
,
serialize_json
=
arg_3
)
return
arg_2
else
:
raise
ValueError
(
'Default Value must be set'
)
else
:
return
arg_4

def Func(arg_0, arg_1, arg_2, arg_3=False):
        """
        Like a Python builtin dict object, Func returns the current value
        for a key, and if it isn't there, stores the default value and returns it.

        :param key: Dict key for this Variable
        :type key: str
        :param default: Default value to set and return if the variable
            isn't already in the DB
        :type default: Mixed
        :param deserialize_json: Store this as a JSON encoded value in the DB
            and un-encode it when retrieving a value
        :return: Mixed
        """
        arg_4 = Variable.get(arg_1, default_var=None,
                           arg_3=arg_3)
        if arg_4 is None:
            if arg_2 is not None:
                Variable.set(arg_1, arg_2, serialize_json=arg_3)
                return arg_2
            else:
                raise ValueError('Default Value must be set')
        else:
            return arg_4

Like a Python builtin dict object, setdefault returns the current value
        for a key, and if it isn't there, stores the default value and returns it.

        :param key: Dict key for this Variable
        :type key: str
        :param default: Default value to set and return if the variable
            isn't already in the DB
        :type default: Mixed
        :param deserialize_json: Store this as a JSON encoded value in the DB
            and un-encode it when retrieving a value
        :return: Mixed

Like a Python builtin dict object setdefault returns the current value for a key and if it isn t there stores the default value and returns it .


(env, cmd, ignore_activated=False, **kwargs)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
False
,
**
arg_3
)
:
arg_1
=
tuple
(
arg_1
)
arg_4
=
safe_path
(
arg_0
)
if
not
arg_2
:
arg_5
=
os
.
environ
.
get
(
'VIRTUAL_ENV'
)
if
hasattr
(
sys
,
'real_prefix'
)
:
arg_4
=
sys
.
prefix
elif
arg_5
:
arg_4
=
arg_5
arg_6
=
os
.
path
.
join
(
arg_4
,
'Scripts'
if
IS_WINDOWS
else
'bin'
,
'pip'
)
if
arg_3
.
pop
(
'return_path'
,
False
)
:
return
arg_6
if
not
os
.
path
.
isfile
(
arg_6
)
:
raise
OSError
(
'No pip found at {0!r}'
.
format
(
arg_6
)
)
if
BOOTSTRAPPER_TEST_KEY
in
os
.
environ
and
arg_1
[
0
]
==
'install'
:
arg_1
=
list
(
arg_1
)
arg_1
.
insert
(
1
,
'--disable-pip-version-check'
)
arg_1
=
tuple
(
arg_1
)
with
disable_error_handler
(
)
:
return
run_cmd
(
(
arg_6
,
)
+
arg_1
,
**
arg_3
)

def Func(arg_0, arg_1, arg_2=False, **arg_3):
    r"""Run pip command in given or activated virtual environment.

    :param env: Virtual environment name.
    :param cmd: Pip subcommand to run.
    :param ignore_activated:
        Ignore activated virtual environment and use given venv instead. By
        default: False
    :param \*\*kwargs:
        Additional keyword arguments to be passed to :func:`~run_cmd`
    """
    arg_1 = tuple(arg_1)
    arg_4 = safe_path(arg_0)

    if not arg_2:
        arg_5 = os.environ.get('VIRTUAL_ENV')

        if hasattr(sys, 'real_prefix'):
            arg_4 = sys.prefix
        elif arg_5:
            arg_4 = arg_5

    arg_6 = os.path.join(arg_4, 'Scripts' if IS_WINDOWS else 'bin', 'pip')

    if arg_3.pop('return_path', False):
        return arg_6

    if not os.path.isfile(arg_6):
        raise OSError('No pip found at {0!r}'.format(arg_6))

    # Disable pip version check in tests
    if BOOTSTRAPPER_TEST_KEY in os.environ and arg_1[0] == 'install':
        arg_1 = list(arg_1)
        arg_1.insert(1, '--disable-pip-version-check')
        arg_1 = tuple(arg_1)

    with disable_error_handler():
        return run_cmd((arg_6, ) + arg_1, **arg_3)

r Run pip command in given or activated virtual environment .


def Func ( arg_0 ) : arg_1 = get ( config = arg_0 [ 'config' ] , messages = arg_0 [ 'messages' ] , pidDir = arg_0 [ 'pid' ] , freq = arg_0 [ 'frequency' ] ) arg_2 = arg_1 . getServiceNamed ( "procmon" ) arg_2 . threshold = arg_0 [ "threshold" ] arg_2 . killTime = arg_0 [ "killtime" ] arg_2 . minRestartDelay = arg_0 [ "minrestartdelay" ] arg_2 . maxRestartDelay = arg_0 [ "maxrestartdelay" ] return arg_1

def Func(arg_0):
    """Return a service based on parsed command-line options

    :param opt: dict-like object. Relevant keys are config, messages,
                pid, frequency, threshold, killtime, minrestartdelay
                and maxrestartdelay
    :returns: service, {twisted.application.interfaces.IService}
    """
    arg_1 = get(config=arg_0['config'], messages=arg_0['messages'],
              pidDir=arg_0['pid'], freq=arg_0['frequency'])
    arg_2 = arg_1.getServiceNamed("procmon")
    arg_2.threshold = arg_0["threshold"]
    arg_2.killTime = arg_0["killtime"]
    arg_2.minRestartDelay = arg_0["minrestartdelay"]
    arg_2.maxRestartDelay = arg_0["maxrestartdelay"]
    return arg_1

Return a service based on parsed command - line options


(self, aspect_ratio, mode="constant", cval=0.0, return_pad_amounts=False)

def Func(arg_0, arg_1, arg_2="constant", arg_3=0.0, arg_4=False):
        """
        Pad the segmentation map on its sides so that its matches a target aspect ratio.

        Depending on which dimension is smaller (height or width), only the corresponding
        sides (left/right or top/bottom) will be padded. In each case, both of the sides will
        be padded equally.

        Parameters
        ----------
        aspect_ratio : float
            Target aspect ratio, given as width/height. E.g. 2.0 denotes the image having twice
            as much width as height.

        mode : str, optional
            Padding mode to use. See :func:`numpy.pad` for details.

        cval : number, optional
            Value to use for padding if `mode` is ``constant``. See :func:`numpy.pad` for details.

        return_pad_amounts : bool, optional
            If False, then only the padded image will be returned. If True, a tuple with two
            entries will be returned, where the first entry is the padded image and the second
            entry are the amounts by which each image side was padded. These amounts are again a
            tuple of the form (top, right, bottom, left), with each value being an integer.

        Returns
        -------
        segmap : imgaug.SegmentationMapOnImage
            Padded segmentation map as SegmentationMapOnImage object.

        pad_amounts : tuple of int
            Amounts by which the segmentation map was padded on each side, given as a
            tuple ``(top, right, bottom, left)``.
            This tuple is only returned if `return_pad_amounts` was set to True.

        """
        arg_5, arg_6 = ia.Func(arg_0.arr, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
                                                         arg_4=True)
        arg_7 = SegmentationMapOnImage(arg_5, shape=arg_0.shape)
        arg_7.input_was = arg_0.input_was
        if arg_4:
            return arg_7, arg_6
        else:
            return arg_7

Pad the segmentation map on its sides so that its matches a target aspect ratio .


def Func ( arg_0 ) : if not arg_0 . _content : Func = arg_0 . httplib_response . read ( ) if arg_0 . is_binary_string ( Func ) : arg_0 . _content = Func else : arg_0 . _content = Func . decode ( 'utf-8' ) return arg_0 . _content

def Func(arg_0):
        """
        The whole response content.
        """

        if not arg_0._content:
            Func = arg_0.httplib_response.read()
            if arg_0.is_binary_string(Func):
                arg_0._content = Func
            else:
                arg_0._content = Func.decode('utf-8')
        return arg_0._content


def Func(arg_0, arg_1, arg_2):
        """Create a project handler

        Args:
            uri (str): schema://something formatted uri
            local_path (str): the project configs directory

        Return:
            ProjectHandler derived class instance
        """
        arg_3 = arg_0.schema_pattern.search(arg_1)

        if not arg_3:
            logger.error("Unknown uri schema: '%s'. Added schemas: %s", arg_1, list(arg_0.handlers.keys()))
            return None

        arg_4 = arg_3.group(1)
        arg_5 = arg_3.group(2)

        return arg_0.handlers[arg_4](arg_5, arg_2)


def Func(arg_0):
        """Add the proper indexes to the scout instance.

        All indexes are specified in scout/constants/indexes.py

        If this method is utilised when new indexes are defined those should be added

        """
        for arg_1 in INDEXES:
            arg_2 = arg_0.indexes(arg_1)
            arg_3 = INDEXES[arg_1]
            for arg_4 in arg_3:
                arg_5 = arg_4.document.get('name')
                if arg_5 in arg_2:
                    LOG.info("Deleting old index: %s" % arg_5)
                    arg_0.db[arg_1].drop_index(arg_5)
            LOG.info("creating indexes for {0} collection: {1}".format(
                arg_1,
                ', '.join([arg_4.document.get('name') for arg_4 in arg_3])
                ))
            arg_0.db[arg_1].create_indexes(arg_3)

Add the proper indexes to the scout instance .


def
Func
(
arg_0
)
:
arg_1
=
get_app
(
)
arg_2
=
arg_1
.
get_snapshot
(
arg_0
)
if
not
arg_2
:
click
.
echo
(
"Couldn't find snapshot %s"
%
arg_0
)
sys
.
exit
(
1
)
click
.
echo
(
"Deleting snapshot %s"
%
arg_0
)
arg_1
.
Func_snapshot
(
arg_2
)
click
.
echo
(
"Deleted"
)

def Func(arg_0):
    """Removes a snapshot"""
    arg_1 = get_app()

    arg_2 = arg_1.get_snapshot(arg_0)
    if not arg_2:
        click.echo("Couldn't find snapshot %s" % arg_0)
        sys.exit(1)

    click.echo("Deleting snapshot %s" % arg_0)
    arg_1.Func_snapshot(arg_2)
    click.echo("Deleted")


(ctx, amount='uint256', rtgs_hash='bytes32', returns=STATUS)

def Func(arg_0, arg_1='uint256', arg_2='bytes32', arg_3=arg_4):
        "In the IOU fungible the supply is set by Issuer, who issue funds."
        # allocate new issue as result of a new cash entry
        arg_0.accounts[arg_0.msg_sender] += arg_1
        arg_0.issued_amounts[arg_0.msg_sender] += arg_1
        # Store hash(rtgs)
        arg_0.Issuance(arg_0.msg_sender, arg_2, arg_1)
        return OK

In the IOU fungible the supply is set by Issuer who issue funds .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . ifun . split ( '.' , 1 ) [ 0 ] if arg_1 . ifun not in arg_0 . shell . alias_manager or arg_2 not in arg_0 . shell . alias_manager or is_shadowed ( arg_2 , arg_0 . shell ) : return None return arg_0 . prefilter_manager . get_handler_by_name ( 'alias' )

def Func(arg_0, arg_1):
        "Check if the initital identifier on the line is an alias."
        # Note: aliases can not contain '.'
        arg_2 = arg_1.ifun.split('.',1)[0]
        if arg_1.ifun not in arg_0.shell.alias_manager \
               or arg_2 not in arg_0.shell.alias_manager \
               or is_shadowed(arg_2, arg_0.shell):
            return None

        return arg_0.prefilter_manager.get_handler_by_name('alias')

Check if the initital identifier on the line is an alias .


def Func ( arg_0 : arg_1 . ClassDef ) -> bool : for arg_3 in arg_0 . bases : try : arg_4 = arg_3 . inferred ( ) except arg_1 . InferenceError : continue for arg_5 in arg_4 : if not isinstance ( arg_5 , arg_1 . ClassDef ) : continue if arg_5 . name == "Enum" and arg_5 . root ( ) . name == "enum" : return True return False

def Func(arg_0: arg_1.ClassDef) -> bool:
    """Check if a class definition defines an Enum class.

    :param node: The class node to check.
    :type node: astroid.ClassDef

    :returns: True if the given node represents an Enum class. False otherwise.
    :rtype: bool
    """
    for arg_3 in arg_0.bases:
        try:
            arg_4 = arg_3.inferred()
        except arg_1.InferenceError:
            continue

        for arg_5 in arg_4:
            if not isinstance(arg_5, arg_1.ClassDef):
                continue

            if arg_5.name == "Enum" and arg_5.root().name == "enum":
                return True

    return False

Check if a class definition defines an Enum class .