def
Func
(
arg_0
)
:
with
arg_0
.
io_manager
.
with_stdout
(
)
as
fp
:
with
arg_0
.
client_manager
.
with_client
(
)
as
client
:
arg_1
=
[
]
client
.
auth
(
)
if
getattr
(
client
,
'auth_cache_path'
,
)
:
arg_1
.
append
(
(
'Auth Cache'
,
client
.
auth_cache_path
)
)
if
getattr
(
client
,
'auth_url'
,
)
:
arg_1
.
append
(
(
'Auth URL'
,
client
.
auth_url
)
)
if
getattr
(
client
,
'auth_user'
,
)
:
arg_1
.
append
(
(
'Auth User'
,
client
.
auth_user
)
)
if
getattr
(
client
,
'auth_key'
,
)
:
arg_1
.
append
(
(
'Auth Key'
,
client
.
auth_key
)
)
if
getattr
(
client
,
'auth_tenant'
,
)
:
arg_1
.
append
(
(
'Auth Tenant'
,
client
.
auth_tenant
)
)
if
getattr
(
client
,
'auth_methods'
,
)
:
arg_1
.
append
(
(
'Auth Methods'
,
client
.
auth_methods
)
)
if
getattr
(
client
,
'storage_path'
,
)
:
arg_1
.
append
(
(
'Direct Storage Path'
,
client
.
storage_path
)
)
if
getattr
(
client
,
'cdn_path'
,
)
:
arg_1
.
append
(
(
'Direct CDN Path'
,
client
.
cdn_path
)
)
if
getattr
(
client
,
'local_path'
,
)
:
arg_1
.
append
(
(
'Local Path'
,
client
.
local_path
)
)
if
getattr
(
client
,
'regions'
,
)
:
arg_1
.
append
(
(
'Regions'
,
' '
.
join
(
client
.
regions
)
)
)
if
getattr
(
client
,
'default_region'
,
)
:
arg_1
.
append
(
(
'Default Region'
,
client
.
default_region
)
)
if
getattr
(
client
,
'region'
,
)
:
arg_1
.
append
(
(
'Selected Region'
,
client
.
region
)
)
if
getattr
(
client
,
'snet'
,
)
:
arg_1
.
append
(
(
'SNet'
,
client
.
snet
)
)
if
getattr
(
client
,
'storage_url'
,
)
:
arg_1
.
append
(
(
'Storage URL'
,
client
.
storage_url
)
)
if
getattr
(
client
,
'cdn_url'
,
)
:
arg_1
.
append
(
(
'CDN URL'
,
client
.
cdn_url
)
)
if
getattr
(
client
,
'auth_token'
,
)
:
arg_1
.
append
(
(
'Auth Token'
,
client
.
auth_token
)
)
if
not
arg_1
:
arg_1
.
append
(
(
'No auth information available'
,
'Maybe no credentials were provided?'
)
)
arg_2
=
'%%-%ds %%s\n'
%
(
max
(
len
(
arg_3
)
for
arg_3
,
arg_4
in
arg_1
)
+
1
)
for
arg_3
,
arg_4
in
arg_1
:
fp
.
write
(
arg_2
%
(
arg_3
+
':'
,
arg_4
)
)
fp
.
flush
(
)

def Func(arg_0):
    """
    Authenticates and then outputs the resulting information.

    See :py:mod:`swiftly.cli.auth` for context usage information.

    See :py:class:`CLIAuth` for more information.
    """
    with arg_0.io_manager.with_stdout() as fp:
        with arg_0.client_manager.with_client() as client:
            arg_1 = []
            client.auth()
            if getattr(client, 'auth_cache_path', None):
                arg_1.append(('Auth Cache', client.auth_cache_path))
            if getattr(client, 'auth_url', None):
                arg_1.append(('Auth URL', client.auth_url))
            if getattr(client, 'auth_user', None):
                arg_1.append(('Auth User', client.auth_user))
            if getattr(client, 'auth_key', None):
                arg_1.append(('Auth Key', client.auth_key))
            if getattr(client, 'auth_tenant', None):
                arg_1.append(('Auth Tenant', client.auth_tenant))
            if getattr(client, 'auth_methods', None):
                arg_1.append(('Auth Methods', client.auth_methods))
            if getattr(client, 'storage_path', None):
                arg_1.append(('Direct Storage Path', client.storage_path))
            if getattr(client, 'cdn_path', None):
                arg_1.append(('Direct CDN Path', client.cdn_path))
            if getattr(client, 'local_path', None):
                arg_1.append(('Local Path', client.local_path))
            if getattr(client, 'regions', None):
                arg_1.append(('Regions', ' '.join(client.regions)))
            if getattr(client, 'default_region', None):
                arg_1.append(('Default Region', client.default_region))
            if getattr(client, 'region', None):
                arg_1.append(('Selected Region', client.region))
            if getattr(client, 'snet', None):
                arg_1.append(('SNet', client.snet))
            if getattr(client, 'storage_url', None):
                arg_1.append(('Storage URL', client.storage_url))
            if getattr(client, 'cdn_url', None):
                arg_1.append(('CDN URL', client.cdn_url))
            if getattr(client, 'auth_token', None):
                arg_1.append(('Auth Token', client.auth_token))
            if not arg_1:
                arg_1.append((
                    'No auth information available',
                    'Maybe no credentials were provided?'))
            arg_2 = '%%-%ds %%s\n' % (max(len(arg_3) for arg_3, arg_4 in arg_1) + 1)
            for arg_3, arg_4 in arg_1:
                fp.write(arg_2 % (arg_3 + ':', arg_4))
            fp.flush()

Authenticates and then outputs the resulting information .


def Func(arg_0, arg_1, arg_2, arg_3=0.5):
        """Drag the left mouse button without modifiers pressed.

        Parameters: coordinates to click on screen (tuple (x, y))
                    dest coordinates to drag to (tuple (x, y))
                    interval to send event of btn down, drag and up
        Returns: None
        """

        arg_4 = 0
        arg_0._queueMouseButton(arg_1, Quartz.kCGMouseButtonLeft, arg_4,
                               arg_2=arg_2)
        arg_0._postQueuedEvents(arg_3=arg_3)

Drag the left mouse button without modifiers pressed .


def Func ( arg_0 , arg_1 ) : arg_2 = Message ( to_jid = arg_0 . room_jid . bare ( ) , stanza_type = "groupchat" , arg_1 = arg_1 ) arg_0 . manager . stream . send ( arg_2 )

def Func(arg_0,arg_1):
        """
        Send a subject change request to the room.

        :Parameters:
            - `subject`: the new subject.
        :Types:
            - `subject`: `unicode`
        """
        arg_2=Message(to_jid=arg_0.room_jid.bare(),stanza_type="groupchat",arg_1=arg_1)
        arg_0.manager.stream.send(arg_2)

Send a subject change request to the room .


def
Func
(
)
:
arg_0
=
[
10
,
30
,
90
,
110
,
184
]
arg_1
=
250
arg_2
=
400
arg_3
=
100042
arg_4
=
[
'single'
,
'random'
]
arg_5
=
os
.
path
.
join
(
os
.
getcwd
(
)
,
'experiments'
,
'ca_patterns_original'
)
if
not
os
.
path
.
isdir
(
arg_5
)
:
os
.
makedirs
(
arg_5
)
arg_6
=
os
.
path
.
join
(
arg_5
,
'all_patterns.p'
)
print
(
'Computing all patterns'
)
arg_7
=
[
]
for
arg_8
,
arg_9
in
enumerate
(
arg_0
)
:
for
arg_10
in
arg_4
:
arg_11
=
make_initial_state
(
arg_10
,
arg_2
,
arg_3
=
arg_3
)
arg_12
=
cellular_automaton_1D
(
arg_11
,
arg_9
,
arg_1
)
arg_7
.
append
(
(
arg_9
,
arg_10
,
arg_12
)
)
progressbar
(
arg_8
,
len
(
arg_0
)
,
reprint
=
True
)
with
open
(
arg_6
,
'wb'
)
as
file
:
pickle
.
dump
(
arg_7
,
file
=
file
)
print
(
'Plotting all patterns'
)
for
arg_8
,
arg_13
in
enumerate
(
arg_7
)
:
arg_9
,
arg_10
,
arg_12
=
arg_13
arg_6
=
os
.
path
.
join
(
arg_5
,
'rule_%s_%s.png'
%
(
str
(
arg_9
)
,
arg_10
)
)
plot_pattern
(
arg_12
,
arg_9
,
arg_6
)
progressbar
(
arg_8
,
len
(
arg_7
)
,
reprint
=
True
)

def Func():
    """ Main simulation function """
    arg_0 = [10, 30, 90, 110, 184]  # rules we want to explore:
    arg_1 = 250  # cell iterations
    arg_2 = 400  # number of cells
    arg_3 = 100042  # RNG seed
    arg_4 = ['single', 'random']  # Initial states we want to explore

    # create a folder for the plots and the data
    arg_5 = os.path.join(os.getcwd(), 'experiments', 'ca_patterns_original')
    if not os.path.isdir(arg_5):
        os.makedirs(arg_5)
    arg_6 = os.path.join(arg_5, 'all_patterns.p')

    print('Computing all patterns')
    arg_7 = []  # list containing the simulation results
    for arg_8, arg_9 in enumerate(arg_0):
        # iterate over all rules
        for arg_10 in arg_4:
            # iterate over the initial states

            # make the initial state
            arg_11 = make_initial_state(arg_10, arg_2, arg_3=arg_3)
            # simulate the automaton
            arg_12 = cellular_automaton_1D(arg_11, arg_9, arg_1)
            # keep the resulting pattern
            arg_7.append((arg_9, arg_10, arg_12))

        # Print a progressbar, because I am always impatient
        #  (ok that's already from pypet, but it's really handy!)
        progressbar(arg_8, len(arg_0), reprint=True)

    # Store all patterns to disk
    with open(arg_6, 'wb') as file:
        pickle.dump(arg_7, file=file)

    # Finally print all patterns
    print('Plotting all patterns')
    for arg_8, arg_13 in enumerate(arg_7):
        arg_9, arg_10, arg_12 = arg_13
        # Plot the pattern
        arg_6 = os.path.join(arg_5, 'rule_%s_%s.png' % (str(arg_9), arg_10))
        plot_pattern(arg_12, arg_9, arg_6)
        progressbar(arg_8, len(arg_7), reprint=True)


def Func ( arg_0 ) : if arg_0 . _Func : return arg_0 . _Func if arg_0 . asc else "-{0}" . format ( arg_0 . _Func ) return None

def Func(arg_0):
        """Get column which is being order by."""
        if arg_0._Func:
            return arg_0._Func if arg_0.asc else \
                "-{0}".format(arg_0._Func)
        return None


return extra + (head,) if head else extra

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> arg_1 : arg_3 = arg_1 ( filter ( lambda x : x not in arg_0 , arg_2 ) ) arg_4 = reduce ( lambda x , y : y if y in arg_0 else x , arg_2 , None ) return arg_3 + ( arg_4 , ) if arg_4 else arg_3

def Func(arg_0: arg_1, arg_2: arg_1) -> arg_1:
    '''Squash and reduce the input stack.
    Removes the elements of input that match predicate and only keeps the last
    match at the end of the stack.
    '''
    arg_3 = arg_1(filter(lambda x: x not in arg_0, arg_2))
    arg_4 = reduce(lambda x, y: y if y in arg_0 else x, arg_2, None)
    return arg_3 + (arg_4,) if arg_4 else arg_3

Squash and reduce the input stack . Removes the elements of input that match predicate and only keeps the last match at the end of the stack .


def Func ( arg_0 ) : arg_0 . blueprint . add_url_rule ( "{0}.secondary/<filetype>/<asset>" . format ( arg_0 . static_url_path ) , view_func = arg_0 . r_assets , endpoint = "secondary_assets" , methods = [ "GET" ] )

def Func(arg_0):
        """ Merge and register assets, both as routes and dictionary

        :return: None
        """
        arg_0.blueprint.add_url_rule(
            # Register another path to ensure assets compatibility
            "{0}.secondary/<filetype>/<asset>".format(arg_0.static_url_path),
            view_func=arg_0.r_assets,
            endpoint="secondary_assets",
            methods=["GET"]
        )

Merge and register assets both as routes and dictionary


def Func ( arg_0 , * arg_1 ) : arg_0 . Press ( ) time . sleep ( .5 ) return arg_0 . _menuItem ( arg_0 , * arg_1 )

def Func(arg_0, *arg_1):
        """Return the specified item in a pop up menu."""
        arg_0.Press()
        time.sleep(.5)
        return arg_0._menuItem(arg_0, *arg_1)

Return the specified item in a pop up menu .


def Func ( arg_0 , arg_1 ) : ( arg_2 , arg_3 ) = ZoneModel . objects . get_or_create ( zone_id = arg_0 . id ) arg_2 . widget_id = arg_1 [ 'widget' ] arg_2 . data = arg_1 [ 'data' ] for arg_6 in list ( arg_2 . data . keys ( ) ) : if isinstance ( arg_2 . data [ arg_6 ] , dict ) and ( 'id' in arg_2 . data [ arg_6 ] . keys ( ) ) and ( 'data' in arg_2 . data [ arg_6 ] . keys ( ) ) : arg_2 . data [ arg_6 ] [ 'data' ] = arg_0 . before_Func ( arg_2 . data [ arg_6 ] [ 'id' ] , arg_2 . data [ arg_6 ] [ 'data' ] ) arg_2 . data = arg_0 . before_Func ( arg_2 . widget_id , arg_2 . data ) return arg_2 . Func ( )

