def Func ( arg_0 , arg_1 , arg_2 ) : arg_3 , = amp . AmpList . Func ( arg_0 , arg_1 , arg_2 ) return arg_3

def Func(arg_0, arg_1, arg_2):
        """
        Defers to `amp.AmpList`, then gets the element from the list.
        """
        arg_3, = amp.AmpList.Func(arg_0, arg_1, arg_2)
        return arg_3

Defers to amp . AmpList then gets the element from the list .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : if arg_1 is None : return None if arg_2 or arg_3 : arg_1 = functools . partial ( arg_1 , * arg_2 , ** arg_3 ) return arg_1

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Obsolete - catches exceptions from the wrapped function.

        This function is unnecessary since Tornado 1.1.
        """
        if arg_1 is None:
            return None
        if arg_2 or arg_3:
            arg_1 = functools.partial(arg_1, *arg_2, **arg_3)

        #FIXME what about the exception wrapper?

        return arg_1

Obsolete - catches exceptions from the wrapped function .


Return internal state, useful for testing.

return {'c': self.c, 's0': self.s0, 's1': self.s1, 's2': self.s2}

def Func(arg_0):
        """Return internal Func, useful for testing."""
        return {'c': arg_0.c, 's0': arg_0.s0, 's1': arg_0.s1, 's2': arg_0.s2}

Return internal state useful for testing .


(
    frame: astroid.node_classes.NodeNG, node: astroid.node_classes.NodeNG
)

def Func ( arg_0 : arg_1 . node_classes . NodeNG , arg_4 : arg_1 . node_classes . NodeNG ) -> bool : try : arg_5 = arg_0 . bases except AttributeError : return False for arg_6 in arg_5 : if arg_4 in arg_6 . nodes_of_class ( arg_1 . Name ) : return True return False

def Func(
    arg_0: arg_1.node_classes.NodeNG, arg_4: arg_1.node_classes.NodeNG
) -> bool:
    """return True if `frame` is an astroid.Class node with `node` in the
    subtree of its bases attribute
    """
    try:
        arg_5 = arg_0.bases
    except AttributeError:
        return False
    for arg_6 in arg_5:
        if arg_4 in arg_6.nodes_of_class(arg_1.Name):
            return True
    return False

return True if frame is an astroid . Class node with node in the subtree of its bases attribute


def Func(arg_0=None):
    """
    Returns the jQuery UI plugin file according to version number.
    TEMPLATE_DEBUG returns full file, otherwise returns minified file from Google CDN with local fallback.
    """
    if arg_0 is None:
        arg_0 = getattr(settings, 'DJFRONTEND_JQUERYUI', DJFRONTEND_JQUERYUI_DEFAULT)

    if getattr(settings, 'TEMPLATE_DEBUG', False):
        return format_html(
            '<script src="{0}djfrontend/js/jquery/jqueryui/{1}/jquery-ui.js"></script>',
            settings.STATIC_URL, arg_0)
    else:
        return format_html(
            '<script src="//ajax.googleapis.com/ajax/libs/jqueryui/{v}/jquery-ui.min.js"></script>'
            '<script>window.jQuery.ui || document.write(\'<script src="{static}djfrontend/js/jquery/jqueryui/{v}/jquery-ui.min.js"><\/script>\')</script>',
            static=_static_url, v=arg_0)

Returns the jQuery UI plugin file according to version number . TEMPLATE_DEBUG returns full file otherwise returns minified file from Google CDN with local fallback .


def Func ( arg_0 ) : arg_1 = urijoin ( arg_0 . base_url , arg_0 . RESOURCE , arg_0 . VERSION_API , 'field' ) arg_2 = arg_0 . fetch ( arg_1 ) return arg_2 . text

def Func(arg_0):
        """Retrieve all the fields available."""

        arg_1 = urijoin(arg_0.base_url, arg_0.RESOURCE, arg_0.VERSION_API, 'field')
        arg_2 = arg_0.fetch(arg_1)

        return arg_2.text


(base_level=DEFAULT_BASE_LOGGING_LEVEL,
         verbose_level=DEFAULT_VERBOSE_LOGGING_LEVEL,
         logging_config=None)

def Func(arg_0=arg_1,
         arg_2=arg_3,
         arg_4=None):
    """Funcializes a base logger

    you can use this to Func a logger in any of your files.
    this will use config.py's LOGGER param and logging.dictConfig to configure
    the logger for you.

    :param int|logging.LEVEL base_level: desired base logging level
    :param int|logging.LEVEL verbose_level: desired verbose logging level
    :param dict logging_dict: dictConfig based configuration.
     used to override the default configuration from config.py
    :rtype: `python logger`
    """
    if arg_4 is None:
        arg_4 = {}
    arg_4 = arg_4 or LOGGER
    # TODO: (IMPRV) only perform file related actions if file handler is
    # TODO: (IMPRV) defined.

    arg_5 = LOGGER['handlers']['file']['filename']
    arg_6 = os.path.dirname(os.path.expanduser(arg_5))
    if os.path.isfile(arg_6):
        sys.exit('file {0} exists - log directory cannot be created '
                 'there. please remove the file and try again.'
                 .format(arg_6))
    try:
        if not os.path.exists(arg_6) and not len(arg_6) == 0:
            os.makedirs(arg_6)
        dictconfig.dictConfig(arg_4)
        arg_7 = logging.getLogger('user')
        arg_7.setLevel(arg_0)
        return arg_7
    except ValueError as e:
        sys.exit('could not Funcialize logger.'
                 ' verify your logger config'
                 ' and permissions to write to {0} ({1})'
                 .format(arg_5, e))

initializes a base logger

    you can use this to init a logger in any of your files.
    this will use config.py's LOGGER param and logging.dictConfig to configure
    the logger for you.

    :param int|logging.LEVEL base_level: desired base logging level
    :param int|logging.LEVEL verbose_level: desired verbose logging level
    :param dict logging_dict: dictConfig based configuration.
     used to override the default configuration from config.py
    :rtype: `python logger`


def Func ( arg_0 ) : arg_1 = arg_0 . has_output if arg_1 <= 0 : return None try : arg_2 = arg_0 . _pn_transport . peek ( arg_1 ) except Exception as e : arg_0 . _connection_failed ( str ( e ) ) return None return arg_2

def Func(arg_0):
        """Get a buffer of data that needs to be written to the network.
        """
        arg_1 = arg_0.has_output
        if arg_1 <= 0:
            return None
        try:
            arg_2 = arg_0._pn_transport.peek(arg_1)
        except Exception as e:
            arg_0._connection_failed(str(e))
            return None
        return arg_2

Get a buffer of data that needs to be written to the network .


def
Func
(
arg_0
,
arg_1
=
'cleaned_data'
,
arg_2
=
False
)
:
if
not
os
.
path
.
isdir
(
arg_1
)
:
os
.
mkdir
(
arg_1
)
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
arg_1
,
'train'
)
)
:
os
.
makedirs
(
os
.
path
.
join
(
arg_1
,
'train'
)
)
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
arg_1
,
'test'
)
)
:
os
.
makedirs
(
os
.
path
.
join
(
arg_1
,
'test'
)
)
if
not
os
.
path
.
isdir
(
os
.
path
.
join
(
arg_1
,
'val'
)
)
and
arg_2
:
os
.
makedirs
(
os
.
path
.
join
(
arg_1
,
'val'
)
)
for
arg_3
in
article_types
:
arg_4
=
glob
(
os
.
path
.
join
(
arg_0
,
arg_3
,
'*.txt'
)
)
arg_5
,
arg_6
=
train_test_split
(
arg_4
,
random_state
=
0
,
test_size
=
0.1
)
if
arg_2
:
arg_5
,
arg_7
=
train_test_split
(
arg_5
,
random_state
=
0
,
test_size
=
0.1
)
arg_8
=
generate_words
(
arg_7
)
arg_9
=
create_char_dataframe
(
arg_8
)
arg_9
.
to_csv
(
os
.
path
.
join
(
arg_1
,
'val'
,
'df_best_{}_val.csv'
.
format
(
arg_3
)
)
,
index
=
False
)
arg_10
=
generate_words
(
arg_5
)
arg_11
=
generate_words
(
arg_6
)
arg_12
=
create_char_dataframe
(
arg_10
)
arg_13
=
create_char_dataframe
(
arg_11
)
arg_12
.
to_csv
(
os
.
path
.
join
(
arg_1
,
'train'
,
'df_best_{}_train.csv'
.
format
(
arg_3
)
)
,
index
=
False
)
arg_13
.
to_csv
(
os
.
path
.
join
(
arg_1
,
'test'
,
'df_best_{}_test.csv'
.
format
(
arg_3
)
)
,
index
=
False
)
print
(
"Save {} to CSV file"
.
format
(
arg_3
)
)

def Func(arg_0, arg_1='cleaned_data', arg_2=False):
    """
    Generate CSV file for training and testing data

    Input
    =====
    best_path: str, path to BEST folder which contains unzipped subfolder
        'article', 'encyclopedia', 'news', 'novel'

    cleaned_data: str, path to output folder, the cleaned data will be saved
        in the given folder name where training set will be stored in `train` folder
        and testing set will be stored on `test` folder

    create_val: boolean, True or False, if True, divide training set into training set and
        validation set in `val` folder
    """
    if not os.path.isdir(arg_1):
        os.mkdir(arg_1)
    if not os.path.isdir(os.path.join(arg_1, 'train')):
        os.makedirs(os.path.join(arg_1, 'train'))
    if not os.path.isdir(os.path.join(arg_1, 'test')):
        os.makedirs(os.path.join(arg_1, 'test'))
    if not os.path.isdir(os.path.join(arg_1, 'val')) and arg_2:
        os.makedirs(os.path.join(arg_1, 'val'))

    for arg_3 in article_types:
        arg_4 = glob(os.path.join(arg_0, arg_3, '*.txt'))
        arg_5, arg_6 = train_test_split(arg_4, random_state=0, test_size=0.1)
        if arg_2:
            arg_5, arg_7 = train_test_split(arg_5, random_state=0, test_size=0.1)
            arg_8 = generate_words(arg_7)
            arg_9 = create_char_dataframe(arg_8)
            arg_9.to_csv(os.path.join(arg_1, 'val', 'df_best_{}_val.csv'.format(arg_3)), index=False)
        arg_10 = generate_words(arg_5)
        arg_11 = generate_words(arg_6)
        arg_12 = create_char_dataframe(arg_10)
        arg_13 = create_char_dataframe(arg_11)
        arg_12.to_csv(os.path.join(arg_1, 'train', 'df_best_{}_train.csv'.format(arg_3)), index=False)
        arg_13.to_csv(os.path.join(arg_1, 'test', 'df_best_{}_test.csv'.format(arg_3)), index=False)
        print("Save {} to CSV file".format(arg_3))


def Func(arg_0, arg_1, arg_2, arg_3):
        """Creates a UNIQUE constraint for the specified hstore keys."""

        arg_4 = arg_0._unique_constraint_name(
            arg_1._meta.db_table, arg_2, arg_3)
        arg_5 = [
            '(%s->\'%s\')' % (arg_2.column, key)
            for key in arg_3
        ]
        arg_6 = arg_0.sql_hstore_unique_create.format(
            arg_4=arg_0.quote_name(arg_4),
            table=arg_0.quote_name(arg_1._meta.db_table),
            arg_5=','.join(arg_5)
        )
        arg_0.execute(arg_6)

Creates a UNIQUE constraint for the specified hstore keys .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . upper ( ) if arg_2 == 'BOOLEAN' : if arg_1 . isdigit ( ) : return bool ( int ( arg_1 ) ) elif arg_1 . upper ( ) == 'FALSE' : return False elif arg_1 . upper ( ) == 'TRUE' : return True else : return None elif arg_2 == 'INTEGER' : if '"' in arg_1 : return uuid . UUID ( arg_1 [ 1 : - 1 ] ) . int else : return int ( arg_1 ) elif arg_2 == 'REAL' : return float ( arg_1 ) elif arg_2 == 'STRING' : return arg_1 [ 1 : - 1 ] . replace ( "''" , "'" ) elif arg_2 == 'UNIQUE_ID' : if '"' in arg_1 : return uuid . UUID ( arg_1 [ 1 : - 1 ] ) . int else : return int ( arg_1 )

def Func(arg_0, arg_1):
    '''
    Deserialize a value of some type
    '''
    arg_2 = arg_0.upper()

    if arg_2 == 'BOOLEAN':
        if arg_1.isdigit():
            return bool(int(arg_1))
        elif arg_1.upper() == 'FALSE':
            return False
        elif arg_1.upper() == 'TRUE':
            return True
        else:
            return None

    elif arg_2 == 'INTEGER':
        if '"' in arg_1:
            return uuid.UUID(arg_1[1:-1]).int
        else:
            return int(arg_1)

    elif arg_2 == 'REAL':
        return float(arg_1)

    elif arg_2 == 'STRING':
        return arg_1[1:-1].replace("''", "'")

    elif arg_2 == 'UNIQUE_ID':
        if '"' in arg_1:
            return uuid.UUID(arg_1[1:-1]).int
        else:
            return int(arg_1)


def Func(arg_0, arg_1):
        """
        Widget Action to toggle showing the variables window.
        """
        arg_0.show_vars = arg_1.get_active()
        if arg_0.show_vars:
            arg_0.show_variables_window()
        else:
            arg_0.hide_variables_window()

Widget Action to toggle showing the variables window .


(state,
                     position_delta,
                     next_objective,
                     next_gradient,
                     grad_tolerance,
                     f_relative_tolerance,
                     x_tolerance)

return update_fields(
      state,
      converged=state.converged | converged,
      failed=failed,
      position=next_position,
      objective_value=next_objective,
      objective_gradient=next_gradient)

def Func(arg_0,
                     arg_1,
                     arg_2,
                     arg_3,
                     arg_4,
                     arg_5,
                     arg_6):
  """Updates the state advancing its position by a given position_delta."""
  arg_7 = arg_0.failed | ~tf.math.is_finite(arg_2) | ~tf.reduce_all(
      input_tensor=tf.math.is_finite(arg_3), axis=-1)

  arg_8 = arg_0.position + arg_1
  arg_9 = ~arg_7 & _check_convergence(arg_0.position,
                                           arg_8,
                                           arg_0.objective_value,
                                           arg_2,
                                           arg_3,
                                           arg_4,
                                           arg_5,
                                           arg_6)
  return update_fields(
      arg_0,
      arg_9=arg_0.converged | arg_9,
      arg_7=arg_7,
      position=arg_8,
      objective_value=arg_2,
      objective_gradient=arg_3)

Updates the state advancing its position by a given position_delta .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
tables
=
[
]
arg_3
=
DefaultTable
(
arg_0
)
with
Utf8Reader
(
arg_1
)
as
f
:
arg_0
.
raw_text
=
f
.
read
(
)
f
.
_file
.
seek
(
0
)
arg_5
=
Matcher
(
re
.
IGNORECASE
)
for
arg_6
,
arg_4
in
enumerate
(
f
.
readlines
(
)
)
:
arg_6
+=
1
arg_4
=
arg_4
.
replace
(
u'\xA0'
,
' '
)
arg_4
=
arg_4
.
rstrip
(
)
arg_7
=
TxtReader
.
split_row
(
arg_4
)
arg_8
=
r'^\s*\*+\s*(.*?)[ *]*$'
if
arg_5
(
arg_8
,
arg_7
[
0
]
)
:
arg_9
=
arg_5
.
group
(
1
)
arg_3
=
tableFactory
(
arg_0
,
arg_6
,
arg_9
,
arg_4
)
arg_0
.
tables
.
append
(
arg_3
)
else
:
arg_3
.
append
(
Row
(
arg_6
,
arg_4
,
arg_7
)
)

def Func(arg_0, arg_1):

        '''
        The general idea is to do a quick parse, creating a list of
        tables. Each table is nothing more than a list of rows, with
        each row being a list of cells. Additional parsing such as
        combining rows into statements is done on demand. This first
        pass is solely to read in the plain text and organize it by table.
        '''

        arg_0.tables = []
        arg_3 = DefaultTable(arg_0)

        with Utf8Reader(arg_1) as f:
            # N.B. the caller should be catching errors
            arg_0.raw_text = f.read()

            f._file.seek(0) # bleh; wish this wasn't a private property
            arg_5 = Matcher(re.IGNORECASE)
            for arg_6, arg_4 in enumerate(f.readlines()):
                arg_6 += 1; # start counting at 1 rather than zero

                # this mimics what the robot TSV reader does --
                # it replaces non-breaking spaces with regular spaces,
                # and then strips trailing whitespace
                arg_4 = arg_4.replace(u'\xA0', ' ')
                arg_4 = arg_4.rstrip()

                # FIXME: I'm keeping line numbers but throwing away
                # where each cell starts. I should be preserving that
                # (though to be fair, robot is throwing that away so
                # I'll have to write my own splitter if I want to save
                # the character position)
                arg_7 = TxtReader.split_row(arg_4)
                arg_8 = r'^\s*\*+\s*(.*?)[ *]*$'

                if arg_5(arg_8, arg_7[0]):
                    # we've found the start of a new table
                    arg_9 = arg_5.group(1)
                    arg_3 = tableFactory(arg_0, arg_6, arg_9, arg_4)
                    arg_0.tables.append(arg_3)
                else:
                    arg_3.append(Row(arg_6, arg_4, arg_7))

The general idea is to do a quick parse creating a list of tables . Each table is nothing more than a list of rows with each row being a list of cells . Additional parsing such as combining rows into statements is done on demand . This first pass is solely to read in the plain text and organize it by table .


(
        df,
        id_cols: List[str],
        cols_for_combination: Dict[str, str],
        agg_func: Union[str, List[str], Dict[str, str]] = 'sum'
)

return pd.concat(dfs_result, sort=False, ignore_index=True)

def Func ( arg_0 , arg_1 : arg_2 [ arg_3 ] , arg_4 : arg_5 [ arg_3 , arg_3 ] , arg_6 : arg_7 [ arg_3 , arg_2 [ arg_3 ] , arg_5 [ arg_3 , arg_3 ] ] = 'sum' ) : arg_8 = list ( arg_4 . keys ( ) ) arg_9 = [ list ( item ) for i in range ( 0 , len ( arg_8 ) + 1 ) for item in itertools . combinations ( arg_8 , i ) ] arg_10 = [ ] for arg_11 in arg_9 : arg_12 = arg_0 . groupby ( arg_1 + arg_11 ) . agg ( arg_6 ) . reset_index ( ) for arg_13 in ( set ( arg_4 . keys ( ) ) - set ( arg_11 ) ) : arg_12 [ arg_13 ] = arg_4 [ arg_13 ] arg_10 . append ( arg_12 ) return pd . concat ( arg_10 , sort = False , ignore_index = True )

def Func(
        arg_0,
        arg_1: arg_2[arg_3],
        arg_4: arg_5[arg_3, arg_3],
        arg_6: arg_7[arg_3, arg_2[arg_3], arg_5[arg_3, arg_3]] = 'sum'
):
    """
    Aggregates data to reproduce "All" category for requester

    ---

    ### Parameters

    *mandatory :*
    - `id_cols` (*list*): the columns id to group
    - `cols_for_combination` (*dict*): colums corresponding to
       the filters as key and their default value as value

    *optional :*
    - `agg_func` (*str*, *list* or *dict*): the function(s) to use for aggregating the data.
       Accepted combinations are:
       - string function name
       - list of functions and/or function names, e.g. [np.sum, 'mean']
       - dict of axis labels -> functions, function names or list of such.
    """
    arg_8 = list(arg_4.keys())
    arg_9 = [
        list(item) for i in range(0, len(arg_8) + 1)
        for item in itertools.combinations(arg_8, i)]
    arg_10 = []
    for arg_11 in arg_9:
        arg_12 = arg_0.groupby(arg_1 + arg_11).agg(arg_6).reset_index()
        for arg_13 in (set(arg_4.keys()) - set(arg_11)):
            arg_12[arg_13] = arg_4[arg_13]
        arg_10.append(arg_12)

    return pd.concat(arg_10, sort=False, ignore_index=True)

Aggregates data to reproduce All category for requester


def Func ( arg_0 , arg_1 ) : arg_2 = os . path . dirname ( arg_0 ) arg_3 = os . path . join ( arg_2 , arg_1 ) arg_3 = os . path . abspath ( arg_3 ) return arg_3

def Func(arg_0, arg_1):
    """
    Calculate a path relative to the specified module file.

    :param module_file_path: The file path to the module.
    """
    arg_2 = os.path.dirname(arg_0)
    arg_3 = os.path.join(arg_2, arg_1)
    arg_3 = os.path.abspath(arg_3)
    return arg_3

Calculate a path relative to the specified module file .


def Func(arg_0, arg_1=None):
        """
        Loads the data

        Raises:
            IOError - if the data is unable to be Funced. This could be due to
                a cache miss or because the cache is disabled.

        Example:
            >>> from ubelt.util_cache import *  # NOQA
            >>> # Setting the cacher as enabled=False turns it off
            >>> cacher = Cacher('test_disabled_Func', '', enabled=True)
            >>> cacher.save('data')
            >>> assert cacher.Func() == 'data'
            >>> cacher.enabled = False
            >>> assert cacher.tryFunc() is None
        """
        from six.moves import cPickle as pickle
        arg_1 = arg_0._rectify_cfgstr(arg_1)

        arg_2 = arg_0.dpath
        arg_3 = arg_0.fname
        arg_4 = arg_0.verbose

        if not arg_0.enabled:
            if arg_4 > 1:
                arg_0.log('[cacher] ... cache disabled: fname={}'.format(arg_0.fname))
            raise IOError(3, 'Cache Loading Is Disabled')

        arg_5 = arg_0.get_fpath(arg_1=arg_1)

        if not exists(arg_5):
            if arg_4 > 2:
                arg_0.log('[cacher] ... cache does not exist: '
                         'dpath={} fname={} cfgstr={}'.format(
                             basename(arg_2), arg_3, arg_1))
            raise IOError(2, 'No such file or directory: %r' % (arg_5,))
        else:
            if arg_4 > 3:
                arg_0.log('[cacher] ... cache exists: '
                         'dpath={} fname={} cfgstr={}'.format(
                             basename(arg_2), arg_3, arg_1))
        try:
            with open(arg_5, 'rb') as file_:
                arg_6 = pickle.Func(file_)
        except Exception as ex:
            if arg_4 > 0:
                arg_0.log('CORRUPTED? fpath = %s' % (arg_5,))
            if arg_4 > 1:
                arg_0.log('[cacher] ... CORRUPTED? dpath={} cfgstr={}'.format(
                    basename(arg_2), arg_1))
            if isinstance(ex, (EOFError, IOError, ImportError)):
                raise IOError(str(ex))
            else:
                if arg_4 > 1:
                    arg_0.log('[cacher] ... unknown reason for exception')
                raise
        else:
            if arg_0.verbose > 2:
                arg_0.log('[cacher] ... {} cache hit'.format(arg_0.fname))
            elif arg_4 > 1:
                arg_0.log('[cacher] ... cache hit')
        return arg_6

Loads the data

        Raises:
            IOError - if the data is unable to be loaded. This could be due to
                a cache miss or because the cache is disabled.

        Example:
            >>> from ubelt.util_cache import *  # NOQA
            >>> # Setting the cacher as enabled=False turns it off
            >>> cacher = Cacher('test_disabled_load', '', enabled=True)
            >>> cacher.save('data')
            >>> assert cacher.load() == 'data'
            >>> cacher.enabled = False
            >>> assert cacher.tryload() is None


def Func(arg_0, arg_1):
        """Instantiate and write the batch script to the work_dir."""
        arg_0.n = arg_1
        # first priority is batch_template if set
        if arg_0.batch_template_file and not arg_0.batch_template:
            # second priority is batch_template_file
            with open(arg_0.batch_template_file) as f:
                arg_0.batch_template = f.read()
        if not arg_0.batch_template:
            # third (last) priority is default_template
            arg_0.batch_template = arg_0.default_template

            # add jobarray or queue lines to user-specified template
            # note that this is *only* when user did not specify a template.
            # print self.job_array_regexp.search(self.batch_template)
            if not arg_0.job_array_regexp.search(arg_0.batch_template):
                arg_0.log.debug("adding job array settings to batch script")
                arg_3, arg_4 = arg_0.batch_template.split('\n',1)
                arg_0.batch_template = u'\n'.join([arg_3, arg_0.job_array_template, arg_4])

            # print self.queue_regexp.search(self.batch_template)
            if arg_0.queue and not arg_0.queue_regexp.search(arg_0.batch_template):
                arg_0.log.debug("adding PBS queue settings to batch script")
                arg_3, arg_4 = arg_0.batch_template.split('\n',1)
                arg_0.batch_template = u'\n'.join([arg_3, arg_0.queue_template, arg_4])

        arg_5 = arg_0.formatter.format(arg_0.batch_template, **arg_0.context)
        arg_0.log.debug('Writing batch script: %s', arg_0.batch_file)

        with open(arg_0.batch_file, 'w') as f:
            f.write(arg_5)
        os.chmod(arg_0.batch_file, stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)

Instantiate and write the batch script to the work_dir .


def Func(arg_0, arg_1, arg_2):
    """Checks that all classes and namespaces have been completely parsed.

    Call this when all lines in a file have been processed.
    Args:
      filename: The name of the current file.
      error: The function to call with any errors found.
    """
    # Note: This test can result in false positives if #ifdef constructs
    # get in the way of brace matching. See the testBuildClass test in
    # cpplint_unittest.py for an example of this.
    for arg_3 in arg_0.stack:
      if isinstance(arg_3, _ClassInfo):
        arg_2(arg_1, arg_3.starting_linenum, 'build/class', 5,
              'Failed to find complete declaration of class %s' %
              arg_3.name)
      elif isinstance(arg_3, _NamespaceInfo):
        arg_2(arg_1, arg_3.starting_linenum, 'build/namespaces', 5,
              'Failed to find complete declaration of namespace %s' %
              arg_3.name)

Checks that all classes and namespaces have been completely parsed .


return dict(
            dependencies=list(self),
            all=self.all,
            success=self.success,
            failure=self.failure
        )

def Func ( arg_0 ) : return dict ( dependencies = list ( arg_0 ) , all = arg_0 . all , success = arg_0 . success , failure = arg_0 . failure )

def Func(arg_0):
        """Represent this dependency as a dict. For json compatibility."""
        return dict(
            dependencies=list(arg_0),
            all=arg_0.all,
            success=arg_0.success,
            failure=arg_0.failure
        )

Represent this dependency as a dict . For json compatibility .


def Func ( arg_0 = None , arg_1 = None ) : arg_2 = get_lsst_bibtex ( bibtex_filenames = arg_0 ) arg_3 = [ pybtex . database . parse_string ( _bibtex , 'bibtex' ) for _bibtex in arg_2 . values ( ) ] if arg_1 is not None : arg_3 . append ( pybtex . database . parse_string ( arg_1 , 'bibtex' ) ) arg_4 = arg_3 [ 0 ] if len ( arg_3 ) > 1 : for arg_5 in arg_3 [ 1 : ] : for arg_6 , arg_7 in arg_5 . entries . items ( ) : arg_4 . add_entry ( arg_6 , arg_7 ) return arg_4

def Func(arg_0=None, arg_1=None):
    """Make a pybtex BibliographyData instance from standard lsst-texmf
    bibliography files and user-supplied bibtex content.

    Parameters
    ----------
    lsst_bib_names : sequence of `str`, optional
        Names of lsst-texmf BibTeX files to include. For example:

        .. code-block:: python

           ['lsst', 'lsst-dm', 'refs', 'books', 'refs_ads']

        Default is `None`, which includes all lsst-texmf bibtex files.

    bibtex : `str`
        BibTeX source content not included in lsst-texmf. This can be content
        from a import ``local.bib`` file.

    Returns
    -------
    bibliography : `pybtex.database.BibliographyData`
        A pybtex bibliography database that includes all given sources:
        lsst-texmf bibliographies and ``bibtex``.
    """
    arg_2 = get_lsst_bibtex(bibtex_filenames=arg_0)

    # Parse with pybtex into BibliographyData instances
    arg_3 = [pybtex.database.parse_string(_bibtex, 'bibtex')
                   for _bibtex in arg_2.values()]

    # Also parse local bibtex content
    if arg_1 is not None:
        arg_3.append(pybtex.database.parse_string(arg_1, 'bibtex'))

    # Merge BibliographyData
    arg_4 = arg_3[0]
    if len(arg_3) > 1:
        for arg_5 in arg_3[1:]:
            for arg_6, arg_7 in arg_5.entries.items():
                arg_4.add_entry(arg_6, arg_7)

    return arg_4

Make a pybtex BibliographyData instance from standard lsst - texmf bibliography files and user - supplied bibtex content .


def Func(arg_0, arg_1):
        """Generate an HTML Func for `morfs`.

        `morfs` is a list of modules or filenames.

        """
        assert arg_0.config.html_dir, "must give a directory for html Funcing"

        # Read the status data.
        arg_0.status.read(arg_0.config.html_dir)

        # Check that this run used the same settings as the last run.
        arg_2 = Hasher()
        arg_2.update(arg_0.config)
        arg_3 = arg_2.digest()
        if arg_0.status.settings_hash() != arg_3:
            arg_0.status.reset()
            arg_0.status.set_settings_hash(arg_3)

        # The user may have extra CSS they want copied.
        if arg_0.config.extra_css:
            arg_0.extra_css = os.path.basename(arg_0.config.extra_css)

        # Process all the files.
        arg_0.Func_files(arg_0.html_file, arg_1, arg_0.config.html_dir)

        if not arg_0.files:
            raise CoverageException("No data to Func.")

        # Write the index file.
        arg_0.index_file()

        arg_0.make_local_static_Func_files()

        return arg_0.totals.pc_covered

Generate an HTML report for `morfs`.

        `morfs` is a list of modules or filenames.


def Func(arg_0, arg_1):
        """Echos only the id"""
        if 'id' in arg_1:
            return str(arg_1['id'])
        if 'results' in arg_1:
            return ' '.join([six.text_type(arg_2['id']) for arg_2 in arg_1['results']])
        raise MultipleRelatedError('Could not serialize output with id format.')


def Func ( arg_0 , arg_1 = False ) : if type ( arg_0 . _path ) == str : arg_2 = arg_0 . _path . split ( '.' ) else : arg_2 = [ arg_0 . _path ] arg_3 = arg_0 . _root . _data arg_4 = [ arg_0 . _root . _data ] while len ( arg_2 ) : arg_5 = arg_2 . pop ( 0 ) try : arg_5 = int ( arg_5 ) except : pass if arg_1 : if type ( arg_3 ) == dict and arg_5 not in arg_3 : arg_3 [ arg_5 ] = { } elif type ( arg_3 ) == list and type ( arg_5 ) == int and len ( arg_3 ) < arg_5 : arg_3 . append ( [ None for arg_6 in range ( arg_5 - len ( arg_3 ) ) ] ) arg_4 . append ( arg_3 ) try : arg_3 = arg_3 [ arg_5 ] except TypeError : if type ( arg_5 ) == int : raise IndexError ( arg_5 ) else : raise KeyError ( arg_5 ) return ( arg_4 [ - 1 ] , arg_5 )

def Func(arg_0, arg_1=False):
        """
        Returns a tuple of a reference to the last container in the path, and
        the last component in the key path.

        For example, with a self._value like this:

        {
            'thing': {
                'another': {
                    'some_leaf': 5,
                    'one_more': {
                        'other_leaf': 'x'
                    }
                }
            }
        }

        And a self._path of: 'thing.another.some_leaf'

        This will return a tuple of a reference to the 'another' dict, and
        'some_leaf', allowing the setter and casting methods to directly access
        the item referred to by the key path.
        """
        # Split up the key path
        if type(arg_0._path) == str:
            arg_2 = arg_0._path.split('.')
        else:
            arg_2 = [arg_0._path]

        # Start at the root node
        arg_3 = arg_0._root._data
        arg_4 = [arg_0._root._data]

        # Traverse along key path
        while len(arg_2):
            # Get the next key in the key path
            arg_5 = arg_2.pop(0)

            # See if the test could be an int for array access, if so assume it is
            try:
                arg_5 = int(arg_5)
            except:
                pass

            # If the next level doesn't exist, create it
            if arg_1:
                if type(arg_3) == dict and arg_5 not in arg_3:
                    arg_3[arg_5] = {}
                elif type(arg_3) == list and type(arg_5) == int and len(arg_3) < arg_5:
                    arg_3.append([None for arg_6 in range(arg_5-len(arg_3))])

            # Store the last node and traverse down the hierarchy
            arg_4.append(arg_3)
            try:
                arg_3 = arg_3[arg_5]
            except TypeError:
                if type(arg_5) == int:
                    raise IndexError(arg_5)
                else:
                    raise KeyError(arg_5)

        return (arg_4[-1], arg_5)

Returns a tuple of a reference to the last container in the path and the last component in the key path .


def Func ( arg_0 , arg_1 , arg_2 ) -> None : arg_0 . _events . push ( arg_0 . now , arg_2 , arg_1 )

def Func(arg_0, arg_1, arg_2) -> None:
        """
        Schedule process on actual time with specified priority
        """
        arg_0._events.push(arg_0.now, arg_2, arg_1)


def Func ( arg_0 ) : arg_1 = StringIO ( ) arg_0 . write ( arg_1 ) arg_1 . flush ( ) arg_1 . seek ( 0 ) return arg_1

def Func(arg_0):
        """Turns a ConfigParser into a StringIO stream."""
        arg_1 = StringIO()
        arg_0.write(arg_1)
        arg_1.flush()
        arg_1.seek(0)
        return arg_1

Turns a ConfigParser into a StringIO stream .


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

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

   Args:
        params: dictionary with layer parameters
        w_name: name prefix in state_dict
        scope_name: pytorch scope name
        inputs: pytorch node inputs
        layers: dictionary with keras tensors
        weights: pytorch state_dict
        names: use short names for keras layers
    """
    print('Converting reshape ...')
    if arg_6 == 'short':
        arg_7 = 'RESH' + random_string(4)
    elif arg_6 == 'keep':
        arg_7 = arg_1
    else:
        arg_7 = arg_1 + str(random.random())

    if len(arg_3) > 1:
        if arg_4[arg_3[1]][0] == -1:
            print('Cannot deduct batch size! It will be omitted, but result may be wrong.')

        arg_8 = keras.layers.Reshape(arg_4[arg_3[1] + '_np'], name=arg_7)
        arg_4[arg_2] = arg_8(arg_4[arg_3[0]])
    else:
        if arg_3[0] in arg_4:
            arg_8 = keras.layers.Reshape(arg_0['shape'][1:], name=arg_7)
            arg_4[arg_2] = arg_8(arg_4[arg_3[0]])
        else:
            print('Skip weight matrix transpose, but result may be wrong.')


