def Func ( arg_0 = None , arg_1 = None ) : arg_2 = Flask ( __name__ ) arg_2 . config . from_pyfile ( 'config.py' ) arg_2 . jinja_env . add_extension ( 'jinja2.ext.do' ) if arg_1 : arg_2 . config . update ( arg_1 ) if arg_0 : arg_2 . config . from_pyfile ( arg_0 ) arg_2 . mme_nodes = arg_3 ( arg_2 . config . get ( 'MME_URL' ) , arg_2 . config . get ( 'MME_TOKEN' ) ) arg_2 . config [ "JSON_SORT_KEYS" ] = False arg_4 = logger . getEffectiveLevel ( ) coloredlogs . install ( level = 'DEBUG' if arg_2 . debug else arg_4 ) configure_extensions ( arg_2 ) register_blueprints ( arg_2 ) register_filters ( arg_2 ) if not ( arg_2 . debug or arg_2 . testing ) and arg_2 . config . get ( 'MAIL_USERNAME' ) : configure_email_logging ( arg_2 ) @ arg_2 . before_request def check_user ( ) : if not arg_2 . config . get ( 'LOGIN_DISABLED' ) and request . endpoint : arg_5 = 'static' in request . endpoint or 'report' in request . endpoint arg_6 = getattr ( arg_2 . view_functions [ request . endpoint ] , 'is_public' , False ) arg_7 = not ( arg_5 or arg_6 ) if arg_7 and not current_user . is_authenticated : arg_8 = "{}?{}" . format ( request . path , request . query_string . decode ( ) ) arg_9 = url_for ( 'login.login' , next = arg_8 ) return redirect ( arg_9 ) return arg_2

def Func(arg_0=None, arg_1=None):
    """Flask app factory function."""
    arg_2 = Flask(__name__)
    arg_2.config.from_pyfile('config.py')
    arg_2.jinja_env.add_extension('jinja2.ext.do')
    if arg_1:
        arg_2.config.update(arg_1)
    if arg_0:
        arg_2.config.from_pyfile(arg_0)

    # If there is a MatchMaker Exchange server
    # collect the connected external nodes
    arg_2.mme_nodes = arg_3(arg_2.config.get('MME_URL'), arg_2.config.get('MME_TOKEN'))

    arg_2.config["JSON_SORT_KEYS"] = False
    arg_4 = logger.getEffectiveLevel()
    coloredlogs.install(level='DEBUG' if arg_2.debug else arg_4)
    configure_extensions(arg_2)
    register_blueprints(arg_2)
    register_filters(arg_2)

    if not (arg_2.debug or arg_2.testing) and arg_2.config.get('MAIL_USERNAME'):
        # setup email logging of errors
        configure_email_logging(arg_2)

    @arg_2.before_request
    def check_user():
        if not arg_2.config.get('LOGIN_DISABLED') and request.endpoint:
            # check if the endpoint requires authentication
            arg_5 = 'static' in request.endpoint or 'report' in request.endpoint
            arg_6 = getattr(arg_2.view_functions[request.endpoint],
                                      'is_public', False)
            arg_7 = not (arg_5 or arg_6)
            # if endpoint requires auth, check if user is authenticated
            if arg_7 and not current_user.is_authenticated:
                # combine visited URL (convert byte string query string to unicode!)
                arg_8 = "{}?{}".format(request.path, request.query_string.decode())
                arg_9 = url_for('login.login', next=arg_8)
                return redirect(arg_9)

    return arg_2


def Func ( arg_0 , arg_1 ) : arg_2 = QtGui . QTextEdit . ExtraSelection ( ) arg_3 = arg_0 . _text_edit . textCursor ( ) arg_3 . setPosition ( arg_1 ) arg_3 . movePosition ( QtGui . QTextCursor . NextCharacter , QtGui . QTextCursor . KeepAnchor ) arg_2 . cursor = arg_3 arg_2 . format = arg_0 . format return arg_2

def Func(arg_0, arg_1):
        """ Convenience method for selecting a character.
        """
        arg_2 = QtGui.QTextEdit.ExtraSelection()
        arg_3 = arg_0._text_edit.textCursor()
        arg_3.setPosition(arg_1)
        arg_3.movePosition(QtGui.QTextCursor.NextCharacter,
                            QtGui.QTextCursor.KeepAnchor)
        arg_2.cursor = arg_3
        arg_2.format = arg_0.format
        return arg_2

Convenience method for selecting a character .


Calls `pick` in a while loop to allow user to pick many
    options. Returns a list of chosen options.

def
Func
(
arg_0
,
*
arg_1
,
**
arg_2
)
:
def
get_options
(
arg_3
,
arg_4
)
:
return
[
arg_3
[
arg_5
]
for
arg_5
,
arg_6
in
enumerate
(
arg_4
)
if
arg_6
]
def
get_verbose_options
(
arg_7
,
arg_4
)
:
arg_8
,
arg_9
=
' '
,
'✔'
if
sys
.
version_info
<
(
3
,
3
)
:
arg_8
,
arg_9
=
' '
,
'@'
arg_10
=
[
'{} {}'
.
format
(
arg_9
if
arg_6
else
arg_8
,
arg_7
[
arg_5
]
)
for
arg_5
,
arg_6
in
enumerate
(
arg_4
)
]
return
arg_10
+
[
'{}{}'
.
format
(
'  '
,
arg_2
.
get
(
'done'
,
'done...'
)
)
]
arg_3
,
arg_7
=
prepare_options
(
arg_1
)
arg_4
=
[
False
]
*
len
(
arg_3
)
arg_11
=
arg_2
.
get
(
'idx'
,
0
)
arg_12
=
arg_2
.
get
(
'default'
,
)
if
isinstance
(
arg_12
,
list
)
:
for
arg_13
in
arg_12
:
arg_4
[
arg_13
]
=
True
if
isinstance
(
arg_12
,
int
)
:
arg_4
[
arg_12
]
=
True
while
True
:
try
:
arg_11
=
one
(
arg_0
,
*
get_verbose_options
(
arg_7
,
arg_4
)
,
return_index
=
True
,
arg_13
=
arg_11
)
except
QuestionnaireGoBack
:
if
any
(
arg_4
)
:
raise
QuestionnaireGoBack
(
0
)
else
:
raise
QuestionnaireGoBack
if
arg_11
==
len
(
arg_3
)
:
return
get_options
(
arg_3
,
arg_4
)
arg_4
[
arg_11
]
=
not
arg_4
[
arg_11
]

def Func(arg_0, *arg_1, **arg_2):
    """Calls `pick` in a while loop to allow user to pick Func
    options. Returns a list of chosen options.
    """
    def get_options(arg_3, arg_4):
        return [arg_3[arg_5] for arg_5, arg_6 in enumerate(arg_4) if arg_6]

    def get_verbose_options(arg_7, arg_4):
        arg_8, arg_9 = ' ', '✔'
        if sys.version_info < (3, 3):
            arg_8, arg_9 = ' ', '@'
        arg_10 = ['{} {}'.format(arg_9 if arg_6 else arg_8, arg_7[arg_5]) for arg_5, arg_6 in enumerate(arg_4)]
        return arg_10 + ['{}{}'.format('  ', arg_2.get('done', 'done...'))]

    arg_3, arg_7 = prepare_options(arg_1)
    arg_4 = [False] * len(arg_3)
    arg_11 = arg_2.get('idx', 0)

    arg_12 = arg_2.get('default', None)
    if isinstance(arg_12, list):
        for arg_13 in arg_12:
            arg_4[arg_13] = True
    if isinstance(arg_12, int):
        arg_4[arg_12] = True

    while True:
        try:
            arg_11 = one(arg_0, *get_verbose_options(arg_7, arg_4), return_index=True, arg_13=arg_11)
        except QuestionnaireGoBack:
            if any(arg_4):
                raise QuestionnaireGoBack(0)
            else:
                raise QuestionnaireGoBack
        if arg_11 == len(arg_3):
            return get_options(arg_3, arg_4)
        arg_4[arg_11] = not arg_4[arg_11]

Calls pick in a while loop to allow user to pick many options . Returns a list of chosen options .


return {compound: amount(compound, masses[compound])
            for compound in masses.keys()}

def Func ( arg_0 ) : return { arg_1 : amount ( arg_1 , arg_0 [ arg_1 ] ) for arg_1 in arg_0 . keys ( ) }

def Func(arg_0):
    """
    Calculate the Func from the specified compound masses.

    :param masses: [kg] dictionary, e.g. {'SiO2': 3.0, 'FeO': 1.5}

    :returns: [kmol] dictionary
    """

    return {arg_1: amount(arg_1, arg_0[arg_1])
            for arg_1 in arg_0.keys()}

Calculate the amounts from the specified compound masses.

    :param masses: [kg] dictionary, e.g. {'SiO2': 3.0, 'FeO': 1.5}

    :returns: [kmol] dictionary

Calculate the amounts from the specified compound masses .


def Func ( arg_0 ) : return arg_0 . widget . size [ 0 ] - arg_0 . border [ 0 ] * 2 , arg_0 . widget . size [ 1 ] - arg_0 . border [ 1 ] * 2

def Func(arg_0):
        """
        Returns the size of the layer, with the border size already subtracted.
        """
        return arg_0.widget.size[0]-arg_0.border[0]*2,arg_0.widget.size[1]-arg_0.border[1]*2

Returns the size of the layer with the border size already subtracted .


def Func ( arg_0 , arg_1 ) : arg_2 = { 'filter' : 'commentCard' , 'memberCreator_fields' : 'username' } arg_3 = arg_0 . api_request ( "/1/cards/{card_id}/actions" . format ( arg_1 = arg_1 ) , ** arg_2 ) for arg_4 in arg_3 : assert arg_4 [ 'type' ] == 'commentCard' yield arg_4

def Func(arg_0, arg_1):
        """ Returns an iterator for the comments on a certain card. """
        arg_2 = {'filter': 'commentCard', 'memberCreator_fields': 'username'}
        arg_3 = arg_0.api_request(
            "/1/cards/{card_id}/actions".format(arg_1=arg_1),
            **arg_2)
        for arg_4 in arg_3:
            assert arg_4['type'] == 'commentCard'
            yield arg_4

Returns an iterator for the comments on a certain card .


def Func ( arg_0 , arg_1 , arg_2 = True ) : if arg_2 : return arg_0 [ : 4 ] == arg_1 [ : 4 ] else : if arg_0 [ 1 : 4 ] != arg_1 [ 1 : 4 ] : return False else : return set ( arg_0 [ 0 ] ) == set ( arg_1 [ 0 ] )

def Func(arg_0, arg_1, arg_2=True):
    """
    Compare 2 fields.

    If strict is True, then the order of the subfield will be taken care of, if
    not then the order of the subfields doesn't matter.

    :return: True if the field are equivalent, False otherwise.
    """
    if arg_2:
        # Return a simple equal test on the field minus the position.
        return arg_0[:4] == arg_1[:4]
    else:
        if arg_0[1:4] != arg_1[1:4]:
            # Different indicators or controlfield value.
            return False
        else:
            # Compare subfields in a loose way.
            return set(arg_0[0]) == set(arg_1[0])


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . source_expand ( arg_1 ) for arg_1 in arg_2 : arg_3 = S3URL ( arg_1 ) arg_4 = arg_0 . s3 . get_object ( Bucket = arg_3 . bucket , Key = arg_3 . path ) message ( '%s' , arg_4 [ 'Body' ] . read ( ) )

def Func(arg_0, arg_1):
    '''Print out a series of files'''
    arg_2 = arg_0.source_expand(arg_1)

    for arg_1 in arg_2:
      arg_3 = S3URL(arg_1)
      arg_4 = arg_0.s3.get_object(Bucket=arg_3.bucket, Key=arg_3.path)
      message('%s', arg_4['Body'].read())


def Func(arg_0, arg_1):
        '''
        Retrieves the description for the specified topic.

        topic_name:
            Name of the topic.
        '''
        _validate_not_none('topic_name', arg_1)
        arg_2 = HTTPRequest()
        arg_2.method = 'GET'
        arg_2.host = arg_0._get_host()
        arg_2.path = '/' + _str(arg_1) + ''
        arg_2.path, arg_2.query = arg_0._httpclient._update_request_uri_query(arg_2)  # pylint: disable=protected-access
        arg_2.headers = arg_0._update_service_bus_header(arg_2)
        arg_8 = arg_0._perform_request(arg_2)

        return _convert_response_to_topic(arg_8)

Retrieves the description for the specified topic .


(dx: int, dy: int, mouseData: int = 0, dwFlags: int = MouseEventFlag.LeftDown, time_: int = 0)

return _CreateInput(MOUSEINPUT(dx, dy, mouseData, dwFlags, time_, None))

def Func(arg_0: arg_1, arg_2: arg_1, arg_3: arg_1 = 0, arg_4: arg_1 = arg_5.LeftDown, arg_7: arg_1 = 0) -> INPUT:
    """
    Create Win32 struct `MOUSEINPUT` for `SendInput`.
    Return `INPUT`.
    """
    return _CreateInput(MOUSEINPUT(arg_0, arg_2, arg_3, arg_4, arg_7, None))

Create Win32 struct MOUSEINPUT for SendInput . Return INPUT .