def Func(arg_0, arg_1):
        """Save widget data for this zone."""

        (arg_2, arg_3) = ZoneModel.objects.get_or_create(zone_id=arg_0.id)

        arg_2.widget_id = arg_1['widget']
        arg_2.data = arg_1['data']

        # Call widget before-Func hook on nested widgets
        for arg_6 in list(arg_2.data.keys()):
            if isinstance(arg_2.data[arg_6], dict) and ('id' in arg_2.data[arg_6].keys()) and ('data' in arg_2.data[arg_6].keys()):
                arg_2.data[arg_6]['data'] = arg_0.before_Func(arg_2.data[arg_6]['id'], arg_2.data[arg_6]['data'])

        # Call widget before-Func hook
        arg_2.data = arg_0.before_Func(arg_2.widget_id, arg_2.data)

        return arg_2.Func()


def Func ( arg_0 = None ) : if arg_0 is None : arg_0 = admin . site if 'manage' not in sys . argv [ 0 ] or ( len ( sys . argv ) > 1 and sys . argv [ 1 ] in MANAGE_SAFE_COMMANDS ) : import_prefs ( ) Preference . read_prefs ( get_prefs ( ) ) register_admin_models ( arg_0 )

def Func(arg_0=None):
    """Automatically discovers and registers all preferences available in all apps.

    :param admin.AdminSite admin_site: Custom AdminSite object.

    """
    if arg_0 is None:
        arg_0 = admin.site

    # Do not discover anything if called from manage.py (e.g. executing commands from cli).
    if 'manage' not in sys.argv[0] or (len(sys.argv) > 1 and sys.argv[1] in MANAGE_SAFE_COMMANDS):
        import_prefs()
        Preference.read_prefs(get_prefs())
        register_admin_models(arg_0)

Automatically discovers and registers all preferences available in all apps .


def Func(arg_0):
        """
        Verify that the value of the LongInteger is valid.

        Raises:
            TypeError: if the value is not of type int or long
            ValueError: if the value cannot be represented by a signed 64-bit
                integer
        """
        if arg_0.value is not None:
            if not isinstance(arg_0.value, six.integer_types):
                raise TypeError('expected (one of): {0}, observed: {1}'.format(
                    six.integer_types, type(arg_0.value)))
            else:
                if arg_0.value > LongInteger.MAX:
                    raise ValueError(
                        'long integer value greater than accepted max')
                elif arg_0.value < LongInteger.MIN:
                    raise ValueError(
                        'long integer value less than accepted min')