def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """
        Create a tar file package of all the repository files and directories.
        Only files and directories that are tracked in the repository
        are stored in the package tar file.

        **N.B. On some systems packaging requires root permissions.**

        :Parameters:
            #. path (None, string): The real absolute path where to create the
               package. If None, it will be created in the same directory as
               the repository. If '.' or an empty string is passed, the current
               working directory will be used.
            #. name (None, string): The name to give to the package file
               If None, the package directory name will be used with the
               appropriate extension added.
            #. mode (None, string): The writing mode of the tarfile.
               If None, automatically the best compression mode will be chose.
               Available modes are ('w', 'w:', 'w:gz', 'w:bz2')
        """
        # check mode
        assert arg_3 in (None, 'w', 'w:', 'w:gz', 'w:bz2'), 'unkown archive mode %s'%str(arg_3)
        if arg_3 is None:
            #mode = 'w:bz2'
            arg_3 = 'w:'
        # get root
        if arg_1 is None:
            arg_4 = os.path.split(arg_0.__path)[0]
        elif arg_1.strip() in ('','.'):
            arg_4 = os.getcwd()
        else:
            arg_4 = os.path.realpath( os.path.expanduser(arg_1) )
        assert os.path.isdir(arg_4), 'absolute path %s is not a valid directory'%arg_1
        # get name
        if arg_2 is None:
            arg_5 = arg_3.split(":")
            if len(arg_5) == 2:
                if len(arg_5[1]):
                    arg_5 = "."+arg_5[1]
                else:
                    arg_5 = '.tar'
            else:
                arg_5 = '.tar'
            arg_2 = os.path.split(arg_0.__path)[1]+arg_5
        # create tar file
        arg_6 = os.path.join(arg_4, arg_2)
        try:
            arg_7 = tarfile.TarFile.open(arg_6, arg_3=arg_3)
        except Exception as e:
            raise Exception("Unable to create package (%s)"%e)
        # walk directory and create empty directories
        for arg_8 in sorted(list(arg_0.walk_directories_path(recursive=True))):
            arg_9 = tarfile.TarInfo( arg_8 )
            arg_9.type = tarfile.DIRTYPE
            arg_7.addfile(arg_9)
            arg_7.add(os.path.join(arg_0.__path,arg_8,arg_0.__dirInfo), arcname=arg_0.__dirInfo)
        # walk files and add to tar
        for arg_11 in arg_0.walk_files_path(recursive=True):
            arg_12, arg_13 = os.path.split(arg_11)
            arg_7.add(os.path.join(arg_0.__path,arg_11), arcname=arg_13)
            arg_7.add(os.path.join(arg_0.__path,arg_12,arg_0.__fileInfo%arg_13), arcname=arg_0.__fileInfo%arg_13)
            arg_7.add(os.path.join(arg_0.__path,arg_12,arg_0.__fileClass%arg_13), arcname=arg_0.__fileClass%arg_13)
        # save repository .pyrepinfo
        arg_7.add(os.path.join(arg_0.__path,arg_0.__repoFile), arcname=".pyrepinfo")
        # close tar file
        arg_7.close()

