def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
arg_0
.
session
.
recv
(
arg_1
,
mode
=
zmq
.
NOBLOCK
)
while
arg_3
is
not
:
if
arg_0
.
debug
:
pprint
(
arg_3
)
arg_4
=
arg_3
[
'header'
]
[
'msg_type'
]
arg_5
=
arg_0
.
_queue_handlers
.
get
(
arg_4
,
)
if
arg_5
is
:
raise
Exception
(
"Unhandled message type: %s"
%
arg_3
.
msg_type
)
else
:
arg_5
(
arg_3
)
arg_2
,
arg_3
=
arg_0
.
session
.
recv
(
arg_1
,
mode
=
zmq
.
NOBLOCK
)

def Func(arg_0, arg_1):
        """Flush task or queue results waiting in ZMQ queue."""
        arg_2,arg_3 = arg_0.session.recv(arg_1, mode=zmq.NOBLOCK)
        while arg_3 is not None:
            if arg_0.debug:
                pprint(arg_3)
            arg_4 = arg_3['header']['msg_type']
            arg_5 = arg_0._queue_handlers.get(arg_4, None)
            if arg_5 is None:
                raise Exception("Unhandled message type: %s"%arg_3.msg_type)
            else:
                arg_5(arg_3)
            arg_2,arg_3 = arg_0.session.recv(arg_1, mode=zmq.NOBLOCK)

Flush task or queue results waiting in ZMQ queue .


def Func ( arg_0 , Func ) : arg_0 . _T = Func arg_0 . _H = arg_0 . _calculate_H ( Func )

def Func(arg_0, Func):
        """
        Set the temperature of the package to the specified value, and
        recalculate it's enthalpy.

        :param T: Temperature. [°C]
        """

        arg_0._T = Func
        arg_0._H = arg_0._calculate_H(Func)

Set the temperature of the package to the specified value and recalculate it s enthalpy .


def Func ( arg_0 , arg_1 , arg_2 = True ) : arg_3 = { } for arg_4 in arg_1 : if arg_4 in arg_0 . main_dictionnary : if isinstance ( arg_1 [ arg_4 ] , dict ) and isinstance ( arg_0 . main_dictionnary [ arg_4 ] , dict ) : arg_3 [ arg_4 ] = Dict ( arg_0 . main_dictionnary [ arg_4 ] ) . Func ( arg_1 [ arg_4 ] ) elif isinstance ( arg_1 [ arg_4 ] , list ) and isinstance ( arg_0 . main_dictionnary [ arg_4 ] , list ) : arg_3 [ arg_4 ] = List ( arg_0 . main_dictionnary [ arg_4 ] ) . Func ( arg_1 [ arg_4 ] , arg_2 ) else : arg_3 . update ( { arg_4 : arg_1 [ arg_4 ] } ) else : arg_3 . update ( { arg_4 : arg_1 [ arg_4 ] } ) for arg_4 in arg_0 . main_dictionnary : if arg_4 not in arg_3 : arg_3 [ arg_4 ] = arg_0 . main_dictionnary [ arg_4 ] return arg_3

def Func(arg_0, arg_1, arg_2=True):
        """
        Merge the content of to_Func into the given main dictionnary.

        :param to_Func: The dictionnary to Func.
        :type to_Func: dict

        :param strict:
            Tell us if we have to strictly Func lists.

            :code:`True`: We follow index
            :code`False`: We follow element (content)
        :type strict: bool

        :return: The Funcd dict.
        :rtype: dict
        """

        # We initiate a variable which will save our result.
        arg_3 = {}

        for arg_4 in arg_1:
            # We loop throught the given dict to Func.

            if arg_4 in arg_0.main_dictionnary:
                # The currently read element is in the main dict.

                if isinstance(arg_1[arg_4], dict) and isinstance(
                    arg_0.main_dictionnary[arg_4], dict
                ):
                    # They are in both side dict.

                    # We Func the dict tree and save into result.
                    arg_3[arg_4] = Dict(arg_0.main_dictionnary[arg_4]).Func(
                        arg_1[arg_4]
                    )

                elif isinstance(arg_1[arg_4], list) and isinstance(
                    arg_0.main_dictionnary[arg_4], list
                ):
                    # They are in both side list.

                    # We Func the lists and save into result.
                    arg_3[arg_4] = List(arg_0.main_dictionnary[arg_4]).Func(
                        arg_1[arg_4], arg_2
                    )
                else:
                    # They are not list, not dict.

                    # We append the currently read element to the result.
                    arg_3.update({arg_4: arg_1[arg_4]})
            else:
                # The currently read element is not into the main
                # dict.

                # We append the currently read element to the result.
                arg_3.update({arg_4: arg_1[arg_4]})

        for arg_4 in arg_0.main_dictionnary:
            # We loop through each element of the main dict.

            if arg_4 not in arg_3:
                # The currently read element is not into
                # the result.

                # We append it to the result.
                arg_3[arg_4] = arg_0.main_dictionnary[arg_4]

        # We return the result.
        return arg_3

Merge the content of to_merge into the given main dictionnary.

        :param to_merge: The dictionnary to merge.
        :type to_merge: dict

        :param strict:
            Tell us if we have to strictly merge lists.

            :code:`True`: We follow index
            :code`False`: We follow element (content)
        :type strict: bool

        :return: The merged dict.
        :rtype: dict

Merge the content of to_merge into the given main dictionnary .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_0 . relationship = arg_2 arg_0 . _set_method_names ( arg_3 = arg_2 ) if arg_0 . res_name is None : arg_0 . res_name = grammar . singularize ( arg_1 . get ( 'endpoint' , 'unknown' ) . strip ( '/' ) )

def Func(arg_0, arg_1, arg_2):
        '''
        Hook for ResourceMeta class to call when initializing model class.
        Saves fields obtained from resource class backlinks
        '''
        arg_0.relationship = arg_2
        arg_0._set_method_names(arg_3=arg_2)
        if arg_0.res_name is None:
            arg_0.res_name = grammar.singularize(arg_1.get('endpoint', 'unknown').strip('/'))

Hook for ResourceMeta class to call when initializing model class . Saves fields obtained from resource class backlinks


return build(
            'dataproc', self.api_version, http=http_authorized,
            cache_discovery=False)

def Func ( arg_0 ) : arg_1 = arg_0 . _authorize ( ) return build ( 'dataproc' , arg_0 . api_version , http = arg_1 , cache_discovery = False )

def Func(arg_0):
        """Returns a Google Cloud Dataproc service object."""
        arg_1 = arg_0._authorize()
        return build(
            'dataproc', arg_0.api_version, http=arg_1,
            cache_discovery=False)

Returns a Google Cloud Dataproc service object .


return "experiment.txt found, but didn't contain %s"%parent

def Func(arg_0):
    """given an ABF, find the parent, return that line of experiments.txt"""
    arg_1=getParent(arg_0)
    arg_1=os.path.basename(arg_1).replace(".abf","")
    arg_2=os.path.dirname(arg_0)+"/experiment.txt"
    if not os.path.exists(arg_2):
        return "no experiment file"
    with open(arg_2) as f:
        arg_3=f.readlines()
    for arg_4 in arg_3:
        if arg_4[0]=='~':
            arg_4=arg_4[1:].strip()
            if arg_4.startswith(arg_1):
                while "\t\t" in arg_4:
                    arg_4=arg_4.replace("\t\t","\t")
                arg_4=arg_4.replace("\t","\n")
                return arg_4
    return "experiment.txt found, but didn't contain %s"%arg_1

given an ABF find the parent return that line of experiments . txt


def Func(arg_0, arg_1, arg_2):
        """
        Helper method to clean up processor_agent to avoid leaving orphan processes.
        """
        arg_0.log.info("Exiting gracefully upon receiving signal %s", arg_1)
        if arg_0.processor_agent:
            arg_0.processor_agent.end()
        sys.exit(os.EX_OK)

Helper method to clean up processor_agent to avoid leaving orphan processes .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . arg_names if len ( arg_0 . arg_defaults ) > 0 : arg_3 = arg_3 [ : - len ( arg_0 . arg_defaults ) ] arg_4 = [ x for x in arg_3 if x not in arg_2 ] return len ( arg_4 ) <= len ( arg_1 )

def Func(arg_0, arg_1, arg_2):
        """Check if we have enough arguments to call this function.

        Args:
            pos_args (list): A list of all the positional values we have.
            kw_args (dict): A dict of all of the keyword args we have.

        Returns:
            bool: True if we have a filled spec, False otherwise.
        """

        arg_3 = arg_0.arg_names
        if len(arg_0.arg_defaults) > 0:
            arg_3 = arg_3[:-len(arg_0.arg_defaults)]

        arg_4 = [x for x in arg_3 if x not in arg_2]
        return len(arg_4) <= len(arg_1)

Check if we have enough arguments to call this function .