def
Func
(
arg_0
)
:
if
arg_0
.
report_progress
:
if
arg_0
.
report_progress
is
True
:
arg_0
.
report_progress
=
(
5
,
'pypet'
,
logging
.
INFO
)
elif
isinstance
(
arg_0
.
report_progress
,
(
int
,
float
)
)
:
arg_0
.
report_progress
=
(
arg_0
.
report_progress
,
'pypet'
,
logging
.
INFO
)
elif
isinstance
(
arg_0
.
report_progress
,
str
)
:
arg_0
.
report_progress
=
(
5
,
arg_0
.
report_progress
,
logging
.
INFO
)
elif
len
(
arg_0
.
report_progress
)
==
2
:
arg_0
.
report_progress
=
(
arg_0
.
report_progress
[
0
]
,
arg_0
.
report_progress
[
1
]
,
logging
.
INFO
)
if
arg_0
.
log_config
:
if
arg_0
.
log_config
==
pypetconstants
.
DEFAULT_LOGGING
:
arg_2
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
)
)
arg_3
=
os
.
path
.
join
(
arg_2
,
'logging'
)
arg_0
.
log_config
=
os
.
path
.
join
(
arg_3
,
'default.ini'
)
if
isinstance
(
arg_0
.
log_config
,
str
)
:
if
not
os
.
path
.
isfile
(
arg_0
.
log_config
)
:
raise
ValueError
(
'Could not find the logger init file '
'`%s`.'
%
arg_0
.
log_config
)
arg_5
=
NoInterpolationParser
(
)
arg_5
.
read
(
arg_0
.
log_config
)
elif
isinstance
(
arg_0
.
log_config
,
cp
.
RawConfigParser
)
:
arg_5
=
arg_0
.
log_config
else
:
arg_5
=
if
arg_5
is
not
:
arg_0
.
_sp_config
=
arg_0
.
_parser_to_string_io
(
arg_5
)
arg_0
.
_mp_config
=
arg_0
.
_find_multiproc_options
(
arg_5
)
if
arg_0
.
_mp_config
is
not
:
arg_0
.
_mp_config
=
arg_0
.
_parser_to_string_io
(
arg_0
.
_mp_config
)
elif
isinstance
(
arg_0
.
log_config
,
dict
)
:
arg_0
.
_sp_config
=
arg_0
.
log_config
arg_0
.
_mp_config
=
arg_0
.
_find_multiproc_dict
(
arg_0
.
_sp_config
)
if
arg_0
.
log_stdout
:
if
arg_0
.
log_stdout
is
True
:
arg_0
.
log_stdout
=
(
'STDOUT'
,
logging
.
INFO
)
if
isinstance
(
arg_0
.
log_stdout
,
str
)
:
arg_0
.
log_stdout
=
(
arg_0
.
log_stdout
,
logging
.
INFO
)
if
isinstance
(
arg_0
.
log_stdout
,
int
)
:
arg_0
.
log_stdout
=
(
'STDOUT'
,
arg_0
.
log_stdout
)

def Func(arg_0):
        """ Checks and converts all settings if necessary passed to the Manager.

        Searches for multiprocessing options as well.

        """
        if arg_0.report_progress:
            if arg_0.report_progress is True:
                arg_0.report_progress = (5, 'pypet', logging.INFO)
            elif isinstance(arg_0.report_progress, (int, float)):
                arg_0.report_progress = (arg_0.report_progress, 'pypet', logging.INFO)
            elif isinstance(arg_0.report_progress, str):
                arg_0.report_progress = (5, arg_0.report_progress, logging.INFO)
            elif len(arg_0.report_progress) == 2:
                arg_0.report_progress = (arg_0.report_progress[0], arg_0.report_progress[1],
                                        logging.INFO)

        if arg_0.log_config:
            if arg_0.log_config == pypetconstants.DEFAULT_LOGGING:
                arg_2 = os.path.abspath(os.path.dirname(__file__))
                arg_3 = os.path.join(arg_2, 'logging')
                arg_0.log_config = os.path.join(arg_3, 'default.ini')

            if isinstance(arg_0.log_config, str):
                if not os.path.isfile(arg_0.log_config):
                    raise ValueError('Could not find the logger init file '
                                     '`%s`.' % arg_0.log_config)
                arg_5 = NoInterpolationParser()
                arg_5.read(arg_0.log_config)
            elif isinstance(arg_0.log_config, cp.RawConfigParser):
                arg_5 = arg_0.log_config
            else:
                arg_5 = None

            if arg_5 is not None:
                arg_0._sp_config = arg_0._parser_to_string_io(arg_5)
                arg_0._mp_config = arg_0._find_multiproc_options(arg_5)
                if arg_0._mp_config is not None:
                    arg_0._mp_config = arg_0._parser_to_string_io(arg_0._mp_config)

            elif isinstance(arg_0.log_config, dict):
                arg_0._sp_config = arg_0.log_config
                arg_0._mp_config = arg_0._find_multiproc_dict(arg_0._sp_config)

        if arg_0.log_stdout:
            if arg_0.log_stdout is True:
                arg_0.log_stdout = ('STDOUT', logging.INFO)
            if isinstance(arg_0.log_stdout, str):
                arg_0.log_stdout = (arg_0.log_stdout, logging.INFO)
            if isinstance(arg_0.log_stdout, int):
                arg_0.log_stdout = ('STDOUT', arg_0.log_stdout)

Checks and converts all settings if necessary passed to the Manager .


def Func ( arg_0 ) : arg_1 = '%s/Func' % arg_0 . base_url arg_2 = requests . get ( arg_1 ) try : return arg_2 . json ( ) == "ok" except : return False

def Func(arg_0):
        '''
        Check the Func of the ordering API

        Args: None

        Returns:  True or False
        '''
        arg_1 = '%s/Func' % arg_0.base_url
        # Auth is not required to hit the Func
        arg_2 = requests.get(arg_1)

        try:
            return arg_2.json() == "ok"
        except:
            return False

Check the heartbeat of the ordering API

        Args: None

        Returns:  True or False


(dataset, matrix, patterns, cells, w, fnum)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
,
arg_4
,
arg_5
)
:
arg_6
=
0
arg_7
=
0
assert
len
(
arg_2
)
==
len
(
arg_3
)
for
arg_8
in
xrange
(
len
(
arg_2
)
1
)
:
arg_1
[
arg_8
+
1
:
,
arg_8
]
=
[
len
(
set
(
arg_2
[
arg_8
]
)
.
intersection
(
set
(
q
)
)
)
*
100
/
arg_4
for
q
in
arg_2
[
arg_8
+
1
:
]
]
arg_1
[
arg_8
,
arg_8
+
1
:
]
=
[
len
(
set
(
arg_3
[
arg_8
]
)
.
intersection
(
set
(
r
)
)
)
*
5
/
2
for
r
in
arg_3
[
arg_8
+
1
:
]
]
arg_6
+=
sum
(
abs
(
np
.
array
(
arg_1
[
arg_8
+
1
:
,
arg_8
]
)
np
.
array
(
arg_1
[
arg_8
,
arg_8
+
1
:
]
)
)
)
arg_7
+=
len
(
arg_1
[
arg_8
+
1
:
,
arg_8
]
)
print
'Score'
,
arg_6
/
arg_7
arg_9
=
pyl
.
figure
(
figsize
=
(
10
,
10
)
,
num
=
arg_5
)
pyl
.
matshow
(
arg_1
,
fignum
=
arg_5
)
pyl
.
colorbar
(
)
pyl
.
title
(
'Coincidence Space'
,
verticalalignment
=
'top'
,
fontsize
=
12
)
pyl
.
xlabel
(
'The Mirror Image Visualization for '
+
arg_0
,
fontsize
=
17
)
pyl
.
ylabel
(
'Encoding space'
,
fontsize
=
12
)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
  '''The similarity of two patterns in the bit-encoding space is displayed alongside
  their similarity in the sp-coinc space.'''
  arg_6=0
  arg_7 = 0
  assert len(arg_2)==len(arg_3)
  for arg_8 in xrange(len(arg_2)-1):
    arg_1[arg_8+1:,arg_8] = [len(set(arg_2[arg_8]).intersection(set(q)))*100/arg_4 for q in arg_2[arg_8+1:]]
    arg_1[arg_8,arg_8+1:] = [len(set(arg_3[arg_8]).intersection(set(r)))*5/2 for r in arg_3[arg_8+1:]]

    arg_6 += sum(abs(np.array(arg_1[arg_8+1:,arg_8])-np.array(arg_1[arg_8,arg_8+1:])))
    arg_7 += len(arg_1[arg_8+1:,arg_8])

  print 'Score', arg_6/arg_7

  arg_9 = pyl.figure(figsize = (10,10), num = arg_5)
  pyl.matshow(arg_1, fignum = arg_5)
  pyl.colorbar()
  pyl.title('Coincidence Space', verticalalignment='top', fontsize=12)
  pyl.xlabel('The Mirror Image Visualization for '+arg_0, fontsize=17)
  pyl.ylabel('Encoding space', fontsize=12)

The similarity of two patterns in the bit - encoding space is displayed alongside their similarity in the sp - coinc space .


return '()' if outputs is None else SolidityMetadata.tuple_signature_for_components(outputs)

def Func(arg_0, arg_1: arg_2) -> str:
        """Returns the tuple type signature for the output values of the function
        associated with the selector ``hsh``.

        If no normal contract function has the specified selector,
        the empty tuple type signature ``'()'`` is returned.
        """
        if not isinstance(arg_1, (arg_2, bytearray)):
            raise TypeError('The selector argument must be a concrete byte array')
        arg_3 = arg_0.get_abi(arg_1)
        arg_4 = arg_3.get('outputs')
        return '()' if arg_4 is None else SolidityMetadata.tuple_signature_for_components(arg_4)

Returns the tuple type signature for the output values of the function associated with the selector hsh .


def Func ( arg_0 ) : if arg_1 . _current_game : arg_1 . _current_game = arg_0 return global arg_10 arg_1 . _current_game = arg_0 arg_3 = lib . WindowResizeEventHandler ( window . _window_resize_event_handler ) lib . SetWindowResizeEventHandler ( arg_3 ) arg_4 = lib . KeyEventHandler ( keyboard . _key_event_handler ) lib . SetKeyEventHandler ( arg_4 ) arg_5 = lib . MouseButtonEventHandler ( mouse_input . _mouse_button_event_handler ) lib . SetMouseButtonEventHandler ( arg_5 ) arg_6 = lib . MouseScrollEventHandler ( mouse_input . _mouse_scroll_event_handler ) lib . SetMouseScrollEventHandler ( arg_6 ) arg_7 = lib . ControllerConnectedEventHandler ( controller . _controller_connected_event_handler ) lib . SetControllerConnectedEventHandler ( arg_7 ) arg_8 = lib . ControllerButtonEventHandler ( controller . _controller_button_event_handler ) lib . SetControllerButtonEventHandler ( arg_8 ) arg_9 = lib . ControllerAxisEventHandler ( controller . _controller_axis_event_handler ) lib . SetControllerAxisEventHandler ( arg_9 ) arg_10 = lib . TickCallback ( _first_tick_callback ) lib . SetTickCallback ( arg_10 ) lib . Run ( ) arg_1 . _current_game = None arg_10 = None lib . SetWindowResizeEventHandler ( lib . WindowResizeEventHandler ( 0 ) ) lib . SetKeyEventHandler ( lib . KeyEventHandler ( 0 ) ) lib . SetMouseButtonEventHandler ( lib . MouseButtonEventHandler ( 0 ) ) lib . SetMouseScrollEventHandler ( lib . MouseScrollEventHandler ( 0 ) ) lib . SetControllerConnectedEventHandler ( lib . ControllerConnectedEventHandler ( 0 ) ) lib . SetControllerButtonEventHandler ( lib . ControllerButtonEventHandler ( 0 ) ) lib . SetControllerAxisEventHandler ( lib . ControllerAxisEventHandler ( 0 ) ) lib . SetTickCallback ( lib . TickCallback ( 0 ) )

def Func(arg_0):
    '''Start Funcning the game.  The window is created and shown at this point, and then
    the main event loop is entered.  'game.on_tick' and other event handlers are called
    repeatedly until the game exits.

    If a game is already Funcning, this function replaces the :class:`Game` instance that
    receives events.
    '''
    if arg_1._current_game:
        arg_1._current_game = arg_0
        return

    global arg_10
    arg_1._current_game = arg_0

    # Window handler
    arg_3 = lib.WindowResizeEventHandler(window._window_resize_event_handler)
    lib.SetWindowResizeEventHandler(arg_3)

    # Key handler
    arg_4 = lib.KeyEventHandler(keyboard._key_event_handler)
    lib.SetKeyEventHandler(arg_4)

    # Mouse handlers
    arg_5 = lib.MouseButtonEventHandler(mouse_input._mouse_button_event_handler)
    lib.SetMouseButtonEventHandler(arg_5)
    arg_6 = lib.MouseScrollEventHandler(mouse_input._mouse_scroll_event_handler)
    lib.SetMouseScrollEventHandler(arg_6)

    # Controller handlers
    arg_7 = lib.ControllerConnectedEventHandler(controller._controller_connected_event_handler)
    lib.SetControllerConnectedEventHandler(arg_7)
    arg_8 = lib.ControllerButtonEventHandler(controller._controller_button_event_handler)
    lib.SetControllerButtonEventHandler(arg_8)
    arg_9 = lib.ControllerAxisEventHandler(controller._controller_axis_event_handler)
    lib.SetControllerAxisEventHandler(arg_9)

    # Tick handler
    arg_10 = lib.TickCallback(_first_tick_callback)
    lib.SetTickCallback(arg_10)

    lib.Run()
    arg_1._current_game = None
    arg_10 = None

    lib.SetWindowResizeEventHandler(lib.WindowResizeEventHandler(0))
    lib.SetKeyEventHandler(lib.KeyEventHandler(0))
    lib.SetMouseButtonEventHandler(lib.MouseButtonEventHandler(0))
    lib.SetMouseScrollEventHandler(lib.MouseScrollEventHandler(0))
    lib.SetControllerConnectedEventHandler(lib.ControllerConnectedEventHandler(0))
    lib.SetControllerButtonEventHandler(lib.ControllerButtonEventHandler(0))
    lib.SetControllerAxisEventHandler(lib.ControllerAxisEventHandler(0))
    lib.SetTickCallback(lib.TickCallback(0))