Create a tar file package of all the repository files and directories . Only files and directories that are tracked in the repository are stored in the package tar file .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : arg_1 = arg_0 . current_layer ( ) if arg_1 != 0 : change ( arg_0 , 0 ) for arg_2 in range ( arg_1 ) : delete ( arg_0 , 0 ) return None

def Func(arg_0, arg_1=None):
    """ Delete all layers below the specified one.

    Useful for MeshLab ver 2016.12, whcih will only output layer 0.
    """
    if arg_1 is None:
        arg_1 = arg_0.current_layer()
    if arg_1 != 0:
        change(arg_0, 0)
    for arg_2 in range(arg_1):
        delete(arg_0, 0)
    return None

Delete all layers below the specified one .


def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
with
jsonconfig
.
Config
(
"messages"
,
indent
=
4
)
as
cfg
:
write_data
(
arg_0
,
arg_1
,
arg_2
,
cfg
)
write_auth
(
arg_0
,
arg_1
,
arg_3
,
cfg
)
print
(
"[+] Configuration entry for <"
+
arg_1
+
"> created."
)
print
(
"[+] Configuration file location: "
+
cfg
.
filename
)

def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Create the profile entry.

    Args:
        :msg_type: (str) message type to create config entry.
        :profile_name: (str) name of the profile entry
        :data: (dict) dict values for the 'settings'
        :auth: (dict) auth parameters
    """
    with jsonconfig.Config("messages", indent=4) as cfg:
        write_data(arg_0, arg_1, arg_2, cfg)
        write_auth(arg_0, arg_1, arg_3, cfg)

    print("[+] Configuration entry for <" + arg_1 + "> created.")
    print("[+] Configuration file location: " + cfg.filename)


def Func ( arg_0 , arg_1 = None ) : arg_2 = arg_0 . get_params ( arg_1 ) arg_3 = [ p . errors for p in arg_2 ] return np . array ( arg_3 )

def Func(arg_0, arg_1=None):
        """ Return an array with the parameter errors

        Parameters
        ----------
        pname : list of string or none
           If a list of strings, get the Parameter objects with those names

           If none, get all the Parameter objects

        Returns
        -------
        ~numpy.array of parameter errors

        Note that this is a N x 2 array.
        """
        arg_2 = arg_0.get_params(arg_1)
        arg_3 = [p.errors for p in arg_2]
        return np.array(arg_3)


return imap(lambda (cid, fc): (cid[0], fc_loads(fc)),
                    self.kvl.scan(self.TABLE, *key_ranges))

def Func ( arg_0 , * arg_1 ) : arg_1 = [ ( tuplify ( s ) , tuplify ( e ) ) for s , e in arg_1 ] return imap ( lambda ( cid , fc ) : ( cid [ 0 ] , fc_loads ( fc ) ) , arg_0 . kvl . Func ( arg_0 . TABLE , * arg_1 ) )

def Func(arg_0, *arg_1):
        '''Retrieve feature collections in a range of ids.

        Returns a generator of content objects corresponding to the
        content identifier ranges given. `key_ranges` can be a possibly
        empty list of 2-tuples, where the first element of the tuple
        is the beginning of a range and the second element is the end
        of a range. To specify the beginning or end of the table, use
        an empty tuple `()`.

        If the list is empty, then this yields all content objects in
        the storage.

        :param key_ranges: as described in
                           :meth:`kvlayer._abstract_storage.AbstractStorage`
        :rtype: generator of
                (``content_id``, :class:`dossier.fc.FeatureCollection`).
        '''
        # (id, id) -> ((id,), (id,))
        arg_1 = [(tuplify(s), tuplify(e)) for s, e in arg_1]
        return imap(lambda (cid, fc): (cid[0], fc_loads(fc)),
                    arg_0.kvl.Func(arg_0.TABLE, *arg_1))

Retrieve feature collections in a range of ids .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
stream_id_pattern
.
search
(
arg_1
)
if
not
arg_2
:
arg_0
.
logger
.
error
(
"Failed to extract stream_id."
)
return
arg_2
.
group
(
"stream_id"
)

def Func(arg_0, arg_1):
        """Returns the stream_id contained in the HTML."""
        arg_2 = stream_id_pattern.search(arg_1)

        if not arg_2:
            arg_0.logger.error("Failed to extract stream_id.")

        return arg_2.group("stream_id")

Returns the stream_id contained in the HTML .


def Func ( arg_0 , arg_1 ) : if isinstance ( arg_1 , text_type ) : warnings . warn ( _TEXT_WARNING . format ( arg_0 ) , category = DeprecationWarning , stacklevel = 3 ) return arg_1 . encode ( 'utf-8' ) return arg_1

def Func(arg_0, arg_1):
    """
    If ``obj`` is text, emit a warning that it should be bytes instead and try
    to convert it to bytes automatically.

    :param str label: The name of the parameter from which ``obj`` was taken
        (so a developer can easily find the source of the problem and correct
        it).

    :return: If ``obj`` is the text string type, a ``bytes`` object giving the
        UTF-8 encoding of that text is returned.  Otherwise, ``obj`` itself is
        returned.
    """
    if isinstance(arg_1, text_type):
        warnings.warn(
            _TEXT_WARNING.format(arg_0),
            category=DeprecationWarning,
            stacklevel=3
        )
        return arg_1.encode('utf-8')
    return arg_1

If obj is text emit a warning that it should be bytes instead and try to convert it to bytes automatically .


def
Func
(
arg_0
)
:
if
arg_0
.
get
(
'title'
)
and
arg_0
.
get
(
'track_number'
)
:
arg_1
=
'{track_number:0>2} {title}'
.
format
(
**
arg_0
)
elif
arg_0
.
get
(
'title'
)
and
arg_0
.
get
(
'trackNumber'
)
:
arg_1
=
'{trackNumber:0>2} {title}'
.
format
(
**
arg_0
)
elif
arg_0
.
get
(
'title'
)
and
arg_0
.
get
(
'tracknumber'
)
:
arg_1
=
'{tracknumber:0>2} {title}'
.
format
(
**
arg_0
)
else
:
arg_1
=
'00 {}'
.
format
(
arg_0
.
get
(
'title'
,
''
)
)
return
arg_1

def Func(arg_0):
	"""Generate a filename for a song based on metadata.

	Parameters:
		metadata (dict): A metadata dict.

	Returns:
		A filename.
	"""

	if arg_0.get('title') and arg_0.get('track_number'):
		arg_1 = '{track_number:0>2} {title}'.format(**arg_0)
	elif arg_0.get('title') and arg_0.get('trackNumber'):
		arg_1 = '{trackNumber:0>2} {title}'.format(**arg_0)
	elif arg_0.get('title') and arg_0.get('tracknumber'):
		arg_1 = '{tracknumber:0>2} {title}'.format(**arg_0)
	else:
		arg_1 = '00 {}'.format(arg_0.get('title', ''))

	return arg_1

Generate a filename for a song based on metadata .


def Func(arg_0, *arg_1, **arg_2):
        """
        Runs the current operator with the subject arguments to test.

        This method is implemented by matchers only.
        """
        log.debug('[operator] Func "{}" with arguments: {}'.format(
            arg_0.__class__.__name__, arg_1
        ))

        if arg_0.kind == OperatorTypes.ATTRIBUTE:
            return arg_0.match(arg_0.ctx)
        else:
            return arg_0.Func_matcher(*arg_1, **arg_2)

Runs the current operator with the subject arguments to test .


def
Func
(
arg_0
,
arg_1
)
:
if
arg_0
.
nearest_version
<
arg_1
:
if
arg_0
.
_version_given
:
raise
ValueError
(
'Data type requires version %s'
%
arg_1
)
else
:
arg_0
.
_version
=
arg_1

def Func(arg_0, arg_1):
        '''
        Assert that the grid version is equal to or above the given value.
        If no version is set, set the version.
        '''
        if arg_0.nearest_version < arg_1:
            if arg_0._version_given:
                raise ValueError(
                        'Data type requires version %s' \
                        % arg_1)
            else:
                arg_0._version = arg_1

Assert that the grid version is equal to or above the given value . If no version is set set the version .


def Func(arg_0, **arg_1):
        """
        Get the system wide configuration Func.

        Returns:
            A dict respresentation of the JSON returned from the API.
        """
        arg_2 = arg_0._get_path('Func')

        arg_3 = arg_0._GET(arg_2, arg_1)
        arg_0._set_attrs_to_values(arg_3)
        return arg_3

Get the system wide configuration info.

        Returns:
            A dict respresentation of the JSON returned from the API.

Get the system wide configuration info .


(
            self,
            filepath,
            table,
            delimiter=",",
            field_dict=None,
            create=True,
            overwrite=True,
            partition=None,
            recreate=False,
            tblproperties=None)

def Func(
            arg_0,
            arg_1,
            arg_2,
            arg_3=",",
            arg_4=None,
            arg_5=True,
            arg_6=True,
            arg_7=None,
            arg_8=False,
            arg_9=None):
        """
        Loads a local file into Hive

        Note that the table generated in Hive uses ``STORED AS textfile``
        which isn't the most efficient serialization format. If a
        large amount of data is loaded and/or if the tables gets
        queried considerably, you may want to use this operator only to
        stage the data into a temporary table before loading it into its
        final destination using a ``HiveOperator``.

        :param filepath: local filepath of the file to load
        :type filepath: str
        :param table: target Hive table, use dot notation to target a
            specific database
        :type table: str
        :param delimiter: field delimiter in the file
        :type delimiter: str
        :param field_dict: A dictionary of the fields name in the file
            as keys and their Hive types as values.
            Note that it must be OrderedDict so as to keep columns' order.
        :type field_dict: collections.OrderedDict
        :param create: whether to create the table if it doesn't exist
        :type create: bool
        :param overwrite: whether to overwrite the data in table or partition
        :type overwrite: bool
        :param partition: target partition as a dict of partition columns
            and values
        :type partition: dict
        :param recreate: whether to drop and recreate the table at every
            execution
        :type recreate: bool
        :param tblproperties: TBLPROPERTIES of the hive table being created
        :type tblproperties: dict
        """
        arg_10 = ''
        if arg_8:
            arg_10 += "DROP TABLE IF EXISTS {table};\n".format(arg_2=arg_2)
        if arg_5 or arg_8:
            if arg_4 is None:
                raise ValueError("Must provide a field dict when creating a table")
            arg_11 = ",\n    ".join(
                [k + ' ' + v for k, v in arg_4.items()])
            arg_10 += "CREATE TABLE IF NOT EXISTS {table} (\n{fields})\n".format(
                arg_2=arg_2, arg_11=arg_11)
            if arg_7:
                arg_12 = ",\n    ".join(
                    [p + " STRING" for p in arg_7])
                arg_10 += "PARTITIONED BY ({pfields})\n".format(arg_12=arg_12)
            arg_10 += "ROW FORMAT DELIMITED\n"
            arg_10 += "FIELDS TERMINATED BY '{delimiter}'\n".format(arg_3=arg_3)
            arg_10 += "STORED AS textfile\n"
            if arg_9 is not None:
                arg_13 = ", ".join(
                    ["'{0}'='{1}'".format(k, v) for k, v in arg_9.items()])
                arg_10 += "TBLPROPERTIES({tprops})\n".format(arg_13=arg_13)
        arg_10 += ";"
        arg_0.log.info(arg_10)
        arg_0.run_cli(arg_10)
        arg_10 = "LOAD DATA LOCAL INPATH '{filepath}' ".format(arg_1=arg_1)
        if arg_6:
            arg_10 += "OVERWRITE "
        arg_10 += "INTO TABLE {table} ".format(arg_2=arg_2)
        if arg_7:
            arg_14 = ", ".join(
                ["{0}='{1}'".format(k, v) for k, v in arg_7.items()])
            arg_10 += "PARTITION ({pvals})".format(arg_14=arg_14)

        # As a workaround for HIVE-10541, add a newline character
        # at the end of hql (AIRFLOW-2412).
        arg_10 += ';\n'

        arg_0.log.info(arg_10)
        arg_0.run_cli(arg_10)


(self, config_file=None, specs=None, default_file=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None):
        """Read a config_file, check the validity with a JSON Schema as specs
        and get default values from default_file if asked.

        All parameters are optionnal.

        If there is no config_file defined, read the venv base
        dir and try to get config/app.yml.

        If no specs, don't validate anything.

        If no default_file, don't merge with default values."""

        arg_0._config_exists(arg_1)
        arg_0._specs_exists(arg_2)

        arg_0.loaded_config = anyconfig.load(arg_0.config_file, ac_Funcr='yaml')

        if arg_3 is not None:
            arg_0._merge_default(arg_3)

        if arg_0.specs is None:
            return arg_0.loaded_config

        arg_0._validate()

        return arg_0.loaded_config