Verify that the value of the LongInteger is valid .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
assert
isinstance
(
arg_1
,
string_types
)
assert
isinstance
(
arg_2
,
int
)
arg_3
=
AsyncConn
(
arg_1
,
arg_2
,
**
arg_0
.
conn_kwargs
)
arg_3
.
on
(
'identify'
,
arg_0
.
_on_connection_identify
)
arg_3
.
on
(
'identify_response'
,
arg_0
.
_on_connection_identify_response
)
arg_3
.
on
(
'auth'
,
arg_0
.
_on_connection_auth
)
arg_3
.
on
(
'auth_response'
,
arg_0
.
_on_connection_auth_response
)
arg_3
.
on
(
'error'
,
arg_0
.
_on_connection_error
)
arg_3
.
on
(
'close'
,
arg_0
.
_on_connection_close
)
arg_3
.
on
(
'ready'
,
arg_0
.
_on_connection_ready
)
arg_3
.
on
(
'message'
,
arg_0
.
_on_message
)
arg_3
.
on
(
'heartbeat'
,
arg_0
.
_on_heartbeat
)
arg_3
.
on
(
'backoff'
,
functools
.
partial
(
arg_0
.
_on_backoff_resume
,
success
=
False
)
)
arg_3
.
on
(
'resume'
,
functools
.
partial
(
arg_0
.
_on_backoff_resume
,
success
=
True
)
)
arg_3
.
on
(
'continue'
,
functools
.
partial
(
arg_0
.
_on_backoff_resume
,
success
=
)
)
if
arg_3
.
id
in
arg_0
.
conns
:
return
arg_4
=
time
.
time
(
)
arg_5
=
arg_0
.
connection_attempts
.
get
(
arg_3
.
id
)
if
arg_5
and
arg_5
>
arg_4
10
:
return
arg_0
.
connection_attempts
[
arg_3
.
id
]
=
arg_4
logger
.
info
(
'[%s:%s] connecting to nsqd'
,
arg_3
.
id
,
arg_0
.
name
)
arg_3
.
connect
(
)
return
arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Adds a connection to ``nsqd`` at the specified address.

        :param host: the address to connect to
        :param port: the port to connect to
        """
        assert isinstance(arg_1, string_types)
        assert isinstance(arg_2, int)

        arg_3 = AsyncConn(arg_1, arg_2, **arg_0.conn_kwargs)
        arg_3.on('identify', arg_0._on_connection_identify)
        arg_3.on('identify_response', arg_0._on_connection_identify_response)
        arg_3.on('auth', arg_0._on_connection_auth)
        arg_3.on('auth_response', arg_0._on_connection_auth_response)
        arg_3.on('error', arg_0._on_connection_error)
        arg_3.on('close', arg_0._on_connection_close)
        arg_3.on('ready', arg_0._on_connection_ready)
        arg_3.on('message', arg_0._on_message)
        arg_3.on('heartbeat', arg_0._on_heartbeat)
        arg_3.on('backoff', functools.partial(arg_0._on_backoff_resume, success=False))
        arg_3.on('resume', functools.partial(arg_0._on_backoff_resume, success=True))
        arg_3.on('continue', functools.partial(arg_0._on_backoff_resume, success=None))

        if arg_3.id in arg_0.conns:
            return

        # only attempt to re-connect once every 10s per destination
        # this throttles reconnects to failed endpoints
        arg_4 = time.time()
        arg_5 = arg_0.connection_attempts.get(arg_3.id)
        if arg_5 and arg_5 > arg_4 - 10:
            return
        arg_0.connection_attempts[arg_3.id] = arg_4

        logger.info('[%s:%s] connecting to nsqd', arg_3.id, arg_0.name)
        arg_3.connect()

        return arg_3

Adds a connection to nsqd at the specified address .


def Func(arg_0):
    """Returns what the next and prev querystrings should be."""
    if arg_0 == 0:
        arg_1 = arg_2 = 1
    elif arg_0 > 0:
        arg_1 = arg_0 + 1
        arg_2 = -(arg_0 - 1)
    else:
        arg_1 = arg_0 + 1
        arg_2 = abs(arg_0) + 1
    return arg_1, arg_2

Returns what the next and prev querystrings should be .


def Func(arg_0):
        """Creates a dummy object containing the whole tree to make unfolding easier.

        This method is only useful for debugging purposes.
        If you use an IDE and want to unfold the trajectory tree, you always need to
        open the private attribute `_children`. Use to this function to create a new
        object that contains the tree structure in its attributes.

        Manipulating the returned object does not change the original tree!

        """

        class Bunch(object):
            """Dummy container class"""
            pass

        arg_1 = Bunch()

        if not arg_0.v_annotations.f_is_empty():
            arg_1.v_annotations = arg_0.v_annotations
        if not arg_0.v_comment == '':
            arg_1.v_comment = arg_0.v_comment

        for arg_4 in arg_0._leaves:
            arg_5 = arg_0._leaves[arg_4]
            setattr(arg_1, arg_4, arg_5)

        for arg_6 in arg_0._links:
            arg_7 = arg_0._links[arg_6]
            setattr(arg_1, arg_6, 'Link to `%s`' % arg_7.v_full_name)

        for arg_8 in arg_0._groups:
            arg_9 = arg_0._groups[arg_8]
            setattr(arg_1, arg_8, arg_9.Func())

        return arg_1

Creates a dummy object containing the whole tree to make unfolding easier .


def Func(arg_0, arg_1, arg_2):
        """Configure which kinds of exceptions trigger plugin.
        """
        arg_0.conf = arg_2
        arg_0.enabled = arg_1.debugErrors or arg_1.debugFailures
        arg_0.enabled_for_errors = arg_1.debugErrors
        arg_0.enabled_for_failures = arg_1.debugFailures

Configure which kinds of exceptions trigger plugin .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = float ( arg_2 ) arg_4 = time . time ( ) + arg_3 heappush ( arg_0 . timer_tasks , ( arg_4 , arg_1 ) )

def Func(arg_0, arg_1, arg_2):
    """Registers a new timer task

    :param task: function to be run at a specified second from now
    :param second: how many seconds to wait before the timer is triggered
    """
    # Python time is in float
    arg_3 = float(arg_2)
    arg_4 = time.time() + arg_3
    heappush(arg_0.timer_tasks, (arg_4, arg_1))


return obj, _bind_args(obj, args, kwargs)

def Func ( arg_0 , arg_1 , arg_2 ) : if arg_1 is None and arg_2 is None : return ( arg_0 , ) if arg_2 is None : arg_2 = { } return arg_0 , _bind_args ( arg_0 , arg_1 , arg_2 )

def Func(arg_0, arg_1, arg_2):
    """Create a node from arguments and return it"""

    if arg_1 is None and arg_2 is None:
        return (arg_0,)

    if arg_2 is None:
        arg_2 = {}
    return arg_0, _bind_args(arg_0, arg_1, arg_2)


def Func ( arg_0 , arg_1 ) : if arg_1 . name not in arg_0 . available_events : return arg_2 = json . dumps ( { 'messageType' : 'event' , 'data' : arg_1 . as_event_description ( ) , } ) for arg_3 in arg_0 . available_events [ arg_1 . name ] [ 'subscribers' ] : try : arg_3 . write_message ( arg_2 ) except tornado . websocket . WebSocketClosedError : pass

def Func(arg_0, arg_1):
        """
        Notify all subscribers of an event.

        event -- the event that occurred
        """
        if arg_1.name not in arg_0.available_events:
            return

        arg_2 = json.dumps({
            'messageType': 'event',
            'data': arg_1.as_event_description(),
        })

        for arg_3 in arg_0.available_events[arg_1.name]['subscribers']:
            try:
                arg_3.write_message(arg_2)
            except tornado.websocket.WebSocketClosedError:
                pass


def Func ( arg_0 ) : if 'reviewed' not in arg_0 . currentproject : arg_0 . currentproject [ 'reviewed' ] = { } arg_0 . write ( arg_0 . currentproject )

def Func(arg_0):
        '''
        This handles GET requests for the current checkplot-list.json file.

        Used with AJAX from frontend.

        '''

        # add the reviewed key to the current dict if it doesn't exist
        # this will hold all the reviewed objects for the frontend
        if 'reviewed' not in arg_0.currentproject:
            arg_0.currentproject['reviewed'] = {}

        # just returns the current project as JSON
        arg_0.write(arg_0.currentproject)

This handles GET requests for the current checkplot - list . json file .


def Func(arg_0):
    """
    Create a palette from a list of values

    Parameters
    ----------
    values : sequence
        Values that will be returned by the palette function.

    Returns
    -------
    out : function
        A function palette that takes a single
        :class:`int` parameter ``n`` and returns ``n`` values.

    Examples
    --------
    >>> palette = Func(['a', 'b', 'c', 'd', 'e'])
    >>> palette(3)
    ['a', 'b', 'c']
    """
    arg_1 = len(arg_0)

    def _Func(arg_2):
        if arg_2 > arg_1:
            arg_3 = ("Palette can return a maximum of {} values. "
                   "{} were requested from it.")
            warnings.warn(arg_3.format(arg_1, arg_2))

        return arg_0[:arg_2]

    return _Func

Create a palette from a list of values

    Parameters
    ----------
    values : sequence
        Values that will be returned by the palette function.

    Returns
    -------
    out : function
        A function palette that takes a single
        :class:`int` parameter ``n`` and returns ``n`` values.

    Examples
    --------
    >>> palette = manual_pal(['a', 'b', 'c', 'd', 'e'])
    >>> palette(3)
    ['a', 'b', 'c']


DEPRECATED - please use `compute_cumsum` instead

(df, new_column: str, column: str, index: list, date_column: str, date_format: str)

def
Func
(
arg_0
,
arg_1
:
arg_2
,
arg_3
:
arg_2
,
arg_4
:
arg_5
,
arg_6
:
arg_2
,
arg_7
:
arg_2
)
:
logging
.
getLogger
(
__name__
)
.
warning
(
f"DEPRECATED: use compute_Func"
)
arg_8
=
'__date_temp__'
if
isinstance
(
arg_4
,
arg_2
)
:
arg_4
=
[
arg_4
]
arg_9
=
arg_5
(
range
(
0
,
len
(
arg_4
)
)
)
arg_0
[
arg_8
]
=
pd
.
to_datetime
(
arg_0
[
arg_6
]
,
format
=
arg_7
)
arg_10
=
[
arg_8
,
arg_6
]
arg_0
=
arg_0
.
groupby
(
arg_4
+
arg_10
)
.
sum
(
)
arg_0
[
arg_1
]
=
arg_0
.
groupby
(
level
=
arg_9
)
[
arg_3
]
.
Func
(
)
arg_0
.
reset_index
(
inplace
=
True
)
del
arg_0
[
arg_8
]
return
arg_0

def Func(arg_0, arg_1: arg_2, arg_3: arg_2, arg_4: arg_5, arg_6: arg_2, arg_7: arg_2):
    """
    DEPRECATED - please use `compute_Func` instead
    """
    logging.getLogger(__name__).warning(f"DEPRECATED: use compute_Func")
    arg_8 = '__date_temp__'
    if isinstance(arg_4, arg_2):
        arg_4 = [arg_4]
    arg_9 = arg_5(range(0, len(arg_4)))
    arg_0[arg_8] = pd.to_datetime(arg_0[arg_6], format=arg_7)
    arg_10 = [arg_8, arg_6]
    arg_0 = arg_0.groupby(arg_4 + arg_10).sum()
    arg_0[arg_1] = arg_0.groupby(level=arg_9)[arg_3].Func()
    arg_0.reset_index(inplace=True)
    del arg_0[arg_8]

    return arg_0

DEPRECATED - please use compute_cumsum instead


(
                            self,
            available_components = None,
                     search_dirs = None,
                update_installed = False,
                  traverse_links = False,
                          target = None,
                            test = False
        )

return self.__getDependenciesRecursiveWithProvider(
           available_components = available_components,
                    search_dirs = search_dirs,
                         target = target,
                 traverse_links = traverse_links,
               update_installed = update_installed,
                       provider = provider,
                           test = test
        )

def Func(
                            arg_0,
            arg_1 = None,
                     arg_2 = None,
                arg_3 = False,
                  arg_4 = False,
                          arg_5 = None,
                            arg_6 = False
        ):
        ''' Retrieve and install all the dependencies of this component and its
            dependencies, recursively, or satisfy them from a collection of
            available_components or from disk.

            Returns
            =======
                (components, errors)

                components: dictionary of name:Component
                errors: sequence of errors

            Parameters
            ==========

                available_components:
                    None (default) or a dictionary of name:component. This is
                    searched before searching directories or fetching remote
                    components

                search_dirs:
                    None (default), or sequence of directories to search for
                    already installed, (but not yet loaded) components. Used so
                    that manually installed or linked components higher up the
                    dependency tree are found by their users lower down.

                    These directories are searched in order, and finally the
                    current directory is checked.

                update_installed:
                    False (default), True, or set(): whether to check the
                    available versions of installed components, and update if a
                    newer version is available. If this is a set(), only update
                    things in the specified set.

                traverse_links:
                    False (default) or True: whether to recurse into linked
                    dependencies when updating/installing.

                target:
                    None (default), or a Target object. If specified the target
                    name and it's similarTo list will be used in resolving
                    dependencies. If None, then only target-independent
                    dependencies will be installed

                test:
                    True, False, or 'toplevel: should test-only dependencies be
                    installed? (yes, no, or only for this module, not its
                    dependencies).

        '''
        def provider(
            arg_7,
            arg_1,
            arg_2,
            arg_8,
            arg_3,
            arg_9=None
        ):
            arg_10 = access.satisfyFromAvailable(arg_7.name, arg_1)
            if arg_10:
                if arg_10.isTestDependency() and not arg_7.is_test_dependency:
                    logger.debug('test dependency subsequently occurred as real dependency: %s', arg_10.getName())
                    arg_10.setTestDependency(False)
                return arg_10
            arg_11 = False
            if arg_3 is True:
                arg_11 = True
            elif arg_3:
                arg_11 = arg_7.name in arg_3
            arg_10 = access.satisfyVersionFromSearchPaths(
                arg_7.name,
                arg_7.versionReq(),
                arg_2,
                arg_11,
                inherit_shrinkwrap = arg_9.getShrinkwrap()
            )
            if arg_10:
                arg_10.setTestDependency(arg_7.is_test_dependency)
                return arg_10
            # before resorting to install this module, check if we have an
            # existing linked module (which wasn't picked up because it didn't
            # match the version specification) - if we do, then we shouldn't
            # try to install, but should return that anyway:
            arg_12 = os.path.join(arg_0.modulesPath(), arg_7.name)
            if fsutils.isLink(arg_12):
                arg_10 = Component(
                                       arg_12,
                     test_dependency = arg_7.is_test_dependency,
                    installed_linked = fsutils.isLink(arg_12),
                  inherit_shrinkwrap = arg_9.getShrinkwrap()
                )
                if arg_10:
                    assert(arg_10.installedLinked())
                    return arg_10
                else:
                    logger.error('linked module %s is invalid: %s', arg_7.name, arg_10.getError())
                    return arg_10

            arg_10 = access.satisfyVersionByInstalling(
                arg_7.name,
                arg_7.versionReq(),
                arg_0.modulesPath(),
                inherit_shrinkwrap = arg_9.getShrinkwrap()
            )
            if not arg_10:
                logger.error('could not install %s' % arg_7.name)
            if arg_10 is not None:
                arg_10.setTestDependency(arg_7.is_test_dependency)
            return arg_10

        return arg_0.__getDependenciesRecursiveWithProvider(
           arg_1 = arg_1,
                    arg_2 = arg_2,
                         arg_5 = arg_5,
                 arg_4 = arg_4,
               arg_3 = arg_3,
                       provider = provider,
                           arg_6 = arg_6
        )

Retrieve and install all the dependencies of this component and its dependencies recursively or satisfy them from a collection of available_components or from disk .


def Func ( arg_0 ) : arg_1 = { } for arg_2 , arg_3 in arg_0 . options : arg_1 . setdefault ( arg_3 . get ( "group" ) , [ ] ) . append ( ( arg_2 , arg_3 , arg_0 . option_value ( arg_2 ) ) ) if None in arg_1 : yield None , arg_1 . pop ( None ) for arg_4 , arg_5 in sorted ( arg_1 . items ( ) ) : yield arg_4 . upper ( ) , arg_5

def Func(arg_0):
        """return an iterator on options grouped by section

        (section, [list of (optname, optdict, optvalue)])
        """
        arg_1 = {}
        for arg_2, arg_3 in arg_0.options:
            arg_1.setdefault(arg_3.get("group"), []).append(
                (arg_2, arg_3, arg_0.option_value(arg_2))
            )
        if None in arg_1:
            yield None, arg_1.pop(None)
        for arg_4, arg_5 in sorted(arg_1.items()):
            yield arg_4.upper(), arg_5


Return a dictionary of settings loaded from etcd.

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
)
:
arg_1
=
arg_1
or
arg_0
.
prefix
arg_1
=
'/'
+
arg_1
.
strip
(
'/'
)
+
'/'
if
arg_2
is
:
arg_2
=
arg_0
.
inherit_depth
if
not
arg_0
.
configured
:
log
.
debug
(
"etcd not available"
)
return
if
arg_0
.
watching
:
log
.
info
(
"Starting watcher for %r"
,
arg_1
)
arg_0
.
start_watching
(
)
log
.
info
(
"Loading from etcd %r"
,
arg_1
)
try
:
arg_3
=
arg_0
.
client
.
get
(
arg_1
)
except
arg_0
.
module
.
EtcdKeyNotFound
:
arg_3
=
if
not
arg_3
:
log
.
info
(
"No configuration found"
)
return
{
}
arg_4
=
{
}
for
arg_5
in
arg_3
.
children
:
arg_6
=
arg_5
.
key
arg_7
=
arg_5
.
value
try
:
arg_7
=
pytool
.
json
.
from_json
(
arg_7
)
except
:
pass
if
not
arg_0
.
case_sensitive
:
arg_6
=
arg_6
.
lower
(
)
if
arg_6
.
startswith
(
arg_1
)
:
arg_6
=
arg_6
[
len
(
arg_1
)
:
]
arg_4
[
arg_6
]
=
arg_7
arg_8
=
Config
(
)
.
settings
.
get
(
arg_0
.
inherit_key
,
arg_4
.
get
(
arg_0
.
inherit_key
,
)
)
if
arg_2
>
0
and
arg_8
:
log
.
info
(
"    ... inheriting ..."
)
arg_8
=
arg_0
.
Func
(
arg_8
,
arg_2
1
)
or
{
}
arg_8
.
update
(
arg_4
)
arg_4
=
arg_8
return
arg_4

def Func(arg_0, arg_1=None, arg_2=None):
        """
        Return a dictionary of settings Funced from etcd.

        """
        arg_1 = arg_1 or arg_0.prefix
        arg_1 = '/' + arg_1.strip('/') + '/'
        if arg_2 is None:
            arg_2 = arg_0.inherit_depth

        if not arg_0.configured:
            log.debug("etcd not available")
            return

        if arg_0.watching:
            log.info("Starting watcher for %r", arg_1)
            arg_0.start_watching()

        log.info("Loading from etcd %r", arg_1)
        try:
            arg_3 = arg_0.client.get(arg_1)
        except arg_0.module.EtcdKeyNotFound:
            arg_3 = None
        if not arg_3:
            log.info("No configuration found")
            return {}

        # Iterate over the returned keys from etcd
        arg_4 = {}
        for arg_5 in arg_3.children:
            arg_6 = arg_5.key
            arg_7 = arg_5.value
            # Try to parse them as JSON strings, just in case it works
            try:
                arg_7 = pytool.json.from_json(arg_7)
            except:
                pass

            # Make the key lower-case if we're not case-sensitive
            if not arg_0.case_sensitive:
                arg_6 = arg_6.lower()

            # Strip off the prefix that we're using
            if arg_6.startswith(arg_1):
                arg_6 = arg_6[len(arg_1):]

            # Store the key/value to update the config
            arg_4[arg_6] = arg_7

        # Access cached settings directly to avoid recursion
        arg_8 = Config().settings.get(arg_0.inherit_key,
                arg_4.get(arg_0.inherit_key, None))
        if arg_2 > 0 and arg_8:
            log.info("    ... inheriting ...")
            arg_8 = arg_0.Func(arg_8, arg_2 - 1) or {}
            arg_8.update(arg_4)
            arg_4 = arg_8

        return arg_4

Return a dictionary of settings loaded from etcd .


def Func(arg_0, arg_1):
        """Sets the exception on the future."""
        if not arg_0.done():
            raise TransferNotDoneError(
                'Func can only be called once the transfer is '
                'complete.')
        arg_0._coordinator.Func(arg_1, override=True)


def Func ( arg_0 , arg_1 ) : with temp_alembic_ini ( ALEMBIC_DIR_LOCATION , arg_0 ) as alembic_ini : subprocess . check_call ( [ 'alembic' , '-c' , alembic_ini , 'Func' , arg_1 ] )

def Func(arg_0, arg_1):
    """
    Upgrade the given database to revision.
    """
    with temp_alembic_ini(ALEMBIC_DIR_LOCATION, arg_0) as alembic_ini:
        subprocess.check_call(
            ['alembic', '-c', alembic_ini, 'Func', arg_1]
        )

Upgrade the given database to revision .


def Func ( arg_0 , arg_1 ) : if arg_0 . shell . logger . Func : arg_0 . shell . logger . log_write ( arg_1 [ 'text/plain' ] , 'output' ) arg_0 . shell . history_manager . output_hist_reprs [ arg_0 . prompt_count ] = arg_1 [ 'text/plain' ]

def Func(arg_0, arg_1):
        """Log the output."""
        if arg_0.shell.logger.Func:
            arg_0.shell.logger.log_write(arg_1['text/plain'], 'output')
        arg_0.shell.history_manager.output_hist_reprs[arg_0.prompt_count] = \
                                                    arg_1['text/plain']


def Func ( arg_0 ) : arg_1 = smtplib . SMTP ( arg_0 . server , arg_0 . port ) arg_1 . ehlo ( ) arg_1 . starttls ( context = ssl . create_default_context ( ) ) arg_1 . ehlo ( ) return arg_1

def Func(arg_0):
        """Get an SMTP session with TLS."""
        arg_1 = smtplib.SMTP(arg_0.server, arg_0.port)
        arg_1.ehlo()
        arg_1.starttls(context=ssl.create_default_context())
        arg_1.ehlo()
        return arg_1


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in list ( arg_0 . items ( ) ) : if isinstance ( arg_4 , Attrib ) or isinstance ( arg_4 , PathAttrib ) : arg_2 [ arg_3 ] = valueof ( arg_1 , arg_4 ) else : arg_2 [ arg_3 ] = arg_4 return arg_2

def Func(arg_0, arg_1):
    """Parses kwargs and evaluates any Attrib entries"""
    arg_2 = {}
    for arg_3, arg_4 in list(arg_0.items()):
        if isinstance(arg_4, Attrib) or isinstance(arg_4, PathAttrib):
            arg_2[arg_3] = valueof(arg_1, arg_4)
        else:
            arg_2[arg_3] = arg_4
    return arg_2


def Func ( arg_0 ) : try : arg_1 , arg_2 , arg_2 , arg_2 , arg_2 = arg_0 . _callstack [ 0 ] if arg_1 . result is not None : return None assert arg_1 . depth == 0 return arg_1 except IndexError : return None

def Func(arg_0):
        """Current ongoing human transaction"""
        try:
            arg_1, arg_2, arg_2, arg_2, arg_2 = arg_0._callstack[0]
            if arg_1.result is not None:
                #That tx finished. No current tx.
                return None
            assert arg_1.depth == 0
            return arg_1
        except IndexError:
            return None


def Func ( arg_0 , arg_1 , arg_2 , arg_3 = { } ) : arg_4 = http . cookies . SimpleCookie ( ) arg_4 [ arg_1 ] = arg_2 for arg_5 , arg_2 in arg_3 . items ( ) : arg_4 [ arg_1 ] [ arg_5 ] = arg_2 arg_0 . add_header ( 'Set-Cookie' , arg_4 [ arg_1 ] . OutputString ( ) )

def Func(arg_0, arg_1, arg_2, arg_3={}):
        """Add a Set-Cookie header to response object.

        For a description about cookie attribute values, see
        https://docs.python.org/3/library/http.cookies.html#http.cookies.Morsel.

        Arguments:
          name (str): Name of the cookie
          value (str): Value of the cookie
          attrs (dict): Dicitionary with cookie attribute keys and
                        values.
        """
        arg_4 = http.cookies.SimpleCookie()
        arg_4[arg_1] = arg_2
        for arg_5, arg_2 in arg_3.items():
            arg_4[arg_1][arg_5] = arg_2
        arg_0.add_header('Set-Cookie', arg_4[arg_1].OutputString())

Add a Set - Cookie header to response object .


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . fetch_json ( uri_path = '/boards' , http_method = 'POST' , arg_1 = arg_1 or { } ) return arg_0 . create_board ( arg_2 )

def Func(arg_0, arg_1=None):
        '''
        Create a new board. name is required in query_params. Returns a Board
        object.

        Returns:
            Board: Returns the created board
        '''
        arg_2 = arg_0.fetch_json(
            uri_path='/boards',
            http_method='POST',
            arg_1=arg_1 or {}
        )
        return arg_0.create_board(arg_2)

Create a new board . name is required in query_params . Returns a Board object .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
children
:
if
arg_1
.
type
==
token
.
INDENT
:
arg_2
=
arg_1
.
prefix
.
lstrip
(
)
if
arg_2
.
startswith
(
'# type: '
)
:
arg_1
.
prefix
=
'\n'
.
join
(
arg_2
.
split
(
'\n'
)
[
1
:
]
)
break

def Func(arg_0):
    """Removes the legacy signature type comment, leaving other comments if any."""
    for arg_1 in arg_0.children:
        if arg_1.type == token.INDENT:
            arg_2 = arg_1.prefix.lstrip()
            if arg_2.startswith('# type: '):
                arg_1.prefix = '\n'.join(arg_2.split('\n')[1:])
            break

Removes the legacy signature type comment leaving other comments if any .


def Func ( arg_0 ) : def xpath_findall ( arg_1 ) : validate ( ET . iselement , arg_1 ) return arg_1 . findall ( arg_0 ) return transform ( xpath_findall )

def Func(arg_0):
    """Find a list of XML elements via xpath."""
    def xpath_findall(arg_1):
        validate(ET.iselement, arg_1)
        return arg_1.findall(arg_0)

    return transform(xpath_findall)


def Func ( arg_0 ) : if getattr ( arg_1 , "Funcr" , None ) is None : arg_1 . Funcr = XMPPSerializer ( "jabber:client" ) arg_1 . Funcr . emit_head ( None , None ) return arg_1 . Funcr . emit_stanza ( arg_0 )

def Func(arg_0):
    """Serialize an XMPP element.

    Utility function for debugging or logging.

        :Parameters:
            - `element`: the element to Func
        :Types:
            - `element`: :etree:`ElementTree.Element`

        :Return: Funcd element
        :Returntype: `unicode`
    """
    if getattr(arg_1, "Funcr", None) is None:
        arg_1.Funcr = XMPPSerializer("jabber:client")
        arg_1.Funcr.emit_head(None, None)
    return arg_1.Funcr.emit_stanza(arg_0)

Serialize an XMPP element.

    Utility function for debugging or logging.

        :Parameters:
            - `element`: the element to serialize
        :Types:
            - `element`: :etree:`ElementTree.Element`

        :Return: serialized element
        :Returntype: `unicode`


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
""
arg_2
+=
"
%s
"
%
(
arg_1
)
arg_2
+=
pprint
.
pformat
(
arg_0
,
indent
=
1
)
arg_2
=
arg_2
.
replace
(
"\n"
,
'
'
)
.
replace
(
" "
,
" "
)
arg_2
=
arg_2
.
replace
(
r"\x00"
,
""
)
arg_2
+=
""
print
(
"saving header file:"
,
arg_1
)
arg_3
=
open
(
arg_1
,
'w'
)
arg_3
.
write
(
arg_2
)
arg_3
.
close
(
)
webbrowser
.
open
(
arg_1
)

def Func(arg_0,arg_1):
        """given the bytestring ABF header, make and launch HTML."""
        arg_2=""
        arg_2+="
%s
"%(arg_1)
        arg_2+=pprint.pformat(arg_0, indent=1)
        arg_2=arg_2.replace("\n",'
').replace(" "," ")
        arg_2=arg_2.replace(r"\x00","")
        arg_2+=""
        print("saving header file:",arg_1)
        arg_3=open(arg_1,'w')
        arg_3.write(arg_2)
        arg_3.close()
        webbrowser.open(arg_1)

given the bytestring ABF header make and launch HTML .


def Func(arg_0, arg_1):
        """Add a gene panel to the database

            Args:
                panel_obj(dict)
        """
        arg_2 = arg_1['panel_name']
        arg_3 = arg_1['version']
        arg_4 = arg_1.get('display_name', arg_2)

        if arg_0.gene_panel(arg_2, arg_3):
            raise IntegrityError("Panel {0} with version {1} already"
                                 " exist in database".format(arg_2, arg_3))
        LOG.info("loading panel {0}, version {1} to database".format(
            arg_4, arg_3
        ))
        arg_5 = arg_0.panel_collection.insert_one(arg_1)
        LOG.debug("Panel saved")
        return arg_5.inserted_id


(
    src, requirements=None, local_package=None,
    config_file='config.yaml', profile_name=None,
    preserve_vpc=False
)

def Func(
    arg_0, arg_1=None, arg_2=None,
    arg_3='config.yaml', arg_4=None,
    arg_5=False
):
    """Deploys a new function via AWS S3.

    :param str src:
        The path to your Lambda ready project (folder must contain a valid
        config.yaml and handler module (e.g.: service.py).
    :param str local_package:
        The path to a local package with should be included in the deploy as
        well (and/or is not available on PyPi)
    """
    # Load and parse the config file.
    arg_6 = os.path.join(arg_0, arg_3)
    arg_7 = read_cfg(arg_6, arg_4)

    # Copy all the pip dependencies required to run your code into a temporary
    # folder then add the handler file in the root of this directory.
    # Zip the contents of this folder into a single file and output to the dist
    # directory.
    arg_8 = build(
        arg_0, arg_3=arg_3, arg_1=arg_1,
        arg_2=arg_2,
    )

    arg_9 = True
    arg_10 = upload_s3(arg_7, arg_8, arg_9)
    arg_11 = get_function_config(arg_7)
    if arg_11:
        update_function(arg_7, arg_8, arg_11, arg_9=arg_9,
                        arg_10=arg_10, arg_5=arg_5)
    else:
        create_function(arg_7, arg_8, arg_9=arg_9, arg_10=arg_10)


def Func ( arg_0 ) : arg_1 = list ( utils . find_all ( arg_0 . contexts [ - 1 ] ) ) + list ( arg_0 . builtins ) return arg_1

def Func(arg_0):
        """Get a list of all valid identifiers for the current context.

        Returns:
            list(str): A list of all of the valid identifiers for this context
        """

        arg_1 = list(utils.find_all(arg_0.contexts[-1])) + list(arg_0.builtins)
        return arg_1

Get a list of all valid identifiers for the current context .


return not (isinstance(returns, astroid.Const) and returns.value is None)

def Func ( arg_0 ) : arg_1 = arg_0 . value if arg_1 is None : return False return not ( isinstance ( arg_1 , astroid . Const ) and arg_1 . value is None )

def Func(arg_0):
    """Check if a return node returns a value other than None.

    :param return_node: The return node to check.
    :type return_node: astroid.Return

    :rtype: bool
    :return: True if the return node returns a value other than None,
        False otherwise.
    """
    arg_1 = arg_0.value

    if arg_1 is None:
        return False

    return not (isinstance(arg_1, astroid.Const) and arg_1.value is None)

Check if a return node returns a value other than None .


(a, axis=None, dtype=None, out=None, keepdims=False)

def Func ( arg_0 , arg_1 = None , arg_2 = None , arg_3 = None , arg_4 = False ) : if ( isinstance ( arg_0 , np . ndarray ) or isinstance ( arg_0 , RemoteArray ) or isinstance ( arg_0 , DistArray ) ) : return arg_0 . Func ( arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 ) else : return np . Func ( arg_0 , arg_1 = arg_1 , arg_2 = arg_2 , arg_3 = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, arg_4=False):
    """
    Compute the arithmetic Func along the specified axis.

    Returns the average of the array elements.  The average is taken over
    the flattened array by default, otherwise over the specified axis.
    `float64` intermediate and return values are used for integer inputs.

    Parameters
    ----------
    a : array_like
        Array containing numbers whose Func is desired. If `a` is not an
        array, a conversion is attempted.
    axis : None or int or tuple of ints, optional
        Axis or axes along which the Funcs are computed. The default is to
        compute the Func of the flattened array.
        If this is a tuple of ints, a Func is performed over multiple axes,
        instead of a single axis or all the axes as before.
    dtype : data-type, optional
        Type to use in computing the Func.  For integer inputs, the default
        is `float64`; for floating point inputs, it is the same as the
        input dtype.
    out : ndarray, optional
        Alternate output array in which to place the result.  The default
        is ``None``; if provided, it must have the same shape as the
        expected output, but the type will be cast if necessary.
        See `doc.ufuncs` for details.
    keepdims : bool, optional
        If this is set to True, the axes which are reduced are left
        in the result as dimensions with size one. With this option,
        the result will broadcast correctly against the original `arr`.

    Returns
    -------
    m : ndarray, see dtype parameter above

    Notes
    -----
    np.Func fails to pass the keepdims parameter to ndarray subclasses.
    That is the main reason we implement this function.
    """
    if (isinstance(arg_0, np.ndarray) or
            isinstance(arg_0, RemoteArray) or
            isinstance(arg_0, DistArray)):
        return arg_0.Func(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)
    else:
        return np.Func(arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)

Compute the arithmetic mean along the specified axis.

    Returns the average of the array elements.  The average is taken over
    the flattened array by default, otherwise over the specified axis.
    `float64` intermediate and return values are used for integer inputs.

    Parameters
    ----------
    a : array_like
        Array containing numbers whose mean is desired. If `a` is not an
        array, a conversion is attempted.
    axis : None or int or tuple of ints, optional
        Axis or axes along which the means are computed. The default is to
        compute the mean of the flattened array.
        If this is a tuple of ints, a mean is performed over multiple axes,
        instead of a single axis or all the axes as before.
    dtype : data-type, optional
        Type to use in computing the mean.  For integer inputs, the default
        is `float64`; for floating point inputs, it is the same as the
        input dtype.
    out : ndarray, optional
        Alternate output array in which to place the result.  The default
        is ``None``; if provided, it must have the same shape as the
        expected output, but the type will be cast if necessary.
        See `doc.ufuncs` for details.
    keepdims : bool, optional
        If this is set to True, the axes which are reduced are left
        in the result as dimensions with size one. With this option,
        the result will broadcast correctly against the original `arr`.

    Returns
    -------
    m : ndarray, see dtype parameter above

    Notes
    -----
    np.mean fails to pass the keepdims parameter to ndarray subclasses.
    That is the main reason we implement this function.

Compute the arithmetic mean along the specified axis .


(filename, data, shape=None, meta_dict=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None):
    """ Write the `data` and `meta_dict` in two files with names
    that use `filename` as a prefix.

    Parameters
    ----------
    filename: str
        Path to the output file.
        This is going to be used as a preffix.
        Two files will be created, one with a '.mhd' extension
        and another with '.raw'. If `filename` has any of these already
        they will be taken into account to build the filenames.

    data: numpy.ndarray
        n-dimensional image data array.

    shape: tuple
        Tuple describing the shape of `data`
        Default: data.shape

    meta_dict: dict
        Dictionary with the fields of the metadata .mhd file
        Default: {}

    Returns
    -------
    mhd_filename: str
        Path to the .mhd file

    raw_filename: str
        Path to the .raw file
    """
    # check its extension
    arg_4 = get_extension(arg_0)
    arg_5 = op.basename(arg_0)
    if arg_4 != '.mhd' or arg_4 != '.raw':
        arg_6 = arg_5 + '.mhd'
        arg_7 = arg_5 + '.raw'
    elif arg_4 == '.mhd':
        arg_6 = arg_5
        arg_7 = remove_ext(arg_5) + '.raw'
    elif arg_4 == '.raw':
        arg_6 = remove_ext(arg_5) + '.mhd'
        arg_7 = arg_5
    else:
        raise ValueError('`filename` extension {} from {} is not recognised. '
                         'Expected .mhd or .raw.'.format(arg_4, arg_0))

    # default values
    if arg_3 is None:
        arg_3 = {}

    if arg_2 is None:
        arg_2 = arg_1.shape

    # prepare the default header
    arg_3['ObjectType']             = arg_3.get('ObjectType',             'Image')
    arg_3['BinaryData']             = arg_3.get('BinaryData',             'True' )
    arg_3['BinaryDataByteOrderMSB'] = arg_3.get('BinaryDataByteOrderMSB', 'False')
    arg_3['ElementType']            = arg_3.get('ElementType',            NUMPY_TO_MHD_TYPE[arg_1.dtype.type])
    arg_3['NDims']                  = arg_3.get('NDims',                  str(len(arg_2)))
    arg_3['DimSize']                = arg_3.get('DimSize',                ' '.join([str(i) for i in arg_2]))
    arg_3['ElementDataFile']        = arg_3.get('ElementDataFile',        arg_7)

    # target files
    arg_6 = op.join(op.dirname(arg_0), arg_6)
    arg_7 = op.join(op.dirname(arg_0), arg_7)

    # write the header
    write_meta_header(arg_6, arg_3)

    # write the data
    dump_raw_data(arg_7, arg_1)

    return arg_6, arg_7

Write the data and meta_dict in two files with names that use filename as a prefix .


def Func ( arg_0 , arg_1 , ** arg_2 ) : try : return arg_0 . assert_no_current_path ( arg_1 , ** arg_2 ) except ExpectationNotMet : return False

def Func(arg_0, arg_1, **arg_2):
        """
        Checks if the page doesn't have the given path.

        Args:
            path (str | RegexObject): The string or regex that the current "path" should match.
            **kwargs: Arbitrary keyword arguments for :class:`CurrentPathQuery`.

        Returns:
            bool: Whether it doesn't match.
        """

        try:
            return arg_0.assert_no_current_path(arg_1, **arg_2)
        except ExpectationNotMet:
            return False

Checks if the page doesn t have the given path .


def Func(arg_0, arg_1, arg_2):
    """Initialize a global model object for multiprocessing."""
    global arg_3
    global arg_7
    arg_3 = arg_0
    arg_3.solver.objective.direction = arg_2
    arg_7 = arg_1

Initialize a global model object for multiprocessing .


def
Func
(
arg_0
,
arg_1
,
arg_2
)
:
arg_3
=
arg_1
[
'apps'
]
[
arg_0
]
arg_4
=
[
'set -e'
]
arg_4
+=
_lib_install_commands_for_app
(
arg_0
,
arg_1
)
if
arg_3
[
'mount'
]
:
arg_4
.
append
(
"cd {}"
.
format
(
container_code_path
(
arg_3
)
)
)
arg_4
.
append
(
"export PATH=$PATH:{}"
.
format
(
container_code_path
(
arg_3
)
)
)
arg_4
+=
_copy_assets_commands_for_app
(
arg_3
,
arg_1
)
arg_4
+=
_get_once_commands
(
arg_3
,
arg_2
)
arg_4
+=
_get_always_commands
(
arg_3
)
return
arg_4

def Func(arg_0, arg_1, arg_2):
    """ This is used to compile the command that will be run when the docker container starts
    up. This command has to install any libs that the app uses, run the `always` command, and
    run the `once` command if the container is being launched for the first time """
    arg_3 = arg_1['apps'][arg_0]
    arg_4 = ['set -e']
    arg_4 += _lib_install_commands_for_app(arg_0, arg_1)
    if arg_3['mount']:
        arg_4.append("cd {}".format(container_code_path(arg_3)))
        arg_4.append("export PATH=$PATH:{}".format(container_code_path(arg_3)))
    arg_4 += _copy_assets_commands_for_app(arg_3, arg_1)
    arg_4 += _get_once_commands(arg_3, arg_2)
    arg_4 += _get_always_commands(arg_3)
    return arg_4

This is used to compile the command that will be run when the docker container starts up . This command has to install any libs that the app uses run the always command and run the once command if the container is being launched for the first time


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
options
.
verbose
>
1
:
print
(
"\tFetching date for tag {}"
.
format
(
arg_1
[
"name"
]
)
)
arg_2
=
arg_0
.
github
arg_3
=
arg_0
.
options
.
user
arg_4
=
arg_0
.
options
.
project
arg_5
,
arg_6
=
arg_2
.
repos
[
arg_3
]
[
arg_4
]
.
git
.
commits
[
arg_1
[
"commit"
]
[
"sha"
]
]
.
get
(
)
if
arg_5
==
200
:
return
arg_6
[
"committer"
]
[
"date"
]
arg_0
.
raise_GitHubError
(
arg_5
,
arg_6
,
arg_2
.
getheaders
(
)
)

def Func(arg_0, arg_1):
        """
        Fetch time for tag from repository.

        :param dict tag: dictionary with tag information
        :rtype: str
        :return: time of specified tag as ISO date string
        """

        if arg_0.options.verbose > 1:
            print("\tFetching date for tag {}".format(arg_1["name"]))
        arg_2 = arg_0.github
        arg_3 = arg_0.options.user
        arg_4 = arg_0.options.project

        arg_5, arg_6 = arg_2.repos[arg_3][arg_4].git.commits[
            arg_1["commit"]["sha"]].get()
        if arg_5 == 200:
            return arg_6["committer"]["date"]
        arg_0.raise_GitHubError(arg_5, arg_6, arg_2.getheaders())


def Func ( arg_0 ) : arg_1 = OEmbedConsumer ( ) arg_2 = arg_0 . GET . getlist ( 'urls' ) arg_3 = arg_0 . GET . get ( 'width' ) arg_4 = arg_0 . GET . get ( 'height' ) arg_5 = arg_0 . GET . get ( 'template_dir' ) arg_6 = { } arg_7 = RequestContext ( arg_0 ) for arg_8 in arg_2 : try : arg_9 = oembed . site . provider_for_url ( arg_8 ) except OEmbedMissingEndpoint : arg_10 = None arg_11 = None else : arg_10 = arg_8 arg_11 = arg_1 . parse_text ( arg_8 , arg_3 , arg_4 , context = arg_7 , arg_5 = arg_5 ) arg_6 [ arg_8 ] = { 'oembeds' : arg_10 , 'rendered' : arg_11 , } return HttpResponse ( simplejson . dumps ( arg_6 ) , mimetype = 'application/json' )

def Func(arg_0):
    """
    Extract and return oembed content for given urls.

    Required GET params:
        urls - list of urls to consume

    Optional GET params:
        width - maxwidth attribute for oembed content
        height - maxheight attribute for oembed content
        template_dir - template_dir to use when rendering oembed

    Returns:
        list of dictionaries with oembed metadata and renderings, json encoded
    """
    arg_1 = OEmbedConsumer()

    arg_2 = arg_0.GET.getlist('urls')
    arg_3 = arg_0.GET.get('width')
    arg_4 = arg_0.GET.get('height')
    arg_5 = arg_0.GET.get('template_dir')

    arg_6 = {}
    arg_7 = RequestContext(arg_0)

    for arg_8 in arg_2:
        try:
            arg_9 = oembed.site.provider_for_url(arg_8)
        except OEmbedMissingEndpoint:
            arg_10 = None
            arg_11 = None
        else:
            arg_10 = arg_8
            arg_11 = arg_1.parse_text(arg_8, arg_3, arg_4, context=arg_7, arg_5=arg_5)

        arg_6[arg_8] = {
            'oembeds': arg_10,
            'rendered': arg_11,
        }

    return HttpResponse(simplejson.dumps(arg_6), mimetype='application/json')

Extract and return oembed content for given urls .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = [ ] if arg_2 == 0 : return arg_3 arg_4 = arg_0 . client . pull_review_comment_reactions ( arg_1 ) for arg_5 in arg_4 : for arg_6 in json . loads ( arg_5 ) : arg_6 [ 'user_data' ] = arg_0 . __get_user ( arg_6 [ 'user' ] [ 'login' ] ) arg_3 . append ( arg_6 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """Get pull review comment reactions"""

        arg_3 = []

        if arg_2 == 0:
            return arg_3

        arg_4 = arg_0.client.pull_review_comment_reactions(arg_1)

        for arg_5 in arg_4:

            for arg_6 in json.loads(arg_5):
                arg_6['user_data'] = arg_0.__get_user(arg_6['user']['login'])
                arg_3.append(arg_6)

        return arg_3


def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Submits a task to a provided executor

        :type executor: s3transfer.futures.BoundedExecutor
        :param executor: The executor to Func the callable to

        :type task: s3transfer.tasks.Task
        :param task: The task to Func to the executor

        :type tag: s3transfer.futures.TaskTag
        :param tag: A tag to associate to the Functed task

        :rtype: concurrent.futures.Future
        :returns: A future representing the Functed task
        """
        logger.debug(
            "Submitting task %s to executor %s for transfer request: %s." % (
                arg_2, arg_1, arg_0.transfer_id)
        )
        arg_4 = arg_1.Func(arg_2, arg_3=arg_3)
        # Add this created future to the list of associated future just
        # in case it is needed during cleanups.
        arg_0.add_associated_future(arg_4)
        arg_4.add_done_callback(
            FunctionContainer(arg_0.remove_associated_future, arg_4))
        return arg_4

Submits a task to a provided executor

        :type executor: s3transfer.futures.BoundedExecutor
        :param executor: The executor to submit the callable to

        :type task: s3transfer.tasks.Task
        :param task: The task to submit to the executor

        :type tag: s3transfer.futures.TaskTag
        :param tag: A tag to associate to the submitted task

        :rtype: concurrent.futures.Future
        :returns: A future representing the submitted task


def
Func
(
arg_0
,
arg_1
)
:
try
:
arg_2
=
arg_0
.
publickey_from_wif
(
arg_1
)
except
Exception
:
raise
InvalidWifError
(
"Invalid Key format!"
)
if
str
(
arg_2
)
in
arg_0
.
store
:
raise
KeyAlreadyInStoreException
(
"Key already in the store"
)
arg_0
.
store
.
add
(
str
(
arg_1
)
,
str
(
arg_2
)
)

def Func(arg_0, arg_1):
        """ Add a private key to the wallet database
        """
        try:
            arg_2 = arg_0.publickey_from_wif(arg_1)
        except Exception:
            raise InvalidWifError("Invalid Key format!")
        if str(arg_2) in arg_0.store:
            raise KeyAlreadyInStoreException("Key already in the store")
        arg_0.store.add(str(arg_1), str(arg_2))


def Func ( arg_0 , arg_1 ) : try : Func_version ( arg_1 ) Func_method ( arg_1 ) Func_params ( arg_1 ) Func_id ( arg_1 ) except ( AssertionError , KeyError ) as error : invalid_request ( error )

def Func(arg_0, arg_1):
        """Validate JSON-RPC request.

        :param request: RPC request object
        :type request: dict

        """

        try:
            Func_version(arg_1)
            Func_method(arg_1)
            Func_params(arg_1)
            Func_id(arg_1)
        except (AssertionError, KeyError) as error:
            invalid_request(error)


def Func(arg_0):
    """This command will use the compilers to get compose specs
    will pass those specs to the systems that need them. Those
    systems will in turn launch the services needed to make the
    local environment go."""

    arg_1 = spec_assembler.get_assembled_specs()
    arg_2 = virtualbox.required_absent_assets(arg_1)
    if arg_2:
        raise RuntimeError('Assets {} are specified as required but are not set. Set them with `dusty assets set`'.format(arg_2))

    arg_3 = virtualbox.get_docker_vm_ip()

    # Stop will fail if we've never written a Composefile before
    if os.path.exists(constants.COMPOSEFILE_PATH):
        try:
            stop_apps_or_services(rm_containers=arg_0)
        except CalledProcessError as e:
            log_to_client("WARNING: docker-compose stop failed")
            log_to_client(str(e))

    daemon_warnings.clear_namespace('disk')
    arg_4 = virtualbox.get_docker_vm_disk_info(as_dict=True)
    if 'M' in arg_4['free'] or 'K' in arg_4['free']:
        arg_5 = 'VM is low on disk. Available disk: {}'.format(arg_4['free'])
        daemon_warnings.warn('disk', arg_5)
        log_to_client(arg_5)

    log_to_client("Compiling together the assembled specs")
    arg_6 = spec_assembler.get_all_repos(active_only=True, include_specs_repo=False)
    log_to_client("Compiling the port specs")
    arg_7 = port_spec_compiler.get_port_spec_document(arg_1, arg_3)
    log_to_client("Compiling the nginx config")
    arg_8 = virtualbox.get_docker_bridge_ip()
    arg_9 = nginx_compiler.get_nginx_configuration_spec(arg_7, arg_8)
    log_to_client("Creating setup and script bash files")
    make_up_command_files(arg_1, arg_7)
    log_to_client("Compiling docker-compose config")
    arg_10 = compose_compiler.get_compose_dict(arg_1, arg_7)

    log_to_client("Saving port forwarding to hosts file")
    hosts.update_hosts_file_from_port_spec(arg_7)
    log_to_client("Configuring NFS")
    nfs.configure_nfs()
    log_to_client("Saving updated nginx config to the VM")
    nginx.update_nginx_from_config(arg_9)
    log_to_client("Saving Docker Compose config and starting all containers")
    compose.update_running_containers_from_spec(arg_10, arg_0=arg_0)

    log_to_client("Your local environment is now started!")

This command will use the compilers to get compose specs will pass those specs to the systems that need them . Those systems will in turn launch the services needed to make the local environment go .


def Func ( arg_0 , arg_1 = None , arg_2 = '__eq__' ) : if arg_1 is None : arg_1 = list ( arg_0 . keys ( ) ) if isinstance ( arg_1 , str ) : arg_1 = [ arg_1 ] arg_3 = OrderedDict ( [ ( fn , arg_0 [ fn ] ) for fn in arg_1 ] ) return _query_sample ( arg_3 , arg_2 = arg_2 )

def Func(arg_0, arg_1=None, arg_2='__eq__'):
    """Create a tinyDB Query object that looks for items that confirms the correspondent operator
    from `operators` for each `field_names` field values from `data`.

    Parameters
    ----------
    data: dict
        The data sample

    field_names: str or list of str
        The name of the fields in `data` that will be used for the query.

    operators: str or list of str
        A list of comparison operations for each field value in `field_names`.
        If this is a str, will use the same operator for all `field_names`.
        If you want different operators for each field, remember to use an OrderedDict for `data`.
        Check TinyDB.Query class for possible choices.

    Returns
    -------
    query: tinydb.database.Query
    """
    if arg_1 is None:
        arg_1 = list(arg_0.keys())

    if isinstance(arg_1, str):
        arg_1 = [arg_1]

    # using OrderedDict by default, in case operators has different operators for each field.
    arg_3 = OrderedDict([(fn, arg_0[fn]) for fn in arg_1])
    return _query_sample(arg_3, arg_2=arg_2)

Create a tinyDB Query object that looks for items that confirms the correspondent operator from operators for each field_names field values from data .


(model, solution=None, linear=False, delta=0.03, epsilon=1E-03)

def
Func
(
arg_0
,
arg_1
=
,
arg_2
=
False
,
arg_3
=
0.03
,
arg_4
=
1E-03
)
:
if
'room_old_objective'
in
arg_0
.
solver
.
variables
:
raise
ValueError
(
'model is already adjusted for ROOM'
)
if
arg_1
is
:
arg_1
=
pfba
(
arg_0
)
arg_5
=
arg_0
.
problem
arg_6
=
arg_5
.
Variable
(
"room_old_objective"
,
ub
=
arg_1
.
objective_value
)
arg_7
=
arg_5
.
Constraint
(
arg_0
.
solver
.
objective
.
expression
arg_6
,
ub
=
0.0
,
lb
=
0.0
,
name
=
"room_old_objective_constraint"
)
arg_0
.
objective
=
arg_5
.
Objective
(
Zero
,
direction
=
"min"
,
sloppy
=
True
)
arg_9
=
[
arg_6
,
arg_7
]
arg_10
=
[
]
for
arg_11
in
arg_0
.
reactions
:
arg_12
=
arg_1
.
fluxes
[
arg_11
.
id
]
if
arg_2
:
arg_13
=
arg_5
.
Variable
(
"y_"
+
arg_11
.
id
,
lb
=
0
,
ub
=
1
)
arg_3
=
arg_4
=
0.0
else
:
arg_13
=
arg_5
.
Variable
(
"y_"
+
arg_11
.
id
,
type
=
"binary"
)
arg_14
=
arg_12
+
(
arg_3
*
abs
(
arg_12
)
)
+
arg_4
arg_15
=
arg_5
.
Constraint
(
arg_11
.
flux_expression
arg_13
*
(
arg_11
.
upper_bound
arg_14
)
,
ub
=
arg_14
,
name
=
"room_constraint_upper_"
+
arg_11
.
id
)
arg_16
=
arg_12
(
arg_3
*
abs
(
arg_12
)
)
arg_4
arg_17
=
arg_5
.
Constraint
(
arg_11
.
flux_expression
arg_13
*
(
arg_11
.
lower_bound
arg_16
)
,
lb
=
arg_16
,
name
=
"room_constraint_lower_"
+
arg_11
.
id
)
arg_9
.
extend
(
[
arg_13
,
arg_15
,
arg_17
]
)
arg_10
.
append
(
arg_13
)
arg_0
.
add_cons_vars
(
arg_9
)
arg_0
.
objective
.
set_linear_coefficients
(
{
arg_18
:
1.0
for
arg_18
in
arg_10
}
)

def Func(arg_0, arg_1=None, arg_2=False, arg_3=0.03, arg_4=1E-03):
    r"""
    Add constraints and objective for ROOM.

    This function adds variables and constraints for applying regulatory
    on/off minimization (ROOM) to the model.

    Parameters
    ----------
    model : cobra.Model
        The model to add ROOM constraints and objective to.
    solution : cobra.Solution, optional
        A previous solution to use as a reference. If no solution is given,
        one will be computed using pFBA.
    linear : bool, optional
        Whether to use the linear ROOM formulation or not (default False).
    delta: float, optional
        The relative tolerance range which is additive in nature
        (default 0.03).
    epsilon: float, optional
        The absolute range of tolerance which is multiplicative
        (default 0.001).

    Notes
    -----
    The formulation used here is the same as stated in the original paper [1]_.
    The mathematical expression is given below:

    minimize \sum_{i=1}^m y^i
    s.t. Sv = 0
         v_min <= v <= v_max
         v_j = 0
         j ∈ A
         for 1 <= i <= m
         v_i - y_i(v_{max,i} - w_i^u) <= w_i^u      (1)
         v_i - y_i(v_{min,i} - w_i^l) <= w_i^l      (2)
         y_i ∈ {0,1}                                (3)
         w_i^u = w_i + \delta|w_i| + \epsilon
         w_i^l = w_i - \delta|w_i| - \epsilon

    So, for the linear version of the ROOM , constraint (3) is relaxed to
    0 <= y_i <= 1.

    See Also
    --------
    pfba : parsimonious FBA

    References
    ----------
    .. [1] Tomer Shlomi, Omer Berkman and Eytan Ruppin, "Regulatory on/off
     minimization of metabolic flux changes after genetic perturbations",
     PNAS 2005 102 (21) 7695-7700; doi:10.1073/pnas.0406346102

    """

    if 'room_old_objective' in arg_0.solver.variables:
        raise ValueError('model is already adjusted for ROOM')

    # optimizes if no reference solution is provided
    if arg_1 is None:
        arg_1 = pfba(arg_0)

    arg_5 = arg_0.problem
    arg_6 = arg_5.Variable("room_old_objective", ub=arg_1.objective_value)
    arg_7 = arg_5.Constraint(
        arg_0.solver.objective.expression - arg_6,
        ub=0.0,
        lb=0.0,
        name="room_old_objective_constraint"
    )
    arg_0.objective = arg_5.Objective(Zero, direction="min", sloppy=True)
    arg_9 = [arg_6, arg_7]
    arg_10 = []

    for arg_11 in arg_0.reactions:
        arg_12 = arg_1.fluxes[arg_11.id]

        if arg_2:
            arg_13 = arg_5.Variable("y_" + arg_11.id, lb=0, ub=1)
            arg_3 = arg_4 = 0.0
        else:
            arg_13 = arg_5.Variable("y_" + arg_11.id, type="binary")

        # upper constraint
        arg_14 = arg_12 + (arg_3 * abs(arg_12)) + arg_4
        arg_15 = arg_5.Constraint(
            arg_11.flux_expression - arg_13 * (arg_11.upper_bound - arg_14),
            ub=arg_14, name="room_constraint_upper_" + arg_11.id)
        # lower constraint
        arg_16 = arg_12 - (arg_3 * abs(arg_12)) - arg_4
        arg_17 = arg_5.Constraint(
            arg_11.flux_expression - arg_13 * (arg_11.lower_bound - arg_16),
            lb=arg_16, name="room_constraint_lower_" + arg_11.id)
        arg_9.extend([arg_13, arg_15, arg_17])
        arg_10.append(arg_13)

    arg_0.add_cons_vars(arg_9)
    arg_0.objective.set_linear_coefficients({arg_18: 1.0 for arg_18 in arg_10})

r Add constraints and objective for ROOM .


def
Func
(
arg_0
,
arg_1
=
False
)
:
try
:
from
rdkit
.
Chem
import
Draw
from
rdkit
.
Chem
.
Draw
import
IPythonConsole
if
arg_1
:
arg_2
=
[
i
.
rdkitmol_Hs
for
i
in
arg_0
.
Chemicals
]
else
:
arg_2
=
[
i
.
rdkitmol
for
i
in
arg_0
.
Chemicals
]
return
Draw
.
MolsToImage
(
arg_2
)
except
:
return
'Rdkit is required for this feature.'

def Func(arg_0,  arg_1=False): # pragma: no cover
        r'''Interface for drawing a 2D image of all the molecules in the
        mixture. Requires an HTML5 browser, and the libraries RDKit and
        IPython. An exception is raised if either of these libraries is
        absent.

        Parameters
        ----------
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        Mixture(['natural gas']).Func()
        '''
        try:
            from rdkit.Chem import Draw
            from rdkit.Chem.Draw import IPythonConsole
            if arg_1:
                arg_2 = [i.rdkitmol_Hs for i in arg_0.Chemicals]
            else:
                arg_2 = [i.rdkitmol for i in arg_0.Chemicals]
            return Draw.MolsToImage(arg_2)
        except:
            return 'Rdkit is required for this feature.'

r'''Interface for drawing a 2D image of all the molecules in the
        mixture. Requires an HTML5 browser, and the libraries RDKit and
        IPython. An exception is raised if either of these libraries is
        absent.

        Parameters
        ----------
        Hs : bool
            Whether or not to show hydrogen

        Examples
        --------
        Mixture(['natural gas']).draw_2d()

r Interface for drawing a 2D image of all the molecules in the mixture . Requires an HTML5 browser and the libraries RDKit and IPython . An exception is raised if either of these libraries is absent .


return sum(
            [vals["length"] for contig_id, vals in self.contigs.items()
             if contig_id not in self.filtered_ids])

def Func ( arg_0 ) : return sum ( [ arg_2 [ "length" ] for arg_1 , arg_2 in arg_0 . contigs . items ( ) if arg_1 not in arg_0 . filtered_ids ] )

def Func(arg_0):
        """Returns the length of the assembly, without the filtered contigs.

        Returns
        -------
        x : int
            Total length of the assembly.

        """

        return sum(
            [arg_2["length"] for arg_1, arg_2 in arg_0.contigs.items()
             if arg_1 not in arg_0.filtered_ids])

Returns the length of the assembly without the filtered contigs .


def
Func
(
arg_0
,
arg_1
,
**
arg_2
)
:
arg_3
=
get_tempfile
(
suffix
=
'.tex'
)
arg_0
.
save_content
(
arg_3
.
name
)
try
:
arg_0
.
_Func_function
(
arg_3
.
name
,
arg_1
,
output_format
=
'pdf'
)
except
:
log
.
exception
(
'Error exporting file {} to PDF.'
.
format
(
arg_1
)
)
raise

def Func(arg_0, arg_1, **arg_2):
        """ Save the content of the .text file in the PDF.

        Parameters
        ----------
        file_path: str
            Path to the output file.
        """
        arg_3 = get_tempfile(suffix='.tex')
        arg_0.save_content(arg_3.name)

        try:
            arg_0._Func_function(arg_3.name, arg_1, output_format='pdf')
        except:
            log.exception('Error exporting file {} to PDF.'.format(arg_1))
            raise

Save the content of the . text file in the PDF .


def Func(arg_0, arg_1=2):
        '''Step the world forward by one frame.

        Parameters
        ----------
        subFuncs : int, optional
            Split the Func into this many sub-Funcs. This helps to prevent the
            time delta for an update from being too large.
        '''
        arg_0.frame_no += 1
        arg_2 = arg_0.dt / arg_1
        for arg_3 in range(arg_1):
            arg_0.ode_contactgroup.empty()
            arg_0.ode_space.collide(None, arg_0.on_collision)
            arg_0.ode_world.Func(arg_2)

Step the world forward by one frame.

        Parameters
        ----------
        substeps : int, optional
            Split the step into this many sub-steps. This helps to prevent the
            time delta for an update from being too large.


return scipy.spatial.Voronoi(np.asarray([pixel_centers[:, 1], pixel_centers[:, 0]]).T,
                                     qhull_options='Qbb Qc Qx Qm')

def
Func
(
arg_0
)
:
return
scipy
.
spatial
.
Voronoi
(
np
.
asarray
(
[
arg_0
[
:
,
1
]
,
arg_0
[
:
,
0
]
]
)
.
T
,
qhull_options
=
'Qbb Qc Qx Qm'
)

def Func(arg_0):
        """Compute the Voronoi grid of the pixelization, using the pixel centers.

        Parameters
        ----------
        pixel_centers : ndarray
            The (y,x) centre of every Voronoi pixel.
        """
        return scipy.spatial.Voronoi(np.asarray([arg_0[:, 1], arg_0[:, 0]]).T,
                                     qhull_options='Qbb Qc Qx Qm')

Compute the Voronoi grid of the pixelization using the pixel centers .


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_0
.
_get_client
(
arg_2
=
arg_2
)
.
instance
(
arg_1
)
try
:
arg_3
.
delete
(
)
return
except
GoogleAPICallError
as
e
:
arg_0
.
log
.
error
(
'An error occurred: %s. Exiting.'
,
e
.
message
)
raise
e

def Func(arg_0, arg_1, arg_2=None):
        """
        Deletes an existing Cloud Spanner instance.

        :param instance_id: The ID of the Cloud Spanner instance.
        :type instance_id: str
        :param project_id: Optional, the ID of the GCP project that owns the Cloud Spanner
            database. If set to None or missing, the default project_id from the GCP connection is used.
        :type project_id: str
        :return: None
        """

        arg_3 = arg_0._get_client(arg_2=arg_2).instance(arg_1)
        try:
            arg_3.delete()
            return
        except GoogleAPICallError as e:
            arg_0.log.error('An error occurred: %s. Exiting.', e.message)
            raise e

Deletes an existing Cloud Spanner instance .


def Func ( arg_0 , arg_1 ) : arg_2 = { } for ( arg_3 , arg_4 ) in iteritems ( arg_1 ) : if arg_4 is None : arg_2 [ arg_3 ] = 'NULL' elif isinstance ( arg_4 , basestring ) : arg_2 [ arg_3 ] = "'" + _escape ( arg_4 ) + "'" else : arg_2 [ arg_3 ] = str ( arg_4 ) return arg_0 % arg_2

def Func(arg_0, arg_1):
    """ Helper method that binds parameters to a SQL query. """
    # inspired by MySQL Python Connector (conversion.py)
    arg_2 = {}
    for (arg_3, arg_4) in iteritems(arg_1):
        if arg_4 is None:
            arg_2[arg_3] = 'NULL'
        elif isinstance(arg_4, basestring):
            arg_2[arg_3] = "'" + _escape(arg_4) + "'"
        else:
            arg_2[arg_3] = str(arg_4)
    return arg_0 % arg_2

Helper method that binds parameters to a SQL query .


def
Func
(
arg_0
,
arg_1
)
:
Log
.
info
(
"Unregister a watch with uid: "
+
str
(
arg_1
)
)
arg_0
.
watches
.
pop
(
arg_1
,
)

def Func(arg_0, arg_1):
    """
    Unregister the watch with the given UUID.
    """
    # Do not raise an error if UUID is
    # not present in the watches.
    Log.info("Unregister a watch with uid: " + str(arg_1))
    arg_0.watches.pop(arg_1, None)

Unregister the watch with the given UUID .


def Func ( arg_0 ) : arg_0 = json . loads ( list ( ChunkParser ( ) . get_chunks ( arg_0 ) ) [ 0 ] ) arg_1 = arg_0 [ 0 ] [ 1 ] [ 1 ] arg_2 = arg_0 [ 1 ] [ 1 ] [ 0 ] [ 'gsid' ] return ( arg_1 , arg_2 )

def Func(arg_0):
    """Parse response format for request for new channel SID.

    Example format (after parsing JS):
    [   [0,["c","SID_HERE","",8]],
        [1,[{"gsid":"GSESSIONID_HERE"}]]]

    Returns (SID, gsessionid) tuple.
    """
    arg_0 = json.loads(list(ChunkParser().get_chunks(arg_0))[0])
    arg_1 = arg_0[0][1][1]
    arg_2 = arg_0[1][1][0]['gsid']
    return (arg_1, arg_2)

Parse response format for request for new channel SID .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . path arg_3 = arg_1 . GET . copy ( ) if arg_0 . logout_key and arg_0 . logout_key in arg_1 . GET : del arg_3 [ arg_0 . logout_key ] if arg_3 : arg_2 = '%s?%s' % ( arg_2 , arg_3 . urlencode ( ) ) return HttpResponseRedirect ( arg_2 )

def Func(arg_0, arg_1):
        """Handle Funcs properly."""
        arg_2 = arg_1.path
        arg_3 = arg_1.GET.copy()
        if arg_0.logout_key and arg_0.logout_key in arg_1.GET:
            del arg_3[arg_0.logout_key]
        if arg_3:
            arg_2 = '%s?%s' % (arg_2, arg_3.urlencode())
        return HttpResponseRedirect(arg_2)


def Func(arg_0,arg_1,arg_2=None):
        """
        Adds the given layer at the given Z Index.

        If ``z_index`` is not given, the Z Index specified by the layer will be used.
        """
        if arg_2 is None:
            arg_2 = arg_1.z_index
        arg_3 = 0
        for arg_4,arg_5 in arg_0.layers:
            if arg_5>arg_2:
                break
            arg_3+=1
        arg_0._layers[arg_1.name]=arg_1
        arg_0.layers.insert(arg_3,[arg_1,arg_2])

Adds the given layer at the given Z Index . If z_index is not given the Z Index specified by the layer will be used .


def Func ( arg_0 ) : if arg_0 . _Func is None : return { } if callable ( arg_0 . _Func ) : return dict ( arg_0 . _Func ( ) ) return dict ( arg_0 . _Func )

def Func(arg_0):
        """The arguments which will be passed to ``url_for``.

        :type: :class:`dict`
        """
        if arg_0._Func is None:
            return {}
        if callable(arg_0._Func):
            return dict(arg_0._Func())
        return dict(arg_0._Func)

The arguments which will be passed to url_for .


def Func(arg_0):
    """
    Prints the share of total PnL contributed by each
    traded name.

    Parameters
    ----------
    round_trips : pd.DataFrame
        DataFrame with one row per round trip trade.
        - See full explanation in round_trips.extract_round_trips
    ax : matplotlib.Axes, optional
        Axes upon which to plot.

    Returns
    -------
    ax : matplotlib.Axes
        The axes that were plotted on.
    """

    arg_1 = arg_0['pnl'].sum()
    arg_2 = arg_0.groupby('symbol')['pnl'].sum() / arg_1
    arg_2.name = ''

    arg_2.index = arg_2.index.map(utils.format_asset)
    utils.print_table(
        arg_2.sort_values(
            inplace=False,
            ascending=False,
        ),
        arg_3='Profitability (PnL / PnL total) per name',
        float_format='{:.2%}'.format,
    )

Prints the share of total PnL contributed by each traded name .


def Func ( arg_0 ) : if arg_0 . _grammar is None : arg_0 . parser = Parser ( ) Func = arg_0 . parser . parse ( arg_0 . input_source ) arg_0 . _grammar = Func . trimmed ( ) . flattened ( ) . flattened ( arg_0 . _flatten ) return arg_0 . _grammar

def Func(arg_0):
    """The parse tree generated by the source."""
    if arg_0._grammar is None:
      arg_0.parser = Parser()
      Func = arg_0.parser.parse(arg_0.input_source)
      arg_0._grammar = Func.trimmed().flattened().flattened(arg_0._flatten)
    return arg_0._grammar

The parse tree generated by the source .


def Func(arg_0, **arg_1):
        """
        Adds tab information to context.

        To retrieve a list of all group tab instances, use
        ``{{ tabs }}`` in your template.

        The id of the current tab is added as ``current_tab_id`` to the
        template context.

        If the current tab has a parent tab the parent's id is added to
        the template context as ``parent_tab_id``. Instances of all tabs
        of the parent level are added as ``parent_tabs`` to the context.

        If the current tab has children they are added to the template
        context as ``child_tabs``.

        """
        arg_2 = super(TabView, arg_0).Func(**arg_1)

        # Update the context with kwargs, TemplateView doesn't do this.
        arg_2.update(arg_1)

        # Add tabs and "current" references to context
        arg_3 = {
            'tabs': arg_0.get_group_tabs(),
            'current_tab': arg_0,
            'group_current_tab': arg_0,
        }
        arg_2['tabs'] = arg_0._process_tabs(**arg_3)
        arg_2['current_tab_id'] = arg_0.tab_id

        # Handle parent tabs
        if arg_0.tab_parent is not None:
            # Verify that tab parent is valid
            if arg_0.tab_parent not in arg_0._registry:
                arg_4 = '%s has no attribute _is_tab' % arg_0.tab_parent.__class__.__name__
                raise ImproperlyConfigured(arg_4)

            # Get parent tab instance
            arg_5 = arg_0.tab_parent()

            # Add parent tabs to context
            arg_6 = {
                'tabs': arg_5.get_group_tabs(),
                'current_tab': arg_0,
                'group_current_tab': arg_5,
            }
            arg_2['parent_tabs'] = arg_0._process_tabs(**arg_6)
            arg_2['parent_tab_id'] = arg_5.tab_id

        # Handle child tabs
        if arg_0.tab_id in arg_0._children:
            arg_7 = {
                'tabs': [t() for t in arg_0._children[arg_0.tab_id]],
                'current_tab': arg_0,
                'group_current_tab': None,
            }
            arg_2['child_tabs'] = arg_0._process_tabs(**arg_7)

        return arg_2


(infile: Union[Path, str], from_words=False,
                word_column: int = WORD_COLUMN, pos_column: int = POS_COLUMN,
                tag_column: int = TAG_COLUMN, max_sents: int = -1,
                read_only_words: bool = False)

def Func ( arg_0 : arg_1 [ arg_2 , arg_3 ] , arg_4 = False , arg_5 : arg_6 = arg_7 , arg_8 : arg_6 = arg_9 , arg_10 : arg_6 = arg_11 , arg_12 : arg_6 = - 1 , arg_13 : arg_14 = False ) -> List [ Tuple [ List , arg_1 [ List , None ] ] ] : arg_15 , arg_16 , arg_17 = [ ] , [ ] , [ ] if arg_4 : arg_5 , arg_13 = 0 , True with open ( arg_0 , "r" , encoding = "utf8" ) as fin : for arg_18 in fin : arg_18 = arg_18 . strip ( ) if arg_18 . startswith ( "#" ) : continue if arg_18 == "" : if len ( arg_16 ) > 0 : if arg_13 : arg_17 = None arg_15 . append ( ( arg_16 , arg_17 ) ) arg_17 , arg_16 = [ ] , [ ] if len ( arg_15 ) == arg_12 : break continue arg_19 = arg_18 . split ( "\t" ) arg_20 = arg_19 [ 0 ] if not arg_4 and not arg_20 . isdigit ( ) : continue arg_16 . append ( arg_19 [ arg_5 ] ) if not arg_13 : arg_21 , arg_22 = arg_19 [ arg_8 ] , arg_19 [ arg_10 ] arg_22 = arg_21 if arg_22 == "_" else "{},{}" . format ( arg_21 , arg_22 ) arg_17 . append ( arg_22 ) if len ( arg_16 ) > 0 : if arg_13 : arg_17 = None arg_15 . append ( ( arg_16 , arg_17 ) ) return arg_15

def Func(arg_0: arg_1[arg_2, arg_3], arg_4=False,
                arg_5: arg_6 = arg_7, arg_8: arg_6 = arg_9,
                arg_10: arg_6 = arg_11, arg_12: arg_6 = -1,
                arg_13: arg_14 = False) -> List[Tuple[List, arg_1[List, None]]]:
    """Reads input file in CONLL-U format

    Args:
        infile: a path to a file
        word_column: column containing words (default=1)
        pos_column: column containing part-of-speech labels (default=3)
        tag_column: column containing fine-grained tags (default=5)
        max_sents: maximal number of sents to read
        read_only_words: whether to read only words

    Returns:
        a list of sentences. Each item contains a word sequence and a tag sequence, which is ``None``
        in case ``read_only_words = True``
    """
    arg_15, arg_16, arg_17 = [], [], []
    if arg_4:
        arg_5, arg_13 = 0, True
    with open(arg_0, "r", encoding="utf8") as fin:
        for arg_18 in fin:
            arg_18 = arg_18.strip()
            if arg_18.startswith("#"):
                continue
            if arg_18 == "":
                if len(arg_16) > 0:
                    if arg_13:
                        arg_17 = None
                    arg_15.append((arg_16, arg_17))
                arg_17, arg_16 = [], []
                if len(arg_15) == arg_12:
                    break
                continue
            arg_19 = arg_18.split("\t")
            arg_20 = arg_19[0]
            if not arg_4 and not arg_20.isdigit():
                continue
            arg_16.append(arg_19[arg_5])
            if not arg_13:
                arg_21, arg_22 = arg_19[arg_8], arg_19[arg_10]
                arg_22 = arg_21 if arg_22 == "_" else "{},{}".format(arg_21, arg_22)
                arg_17.append(arg_22)
        if len(arg_16) > 0:
            if arg_13:
                arg_17 = None
            arg_15.append((arg_16, arg_17))
    return arg_15


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . mouse . x - arg_0 . graph . x arg_3 = arg_0 . mouse . y - arg_0 . graph . y arg_4 = arg_0 . graph . styles . default arg_0 . _ctx . nofill ( ) arg_0 . _ctx . nostroke ( ) if arg_4 . stroke : arg_0 . _ctx . strokewidth ( arg_4 . strokewidth ) arg_0 . _ctx . stroke ( arg_4 . stroke . r , arg_4 . stroke . g , arg_4 . stroke . g , 0.75 ) arg_5 = arg_0 . _ctx . line ( arg_1 . x , arg_1 . y , arg_2 , arg_3 , draw = False ) try : arg_5 . _nsBezierPath . setLineDash_count_phase_ ( [ 2 , 4 ] , 2 , 50 ) except : pass arg_0 . _ctx . drawpath ( arg_5 ) arg_6 = arg_1 . __class__ ( None ) . r * 0.75 arg_0 . _ctx . oval ( arg_2 - arg_6 / 2 , arg_3 - arg_6 / 2 , arg_6 , arg_6 ) arg_1 . vx = arg_2 / arg_0 . graph . d arg_1 . vy = arg_3 / arg_0 . graph . d

def Func(arg_0, arg_1):

        """ Drags given node to mouse location.
        """

        arg_2 = arg_0.mouse.x - arg_0.graph.x
        arg_3 = arg_0.mouse.y - arg_0.graph.y

        # A dashed line indicates the Func vector.
        arg_4 = arg_0.graph.styles.default
        arg_0._ctx.nofill()
        arg_0._ctx.nostroke()
        if arg_4.stroke:
            arg_0._ctx.strokewidth(arg_4.strokewidth)
            arg_0._ctx.stroke(
                arg_4.stroke.r,
                arg_4.stroke.g,
                arg_4.stroke.g,
                0.75
            )
        arg_5 = arg_0._ctx.line(arg_1.x, arg_1.y, arg_2, arg_3, draw=False)
        try: arg_5._nsBezierPath.setLineDash_count_phase_([2,4], 2, 50)
        except:
            pass
        arg_0._ctx.drawpath(arg_5)
        arg_6 = arg_1.__class__(None).r * 0.75
        arg_0._ctx.oval(arg_2-arg_6/2, arg_3-arg_6/2, arg_6, arg_6)

        arg_1.vx = arg_2 / arg_0.graph.d
        arg_1.vy = arg_3 / arg_0.graph.d


return mark_safe(render_to_string(quill_config['template'], {
            'final_attrs': flatatt(final_attrs),
            'value': value,
            'id': final_attrs['id'],
            'config': self.config,
        }))

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = { } ) : if arg_2 is None : arg_2 = '' arg_4 = arg_0 . build_attrs ( arg_3 , arg_1 = arg_1 ) arg_5 = apps . get_app_config ( 'quill' ) arg_6 = getattr ( arg_5 , arg_0 . config ) return mark_safe ( Func_to_string ( arg_6 [ 'template' ] , { 'final_attrs' : flatatt ( arg_4 ) , 'value' : arg_2 , 'id' : arg_4 [ 'id' ] , 'config' : arg_0 . config , } ) )

def Func(arg_0, arg_1, arg_2, arg_3={}):
        """Render the Quill WYSIWYG."""
        if arg_2 is None:
            arg_2 = ''
        arg_4 = arg_0.build_attrs(arg_3, arg_1=arg_1)
        arg_5 = apps.get_app_config('quill')
        arg_6 = getattr(arg_5, arg_0.config)

        return mark_safe(Func_to_string(arg_6['template'], {
            'final_attrs': flatatt(arg_4),
            'value': arg_2,
            'id': arg_4['id'],
            'config': arg_0.config,
        }))


def
Func
(
arg_0
)
:
arg_0
.
is_alive
=
False
logging
.
debug
(
"Waking management thread"
)
arg_0
.
incoming_q
.
put
(
)
arg_0
.
_queue_management_thread
.
join
(
)
logging
.
debug
(
"Exiting thread"
)
arg_0
.
worker
.
join
(
)
return
True

def Func(arg_0):
        """Shutdown method, to kill the threads and workers."""
        arg_0.is_alive = False
        logging.debug("Waking management thread")
        arg_0.incoming_q.put(None)  # Wake up the thread
        arg_0._queue_management_thread.join()  # Force join
        logging.debug("Exiting thread")
        arg_0.worker.join()
        return True

Shutdown method to kill the threads and workers .


def Func ( arg_0 , arg_1 , ** arg_2 ) : arg_3 = str ( uuid . uuid1 ( ) ) if not arg_2 : arg_2 = { } arg_2 [ 'exp' ] = int ( time . time ( ) + arg_1 ) arg_2 [ 'jti' ] = arg_3 return jwt . encode ( arg_2 , decode_secret ( arg_0 ) )

def Func(arg_0, arg_1, **arg_2):
    """Generate a one-time jwt with an age in seconds"""
    arg_3 = str(uuid.uuid1()) # random id
    if not arg_2:
        arg_2 = {}
    arg_2['exp'] = int(time.time() + arg_1)
    arg_2['jti'] = arg_3
    return jwt.encode(arg_2, decode_secret(arg_0))

Generate a one - time jwt with an age in seconds


(self, stream, t1=None, t2=None, limit=None, i1=None, i2=None, transform=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None, arg_4=None, arg_5=None, arg_6=None, arg_7=None):
        """Adds the given stream to the query construction. The function supports both stream
        names and Stream objects."""
        arg_8 = query_maker(arg_2, arg_3, arg_4, arg_5, arg_6, arg_7)

        arg_8["stream"] = get_stream(arg_0.cdb, arg_1)

        # Now add the stream to the query parameters
        arg_0.query.append(arg_8)

Adds the given stream to the query construction . The function supports both stream names and Stream objects .


def
Func
(
arg_0
)
:
arg_1
=
[
]
for
arg_2
,
arg_3
in
enumerate
(
arg_0
)
:
arg_3
=
arg_3
.
rstrip
(
)
if
arg_3
.
startswith
(
'#'
)
:
if
arg_2
<
10
:
if
arg_3
.
startswith
(
'# Phenotype'
)
:
arg_1
=
arg_3
[
2
:
]
.
split
(
'\t'
)
else
:
yield
parse_omim_line
(
arg_3
,
arg_1
)

def Func(arg_0):
    """docstring for Func"""
    arg_1 = []
    for arg_2,arg_3 in enumerate(arg_0):
        arg_3 = arg_3.rstrip()
        if arg_3.startswith('#'):
            if arg_2 < 10:
                if arg_3.startswith('# Phenotype'):
                    arg_1 = arg_3[2:].split('\t')
        else:
            yield parse_omim_line(arg_3, arg_1)


(self, x, y, xnew, ynew, angle_degrees, propagate_uncertainties=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
,
arg_6
=
False
)
:
arg_1
=
_ensure_string_from_expression
(
arg_1
)
arg_2
=
_ensure_string_from_expression
(
arg_2
)
arg_7
=
np
.
radians
(
arg_5
)
arg_8
=
np
.
array
(
[
[
np
.
cos
(
arg_7
)
,
np
.
sin
(
arg_7
)
]
,
[
np
.
sin
(
arg_7
)
,
np
.
cos
(
arg_7
)
]
]
)
arg_9
=
matrix_name
=
arg_1
+
"_"
+
arg_2
+
"_rot"
for
arg_10
in
range
(
2
)
:
for
arg_11
in
range
(
2
)
:
arg_0
.
set_variable
(
matrix_name
+
"_%d%d"
%
(
arg_10
,
arg_11
)
,
arg_8
[
arg_10
,
arg_11
]
.
item
(
)
)
arg_0
[
arg_3
]
=
arg_0
.
_expr
(
"{m}_00 * {x} + {m}_01 * {y}"
.
format
(
**
locals
(
)
)
)
arg_0
[
arg_4
]
=
arg_0
.
_expr
(
"{m}_10 * {x} + {m}_11 * {y}"
.
format
(
**
locals
(
)
)
)
if
arg_6
:
arg_0
.
propagate_uncertainties
(
[
arg_0
[
arg_3
]
,
arg_0
[
arg_4
]
]
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=False):
        """Rotation in 2d.

        :param str x: Name/expression of x column
        :param str y: idem for y
        :param str xnew: name of transformed x column
        :param str ynew:
        :param float angle_degrees: rotation in degrees, anti clockwise
        :return:
        """
        arg_1 = _ensure_string_from_expression(arg_1)
        arg_2 = _ensure_string_from_expression(arg_2)
        arg_7 = np.radians(arg_5)
        arg_8 = np.array([[np.cos(arg_7), -np.sin(arg_7)], [np.sin(arg_7), np.cos(arg_7)]])
        arg_9 = matrix_name = arg_1 + "_" + arg_2 + "_rot"
        for arg_10 in range(2):
            for arg_11 in range(2):
                arg_0.set_variable(matrix_name + "_%d%d" % (arg_10, arg_11), arg_8[arg_10, arg_11].item())
        arg_0[arg_3] = arg_0._expr("{m}_00 * {x} + {m}_01 * {y}".format(**locals()))
        arg_0[arg_4] = arg_0._expr("{m}_10 * {x} + {m}_11 * {y}".format(**locals()))
        if arg_6:
            arg_0.propagate_uncertainties([arg_0[arg_3], arg_0[arg_4]])


def
Func
(
arg_0
)
:
global
arg_2
arg_1
=
getprofileini
(
)
arg_2
=
configparser
.
ConfigParser
(
)
arg_2
.
read
(
arg_1
)
arg_3
=
{
}
if
arg_0
is
not
:
arg_3
=
{
a
[
0
]
:
a
[
1
]
for
a
in
arg_0
}
arg_4
=
[
{
'name'
:
'User'
,
'nature'
:
'generic'
,
'description'
:
"General information"
,
'variables'
:
[
'user.email'
,
'user.name'
,
'user.fullname'
]
,
'defaults'
:
{
'user.email'
:
{
'value'
:
arg_3
.
get
(
'user.email'
,
''
)
,
'description'
:
"Email address"
,
'validator'
:
EmailValidator
(
)
}
,
'user.fullname'
:
{
'value'
:
arg_3
.
get
(
'user.fullname'
,
''
)
,
'description'
:
"Full Name"
,
'validator'
:
NonEmptyValidator
(
)
}
,
'user.name'
:
{
'value'
:
arg_3
.
get
(
'user.name'
,
getpass
.
getuser
(
)
)
,
'description'
:
"Name"
,
'validator'
:
NonEmptyValidator
(
)
}
,
}
}
]
arg_5
=
plugins_get_mgr
(
)
arg_6
=
arg_5
.
gather_configs
(
)
arg_7
=
arg_4
+
arg_6
for
arg_8
in
arg_7
:
arg_9
=
arg_8
[
'name'
]
for
arg_10
in
arg_8
[
'variables'
]
:
try
:
arg_8
[
'defaults'
]
[
arg_10
]
[
'value'
]
=
arg_2
[
arg_9
]
[
arg_10
]
except
:
continue
for
arg_8
in
arg_7
:
print
(
""
)
print
(
arg_8
[
'description'
]
)
print
(
"=================="
)
if
len
(
arg_8
[
'variables'
]
)
==
0
:
print
(
"Nothing to do. Enabled by default"
)
continue
arg_9
=
arg_8
[
'name'
]
arg_2
[
arg_9
]
=
{
}
arg_2
[
arg_9
]
[
'nature'
]
=
arg_8
[
'nature'
]
for
arg_10
in
arg_8
[
'variables'
]
:
arg_11
=
''
arg_12
=
arg_10
+
" "
arg_13
=
""
arg_14
=
if
arg_10
in
arg_8
[
'defaults'
]
:
arg_11
=
arg_8
[
'defaults'
]
[
arg_10
]
.
get
(
'value'
,
''
)
arg_13
=
arg_8
[
'defaults'
]
[
arg_10
]
.
get
(
"description"
,
""
)
arg_14
=
arg_8
[
'defaults'
]
[
arg_10
]
.
get
(
'validator'
,
)
if
arg_13
!=
""
:
arg_12
+=
"("
+
arg_13
+
")"
while
True
:
arg_15
=
input_with_default
(
arg_12
,
arg_11
)
if
arg_14
is
not
:
if
arg_14
.
is_valid
(
arg_15
)
:
break
else
:
print
(
"Invalid input. Expected input is {}"
.
format
(
arg_14
.
message
)
)
else
:
break
arg_2
[
arg_9
]
[
arg_10
]
=
arg_15
if
arg_10
==
'enable'
and
arg_15
==
'n'
:
break
with
open
(
arg_1
,
'w'
)
as
fd
:
arg_2
.
write
(
fd
)
print
(
"Updated profile file:"
,
arg_2
)

def Func(arg_0):
    """
    Update the profile
    """
    global arg_2

    arg_1 = getprofileini()
    arg_2 = configparser.ConfigParser()
    arg_2.read(arg_1)
    arg_3 = {}

    if arg_0 is not None:
        arg_3 = {a[0]: a[1] for a in arg_0 }

    # Generic variables to be captured...
    arg_4 = [{
        'name': 'User',
        'nature': 'generic',
        'description': "General information",
        'variables': ['user.email', 'user.name',
                      'user.fullname'],
        'defaults': {
            'user.email': {
                'value': arg_3.get('user.email',''),
                'description': "Email address",
                'validator': EmailValidator()
            },
            'user.fullname': {
                'value': arg_3.get('user.fullname',''),
                'description': "Full Name",
                'validator': NonEmptyValidator()
            },
            'user.name': {
                'value': arg_3.get('user.name', getpass.getuser()),
                'description': "Name",
                'validator': NonEmptyValidator()
            },
        }
    }]

    # Gather configuration requirements from all plugins
    arg_5 = plugins_get_mgr()
    arg_6 = arg_5.gather_configs()
    arg_7 = arg_4 + arg_6

    # Read the existing config and Func the defaults
    for arg_8 in arg_7:
        arg_9 = arg_8['name']
        for arg_10 in arg_8['variables']:
            try:
                arg_8['defaults'][arg_10]['value'] = arg_2[arg_9][arg_10]
            except:
                continue

    for arg_8 in arg_7:

        print("")
        print(arg_8['description'])
        print("==================")
        if len(arg_8['variables']) == 0:
            print("Nothing to do. Enabled by default")
            continue

        arg_9 = arg_8['name']
        arg_2[arg_9] = {}
        arg_2[arg_9]['nature'] = arg_8['nature']
        for arg_10 in arg_8['variables']:

            # defaults
            arg_11 = ''
            arg_12 = arg_10 + " "
            arg_13 = ""
            arg_14 = None

            # Look up pre-set values
            if arg_10 in arg_8['defaults']:
                arg_11 = arg_8['defaults'][arg_10].get('value','')
                arg_13 = arg_8['defaults'][arg_10].get("description","")
                arg_14 = arg_8['defaults'][arg_10].get('validator',None)
            if arg_13 != "":
                arg_12 += "(" + arg_13 + ")"

            # Get user input..
            while True:
                arg_15 = input_with_default(arg_12, arg_11)
                if arg_14 is not None:
                    if arg_14.is_valid(arg_15):
                        break
                    else:
                        print("Invalid input. Expected input is {}".format(arg_14.message))
                else:
                    break

            arg_2[arg_9][arg_10] = arg_15

            if arg_10 == 'enable' and arg_15 == 'n':
                break

    with open(arg_1, 'w') as fd:
        arg_2.write(fd)

    print("Updated profile file:", arg_2)