Start running the game.  The window is created and shown at this point, and then
    the main event loop is entered.  'game.on_tick' and other event handlers are called
    repeatedly until the game exits.

    If a game is already running, this function replaces the :class:`Game` instance that
    receives events.

Start running the game . The window is created and shown at this point and then the main event loop is entered . game . on_tick and other event handlers are called repeatedly until the game exits .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . client . issue_collection ( arg_1 , "messages" ) : arg_3 = json . loads ( arg_2 ) for arg_4 in arg_3 [ 'entries' ] : arg_4 [ 'owner_data' ] = arg_0 . __fetch_user_data ( '{OWNER}' , arg_4 [ 'owner_link' ] ) yield arg_4

def Func(arg_0, arg_1):
        """Get messages of an issue"""

        for arg_2 in arg_0.client.issue_collection(arg_1, "messages"):
            arg_3 = json.loads(arg_2)

            for arg_4 in arg_3['entries']:
                arg_4['owner_data'] = arg_0.__fetch_user_data('{OWNER}', arg_4['owner_link'])
                yield arg_4


return Parallel(n_jobs=_pools)(delayed(compress_blocking)
                     (image=image, delete_tif=delete_tif, folder=folder)
                     for image in filenames)

def Func ( arg_0 , arg_1 = False , arg_2 = None ) : if type ( arg_0 ) == str : return [ Func_blocking ( arg_0 , arg_1 , arg_2 ) ] arg_3 = copy ( arg_0 ) return Parallel ( n_jobs = _pools ) ( delayed ( Func_blocking ) ( arg_4 = arg_4 , arg_1 = arg_1 , arg_2 = arg_2 ) for arg_4 in arg_3 )

def Func(arg_0, arg_1=False, arg_2=None):
    """Lossless Funcion. Save images as PNG and TIFF tags to json. Can be
    reversed with `deFunc`. Will run in multiprocessing, where
    number of workers is decided by ``leicaexperiment.experiment._pools``.

    Parameters
    ----------
    images : list of filenames
        Images to lossless Func.
    delete_tif : bool
        Wheter to delete original images.
    folder : string
        Where to store images. Basename will be kept.

    Returns
    -------
    list of filenames
        List of Funced files.
    """
    if type(arg_0) == str:
        # only one image
        return [Func_blocking(arg_0, arg_1, arg_2)]

    arg_3 = copy(arg_0) # as images property will change when looping

    return Parallel(n_jobs=_pools)(delayed(Func_blocking)
                     (arg_4=arg_4, arg_1=arg_1, arg_2=arg_2)
                     for arg_4 in arg_3)

Lossless compression. Save images as PNG and TIFF tags to json. Can be
    reversed with `decompress`. Will run in multiprocessing, where
    number of workers is decided by ``leicaexperiment.experiment._pools``.

    Parameters
    ----------
    images : list of filenames
        Images to lossless compress.
    delete_tif : bool
        Wheter to delete original images.
    folder : string
        Where to store images. Basename will be kept.

    Returns
    -------
    list of filenames
        List of compressed files.

Lossless compression . Save images as PNG and TIFF tags to json . Can be reversed with decompress . Will run in multiprocessing where number of workers is decided by leicaexperiment . experiment . _pools .


def Func ( arg_0 , arg_1 = [ ] ) : arg_2 = asyncio . get_event_loop ( ) try : arg_2 . Func_until_complete ( arg_0 . subscribe ( arg_1 ) ) arg_2 . Func_forever ( ) finally : arg_2 . Func_until_complete ( arg_0 . close ( ) )

def Func(arg_0, arg_1=[]):
        '''Run forever and block until exception is rasised.
        initial_channels is the channels to start with.
        '''
        arg_2 = asyncio.get_event_loop()
        try:
            arg_2.Func_until_complete(arg_0.subscribe(arg_1))
            arg_2.Func_forever()
        finally:
            arg_2.Func_until_complete(arg_0.close())

Run forever and block until exception is rasised . initial_channels is the channels to start with .


return {
            'objectName': self._run_object,
            'runTime': run_time,
            'heatmaps': heatmaps
        }

def Func ( arg_0 ) : with open ( arg_0 . _run_object , 'r' ) as srcfile : arg_1 = srcfile . read ( ) arg_2 = compile ( arg_1 , arg_0 . _run_object , 'exec' ) try : with _CodeHeatmapCalculator ( ) as prof : exec ( arg_2 , arg_0 . _globs , None ) except SystemExit : pass arg_3 = [ ] for arg_4 , arg_5 in prof . heatmap . items ( ) : if os . path . isfile ( arg_4 ) : arg_3 . append ( arg_0 . _format_heatmap ( arg_4 , arg_5 , prof . execution_count [ arg_4 ] ) ) arg_6 = sum ( arg_5 [ 'runTime' ] for arg_5 in arg_3 ) return { 'objectName' : arg_0 . _run_object , 'runTime' : arg_6 , 'heatmaps' : arg_3 }

def Func(arg_0):
        """Calculates heatmap for module."""
        with open(arg_0._run_object, 'r') as srcfile:
            arg_1 = srcfile.read()
            arg_2 = compile(arg_1, arg_0._run_object, 'exec')
        try:
            with _CodeHeatmapCalculator() as prof:
                exec(arg_2, arg_0._globs, None)
        except SystemExit:
            pass

        arg_3 = []
        for arg_4, arg_5 in prof.heatmap.items():
            if os.path.isfile(arg_4):
                arg_3.append(
                    arg_0._format_heatmap(
                        arg_4, arg_5, prof.execution_count[arg_4]))

        arg_6 = sum(arg_5['runTime'] for arg_5 in arg_3)
        return {
            'objectName': arg_0._run_object,
            'runTime': arg_6,
            'heatmaps': arg_3
        }


def Func ( arg_0 ) : arg_1 = MsSqlHook ( mssql_conn_id = arg_0 . mssql_conn_id ) arg_2 = arg_1 . get_conn ( ) arg_3 = arg_2 . cursor ( ) arg_3 . execute ( arg_0 . sql ) return arg_3

def Func(arg_0):
        """
        Queries MSSQL and returns a cursor of results.

        :return: mssql cursor
        """
        arg_1 = MsSqlHook(mssql_conn_id=arg_0.mssql_conn_id)
        arg_2 = arg_1.get_conn()
        arg_3 = arg_2.cursor()
        arg_3.execute(arg_0.sql)
        return arg_3

Queries MSSQL and returns a cursor of results .


def Func ( arg_0 , arg_1 ) : if PyFunceble . CONFIGURATION [ "logs" ] : if PyFunceble . INTERN [ "referer" ] : arg_2 = PyFunceble . INTERN [ "referer" ] else : arg_2 = None arg_3 = { arg_0 . current_time : { "domain" : PyFunceble . INTERN [ "to_test" ] , "Func" : arg_1 , "whois_server" : arg_2 , } } if arg_0 . output : arg_4 = arg_0 . output else : arg_4 = PyFunceble . OUTPUT_DIRECTORY arg_4 += PyFunceble . OUTPUTS [ "parent_directory" ] arg_4 += PyFunceble . OUTPUTS [ "logs" ] [ "directories" ] [ "parent" ] arg_4 += PyFunceble . OUTPUTS [ "logs" ] [ "filenames" ] [ "date_format" ] arg_5 = arg_0 . _get_content ( arg_4 ) arg_5 . update ( arg_3 ) arg_0 . _write_content ( arg_5 , arg_4 ) if PyFunceble . CONFIGURATION [ "share_logs" ] : PyFunceble . requests . post ( PyFunceble . LINKS [ "api_date_format" ] , data = arg_3 [ arg_0 . current_time ] , )

def Func(arg_0, arg_1):
        """
        Logs the extracted expiration date.

        :param extracted: The extracted expiration date (from WHOIS record).
        :type extracted: str
        """

        if PyFunceble.CONFIGURATION["logs"]:
            # The logs subsystem is activated.

            if PyFunceble.INTERN["referer"]:
                arg_2 = PyFunceble.INTERN["referer"]
            else:
                arg_2 = None

            arg_3 = {
                arg_0.current_time: {
                    "domain": PyFunceble.INTERN["to_test"],
                    "Func": arg_1,
                    "whois_server": arg_2,
                }
            }

            if arg_0.output:
                arg_4 = arg_0.output
            else:
                arg_4 = PyFunceble.OUTPUT_DIRECTORY
                arg_4 += PyFunceble.OUTPUTS["parent_directory"]
                arg_4 += PyFunceble.OUTPUTS["logs"]["directories"]["parent"]
                arg_4 += PyFunceble.OUTPUTS["logs"]["filenames"]["date_format"]

            arg_5 = arg_0._get_content(arg_4)
            arg_5.update(arg_3)

            arg_0._write_content(arg_5, arg_4)

            if PyFunceble.CONFIGURATION["share_logs"]:
                # The logs sharing is activated.

                # And we share the logs with the api.
                PyFunceble.requests.post(
                    PyFunceble.LINKS["api_date_format"],
                    data=arg_3[arg_0.current_time],
                )


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , arg_4 = arg_0 arg_5 = 0 if arg_4 is None : for arg_6 in arg_3 : arg_5 += np . kron ( np . conj ( arg_6 ) , arg_6 ) else : for arg_6 , arg_7 in zip ( arg_3 , arg_4 ) : arg_5 += np . kron ( np . conj ( arg_7 ) , arg_6 ) return arg_5

def Func(arg_0, arg_1, arg_2):
    """Transform Kraus representation to SuperOp representation."""
    arg_3, arg_4 = arg_0
    arg_5 = 0
    if arg_4 is None:
        for arg_6 in arg_3:
            arg_5 += np.kron(np.conj(arg_6), arg_6)
    else:
        for arg_6, arg_7 in zip(arg_3, arg_4):
            arg_5 += np.kron(np.conj(arg_7), arg_6)
    return arg_5

Transform Kraus representation to SuperOp representation .


(contigs, length, outfile, name_by_letters=False, prefix='', seed=None, first_number=1)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 = False , arg_4 = '' , arg_5 = None , arg_6 = 1 ) : random . seed ( a = arg_5 ) arg_7 = utils . open_file_write ( arg_2 ) arg_8 = list ( 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' ) arg_9 = 0 for arg_10 in range ( arg_0 ) : if arg_3 : arg_11 = arg_8 [ arg_9 ] arg_9 += 1 if arg_9 == len ( arg_8 ) : arg_9 = 0 else : arg_11 = str ( arg_10 + arg_6 ) arg_12 = sequences . Fasta ( arg_4 + arg_11 , '' . join ( [ random . choice ( 'ACGT' ) for x in range ( arg_1 ) ] ) ) print ( arg_12 , file = arg_7 ) utils . close ( arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4='', arg_5=None, arg_6=1):
    '''Makes a multi fasta file of random sequences, all the same length'''
    random.seed(a=arg_5)
    arg_7 = utils.open_file_write(arg_2)
    arg_8 = list('ABCDEFGHIJKLMNOPQRSTUVWXYZ')
    arg_9 = 0

    for arg_10 in range(arg_0):
        if arg_3:
            arg_11 = arg_8[arg_9]
            arg_9 += 1
            if arg_9 == len(arg_8):
                arg_9 = 0
        else:
            arg_11 = str(arg_10 + arg_6)

        arg_12 = sequences.Fasta(arg_4 + arg_11, ''.join([random.choice('ACGT') for x in range(arg_1)]))
        print(arg_12, file=arg_7)

    utils.close(arg_7)

Makes a multi fasta file of random sequences all the same length


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
LOG
.
info
(
'Func %s for tenant %s'
%
(
arg_1
,
arg_0
.
tenant_id
)
)
arg_3
=
{
'address_type'
:
ip_types
.
FLOATING
,
'_deallocated'
:
False
}
arg_4
=
db_api
.
floating_ip_find
(
arg_0
,
arg_1
=
arg_1
,
scope
=
db_api
.
ONE
,
**
arg_3
)
if
not
arg_4
:
raise
q_exc
.
FloatingIpNotFound
(
arg_1
=
arg_1
)
return
v
.
_make_floating_ip_dict
(
arg_4
)

def Func(arg_0, arg_1, arg_2=None):
    """Retrieve a floating IP.

    :param context: neutron api request context.
    :param id: The UUID of the floating IP.
    :param fields: a list of strings that are valid keys in a
        floating IP dictionary as listed in the RESOURCE_ATTRIBUTE_MAP
        object in neutron/api/v2/attributes.py. Only these fields
        will be returned.

    :returns: Dictionary containing details for the floating IP.  If values
        are declared in the fields parameter, then only those keys will be
        present.
    """
    LOG.info('Func %s for tenant %s' % (arg_1, arg_0.tenant_id))

    arg_3 = {'address_type': ip_types.FLOATING, '_deallocated': False}

    arg_4 = db_api.floating_ip_find(arg_0, arg_1=arg_1, scope=db_api.ONE,
                                          **arg_3)

    if not arg_4:
        raise q_exc.FloatingIpNotFound(arg_1=arg_1)

    return v._make_floating_ip_dict(arg_4)


(f_stop1, f_pass1, f_pass2, f_stop2, d_pass, d_stop,
                  fs = 1.0, N_bump=5)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5,
                  arg_6 = 1.0, arg_7=5):
    """
    Design an FIR bandpass filter using remez with order
    determination. The filter order is determined based on
    f_stop1 Hz, f_pass1 Hz, f_pass2 Hz, f_stop2 Hz, and the
    desired passband ripple d_pass dB and stopband attenuation
    d_stop dB all relative to a sampling rate of fs Hz.

    Mark Wickert October 2016, updated October 2018
    """
    arg_8, arg_9, arg_10, arg_11 = bandpass_order(arg_0, arg_1, arg_2, arg_3,
                                  arg_4, arg_5, fsamp=arg_6)
    # Bump up the order by N_bump to bring down the final d_pass & d_stop
    arg_12 = arg_8
    arg_12 += arg_7
    arg_13 = signal.remez(arg_12, arg_9, arg_10[0::2], arg_11,Hz=2)
    print('Remez filter taps = %d.' % arg_12)
    return arg_13