Read a config_file check the validity with a JSON Schema as specs and get default values from default_file if asked .


(self, cmd, stdin_content="", stdin=False, shell=False, timeout=2)

def
Func
(
arg_0
,
arg_1
,
arg_2
=
""
,
arg_3
=
False
,
arg_4
=
False
,
arg_5
=
2
)
:
try
:
if
type
(
arg_1
)
!=
list
:
raise
PJFInvalidType
(
type
(
arg_1
)
,
list
)
if
type
(
arg_2
)
!=
str
:
raise
PJFInvalidType
(
type
(
arg_2
)
,
str
)
if
type
(
arg_3
)
!=
bool
:
raise
PJFInvalidType
(
type
(
arg_3
)
,
bool
)
arg_0
.
_in
=
arg_2
try
:
arg_0
.
process
=
subprocess
.
Popen
(
arg_1
,
stdout
=
PIPE
,
stderr
=
PIPE
,
arg_3
=
PIPE
,
arg_4
=
arg_4
)
arg_0
.
finish_read
(
arg_5
,
arg_2
,
arg_3
)
if
arg_0
.
process
.
poll
(
)
is
not
:
arg_0
.
close
(
)
except
KeyboardInterrupt
:
return
except
OSError
:
raise
PJFProcessExecutionError
(
"Binary <%s> does not exist"
%
arg_1
[
0
]
)
except
Exception
as
e
:
raise
PJFBaseException
(
e
.
message
if
hasattr
(
e
,
"message"
)
else
str
(
e
)
)