(params, w_name, scope_name, inputs, layers, weights, names)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
)
:
print
(
'Converting shape ...'
)
def
target_layer
(
arg_7
)
:
import
tensorflow
as
tf
return
tf
.
shape
(
arg_7
)
arg_8
=
keras
.
layers
.
Lambda
(
target_layer
)
arg_4
[
arg_2
]
=
arg_8
(
arg_4
[
arg_3
[
0
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6):
    """
    Convert shape operation.

    Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting shape ...')

    def target_layer(arg_7):
        import tensorflow as tf
        return tf.shape(arg_7)

    arg_8 = keras.layers.Lambda(target_layer)
    arg_4[arg_2] = arg_8(arg_4[arg_3[0]])


def Func ( arg_0 ) : arg_1 = arg_0 . data [ "signatures" ] arg_0 . data . pop ( "signatures" , None ) arg_2 = hashlib . sha256 ( bytes ( arg_0 ) ) . digest ( ) arg_0 . data [ "signatures" ] = arg_1 return hexlify ( arg_2 [ : 20 ] ) . decode ( "ascii" )

def Func(arg_0):
        """ The transaction Func of this transaction
        """
        # Store signatures temporarily since they are not part of
        # transaction Func
        arg_1 = arg_0.data["signatures"]
        arg_0.data.pop("signatures", None)

        # Generage Hash of the seriliazed version
        arg_2 = hashlib.sha256(bytes(arg_0)).digest()

        # recover signatures
        arg_0.data["signatures"] = arg_1

        # Return properly truncated tx hash
        return hexlify(arg_2[:20]).decode("ascii")


def Func ( arg_0 ) : try : arg_1 = arg_0 . id arg_0 = _forbidden_attributes ( arg_0 ) arg_2 = _pybossa_req ( 'put' , 'project' , arg_1 , payload = arg_0 . data ) if arg_2 . get ( 'id' ) : return Project ( arg_2 ) else : return arg_2 except : raise

def Func(arg_0):
    """Update a project instance.

    :param project: PYBOSSA project
    :type project: PYBOSSA Project
    :returns: True -- the response status code

    """
    try:
        arg_1 = arg_0.id
        arg_0 = _forbidden_attributes(arg_0)
        arg_2 = _pybossa_req('put', 'project', arg_1, payload=arg_0.data)
        if arg_2.get('id'):
            return Project(arg_2)
        else:
            return arg_2
    except:  # pragma: no cover
        raise


def Func ( ) : if DAGS_FOLDER not in sys . path : sys . path . append ( DAGS_FOLDER ) arg_0 = os . path . join ( AIRFLOW_HOME , 'config' ) if arg_0 not in sys . path : sys . path . append ( arg_0 ) if PLUGINS_FOLDER not in sys . path : sys . path . append ( PLUGINS_FOLDER )

def Func():
    """
    Ensures that certain subfolders of AIRFLOW_HOME are on the classpath
    """

    if DAGS_FOLDER not in sys.path:
        sys.path.append(DAGS_FOLDER)

    # Add ./config/ for loading custom log parsers etc, or
    # airflow_local_settings etc.
    arg_0 = os.path.join(AIRFLOW_HOME, 'config')
    if arg_0 not in sys.path:
        sys.path.append(arg_0)

    if PLUGINS_FOLDER not in sys.path:
        sys.path.append(PLUGINS_FOLDER)


def
Func
(
arg_0
)
:
try
:
arg_0
.
m_ser
=
serial
.
Serial
(
port
=
arg_0
.
m_ttyport
,
baudrate
=
arg_0
.
m_baudrate
,
timeout
=
0
,
parity
=
serial
.
PARITY_EVEN
,
stopbits
=
serial
.
STOPBITS_ONE
,
bytesize
=
serial
.
SEVENBITS
,
rtscts
=
False
)
ekm_log
(
"Pyserial version = "
+
serial
.
VERSION
)
ekm_log
(
"Port = "
+
arg_0
.
m_ttyport
)
ekm_log
(
"Rate = "
+
str
(
arg_0
.
m_baudrate
)
)
time
.
sleep
(
arg_0
.
m_init_wait
)
return
True
except
:
ekm_log
(
traceback
.
format_exc
(
sys
.
exc_info
(
)
)
)
return
False

def Func(arg_0):
        """ Required initialization call, wraps pyserial constructor. """
        try:
            arg_0.m_ser = serial.Serial(port=arg_0.m_ttyport,
                                       baudrate=arg_0.m_baudrate,
                                       timeout=0,
                                       parity=serial.PARITY_EVEN,
                                       stopbits=serial.STOPBITS_ONE,
                                       bytesize=serial.SEVENBITS,
                                       rtscts=False)
            ekm_log("Pyserial version = " + serial.VERSION)
            ekm_log("Port = " + arg_0.m_ttyport)
            ekm_log("Rate = " + str(arg_0.m_baudrate))
            time.sleep(arg_0.m_init_wait)
            return True
        except:
            ekm_log(traceback.format_exc(sys.exc_info()))

        return False

Required initialization call wraps pyserial constructor .


def Func ( arg_0 , arg_1 ) : if not isinstance ( arg_1 , ( list , tuple ) ) : arg_1 = [ arg_1 ] def _decor_closure ( arg_2 ) : for arg_3 in arg_1 : arg_4 = ( arg_3 . __module__ , arg_3 . __name__ ) arg_0 . keyed_extensions [ arg_4 ] = ( arg_3 , arg_2 ) return arg_2 return _decor_closure

def Func(arg_0, arg_1):
        """
        Registers a function to generate a hash for data of the appropriate
        types. This can be used to Func custom classes. Internally this is
        used to define how to hash non-builtin objects like ndarrays and uuids.

        The Funced function should return a tuple of bytes. First a small
        prefix hinting at the data type, and second the raw bytes that can be
        hashed.

        Args:
            hash_types (class or tuple of classes):

        Returns:
            func: closure to be used as the decorator

        Example:
            >>> # xdoctest: +SKIP
            >>> # Skip this doctest because we dont want tests to modify
            >>> # the global state.
            >>> import ubelt as ub
            >>> import pytest
            >>> class MyType(object):
            ...     def __init__(self, id):
            ...         self.id = id
            >>> data = MyType(1)
            >>> # Custom types wont work with ub.hash_data by default
            >>> with pytest.raises(TypeError):
            ...     ub.hash_data(data)
            >>> # You can Func your functions with ubelt's internal
            >>> # hashable_extension Funcy.
            >>> @ub.util_hash._HASHABLE_EXTENSIONS.Func(MyType)
            >>> def hash_my_type(data):
            ...     return b'mytype', six.b(ub.hash_data(data.id))
            >>> # TODO: allow hash_data to take an new instance of
            >>> # HashableExtensions, so we dont have to modify the global
            >>> # ubelt state when we run tests.
            >>> my_instance = MyType(1)
            >>> ub.hash_data(my_instance)
        """
        # ensure iterable
        if not isinstance(arg_1, (list, tuple)):
            arg_1 = [arg_1]
        def _decor_closure(arg_2):
            for arg_3 in arg_1:
                arg_4 = (arg_3.__module__, arg_3.__name__)
                arg_0.keyed_extensions[arg_4] = (arg_3, arg_2)
            return arg_2
        return _decor_closure

Registers a function to generate a hash for data of the appropriate
        types. This can be used to register custom classes. Internally this is
        used to define how to hash non-builtin objects like ndarrays and uuids.

        The registered function should return a tuple of bytes. First a small
        prefix hinting at the data type, and second the raw bytes that can be
        hashed.

        Args:
            hash_types (class or tuple of classes):

        Returns:
            func: closure to be used as the decorator

        Example:
            >>> # xdoctest: +SKIP
            >>> # Skip this doctest because we dont want tests to modify
            >>> # the global state.
            >>> import ubelt as ub
            >>> import pytest
            >>> class MyType(object):
            ...     def __init__(self, id):
            ...         self.id = id
            >>> data = MyType(1)
            >>> # Custom types wont work with ub.hash_data by default
            >>> with pytest.raises(TypeError):
            ...     ub.hash_data(data)
            >>> # You can register your functions with ubelt's internal
            >>> # hashable_extension registery.
            >>> @ub.util_hash._HASHABLE_EXTENSIONS.register(MyType)
            >>> def hash_my_type(data):
            ...     return b'mytype', six.b(ub.hash_data(data.id))
            >>> # TODO: allow hash_data to take an new instance of
            >>> # HashableExtensions, so we dont have to modify the global
            >>> # ubelt state when we run tests.
            >>> my_instance = MyType(1)
            >>> ub.hash_data(my_instance)

Registers a function to generate a hash for data of the appropriate types . This can be used to register custom classes . Internally this is used to define how to hash non - builtin objects like ndarrays and uuids .


return str(header) if PY2 else bytes(header)

def Func ( arg_0 ) : arg_1 = bytearray ( 1 ) arg_2 = bytearray ( ) arg_3 = bytearray ( ) if arg_0 . qos : arg_1 [ 0 ] = 0x30 | arg_0 . retain | ( arg_0 . qos << 1 ) | ( arg_0 . dup << 3 ) arg_2 . extend ( FuncString ( arg_0 . topic ) ) arg_2 . extend ( Func16Int ( arg_0 . msgId ) ) else : arg_1 [ 0 ] = 0x30 | arg_0 . retain arg_2 . extend ( FuncString ( arg_0 . topic ) ) if isinstance ( arg_0 . payload , bytearray ) : arg_3 . extend ( arg_0 . payload ) elif isinstance ( arg_0 . payload , str ) : arg_3 . extend ( bytearray ( arg_0 . payload , encoding = 'utf-8' ) ) else : raise PayloadTypeError ( type ( arg_0 . payload ) ) arg_4 = len ( arg_2 ) + len ( arg_3 ) if arg_4 > 268435455 : raise PayloadValueError ( arg_4 ) arg_1 . extend ( FuncLength ( arg_4 ) ) arg_1 . extend ( arg_2 ) arg_1 . extend ( arg_3 ) arg_0 . Funcd = arg_1 return str ( arg_1 ) if PY2 else bytes ( arg_1 )

def Func(arg_0):
        '''
        Encode and store a PUBLISH control packet.
        @raise e: C{ValueError} if Funcd topic string exceeds 65535 bytes.
        @raise e: C{ValueError} if Funcd packet size exceeds 268435455 bytes.
        @raise e: C{TypeError} if C{data} is not a string, bytearray, int, boolean or float.
        '''
        arg_1    = bytearray(1)
        arg_2 = bytearray()
        arg_3   = bytearray()

        if arg_0.qos:
            arg_1[0] = 0x30 | arg_0.retain | (arg_0.qos << 1) | (arg_0.dup << 3)
            arg_2.extend(FuncString(arg_0.topic)) # topic name
            arg_2.extend(Func16Int(arg_0.msgId))  # msgId should not be None
        else:
            arg_1[0] = 0x30 | arg_0.retain
            arg_2.extend(FuncString(arg_0.topic)) # topic name
        if isinstance(arg_0.payload, bytearray):
            arg_3.extend(arg_0.payload)
        elif isinstance(arg_0.payload, str):
            arg_3.extend(bytearray(arg_0.payload, encoding='utf-8'))
        else:
            raise PayloadTypeError(type(arg_0.payload))
        arg_4 = len(arg_2) + len(arg_3)
        if arg_4 > 268435455:
            raise PayloadValueError(arg_4)
        arg_1.extend(FuncLength(arg_4))
        arg_1.extend(arg_2)
        arg_1.extend(arg_3)
        arg_0.Funcd = arg_1
        return str(arg_1) if PY2 else bytes(arg_1)

Encode and store a PUBLISH control packet.
        @raise e: C{ValueError} if encoded topic string exceeds 65535 bytes.
        @raise e: C{ValueError} if encoded packet size exceeds 268435455 bytes.
        @raise e: C{TypeError} if C{data} is not a string, bytearray, int, boolean or float.

Encode and store a PUBLISH control packet .


def Func ( arg_0 , arg_1 ) : if arg_1 not in arg_0 . dictionary : arg_0 . dictionary [ arg_1 ] = arg_0 . default arg_0 . n_obs += arg_0 . default arg_0 . sampler = None

def Func(arg_0, arg_1):
        """Include o among the possible observations, whether or not
        it's been observed yet."""
        if arg_1 not in arg_0.dictionary:
            arg_0.dictionary[arg_1] = arg_0.default
            arg_0.n_obs += arg_0.default
            arg_0.sampler = None

Include o among the possible observations whether or not it s been observed yet .


def Func ( * arg_0 , ** arg_1 ) : Preference . update_prefs ( * arg_0 , ** arg_1 ) Preference . read_prefs ( get_prefs ( ) )

def Func(*arg_0, **arg_1):
    """Triggered on dynamic preferences model save.
     Issues DB save and reread.

    """
    Preference.update_prefs(*arg_0, **arg_1)
    Preference.read_prefs(get_prefs())

Triggered on dynamic preferences model save . Issues DB save and reread .


def Func ( arg_0 ) : arg_1 = list ( map ( arg_0 . get_pipeline , arg_0 . pipeline_dict . keys ( ) ) ) arg_0 . _construct_solid_defs ( arg_1 ) return arg_1

def Func(arg_0):
        '''Return all pipelines as a list

        Returns:
            List[PipelineDefinition]:

        '''
        arg_1 = list(map(arg_0.get_pipeline, arg_0.pipeline_dict.keys()))
        # This does uniqueness check
        arg_0._construct_solid_defs(arg_1)
        return arg_1


def
Func
(
arg_0
,
arg_1
=
False
,
arg_2
=
False
)
:
arg_3
=
arg_0
.
get
(
)
[
'document_count'
]
arg_4
=
try
:
if
arg_2
:
arg_4
=
tqdm
(
desc
=
'Downloading documents'
,
total
=
arg_3
)
for
arg_5
in
range
(
0
,
arg_3
,
DOCS_PER_BATCH
)
:
arg_6
=
arg_0
.
get
(
'docs'
,
arg_5
=
arg_5
,
limit
=
DOCS_PER_BATCH
)
arg_7
=
arg_6
[
'result'
]
for
arg_8
in
arg_7
:
if
arg_1
:
for
arg_9
in
UNNECESSARY_FIELDS
:
arg_8
.
pop
(
arg_9
,
)
else
:
arg_8
=
{
arg_9
:
arg_8
[
arg_9
]
for
arg_9
in
CONCISE_FIELDS
}
if
arg_2
:
arg_4
.
update
(
)
yield
arg_8
finally
:
if
arg_2
:
arg_4
.
close
(
)

def Func(arg_0, arg_1=False, arg_2=False):
    """
    Yield each document in a Luminoso project in turn. Requires a client whose
    URL points to a project.

    If expanded=True, it will include additional fields that Luminoso added in
    its analysis, such as 'terms' and 'vector'.

    Otherwise, it will contain only the fields necessary to reconstruct the
    document: 'title', 'text', and 'metadata'.

    Shows a progress bar if progress=True.
    """
    # Get total number of docs from the project record
    arg_3 = arg_0.get()['document_count']
    arg_4 = None
    try:
        if arg_2:
            arg_4 = tqdm(desc='Downloading documents', total=arg_3)

        for arg_5 in range(0, arg_3, DOCS_PER_BATCH):
            arg_6 = arg_0.get('docs', arg_5=arg_5, limit=DOCS_PER_BATCH)
            arg_7 = arg_6['result']
            for arg_8 in arg_7:
                # Get the appropriate set of fields for each document
                if arg_1:
                    for arg_9 in UNNECESSARY_FIELDS:
                        arg_8.pop(arg_9, None)
                else:
                    arg_8 = {arg_9: arg_8[arg_9] for arg_9 in CONCISE_FIELDS}

                if arg_2:
                    arg_4.update()
                yield arg_8

    finally:
        if arg_2:
            arg_4.close()

Yield each document in a Luminoso project in turn . Requires a client whose URL points to a project .


def Func(arg_0, arg_1=arg_2.input):
    """ Yield pasted lines until the user enters the given sentinel value.
    """
    print "Pasting code; enter '%s' alone on the line to stop or use Ctrl-D." \
          % arg_0
    while True:
        try:
            arg_4 = arg_1(':')
            if arg_4 == arg_0:
                return
            else:
                yield arg_4
        except EOFError:
            print '<EOF>'
            return

Yield pasted lines until the user enters the given sentinel value .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = 100 ) : arg_4 = _ctx . stroke ( 0 , 0 , 0 , 0 ) arg_5 = _ctx . strokewidth ( 0 ) _ctx . push ( ) _ctx . transform ( _ctx . CORNER ) _ctx . translate ( arg_1 , arg_2 ) for arg_6 in _range ( arg_3 * 3 ) : arg_7 = choice ( arg_0 ) . copy ( ) arg_7 . alpha -= 0.5 * random ( ) _ctx . fill ( arg_7 ) arg_7 = choice ( arg_0 ) _ctx . stroke ( arg_7 ) _ctx . strokewidth ( 10 * random ( ) ) _ctx . rotate ( 360 * random ( ) ) arg_8 = arg_3 * 0.5 * random ( ) _ctx . oval ( arg_3 * random ( ) , 0 , arg_8 , arg_8 ) _ctx . pop ( ) _ctx . strokewidth ( arg_5 ) if arg_4 is None : _ctx . nostroke ( ) else : _ctx . stroke ( arg_4 )

def Func(arg_0, arg_1, arg_2, arg_3=100):
        """
        Fancy random ovals for all the colors in the list.
        """
        arg_4 = _ctx.stroke(0, 0, 0, 0)
        arg_5 = _ctx.strokewidth(0)

        _ctx.push()
        _ctx.transform(_ctx.CORNER)
        _ctx.translate(arg_1, arg_2)

        for arg_6 in _range(arg_3 * 3):
            arg_7 = choice(arg_0).copy()
            arg_7.alpha -= 0.5 * random()
            _ctx.fill(arg_7)
            arg_7 = choice(arg_0)
            _ctx.stroke(arg_7)
            _ctx.strokewidth(10 * random())

            _ctx.rotate(360 * random())

            arg_8 = arg_3 * 0.5 * random()
            _ctx.oval(arg_3 * random(), 0, arg_8, arg_8)
        _ctx.pop()

        _ctx.strokewidth(arg_5)
        if arg_4 is None:
            _ctx.nostroke()
        else:
            _ctx.stroke(arg_4)

Fancy random ovals for all the colors in the list .


def Func ( arg_0 , arg_1 = None ) : if not arg_0 . __data : return arg_1 return heapq . heappop ( arg_0 . __data )

def Func(arg_0, arg_1=None):
        """Extract the smallest item from queue.
        Return default if queue is empty."""
        if not arg_0.__data:
            return arg_1
        return heapq.heappop(arg_0.__data)

Extract the smallest item from queue . Return default if queue is empty .


(labels: [List[str], List[List[str]], np.ndarray], classes:  [list, np.ndarray])

def Func(arg_0: [arg_1[arg_2], arg_1[arg_1[arg_2]], arg_3.ndarray], arg_5:  [arg_6, arg_3.ndarray]) -> arg_3.ndarray:
    """
    Convert labels to one-hot vectors for multi-class multi-label classification

    Args:
        labels: list of samples where each sample is a class or a list of classes which sample belongs with
        classes: array of classes' names

    Returns:
        2d array with one-hot representation of given samples
    """
    arg_7 = len(arg_5)
    arg_8 = []
    for arg_9 in arg_0:
        arg_10 = arg_3.zeros(arg_7)
        if isinstance(arg_9, arg_6):
            for arg_11 in arg_9:
                if arg_11 not in arg_5:
                    log.warning('Unknown intent {} detected. Assigning no class'.format(arg_11))
                else:
                    arg_10[arg_3.where(arg_3.array(arg_5) == arg_11)[0]] = 1
        else:
            arg_10[arg_3.where(arg_3.array(arg_5) == arg_9)[0]] = 1
        arg_8.append(arg_10)
    arg_8 = arg_3.asarray(arg_8)
    return arg_8

Convert labels to one - hot vectors for multi - class multi - label classification


def Func ( arg_0 ) : arg_0 = bytes ( arg_0 , encoding = "ascii" ) arg_1 = len ( arg_0 ) % 4 if arg_1 != 0 : arg_0 += b'=' * ( 4 - arg_1 ) return base64 . b64decode ( arg_0 )

def Func(arg_0):
    """
    Decodes a base64 string, with padding being optional

    Args:
        data: A base64 encoded string

    Returns:
        bytes: The decoded bytes

    """
    arg_0 = bytes(arg_0, encoding="ascii")
    arg_1 = len(arg_0) % 4
    if arg_1 != 0:
        arg_0 += b'=' * (4 - arg_1)
    return base64.b64decode(arg_0)

Decodes a base64 string with padding being optional


def Func(arg_0, arg_1):
    '''
    Convert XML 1.0 to MicroXML

    source - XML 1.0 input
    handler - MicroXML events handler

    Returns uxml, extras

    uxml - MicroXML element extracted from the source
    extras - information to be preserved but not part of MicroXML, e.g. namespaces
    '''
    arg_2 = expat_callbacks(arg_1)
    arg_3 = xml.Funcrs.expat.ParserCreate(namespace_separator=' ')

    arg_3.StartElementHandler = arg_2.start_element
    arg_3.EndElementHandler = arg_2.end_element
    arg_3.CharacterDataHandler = arg_2.char_data
    arg_3.StartNamespaceDeclHandler = arg_2.start_namespace
    arg_3.EndNamespaceDeclHandler = arg_2.end_namespace
    arg_3.Parse(arg_0)
    return arg_3


return redirect(success_url if consent_provided else failure_url)

def Func(arg_0, arg_1):
        """
        Process the above form.
        """
        arg_2 = arg_1.POST.get('enterprise_customer_uuid')
        arg_3 = arg_1.POST.get('redirect_url')
        arg_4 = arg_1.POST.get('failure_url')
        arg_5 = arg_1.POST.get('course_id', '')
        arg_6 = arg_1.POST.get('program_uuid', '')

        arg_7 = get_enterprise_customer_or_404(arg_2)
        arg_8 = get_global_context(arg_1, arg_7)

        if not (arg_2 and arg_3 and arg_4):
            arg_9 = 'ENTGDS005'
            arg_10 = (
                'Error: one or more of the following values was falsy: '
                'enterprise_uuid: {enterprise_uuid}, '
                'success_url: {success_url}, '
                'failure_url: {failure_url} for course_id {course_id}. '
                'The following error code was reported to the user {userid}: {error_code}'.format(
                    userid=arg_1.user.id,
                    arg_2=arg_2,
                    arg_3=arg_3,
                    arg_4=arg_4,
                    arg_9=arg_9,
                    arg_5=arg_5,
                )
            )
            return render_page_with_error_code_message(arg_1, arg_8, arg_9, arg_10)

        if not arg_0.course_or_program_exist(arg_5, arg_6):
            arg_9 = 'ENTGDS006'
            arg_10 = (
                'Neither the course with course_id: {course_id} '
                'or program with {program_uuid} exist for '
                'enterprise customer {enterprise_uuid}'
                'Error code {error_code} presented to user {userid}'.format(
                    arg_5=arg_5,
                    arg_6=arg_6,
                    arg_9=arg_9,
                    userid=arg_1.user.id,
                    arg_2=arg_2,
                )
            )
            return render_page_with_error_code_message(arg_1, arg_8, arg_9, arg_10)

        arg_11 = get_data_sharing_consent(
            arg_1.user.username,
            arg_2,
            arg_6=arg_6,
            arg_5=arg_5
        )
        if arg_11 is None:
            arg_9 = 'ENTGDS007'
            arg_10 = (
                'The was a problem with the consent record of user {userid} with '
                'enterprise_uuid {enterprise_uuid}. consent_record has a value '
                'of {consent_record} and a '
                'value for course_id {course_id}. '
                'Error code {error_code} presented to user'.format(
                    userid=arg_1.user.id,
                    arg_2=arg_2,
                    arg_11=arg_11,
                    arg_9=arg_9,
                    arg_5=arg_5,
                )
            )
            return render_page_with_error_code_message(arg_1, arg_8, arg_9, arg_10)

        arg_12 = arg_1.POST.get('defer_creation')
        arg_13 = bool(arg_1.POST.get('data_sharing_consent', False))
        if arg_12 is None and arg_11.consent_required():
            if arg_5:
                arg_14, arg_15 = EnterpriseCustomerUser.objects.get_or_create(
                    arg_7=arg_11.enterprise_customer,
                    user_id=arg_1.user.id
                )
                arg_14.update_session(arg_1)
                arg_15, arg_16 = EnterpriseCourseEnrollment.objects.get_or_create(
                    arg_14=arg_14,
                    arg_5=arg_5,
                )
                if arg_16:
                    track_enrollment('data-consent-page-enrollment', arg_1.user.id, arg_5, arg_1.path)

            arg_11.granted = arg_13
            arg_11.save()

        return redirect(arg_3 if arg_13 else arg_4)


def Func ( arg_0 , arg_1 = None , ** arg_2 ) : if arg_2 . get ( 'activate' ) : arg_2 . pop ( 'activate' ) arg_0 . activate ( ) Func = Mock ( arg_1 = arg_1 , ** arg_2 ) Func . _engine = arg_0 arg_0 . add_mock ( Func ) return Func

def Func(arg_0, arg_1=None, **arg_2):
        """
        Creates and registers a new HTTP mock in the current engine.

        Arguments:
            url (str): request URL to mock.
            activate (bool): force mock engine activation.
                Defaults to ``False``.
            **kw (mixed): variadic keyword arguments for ``Mock`` constructor.

        Returns:
            pook.Mock: new mock instance.
        """
        # Activate mock engine, if explicitly requested
        if arg_2.get('activate'):
            arg_2.pop('activate')
            arg_0.activate()

        # Create the new HTTP mock expectation
        Func = Mock(arg_1=arg_1, **arg_2)
        # Expose current engine instance via mock
        Func._engine = arg_0
        # Register the mock in the current engine
        arg_0.add_mock(Func)

        # Return it for consumer satisfaction
        return Func

Creates and registers a new HTTP mock in the current engine .


def Func ( arg_0 , arg_1 = True , arg_2 = True ) : if arg_1 : arg_0 . reactions . _generate_index ( ) arg_0 . metabolites . _generate_index ( ) arg_0 . genes . _generate_index ( ) arg_0 . groups . _generate_index ( ) if arg_2 : for arg_3 in arg_0 . metabolites : arg_3 . _reaction . clear ( ) for arg_4 in arg_0 . genes : arg_4 . _reaction . clear ( ) for arg_5 in arg_0 . reactions : for arg_3 in arg_5 . _metabolites : arg_3 . _reaction . add ( arg_5 ) for arg_4 in arg_5 . _genes : arg_4 . _reaction . add ( arg_5 ) for arg_6 in ( arg_0 . reactions , arg_0 . genes , arg_0 . metabolites , arg_0 . groups ) : for arg_7 in arg_6 : arg_7 . _model = arg_0

def Func(arg_0, arg_1=True, arg_2=True):
        """Update all indexes and pointers in a model

        Parameters
        ----------
        rebuild_index : bool
            rebuild the indices kept in reactions, metabolites and genes
        rebuild_relationships : bool
             reset all associations between genes, metabolites, model and
             then re-add them.
        """
        if arg_1:  # DictList indexes
            arg_0.reactions._generate_index()
            arg_0.metabolites._generate_index()
            arg_0.genes._generate_index()
            arg_0.groups._generate_index()
        if arg_2:
            for arg_3 in arg_0.metabolites:
                arg_3._reaction.clear()
            for arg_4 in arg_0.genes:
                arg_4._reaction.clear()
            for arg_5 in arg_0.reactions:
                for arg_3 in arg_5._metabolites:
                    arg_3._reaction.add(arg_5)
                for arg_4 in arg_5._genes:
                    arg_4._reaction.add(arg_5)

        # point _model to self
        for arg_6 in (arg_0.reactions, arg_0.genes, arg_0.metabolites, arg_0.groups):
            for arg_7 in arg_6:
                arg_7._model = arg_0


def Func(arg_0, arg_1='', arg_2=arg_3):
        """Cancels all inprogress transfers

        This Funcs the inprogress transfers by calling Func() on all
        tracked transfer coordinators.

        :param msg: The message to pass on to each transfer coordinator that
            gets Funcled.

        :param exc_type: The type of exception to set for the Funclation
        """
        for arg_4 in arg_0.tracked_transfer_coordinators:
            arg_4.Func(arg_1, arg_2)

Cancels all inprogress transfers

        This cancels the inprogress transfers by calling cancel() on all
        tracked transfer coordinators.

        :param msg: The message to pass on to each transfer coordinator that
            gets cancelled.

        :param exc_type: The type of exception to set for the cancellation


makes a new matplotlib figure with default dims and DPI.
    Also labels it with pA or mV depending on ABF.

def Func ( arg_0 , arg_1 = False , arg_2 = None , arg_3 = None , arg_4 = None ) : if len ( pylab . get_fignums ( ) ) and arg_1 == False : return pylab . figure ( figsize = ( 8 , 6 ) ) pylab . grid ( alpha = .5 ) pylab . title ( arg_0 . ID ) pylab . ylabel ( arg_0 . units ) pylab . xlabel ( "seconds" ) if arg_3 : pylab . xlabel ( arg_3 ) if arg_4 : pylab . ylabel ( arg_4 ) if arg_2 : pylab . title ( arg_2 ) annotate ( arg_0 )

def Func(arg_0,arg_1=False,arg_2=None,arg_3=None,arg_4=None):
    """
    makes a Func matplotlib figure with default dims and DPI.
    Also labels it with pA or mV depending on ABF.
    """
    if len(pylab.get_fignums()) and arg_1==False:
        #print("adding to existing figure")
        return
    pylab.figure(figsize=(8,6))
    pylab.grid(alpha=.5)
    pylab.title(arg_0.ID)
    pylab.ylabel(arg_0.units)
    pylab.xlabel("seconds")
    if arg_3:
        pylab.xlabel(arg_3)
    if arg_4:
        pylab.ylabel(arg_4)
    if arg_2:
        pylab.title(arg_2)
    annotate(arg_0)

makes a new matplotlib figure with default dims and DPI . Also labels it with pA or mV depending on ABF .


(self,
                               travel_impedance_measure,
                               from_stop_I=None,
                               to_stop_I=None,
                               statistic=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
)
:
arg_5
=
[
]
arg_6
=
[
]
arg_5
.
append
(
"from_stop_I"
)
arg_5
.
append
(
"to_stop_I"
)
if
arg_2
is
not
:
arg_6
.
append
(
"from_stop_I="
+
str
(
int
(
arg_2
)
)
)
if
arg_3
is
not
:
arg_6
.
append
(
"to_stop_I="
+
str
(
int
(
arg_3
)
)
)
arg_7
=
""
if
len
(
arg_6
)
>
0
:
arg_7
=
" WHERE "
+
" AND "
.
join
(
arg_6
)
if
not
arg_4
:
arg_5
.
extend
(
[
"min"
,
"mean"
,
"median"
,
"max"
]
)
else
:
arg_5
.
append
(
arg_4
)
arg_8
=
","
.
join
(
arg_5
)
if
not
arg_8
:
arg_8
=
"*"
arg_9
=
"SELECT "
+
arg_8
+
" FROM "
+
arg_1
+
arg_7
+
";"
arg_10
=
pd
.
read_sql
(
arg_9
,
arg_0
.
conn
)
return
arg_10

def Func(arg_0,
                               arg_1,
                               arg_2=None,
                               arg_3=None,
                               arg_4=None):
        """
        Recover pre-computed travel_impedance between od-pairs from the database.

        Returns
        -------
        values: number | Pandas DataFrame
        """
        arg_5 = []
        arg_6 = []
        arg_5.append("from_stop_I")
        arg_5.append("to_stop_I")
        if arg_2 is not None:
            arg_6.append("from_stop_I=" + str(int(arg_2)))
        if arg_3 is not None:
            arg_6.append("to_stop_I=" + str(int(arg_3)))
        arg_7 = ""
        if len(arg_6) > 0:
            arg_7 = " WHERE " + " AND ".join(arg_6)
        if not arg_4:
            arg_5.extend(["min", "mean", "median", "max"])
        else:
            arg_5.append(arg_4)
        arg_8 = ",".join(arg_5)
        if not arg_8:
            arg_8 = "*"
        arg_9 = "SELECT " + arg_8 + " FROM " + arg_1 + arg_7 + ";"
        arg_10 = pd.read_sql(arg_9, arg_0.conn)
        return arg_10

Recover pre - computed travel_impedance between od - pairs from the database .


(self, args, axis=0, out=None, chunksize=1024 * 1024, **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = 0 , arg_3 = None , arg_4 = 1024 * 1024 , ** arg_5 ) : if arg_0 . altreduce is not None : arg_6 = [ None ] else : if arg_3 is None : if arg_0 . outdtype is not None : arg_7 = arg_0 . outdtype else : try : arg_7 = numpy . result_type ( * [ arg_1 [ arg_8 ] for arg_8 in arg_0 . ins ] * 2 ) except : arg_7 = None arg_3 = sharedmem . empty ( numpy . broadcast ( * [ arg_1 [ arg_8 ] for arg_8 in arg_0 . ins ] * 2 ) . shape , arg_7 = arg_7 ) if arg_2 != 0 : for arg_8 in arg_0 . ins : arg_1 [ arg_8 ] = numpy . rollaxis ( arg_1 [ arg_8 ] , arg_2 ) arg_3 = numpy . rollaxis ( arg_3 , arg_2 ) arg_9 = numpy . max ( [ len ( arg_1 [ arg_8 ] ) for arg_8 in arg_0 . ins ] ) with sharedmem . MapReduce ( ) as pool : def work ( arg_8 ) : arg_10 = slice ( arg_8 , arg_8 + arg_4 ) arg_11 = arg_1 [ : ] for arg_12 in arg_0 . ins : try : arg_13 = arg_11 [ arg_12 ] [ arg_10 ] arg_14 , arg_15 , arg_16 = arg_10 . indices ( len ( arg_1 [ arg_12 ] ) ) arg_11 [ arg_12 ] = arg_13 except Exception as e : print arg_13 print arg_12 , e pass if arg_15 == arg_14 : return None arg_17 = arg_0 . ufunc ( * arg_11 , ** arg_5 ) if arg_0 . altreduce is not None : return arg_17 else : arg_3 [ arg_10 ] = arg_17 def reduce ( arg_17 ) : if arg_0 . altreduce is None : return if arg_6 [ 0 ] is None : arg_6 [ 0 ] = arg_17 elif arg_17 is not None : arg_6 [ 0 ] = arg_0 . altreduce ( arg_6 [ 0 ] , arg_17 ) pool . map ( work , range ( 0 , arg_9 , arg_4 ) , reduce = reduce ) if arg_0 . altreduce is None : if arg_2 != 0 : arg_3 = numpy . rollaxis ( arg_3 , 0 , arg_2 + 1 ) return arg_3 else : return arg_6 [ 0 ]

def Func(arg_0, arg_1, arg_2=0, arg_3=None, arg_4=1024 * 1024, **arg_5):
        """ axis is the axis to chop it off.
            if self.altreduce is set, the results will
            be reduced with altreduce and returned
            otherwise will be saved to out, then return out.
        """
        if arg_0.altreduce is not None:
            arg_6 = [None]
        else:
            if arg_3 is None :
                if arg_0.outdtype is not None:
                    arg_7 = arg_0.outdtype
                else:
                    try:
                        arg_7 = numpy.result_type(*[arg_1[arg_8] for arg_8 in arg_0.ins] * 2)
                    except:
                        arg_7 = None
                arg_3 = sharedmem.empty(
                        numpy.broadcast(*[arg_1[arg_8] for arg_8 in arg_0.ins] * 2).shape,
                        arg_7=arg_7)
        if arg_2 != 0:
            for arg_8 in arg_0.ins:
                arg_1[arg_8] = numpy.rollaxis(arg_1[arg_8], arg_2)
            arg_3 = numpy.rollaxis(arg_3, arg_2)
        arg_9 = numpy.max([len(arg_1[arg_8]) for arg_8 in arg_0.ins])
        with sharedmem.MapReduce() as pool:
            def work(arg_8):
                arg_10 = slice(arg_8, arg_8+arg_4)
                arg_11 = arg_1[:]
                for arg_12 in arg_0.ins:
                    try:
                        arg_13 = arg_11[arg_12][arg_10]
                        arg_14, arg_15, arg_16 = arg_10.indices(len(arg_1[arg_12]))
                        arg_11[arg_12] = arg_13
                    except Exception as e:
                        print arg_13
                        print arg_12, e
                        pass
                if arg_15 == arg_14: return None
                arg_17 = arg_0.ufunc(*arg_11, **arg_5)
                if arg_0.altreduce is not None:
                    return arg_17
                else:
                    arg_3[arg_10] = arg_17
            def reduce(arg_17):
                if arg_0.altreduce is None:
                    return
                if arg_6[0] is None:
                    arg_6[0] = arg_17
                elif arg_17 is not None:
                    arg_6[0] = arg_0.altreduce(arg_6[0], arg_17)

            pool.map(work, range(0, arg_9, arg_4), reduce=reduce)

        if arg_0.altreduce is None:
            if arg_2 != 0:
                arg_3 = numpy.rollaxis(arg_3, 0, arg_2 + 1)
            return arg_3
        else:
            return arg_6[0]

axis is the axis to chop it off . if self . altreduce is set the results will be reduced with altreduce and returned otherwise will be saved to out then return out .


def Func(arg_0):
        """
        Note that this interface will be master

        :return: self
        """
        assert not hasattr(arg_0, "_interfaces") or not arg_0._interfaces, \
            "Too late to change direction of interface"
        arg_0._direction = DIRECTION.asIntfDirection(DIRECTION.opposite(arg_0.FuncasterDir))

        return arg_0


def
Func
(
arg_0
)
:
arg_1
=
month_name
[
arg_0
.
mo
]
if
isinstance
(
arg_1
,
six
.
binary_type
)
and
arg_0
.
encoding
:
arg_1
=
arg_1
.
decode
(
'utf-8'
)
arg_0
.
when
=
(
'
When: '
+
arg_1
+
' '
+
str
(
arg_0
.
day
)
+
', '
+
arg_0
.
event
.
l_start_date
.
strftime
(
LEGACY_CALENDAR_TIME_FORMAT
)
.
lstrip
(
'0'
)
+
' - '
+
arg_0
.
event
.
l_end_date
.
strftime
(
LEGACY_CALENDAR_TIME_FORMAT
)
.
lstrip
(
'0'
)
+
'
'
)
if
arg_0
.
event
.
location
.
exists
(
)
:
arg_0
.
where
=
'
Where: '
for
arg_4
in
arg_0
.
event
.
location
.
all
(
)
:
arg_0
.
where
+=
arg_4
.
name
arg_0
.
where
+=
'
'
else
:
arg_0
.
where
=
''
arg_0
.
desc
=
'
Description: '
+
arg_0
.
event
.
description
[
:
100
]
arg_0
.
desc
+=
(
'...
'
if
len
(
arg_0
.
event
.
description
)
>
100
else
'
'
)
arg_0
.
event_url
=
arg_0
.
event
.
get_absolute_url
(
)
arg_7
=
LEGACY_CALENDAR_TIME_FORMAT
if
arg_0
.
event
.
l_start_date
.
minute
else
LEGACY_CALENDAR_HOUR_FORMAT
arg_0
.
title2
=
(
arg_0
.
event
.
l_start_date
.
strftime
(
arg_7
)
.
lstrip
(
'0'
)
+
' '
+
arg_0
.
title
)

def Func(arg_0):
        """Populate variables used to build popovers."""
        # when
        arg_1 = month_name[arg_0.mo]

        if isinstance(arg_1, six.binary_type) and arg_0.encoding:
            arg_1 = arg_1.decode('utf-8')

        arg_0.when = ('
When: ' + arg_1 + ' ' +
                     str(arg_0.day) + ', ' + arg_0.event.l_start_date.strftime(
                         LEGACY_CALENDAR_TIME_FORMAT).lstrip('0') + ' - ' +
                     arg_0.event.l_end_date.strftime(LEGACY_CALENDAR_TIME_FORMAT).lstrip('0') +
                     '
')

        if arg_0.event.location.exists():  # where
            arg_0.where = '
Where: '
            for arg_4 in arg_0.event.location.all():
                arg_0.where += arg_4.name
            arg_0.where += '
'
        else:
            arg_0.where = ''

        # description
        arg_0.desc = '
Description: ' + arg_0.event.description[:100]
        arg_0.desc += ('...
' if len(arg_0.event.description) > 100
                      else '
')

        arg_0.event_url = arg_0.event.get_absolute_url()  # url
        arg_7 = LEGACY_CALENDAR_TIME_FORMAT if arg_0.event.l_start_date.minute else LEGACY_CALENDAR_HOUR_FORMAT
        arg_0.title2 = (arg_0.event.l_start_date.strftime(arg_7).lstrip('0') +
                       ' ' + arg_0.title)

Populate variables used to build popovers .


(z, cos_theta, zint=100.0, n2n1=0.95, get_hdet=False,
        **kwargs)

def Func ( arg_0 , arg_1 , arg_2 = 100.0 , arg_3 = 0.95 , arg_4 = False , ** arg_5 ) : arg_6 = f_theta ( arg_1 , arg_2 , arg_0 , arg_3 = arg_3 , ** arg_5 ) arg_7 = np . exp ( - 1j * arg_6 ) if not arg_4 : arg_7 *= np . outer ( np . ones_like ( arg_0 ) , np . sqrt ( arg_1 ) ) return arg_7

def Func(arg_0, arg_1, arg_2=100.0, arg_3=0.95, arg_4=False,
        **arg_5):
    """
    Returns a prefactor in the electric field integral.

    This is an internal function called by get_K. The returned prefactor
    in the integrand is independent of which integral is being called;
    it is a combination of the exp(1j*phase) and apodization.

    Parameters
    ----------
        z : numpy.ndarray
            The values of z (distance along optical axis) at which to
            calculate the prefactor. Size is unrelated to the size of
            `cos_theta`
        cos_theta : numpy.ndarray
            The values of cos(theta) (i.e. position on the incoming
            focal spherical wavefront) at which to calculate the
            prefactor. Size is unrelated to the size of `z`
        zint : Float, optional
            The position of the optical interface, in units of 1/k.
            Default is 100.
        n2n1 : Float, optional
            The ratio of the index mismatch between the optics (n1) and
            the sample (n2). Default is 0.95
        get_hdet : Bool, optional
            Set to True to calculate the detection prefactor vs the
            illumination prefactor (i.e. False to include apodization).
            Default is False

    Returns
    -------
        numpy.ndarray
            The prefactor, of size [`z.size`, `cos_theta.size`], sampled
            at the values [`z`, `cos_theta`]
    """
    arg_6 = f_theta(arg_1, arg_2, arg_0, arg_3=arg_3, **arg_5)
    arg_7 = np.exp(-1j*arg_6)
    if not arg_4:
        arg_7 *= np.outer(np.ones_like(arg_0),np.sqrt(arg_1))

    return arg_7

Returns a prefactor in the electric field integral .


(self,
        requirement, tmpdir, force_scan=False, source=False, develop_ok=False,
        local_index=None
    )

def Func(arg_0,
        arg_1, arg_2, arg_3=False, arg_4=False, arg_5=False,
        arg_6=None
    ):
        """Obtain a distribution suitable for fulfilling `requirement`

        `requirement` must be a ``pkg_resources.Requirement`` instance.
        If necessary, or if the `force_scan` flag is set, the requirement is
        searched for in the (online) package index as well as the locally
        installed packages.  If a distribution matching `requirement` is found,
        the returned distribution's ``location`` is the value you would have
        gotten from calling the ``download()`` method with the matching
        distribution's URL or filename.  If no matching distribution is found,
        ``None`` is returned.

        If the `source` flag is set, only source distributions and source
        checkout links will be considered.  Unless the `develop_ok` flag is
        set, development and system eggs (i.e., those using the ``.egg-info``
        format) will be ignored.
        """

        # process a Requirement
        arg_0.info("Searching for %s", arg_1)
        arg_7 = {}
        arg_8 = None

        def find(arg_9, arg_10=None):
            if arg_10 is None:
                arg_10 = arg_0
            # Find a matching distribution; may be called more than once

            for arg_8 in arg_10[arg_9.key]:

                if arg_8.precedence==DEVELOP_DIST and not arg_5:
                    if arg_8 not in arg_7:
                        arg_0.warn("Skipping development or system egg: %s",arg_8)
                        arg_7[arg_8] = 1
                    continue

                if arg_8 in arg_9 and (arg_8.precedence<=SOURCE_DIST or not arg_4):
                    arg_0.info("Best match: %s", arg_8)
                    return arg_8.clone(
                        location=arg_0.download(arg_8.location, arg_2)
                    )

        if arg_3:
            arg_0.prescan()
            arg_0.find_packages(arg_1)
            arg_8 = find(arg_1)

        if arg_6 is not None:
            arg_8 = arg_8 or find(arg_1, arg_6)

        if arg_8 is None and arg_0.to_scan is not None:
            arg_0.prescan()
            arg_8 = find(arg_1)

        if arg_8 is None and not arg_3:
            arg_0.find_packages(arg_1)
            arg_8 = find(arg_1)

        if arg_8 is None:
            arg_0.warn(
                "No local packages or download links found for %s%s",
                (arg_4 and "a source distribution of " or ""),
                arg_1,
            )
        return arg_8

Obtain a distribution suitable for fulfilling requirement


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in arg_0 . tags . items ( ) : for arg_5 in arg_1 . tags : if arg_4 . is_tag ( arg_5 ) : arg_2 [ arg_3 ] = arg_4 . get ( arg_1 ) return arg_2

def Func(arg_0, arg_1):
        """Get all known tags from a model.

        Returns a dict of {<tag_name>:<tag_value>}.
        """
        arg_2 = {}
        for arg_3, arg_4 in arg_0.tags.items():
            for arg_5 in arg_1.tags:
                if arg_4.is_tag(arg_5):
                    arg_2[arg_3] = arg_4.get(arg_1)
        return arg_2


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
try
:
if
not
arg_2
:
arg_3
=
Popen
(
arg_0
,
arg_4
=
PIPE
,
arg_5
=
PIPE
)
arg_4
,
arg_5
=
arg_3
.
communicate
(
)
arg_6
=
arg_3
.
returncode
if
arg_1
>=
1
:
print
(
"Program : "
,
" "
.
join
(
arg_0
)
)
print
(
"Return Code: "
,
arg_6
)
print
(
"Stdout: "
,
arg_4
)
print
(
"Stderr: "
,
arg_5
)
return
bool
(
arg_6
)
else
:
arg_7
=
" "
.
join
(
arg_0
)
os
.
system
(
arg_7
)
return
True
except
:
return
False

def Func(arg_0, arg_1, arg_2):
    """Run a  program and check program return code Note that some commands don't work
    well with Popen.  So if this function is specifically called with 'shell=True',
    then it will run the old 'os.system'. In which case, there is no program output
    """
    try:
        if not arg_2:
            arg_3 = Popen(arg_0, arg_4=PIPE, arg_5=PIPE)
            arg_4, arg_5 = arg_3.communicate()
            arg_6 = arg_3.returncode
            if arg_1 >= 1:
                print("Program : ", " ".join(arg_0))
                print("Return Code: ", arg_6)
                print("Stdout: ", arg_4)
                print("Stderr: ", arg_5)
            return bool(arg_6)
        else:
            arg_7 = " ".join(arg_0)
            os.system(arg_7)
            return True
    except:
        return False

Run a program and check program return code Note that some commands don t work well with Popen . So if this function is specifically called with shell = True then it will run the old os . system . In which case there is no program output


def Func ( arg_0 ) : arg_1 = arg_0 . count arg_2 = [ ( item , arg_1 ( item ) ) for item in set ( arg_0 ) ] arg_2 . sort ( ) return arg_2

def Func(arg_0):
    """
    Generates a count of the number of times each unique item appears in a list
    """
    arg_1 = arg_0.count
    arg_2 = [(item, arg_1(item)) for item in set(arg_0)]
    arg_2.sort()
    return arg_2


def
Func
(
arg_0
,
arg_1
)
:
super
(
FrontendWidget
,
arg_0
)
.
Func
(
arg_1
)
arg_1
.
insertText
(
' '
*
arg_0
.
_input_splitter
.
indent_spaces
)

def Func(arg_0, arg_1):
        """ Reimplemented for auto-indentation.
        """
        super(FrontendWidget, arg_0).Func(arg_1)
        arg_1.insertText(' ' * arg_0._input_splitter.indent_spaces)


def
Func
(
)
:
if
os
.
name
==
'posix'
:
Func
=
[
(
'mkdir'
,
'mkdir'
)
,
(
'rmdir'
,
'rmdir'
)
,
(
'mv'
,
'mv -i'
)
,
(
'rm'
,
'rm -i'
)
,
(
'cp'
,
'cp -i'
)
,
(
'cat'
,
'cat'
)
,
]
if
sys
.
platform
.
startswith
(
'linux'
)
:
arg_1
=
[
(
'ls'
,
'ls -F --color'
)
,
(
'll'
,
'ls -F -o --color'
)
,
(
'lf'
,
'ls -F -o --color %l | grep ^-'
)
,
(
'lk'
,
'ls -F -o --color %l | grep ^l'
)
,
(
'ldir'
,
'ls -F -o --color %l | grep /$'
)
,
(
'lx'
,
'ls -F -o --color %l | grep ^-..x'
)
,
]
else
:
arg_1
=
[
(
'ls'
,
'ls -F'
)
,
(
'll'
,
'ls -F -l'
)
,
(
'lf'
,
'ls -F -l %l | grep ^-'
)
,
(
'lk'
,
'ls -F -l %l | grep ^l'
)
,
(
'ldir'
,
'ls -F -l %l | grep /$'
)
,
(
'lx'
,
'ls -F -l %l | grep ^-..x'
)
,
]
Func
=
Func
+
arg_1
elif
os
.
name
in
[
'nt'
,
'dos'
]
:
Func
=
[
(
'ls'
,
'dir /on'
)
,
(
'ddir'
,
'dir /ad /on'
)
,
(
'ldir'
,
'dir /ad /on'
)
,
(
'mkdir'
,
'mkdir'
)
,
(
'rmdir'
,
'rmdir'
)
,
(
'echo'
,
'echo'
)
,
(
'ren'
,
'ren'
)
,
(
'copy'
,
'copy'
)
,
]
else
:
Func
=
[
]
return
Func

def Func():
    """Return list of shell aliases to auto-define.
    """
    # Note: the aliases defined here should be safe to use on a kernel
    # regardless of what frontend it is attached to.  Frontends that use a
    # kernel in-process can define additional aliases that will only work in
    # their case.  For example, things like 'less' or 'clear' that manipulate
    # the terminal should NOT be declared here, as they will only work if the
    # kernel is running inside a true terminal, and not over the network.

    if os.name == 'posix':
        Func = [('mkdir', 'mkdir'), ('rmdir', 'rmdir'),
                           ('mv', 'mv -i'), ('rm', 'rm -i'), ('cp', 'cp -i'),
                           ('cat', 'cat'),
                           ]
        # Useful set of ls aliases.  The GNU and BSD options are a little
        # different, so we make aliases that provide as similar as possible
        # behavior in ipython, by passing the right flags for each platform
        if sys.platform.startswith('linux'):
            arg_1 = [('ls', 'ls -F --color'),
                          # long ls
                          ('ll', 'ls -F -o --color'),
                          # ls normal files only
                          ('lf', 'ls -F -o --color %l | grep ^-'),
                          # ls symbolic links
                          ('lk', 'ls -F -o --color %l | grep ^l'),
                          # directories or links to directories,
                          ('ldir', 'ls -F -o --color %l | grep /$'),
                          # things which are executable
                          ('lx', 'ls -F -o --color %l | grep ^-..x'),
                          ]
        else:
            # BSD, OSX, etc.
            arg_1 = [('ls', 'ls -F'),
                          # long ls
                          ('ll', 'ls -F -l'),
                          # ls normal files only
                          ('lf', 'ls -F -l %l | grep ^-'),
                          # ls symbolic links
                          ('lk', 'ls -F -l %l | grep ^l'),
                          # directories or links to directories,
                          ('ldir', 'ls -F -l %l | grep /$'),
                          # things which are executable
                          ('lx', 'ls -F -l %l | grep ^-..x'),
                          ]
        Func = Func + arg_1
    elif os.name in ['nt', 'dos']:
        Func = [('ls', 'dir /on'),
                           ('ddir', 'dir /ad /on'), ('ldir', 'dir /ad /on'),
                           ('mkdir', 'mkdir'), ('rmdir', 'rmdir'),
                           ('echo', 'echo'), ('ren', 'ren'), ('copy', 'copy'),
                           ]
    else:
        Func = []

    return Func

Return list of shell aliases to auto - define .


Returns the Instruction object corresponding to the op for the node else None

def
Func
(
arg_0
)
:
if
'type'
not
in
arg_0
.
data_dict
or
arg_0
.
data_dict
[
'type'
]
!=
'Func'
:
raise
QiskitError
(
"The node %s is not an Func node"
%
(
str
(
arg_0
)
)
)
return
arg_0
.
data_dict
.
get
(
'Func'
)

def Func(arg_0):
        """Returns the Instruction object corresponding to the Func for the node else None"""
        if 'type' not in arg_0.data_dict or arg_0.data_dict['type'] != 'Func':
            raise QiskitError("The node %s is not an Func node" % (str(arg_0)))
        return arg_0.data_dict.get('Func')


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
log
.
debug
(
'Validate client key for %r'
,
arg_1
)
if
not
arg_2
.
client
:
arg_2
.
client
=
arg_0
.
_clientgetter
(
arg_1
=
arg_1
)
if
arg_2
.
client
:
return
True
return
False

def Func(arg_0, arg_1, arg_2):
        """Validates that supplied client key."""
        log.debug('Validate client key for %r', arg_1)
        if not arg_2.client:
            arg_2.client = arg_0._clientgetter(arg_1=arg_1)
        if arg_2.client:
            return True
        return False


def Func ( arg_0 , arg_1 = None ) : arg_2 = { "prefix" : arg_1 } return arg_0 . request ( method = "get" , arg_2 = arg_2 ) . json ( )

def Func(arg_0, arg_1=None):
        """ Lists all the evaluations.

           https://www.nomadproject.io/docs/http/evals.html
            arguments:
              - prefix :(str) optional, specifies a string to filter evaluations on based on an prefix.
                        This is specified as a querystring parameter.
            returns: list
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"prefix": arg_1}
        return arg_0.request(method="get", arg_2=arg_2).json()


Get the path to the file relative to its parent.

def Func ( arg_0 ) : if arg_0 . _parent : return os . Func . join ( arg_0 . _parent . Func , arg_0 . _fFunc ) else : return arg_0 . _fFunc

def Func(arg_0):
        """
        Get the Func to the file relative to its parent.
        """
        if arg_0._parent:
            return os.Func.join(arg_0._parent.Func, arg_0._fFunc)
        else:
            return arg_0._fFunc

Get the path to the file relative to its parent .


(self, f_start=None, f_stop=None,t_start=None, t_stop=None, if_id=0)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = None , arg_5 = 0 ) : arg_0 . freqs = arg_0 . populate_freqs ( ) arg_0 . timestamps = arg_0 . populate_timestamps ( ) if arg_1 is None : arg_1 = arg_0 . freqs [ 0 ] if arg_2 is None : arg_2 = arg_0 . freqs [ - 1 ] arg_8 = np . argmin ( np . abs ( arg_0 . freqs - arg_1 ) ) arg_9 = np . argmin ( np . abs ( arg_0 . freqs - arg_2 ) ) if arg_8 < arg_9 : arg_10 = arg_0 . freqs [ arg_8 : arg_9 + 1 ] arg_11 = np . squeeze ( arg_0 . data [ arg_3 : arg_4 , ... , arg_8 : arg_9 + 1 ] ) else : arg_10 = arg_0 . freqs [ arg_9 : arg_8 + 1 ] arg_11 = np . squeeze ( arg_0 . data [ arg_3 : arg_4 , ... , arg_9 : arg_8 + 1 ] ) return arg_10 , arg_11

def Func(arg_0, arg_1=None, arg_2=None,arg_3=None, arg_4=None, arg_5=0):
        """ Extract a portion of data by frequency range.

        Args:
            f_start (float): start frequency in MHz
            f_stop (float): stop frequency in MHz
            if_id (int): IF input identification (req. when multiple IFs in file)

        Returns:
            (freqs, data) (np.arrays): frequency axis in MHz and data subset
        """

        arg_0.freqs = arg_0.populate_freqs()
        arg_0.timestamps = arg_0.populate_timestamps()

        if arg_1 is None:
            arg_1 = arg_0.freqs[0]
        if arg_2 is None:
            arg_2 = arg_0.freqs[-1]

        arg_8 = np.argmin(np.abs(arg_0.freqs - arg_1))
        arg_9 = np.argmin(np.abs(arg_0.freqs - arg_2))

        if arg_8 < arg_9:
            arg_10    = arg_0.freqs[arg_8:arg_9 + 1]
            arg_11 = np.squeeze(arg_0.data[arg_3:arg_4, ..., arg_8:arg_9 + 1])
        else:
            arg_10    = arg_0.freqs[arg_9:arg_8 + 1]
            arg_11 = np.squeeze(arg_0.data[arg_3:arg_4, ..., arg_9:arg_8 + 1])

        return arg_10, arg_11

Extract a portion of data by frequency range .


def Func ( arg_0 , arg_1 ) : arg_2 = collections . defaultdict ( float ) for arg_3 in arg_0 : for arg_4 , arg_5 in arg_3 . count ( ) . items ( ) : arg_2 [ arg_4 ] += arg_5 * arg_1 return arg_2

def Func(arg_0, arg_1):
    """ Update group counts with multiplier

    This is for handling atom counts on groups like (OH)2

    :param groups: iterable of Group/Element
    :param multiplier: the number to multiply by

    """
    arg_2 = collections.defaultdict(float)
    for arg_3 in arg_0:
        for arg_4, arg_5 in arg_3.count().items():
            arg_2[arg_4] += arg_5*arg_1
    return arg_2


def Func ( arg_0 ) : if arg_0 . _tp + arg_0 . _fn == 0 : return float ( 'NaN' ) return arg_0 . _tp / ( arg_0 . _tp + arg_0 . _fn )

def Func(arg_0):
        r"""Return Func.

        Recall is defined as :math:`\frac{tp}{tp + fn}`

        AKA sensitivity

        AKA true positive rate (TPR)

        Cf. https://en.wikipedia.org/wiki/Precision_and_Func

        Cf. https://en.wikipedia.org/wiki/Sensitivity_(test)

        Cf. https://en.wikipedia.org/wiki/Information_retrieval#Recall

        Returns
        -------
        float
            The Func of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.Func()
        0.8

        """
        if arg_0._tp + arg_0._fn == 0:
            return float('NaN')
        return arg_0._tp / (arg_0._tp + arg_0._fn)

r"""Return recall.

        Recall is defined as :math:`\frac{tp}{tp + fn}`

        AKA sensitivity

        AKA true positive rate (TPR)

        Cf. https://en.wikipedia.org/wiki/Precision_and_recall

        Cf. https://en.wikipedia.org/wiki/Sensitivity_(test)

        Cf. https://en.wikipedia.org/wiki/Information_retrieval#Recall

        Returns
        -------
        float
            The recall of the confusion table

        Example
        -------
        >>> ct = ConfusionTable(120, 60, 20, 30)
        >>> ct.recall()
        0.8


def Func(arg_0, arg_1):
    r'''Calculates the activity coefficients of each species in a mixture
    using the Func method, given their mole fractions, and
    dimensionless interaction parameters. Those are normally correlated with
    temperature, and need to be calculated separately.

    .. math::
        \ln \gamma_i = 1 - \ln \left(\sum_j^N \Lambda_{ij} x_j\right)
        -\sum_j^N \frac{\Lambda_{ji}x_j}{\displaystyle\sum_k^N \Lambda_{jk}x_k}

    Parameters
    ----------
    xs : list[float]
        Liquid mole fractions of each species, [-]
    params : list[list[float]]
        Dimensionless interaction parameters of each compound with each other,
        [-]

    Returns
    -------
    gammas : list[float]
        Activity coefficient for each species in the liquid mixture, [-]

    Notes
    -----
    This model needs N^2 parameters.

    The original model correlated the interaction parameters using the standard
    pure-component molar volumes of each species at 25°C, in the following form:

    .. math::
        \Lambda_{ij} = \frac{V_j}{V_i} \exp\left(\frac{-\lambda_{i,j}}{RT}\right)

    However, that form has less flexibility and offered no advantage over
    using only regressed parameters.

    Most correlations for the interaction parameters include some of the terms
    shown in the following form:

    .. math::
        \ln \Lambda_{ij} =a_{ij}+\frac{b_{ij}}{T}+c_{ij}\ln T + d_{ij}T
        + \frac{e_{ij}}{T^2} + h_{ij}{T^2}

    The Func model is not applicable to liquid-liquid systems.

    Examples
    --------
    Ethanol-water example, at 343.15 K and 1 MPa:

    >>> Func([0.252, 0.748], [[1, 0.154], [0.888, 1]])
    [1.8814926087178843, 1.1655774931125487]

    References
    ----------
    .. [1] Func, Grant M. "Vapor-Liquid Equilibrium. XI. A New Expression for
       the Excess Free Energy of Mixing." Journal of the American Chemical
       Society 86, no. 2 (January 1, 1964): 127-130. doi:10.1021/ja01056a002.
    .. [2] Gmehling, Jurgen, Barbel Kolbe, Michael Kleiber, and Jurgen Rarey.
       Chemical Thermodynamics for Process Simulation. 1st edition. Weinheim:
       Wiley-VCH, 2012.
    '''
    arg_2 = []
    arg_3 = range(len(arg_0))
    for arg_4 in arg_3:
        arg_5 = log(sum([arg_1[arg_4][arg_7]*arg_0[arg_7] for arg_7 in arg_3]))
        arg_6 = 0.
        for arg_7 in arg_3:
            arg_6 += arg_1[arg_7][arg_4]*arg_0[arg_7]/sum([arg_1[arg_7][arg_8]*arg_0[arg_8] for arg_8 in arg_3])

        arg_9 = exp(1. - arg_5 - arg_6)
        arg_2.append(arg_9)
    return arg_2

r'''Calculates the activity coefficients of each species in a mixture
    using the Wilson method, given their mole fractions, and
    dimensionless interaction parameters. Those are normally correlated with
    temperature, and need to be calculated separately.

    .. math::
        \ln \gamma_i = 1 - \ln \left(\sum_j^N \Lambda_{ij} x_j\right)
        -\sum_j^N \frac{\Lambda_{ji}x_j}{\displaystyle\sum_k^N \Lambda_{jk}x_k}

    Parameters
    ----------
    xs : list[float]
        Liquid mole fractions of each species, [-]
    params : list[list[float]]
        Dimensionless interaction parameters of each compound with each other,
        [-]

    Returns
    -------
    gammas : list[float]
        Activity coefficient for each species in the liquid mixture, [-]

    Notes
    -----
    This model needs N^2 parameters.

    The original model correlated the interaction parameters using the standard
    pure-component molar volumes of each species at 25°C, in the following form:

    .. math::
        \Lambda_{ij} = \frac{V_j}{V_i} \exp\left(\frac{-\lambda_{i,j}}{RT}\right)

    However, that form has less flexibility and offered no advantage over
    using only regressed parameters.

    Most correlations for the interaction parameters include some of the terms
    shown in the following form:

    .. math::
        \ln \Lambda_{ij} =a_{ij}+\frac{b_{ij}}{T}+c_{ij}\ln T + d_{ij}T
        + \frac{e_{ij}}{T^2} + h_{ij}{T^2}

    The Wilson model is not applicable to liquid-liquid systems.

    Examples
    --------
    Ethanol-water example, at 343.15 K and 1 MPa:

    >>> Wilson([0.252, 0.748], [[1, 0.154], [0.888, 1]])
    [1.8814926087178843, 1.1655774931125487]

    References
    ----------
    .. [1] Wilson, Grant M. "Vapor-Liquid Equilibrium. XI. A New Expression for
       the Excess Free Energy of Mixing." Journal of the American Chemical
       Society 86, no. 2 (January 1, 1964): 127-130. doi:10.1021/ja01056a002.
    .. [2] Gmehling, Jurgen, Barbel Kolbe, Michael Kleiber, and Jurgen Rarey.
       Chemical Thermodynamics for Process Simulation. 1st edition. Weinheim:
       Wiley-VCH, 2012.

r Calculates the activity coefficients of each species in a mixture using the Wilson method given their mole fractions and dimensionless interaction parameters . Those are normally correlated with temperature and need to be calculated separately .


def Func(arg_0):
        """ Return the contents of My Publications
        """
        if arg_0.library_type != "users":
            raise ze.CallDoesNotExist(
                "This API call does not exist for group libraries"
            )
        arg_1 = "/{t}/{u}/Func/items"
        return arg_0._build_query(arg_1)


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
_getRunningApps
(
)
for
arg_2
in
arg_1
:
arg_3
=
arg_2
.
processIdentifier
(
)
arg_4
=
arg_0
.
getAppRefByPid
(
arg_3
)
if
hasattr
(
arg_4
,
'windows'
)
and
len
(
arg_4
.
windows
(
)
)
>
0
:
return
arg_4
raise
ValueError
(
'No GUI application found.'
)

def Func(arg_0):
        """Get a random app that has windows.

        Raise a ValueError exception if no GUI applications are found.
        """
        # Refresh the runningApplications list
        arg_1 = arg_0._getRunningApps()
        for arg_2 in arg_1:
            arg_3 = arg_2.processIdentifier()
            arg_4 = arg_0.getAppRefByPid(arg_3)
            if hasattr(arg_4, 'windows') and len(arg_4.windows()) > 0:
                return arg_4
        raise ValueError('No GUI application found.')


def Func(arg_0):
        '''
        multiplies a list of Distribution objects
        '''
        if  not all([isinstance(arg_1, Distribution) for arg_1 in arg_0]):
            raise NotImplementedError("Can only Func Distribution objects")

        arg_2 = np.sum([arg_1.is_delta for arg_1 in arg_0])
        arg_3 = np.max([arg_1.min_width for arg_1 in arg_0])
        if arg_2>1:
            raise ArithmeticError("Cannot Func more than one delta functions!")
        elif arg_2==1:
            arg_4 = np.where([arg_1.is_delta for arg_1 in arg_0])[0][0]
            arg_5 = arg_0[arg_4]
            arg_6 = arg_5.peak_pos
            arg_7  = np.prod([arg_1.prob(arg_6) for arg_1 in arg_0 if arg_1!=arg_4]) * arg_5.weight
            arg_8 = Distribution.delta_function(arg_6, weight = arg_7,arg_3=arg_3)
        else:
            arg_9 = np.max([arg_1.xmin for arg_1 in arg_0])
            arg_10 = np.min([arg_1.xmax for arg_1 in arg_0])

            arg_11 = np.unique(np.concatenate([arg_1.x for arg_1 in arg_0]))
            arg_11 = arg_11[(arg_11>arg_9-TINY_NUMBER)&(arg_11<arg_10+TINY_NUMBER)]
            arg_12 = np.sum([arg_1.__call__(arg_11) for arg_1 in arg_0], axis=0)
            arg_13 = arg_12.min()
            arg_14 = (arg_12-arg_13)<BIG_NUMBER/1000
            arg_15 = arg_14.sum()
            if arg_15 == 0:
                print ("ERROR in distribution multiplication: Distributions do not overlap")
                arg_11 = [0,1]
                arg_12 = [BIG_NUMBER,BIG_NUMBER]
                arg_8 = Distribution(arg_11, arg_12, is_log=True,
                                   arg_3=arg_3, kind='linear')
            elif arg_15 == 1:
                arg_8 = Distribution.delta_function(arg_11[0])
            else:
                arg_8 = Distribution(arg_11[arg_14], arg_12[arg_14], is_log=True,
                                   arg_3=arg_3, kind='linear', assume_sorted=True)

        return arg_8


def
Func
(
arg_0
)
:
arg_1
=
getattr
(
arg_0
,
'module_name'
,
''
)
arg_2
=
getattr
(
arg_0
,
'prefix'
,
''
)
arg_3
=
getattr
(
arg_0
,
'filepath'
,
''
)
if
arg_3
:
if
os
.
path
.
isabs
(
arg_3
)
:
yield
arg_3
else
:
yield
os
.
path
.
join
(
arg_0
.
basedir
,
arg_3
)
else
:
if
arg_2
:
arg_4
=
arg_0
.
_find_prefix_Func
(
arg_0
.
basedir
,
arg_2
)
else
:
arg_4
=
[
arg_0
.
basedir
]
for
arg_5
in
arg_4
:
try
:
if
arg_1
:
arg_6
=
arg_0
.
_find_module_path
(
arg_5
,
arg_1
)
else
:
arg_6
=
arg_5
if
os
.
path
.
isfile
(
arg_6
)
:
logger
.
debug
(
'Module path: {}'
.
format
(
arg_6
)
)
yield
arg_6
else
:
arg_7
=
set
(
)
for
arg_8
,
arg_9
,
arg_10
in
arg_0
.
walk
(
arg_6
)
:
for
arg_11
in
arg_10
:
if
arg_11
.
startswith
(
"__init__"
)
:
if
arg_0
.
_is_module_path
(
arg_8
)
:
arg_3
=
os
.
path
.
join
(
arg_8
,
arg_11
)
if
arg_3
not
in
arg_7
:
logger
.
debug
(
'Module package path: {}'
.
format
(
arg_3
)
)
arg_7
.
add
(
arg_3
)
yield
arg_3
else
:
arg_12
=
os
.
path
.
splitext
(
arg_11
)
[
0
]
for
arg_13
in
arg_0
.
module_postfixes
:
if
arg_12
.
endswith
(
arg_13
)
:
arg_3
=
os
.
path
.
join
(
arg_8
,
arg_11
)
if
arg_3
not
in
arg_7
:
logger
.
debug
(
'Module postfix path: {}'
.
format
(
arg_3
)
)
arg_7
.
add
(
arg_3
)
yield
arg_3
for
arg_13
in
arg_0
.
module_prefixes
:
if
arg_12
.
startswith
(
arg_13
)
:
arg_3
=
os
.
path
.
join
(
arg_8
,
arg_11
)
if
arg_3
not
in
arg_7
:
logger
.
debug
(
'Module prefix path: {}'
.
format
(
arg_3
)
)
arg_7
.
add
(
arg_3
)
yield
arg_3
except
IOError
as
e
:
logger
.
warning
(
e
,
exc_info
=
True
)
pass

def Func(arg_0):
        '''
        given a basedir, yield all test modules Func recursively found in
        basedir that are test modules

        return -- generator
        '''
        arg_1 = getattr(arg_0, 'module_name', '')
        arg_2 = getattr(arg_0, 'prefix', '')
        arg_3 = getattr(arg_0, 'filepath', '')

        if arg_3:
            if os.path.isabs(arg_3):
                yield arg_3

            else:
                yield os.path.join(arg_0.basedir, arg_3)

        else:
            if arg_2:
                arg_4 = arg_0._find_prefix_Func(arg_0.basedir, arg_2)
            else:
                arg_4 = [arg_0.basedir]

            for arg_5 in arg_4:
                try:
                    if arg_1:
                        arg_6 = arg_0._find_module_path(arg_5, arg_1)

                    else:
                        arg_6 = arg_5

                    if os.path.isfile(arg_6):
                        logger.debug('Module path: {}'.format(arg_6))
                        yield arg_6

                    else:
                        arg_7 = set()
                        for arg_8, arg_9, arg_10 in arg_0.walk(arg_6):
                            for arg_11 in arg_10:
                                if arg_11.startswith("__init__"):
                                    if arg_0._is_module_path(arg_8):
                                        arg_3 = os.path.join(arg_8, arg_11)
                                        if arg_3 not in arg_7:
                                            logger.debug('Module package path: {}'.format(arg_3))
                                            arg_7.add(arg_3)
                                            yield arg_3

                                else:
                                    arg_12 = os.path.splitext(arg_11)[0]
                                    for arg_13 in arg_0.module_postfixes:
                                        if arg_12.endswith(arg_13):
                                            arg_3 = os.path.join(arg_8, arg_11)
                                            if arg_3 not in arg_7:
                                                logger.debug('Module postfix path: {}'.format(arg_3))
                                                arg_7.add(arg_3)
                                                yield arg_3

                                    for arg_13 in arg_0.module_prefixes:
                                        if arg_12.startswith(arg_13):
                                            arg_3 = os.path.join(arg_8, arg_11)
                                            if arg_3 not in arg_7:
                                                logger.debug('Module prefix path: {}'.format(arg_3))
                                                arg_7.add(arg_3)
                                                yield arg_3

                except IOError as e:
                    # we failed to find a suitable path
                    logger.warning(e, exc_info=True)
                    pass

given a basedir, yield all test modules paths recursively found in
        basedir that are test modules

        return -- generator

given a basedir yield all test modules paths recursively found in basedir that are test modules


def
Func
(
arg_0
,
**
arg_1
)
:
with
settings
(
hide
(
'running'
,
'stdout'
,
'stderr'
,
'warnings'
)
,
warn_only
=
True
)
:
arg_2
=
query
(
"SHOW DATABASES LIKE '%(name)s';"
%
{
'name'
:
arg_0
}
,
**
arg_1
)
return
arg_2
.
succeeded
and
(
arg_2
==
arg_0
)

def Func(arg_0, **arg_1):
    """
    Check if a MySQL database exists.
    """
    with settings(hide('running', 'stdout', 'stderr', 'warnings'), warn_only=True):
        arg_2 = query("SHOW DATABASES LIKE '%(name)s';" % {
            'name': arg_0
        }, **arg_1)

    return arg_2.succeeded and (arg_2 == arg_0)


def Func(arg_0, arg_1):
        """Remove classified or confidential data from an item.

        It removes those fields that contain data considered as classified.
        Classified fields are defined in `CLASSIFIED_FIELDS` class attribute.

        :param item: fields will be removed from this item

        :returns: the same item but with confidential data filtered
        """
        arg_2 = uuid(arg_0.origin, arg_0.metadata_id(arg_1))

        logger.debug("Filtering classified data for item %s", arg_2)

        for arg_3 in arg_0.CLASSIFIED_FIELDS:
            try:
                _remove_key_from_nested_dict(arg_1, arg_3)
            except KeyError:
                logger.debug("Classified field '%s' not found for item %s; field ignored",
                             '.'.join(arg_3), arg_2)

        logger.debug("Classified data filtered for item %s", arg_2)

        return arg_1

Remove classified or confidential data from an item .


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

def Func ( arg_0 = "" , arg_1 = "" , arg_2 = None , arg_3 = None ) : arg_4 = dialogs . colorDialog ( arg_3 , arg_2 = arg_2 ) return arg_4 . accepted and arg_4 . color

def Func(arg_0="", arg_1="", arg_2=None, arg_3=None):
    "Show a dialog to pick a color"
    arg_4 = dialogs.colorDialog(arg_3, arg_2=arg_2)
    return arg_4.accepted and arg_4.color


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = ACCOUNTS_API . format ( arg_1 ) + "/reports/{}" . format ( arg_2 ) arg_4 = [ ] for arg_5 in arg_0 . _get_resource ( arg_3 ) : arg_5 [ "account_id" ] = arg_1 arg_4 . append ( Report ( data = arg_5 ) ) return arg_4

def Func(arg_0, arg_1, arg_2):
        """
        Shows all reports of the passed report_type that have been run
        for the canvas account id.

        https://canvas.instructure.com/doc/api/account_reports.html#method.account_reports.index
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/reports/{}".format(
            arg_2)

        arg_4 = []
        for arg_5 in arg_0._get_resource(arg_3):
            arg_5["account_id"] = arg_1
            arg_4.append(Report(data=arg_5))

        return arg_4

Shows all reports of the passed report_type that have been run for the canvas account id .


(self, case_id, query=None, variant_ids=None, category='snv')

def
Func
(
arg_0
,
arg_1
,
arg_2
=
,
arg_3
=
,
arg_4
=
'snv'
)
:
arg_2
=
arg_2
or
{
}
arg_5
=
{
}
arg_6
=
for
arg_7
in
FUNDAMENTAL_CRITERIA
:
if
arg_7
==
'case_id'
:
LOG
.
debug
(
"Building a mongo query for %s"
%
arg_1
)
arg_5
[
'case_id'
]
=
arg_1
elif
arg_7
==
'variant_ids'
and
arg_3
:
LOG
.
debug
(
"Adding variant_ids %s to query"
%
', '
.
join
(
arg_3
)
)
arg_5
[
'variant_id'
]
=
{
'$in'
:
arg_3
}
elif
arg_7
==
'category'
:
LOG
.
debug
(
"Querying category %s"
%
arg_4
)
arg_5
[
'category'
]
=
arg_4
elif
arg_7
==
'variant_type'
:
arg_5
[
'variant_type'
]
=
arg_2
.
get
(
'variant_type'
,
'clinical'
)
LOG
.
debug
(
"Set variant type to %s"
,
arg_5
[
'variant_type'
]
)
elif
arg_7
in
[
'hgnc_symbols'
,
'gene_panels'
]
and
arg_6
is
:
arg_6
=
arg_0
.
gene_filter
(
arg_2
,
arg_5
)
elif
arg_7
==
'chrom'
and
arg_2
.
get
(
'chrom'
)
:
arg_0
.
coordinate_filter
(
arg_2
,
arg_5
)
elif
arg_7
==
'variant_ids'
and
arg_3
:
LOG
.
debug
(
"Adding variant_ids %s to query"
%
', '
.
join
(
arg_3
)
)
arg_5
[
'variant_id'
]
=
{
'$in'
:
arg_3
}
arg_8
=
False
arg_9
=
False
for
arg_10
in
PRIMARY_CRITERIA
:
if
arg_2
.
get
(
arg_10
)
:
arg_8
=
True
for
arg_10
in
SECONDARY_CRITERIA
:
if
arg_2
.
get
(
arg_10
)
:
arg_9
=
True
if
arg_8
is
True
:
arg_11
=
arg_0
.
clinsig_query
(
arg_2
,
arg_5
)
if
arg_9
is
True
:
arg_12
=
arg_0
.
secondary_query
(
arg_2
,
arg_5
)
if
arg_8
is
False
:
if
arg_6
:
arg_5
[
'$and'
]
=
[
{
'$or'
:
arg_6
}
,
{
'$and'
:
arg_12
}
]
else
:
arg_5
[
'$and'
]
=
arg_12
if
arg_8
is
True
:
if
arg_2
.
get
(
'clinsig_confident_always_returned'
)
==
True
:
if
arg_6
:
arg_5
[
'$and'
]
=
[
{
'$or'
:
arg_6
}
,
{
'$or'
:
[
{
'$and'
:
arg_12
}
,
arg_11
]
}
]
else
:
arg_5
[
'$or'
]
=
[
{
'$and'
:
arg_12
}
,
arg_11
]
else
:
arg_12
.
append
(
arg_11
)
if
arg_6
:
arg_5
[
'$and'
]
=
[
{
'$or'
:
arg_6
}
,
{
'$and'
:
arg_12
}
]
else
:
arg_5
[
'$and'
]
=
arg_12
elif
arg_8
is
True
:
arg_5
[
'clnsig'
]
=
arg_11
[
'clnsig'
]
if
arg_6
:
arg_5
[
'$and'
]
=
[
{
'$or'
:
arg_6
}
]
elif
arg_6
:
arg_5
[
'$and'
]
=
[
{
'$or'
:
arg_6
}
]
LOG
.
info
(
"mongo query: %s"
,
arg_5
)
return
arg_5

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4='snv'):
        """Build a mongo query

        These are the different query options:
            {
                'genetic_models': list,
                'chrom': str,
                'thousand_genomes_frequency': float,
                'exac_frequency': float,
                'clingen_ngi': int,
                'cadd_score': float,
                'cadd_inclusive": boolean,
                'genetic_models': list(str),
                'hgnc_symbols': list,
                'region_annotations': list,
                'functional_annotations': list,
                'clinsig': list,
                'clinsig_confident_always_returned': boolean,
                'variant_type': str(('research', 'clinical')),
                'chrom': str,
                'start': int,
                'end': int,
                'svtype': list,
                'size': int,
                'size_shorter': boolean,
                'gene_panels': list(str),
                'mvl_tag": boolean,
                'decipher": boolean,
            }

        Arguments:
            case_id(str)
            query(dict): a dictionary of query filters specified by the users
            variant_ids(list(str)): A list of md5 variant ids

        Returns:
            mongo_query : A dictionary in the mongo query format

        """
        arg_2 = arg_2 or {}
        arg_5 = {}
        arg_6 = None

        ##### Base query params

        # set up the fundamental query params: case_id, category, type and
        # restrict to list of variants (if var list is provided)
        for arg_7 in FUNDAMENTAL_CRITERIA:
            if arg_7 == 'case_id':
                LOG.debug("Building a mongo query for %s" % arg_1)
                arg_5['case_id'] = arg_1

            elif arg_7 == 'variant_ids' and arg_3:
                LOG.debug("Adding variant_ids %s to query" % ', '.join(arg_3))
                arg_5['variant_id'] = {'$in': arg_3}

            elif arg_7 == 'category':
                LOG.debug("Querying category %s" % arg_4)
                arg_5['category'] = arg_4

            elif arg_7 == 'variant_type':
                arg_5['variant_type'] = arg_2.get('variant_type', 'clinical')
                LOG.debug("Set variant type to %s", arg_5['variant_type'])

            # Requests to filter based on gene panels, hgnc_symbols or
            # coordinate ranges must always be honored. They are always added to
            # query as top level, implicit '$and'. When both hgnc_symbols and a
            # panel is used, addition of this is delayed until after the rest of
            # the query content is clear.

            elif arg_7 in ['hgnc_symbols', 'gene_panels'] and arg_6 is None:
                arg_6 = arg_0.gene_filter(arg_2, arg_5)

            elif arg_7 == 'chrom' and arg_2.get('chrom'): # filter by coordinates
                arg_0.coordinate_filter(arg_2, arg_5)

            elif arg_7 == 'variant_ids' and arg_3:
                LOG.debug("Adding variant_ids %s to query" % ', '.join(arg_3))
                arg_5['variant_id'] = {'$in': arg_3}

            ##### end of fundamental query params

        ##### start of the custom query params
        # there is only 'clinsig' criterion among the primary terms right now
        arg_8 = False

        # gnomad_frequency, local_obs, clingen_ngi, swegen, spidex_human, cadd_score, genetic_models, mvl_tag
        # functional_annotations, region_annotations, size, svtype, decipher, depth, alt_count, control_frequency
        arg_9 = False

        # check if any of the primary criteria was specified in the query
        for arg_10 in PRIMARY_CRITERIA:
            if arg_2.get(arg_10):
                arg_8 = True

        # check if any of the secondary criteria was specified in the query:
        for arg_10 in SECONDARY_CRITERIA:
            if arg_2.get(arg_10):
                arg_9 = True

        if arg_8 is True:
            arg_11 = arg_0.clinsig_query(arg_2, arg_5)

        # Secondary, excluding filter criteria will hide variants in general,
        # but can be overridden by an including, major filter criteria
        # such as a Pathogenic ClinSig.
        if arg_9 is True:
            arg_12 = arg_0.secondary_query(arg_2, arg_5)

            # If there are no primary criteria given, all secondary criteria are added as a
            # top level '$and' to the query.
            if arg_8 is False:
                if arg_6:
                    arg_5['$and'] = [ {'$or': arg_6}, {'$and': arg_12}]
                else:
                    arg_5['$and'] = arg_12

            # If there is only one primary criterion given without any secondary, it will also be
            # added as a top level '$and'.
            # Otherwise, primary criteria are added as a high level '$or' and all secondary criteria
            # are joined together with them as a single lower level '$and'.
            if arg_8 is True: # clinsig is specified

                # Given a request to always return confident clinical variants,
                # add the clnsig query as a major criteria, but only
                # trust clnsig entries with trusted revstat levels.
                if arg_2.get('clinsig_confident_always_returned') == True:
                    if arg_6:
                        arg_5['$and'] = [
                            {'$or': arg_6},
                            {
                                '$or': [
                                    {'$and': arg_12}, arg_11
                                ]
                            }
                        ]
                    else:
                        arg_5['$or'] = [ {'$and': arg_12}, arg_11 ]
                else: # clisig terms are provided but no need for trusted revstat levels
                    arg_12.append(arg_11)
                    if arg_6:
                        arg_5['$and'] = [ {'$or': arg_6}, {'$and': arg_12}]
                    else:
                        arg_5['$and'] = arg_12

        elif arg_8 is True: # clisig is provided without secondary terms query
            # use implicit and
            arg_5['clnsig'] = arg_11['clnsig']
            if arg_6:
                arg_5['$and'] = [{ '$or': arg_6 }]

        elif arg_6: # no primary or secondary filters provided
            arg_5['$and'] = [{ '$or': arg_6 }]

        LOG.info("mongo query: %s", arg_5)

        return arg_5


return has_same_endpoint and has_same_args

def Func ( arg_0 ) : if not arg_0 . is_internal : return False arg_1 = ( request . endpoint == arg_0 . endpoint ) arg_2 = ( request . view_args == arg_0 . args ) return arg_1 and arg_2

def Func(arg_0):
        """``True`` if current request has same endpoint with the item.

        The property should be used in a bound request context, or the
        :class:`RuntimeError` may be raised.
        """
        if not arg_0.is_internal:
            return False  # always false for external url
        arg_1 = (request.endpoint == arg_0.endpoint)
        arg_2 = (request.view_args == arg_0.args)
        return arg_1 and arg_2

True if current request has same endpoint with the item .


(
        self,
        summary,
        source,
        severity,
        event_action='trigger',
        dedup_key=None,
        timestamp=None,
        component=None,
        group=None,
        event_class=None,
        custom_details=None,
    )

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 = 'trigger' , arg_5 = None , arg_6 = None , arg_7 = None , arg_8 = None , arg_9 = None , arg_10 = None , ) : arg_11 = { 'routing_key' : arg_0 . routing_key , 'event_action' : arg_4 , 'payload' : { 'summary' : arg_1 , 'source' : arg_2 , 'severity' : arg_3 } , } if arg_5 is not None : arg_11 [ 'dedup_key' ] = arg_5 if arg_6 is not None : arg_11 [ 'payload' ] [ 'timestamp' ] = arg_6 if arg_7 is not None : arg_11 [ 'payload' ] [ 'component' ] = arg_7 if arg_8 is not None : arg_11 [ 'payload' ] [ 'group' ] = arg_8 if arg_9 is not None : arg_11 [ 'payload' ] [ 'class' ] = arg_9 if arg_10 is not None : arg_11 [ 'payload' ] [ 'custom_details' ] = arg_10 return pypd . EventV2 . create ( arg_11 = arg_11 )

def Func(
        arg_0,
        arg_1,
        arg_2,
        arg_3,
        arg_4='trigger',
        arg_5=None,
        arg_6=None,
        arg_7=None,
        arg_8=None,
        arg_9=None,
        arg_10=None,
    ):
        '''Events API v2 enables you to add PagerDuty's advanced event and incident management
        functionality to any system that can make an outbound HTTP connection.

        Arguments:
            summary {string} -- A high-level, text summary message of the event. Will be used to
                                construct an alert's description.

                                Example: "PING OK - Packet loss = 0%, RTA = 1.41 ms" "Host
                                         'acme-andromeda-sv1-c40 :: 179.21.24.50' is DOWN"

            source {string} -- Specific human-readable unique identifier, such as a hostname, for
                               the system having the problem.

                               Examples:
                               "prod05.theseus.acme-widgets.com"
                               "171.26.23.22"
                               "aws:elasticache:us-east-1:852511987:cluster/api-stats-prod-003"
                               "9c09acd49a25"

            severity {string} -- How impacted the affected system is. Displayed to users in lists
                                 and influences the priority of any created incidents. Must be one
                                 of {info, warning, error, critical}

        Keyword Arguments:
            event_action {str} -- There are three types of events that PagerDuty recognizes, and
                                  are used to represent different types of activity in your
                                  monitored systems. (default: 'trigger')
                * trigger: When PagerDuty receives a trigger event, it will either open a new alert,
                           or add a new trigger log entry to an existing alert, depending on the
                           provided dedup_key. Your monitoring tools should send PagerDuty a trigger
                           when a new problem has been detected. You may send additional triggers
                           when a previously detected problem has occurred again.

                * acknowledge: acknowledge events cause the referenced incident to enter the
                               acknowledged state. While an incident is acknowledged, it won't
                               generate any additional notifications, even if it receives new
                               trigger events. Your monitoring tools should send PagerDuty an
                               acknowledge event when they know someone is presently working on the
                               problem.

                * resolve: resolve events cause the referenced incident to enter the resolved state.
                           Once an incident is resolved, it won't generate any additional
                           notifications. New trigger events with the same dedup_key as a resolved
                           incident won't re-open the incident. Instead, a new incident will be
                           created. Your monitoring tools should send PagerDuty a resolve event when
                           the problem that caused the initial trigger event has been fixed.

            dedup_key {string} -- Deduplication key for correlating triggers and resolves. The
                                  maximum permitted length of this property is 255 characters.

            timestamp {string} -- Timestamp (ISO 8601). When the upstream system detected / created
                                  the event. This is useful if a system batches or holds events
                                  before sending them to PagerDuty.

                                  Optional - Will be auto-generated by PagerDuty if not provided.

                                  Example:
                                  2015-07-17T08:42:58.315+0000

            component {string} -- The part or component of the affected system that is broken.

                                  Examples:
                                  "keepalive"
                                  "webping"
                                  "mysql"
                                  "wqueue"

            group {string} -- A cluster or grouping of sources. For example, sources
                              “prod-datapipe-02” and “prod-datapipe-03” might both be part of
                              “prod-datapipe”

                              Examples:
                              "prod-datapipe"
                              "www"
                              "web_stack"

            event_class {string} -- The class/type of the event.

                                    Examples:
                                    "High CPU"
                                    "Latency"
                                    "500 Error"

            custom_details {Dict[str, str]} -- Additional details about the event and affected
                                               system.

                                               Example:
                                               {"ping time": "1500ms", "load avg": 0.75 }
        '''

        arg_11 = {
            'routing_key': arg_0.routing_key,
            'event_action': arg_4,
            'payload': {'summary': arg_1, 'source': arg_2, 'severity': arg_3},
        }

        if arg_5 is not None:
            arg_11['dedup_key'] = arg_5

        if arg_6 is not None:
            arg_11['payload']['timestamp'] = arg_6

        if arg_7 is not None:
            arg_11['payload']['component'] = arg_7

        if arg_8 is not None:
            arg_11['payload']['group'] = arg_8

        if arg_9 is not None:
            arg_11['payload']['class'] = arg_9

        if arg_10 is not None:
            arg_11['payload']['custom_details'] = arg_10

        return pypd.EventV2.create(arg_11=arg_11)

Events API v2 enables you to add PagerDuty s advanced event and incident management functionality to any system that can make an outbound HTTP connection .


def Func(arg_0, **arg_1):
        """
        Register resources with the ResourceManager.
        """
        for arg_2, arg_3 in arg_1.items():
            if arg_2 in arg_0._resources:
                raise AlreadyExistsException('A Service for {} is already registered.'.format(arg_2))

            arg_0._init_resource(arg_2, arg_3)

Register resources with the ResourceManager .


def Func ( arg_0 ) : arg_0 . cnxn . xfer ( [ 0x12 ] ) sleep ( 10e-3 ) arg_0 . firmware [ 'major' ] = arg_0 . cnxn . xfer ( [ 0x00 ] ) [ 0 ] arg_0 . firmware [ 'minor' ] = arg_0 . cnxn . xfer ( [ 0x00 ] ) [ 0 ] arg_0 . firmware [ 'version' ] = float ( '{}.{}' . format ( arg_0 . firmware [ 'major' ] , arg_0 . firmware [ 'minor' ] ) ) sleep ( 0.1 ) return arg_0 . firmware

def Func(arg_0):
        """Read the firmware version of the OPC-N2. Firmware v18+ only.

        :rtype: dict

        :Example:

        >>> alpha.Func()
        {
            'major': 18,
            'minor': 2,
            'version': 18.2
        }
        """
        # Send the command byte and sleep for 9 ms
        arg_0.cnxn.xfer([0x12])
        sleep(10e-3)

        arg_0.firmware['major'] = arg_0.cnxn.xfer([0x00])[0]
        arg_0.firmware['minor'] = arg_0.cnxn.xfer([0x00])[0]

        # Build the firmware version
        arg_0.firmware['version'] = float('{}.{}'.format(arg_0.firmware['major'], arg_0.firmware['minor']))

        sleep(0.1)

        return arg_0.firmware

Read the firmware version of the OPC-N2. Firmware v18+ only.

        :rtype: dict

        :Example:

        >>> alpha.read_firmware()
        {
            'major': 18,
            'minor': 2,
            'version': 18.2
        }

Read the firmware version of the OPC - N2 . Firmware v18 + only .


def Func ( arg_0 = None , arg_1 = 'name' , ** arg_2 ) : arg_3 = [ ] arg_4 = arg_0 . aggregatedList ( ** arg_2 ) while arg_4 is not None : arg_5 = arg_4 . execute ( ) for arg_6 , arg_7 in arg_5 [ 'items' ] . items ( ) : if arg_1 in arg_7 : arg_3 . extend ( arg_7 [ arg_1 ] ) arg_4 = arg_0 . aggregatedList_next ( previous_request = arg_4 , previous_response = arg_5 ) return arg_3

def Func(arg_0=None, arg_1='name', **arg_2):
    """General aggregated list function for the GCE service."""
    arg_3 = []
    arg_4 = arg_0.aggregatedList(**arg_2)

    while arg_4 is not None:
        arg_5 = arg_4.execute()
        for arg_6, arg_7 in arg_5['items'].items():
            if arg_1 in arg_7:
                arg_3.extend(arg_7[arg_1])

        arg_4 = arg_0.aggregatedList_next(previous_request=arg_4,
                                          previous_response=arg_5)
    return arg_3

General aggregated list function for the GCE service .


def Func ( arg_0 , arg_1 ) : for arg_2 , arg_3 in enumerate ( arg_1 ) : if arg_3 [ "input" ] [ "process" ] != "__init__" : arg_3 [ "input" ] [ "process" ] = arg_0 [ arg_3 [ "input" ] [ "process" ] ] if arg_3 [ "output" ] [ "process" ] != "__init__" : arg_3 [ "output" ] [ "process" ] = arg_0 [ arg_3 [ "output" ] [ "process" ] ] return arg_1

def Func(arg_0, arg_1):
    """Removes unique identifiers and add the original process names to the
    already parsed pipelines

    Parameters
    ----------
    identifiers_to_tags : dict
        Match between unique process identifiers and process names
    pipeline_links: list
        Parsed pipeline list with unique identifiers

    Returns
    -------
    list
        Pipeline list with original identifiers
    """

    # Replaces the unique identifiers by the original process names
    for arg_2, arg_3 in enumerate(arg_1):
        if arg_3["input"]["process"] != "__init__":
            arg_3["input"]["process"] = arg_0[
                arg_3["input"]["process"]]
        if arg_3["output"]["process"] != "__init__":
            arg_3["output"]["process"] = arg_0[
                arg_3["output"]["process"]]

    return arg_1