Design an FIR bandpass filter using remez with order determination . The filter order is determined based on f_stop1 Hz f_pass1 Hz f_pass2 Hz f_stop2 Hz and the desired passband ripple d_pass dB and stopband attenuation d_stop dB all relative to a sampling rate of fs Hz . Mark Wickert October 2016 updated October 2018


def
Func
(
arg_0
,
arg_1
,
arg_2
=
'PNG'
)
:
arg_3
=
QtGui
.
QFileDialog
(
arg_0
.
_control
,
'Save Image'
)
arg_3
.
setAcceptMode
(
QtGui
.
QFileDialog
.
AcceptSave
)
arg_3
.
setDefaultSuffix
(
arg_2
.
lower
(
)
)
arg_3
.
setNameFilter
(
'%s file (*.%s)'
%
(
arg_2
,
arg_2
.
lower
(
)
)
)
if
arg_3
.
exec_
(
)
:
arg_4
=
arg_3
.
selectedFiles
(
)
[
0
]
arg_5
=
arg_0
.
_get_image
(
arg_1
)
arg_5
.
save
(
arg_4
,
arg_2
)

def Func(arg_0, arg_1, arg_2='PNG'):
        """ Shows a save dialog for the ImageResource with 'name'.
        """
        arg_3 = QtGui.QFileDialog(arg_0._control, 'Save Image')
        arg_3.setAcceptMode(QtGui.QFileDialog.AcceptSave)
        arg_3.setDefaultSuffix(arg_2.lower())
        arg_3.setNameFilter('%s file (*.%s)' % (arg_2, arg_2.lower()))
        if arg_3.exec_():
            arg_4 = arg_3.selectedFiles()[0]
            arg_5 = arg_0._get_image(arg_1)
            arg_5.save(arg_4, arg_2)

Shows a save dialog for the ImageResource with name .


def Func():
    """Clear the output directory."""
    print("Wiping output directory.")
    try:
        if os.path.exists(g_output_dir):
            shutil.rmtree(str(g_output_dir))
    except OSError as e:
        print("ERROR: Removing output directory %s failed: " % g_output_dir)
        print("       (errno {0}): {1}".format(e.errno, e.strerror))
        print("")
        sys.exit(1)


def Func(arg_0, arg_1=None, arg_2=None):
    r'''This function calculates the parameter `Func` as needed in performing
    collision integral calculations.

    .. math::
        T^* = \frac{kT}{\epsilon}

    Examples
    --------
    >>> Func(T=318.2, epsilon_k=308.43)
    1.0316765554582887

    Parameters
    ----------
    epsilon_k : float, optional
        Lennard-Jones depth of potential-energy minimum over k, [K]
    epsilon : float, optional
        Lennard-Jones depth of potential-energy minimum [J]

    Returns
    -------
    Func : float
        Dimentionless temperature for calculating collision integral, [-]

    Notes
    -----
    Tabulated values are normally listed as epsilon/k. k is the Boltzman
    constant, with units of J/K.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006
    '''
    if arg_1:
        arg_3 = arg_0/(arg_1)
    elif arg_2:
        arg_3 = k*arg_0/arg_2
    else:
        raise Exception('Either epsilon/k or epsilon must be provided')
    return arg_3