def Func(arg_0, arg_1, arg_2="", arg_3=False, arg_4=False, arg_5=2):
        """
        Spawn a new process using subprocess
        """
        try:
            if type(arg_1) != list:
                raise PJFInvalidType(type(arg_1), list)
            if type(arg_2) != str:
                raise PJFInvalidType(type(arg_2), str)
            if type(arg_3) != bool:
                raise PJFInvalidType(type(arg_3), bool)
            arg_0._in = arg_2
            try:
                arg_0.process = subprocess.Popen(arg_1, stdout=PIPE, stderr=PIPE, arg_3=PIPE, arg_4=arg_4)
                arg_0.finish_read(arg_5, arg_2, arg_3)
                if arg_0.process.poll() is not None:
                    arg_0.close()
            except KeyboardInterrupt:
                return
        except OSError:
            raise PJFProcessExecutionError("Binary <%s> does not exist" % arg_1[0])
        except Exception as e:
            raise PJFBaseException(e.message if hasattr(e, "message") else str(e))


(self, service, method, params=None, body="",
                      need_auth=True)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4="",
                      arg_5=True):
        """Make an API request to the router."""
        # If we have no cookie (v2) or never called login before (v1)
        # and we need auth, the request will fail for sure.
        if arg_5 and not arg_0.cookie:
            if not arg_0.login():
                return False, None

        arg_6 = arg_0._get_headers(arg_1, arg_2, arg_5)

        if not arg_4:
            if not arg_3:
                arg_3 = ""
            if isinstance(arg_3, dict):
                arg_7 = arg_3
                arg_3 = ""
                for arg_8 in arg_7:
                    arg_3 += "<" + arg_8 + ">" + arg_7[arg_8] + "</" + arg_8 + ">\n"

            arg_4 = CALL_BODY.format(arg_1=SERVICE_PREFIX + arg_1,
                                    arg_2=arg_2, arg_3=arg_3)

        arg_9 = SOAP_REQUEST.format(session_id=SESSION_ID, arg_4=arg_4)

        try:
            arg_10 = requests.post(arg_0.soap_url, arg_6=arg_6,
                                     data=arg_9, timeout=30, verify=False)

            if arg_5 and _is_unauthorized_response(arg_10):
                # let's discard the cookie because it probably expired (v2)
                # or the IP-bound (?) session expired (v1)
                arg_0.cookie = None

                _LOGGER.warning("Unauthorized response, let's login and retry...")
                if arg_0.login():
                    # reset headers with new cookie first
                    arg_6 = arg_0._get_headers(arg_1, arg_2, arg_5)
                    arg_10 = requests.post(arg_0.soap_url, arg_6=arg_6,
                                             data=arg_9, timeout=30, verify=False)

            arg_12 = _is_valid_response(arg_10)

            if not arg_12:
                _LOGGER.error("Invalid response")
                _LOGGER.debug("%s\n%s\n%s", arg_10.status_code, str(arg_10.headers), arg_10.text)

            return arg_12, arg_10

        except requests.exceptions.RequestException:
            _LOGGER.exception("Error talking to API")

            # Maybe one day we will distinguish between
            # different errors..
            return False, None


return '_'.join((self.id, 'reverse',
                         hashlib.md5(
                             self.id.encode('utf-8')).hexdigest()[0:5]))

def Func ( arg_0 ) : return '_' . join ( ( arg_0 . id , 'reverse' , hashlib . md5 ( arg_0 . id . encode ( 'utf-8' ) ) . hexdigest ( ) [ 0 : 5 ] ) )

def Func(arg_0):
        """Generate the id of reverse_variable from the reaction's id."""
        return '_'.join((arg_0.id, 'reverse',
                         hashlib.md5(
                             arg_0.id.encode('utf-8')).hexdigest()[0:5]))

Generate the id of reverse_variable from the reaction s id .


return cls(
            name=entry_dict["name"],
            instance_type=entry_dict["instance_type"],
            hostname=entry_dict["hostname"],
            private_ip=entry_dict["private_ip"],
            public_ip=entry_dict["public_ip"],
            stack_name=entry_dict["stack_name"],
            stack_id=entry_dict["stack_id"],
            logical_id=entry_dict["logical_id"],
            security_groups=entry_dict["security_groups"],
            tags=entry_dict["tags"],
            ami_id=entry_dict["ami_id"],
            launch_time=entry_dict["launch_time"],
            instance_id=entry_dict["instance_id"]
        )

def Func(arg_0, arg_1):
        """Deserialize a HostEntry from a dictionary.

        This is more or less the same as calling
        HostEntry(**entry_dict), but is clearer if something is
        missing.

        :param entry_dict: A dictionary in the format outputted by to_dict().
        :type entry_dict: ``dict``

        :return: A HostEntry object.
        :rtype: ``cls``
        """
        return arg_0(
            name=arg_1["name"],
            instance_type=arg_1["instance_type"],
            hostname=arg_1["hostname"],
            private_ip=arg_1["private_ip"],
            public_ip=arg_1["public_ip"],
            stack_name=arg_1["stack_name"],
            stack_id=arg_1["stack_id"],
            logical_id=arg_1["logical_id"],
            security_groups=arg_1["security_groups"],
            tags=arg_1["tags"],
            ami_id=arg_1["ami_id"],
            launch_time=arg_1["launch_time"],
            instance_id=arg_1["instance_id"]
        )

Deserialize a HostEntry from a dictionary .


def
Func
(
arg_0
,
arg_1
=
)
:
if
arg_1
is
not
and
not
arg_1
>=
0
:
raise
ValueError
(
"timeout must be a positive integer"
)
return
arg_0
.
_platform_impl
.
process_Func
(
arg_1
)

def Func(arg_0, arg_1=None):
        """Wait for process to terminate and, if process is a children
        of the current one also return its exit code, else None.
        """
        if arg_1 is not None and not arg_1 >= 0:
            raise ValueError("timeout must be a positive integer")
        return arg_0._platform_impl.process_Func(arg_1)

Wait for process to terminate and if process is a children of the current one also return its exit code else None .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
,
arg_3
=
,
if
arg_0
.
args
:
arg_2
=
_eval_args
(
arg_0
.
args
,
arg_1
)
if
arg_0
.
kwargs
:
arg_3
=
_eval_kwargs
(
arg_0
.
kwargs
,
arg_1
)
LOG
.
debug
(
"%s (task id %s) calling %s"
%
(
arg_0
.
name
,
arg_1
.
id
,
arg_0
.
call
)
,
extra
=
dict
(
data
=
dict
(
arg_2
=
arg_2
,
arg_3
=
arg_3
)
)
)
arg_4
=
default_app
.
send_task
(
arg_0
.
call
,
arg_2
=
arg_2
,
arg_3
=
arg_3
)
arg_1
.
_set_internal_data
(
task_id
=
arg_4
.
task_id
)
arg_1
.
async_call
=
arg_4
LOG
.
debug
(
"'%s' called: %s"
%
(
arg_0
.
call
,
arg_1
.
async_call
.
task_id
)
)

def Func(arg_0, arg_1):
        """Sends Celery asynchronous call and stores async call information for
        retrieval laster"""
        arg_2, arg_3 = None, None
        if arg_0.args:
            arg_2 = _eval_args(arg_0.args, arg_1)
        if arg_0.kwargs:
            arg_3 = _eval_kwargs(arg_0.kwargs, arg_1)
        LOG.debug(
            "%s (task id %s) calling %s" % (arg_0.name, arg_1.id, arg_0.call),
            extra=dict(data=dict(arg_2=arg_2, arg_3=arg_3)))
        arg_4 = default_app.send_task(arg_0.call, arg_2=arg_2, arg_3=arg_3)
        arg_1._set_internal_data(task_id=arg_4.task_id)
        arg_1.async_call = arg_4
        LOG.debug("'%s' called: %s" % (arg_0.call, arg_1.async_call.task_id))


def Func(arg_0, arg_1):
        """Initializes profiler with a function."""
        arg_0.profile = arg_0.profile_function
        arg_0._run_object, arg_0._run_args, arg_0._run_kwargs = arg_1
        arg_6 = inspect.getsourcefile(arg_0._run_object)
        arg_0._object_name = '%s @ %s (function)' % (
            arg_0._run_object.__name__, arg_6)


WindowFromPoint from Win32.
    Return int, a native window handle.

def Func ( arg_0 : arg_1 , arg_2 : arg_1 ) -> arg_1 : return ctypes . windll . user32 . Func ( ctypes . wintypes . POINT ( arg_0 , arg_2 ) )

def Func(arg_0: arg_1, arg_2: arg_1) -> arg_1:
    """
    Func from Win32.
    Return int, a native window handle.
    """
    return ctypes.windll.user32.Func(ctypes.wintypes.POINT(arg_0, arg_2))

WindowFromPoint from Win32 . Return int a native window handle .


def Func ( * arg_0 ) : arg_1 = [ ] for arg_2 in arg_0 : if isinstance ( arg_2 , basestring ) : arg_3 = arg_2 . encode ( 'utf-8' ) if isinstance ( arg_2 , unicode ) else arg_2 arg_1 . append ( urllib . quote ( arg_3 ) ) else : arg_3 = str ( arg_2 ) arg_1 . append ( urllib . quote ( arg_3 ) ) return ';' . join ( arg_1 )

def Func(*arg_0):
    """
    Do url-encode resource ids
    """

    arg_1 = []
    for arg_2 in arg_0:
        if isinstance(arg_2, basestring):
            arg_3 = arg_2.encode('utf-8') if isinstance(arg_2, unicode) else arg_2
            arg_1.append(urllib.quote(arg_3))
        else:
            arg_3 = str(arg_2)
            arg_1.append(urllib.quote(arg_3))

    return ';'.join(arg_1)


def Func ( arg_0 ) : arg_1 = get_md5sum ( arg_0 ) arg_2 = arg_0 + '.md5' arg_3 = True if os . path . exists ( arg_2 ) : with open ( arg_2 , 'r' ) as file_checksum : arg_4 = file_checksum . read ( ) if arg_1 == arg_4 : arg_3 = False if arg_3 : with open ( arg_2 , 'w' ) as file_checksum : file_checksum . write ( arg_1 ) return arg_3

def Func(arg_0):
    """Returns True if src_file has a different md5sum"""

    arg_1 = get_md5sum(arg_0)

    arg_2 = arg_0 + '.md5'
    arg_3 = True
    if os.path.exists(arg_2):
        with open(arg_2, 'r') as file_checksum:
            arg_4 = file_checksum.read()
        if arg_1 == arg_4:
            arg_3 = False

    if arg_3:
        with open(arg_2, 'w') as file_checksum:
            file_checksum.write(arg_1)

    return arg_3


def Func ( arg_0 ) : if os . path . isdir ( arg_0 ) : arg_1 = os . path . basename ( arg_0 ) if ident_re . match ( arg_1 ) : for arg_2 in ( '__init__.py' , '__init__.pyc' , '__init__.pyo' ) : if os . path . isfile ( os . path . join ( arg_0 , arg_2 ) ) : return True if sys . platform . startswith ( 'java' ) and os . path . isfile ( os . path . join ( arg_0 , '__init__$py.class' ) ) : return True return False

def Func(arg_0):
    """
    Is this path a package directory?

    >>> Func('nose')
    True
    >>> Func('unit_tests')
    False
    >>> Func('nose/plugins')
    True
    >>> Func('nose/loader.py')
    False
    """
    if os.path.isdir(arg_0):
        # at least the end of the path must be a legal python identifier
        # and __init__.py[co] must exist
        arg_1 = os.path.basename(arg_0)
        if ident_re.match(arg_1):
            for arg_2 in ('__init__.py', '__init__.pyc', '__init__.pyo'):
                if os.path.isfile(os.path.join(arg_0, arg_2)):
                    return True
            if sys.platform.startswith('java') and \
                    os.path.isfile(os.path.join(arg_0, '__init__$py.class')):
                return True
    return False

Is this path a package directory?

    >>> ispackage('nose')
    True
    >>> ispackage('unit_tests')
    False
    >>> ispackage('nose/plugins')
    True
    >>> ispackage('nose/loader.py')
    False


def Func ( arg_0 , arg_1 ) : arg_2 = { } for arg_3 , arg_4 in arg_0 . items ( ) : if arg_3 not in arg_1 : arg_2 . update ( { arg_3 : arg_4 } ) return arg_2

def Func(arg_0, arg_1):
    """Return a new dict with specified keys excluded from the origional dict

    Args:
        d (dict): origional dict
        exclude (list): The keys that are excluded
    """
    arg_2 = {}
    for arg_3, arg_4 in arg_0.items():
        if arg_3 not in arg_1:
            arg_2.update({arg_3: arg_4})
    return arg_2


def Func(arg_0):
        """walks the byte code to find the variables which are actually globals"""
        arg_1 = 0
        arg_2 = arg_0.co_code

        arg_3 = set()
        while arg_1 < len(arg_2):
            arg_4 = ord(arg_2[arg_1])

            if arg_4 >= dis.HAVE_ARGUMENT:
                if arg_4 == _LOAD_GLOBAL:
                    arg_5 = ord(arg_2[arg_1 + 1]) + (ord(arg_2[arg_1 + 2]) << 8)
                    arg_6 = arg_0.co_names[arg_5]
                    arg_3.add(arg_6)

                arg_1 += 2
            arg_1 += 1

        return arg_3


def Func(arg_0):
    """The python source of the parser generated from the input source."""
    if arg_0._Func is None:
      arg_0._Func = arg_0._compile()
    return arg_0._Func

The python source of the parser generated from the input source .


def Func ( arg_0 , arg_1 ) : try : for arg_2 in range ( arg_1 ) : arg_0 . buffer . append ( arg_0 . source . next ( ) ) except StopIteration : arg_0 . buffer . append ( ( EndOfFile , EndOfFile ) ) arg_0 . len = arg_3 ( arg_0 . buffer )

def Func(arg_0, arg_1):
        """fills the internal buffer from the source iterator"""
        try:
            for arg_2 in range(arg_1):
                arg_0.buffer.append(arg_0.source.next())
        except StopIteration:
            arg_0.buffer.append((EndOfFile, EndOfFile))
        arg_0.len = arg_3(arg_0.buffer)


def Func(arg_0):
        """
        Return the issuer of this certificate.

        This creates a new :class:`X509Name` that wraps the underlying issuer
        name field on the certificate. Modifying it will modify the underlying
        certificate, and will have the effect of modifying any other
        :class:`X509Name` that refers to this issuer.

        :return: The issuer of this certificate.
        :rtype: :class:`X509Name`
        """
        arg_1 = arg_0._get_name(_lib.X509_Func_name)
        arg_0._issuer_invalidator.add(arg_1)
        return arg_1


def Func ( arg_0 , arg_1 ) : check_type ( arg_1 , basestring , may_be_none = False ) arg_0 . _session . Func ( API_ENDPOINT + '/' + arg_1 )

def Func(arg_0, arg_1):
        """Delete a message.

        Args:
            messageId(basestring): The ID of the message to be Funcd.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.

        """
        check_type(arg_1, basestring, may_be_none=False)

        # API request
        arg_0._session.Func(API_ENDPOINT + '/' + arg_1)

Delete a message.

        Args:
            messageId(basestring): The ID of the message to be deleted.

        Raises:
            TypeError: If the parameter types are incorrect.
            ApiError: If the Webex Teams cloud returns an error.


(fileobj, keywords, comment_tags, options)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
)
:
arg_4
=
get_pipeserver
(
)
arg_4
.
sendline
(
COMMAND
+
u'PARSE FILE:'
+
arg_0
.
name
)
arg_4
.
expect
(
RESPONSE
+
'SENDING OUTPUT'
)
arg_4
.
expect
(
RESPONSE
+
'OUTPUT END'
)
arg_5
=
arg_4
.
before
for
arg_6
in
json
.
loads
(
arg_5
)
:
arg_7
=
[
arg_6
[
'content'
]
]
if
arg_6
[
'funcname'
]
==
'ngettext'
:
arg_7
.
append
(
arg_6
[
'alt_content'
]
)
yield
arg_6
[
'line_number'
]
,
arg_6
[
'funcname'
]
,
tuple
(
arg_7
)
,
[
]

def Func(arg_0, arg_1, arg_2, arg_3):
    """Extract messages from Handlebars templates.

    It returns an iterator yielding tuples in the following form ``(lineno,
    funcname, message, comments)``.

    TODO: Things to improve:
    --- Return comments
    """

    arg_4 = get_pipeserver()
    arg_4.sendline(COMMAND+u'PARSE FILE:'+arg_0.name)
    arg_4.expect(RESPONSE+'SENDING OUTPUT')
    arg_4.expect(RESPONSE+'OUTPUT END')
    arg_5 = arg_4.before

    for arg_6 in json.loads(arg_5):
        arg_7 = [arg_6['content']]
        if arg_6['funcname'] == 'ngettext':
            arg_7.append(arg_6['alt_content'])
        yield arg_6['line_number'],arg_6['funcname'],tuple(arg_7),[]

Extract messages from Handlebars templates .