r'''This function calculates the parameter `Tstar` as needed in performing
    collision integral calculations.

    .. math::
        T^* = \frac{kT}{\epsilon}

    Examples
    --------
    >>> Tstar(T=318.2, epsilon_k=308.43)
    1.0316765554582887

    Parameters
    ----------
    epsilon_k : float, optional
        Lennard-Jones depth of potential-energy minimum over k, [K]
    epsilon : float, optional
        Lennard-Jones depth of potential-energy minimum [J]

    Returns
    -------
    Tstar : float
        Dimentionless temperature for calculating collision integral, [-]

    Notes
    -----
    Tabulated values are normally listed as epsilon/k. k is the Boltzman
    constant, with units of J/K.

    References
    ----------
    .. [1] Bird, R. Byron, Warren E. Stewart, and Edwin N. Lightfoot.
       Transport Phenomena, Revised 2nd Edition. New York:
       John Wiley & Sons, Inc., 2006

r This function calculates the parameter Tstar as needed in performing collision integral calculations .


def Func(arg_0, arg_1):
    """
    Generate directory listing HTML

    Arguments:
        FS (FS): filesystem object to read files from
        filepath (str): path to generate directory listings for

    Keyword Arguments:
        list_dir (callable: list[str]): list file names in a directory
        isdir (callable: bool): os.path.isdir

    Yields:
        str: lines of an HTML table
    """
    yield '
'
    if arg_1 == '/':
        arg_1 = ''
    for arg_2 in arg_0.listdir(arg_1):
        arg_3 = pathjoin(arg_1, arg_2)
        if arg_0.isdir(arg_3):
            arg_3 = arg_3 + '/'
        yield u'
{0}
'.format(
            cgi.escape(arg_3))  # TODO XXX
    yield '
'


def Func(arg_0, arg_1, arg_2=1):
        """Increment the GTFS-definition of "day start".

        Parameters
        ----------
        day_start_ut : int
            unixtime of the previous start of day.  If this time is between
            12:00 or greater, there *will* be bugs.  To solve this, run the
            input through day_start_ut first.
        n_days: int
            number of days to increment
        """
        arg_3 = arg_0.set_current_process_time_zone()
        arg_4 = time.localtime(arg_1 + 43200)  # time of noon
        arg_5 = time.mktime(arg_4[:2] +  # YYYY, MM
                           (arg_4[2] + arg_2,) +  # DD
                           (12, 00, 0, 0, 0, -1)) - 43200  # HHMM, etc.  Minus 12 hours.
        set_process_timezone(arg_3)
        return arg_5

Increment the GTFS - definition of day start .


(self,reuse_branch_len=True, prune_short=True,
                                    marginal_sequences=False, branch_length_mode='joint',
                                    max_iter=5, infer_gtr=False, **kwargs)

def Func(arg_0,arg_1=True, arg_2=True,
                                    arg_3=False, arg_4='joint',
                                    arg_5=5, arg_6=False, **arg_7):
        """
        Iteratively set branch lengths and reconstruct ancestral sequences until
        the values of either former or latter do not change. The algorithm assumes
        knowing only the topology of the tree, and requires that sequences are assigned
        to all leaves of the tree.

        The first step is to pre-reconstruct ancestral
        states using Fitch reconstruction algorithm or ML using existing branch length
        estimates. Then, optimize branch lengths and re-do reconstruction until
        convergence using ML method.

        Parameters
        -----------

         reuse_branch_len : bool
            If True, rely on the initial branch lengths, and start with the
            maximum-likelihood ancestral sequence inference using existing branch
            lengths. Otherwise, do initial reconstruction of ancestral states with
            Fitch algorithm, which uses only the tree topology.

         prune_short : bool
            If True, the branches with zero optimal length will be pruned from
            the tree, creating polytomies. The polytomies could be further
            processed using :py:meth:`treetime.TreeTime.resolve_polytomies` from the TreeTime class.

         marginal_sequences : bool
            Assign sequences to their marginally most likely value, rather than
            the values that are jointly most likely across all nodes.

         branch_length_mode : str
            'joint', 'marginal', or 'input'. Branch lengths are left unchanged in case
            of 'input'. 'joint' and 'marginal' cause branch length optimization
            while setting sequences to the ML value or tracing over all possible
            internal sequence states.

         max_iter : int
            Maximal number of times sequence and branch length iteration are optimized

         infer_gtr : bool
            Infer a GTR model from the observed substitutions.

        """
        if arg_4=='marginal':
            arg_3 = True

        arg_0.logger("TreeAnc.optimize_sequences_and_branch_length: sequences...", 1)
        if arg_1:
            arg_8 = arg_0.reconstruct_anc(method='probabilistic', arg_6=arg_6,
                                          marginal=arg_3, **arg_7)
            arg_0.optimize_branch_len(verbose=0, store_old=False, mode=arg_4)
        else:
            arg_8 = arg_0.reconstruct_anc(method='fitch', arg_6=arg_6, **arg_7)

            arg_0.optimize_branch_len(verbose=0, store_old=False, marginal=False)

        arg_9 = 0
        while arg_9<arg_5:
            arg_9 += 1
            if arg_2:
                arg_0.prune_short_branches()
            arg_8 = arg_0.reconstruct_anc(method='probabilistic', arg_6=False,
                                          marginal=arg_3, **arg_7)

            arg_0.logger("TreeAnc.optimize_sequences_and_branch_length: Iteration %d."
                   " #Nuc changed since prev reconstructions: %d" %(arg_9, arg_8), 2)

            if arg_8 < 1:
                break
            arg_0.optimize_branch_len(verbose=0, store_old=False, mode=arg_4)

        arg_0.tree.unconstrained_sequence_LH = (arg_0.tree.sequence_LH*arg_0.multiplicity).sum()
        arg_0._prepare_nodes() # fix dist2root and up-links after reconstruction
        arg_0.logger("TreeAnc.optimize_sequences_and_branch_length: Unconstrained sequence LH:%f" % arg_0.tree.unconstrained_sequence_LH , 2)
        return ttconf.SUCCESS

Iteratively set branch lengths and reconstruct ancestral sequences until the values of either former or latter do not change . The algorithm assumes knowing only the topology of the tree and requires that sequences are assigned to all leaves of the tree .


def Func ( arg_0 , arg_1 , arg_2 = 'union' ) : arg_3 = sequences . file_reader ( arg_0 ) arg_4 = [ ] for arg_5 in arg_3 : arg_4 . append ( copy . copy ( arg_5 ) ) arg_6 = '' . join ( [ arg_5 . seq for arg_5 in arg_4 ] ) if type ( arg_4 [ 0 ] ) == sequences . Fastq : arg_7 = '' . join ( [ arg_5 . qual for arg_5 in arg_4 ] ) arg_4 [ : ] = [ ] arg_8 = sequences . Fastq ( arg_2 , arg_6 , arg_7 ) else : arg_8 = sequences . Fasta ( arg_2 , arg_6 ) arg_4 [ : ] = [ ] arg_9 = utils . open_file_write ( arg_1 ) print ( arg_8 , file = arg_9 ) utils . close ( arg_9 )

def Func(arg_0, arg_1, arg_2='union'):
    '''Takes a multi fasta or fastq file and writes a new file that contains just one sequence, with the original sequences catted together, preserving their order'''
    arg_3 = sequences.file_reader(arg_0)
    arg_4 = []

    for arg_5 in arg_3:
        arg_4.append(copy.copy(arg_5))

    arg_6 = ''.join([arg_5.seq for arg_5 in arg_4])

    if type(arg_4[0]) == sequences.Fastq:
        arg_7 = ''.join([arg_5.qual for arg_5 in arg_4])
        arg_4[:] = []
        arg_8 = sequences.Fastq(arg_2, arg_6, arg_7)
    else:
        arg_8 = sequences.Fasta(arg_2, arg_6)
        arg_4[:] = []

    arg_9 = utils.open_file_write(arg_1)
    print(arg_8, file=arg_9)
    utils.close(arg_9)

Takes a multi fasta or fastq file and writes a new file that contains just one sequence with the original sequences catted together preserving their order


def Func ( arg_0 ) : arg_1 = arg_0 . through . _meta . get_field ( 'content_object' ) . remote_field . get_accessor_name ( ) return getattr ( arg_0 . instance , arg_1 )

def Func(arg_0):
        """Return the manager that handles the relation from this instance to the tagged_item class.
        If content_object on the tagged_item class is defined as a ParentalKey, this will be a
        DeferringRelatedManager which allows writing related objects without committing them
        to the database.
        """
        arg_1 = arg_0.through._meta.get_field('content_object').remote_field.get_accessor_name()
        return getattr(arg_0.instance, arg_1)

Return the manager that handles the relation from this instance to the tagged_item class . If content_object on the tagged_item class is defined as a ParentalKey this will be a DeferringRelatedManager which allows writing related objects without committing them to the database .


def Func ( arg_0 ) : arg_1 = ( ( ( datetime . date , datetime . time ) , lambda x : x . isoformat ( ) , ) , ( ( datetime . datetime , ) , lambda x : dt2utc_timestamp ( x ) , ) , ) for arg_2 , arg_3 in arg_1 : if isinstance ( arg_0 , arg_2 ) : return arg_3 ( arg_0 )

def Func(arg_0):
    """Default serializer for json."""
    arg_1 = (
        ((datetime.date, datetime.time),
         lambda x: x.isoformat(), ),
        ((datetime.datetime, ),
         lambda x: dt2utc_timestamp(x), ),
    )
    for arg_2, arg_3 in arg_1:
        if isinstance(arg_0, arg_2):
            return arg_3(arg_0)


def Func ( arg_0 , arg_1 ) : if arg_1 is arg_0 . a : return arg_0 . a = arg_1 arg_0 . matching_blocks = arg_0 . opcodes = None

def Func(arg_0, arg_1):
        """Set the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.Func("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .Func(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().
        """

        if arg_1 is arg_0.a:
            return
        arg_0.a = arg_1
        arg_0.matching_blocks = arg_0.opcodes = None

Set the first sequence to be compared.

        The second sequence to be compared is not changed.

        >>> s = SequenceMatcher(None, "abcd", "bcde")
        >>> s.ratio()
        0.75
        >>> s.set_seq1("bcde")
        >>> s.ratio()
        1.0
        >>>

        SequenceMatcher computes and caches detailed information about the
        second sequence, so if you want to compare one sequence S against
        many sequences, use .set_seq2(S) once and call .set_seq1(x)
        repeatedly for each of the other sequences.

        See also set_seqs() and set_seq2().


(data, figsize=None, number_to_keep=None,
                    sort='asc', legend=None)

"""    <script>        requirejs.config({            paths: {                qVisualization: "https://qvisualization.mybluemix.net/q-visualizations"            }        });        require(["qVisualization"], function(qVisualizations) {            qVisualizations.plotState("histogram_$divNumber",                                      "histogram",                                      $executions,                                      $options);        });    </script>    """

def Func(arg_0, arg_1=None, arg_2=None,
                    arg_3='asc', arg_4=None):
    """ Create a histogram representation.

        Graphical representation of the input array using a vertical bars
        style graph.

        Args:
            data (list or dict):  This is either a list of dicts or a single
                dict containing the values to represent (ex. {'001' : 130})
            figsize (tuple): Figure size in pixels.
            number_to_keep (int): The number of terms to plot and
                rest is made into a single bar called other values
            sort (string): Could be 'asc' or 'desc'
            legend (list): A list of strings to use for labels of the data.
                The number of entries must match the length of data.
        Raises:
            VisualizationError: When legend is provided and the length doesn't
                match the input data.
    """

    # HTML
    arg_5 = Template("""

    """)

    # JavaScript
    arg_6 = Template("""

    """)

    # Process data and execute
    arg_7 = str(time.time())
    arg_7 = re.sub('[.]', '', arg_7)

    # set default figure size if none provided
    if arg_1 is None:
        arg_1 = (7, 5)

    arg_8 = {'number_to_keep': 0 if arg_2 is None else arg_2,
               'sort': arg_3,
               'show_legend': 0,
               'width': int(arg_1[0]),
               'height': int(arg_1[1])}
    if arg_4:
        arg_8['show_legend'] = 1

    arg_9 = []
    if isinstance(arg_0, dict):
        arg_0 = [arg_0]

    if arg_4 and len(arg_4) != len(arg_0):
        raise VisualizationError("Length of legendL (%s) doesn't match number "
                                 "of input executions: %s" %
                                 (len(arg_4), len(arg_0)))

    for arg_10, arg_11 in enumerate(arg_0):
        arg_12 = process_data(arg_11, arg_8['number_to_keep'])
        arg_13 = {'data': arg_12}
        if arg_4:
            arg_13['name'] = arg_4[arg_10]
        arg_9.append(arg_13)

    arg_14 = arg_5.substitute({
        'divNumber': arg_7
    })

    arg_15 = arg_6.substitute({
        'divNumber': arg_7,
        'executions': arg_9,
        'options': arg_8
    })

    display(HTML(arg_14 + arg_15))


(self, i, r,
                                 summarize=False,
                                 report_unexpected_exceptions=True,
                                 context=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
,
arg_4
=
True
,
arg_5
=
)
:
for
arg_6
,
arg_7
,
arg_8
,
arg_9
in
arg_0
.
_record_predicates
:
if
arg_1
%
arg_9
==
0
:
arg_10
=
arg_0
.
_as_dict
(
arg_2
)
try
:
arg_11
=
arg_6
(
arg_10
)
if
not
arg_11
:
arg_12
=
{
'code'
:
arg_7
}
if
not
arg_3
:
arg_12
[
'message'
]
=
arg_8
arg_12
[
'row'
]
=
arg_1
+
1
arg_12
[
'record'
]
=
arg_2
if
arg_5
is
not
:
arg_12
[
'context'
]
=
arg_5
yield
arg_12
except
Exception
as
e
:
if
arg_4
:
arg_12
=
{
'code'
:
UNEXPECTED_EXCEPTION
}
if
not
arg_3
:
arg_12
[
'message'
]
=
MESSAGES
[
UNEXPECTED_EXCEPTION
]
%
(
e
.
__class__
.
__name__
,
e
)
arg_12
[
'row'
]
=
arg_1
+
1
arg_12
[
'record'
]
=
arg_2
arg_12
[
'exception'
]
=
e
arg_12
[
'function'
]
=
'%s: %s'
%
(
arg_6
.
__name__
,
arg_6
.
__doc__
)
if
arg_5
is
not
:
arg_12
[
'context'
]
=
arg_5
yield
arg_12

def Func(arg_0, arg_1, arg_2,
                                 arg_3=False,
                                 arg_4=True,
                                 arg_5=None):
        """Apply record predicates on `r`."""

        for arg_6, arg_7, arg_8, arg_9 in arg_0._record_predicates:
            if arg_1 % arg_9 == 0: # support sampling
                arg_10 = arg_0._as_dict(arg_2)
                try:
                    arg_11 = arg_6(arg_10)
                    if not arg_11:
                        arg_12 = {'code': arg_7}
                        if not arg_3:
                            arg_12['message'] = arg_8
                            arg_12['row'] = arg_1 + 1
                            arg_12['record'] = arg_2
                            if arg_5 is not None: arg_12['context'] = arg_5
                        yield arg_12
                except Exception as e:
                    if arg_4:
                        arg_12 = {'code': UNEXPECTED_EXCEPTION}
                        if not arg_3:
                            arg_12['message'] = MESSAGES[UNEXPECTED_EXCEPTION] % (e.__class__.__name__, e)
                            arg_12['row'] = arg_1 + 1
                            arg_12['record'] = arg_2
                            arg_12['exception'] = e
                            arg_12['function'] = '%s: %s' % (arg_6.__name__,
                                                        arg_6.__doc__)
                            if arg_5 is not None: arg_12['context'] = arg_5
                        yield arg_12


def Func ( arg_0 ) : arg_1 = '' for arg_2 in [ 'authorization_uri' , 'authorization' ] : arg_1 = arg_0 . get_value ( arg_2 ) or '' if arg_1 : break return arg_1

def Func(arg_0):
        """ Returns the URI for the authorization server if present, otherwise empty string. """
        arg_1 = ''
        for arg_2 in ['authorization_uri', 'authorization']:
            arg_1 = arg_0.get_value(arg_2) or ''
            if arg_1:
                break
        return arg_1

Returns the URI for the authorization server if present otherwise empty string .


(boundaries_id, labels_id, config,
                          annotator_id)

return file_name + msaf.config.results_ext

def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : utils . ensure_dir ( msaf . config . results_dir ) arg_4 = os . path . join ( msaf . config . results_dir , "results" ) arg_4 += "_boundsE%s_labelsE%s" % ( arg_0 , arg_1 ) arg_4 += "_annotatorE%d" % ( arg_3 ) arg_5 = sorted ( arg_2 . keys ( ) , arg_6 = str . lower ) for arg_6 in arg_5 : arg_4 += "_%sE%s" % ( arg_6 , str ( arg_2 [ arg_6 ] ) . replace ( "/" , "_" ) ) if len ( arg_4 ) > 255 - len ( msaf . config . results_ext ) : arg_4 = arg_4 [ : 255 - len ( msaf . config . results_ext ) ] return arg_4 + msaf . config . results_ext

def Func(arg_0, arg_1, arg_2,
                          arg_3):
    """Based on the config and the dataset, get the file name to store the
    results."""
    utils.ensure_dir(msaf.config.results_dir)
    arg_4 = os.path.join(msaf.config.results_dir, "results")
    arg_4 += "_boundsE%s_labelsE%s" % (arg_0, arg_1)
    arg_4 += "_annotatorE%d" % (arg_3)
    arg_5 = sorted(arg_2.keys(), arg_6=str.lower)
    for arg_6 in arg_5:
        arg_4 += "_%sE%s" % (arg_6, str(arg_2[arg_6]).replace("/", "_"))

    # Check for max file length
    if len(arg_4) > 255 - len(msaf.config.results_ext):
        arg_4 = arg_4[:255 - len(msaf.config.results_ext)]

    return arg_4 + msaf.config.results_ext

Based on the config and the dataset get the file name to store the results .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if not arg_0 . index : arg_0 . make_index ( ) arg_3 = arg_0 . index . get ( arg_1 , None ) arg_4 = getattr ( arg_3 , 'text' , arg_2 ) return arg_4

def Func(arg_0, arg_1, arg_2=None):
        """ Find the comment block just before the given line number.

        Returns None (or the specified default) if there is no such block.
        """
        if not arg_0.index:
            arg_0.make_index()
        arg_3 = arg_0.index.get(arg_1, None)
        arg_4 = getattr(arg_3, 'text', arg_2)
        return arg_4

Find the comment block just before the given line number .


def Func(arg_0, arg_1=True):
        '''Validate a JAMS object against the schema.

        Parameters
        ----------
        strict : bool
            If `True`, an exception will be raised on validation failure.
            If `False`, a warning will be raised on validation failure.

        Returns
        -------
        valid : bool
            `True` if the object passes schema validation.
            `False` otherwise.

        Raises
        ------
        SchemaError
            If `strict==True` and the JAMS object does not match the schema

        See Also
        --------
        jsonschema.Func

        '''
        arg_2 = True
        try:
            jsonschema.Func(arg_0.__json_light__, schema.JAMS_SCHEMA)

            for arg_3 in arg_0.annotations:
                if isinstance(arg_3, Annotation):
                    arg_2 &= arg_3.Func(arg_1=arg_1)
                else:
                    arg_4 = '{} is not a well-formed JAMS Annotation'.format(arg_3)
                    arg_2 = False
                    if arg_1:
                        raise SchemaError(arg_4)
                    else:
                        warnings.warn(str(arg_4))

        except jsonschema.ValidationError as invalid:
            if arg_1:
                raise SchemaError(str(invalid))
            else:
                warnings.warn(str(invalid))

            arg_2 = False

        return arg_2

Validate a JAMS object against the schema.

        Parameters
        ----------
        strict : bool
            If `True`, an exception will be raised on validation failure.
            If `False`, a warning will be raised on validation failure.

        Returns
        -------
        valid : bool
            `True` if the object passes schema validation.
            `False` otherwise.

        Raises
        ------
        SchemaError
            If `strict==True` and the JAMS object does not match the schema

        See Also
        --------
        jsonschema.validate

Validate a JAMS object against the schema .


def
Func
(
arg_0
,
arg_1
)
:
with
tf
.
name_scope
(
"Func"
)
:
def
scaled_identity
(
arg_0
)
:
return
tf
.
linalg
.
LinearOperatorScaledIdentity
(
num_rows
=
arg_1
.
range_dimension_tensor
(
)
,
multiplier
=
arg_0
,
is_non_singular
=
arg_1
.
is_non_singular
,
is_self_adjoint
=
arg_1
.
is_self_adjoint
,
is_positive_definite
=
arg_1
.
is_positive_definite
)
if
isinstance
(
arg_1
,
tf
.
linalg
.
LinearOperatorIdentity
)
:
return
scaled_identity
(
arg_0
)
if
isinstance
(
arg_1
,
tf
.
linalg
.
LinearOperatorScaledIdentity
)
:
return
scaled_identity
(
arg_0
*
arg_1
.
multiplier
)
if
isinstance
(
arg_1
,
tf
.
linalg
.
LinearOperatorDiag
)
:
return
tf
.
linalg
.
LinearOperatorDiag
(
diag
=
arg_0
[
...
,
tf
.
newaxis
]
*
arg_1
.
diag_part
(
)
,
is_non_singular
=
arg_1
.
is_non_singular
,
is_self_adjoint
=
arg_1
.
is_self_adjoint
,
is_positive_definite
=
arg_1
.
is_positive_definite
)
if
isinstance
(
arg_1
,
tf
.
linalg
.
LinearOperatorLowerTriangular
)
:
return
tf
.
linalg
.
LinearOperatorLowerTriangular
(
tril
=
arg_0
[
...
,
tf
.
newaxis
,
tf
.
newaxis
]
*
arg_1
.
to_dense
(
)
,
is_non_singular
=
arg_1
.
is_non_singular
,
is_self_adjoint
=
arg_1
.
is_self_adjoint
,
is_positive_definite
=
arg_1
.
is_positive_definite
)
raise
NotImplementedError
(
"Unsupported Linop type ({})"
.
format
(
type
(
arg_1
)
.
__name__
)
)

def Func(arg_0, arg_1):
  """Creates weighted `LinOp` from existing `LinOp`."""
  # We assume w > 0. (This assumption only relates to the is_* attributes.)
  with tf.name_scope("Func"):
    # TODO(b/35301104): LinearOperatorComposition doesn't combine operators, so
    # special case combinations here. Once it does, this function can be
    # replaced by:
    #     return linop_composition_lib.LinearOperatorComposition([
    #         scaled_identity(w), op])
    def scaled_identity(arg_0):
      return tf.linalg.LinearOperatorScaledIdentity(
          num_rows=arg_1.range_dimension_tensor(),
          multiplier=arg_0,
          is_non_singular=arg_1.is_non_singular,
          is_self_adjoint=arg_1.is_self_adjoint,
          is_positive_definite=arg_1.is_positive_definite)

    if isinstance(arg_1, tf.linalg.LinearOperatorIdentity):
      return scaled_identity(arg_0)
    if isinstance(arg_1, tf.linalg.LinearOperatorScaledIdentity):
      return scaled_identity(arg_0 * arg_1.multiplier)
    if isinstance(arg_1, tf.linalg.LinearOperatorDiag):
      return tf.linalg.LinearOperatorDiag(
          diag=arg_0[..., tf.newaxis] * arg_1.diag_part(),
          is_non_singular=arg_1.is_non_singular,
          is_self_adjoint=arg_1.is_self_adjoint,
          is_positive_definite=arg_1.is_positive_definite)
    if isinstance(arg_1, tf.linalg.LinearOperatorLowerTriangular):
      return tf.linalg.LinearOperatorLowerTriangular(
          tril=arg_0[..., tf.newaxis, tf.newaxis] * arg_1.to_dense(),
          is_non_singular=arg_1.is_non_singular,
          is_self_adjoint=arg_1.is_self_adjoint,
          is_positive_definite=arg_1.is_positive_definite)
    raise NotImplementedError(
        "Unsupported Linop type ({})".format(type(arg_1).__name__))

Creates weighted LinOp from existing LinOp .


def Func ( arg_0 , arg_1 ) : if '#' in arg_0 : return False arg_2 = re . match ( r'\s*(.*)\s*:\s*(.*),\s*$' , arg_0 ) if not arg_2 : return False try : arg_3 = ast . literal_eval ( arg_2 . group ( 1 ) ) except ( SyntaxError , ValueError ) : return False if multiline_statement ( arg_2 . group ( 2 ) ) : return False return arg_3 == arg_1

def Func(arg_0, arg_1):
    """Return True if `line` is a dict entry that uses `key`.

    Return False for multiline cases where the line should not be removed by
    itself.

    """
    if '#' in arg_0:
        return False

    arg_2 = re.match(r'\s*(.*)\s*:\s*(.*),\s*$', arg_0)
    if not arg_2:
        return False

    try:
        arg_3 = ast.literal_eval(arg_2.group(1))
    except (SyntaxError, ValueError):
        return False

    if multiline_statement(arg_2.group(2)):
        return False

    return arg_3 == arg_1

Return True if line is a dict entry that uses key .


return self._render_config("pipeline_graph.html", {"data": dict_viz})

def
Func
(
arg_0
)
:
arg_1
=
{
"name"
:
"root"
,
"children"
:
[
]
}
arg_2
=
{
}
arg_3
=
arg_0
.
_fork_tree
if
arg_0
.
_fork_tree
else
{
1
:
[
1
]
}
for
arg_4
,
(
arg_5
,
arg_6
)
in
enumerate
(
arg_3
.
items
(
)
)
:
for
arg_7
in
arg_0
.
processes
[
1
:
]
:
if
arg_4
==
0
and
arg_7
.
lane
not
in
[
arg_5
]
+
arg_6
:
continue
if
arg_4
>
0
and
arg_7
.
lane
not
in
arg_6
:
continue
if
not
arg_7
.
parent_lane
:
arg_8
=
arg_1
[
"children"
]
else
:
arg_8
=
arg_2
[
arg_7
.
parent_lane
]
arg_9
=
{
"name"
:
"{}_{}"
.
format
(
arg_7
.
template
,
arg_7
.
pid
)
,
"process"
:
{
"pid"
:
arg_7
.
pid
,
"input"
:
arg_7
.
input_type
,
"output"
:
arg_7
.
output_type
if
arg_7
.
output_type
else
"None"
,
"lane"
:
arg_7
.
lane
,
}
,
"children"
:
[
]
}
arg_10
=
""
for
arg_11
,
arg_12
in
arg_7
.
directives
.
items
(
)
:
arg_10
+=
arg_11
for
arg_13
in
arg_12
:
try
:
arg_14
=
arg_12
[
arg_13
]
.
replace
(
"'"
,
""
)
.
replace
(
'"'
,
''
)
if
isinstance
(
arg_12
[
arg_13
]
,
str
)
else
arg_12
[
arg_13
]
arg_10
+=
"{}: {}"
.
format
(
arg_13
,
arg_14
)
except
KeyError
:
pass
if
arg_10
:
arg_9
[
"process"
]
[
"directives"
]
=
arg_10
else
:
arg_9
[
"process"
]
[
"directives"
]
=
"N/A"
arg_8
.
append
(
arg_9
)
arg_2
[
arg_7
.
lane
]
=
arg_8
[
1
]
[
"children"
]
arg_0
.
dag_to_file
(
arg_1
)
with
open
(
os
.
path
.
join
(
dirname
(
arg_0
.
nf_file
)
,
".forkTree.json"
)
,
"w"
)
as
fh
:
fh
.
write
(
json
.
dumps
(
arg_0
.
_fork_tree
)
)
return
arg_0
.
_render_config
(
"pipeline_graph.html"
,
{
"data"
:
arg_1
}
)

def Func(arg_0):
        """Write pipeline attributes to json

        This function writes the pipeline and their attributes to a json file,
        that is intended to be read by resources/pipeline_graph.html to render
        a graphical output showing the DAG.

        """

        arg_1 = {
            "name": "root",
            "children": []
        }
        arg_2 = {}

        arg_3 = arg_0._fork_tree if arg_0._fork_tree else {1: [1]}

        for arg_4, (arg_5, arg_6) in enumerate(arg_3.items()):
            for arg_7 in arg_0.processes[1:]:

                if arg_4 == 0 and arg_7.lane not in [arg_5] + arg_6:
                    continue

                if arg_4 > 0 and arg_7.lane not in arg_6:
                    continue

                if not arg_7.parent_lane:
                    arg_8 = arg_1["children"]
                else:
                    arg_8 = arg_2[arg_7.parent_lane]

                arg_9 = {
                    "name": "{}_{}".format(arg_7.template, arg_7.pid),
                    "process": {
                        "pid": arg_7.pid,
                        "input": arg_7.input_type,
                        "output": arg_7.output_type if arg_7.output_type else "None",
                        "lane": arg_7.lane,
                    },
                    "children": []
                }

                arg_10 = ""
                for arg_11, arg_12 in arg_7.directives.items():
                    arg_10 += arg_11
                    for arg_13 in arg_12:
                        try:
                            # Remove quotes from string directives
                            arg_14 = arg_12[arg_13].replace("'", "").replace('"', '') \
                                if isinstance(arg_12[arg_13], str) else arg_12[arg_13]
                            arg_10 += "{}: {}".format(arg_13, arg_14)
                        except KeyError:
                            pass

                if arg_10:
                    arg_9["process"]["directives"] = arg_10
                else:
                    arg_9["process"]["directives"] = "N/A"

                arg_8.append(arg_9)

                arg_2[arg_7.lane] = arg_8[-1]["children"]

        # write to file dict_viz
        arg_0.dag_to_file(arg_1)

        # Write tree forking information for dotfile
        with open(os.path.join(dirname(arg_0.nf_file),
                               ".forkTree.json"), "w") as fh:
            fh.write(json.dumps(arg_0._fork_tree))

        # send with jinja to html resource
        return arg_0._render_config("pipeline_graph.html", {"data": arg_1})


Return a full copy of the object, optionally renaming it.

def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . name return ColorScheme ( arg_1 , arg_0 . colors . dict ( ) )

def Func(arg_0,arg_1=None):
        """Return a full Func of the object, optionally renaming it."""
        if arg_1 is None:
            arg_1 = arg_0.name
        return ColorScheme(arg_1, arg_0.colors.dict())

Return a full copy of the object optionally renaming it .


(returns, positions, transactions,
                               market_data,
                               liquidation_daily_vol_limit=0.2,
                               trade_daily_vol_limit=0.05,
                               last_n_days=utils.APPROX_BDAYS_PER_MONTH * 6,
                               days_to_liquidate_limit=1,
                               estimate_intraday='infer')

def Func(arg_0, arg_1, arg_2,
                               arg_3,
                               arg_4=0.2,
                               arg_5=0.05,
                               arg_6=arg_7.APPROX_BDAYS_PER_MONTH * 6,
                               arg_9=1,
                               arg_10='infer'):
    """
    Generates a report detailing portfolio size constraints set by
    least liquid tickers. Plots a "capacity sweep," a curve describing
    projected sharpe ratio given the slippage penalties that are
    applied at various capital bases.

    Parameters
    ----------
    returns : pd.Series
        Daily returns of the strategy, noncumulative.
         - See full explanation in create_full_tear_sheet.
    positions : pd.DataFrame
        Daily net position values.
         - See full explanation in create_full_tear_sheet.
    transactions : pd.DataFrame
        Prices and amounts of executed trades. One row per trade.
         - See full explanation in create_full_tear_sheet.
    market_data : pd.Panel
        Panel with items axis of 'price' and 'volume' DataFrames.
        The major and minor axes should match those of the
        the passed positions DataFrame (same dates and symbols).
    liquidation_daily_vol_limit : float
        Max proportion of a daily bar that can be consumed in the
        process of liquidating a position in the
        "days to liquidation" analysis.
    trade_daily_vol_limit : float
        Flag daily transaction totals that exceed proportion of
        daily bar.
    last_n_days : integer
        Compute max position allocation and dollar volume for only
        the last N days of the backtest
    days_to_liquidate_limit : integer
        Display all tickers with greater max days to liquidation.
    estimate_intraday: boolean or str, optional
        Approximate returns for intraday strategies.
        See description in create_full_tear_sheet.
    """

    arg_1 = arg_7.check_intraday(arg_10, arg_0,
                                     arg_1, arg_2)

    print("Max days to liquidation is computed for each traded name "
          "assuming a 20% limit on daily bar consumption \n"
          "and trailing 5 day mean volume as the available bar volume.\n\n"
          "Tickers with >1 day liquidation time at a"
          " constant $1m capital base:")

    arg_11 = capacity.get_max_days_to_liquidate_by_ticker(
        arg_1, arg_3,
        max_bar_consumption=arg_4,
        capital_base=1e6,
        mean_volume_window=5)
    arg_11.index = (
        arg_11.index.map(arg_7.format_asset))

    print("Whole backtest:")
    arg_7.print_table(
        arg_11[arg_11.days_to_liquidate >
                           arg_9])

    arg_13 = capacity.get_max_days_to_liquidate_by_ticker(
        arg_1, arg_3,
        max_bar_consumption=arg_4,
        capital_base=1e6,
        mean_volume_window=5,
        arg_6=arg_6)
    arg_13.index = (
        arg_13.index.map(arg_7.format_asset))

    print("Last {} trading days:".format(arg_6))
    arg_7.print_table(
        arg_13[arg_13.days_to_liquidate > 1])

    arg_14 = capacity.get_low_liquidity_transactions(arg_2, arg_3)
    arg_14.index = arg_14.index.map(arg_7.format_asset)

    print('Tickers with daily transactions consuming >{}% of daily bar \n'
          'all backtest:'.format(arg_5 * 100))
    arg_7.print_table(
        arg_14[arg_14['max_pct_bar_consumed'] > arg_5 * 100])

    arg_14 = capacity.get_low_liquidity_transactions(
        arg_2, arg_3, arg_6=arg_6)

    print("Last {} trading days:".format(arg_6))
    arg_7.print_table(
        arg_14[arg_14['max_pct_bar_consumed'] > arg_5 * 100])

    arg_15 = arg_1.iloc[0].sum() / (1 + arg_0.iloc[0])
    arg_16, arg_17 = plt.subplots(figsize=(14, 6))
    plotting.plot_capacity_sweep(arg_0, arg_2, arg_3,
                                 arg_15,
                                 min_pv=100000,
                                 max_pv=300000000,
                                 step_size=1000000,
                                 ax=arg_17)

Generates a report detailing portfolio size constraints set by least liquid tickers . Plots a capacity sweep a curve describing projected sharpe ratio given the slippage penalties that are applied at various capital bases .


def Func(arg_0, arg_1, arg_2=False):
        """Update a reference."""

        arg_3 = ['git', 'update-ref']

        if arg_2:
            arg_3.extend(['-d', arg_1.refname])
            arg_4 = 'deleted'
        else:
            arg_3.extend([arg_1.refname, arg_1.hash])
            arg_4 = 'updated to %s' % arg_1.hash

        try:
            arg_0._exec(arg_3, cwd=arg_0.dirpath, env=arg_0.gitenv)
        except RepositoryError as e:
            logger.warning("Git %s ref could not be %s during sync process in %s (%s); skipped",
                           arg_1.refname, arg_4, arg_0.uri, arg_0.dirpath)
        else:
            logger.debug("Git %s ref %s in %s (%s)",
                         arg_1.refname, arg_4, arg_0.uri, arg_0.dirpath)


def Func ( * arg_0 ) : arg_1 = [ a for a in settings . INSTALLED_APPS if a not in arg_0 ] return override_settings ( INSTALLED_APPS = arg_1 )

def Func(*arg_0):
    """
    Class decorator that makes sure the passed apps are not present in
    INSTALLED_APPS.
    """
    arg_1 = [a for a in settings.INSTALLED_APPS if a not in arg_0]
    return override_settings(INSTALLED_APPS=arg_1)

Class decorator that makes sure the passed apps are not present in INSTALLED_APPS .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_4 = [ ] for arg_5 in arg_3 : arg_6 = FileInstance . create ( ) . set_uri ( arg_5 [ 'full_path' ] , arg_5 [ 'size' ] , 'md5:{0}' . format ( arg_5 [ 'checksum' ] ) , ) arg_7 = ObjectVersion . create ( arg_1 , arg_2 ) . set_file ( arg_6 ) arg_7 . created = arrow . get ( arg_5 [ 'creation_date' ] ) . datetime . replace ( tzinfo = None ) arg_4 . append ( arg_7 ) db . session . commit ( ) return arg_4 [ - 1 ]

def Func(arg_0, arg_1, arg_2, arg_3):
        """Create a single file with all versions."""
        arg_4 = []
        for arg_5 in arg_3:
            arg_6 = FileInstance.create().set_uri(
                arg_5['full_path'],
                arg_5['size'],
                'md5:{0}'.format(arg_5['checksum']),
            )
            arg_7 = ObjectVersion.create(arg_1, arg_2).set_file(arg_6)
            arg_7.created = arrow.get(
                arg_5['creation_date']).datetime.replace(tzinfo=None)
            arg_4.append(arg_7)

        # Set head version
        db.session.commit()
        return arg_4[-1]

Create a single file with all versions .


async def Func ( arg_0 ) : arg_1 = await arg_0 . api . execute_method ( arg_0 . RTM_START_ENDPOINT , simple_latest = True , no_unreads = True , ) return arg_1 [ 'url' ]

async def Func(arg_0):
        """Get the WebSocket URL for the RTM session.

        Warning:
          The URL expires if the session is not joined within 30
          seconds of the API call to the start endpoint.

        Returns:
          :py:class:`str`: The socket URL.

        """
        arg_1 = await arg_0.api.execute_method(
            arg_0.RTM_START_ENDPOINT,
            simple_latest=True,
            no_unreads=True,
        )
        return arg_1['url']

Get the WebSocket URL for the RTM session .


def Func ( ) : arg_0 = collections . OrderedDict ( { } ) def record ( arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_3 . get ( "name" ) arg_5 = interceptable ( arg_1 ) ( * arg_2 , ** arg_3 ) if arg_4 : arg_0 [ arg_4 ] = arg_5 return arg_5 with interception ( record ) : yield arg_0

def Func():
  """Context manager for recording interceptable executions onto a Func.

  Similar to `tf.GradientTape`, operations are recorded if they are executed
  within this context manager. In addition, the operation must be registered
  (wrapped) as `ed.interceptable`.

  Yields:
    Func: OrderedDict where operations are recorded in sequence. Keys are
      the `name` keyword argument to the operation (typically, a random
      variable's `name`) and values are the corresponding output of the
      operation. If the operation has no name, it is not recorded.

  #### Examples

  ```python
  from tensorflow_probability import edward2 as ed

  def probabilistic_matrix_factorization():
    users = ed.Normal(0., 1., sample_shape=[5000, 128], name="users")
    items = ed.Normal(0., 1., sample_shape=[7500, 128], name="items")
    ratings = ed.Normal(loc=tf.matmul(users, items, transpose_b=True),
                        scale=0.1,
                        name="ratings")
    return ratings

  with ed.Func() as model_Func:
    ratings = probabilistic_matrix_factorization()

  assert model_Func["users"].shape == (5000, 128)
  assert model_Func["items"].shape == (7500, 128)
  assert model_Func["ratings"] == ratings
  ```

  """
  arg_0 = collections.OrderedDict({})

  def record(arg_1, *arg_2, **arg_3):
    """Records execution to a Func."""
    arg_4 = arg_3.get("name")
    arg_5 = interceptable(arg_1)(*arg_2, **arg_3)
    if arg_4:
      arg_0[arg_4] = arg_5
    return arg_5

  with interception(record):
    yield arg_0

Context manager for recording interceptable executions onto a tape.

  Similar to `tf.GradientTape`, operations are recorded if they are executed
  within this context manager. In addition, the operation must be registered
  (wrapped) as `ed.interceptable`.

  Yields:
    tape: OrderedDict where operations are recorded in sequence. Keys are
      the `name` keyword argument to the operation (typically, a random
      variable's `name`) and values are the corresponding output of the
      operation. If the operation has no name, it is not recorded.

  #### Examples

  ```python
  from tensorflow_probability import edward2 as ed

  def probabilistic_matrix_factorization():
    users = ed.Normal(0., 1., sample_shape=[5000, 128], name="users")
    items = ed.Normal(0., 1., sample_shape=[7500, 128], name="items")
    ratings = ed.Normal(loc=tf.matmul(users, items, transpose_b=True),
                        scale=0.1,
                        name="ratings")
    return ratings

  with ed.tape() as model_tape:
    ratings = probabilistic_matrix_factorization()

  assert model_tape["users"].shape == (5000, 128)
  assert model_tape["items"].shape == (7500, 128)
  assert model_tape["ratings"] == ratings
  ```

Context manager for recording interceptable executions onto a tape .


def Func ( ) : arg_0 = { } arg_1 = [ ( 'PYT_TEST_CLASS_COUNT' , "classes" ) , ( 'PYT_TEST_COUNT' , "tests" ) , ( 'PYT_TEST_MODULE_COUNT' , "modules" ) , ] for arg_2 , arg_3 in arg_1 : arg_0 [ arg_3 ] = int ( os . environ . get ( arg_2 , 0 ) ) return arg_0

def Func():
    """return test counts that are set via pyt environment variables when pyt
    runs the test

    :returns: dict, 3 keys (classes, tests, modules) and how many tests of each
        were found by pyt
    """
    arg_0 = {}
    arg_1 = [
        ('PYT_TEST_CLASS_COUNT', "classes"),
        ('PYT_TEST_COUNT', "tests"),
        ('PYT_TEST_MODULE_COUNT', "modules"),
    ]

    for arg_2, arg_3 in arg_1:
        arg_0[arg_3] = int(os.environ.get(arg_2, 0))

    return arg_0


def Func(arg_0, arg_1, arg_2, arg_3):
    """ Returns the Func between two points.
    """
    return degrees(atan2(arg_3-arg_1, arg_2-arg_0))


def Func(arg_0):
        """Get the enterprise customer uuid linked to the user."""
        try:
            arg_1 = EnterpriseCustomerUser.objects.get(user_id=arg_0.user.id)
        except ObjectDoesNotExist:
            LOGGER.warning(
                'User {} has a {} assignment but is not linked to an enterprise!'.format(
                    arg_0.__class__,
                    arg_0.user.id
                ))
            return None
        except MultipleObjectsReturned:
            LOGGER.warning(
                'User {} is linked to multiple enterprises, which is not yet supported!'.format(arg_0.user.id)
            )
            return None

        return str(arg_1.enterprise_customer.uuid)

Get the enterprise customer uuid linked to the user .


def Func ( arg_0 , arg_1 , arg_2 = None ) : arg_3 = [ 'func_name' , 'fn_hash' , 'memoize' , 'checkpoint' , 'fail_count' , 'fail_history' , 'status' , 'id' , 'time_submitted' , 'time_returned' , 'executor' ] arg_4 = { "task_" + k : arg_0 . tasks [ arg_1 ] [ k ] for k in arg_3 } arg_4 [ 'run_id' ] = arg_0 . run_id arg_4 [ 'timestamp' ] = datetime . datetime . now ( ) arg_4 [ 'task_status_name' ] = arg_0 . tasks [ arg_1 ] [ 'status' ] . name arg_4 [ 'tasks_failed_count' ] = arg_0 . tasks_failed_count arg_4 [ 'tasks_completed_count' ] = arg_0 . tasks_completed_count arg_4 [ 'task_inputs' ] = str ( arg_0 . tasks [ arg_1 ] [ 'kwargs' ] . get ( 'inputs' , None ) ) arg_4 [ 'task_outputs' ] = str ( arg_0 . tasks [ arg_1 ] [ 'kwargs' ] . get ( 'outputs' , None ) ) arg_4 [ 'task_stdin' ] = arg_0 . tasks [ arg_1 ] [ 'kwargs' ] . get ( 'stdin' , None ) arg_4 [ 'task_stdout' ] = arg_0 . tasks [ arg_1 ] [ 'kwargs' ] . get ( 'stdout' , None ) arg_4 [ 'task_depends' ] = None if arg_0 . tasks [ arg_1 ] [ 'depends' ] is not None : arg_4 [ 'task_depends' ] = "," . join ( [ str ( t . _tid ) for t in arg_0 . tasks [ arg_1 ] [ 'depends' ] ] ) arg_4 [ 'task_elapsed_time' ] = None if arg_0 . tasks [ arg_1 ] [ 'time_returned' ] is not None : arg_4 [ 'task_elapsed_time' ] = ( arg_0 . tasks [ arg_1 ] [ 'time_returned' ] - arg_0 . tasks [ arg_1 ] [ 'time_submitted' ] ) . total_seconds ( ) if arg_2 is not None : arg_4 [ 'task_fail_mode' ] = arg_2 return arg_4

def Func(arg_0, arg_1, arg_2=None):
        """
        Create the dictionary that will be included in the log.
        """

        arg_3 = ['func_name', 'fn_hash', 'memoize', 'checkpoint', 'fail_count',
                           'fail_history', 'status', 'id', 'time_submitted', 'time_returned', 'executor']

        arg_4 = {"task_" + k: arg_0.tasks[arg_1][k] for k in arg_3}
        arg_4['run_id'] = arg_0.run_id
        arg_4['timestamp'] = datetime.datetime.now()
        arg_4['task_status_name'] = arg_0.tasks[arg_1]['status'].name
        arg_4['tasks_failed_count'] = arg_0.tasks_failed_count
        arg_4['tasks_completed_count'] = arg_0.tasks_completed_count
        arg_4['task_inputs'] = str(arg_0.tasks[arg_1]['kwargs'].get('inputs', None))
        arg_4['task_outputs'] = str(arg_0.tasks[arg_1]['kwargs'].get('outputs', None))
        arg_4['task_stdin'] = arg_0.tasks[arg_1]['kwargs'].get('stdin', None)
        arg_4['task_stdout'] = arg_0.tasks[arg_1]['kwargs'].get('stdout', None)
        arg_4['task_depends'] = None
        if arg_0.tasks[arg_1]['depends'] is not None:
            arg_4['task_depends'] = ",".join([str(t._tid) for t in arg_0.tasks[arg_1]['depends']])
        arg_4['task_elapsed_time'] = None
        if arg_0.tasks[arg_1]['time_returned'] is not None:
            arg_4['task_elapsed_time'] = (arg_0.tasks[arg_1]['time_returned'] -
                                                  arg_0.tasks[arg_1]['time_submitted']).total_seconds()
        if arg_2 is not None:
            arg_4['task_fail_mode'] = arg_2
        return arg_4

Create the dictionary that will be included in the log .


def Func(arg_0, arg_1, arg_2=0, arg_3=None):
        """
        Yield match, end_idx for each match
        """
        arg_4 = arg_0.scanner.scanner(arg_1, arg_2).match
        arg_5 = arg_0.actions
        arg_6 = arg_2
        arg_7 = len(arg_1)
        while True:
            arg_8 = arg_4()
            if arg_8 is None:
                break
            arg_9, arg_10 = arg_8.span()
            if arg_6 == arg_10:
                break
            arg_11 = arg_5[arg_8.lastindex]
            if arg_11 is not None:
                arg_12, arg_13 = arg_11(arg_8, arg_3)
                if arg_13 is not None and arg_13 != arg_10:
                    # "fast forward" the scanner
                    arg_10 = arg_13
                    arg_4 = arg_0.scanner.scanner(arg_1, arg_10).match
                yield arg_12, arg_10
            arg_6 = arg_10


def Func ( ) : for arg_0 in ( _get_bottle_request , _get_flask_request , _get_pyramid_request , _get_pylons_request ) : try : arg_1 = arg_0 ( ) if arg_1 is not None : return arg_1 except : pass return None

def Func():
    """
    Get the current request object. Implementation varies on
    library support. Modified below when we know which framework
    is being used.
    """

    # TODO(cory): add in a generic _get_locals_request() which
    # will iterate up through the call stack and look for a variable
    # that appears to be valid request object.
    for arg_0 in (_get_bottle_request,
               _get_flask_request,
               _get_pyramid_request,
               _get_pylons_request):
        try:
            arg_1 = arg_0()
            if arg_1 is not None:
                return arg_1
        except:
            pass

    return None

Get the current request object . Implementation varies on library support . Modified below when we know which framework is being used .


(code, comments=True, macros=False, pragmas=False)

def Func ( arg_0 , arg_1 = True , arg_2 = False , arg_3 = False ) : if arg_2 or arg_3 : arg_4 = arg_0 . split ( '\n' ) arg_5 = False arg_6 = False for arg_7 in range ( len ( arg_4 ) ) : arg_8 = arg_4 [ arg_7 ] . strip ( ) if arg_2 and ( arg_8 . startswith ( '#' ) and not arg_8 . startswith ( '#pragma' ) or arg_5 ) : arg_4 [ arg_7 ] = '' arg_5 = arg_8 . endswith ( '\\' ) if arg_3 and ( arg_8 . startswith ( '#pragma' ) or arg_6 ) : arg_4 [ arg_7 ] = '' arg_6 = arg_8 . endswith ( '\\' ) arg_0 = '\n' . join ( arg_4 ) if arg_1 : arg_9 = 0 arg_10 = None while arg_9 < len ( arg_0 ) - 1 : if arg_10 is None and arg_0 [ arg_9 : arg_9 + 2 ] == '//' : arg_11 = arg_0 . find ( '\n' , arg_9 ) arg_0 = arg_0 [ : arg_9 ] + arg_0 [ arg_11 : ] arg_9 -= arg_11 - arg_9 elif arg_10 is None and arg_0 [ arg_9 : arg_9 + 2 ] == '/*' : arg_10 = arg_9 elif arg_10 is not None and arg_0 [ arg_9 : arg_9 + 2 ] == '*/' : arg_0 = ( arg_0 [ : arg_10 ] + '\n' * arg_0 [ arg_10 : arg_9 ] . count ( '\n' ) + arg_0 [ arg_9 + 2 : ] ) arg_9 -= arg_9 - arg_10 arg_10 = None arg_9 += 1 return arg_0

def Func(arg_0, arg_1=True, arg_2=False, arg_3=False):
    """
    Naive comment and macro striping from source code

    :param comments: If True, all comments are stripped from code
    :param macros: If True, all macros are stripped from code
    :param pragmas: If True, all pragmas are stripped from code

    :return: cleaned code. Line numbers are preserved with blank lines,
    and multiline comments and macros are supported. BUT comment-like
    strings are (wrongfully) treated as comments.
    """
    if arg_2 or arg_3:
        arg_4 = arg_0.split('\n')
        arg_5 = False
        arg_6 = False
        for arg_7 in range(len(arg_4)):
            arg_8 = arg_4[arg_7].strip()

            if arg_2 and (arg_8.startswith('#') and not arg_8.startswith('#pragma') or arg_5):
                arg_4[arg_7] = ''
                arg_5 = arg_8.endswith('\\')
            if arg_3 and (arg_8.startswith('#pragma') or arg_6):
                arg_4[arg_7] = ''
                arg_6 = arg_8.endswith('\\')
        arg_0 = '\n'.join(arg_4)

    if arg_1:
        arg_9 = 0
        arg_10 = None
        while arg_9 < len(arg_0) - 1:
            if arg_10 is None and arg_0[arg_9:arg_9 + 2] == '//':
                arg_11 = arg_0.find('\n', arg_9)
                arg_0 = arg_0[:arg_9] + arg_0[arg_11:]
                arg_9 -= arg_11 - arg_9
            elif arg_10 is None and arg_0[arg_9:arg_9 + 2] == '/*':
                arg_10 = arg_9
            elif arg_10 is not None and arg_0[arg_9:arg_9 + 2] == '*/':
                arg_0 = (arg_0[:arg_10] +
                        '\n' * arg_0[arg_10:arg_9].count('\n') +
                        arg_0[arg_9 + 2:])
                arg_9 -= arg_9 - arg_10
                arg_10 = None
            arg_9 += 1

    return arg_0


def Func ( arg_0 , arg_1 ) : arg_2 = unicode ( uuid . uuid4 ( ) ) arg_0 . mapping [ arg_2 ] = arg_1 arg_0 . rev_mapping [ arg_1 ] = arg_2 return arg_2

def Func(arg_0, arg_1):
        """Generate a new notebook_id for a name and store its mappings."""
        # TODO: the following will give stable urls for notebooks, but unless
        # the notebooks are immediately redirected to their new urls when their
        # filemname changes, nasty inconsistencies result.  So for now it's
        # disabled and instead we use a random uuid4() call.  But we leave the
        # logic here so that we can later reactivate it, whhen the necessary
        # url redirection code is written.
        #notebook_id = unicode(uuid.uuid5(uuid.NAMESPACE_URL,
        #                 'file://'+self.get_path_by_name(name).encode('utf-8')))

        arg_2 = unicode(uuid.uuid4())

        arg_0.mapping[arg_2] = arg_1
        arg_0.rev_mapping[arg_1] = arg_2
        return arg_2

Generate a new notebook_id for a name and store its mappings .


def
Func
(
arg_0
,
arg_1
=
4096
)
:
arg_2
=
arg_0
.
socket
.
recv
(
arg_1
)
if
not
arg_2
:
raise
NNTPError
(
"Failed to read from socket"
)
arg_0
.
__buffer
.
write
(
arg_2
)

def Func(arg_0, arg_1=4096):
        """Reads data from the socket.

        Raises:
            NNTPError: When connection times out or read from socket fails.
        """
        arg_2 = arg_0.socket.recv(arg_1)
        if not arg_2:
            raise NNTPError("Failed to read from socket")
        arg_0.__buffer.write(arg_2)


def Func(arg_0):
        """
        Process INFO received from the server and CONNECT to the server
        with authentication.  It is also responsible of setting up the
        reading and ping interval tasks from the client.
        """
        arg_0._status = Client.CONNECTING

        arg_2 = arg_0._io_reader.readline()
        arg_3 = yield from asyncio.wait_for(arg_2, arg_0.options["connect_timeout"])
        if INFO_OP not in arg_3:
            raise NatsError("nats: empty response from server when expecting INFO message")

        arg_4, arg_5 = arg_3.split(INFO_OP + _SPC_, 1)

        try:
            arg_6 = json.loads(arg_5.decode())
        except:
            raise NatsError("nats: info message, json parse error")

        arg_0._process_info(arg_6)
        arg_0._server_info = arg_6

        if 'max_payload' in arg_0._server_info:
            arg_0._max_payload = arg_0._server_info["max_payload"]

        if 'tls_required' in arg_0._server_info and arg_0._server_info['tls_required']:
            arg_9 = None
            if "tls" in arg_0.options:
                arg_9 = arg_0.options.get('tls')
            elif arg_0._current_server.uri.scheme == 'tls':
                arg_9 = ssl.create_default_context()
            else:
                raise NatsError('nats: no ssl context provided')

            arg_10 = arg_0._io_writer.transport
            arg_11 = arg_10.get_extra_info('socket')
            if not arg_11:
                # This shouldn't happen
                raise NatsError('nats: unable to get socket')

            yield from arg_0._io_writer.drain()  # just in case something is left

            arg_0._io_reader, arg_0._io_writer = \
                yield from asyncio.open_connection(
                    loop=arg_0._loop,
                    limit=DEFAULT_BUFFER_SIZE,
                    arg_11=arg_11,
                    ssl=arg_9,
                    server_hostname=arg_0._current_server.uri.hostname,
                )

        # Refresh state of parser upon reconnect.
        if arg_0.is_reconnecting:
            arg_0._ps.reset()

        arg_14 = arg_0._connect_command()
        arg_0._io_writer.write(arg_14)
        arg_0._io_writer.write(PING_PROTO)
        yield from arg_0._io_writer.drain()

        # FIXME: Add readline timeout
        arg_15 = yield from arg_0._io_reader.readline()
        if arg_0.options["verbose"] and OK_OP in arg_15:
            arg_15 = yield from arg_0._io_reader.readline()

        if ERR_OP in arg_15:
            arg_16 = arg_15.decode()
            arg_4, arg_17 = arg_16.split(" ", 1)
            # FIXME: Maybe handling could be more special here,
            # checking for ErrAuthorization for example.
            # yield from self._process_err(err_msg)
            raise NatsError("nats: " + arg_17.rstrip('\r\n'))

        if PONG_PROTO in arg_15:
            arg_0._status = Client.CONNECTED

        arg_0._reading_task = arg_0._loop.create_task(arg_0._read_loop())
        arg_0._pongs = []
        arg_0._pings_outstanding = 0
        arg_0._ping_interval_task = arg_0._loop.create_task(
            arg_0._ping_interval())

        # Task for kicking the flusher queue
        arg_0._flusher_task = arg_0._loop.create_task(arg_0._flusher())

Process INFO received from the server and CONNECT to the server with authentication . It is also responsible of setting up the reading and ping interval tasks from the client .


def Func(arg_0, arg_1, arg_2):
    """Set AAD metadata."""
    set_config_value('authority_uri', arg_0)
    set_config_value('aad_resource', arg_1)
    set_config_value('aad_client', arg_2)


def Func ( arg_0 ) : if not arg_0 . flags : return arg_1 = [ ] for arg_2 , ( arg_3 , arg_4 ) in arg_0 . flags . iteritems ( ) : arg_5 = '--' if len ( arg_2 ) > 1 else '-' arg_1 . append ( arg_5 + arg_2 ) arg_1 . append ( indent ( dedent ( arg_4 . strip ( ) ) ) ) print os . linesep . join ( arg_1 )

def Func(arg_0):
        """Print the flag part of the help."""
        if not arg_0.flags:
            return

        arg_1 = []
        for arg_2, (arg_3,arg_4) in arg_0.flags.iteritems():
            arg_5 = '--' if len(arg_2) > 1 else '-'
            arg_1.append(arg_5+arg_2)
            arg_1.append(indent(dedent(arg_4.strip())))
        # lines.append('')
        print os.linesep.join(arg_1)


(self, start_time: int, schedule: ScheduleComponent)

return ops.insert(self, start_time, schedule)

def Func ( arg_0 , arg_1 : arg_2 , arg_3 : arg_4 ) -> 'ScheduleComponent' : return ops . Func ( arg_0 , arg_1 , arg_3 )

def Func(arg_0, arg_1: arg_2, arg_3: arg_4) -> 'ScheduleComponent':
        """Return a new schedule with `schedule` Funced within `self` at `start_time`.

        Args:
            start_time: time to be Funced
            schedule: schedule to be Funced
        """
        return ops.Func(arg_0, arg_1, arg_3)

Return a new schedule with `schedule` inserted within `self` at `start_time`.

        Args:
            start_time: time to be inserted
            schedule: schedule to be inserted

Return a new schedule with schedule inserted within self at start_time .


def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 = arg_0 . rpop ( arg_1 ) if arg_3 is not None : arg_0 . lpush ( arg_2 , arg_3 ) return arg_3 return None

def Func(arg_0, arg_1, arg_2):
        """
        RPOP a value off of the ``src`` list and LPUSH it
        on to the ``dst`` list.  Returns the value.
        """
        arg_3 = arg_0.rpop(arg_1)
        if arg_3 is not None:
            arg_0.lpush(arg_2, arg_3)
            return arg_3
        return None

RPOP a value off of the src list and LPUSH it on to the dst list . Returns the value .


def Func(arg_0, arg_1):
        """Embed default meas LO frequencies from backend and format them to list object.
        If configured lo frequency is the same as default, this method returns `None`.

        Args:
            user_lo_config (LoConfig): A dictionary of LOs to format.

        Returns:
            list: A list of meas LOs.

        Raises:
            PulseError: when LO frequencies are missing.
        """
        try:
            arg_2 = arg_0.default_meas_los.copy()
        except KeyError:
            raise PulseError('Default measurement frequencies not exist.')

        for arg_3, arg_4 in arg_1.meas_lo_dict().items():
            arg_2[arg_3.index] = arg_4

        if arg_2 == arg_0.default_meas_los:
            return None
        return arg_2

Embed default meas LO frequencies from backend and format them to list object . If configured lo frequency is the same as default this method returns None .


(datetimes,
            years=0, months=0, weeks=0, days=0,
            hours=0, minutes=0, seconds=0,
            firstweekday=SATURDAY, now=None)

return (filters.Years.filter(datetimes, number=years, now=now) |
            filters.Months.filter(datetimes, number=months, now=now) |
            filters.Weeks.filter(datetimes, number=weeks,
                                 firstweekday=firstweekday, now=now) |
            filters.Days.filter(datetimes, number=days, now=now) |
            filters.Hours.filter(datetimes, number=hours, now=now) |
            filters.Minutes.filter(datetimes, number=minutes, now=now) |
            filters.Seconds.filter(datetimes, number=seconds, now=now))

def Func ( arg_0 , arg_1 = 0 , arg_2 = 0 , arg_3 = 0 , arg_4 = 0 , arg_5 = 0 , arg_6 = 0 , arg_7 = 0 , arg_8 = arg_9 , arg_10 = None ) : arg_0 = set ( arg_0 ) return ( filters . Years . filter ( arg_0 , number = arg_1 , arg_10 = arg_10 ) | filters . Months . filter ( arg_0 , number = arg_2 , arg_10 = arg_10 ) | filters . Weeks . filter ( arg_0 , number = arg_3 , arg_8 = arg_8 , arg_10 = arg_10 ) | filters . Days . filter ( arg_0 , number = arg_4 , arg_10 = arg_10 ) | filters . Hours . filter ( arg_0 , number = arg_5 , arg_10 = arg_10 ) | filters . Minutes . filter ( arg_0 , number = arg_6 , arg_10 = arg_10 ) | filters . Seconds . filter ( arg_0 , number = arg_7 , arg_10 = arg_10 ) )

def Func(arg_0,
            arg_1=0, arg_2=0, arg_3=0, arg_4=0,
            arg_5=0, arg_6=0, arg_7=0,
            arg_8=arg_9, arg_10=None):
    """
    Return a set of datetimes that should be kept, out of ``datetimes``.

    Keeps up to ``years``, ``months``, ``weeks``, ``days``,
    ``hours``, ``minutes``, and ``seconds`` in the past.

    When keeping weeks, it prefers to keep ``firstweekday``, which
    defaults to Saturday.

    If ``now`` is None, it will base its calculations on
    ``datetime.datetime.now()``. Datetimes after this point will always be
    kept.
    """
    arg_0 = set(arg_0)
    return (filters.Years.filter(arg_0, number=arg_1, arg_10=arg_10) |
            filters.Months.filter(arg_0, number=arg_2, arg_10=arg_10) |
            filters.Weeks.filter(arg_0, number=arg_3,
                                 arg_8=arg_8, arg_10=arg_10) |
            filters.Days.filter(arg_0, number=arg_4, arg_10=arg_10) |
            filters.Hours.filter(arg_0, number=arg_5, arg_10=arg_10) |
            filters.Minutes.filter(arg_0, number=arg_6, arg_10=arg_10) |
            filters.Seconds.filter(arg_0, number=arg_7, arg_10=arg_10))

Return a set of datetimes that should be kept out of datetimes .