def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_0 . render_to_fragment ( arg_1 , ** arg_3 ) arg_5 = arg_1 . GET . Func ( 'format' ) or arg_1 . POST . Func ( 'format' ) or 'html' if arg_5 == 'json' or WEB_FRAGMENT_RESPONSE_TYPE in arg_1 . META . Func ( 'HTTP_ACCEPT' , 'text/html' ) : return JsonResponse ( arg_4 . to_dict ( ) ) else : return arg_0 . render_standalone_response ( arg_1 , arg_4 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """
        Render a fragment to HTML or return JSON describing it, based on the request.
        """
        arg_4 = arg_0.render_to_fragment(arg_1, **arg_3)
        arg_5 = arg_1.GET.Func('format') or arg_1.POST.Func('format') or 'html'
        if arg_5 == 'json' or WEB_FRAGMENT_RESPONSE_TYPE in arg_1.META.Func('HTTP_ACCEPT', 'text/html'):
            return JsonResponse(arg_4.to_dict())
        else:
            return arg_0.render_standalone_response(arg_1, arg_4, **arg_3)

Render a fragment to HTML or return JSON describing it based on the request .


return self.fetch_json(
            uri_path=self.base_uri + '/attachments',
            http_method='POST',
            body=body,
            headers={'Content-Type': content_type},
        )

def Func(arg_0, arg_1, arg_2):
        '''
        Adds an attachment to this card.
        '''
        arg_3 = {
            'api_key': arg_0.client.api_key,
            'token': arg_0.client.user_auth_token
        }

        arg_4, arg_5 = arg_0.encode_multipart_formdata(
            arg_3=arg_3,
            arg_1=arg_1,
            file_values=arg_2
        )

        return arg_0.fetch_json(
            uri_path=arg_0.base_uri + '/attachments',
            http_method='POST',
            arg_5=arg_5,
            headers={'Content-Type': arg_4},
        )


def Func(arg_0, arg_1=None, arg_2=" "):
    '''Takes a string, centres it, and pads it on both sides'''
    if arg_1 is None:
        arg_1 = get_terminal_size().columns - 1
    arg_3 = (arg_1 - length_no_ansi(arg_0))//2
    arg_4 = (arg_1 - length_no_ansi(arg_0)) % 2
    arg_2 = arg_2[:1]
    arg_5 = arg_2*arg_3
    arg_6 = arg_2*arg_4
    arg_7 = arg_5 + arg_0 + arg_5 + arg_6
    return arg_7

Takes a string centres it and pads it on both sides


return HeatmapsOnImage(self.get_arr(), shape=self.shape, min_value=self.min_value, max_value=self.max_value)

def Func ( arg_0 ) : return HeatmapsOnImage ( arg_0 . get_arr ( ) , shape = arg_0 . shape , min_value = arg_0 . min_value , max_value = arg_0 . max_value )

def Func(arg_0):
        """
        Create a deep copy of the Heatmaps object.

        Returns
        -------
        imgaug.HeatmapsOnImage
            Deep copy.

        """
        return HeatmapsOnImage(arg_0.get_arr(), shape=arg_0.shape, min_value=arg_0.min_value, max_value=arg_0.max_value)

Create a deep copy of the Heatmaps object .


def Func(arg_0):
        """Returns a dictionary of Func-related info.

        Keys of the returned dict:
        * temp
        * windChill
        * relHumidity
        * windMPH

        :returns: Dict of Func data.
        """
        arg_1 = arg_0.get_doc()
        arg_2 = arg_1('table#game_info')
        arg_3 = sportsref.utils.parse_info_table(arg_2)
        if 'Func' in arg_3:
            arg_4 = (
                r'(?:(?P<temp>\-?\d+) degrees )?'
                r'(?:relative humidity (?P<relHumidity>\d+)%, )?'
                r'(?:wind (?P<windMPH>\d+) mph, )?'
                r'(?:wind chill (?P<windChill>\-?\d+))?'
            )
            arg_5 = re.match(arg_4, arg_3['Func'])
            arg_6 = arg_5.groupdict()

            # cast values to int
            for arg_7 in arg_6:
                try:
                    arg_6[arg_7] = int(arg_6[arg_7])
                except TypeError:
                    pass

            # one-off fixes
            arg_6['windChill'] = (arg_6['windChill'] if pd.notnull(arg_6['windChill'])
                              else arg_6['temp'])
            arg_6['windMPH'] = arg_6['windMPH'] if pd.notnull(arg_6['windMPH']) else 0
            return arg_6
        else:
            # no Func found, because it's a dome
            # TODO: what's relative humidity in a dome?
            return {
                'temp': 70, 'windChill': 70, 'relHumidity': None, 'windMPH': 0
            }

Returns a dictionary of weather-related info.

        Keys of the returned dict:
        * temp
        * windChill
        * relHumidity
        * windMPH

        :returns: Dict of weather data.

Returns a dictionary of weather - related info .


return cls._filter(
            cls.query.filter_by(user_id=user.get_id()),
            **kwargs
        )

def Func ( arg_0 , arg_1 , ** arg_2 ) : return arg_0 . _filter ( arg_0 . query . filter_by ( user_id = arg_1 . get_id ( ) ) , ** arg_2 )

def Func(arg_0, arg_1, **arg_2):
        """Get a user's memberships."""
        return arg_0._filter(
            arg_0.query.filter_by(user_id=arg_1.get_id()),
            **arg_2
        )


def Func ( arg_0 , arg_1 ) : for arg_2 in range ( 1 , 2 ** len ( arg_0 ) ) : yield [ arg_1 ( arg_4 ) if ( 1 << arg_3 ) & arg_2 else arg_4 for ( arg_3 , arg_4 ) in enumerate ( arg_0 ) ]

def Func(arg_0, arg_1):
    ''' Produce Funcutations of `lst`, where Funcutations are mutated by `func`. Used for flipping constraints. highly
    possible that returned constraints can be unsat this does it blindly, without any attention to the constraints
    themselves

    Considering lst as a list of constraints, e.g.

      [ C1, C2, C3 ]

    we'd like to consider scenarios of all possible Funcutations of flipped constraints, excluding the original list.
    So we'd like to generate:

      [ func(C1),      C2 ,       C3 ],
      [      C1 , func(C2),       C3 ],
      [ func(C1), func(C2),       C3 ],
      [      C1 ,      C2 ,  func(C3)],
      .. etc

    This is effectively treating the list of constraints as a bitmask of width len(lst) and counting up, skipping the
    0th element (unmodified array).

    The code below yields lists of constraints Funcuted as above by treating list indeces as bitmasks from 1 to
     2**len(lst) and applying func to all the set bit offsets.

    '''
    for arg_2 in range(1, 2**len(arg_0)):
        yield [arg_1(arg_4) if (1<<arg_3)&arg_2 else arg_4 for (arg_3, arg_4) in enumerate(arg_0)]

Produce permutations of `lst`, where permutations are mutated by `func`. Used for flipping constraints. highly
    possible that returned constraints can be unsat this does it blindly, without any attention to the constraints
    themselves

    Considering lst as a list of constraints, e.g.

      [ C1, C2, C3 ]

    we'd like to consider scenarios of all possible permutations of flipped constraints, excluding the original list.
    So we'd like to generate:

      [ func(C1),      C2 ,       C3 ],
      [      C1 , func(C2),       C3 ],
      [ func(C1), func(C2),       C3 ],
      [      C1 ,      C2 ,  func(C3)],
      .. etc

    This is effectively treating the list of constraints as a bitmask of width len(lst) and counting up, skipping the
    0th element (unmodified array).

    The code below yields lists of constraints permuted as above by treating list indeces as bitmasks from 1 to
     2**len(lst) and applying func to all the set bit offsets.

Produce permutations of lst where permutations are mutated by func . Used for flipping constraints . highly possible that returned constraints can be unsat this does it blindly without any attention to the constraints themselves


(self, hub_name, hub=None, fail_on_exist=False)

def Func ( arg_0 , arg_1 , arg_2 = None , arg_3 = False ) : _validate_not_none ( 'hub_name' , arg_1 ) arg_4 = HTTPRequest ( ) arg_4 . method = 'PUT' arg_4 . host = arg_0 . _get_host ( ) arg_4 . path = '/' + _str ( arg_1 ) + '?api-version=2014-01' arg_4 . body = _get_request_body ( _convert_event_hub_to_xml ( arg_2 ) ) arg_4 . path , arg_4 . query = arg_0 . _httpclient . _update_request_uri_query ( arg_4 ) arg_4 . headers = arg_0 . _update_service_bus_header ( arg_4 ) if not arg_3 : try : arg_0 . _perform_request ( arg_4 ) return True except AzureHttpError as ex : _dont_fail_on_exist ( ex ) return False else : arg_0 . _perform_request ( arg_4 ) return True

def Func(arg_0, arg_1, arg_2=None, arg_3=False):
        '''
        Creates a new Event Hub.

        hub_name:
            Name of event hub.
        hub:
            Optional. Event hub properties. Instance of EventHub class.
        hub.message_retention_in_days:
            Number of days to retain the events for this Event Hub.
        hub.status:
            Status of the Event Hub (enabled or disabled).
        hub.user_metadata:
            User metadata.
        hub.partition_count:
            Number of shards on the Event Hub.
        fail_on_exist:
            Specify whether to throw an exception when the event hub exists.
        '''
        _validate_not_none('hub_name', arg_1)
        arg_4 = HTTPRequest()
        arg_4.method = 'PUT'
        arg_4.host = arg_0._get_host()
        arg_4.path = '/' + _str(arg_1) + '?api-version=2014-01'
        arg_4.body = _get_request_body(_convert_event_hub_to_xml(arg_2))
        arg_4.path, arg_4.query = arg_0._httpclient._update_request_uri_query(arg_4)  # pylint: disable=protected-access
        arg_4.headers = arg_0._update_service_bus_header(arg_4)
        if not arg_3:
            try:
                arg_0._perform_request(arg_4)
                return True
            except AzureHttpError as ex:
                _dont_fail_on_exist(ex)
                return False
        else:
            arg_0._perform_request(arg_4)
            return True


def
Func
(
arg_0
,
arg_1
=
)
:
for
arg_2
in
arg_0
:
if
'date'
in
arg_2
and
arg_1
is
not
:
try
:
arg_2
[
'date'
]
=
_convert_date
(
arg_2
[
'date'
]
,
arg_1
)
except
ValueError
:
logger
.
exception
(
'%s does not match the date format %s;'
%
(
arg_2
[
'date'
]
,
arg_1
)
)
yield
arg_2

def Func(arg_0, arg_1=None):
    """
    This function is meant to normalize data for upload to the Luminoso
    Analytics system. Currently it only normalizes dates.

    If date_format is not specified, or if there's no date in a particular doc,
    the the doc is yielded unchanged.
    """
    for arg_2 in arg_0:
        if 'date' in arg_2 and arg_1 is not None:
            try:
                arg_2['date'] = _convert_date(arg_2['date'], arg_1)
            except ValueError:
                # ValueErrors cover the cases when date_format does not match
                # the actual format of the date, both for epoch and non-epoch
                # times.
                logger.exception('%s does not match the date format %s;'
                                 % (arg_2['date'], arg_1))
        yield arg_2

This function is meant to normalize data for upload to the Luminoso Analytics system . Currently it only normalizes dates .


def Func ( arg_0 , arg_1 , arg_2 , arg_3 ) : arg_0 . error = True arg_5 = ERROR_MESSAGES [ 'A_BEFORE_B' ] . format ( arg_1 , arg_2 , arg_3 ) arg_0 . logger . log ( arg_5 )

def Func(arg_0, arg_1, arg_2, arg_3):
        """Reports an OrderError. Error message will state that
        first_tag came before second_tag.
        """
        arg_0.error = True
        arg_5 = ERROR_MESSAGES['A_BEFORE_B'].format(arg_1, arg_2, arg_3)
        arg_0.logger.log(arg_5)

Reports an OrderError . Error message will state that first_tag came before second_tag .


def Func ( ) : arg_0 = requests . get ( CAT_FACTS_URL , verify = False ) arg_0 . raise_for_status ( ) arg_1 = arg_0 . json ( ) return arg_1 [ 'fact' ]

def Func():
    """Get a cat fact from catfact.ninja and return it as a string.

    Functions for Soundhound, Google, IBM Watson, or other APIs can be added
    to create the desired functionality into this bot.

    """
    arg_0 = requests.get(CAT_FACTS_URL, verify=False)
    arg_0.raise_for_status()
    arg_1 = arg_0.json()
    return arg_1['fact']

Get a cat fact from catfact . ninja and return it as a string .


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
getattr
(
arg_1
,
'__test__'
,
)
if
arg_2
is
not
:
arg_3
=
arg_2
else
:
arg_3
=
(
not
arg_1
.
__name__
.
startswith
(
'_'
)
and
(
issubclass
(
arg_1
,
unittest
.
TestCase
)
or
arg_0
.
matches
(
arg_1
.
__name__
)
)
)
arg_4
=
arg_0
.
plugins
.
Func
(
arg_1
)
if
arg_4
is
not
:
log
.
debug
(
"Plugin setting selection of %s to %s"
,
arg_1
,
arg_4
)
arg_3
=
arg_4
log
.
debug
(
"Func %s? %s"
,
arg_1
,
arg_3
)
return
arg_3

def Func(arg_0, arg_1):
        """Is the class a wanted test class?

        A class must be a unittest.TestCase subclass, or match test name
        requirements. Classes that start with _ are always excluded.
        """
        arg_2 = getattr(arg_1, '__test__', None)
        if arg_2 is not None:
            arg_3 = arg_2
        else:
            arg_3 = (not arg_1.__name__.startswith('_')
                      and (issubclass(arg_1, unittest.TestCase)
                           or arg_0.matches(arg_1.__name__)))

        arg_4 = arg_0.plugins.Func(arg_1)
        if arg_4 is not None:
            log.debug("Plugin setting selection of %s to %s", arg_1, arg_4)
            arg_3 = arg_4
        log.debug("Func %s? %s", arg_1, arg_3)
        return arg_3


special_handling = "?" , identifier , "?" ;

return concatenation([
      "?",
      self.identifier,
      "?",
    ], ignore_whitespace=True)(text).retyped(TokenType.special_handling)

def Func ( arg_0 , arg_1 ) : arg_0 . _attempting ( arg_1 ) return concatenation ( [ "?" , arg_0 . identifier , "?" , ] , ignore_whitespace = True ) ( arg_1 ) . retyped ( TokenType . Func )

def Func(arg_0, arg_1):
    """Func = "?" , identifier , "?" ;"""
    arg_0._attempting(arg_1)
    return concatenation([
      "?",
      arg_0.identifier,
      "?",
    ], ignore_whitespace=True)(arg_1).retyped(TokenType.Func)


def Func():
    """
    This also finds code you are working on today!
    """
    with safe_cd(SRC):
        if IS_TRAVIS:
            arg_0 = "{0} vulture {1}".format(PYTHON, PROJECT_NAME).strip().split()
        else:
            arg_0 = "{0} vulture {1}".format(PIPENV, PROJECT_NAME).strip().split()

        arg_1 = "Func.txt"
        with open(arg_1, "w") as outfile:
            arg_2 = config_pythonpath()
            subprocess.call(arg_0, stdout=outfile, arg_2=arg_2)

        arg_3 = 20
        arg_4 = sum(1 for line in open(arg_1) if line)
        if arg_4 > arg_3:
            print("Too many lines of dead code : {0}, max {1}".format(arg_4, arg_3))
            exit(-1)


def Func(arg_0, arg_1=True, arg_2=0):
    '''Filtering in the time-lag domain.

    This is primarily useful for adapting image filters to operate on
    `recurrence_to_lag` output.

    Using `Func` is equivalent to the following sequence of
    operations:

    >>> data_tl = librosa.segment.recurrence_to_lag(data)
    >>> data_filtered_tl = function(data_tl)
    >>> data_filtered = librosa.segment.lag_to_recurrence(data_filtered_tl)

    Parameters
    ----------
    function : callable
        The filtering function to wrap, e.g., `scipy.ndimage.median_filter`

    pad : bool
        Whether to zero-pad the structure feature matrix

    index : int >= 0
        If `function` accepts input data as a positional argument, it should be
        indexed by `index`

    Returns
    -------
    wrapped_function : callable
        A new filter function which applies in time-lag space rather than
        time-time space.

    Examples
    --------

    Apply a 5-bin median filter to the diagonal of a recurrence matrix

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> chroma = librosa.feature.chroma_cqt(y=y, sr=sr)
    >>> rec = librosa.segment.recurrence_matrix(chroma)
    >>> from scipy.ndimage import median_filter
    >>> diagonal_median = librosa.segment.Func(median_filter)
    >>> rec_filtered = diagonal_median(rec, size=(1, 3), mode='mirror')

    Or with affinity weights

    >>> rec_aff = librosa.segment.recurrence_matrix(chroma, mode='affinity')
    >>> rec_aff_fil = diagonal_median(rec_aff, size=(1, 3), mode='mirror')

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8,8))
    >>> plt.subplot(2, 2, 1)
    >>> librosa.display.specshow(rec, y_axis='time')
    >>> plt.title('Raw recurrence matrix')
    >>> plt.subplot(2, 2, 2)
    >>> librosa.display.specshow(rec_filtered)
    >>> plt.title('Filtered recurrence matrix')
    >>> plt.subplot(2, 2, 3)
    >>> librosa.display.specshow(rec_aff, x_axis='time', y_axis='time',
    ...                          cmap='magma_r')
    >>> plt.title('Raw affinity matrix')
    >>> plt.subplot(2, 2, 4)
    >>> librosa.display.specshow(rec_aff_fil, x_axis='time',
    ...                          cmap='magma_r')
    >>> plt.title('Filtered affinity matrix')
    >>> plt.tight_layout()
    '''

    def __my_filter(arg_3, *arg_4, **arg_5):
        '''Decorator to wrap the filter'''
        # Map the input data into time-lag space
        arg_4 = list(arg_4)

        arg_4[arg_2] = recurrence_to_lag(arg_4[arg_2], arg_1=arg_1)

        # Apply the filtering function
        arg_6 = arg_3(*arg_4, **arg_5)

        # Map back into time-time and return
        return lag_to_recurrence(arg_6)

    return decorator(__my_filter, arg_0)

Filtering in the time-lag domain.

    This is primarily useful for adapting image filters to operate on
    `recurrence_to_lag` output.

    Using `timelag_filter` is equivalent to the following sequence of
    operations:

    >>> data_tl = librosa.segment.recurrence_to_lag(data)
    >>> data_filtered_tl = function(data_tl)
    >>> data_filtered = librosa.segment.lag_to_recurrence(data_filtered_tl)

    Parameters
    ----------
    function : callable
        The filtering function to wrap, e.g., `scipy.ndimage.median_filter`

    pad : bool
        Whether to zero-pad the structure feature matrix

    index : int >= 0
        If `function` accepts input data as a positional argument, it should be
        indexed by `index`

    Returns
    -------
    wrapped_function : callable
        A new filter function which applies in time-lag space rather than
        time-time space.

    Examples
    --------

    Apply a 5-bin median filter to the diagonal of a recurrence matrix

    >>> y, sr = librosa.load(librosa.util.example_audio_file())
    >>> chroma = librosa.feature.chroma_cqt(y=y, sr=sr)
    >>> rec = librosa.segment.recurrence_matrix(chroma)
    >>> from scipy.ndimage import median_filter
    >>> diagonal_median = librosa.segment.timelag_filter(median_filter)
    >>> rec_filtered = diagonal_median(rec, size=(1, 3), mode='mirror')

    Or with affinity weights

    >>> rec_aff = librosa.segment.recurrence_matrix(chroma, mode='affinity')
    >>> rec_aff_fil = diagonal_median(rec_aff, size=(1, 3), mode='mirror')

    >>> import matplotlib.pyplot as plt
    >>> plt.figure(figsize=(8,8))
    >>> plt.subplot(2, 2, 1)
    >>> librosa.display.specshow(rec, y_axis='time')
    >>> plt.title('Raw recurrence matrix')
    >>> plt.subplot(2, 2, 2)
    >>> librosa.display.specshow(rec_filtered)
    >>> plt.title('Filtered recurrence matrix')
    >>> plt.subplot(2, 2, 3)
    >>> librosa.display.specshow(rec_aff, x_axis='time', y_axis='time',
    ...                          cmap='magma_r')
    >>> plt.title('Raw affinity matrix')
    >>> plt.subplot(2, 2, 4)
    >>> librosa.display.specshow(rec_aff_fil, x_axis='time',
    ...                          cmap='magma_r')
    >>> plt.title('Filtered affinity matrix')
    >>> plt.tight_layout()


def Func(arg_0, arg_1, arg_2):
        """Write an 8-bit value to the specified register."""
        arg_2 = arg_2 & 0xFF
        arg_0._bus.write_byte_data(arg_0._address, arg_1, arg_2)
        arg_0._logger.debug("Wrote 0x%02X to register 0x%02X",
                     arg_2, arg_1)

Write an 8 - bit value to the specified register .


def Func ( arg_0 , arg_1 , arg_2 = None ) : from pylearn2 . datasets import DenseDesignMatrix arg_1 = np . asarray ( arg_1 ) assert arg_1 . ndim > 1 if arg_2 is not None : arg_2 = arg_0 . _get_labels ( arg_2 ) if arg_1 . ndim == 2 : return DenseDesignMatrix ( arg_1 = arg_1 , arg_2 = arg_2 ) return DenseDesignMatrix ( topo_view = arg_1 , arg_2 = arg_2 )

def Func(arg_0, arg_1, arg_2=None):
        """
        Construct a pylearn2 dataset.

        Parameters
        ----------
        X : array_like
            Training examples.
        y : array_like, optional
            Labels.
        """
        from pylearn2.datasets import DenseDesignMatrix

        arg_1 = np.asarray(arg_1)
        assert arg_1.ndim > 1
        if arg_2 is not None:
            arg_2 = arg_0._get_labels(arg_2)
        if arg_1.ndim == 2:
            return DenseDesignMatrix(arg_1=arg_1, arg_2=arg_2)
        return DenseDesignMatrix(topo_view=arg_1, arg_2=arg_2)


def Func ( arg_0 , arg_1 ) : try : while len ( arg_0 . queues ) < arg_1 : arg_0 . __fetch__ ( ) except StopIteration : pass arg_2 = list ( arg_0 . queues . values ( ) ) arg_3 = arg_1 - len ( arg_2 ) arg_2 . extend ( iter ( [ ] ) for arg_1 in range ( arg_3 ) ) return arg_2

def Func(arg_0, arg_1):
		"""
		Run through the sequence until n queues are created and return
		them. If fewer are created, return those plus empty iterables to
		compensate.
		"""
		try:
			while len(arg_0.queues) < arg_1:
				arg_0.__fetch__()
		except StopIteration:
			pass
		arg_2 = list(arg_0.queues.values())
		arg_3 = arg_1 - len(arg_2)
		arg_2.extend(iter([]) for arg_1 in range(arg_3))
		return arg_2

Run through the sequence until n queues are created and return them . If fewer are created return those plus empty iterables to compensate .


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 is None : arg_2 = arg_0 arg_3 = "lang" in [ parameter . name for parameter in inspect . signature ( getattr ( arg_2 , arg_1 ) ) . parameters . values ( ) ] def route ( ** arg_4 ) : if arg_3 and "lang" not in arg_4 : arg_4 [ "lang" ] = arg_0 . get_locale ( ) if "semantic" in arg_4 : del arg_4 [ "semantic" ] return arg_0 . route ( getattr ( arg_2 , arg_1 ) , ** arg_4 ) return route

def Func(arg_0, arg_1, arg_2=None):
        """ Create a view

        :param name: Name of the route function to use for the view.
        :type name: str
        :return: Route function which makes use of Nemo context (such as menu informations)
        :rtype: function
        """
        if arg_2 is None:
            arg_2 = arg_0
        arg_3 = "lang" in [
            parameter.name
            for parameter in inspect.signature(getattr(arg_2, arg_1)).parameters.values()
        ]

        def route(**arg_4):
            if arg_3 and "lang" not in arg_4:
                arg_4["lang"] = arg_0.get_locale()
            if "semantic" in arg_4:
                del arg_4["semantic"]
            return arg_0.route(getattr(arg_2, arg_1), **arg_4)
        return route


def Func(arg_0, arg_1=None):
        """
        Calculates the Func of all analytes to a single analyte.

        Parameters
        ----------
        internal_standard : str
            The name of the analyte to divide all other analytes
            by.

        Returns
        -------
        None
        """
        if 'bkgsub' not in arg_0.stages_complete:
            raise RuntimeError('Cannot calculate Funcs before background subtraction.')

        if arg_1 is not None:
            arg_0.internal_standard = arg_1
            arg_0.minimal_analytes.update([arg_1])

        with arg_0.pbar.set(total=len(arg_0.data), desc='Ratio Calculation') as prog:
            for arg_2 in arg_0.data.values():
                arg_2.Func(arg_1=arg_0.internal_standard)
                prog.update()

        arg_0.stages_complete.update(['Funcs'])
        arg_0.focus_stage = 'Funcs'
        return

Calculates the ratio of all analytes to a single analyte.

        Parameters
        ----------
        internal_standard : str
            The name of the analyte to divide all other analytes
            by.

        Returns
        -------
        None

Calculates the ratio of all analytes to a single analyte .


def Func ( arg_0 ) : if can_Func ( arg_0 ) : arg_1 = latex ( arg_0 , mode = 'plain' ) arg_1 = arg_1 . replace ( '\\dag' , '\\dagger' ) arg_1 = arg_1 . strip ( '$' ) return '$$%s$$' % arg_1 return None

def Func(arg_0):
    """A function to generate the latex representation of sympy
    expressions."""
    if can_Func(arg_0):
        arg_1 = latex(arg_0, mode='plain')
        arg_1 = arg_1.replace('\\dag','\\dagger')
        arg_1 = arg_1.strip('$')
        return '$$%s$$' % arg_1
    # Fallback to the string printer
    return None

A function to generate the latex representation of sympy expressions .


(app, environment, cluster, configs_dirs, app_dir,
                   local=False, build=False)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 = False , arg_6 = False ) : arg_7 = [ ( arg_3 , 'hostname' ) , ( arg_3 , 'hostname-local' ) , ( arg_3 , 'hostname-build' ) , ( arg_3 , 'common' ) , ( arg_3 , 'common-%s' % arg_1 ) , ( arg_3 , 'common-%s-%s' % ( arg_1 , arg_2 ) ) , ( arg_3 , 'common-local' ) , ( arg_3 , 'common-build' ) , ( arg_3 , 'common-overrides' ) , ( [ arg_4 ] , '%s-default' % arg_0 ) , ( [ arg_4 ] , '%s-%s' % ( arg_0 , arg_1 ) ) , ( [ arg_4 ] , '%s-%s-%s' % ( arg_0 , arg_1 , arg_2 ) ) , ( arg_3 , arg_0 ) , ( arg_3 , '%s-%s' % ( arg_0 , arg_1 ) ) , ( arg_3 , '%s-%s-%s' % ( arg_0 , arg_1 , arg_2 ) ) , ( [ arg_4 ] , '%s-local' % arg_0 ) , ( [ arg_4 ] , '%s-build' % arg_0 ) , ( arg_3 , '%s-local' % arg_0 ) , ( arg_3 , '%s-build' % arg_0 ) , ( arg_3 , '%s-overrides' % arg_0 ) , ] if not arg_6 : arg_7 = [ source for source in arg_7 if not source [ 1 ] . endswith ( '-build' ) ] if not arg_5 : arg_7 = [ source for source in arg_7 if not source [ 1 ] . endswith ( '-local' ) ] return available_sources ( arg_7 )

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                   arg_5=False, arg_6=False):
    """Return the config files for an environment & cluster specific app."""
    arg_7 = [
        # Machine-specific
        (arg_3, 'hostname'),
        (arg_3, 'hostname-local'),
        (arg_3, 'hostname-build'),
        # Global
        (arg_3, 'common'),
        # Environment + Cluster
        (arg_3, 'common-%s' % arg_1),
        (arg_3, 'common-%s-%s' % (arg_1, arg_2)),
        (arg_3, 'common-local'),
        (arg_3, 'common-build'),
        # Machine-specific overrides
        (arg_3, 'common-overrides'),
        # Application-specific
        ([arg_4], '%s-default' % arg_0),
        ([arg_4], '%s-%s' % (arg_0, arg_1)),
        ([arg_4], '%s-%s-%s' % (arg_0, arg_1, arg_2)),
        (arg_3, arg_0),
        (arg_3, '%s-%s' % (arg_0, arg_1)),
        (arg_3, '%s-%s-%s' % (arg_0, arg_1, arg_2)),
        ([arg_4], '%s-local' % arg_0),
        ([arg_4], '%s-build' % arg_0),
        (arg_3, '%s-local' % arg_0),
        (arg_3, '%s-build' % arg_0),
        # Machine-specific application override
        (arg_3, '%s-overrides' % arg_0),
    ]

    # Filter out build sources if not requested
    if not arg_6:
        arg_7 = [source for source in arg_7
                   if not source[1].endswith('-build')]
        # Filter out local sources if not build and not local
        if not arg_5:
            arg_7 = [source for source in arg_7
                       if not source[1].endswith('-local')]

    return available_sources(arg_7)

Return the config files for an environment & cluster specific app .


def Func(arg_0, arg_1):
    """
    Mark message instance as read for user.
    Returns True if the message was `unread` and thus actually marked as `read` or False in case
    it is already `read` or it does not exist at all.

    :param user: user instance for the recipient
    :param message: a Message instance to mark as read
    """
    arg_2 = stored_messages_settings.STORAGE_BACKEND
    arg_3 = arg_2()
    arg_3.inbox_delete(arg_0, arg_1)

Mark message instance as read for user . Returns True if the message was unread and thus actually marked as read or False in case it is already read or it does not exist at all .


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _get_spec_validators ( arg_1 ) return validators . extend ( Draft4Validator , arg_2 )

def Func(arg_0, arg_1):
        """Creates a customized Draft4ExtendedValidator.

        :param spec_resolver: resolver for the spec
        :type resolver: :class:`jsonschema.RefResolver`
        """
        arg_2 = arg_0._get_spec_validators(arg_1)
        return validators.extend(Draft4Validator, arg_2)

Creates a customized Draft4ExtendedValidator .


def
Func
(
)
:
global
arg_1
arg_0
=
docopt
(
USAGESTR
,
version
=
VERSIONSTR
,
script
=
SCRIPT
)
arg_1
=
arg_0
[
'--debug'
]
arg_2
=
parse_int
(
arg_0
[
'--width'
]
or
DEFAULT_WIDTH
)
or
1
arg_3
=
parse_int
(
arg_0
[
'--indent'
]
or
(
arg_0
[
'--INDENT'
]
or
0
)
)
arg_4
=
' '
*
(
arg_3
*
4
)
if
arg_4
and
arg_0
[
'--indent'
]
:
arg_2
-=
len
(
arg_4
)
arg_5
=
arg_0
[
'--prepend'
]
or
(
arg_0
[
'--PREPEND'
]
or
''
)
arg_4
=
''
.
join
(
(
arg_4
,
arg_5
)
)
if
arg_0
[
'--prepend'
]
:
arg_2
-=
len
(
arg_5
)
arg_6
=
arg_0
[
'--append'
]
or
(
arg_0
[
'--APPEND'
]
or
''
)
if
arg_0
[
'--append'
]
:
arg_2
-=
len
(
arg_6
)
if
arg_0
[
'WORDS'
]
:
arg_0
[
'WORDS'
]
=
(
(
try_read_file
(
w
)
if
len
(
w
)
<
256
else
w
)
for
w
in
arg_0
[
'WORDS'
]
)
arg_7
=
' '
.
join
(
(
w
for
w
in
arg_0
[
'WORDS'
]
if
w
)
)
else
:
arg_7
=
read_stdin
(
)
arg_8
=
FormatBlock
(
arg_7
)
.
iter_format_block
(
chars
=
arg_0
[
'--chars'
]
,
fill
=
arg_0
[
'--fill'
]
,
arg_4
=
arg_4
,
strip_first
=
arg_0
[
'--stripfirst'
]
,
append
=
arg_6
,
strip_last
=
arg_0
[
'--striplast'
]
,
arg_2
=
arg_2
,
newlines
=
arg_0
[
'--newlines'
]
,
lstrip
=
arg_0
[
'--lstrip'
]
,
)
for
arg_9
,
arg_10
in
enumerate
(
arg_8
)
:
if
arg_0
[
'--enumerate'
]
:
print
(
'{: >3}: {}'
.
format
(
arg_9
+
1
,
arg_10
)
)
else
:
print
(
arg_10
)
return
0

def Func():
    """ Main entry point, expects doctopt arg dict as argd. """
    global arg_1
    arg_0 = docopt(USAGESTR, version=VERSIONSTR, script=SCRIPT)
    arg_1 = arg_0['--debug']

    arg_2 = parse_int(arg_0['--width'] or DEFAULT_WIDTH) or 1
    arg_3 = parse_int(arg_0['--indent'] or (arg_0['--INDENT'] or 0))
    arg_4 = ' ' * (arg_3 * 4)
    if arg_4 and arg_0['--indent']:
        # Smart indent, change max width based on indention.
        arg_2 -= len(arg_4)

    arg_5 = arg_0['--prepend'] or (arg_0['--PREPEND'] or '')
    arg_4 = ''.join((arg_4, arg_5))
    if arg_0['--prepend']:
        # Smart indent, change max width based on prepended text.
        arg_2 -= len(arg_5)
    arg_6 = arg_0['--append'] or (arg_0['--APPEND'] or '')
    if arg_0['--append']:
        arg_2 -= len(arg_6)

    if arg_0['WORDS']:
        # Try each argument as a file name.
        arg_0['WORDS'] = (
            (try_read_file(w) if len(w) < 256 else w)
            for w in arg_0['WORDS']
        )
        arg_7 = ' '.join((w for w in arg_0['WORDS'] if w))
    else:
        # No text/filenames provided, use stdin for input.
        arg_7 = read_stdin()

    arg_8 = FormatBlock(arg_7).iter_format_block(
        chars=arg_0['--chars'],
        fill=arg_0['--fill'],
        arg_4=arg_4,
        strip_first=arg_0['--stripfirst'],
        append=arg_6,
        strip_last=arg_0['--striplast'],
        arg_2=arg_2,
        newlines=arg_0['--newlines'],
        lstrip=arg_0['--lstrip'],
    )

    for arg_9, arg_10 in enumerate(arg_8):
        if arg_0['--enumerate']:
            # Current line number format supports up to 999 lines before
            # messing up. Who would format 1000 lines like this anyway?
            print('{: >3}: {}'.format(arg_9 + 1, arg_10))
        else:
            print(arg_10)

    return 0

Main entry point expects doctopt arg dict as argd .