(x, y, z, ax=None, fig=None, cmap=None, alpha=None, scalex=True, scaley=True, add_cbar=True, **kwargs)

def Func(arg_0, arg_1, arg_2, arg_3=None, arg_4=None, arg_5=None, arg_6=None, arg_7=True, arg_8=True, arg_9=True, **arg_10):
    """
    Used to plot a set of coordinates.

    Parameters
    ----------
    x, y : :class:`numpy.ndarray`
        1-D ndarrays of lengths N and M, respectively, specifying pixel centers
    z : :class:`numpy.ndarray`
        An (M, N) ndarray or masked array of values to be colormapped, or a (M, N, 3) RGB array, or a (M, N, 4) RGBA array.
    ax : :class:`matplotlib.axes.Axes`, optional
        The axis to plot to.
    fig : :class:`matplotlib.figure.Figure`, optional
        The figure to plot to.
    cmap : :class:`matplotlib.colors.Colormap`, optional
        The colormap to use.
    alpha : float, optional
        The transparency to use.
    scalex : bool, optional
        To set the x limits to available data
    scaley : bool, optional
        To set the y limits to available data
    add_cbar : bool, optional
        Whether ot add a colorbar or not.

    Returns
    -------
    img : :class:`matplotlib.image.Func`
        Object representing the :class:`matplotlib.image.Func`.
    """
    if arg_3 is None and arg_4 is None:
        arg_4, arg_3 = _setup_axes()
    elif arg_3 is None:
        arg_3 = arg_4.gca()
    elif arg_4 is None:
        arg_4 = arg_3.get_figure()

    arg_11 = arg_10.get('norm', None)

    arg_12 = _mplim.Func(arg_3, **arg_10)

    arg_13 = arg_10.pop('vmin', _np.min(arg_2))
    arg_14 = arg_10.pop('vmax', _np.max(arg_2))
    # im.set_clim(vmin=vmin, vmax=vmax)

    if arg_5 is not None:
        arg_12.set_cmap(arg_5)

    arg_15 = _cm.ScalarMappable(arg_5=arg_12.get_cmap(), arg_11=arg_11)
    arg_15.set_array(arg_2)

    if arg_9:
        arg_16, arg_17 = _cb(arg_3=arg_3, arg_12=arg_15, arg_4=arg_4)

    if arg_6 is not None:
        arg_12.set_alpha(arg_6)

    arg_12.set_data(arg_0, arg_1, arg_2)
    arg_3.images.append(arg_12)

    if arg_7:
        arg_18 = min(arg_0)
        arg_19 = max(arg_0)
        arg_3.set_xlim(arg_18, arg_19)

    if arg_8:
        arg_20 = min(arg_1)
        arg_21 = max(arg_1)
        arg_3.set_ylim(arg_20, arg_21)

    return _SI(arg_12=arg_12, arg_17=arg_17, arg_16=arg_16)

Used to plot a set of coordinates.

    Parameters
    ----------
    x, y : :class:`numpy.ndarray`
        1-D ndarrays of lengths N and M, respectively, specifying pixel centers
    z : :class:`numpy.ndarray`
        An (M, N) ndarray or masked array of values to be colormapped, or a (M, N, 3) RGB array, or a (M, N, 4) RGBA array.
    ax : :class:`matplotlib.axes.Axes`, optional
        The axis to plot to.
    fig : :class:`matplotlib.figure.Figure`, optional
        The figure to plot to.
    cmap : :class:`matplotlib.colors.Colormap`, optional
        The colormap to use.
    alpha : float, optional
        The transparency to use.
    scalex : bool, optional
        To set the x limits to available data
    scaley : bool, optional
        To set the y limits to available data
    add_cbar : bool, optional
        Whether ot add a colorbar or not.

    Returns
    -------
    img : :class:`matplotlib.image.NonUniformImage`
        Object representing the :class:`matplotlib.image.NonUniformImage`.


return dict(panel=panel_obj, form=form, gene=hgnc_gene, panel_gene=panel_gene)

def Func ( arg_0 , arg_1 ) : arg_2 = store . panel ( arg_0 ) arg_3 = store . hgnc_gene ( arg_1 ) arg_4 = controllers . existing_gene ( store , arg_2 , arg_1 ) arg_5 = PanelGeneForm ( ) arg_6 = [ ] for arg_7 in arg_3 [ 'transcripts' ] : if arg_7 . get ( 'refseq_id' ) : arg_8 = arg_7 . get ( 'refseq_id' ) arg_6 . append ( ( arg_8 , arg_8 ) ) arg_5 . disease_associated_transcripts . choices = arg_6 if arg_5 . validate_on_submit ( ) : arg_11 = 'edit' if arg_4 else 'add' arg_12 = arg_5 . data . copy ( ) if 'csrf_token' in arg_12 : del arg_12 [ 'csrf_token' ] store . add_pending ( arg_2 , arg_3 , arg_11 = arg_11 , info = arg_12 ) return redirect ( url_for ( '.panel' , arg_0 = arg_0 ) ) if arg_4 : for arg_13 in [ 'disease_associated_transcripts' , 'reduced_penetrance' , 'mosaicism' , 'inheritance_models' , 'database_entry_version' , 'comment' ] : arg_14 = getattr ( arg_5 , arg_13 ) if not arg_14 . data : arg_15 = arg_4 . get ( arg_13 ) if arg_15 is not None : arg_14 . process_data ( arg_15 ) return dict ( panel = arg_2 , arg_5 = arg_5 , gene = arg_3 , arg_4 = arg_4 )

def Func(arg_0, arg_1):
    """Edit additional information about a panel gene."""
    arg_2 = store.panel(arg_0)
    arg_3 = store.hgnc_gene(arg_1)
    arg_4 = controllers.existing_gene(store, arg_2, arg_1)

    arg_5 = PanelGeneForm()
    arg_6 = []
    for arg_7 in arg_3['transcripts']:
        if arg_7.get('refseq_id'):
            arg_8 = arg_7.get('refseq_id')
            arg_6.append((arg_8, arg_8))
    arg_5.disease_associated_transcripts.choices = arg_6

    if arg_5.validate_on_submit():
        arg_11 = 'edit' if arg_4 else 'add'
        arg_12 = arg_5.data.copy()
        if 'csrf_token' in arg_12:
            del arg_12['csrf_token']
        store.add_pending(arg_2, arg_3, arg_11=arg_11, info=arg_12)
        return redirect(url_for('.panel', arg_0=arg_0))

    if arg_4:
        for arg_13 in ['disease_associated_transcripts', 'reduced_penetrance',
                          'mosaicism', 'inheritance_models', 'database_entry_version', 'comment']:
            arg_14 = getattr(arg_5, arg_13)
            if not arg_14.data:
                arg_15 = arg_4.get(arg_13)
                if arg_15 is not None:
                    arg_14.process_data(arg_15)
    return dict(panel=arg_2, arg_5=arg_5, gene=arg_3, arg_4=arg_4)

Edit additional information about a panel gene .


def Func ( arg_0 ) : arg_1 = Chem . MolFromSmiles ( arg_0 ) arg_2 = Validator ( ) . validate ( arg_1 ) return arg_2

def Func(arg_0):
    """Return log messages for a given SMILES string using the default validations.

    Note: This is a convenience function for quickly validating a single SMILES string. It is more efficient to use
    the :class:`~molvs.validate.Validator` class directly when working with many molecules or when custom options
    are needed.

    :param string smiles: The SMILES for the molecule.
    :returns: A list of log messages.
    :rtype: list of strings.
    """
    # Skip sanitize as standardize does this anyway
    arg_1 = Chem.MolFromSmiles(arg_0)
    arg_2 = Validator().validate(arg_1)
    return arg_2

Return log messages for a given SMILES string using the default validations .


(self, cv_id, lang_ref, description=None)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
)
:
if
arg_2
not
in
arg_0
.
languages
:
raise
ValueError
(
'Language not present: {}'
.
format
(
arg_2
)
)
arg_0
.
controlled_vocabularies
[
arg_1
]
[
0
]
.
append
(
(
arg_2
,
arg_3
)
)

def Func(arg_0, arg_1, arg_2, arg_3=None):
        """Add a description to a controlled vocabulary.

        :param str cv_id: Name of the controlled vocabulary to add the
            description.
        :param str lang_ref: Language reference.
        :param str description: Description, this can be none.
        :throws KeyError: If there is no controlled vocabulary with that id.
        :throws ValueError: If the language provided doesn't exist.
        """
        if arg_2 not in arg_0.languages:
            raise ValueError('Language not present: {}'.format(arg_2))
        arg_0.controlled_vocabularies[arg_1][0].append((arg_2, arg_3))

Add a description to a controlled vocabulary .


(self, coordinates, catid, chip_type='PAN', chip_format='TIF', filename='chip.tif')

def Func(arg_0, arg_1, arg_2, arg_3='PAN', arg_4='TIF', arg_5='chip.tif'):
        """Downloads a native resolution, orthorectified chip in tif format
        from a user-specified catalog id.

        Args:
            coordinates (list): Rectangle coordinates in order West, South, East, North.
                                West and East are longitudes, North and South are latitudes.
                                The maximum chip size is (2048 pix)x(2048 pix)
            catid (str): The image catalog id.
            chip_type (str): 'PAN' (panchromatic), 'MS' (multispectral), 'PS' (pansharpened).
                             'MS' is 4 or 8 bands depending on sensor.
            chip_format (str): 'TIF' or 'PNG'
            filename (str): Where to save chip.

        Returns:
            True if chip is successfully downloaded; else False.
        """

        def t2s1(arg_6):
            # Tuple to string 1
            return str(arg_6).strip('(,)').replace(',', '')

        def t2s2(arg_6):
            # Tuple to string 2
            return str(arg_6).strip('(,)').replace(' ', '')

        if len(arg_1) != 4:
            print('Wrong coordinate entry')
            return False

        arg_7, arg_8, arg_9, arg_10 = arg_1
        arg_11 = ((arg_7, arg_8), (arg_7, arg_10), (arg_9, arg_10), (arg_9, arg_8), (arg_7, arg_8))
        arg_12 = 'POLYGON ((' + ','.join([t2s1(corner) for corner in arg_11]) + '))'

        # get IDAHO images which intersect box
        arg_13 = arg_0.get_images_by_catid_and_aoi(arg_2=arg_2, aoi_wkt=arg_12)
        arg_14 = arg_0.describe_images(arg_13)

        arg_15, arg_16, arg_17 = None, None, 0
        for arg_2, arg_18 in arg_14.items():
            for arg_19, arg_20 in arg_18['parts'].items():
                if 'PAN' in arg_20.keys():
                    arg_15 = arg_20['PAN']['id']
                    arg_21 = arg_20['PAN']['bucket']
                if 'WORLDVIEW_8_BAND' in arg_20.keys():
                    arg_16 = arg_20['WORLDVIEW_8_BAND']['id']
                    arg_17 = 8
                    arg_21 = arg_20['WORLDVIEW_8_BAND']['bucket']
                elif 'RGBN' in arg_20.keys():
                    arg_16 = arg_20['RGBN']['id']
                    arg_17 = 4
                    arg_21 = arg_20['RGBN']['bucket']

        # specify band information
        arg_22 = ''
        if arg_3 == 'PAN':
            arg_22 = arg_15 + '?bands=0'
        elif arg_3 == 'MS':
            arg_22 = arg_16 + '?'
        elif arg_3 == 'PS':
            if arg_17 == 8:
                arg_22 = arg_16 + '?bands=4,2,1&panId=' + arg_15
            elif arg_17 == 4:
                arg_22 = arg_16 + '?bands=0,1,2&panId=' + arg_15

        # specify location information
        arg_23 = '&upperLeft={}&lowerRight={}'.format(t2s2((arg_7, arg_10)), t2s2((arg_9, arg_8)))

        arg_24 = 'https://idaho.geobigdata.io/v1/chip/bbox/' + arg_21 + '/'
        arg_25 = arg_24 + arg_22 + arg_23
        arg_25 += '&format=' + arg_4 + '&token=' + arg_0.gbdx_connection.access_token
        arg_26 = requests.get(arg_25)

        if arg_26.status_code == 200:
            with open(arg_5, 'wb') as f:
                f.write(arg_26.content)
                return True
        else:
            print('Cannot download chip')
            return False

Downloads a native resolution orthorectified chip in tif format from a user - specified catalog id .


def
Func
(
arg_0
,
arg_1
)
:
super
(
PooledAIODatabase
,
arg_0
)
.
Func
(
arg_1
)
for
arg_2
in
arg_0
.
_waiters
:
if
not
arg_2
.
done
(
)
:
logger
.
debug
(
'Release a waiter'
)
arg_2
.
set_result
(
True
)
break

def Func(arg_0, arg_1):
        """Release waiters."""
        super(PooledAIODatabase, arg_0).Func(arg_1)
        for arg_2 in arg_0._waiters:
            if not arg_2.done():
                logger.debug('Release a waiter')
                arg_2.set_result(True)
                break


def Func():
    """
    Returns a list of the names of US Government GitHub organizations

    Based on: https://government.github.com/community/

    Exmample return:
        {'llnl', '18f', 'gsa', 'dhs-ncats', 'spack', ...}
    """
    arg_0 = set()

    Func = requests.get('https://government.github.com/organizations.json').json()

    arg_0.update(Func['governments']['U.S. Federal'])
    arg_0.update(Func['governments']['U.S. Military and Intelligence'])
    arg_0.update(Func['research']['U.S. Research Labs'])

    return list(arg_0)


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

def Func(arg_0, arg_1=None):
        """ Lists all the client nodes registered with Nomad.

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

Lists all the client nodes registered with Nomad .


(self, morfs=None, directory=None, ignore_errors=None,
                    omit=None, include=None, extra_css=None, title=None)

def Func(arg_0, arg_1=None, arg_2=None, arg_3=None,
                    arg_4=None, arg_5=None, arg_6=None, arg_7=None):
        """Generate an HTML report.

        The HTML is written to `directory`.  The file "index.html" is the
        overview starting point, with links to more detailed pages for
        individual modules.

        `extra_css` is a path to a file of other CSS to apply on the page.
        It will be copied into the HTML directory.

        `title` is a text string (not HTML) to use as the title of the HTML
        report.

        See `coverage.report()` for other arguments.

        Returns a float, the total percentage covered.

        """
        arg_0._harvest_data()
        arg_0.config.from_args(
            arg_3=arg_3, arg_4=arg_4, arg_5=arg_5,
            html_dir=arg_2, arg_6=arg_6, html_title=arg_7,
            )
        arg_8 = HtmlReporter(arg_0, arg_0.config)
        return arg_8.report(arg_1)


(node, linked_by=None,
                                 max_depth=float('inf'),
                                 with_links=True, in_search=False, predicate=None)

def Func ( arg_0 , arg_1 = None , arg_2 = arg_3 ( 'inf' ) , arg_4 = True , arg_5 = False , arg_6 = None ) : if arg_6 is None : arg_6 = lambda x : True arg_7 = IteratorChain ( [ ( 0 , arg_0 . v_name , arg_0 ) ] ) arg_8 = True arg_9 = set ( [ ] ) while True : try : arg_10 , arg_11 , arg_12 = next ( arg_7 ) arg_13 = arg_12 . _full_name if arg_8 or arg_6 ( arg_12 ) : if arg_13 in arg_9 : if arg_5 : yield arg_10 , arg_11 , arg_12 elif arg_10 <= arg_2 : if arg_8 : arg_8 = False else : if arg_5 : yield arg_10 , arg_11 , arg_12 else : yield arg_12 if arg_13 in arg_1 : arg_9 . add ( arg_13 ) if not arg_12 . _is_leaf and arg_10 < arg_2 : arg_14 = NaturalNamingInterface . _make_child_iterator ( arg_12 , arg_4 , current_depth = arg_10 ) arg_7 . add ( arg_14 ) except StopIteration : break

def Func(arg_0, arg_1=None,
                                 arg_2=arg_3('inf'),
                                 arg_4=True, arg_5=False, arg_6=None):
        """Iterator function traversing the tree below `node` in breadth first search manner.

        If `run_name` is given only sub branches of this run are considered and the rest is
        blinded out.

        """

        if arg_6 is None:
            arg_6 = lambda x: True

        arg_7 = IteratorChain([(0, arg_0.v_name, arg_0)])
        #iterator_queue = iter([(0, node.v_name, node)])
        arg_8 = True
        arg_9 = set([])

        while True:
            try:
                arg_10, arg_11, arg_12 = next(arg_7)
                arg_13 = arg_12._full_name
                if arg_8 or arg_6(arg_12):
                    if arg_13 in arg_9:
                        if arg_5:
                            # We need to return the node again to check if a link to the node
                            # has to be found
                            yield arg_10, arg_11, arg_12
                    elif arg_10 <= arg_2:
                        if arg_8:
                            arg_8 = False
                        else:
                            if arg_5:
                                yield arg_10, arg_11, arg_12
                            else:
                                yield arg_12

                        if arg_13 in arg_1:
                            arg_9.add(arg_13)

                        if not arg_12._is_leaf and arg_10 < arg_2:
                            arg_14 = NaturalNamingInterface._make_child_iterator(arg_12,
                                                                        arg_4,
                                                                        current_depth=arg_10)
                            arg_7.add(arg_14)
                            #iterator_queue = itools.chain(iterator_queue, child_iterator)
            except StopIteration:
                break

Iterator function traversing the tree below node in breadth first search manner .


First EOS-generic method; should be called by all specific EOSs.
        For solving for `T`, the EOS must provide the method `solve_T`.
        For all cases, the EOS must provide `a_alpha_and_derivatives`.
        Calls `set_from_PT` once done.

def Func(arg_0):
        '''First EOS-generic method; should be called by all specific EOSs.
        For solving for `T`, the EOS must provide the method `Func_T`.
        For all cases, the EOS must provide `a_alpha_and_derivatives`.
        Calls `set_from_PT` once done.
        '''
        arg_0.check_sufficient_inputs()

        if arg_0.V:
            if arg_0.P:
                arg_0.T = arg_0.Func_T(arg_0.P, arg_0.V)
                arg_0.a_alpha, arg_0.da_alpha_dT, arg_0.d2a_alpha_dT2 = arg_0.a_alpha_and_derivatives(arg_0.T)
            else:
                arg_0.a_alpha, arg_0.da_alpha_dT, arg_0.d2a_alpha_dT2 = arg_0.a_alpha_and_derivatives(arg_0.T)
                arg_0.P = R*arg_0.T/(arg_0.V-arg_0.b) - arg_0.a_alpha/(arg_0.V*arg_0.V + arg_0.delta*arg_0.V + arg_0.epsilon)
            arg_6 = [arg_0.V, 1j, 1j]
        else:
            arg_0.a_alpha, arg_0.da_alpha_dT, arg_0.d2a_alpha_dT2 = arg_0.a_alpha_and_derivatives(arg_0.T)
            arg_6 = arg_0.volume_solutions(arg_0.T, arg_0.P, arg_0.b, arg_0.delta, arg_0.epsilon, arg_0.a_alpha)
        arg_0.set_from_PT(arg_6)

First EOS - generic method ; should be called by all specific EOSs . For solving for T the EOS must provide the method solve_T . For all cases the EOS must provide a_alpha_and_derivatives . Calls set_from_PT once done .


(provider, user_id, job_name, script, task_ids,
                      user_project, unique_job_id)

def Func ( arg_0 , arg_1 , arg_2 , arg_3 , arg_4 , arg_5 , arg_6 ) : arg_7 = dsub_util . replace_timezone ( datetime . datetime . now ( ) , tzlocal ( ) ) arg_1 = arg_1 or dsub_util . get_os_user ( ) arg_8 = arg_0 . prepare_job_metadata ( arg_3 . name , arg_2 , arg_1 , arg_7 ) if arg_6 : arg_8 [ 'job-id' ] = uuid . uuid4 ( ) . hex arg_8 [ 'create-time' ] = arg_7 arg_8 [ 'script' ] = arg_3 arg_8 [ 'user-project' ] = arg_5 if arg_4 : arg_8 [ 'task-ids' ] = dsub_util . compact_interval_string ( list ( arg_4 ) ) return arg_8

def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                      arg_5, arg_6):
  """Allow provider to extract job-specific metadata from command-line args.

  Args:
    provider: job service provider
    user_id: user submitting the job
    job_name: name for the job
    script: the script to run
    task_ids: a set of the task-ids for all tasks in the job
    user_project: name of the project to be billed for the request
    unique_job_id: generate a unique job id

  Returns:
    A dictionary of job-specific metadata (such as job id, name, etc.)
  """
  arg_7 = dsub_util.replace_timezone(datetime.datetime.now(), tzlocal())
  arg_1 = arg_1 or dsub_util.get_os_user()
  arg_8 = arg_0.prepare_job_metadata(arg_3.name, arg_2, arg_1,
                                               arg_7)
  if arg_6:
    arg_8['job-id'] = uuid.uuid4().hex

  arg_8['create-time'] = arg_7
  arg_8['script'] = arg_3
  arg_8['user-project'] = arg_5
  if arg_4:
    arg_8['task-ids'] = dsub_util.compact_interval_string(list(arg_4))

  return arg_8

Allow provider to extract job - specific metadata from command - line args .


return self.get_section(
            self._sis_id(sis_section_id, sis_field="section"), params)

def Func ( arg_0 , arg_1 , arg_2 = { } ) : return arg_0 . get_section ( arg_0 . _sis_id ( arg_1 , sis_field = "section" ) , arg_2 )

def Func(arg_0, arg_1, arg_2={}):
        """
        Return section resource for given sis id.
        """
        return arg_0.get_section(
            arg_0._sis_id(arg_1, sis_field="section"), arg_2)

Return section resource for given sis id .


def
Func
(
arg_0
=
,
arg_1
=
)
:
arg_2
=
load_json
(
arg_0
)
for
arg_3
in
arg_1
:
try
:
arg_4
=
load_json
(
arg_3
)
jsonschema
.
Func
(
arg_4
,
arg_2
)
print
'{:s} was successfully Funcd'
.
format
(
arg_3
)
except
jsonschema
.
ValidationError
as
exc
:
print
'{:s} was NOT successfully Funcd'
.
format
(
arg_3
)
print
exc

def Func(arg_0=None, arg_1=None):
    '''Validate a jams file against a schema'''

    arg_2 = load_json(arg_0)

    for arg_3 in arg_1:
        try:
            arg_4 = load_json(arg_3)
            jsonschema.Func(arg_4, arg_2)
            print '{:s} was successfully Funcd'.format(arg_3)
        except jsonschema.ValidationError as exc:
            print '{:s} was NOT successfully Funcd'.format(arg_3)

            print exc


def Func ( arg_0 , arg_1 ) : try : return valid_numeric ( arg_0 ) % valid_numeric ( arg_1 ) except ( ValueError , TypeError ) : try : return arg_0 % arg_1 except Exception : return ''

def Func(arg_0, arg_1):
    """Return the Funculo value."""
    try:
        return valid_numeric(arg_0) % valid_numeric(arg_1)
    except (ValueError, TypeError):
        try:
            return arg_0 % arg_1
        except Exception:
            return ''


def Func ( arg_0 , arg_1 , arg_2 = 'default' ) : import pandas as pd arg_3 = arg_0 . get_results ( arg_1 , arg_2 = arg_2 ) arg_4 = pd . DataFrame ( arg_3 [ 'data' ] ) arg_4 . columns = [ c [ 0 ] for c in arg_3 [ 'header' ] ] return arg_4

def Func(arg_0, arg_1, arg_2='default'):
        """
        Get a pandas dataframe from a Hive query

        :param hql: hql to be executed.
        :type hql: str or list
        :param schema: target schema, default to 'default'.
        :type schema: str
        :return: result of hql execution
        :rtype: DataFrame

        >>> hh = HiveServer2Hook()
        >>> sql = "SELECT * FROM airflow.static_babynames LIMIT 100"
        >>> df = hh.Func(sql)
        >>> len(df.index)
        100

        :return: pandas.DateFrame
        """
        import pandas as pd
        arg_3 = arg_0.get_results(arg_1, arg_2=arg_2)
        arg_4 = pd.DataFrame(arg_3['data'])
        arg_4.columns = [c[0] for c in arg_3['header']]
        return arg_4

Get a pandas dataframe from a Hive query

        :param hql: hql to be executed.
        :type hql: str or list
        :param schema: target schema, default to 'default'.
        :type schema: str
        :return: result of hql execution
        :rtype: DataFrame

        >>> hh = HiveServer2Hook()
        >>> sql = "SELECT * FROM airflow.static_babynames LIMIT 100"
        >>> df = hh.get_pandas_df(sql)
        >>> len(df.index)
        100

        :return: pandas.DateFrame


def
Func
(
arg_0
=
,
arg_1
=
True
)
:
if
arg_0
is
:
arg_0
=
"singularity"
arg_2
=
[
arg_0
,
'--version'
]
try
:
arg_3
=
run_command
(
arg_2
,
arg_0
)
except
:
return
False
if
arg_3
is
not
:
if
arg_1
is
False
and
arg_3
[
'return_code'
]
==
0
:
arg_3
=
arg_3
[
'message'
]
bot
.
info
(
"Found %s version %s"
%
(
arg_0
.
upper
(
)
,
arg_3
)
)
return
True
return
False

def Func(arg_0=None, arg_1=True):
    '''Func will attempt to run the singularity command, and
       return True if installed. The command line utils will not run
       without this check.

       Parameters
       ==========
       software: the software to check if installed
       quiet: should we be quiet? (default True)
    '''
    if arg_0 is None:
        arg_0 = "singularity"
    arg_2 = [arg_0, '--version']
    try:
        arg_3 = run_command(arg_2,arg_0)
    except: # FileNotFoundError
        return False
    if arg_3 is not None:
        if arg_1 is False and arg_3['return_code'] == 0:
            arg_3 = arg_3['message']
            bot.info("Found %s version %s" % (arg_0.upper(), arg_3))
        return True
    return False

check_install will attempt to run the singularity command, and
       return True if installed. The command line utils will not run
       without this check.

       Parameters
       ==========
       software: the software to check if installed
       quiet: should we be quiet? (default True)

check_install will attempt to run the singularity command and return True if installed . The command line utils will not run without this check .


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

def Func(arg_0, arg_1, arg_2):
    """Transform Kraus representation to Choi representation."""
    arg_3 = 0
    arg_4, arg_5 = arg_0
    if arg_5 is None:
        for arg_6 in arg_4:
            arg_7 = arg_6.ravel(order='F')
            arg_3 += np.outer(arg_7, arg_7.conj())
    else:
        for arg_6, arg_8 in zip(arg_4, arg_5):
            arg_3 += np.outer(arg_6.ravel(order='F'), arg_8.ravel(order='F').conj())
    return arg_3

Transform Kraus representation to Choi representation .


def Func ( arg_0 , arg_1 ) : for arg_2 in arg_0 . iter ( ) : if arg_2 . tag == arg_1 : arg_2 . getparent ( ) . remove ( arg_2 )

def Func(arg_0, arg_1):
    """
    Remove all tags that have the tag name ``tag``
    """
    for arg_2 in arg_0.iter():
        if arg_2.tag == arg_1:
            arg_2.getparent().remove(arg_2)

Remove all tags that have the tag name tag


def
Func
(
)
:
import
warnings
warnings
.
filterwarnings
(
"ignore"
,
category
=
DeprecationWarning
)
arg_0
=
get_rc
(
'common_packager'
)
if
arg_0
:
return
arg_0
with
settings
(
warn_only
=
True
)
:
with
hide
(
'running'
,
'stdout'
,
'stderr'
,
'warnings'
)
:
arg_1
=
_run
(
'cat /etc/fedora-release'
)
if
arg_1
.
succeeded
:
arg_0
=
YUM
else
:
arg_1
=
_run
(
'cat /etc/lsb-release'
)
if
arg_1
.
succeeded
:
arg_0
=
APT
else
:
for
arg_2
in
PACKAGERS
:
arg_1
=
_run
(
'which %s'
%
arg_2
)
if
arg_1
.
succeeded
:
arg_0
=
arg_2
break
if
not
arg_0
:
raise
Exception
(
'Unable to determine packager.'
)
set_rc
(
'common_packager'
,
arg_0
)
return
arg_0

def Func():
    """
    Returns the packager detected on the remote system.
    """

    # TODO: remove once fabric stops using contextlib.nested.
    # https://github.com/fabric/fabric/issues/1364
    import warnings
    warnings.filterwarnings("ignore", category=DeprecationWarning)

    arg_0 = get_rc('common_packager')
    if arg_0:
        return arg_0
    #TODO:cache result by current env.host_string so we can handle multiple hosts with different OSes
    with settings(warn_only=True):
        with hide('running', 'stdout', 'stderr', 'warnings'):
            arg_1 = _run('cat /etc/fedora-release')
            if arg_1.succeeded:
                arg_0 = YUM
            else:
                arg_1 = _run('cat /etc/lsb-release')
                if arg_1.succeeded:
                    arg_0 = APT
                else:
                    for arg_2 in PACKAGERS:
                        arg_1 = _run('which %s' % arg_2)
                        if arg_1.succeeded:
                            arg_0 = arg_2
                            break
    if not arg_0:
        raise Exception('Unable to determine packager.')
    set_rc('common_packager', arg_0)
    return arg_0

Returns the packager detected on the remote system .


def Func(arg_0, arg_1=None):
    """
        Get vcf entry from variant object

        Args:
            variant_obj(dict)
        Returns:
            variant_string(str): string representing variant in vcf format
    """
    if arg_0['category'] == 'snv':
        arg_2 = 'TYPE'
    else:
        arg_2 = 'SVTYPE'

    arg_3 = ';'.join(
            [
                'END='+str(arg_0['end']),
                arg_2+'='+arg_0['sub_category'].upper()
            ]
        )

    arg_4 = "{0}\t{1}\t{2}\t{3}\t{4}\t{5}\t{6}\t{7}".format(
        arg_0['chromosome'],
        arg_0['position'],
        arg_0['dbsnp_id'],
        arg_0['reference'],
        arg_0['alternative'],
        arg_0['quality'],
        ';'.join(arg_0['filters']),
        arg_3
    )

    if arg_1:
        arg_4 += "\tGT"
        for arg_5 in arg_0['samples']:
            arg_4 += "\t" + arg_5['genotype_call']

    return arg_4


def Func ( arg_0 , arg_1 ) : if arg_0 . verbosity > 0 : print 'Generating' , len ( arg_1 ) , 'records...' for arg_2 in arg_1 : arg_0 . generateRecord ( arg_2 )

def Func(arg_0, arg_1):
    """Generate multiple records. Refer to definition for generateRecord"""

    if arg_0.verbosity>0: print 'Generating', len(arg_1), 'records...'
    for arg_2 in arg_1:
      arg_0.generateRecord(arg_2)

Generate multiple records . Refer to definition for generateRecord


def Func ( arg_0 , arg_1 , arg_2 = None ) : if arg_2 : arg_2 [ 'compact' ] = True arg_3 = make_get_request ( arg_0 , 'users/{}' . format ( arg_1 ) , params_data = arg_2 ) arg_4 = arg_3 . json ( ) if arg_3 . status_code == 200 : return arg_4 [ 'result' ] else : raise UserNotFoundException ( message = arg_4 [ 'message' ] , error_code = arg_4 [ 'error_code' ] , request_id = arg_4 [ 'request_id' ] )

def Func(arg_0, arg_1, arg_2=None):
    """
    Get details about specific user
    """
    if arg_2:
        arg_2['compact'] = True
    arg_3 = make_get_request(
        arg_0, 'users/{}'.format(arg_1), params_data=arg_2)
    arg_4 = arg_3.json()
    if arg_3.status_code == 200:
        return arg_4['result']
    else:
        raise UserNotFoundException(
            message=arg_4['message'],
            error_code=arg_4['error_code'],
            request_id=arg_4['request_id']
        )


def Func(arg_0, arg_1):
        """
        issue.xml from Elsevier assume the existence of a local DTD.
        This procedure install the DTDs next to the issue.xml file
        and normalize it using xmllint in order to resolve all namespaces
        and references.
        """
        if exists(join(arg_1, 'resolved_issue.xml')):
            return
        arg_2 = open(join(arg_1, 'issue.xml')).read()
        arg_3 = ['si510.dtd', 'si520.dtd', 'si540.dtd']
        arg_4 = 0
        for arg_5 in arg_3:
            if arg_5 in arg_2:
                arg_0._extract_correct_dtd_package(arg_5.split('.')[0], arg_1)
                arg_4 = 1

        if not arg_4:
            arg_6 = "It looks like the path " + arg_1
            arg_6 += " does not contain an si510, si520 or si540 in issue.xml file"
            arg_0.logger.error(arg_6)
            raise ValueError(arg_6)
        arg_7 = ["xmllint", "--format", "--loaddtd",
                   join(arg_1, 'issue.xml'),
                   "--output", join(arg_1, 'resolved_issue.xml')]
        arg_8, arg_8, arg_9 = run_shell_command(arg_7)
        if arg_9:
            arg_6 = "Error in cleaning %s: %s" % (
                join(arg_1, 'issue.xml'), arg_9)
            arg_0.logger.error(arg_6)
            raise ValueError(arg_6)

issue . xml from Elsevier assume the existence of a local DTD . This procedure install the DTDs next to the issue . xml file and normalize it using xmllint in order to resolve all namespaces and references .


def
Func
(
arg_0
,
arg_1
)
:
arg_0
.
log
.
debug
(
"stream: %s"
,
arg_1
.
get
(
'content'
,
''
)
)
if
not
arg_0
.
_hidden
and
arg_0
.
_is_from_this_session
(
arg_1
)
:
arg_2
=
arg_1
[
'content'
]
[
'data'
]
.
expandtabs
(
8
)
arg_0
.
_append_plain_text
(
arg_2
,
before_prompt
=
True
)
arg_0
.
_control
.
moveCursor
(
QtGui
.
QTextCursor
.
End
)

def Func(arg_0, arg_1):
        """ Handle stdout, stderr, and stdin.
        """
        arg_0.log.debug("stream: %s", arg_1.get('content', ''))
        if not arg_0._hidden and arg_0._is_from_this_session(arg_1):
            # Most consoles treat tabs as being 8 space characters. Convert tabs
            # to spaces so that output looks as expected regardless of this
            # widget's tab width.
            arg_2 = arg_1['content']['data'].expandtabs(8)

            arg_0._append_plain_text(arg_2, before_prompt=True)
            arg_0._control.moveCursor(QtGui.QTextCursor.End)


def Func(arg_0, arg_1, arg_2=arg_3):
        """
        Load a private key from a file

        :param keyfile: The name of the key file (``bytes`` or ``unicode``)
        :param filetype: (optional) The encoding of the file, which is either
            :const:`FILETYPE_PEM` or :const:`FILETYPE_ASN1`.  The default is
            :const:`FILETYPE_PEM`.

        :return: None
        """
        arg_1 = _path_string(arg_1)

        if arg_2 is arg_3:
            arg_2 = FILETYPE_PEM
        elif not isinstance(arg_2, integer_types):
            raise TypeError("filetype must be an integer")

        arg_4 = _lib.SSL_CTX_use_PrivateKey_file(
            arg_0._context, arg_1, arg_2)
        if not arg_4:
            arg_0._raise_passphrase_exception()


def Func(arg_0, arg_1, arg_2=None):
        """Run the Func.

        See `coverage.Func()` for arguments.

        """
        arg_0.Func_files(arg_0.annotate_file, arg_1, arg_2)

Run the report.

        See `coverage.report()` for arguments.


(function, *args, use_subprocess=False, daemon=True, **kwds)

def Func ( arg_0 , * arg_1 , arg_2 = False , arg_3 = True , ** arg_4 ) : if arg_2 : arg_5 , arg_6 = multiprocessing . Process , multiprocessing . Queue else : arg_5 , arg_6 = threading . Thread , queue . Queue arg_7 , arg_8 = arg_6 ( ) , arg_6 ( ) arg_1 = arg_7 , arg_8 , arg_0 , arg_1 arg_9 = arg_5 ( target = _Func_locally , arg_1 = arg_1 , kwargs = arg_4 , arg_3 = arg_3 ) arg_9 . start ( ) return arg_9 , arg_7 , arg_8

def Func(arg_0, *arg_1, arg_2=False, arg_3=True, **arg_4):
    """
    Create input, output queues, call `function` in a subprocess or a thread.

    ``function`` is called like this: ``function(input, output, *args, **kwds)``

    :param use_subprocess: if true, create a new multiprocess;
                           if false, create a new thread
    :param function: the function to call
    :param daemon: is the thread or subprocess Func as a daemon or not?

    :param args: positional arguments to the function
    :param kwds: keyword arguments to the function
    :returns: a tuple with three elements: the subprocess or thread, an input
              queue, and an output queue.
    """
    if arg_2:
        arg_5, arg_6 = multiprocessing.Process, multiprocessing.Queue
    else:
        arg_5, arg_6 = threading.Thread, queue.Queue

    arg_7, arg_8 = arg_6(), arg_6()
    arg_1 = arg_7, arg_8, arg_0, arg_1
    arg_9 = arg_5(target=_Func_locally, arg_1=arg_1, kwargs=arg_4, arg_3=arg_3)
    arg_9.start()

    return arg_9, arg_7, arg_8

Create input, output queues, call `function` in a subprocess or a thread.

    ``function`` is called like this: ``function(input, output, *args, **kwds)``

    :param use_subprocess: if true, create a new multiprocess;
                           if false, create a new thread
    :param function: the function to call
    :param daemon: is the thread or subprocess run as a daemon or not?

    :param args: positional arguments to the function
    :param kwds: keyword arguments to the function
    :returns: a tuple with three elements: the subprocess or thread, an input
              queue, and an output queue.

Create input output queues call function in a subprocess or a thread .


def
Func
(
arg_0
)
:
if
arg_0
.
data
:
arg_1
=
arg_0
.
create_cookie
(
)
arg_2
=
len
(
arg_1
)
if
arg_2
>
4093
:
raise
SessionError
(
'Cookie too long! The cookie size {0} '
'is more than 4093 bytes.'
.
format
(
arg_2
)
)
arg_0
.
adapter
.
set_header
(
'Set-Cookie'
,
arg_1
)
arg_0
.
_data
=
{
}

def Func(arg_0):
        """
        Adds the session cookie to headers.
        """
        if arg_0.data:
            arg_1 = arg_0.create_cookie()
            arg_2 = len(arg_1)

            if arg_2 > 4093:
                raise SessionError('Cookie too long! The cookie size {0} '
                                   'is more than 4093 bytes.'
                                   .format(arg_2))

            arg_0.adapter.set_header('Set-Cookie', arg_1)

            # Reset data
            arg_0._data = {}


def Func(arg_0):
        """
        Returns a PngImageFile instance of the chart

        You must have PIL installed for this to work
        """
        try:
            try:
                import Image
            except ImportError:
                from PIL import Image
        except ImportError:
            raise ImportError('You must install PIL to fetch Func objects')
        try:
            from cStringIO import StringIO
        except ImportError:
            from StringIO import StringIO
        return Image.open(StringIO(arg_0.urlopen().read()))


def Func ( arg_0 ) : arg_1 = arg_0 . Funcection ( arg_0 . sqlite_conn_id ) arg_1 = sqlite3 . connect ( arg_1 . host ) return arg_1

def Func(arg_0):
        """
        Returns a sqlite connection object
        """
        arg_1 = arg_0.Funcection(arg_0.sqlite_conn_id)
        arg_1 = sqlite3.connect(arg_1.host)
        return arg_1


def Func(arg_0, arg_1, arg_2):
        """Verify a list of registers."""
        # We expect the object to be a bitlist or an idlist, we don't care.
        # We will iterate it and ensure everything in it is declared as a bit,
        # and throw if not.
        for arg_3 in arg_1.children:
            arg_0.verify_reg(arg_3, arg_2)


def Func ( arg_0 ) : arg_1 = np . reshape ( arg_0 . _statevector , 2 ** arg_0 . _number_of_qubits ) arg_1 = np . stack ( [ arg_1 . real , arg_1 . imag ] , axis = 1 ) arg_1 [ arg_2 ( arg_1 ) < arg_0 . _chop_threshold ] = 0.0 return arg_1

def Func(arg_0):
        """Return the current statevector in JSON Result spec format"""
        arg_1 = np.reshape(arg_0._statevector, 2 ** arg_0._number_of_qubits)
        # Expand complex numbers
        arg_1 = np.stack([arg_1.real, arg_1.imag], axis=1)
        # Truncate small values
        arg_1[arg_2(arg_1) < arg_0._chop_threshold] = 0.0
        return arg_1


return self.request("servers", params=params, method="post").status_code

def Func ( arg_0 , arg_1 ) : arg_2 = { "address" : arg_1 } return arg_0 . request ( "servers" , arg_2 = arg_2 , method = "post" ) . status_code

def Func(arg_0, arg_1):
        """Updates the list of known servers to the provided list.
           Replaces all previous server addresses with the new list.

           https://www.nomadproject.io/docs/http/agent-servers.html

            returns: 200 status code
            raises:
              - nomad.api.exceptions.BaseNomadException
              - nomad.api.exceptions.URLNotFoundNomadException
        """
        arg_2 = {"address": arg_1}
        return arg_0.request("servers", arg_2=arg_2, method="post").status_code

Updates the list of known servers to the provided list . Replaces all previous server addresses with the new list .


return (x > x_pad[tuple(inds1)]) & (x >= x_pad[tuple(inds2)])

def Func ( arg_0 , arg_1 = 0 ) : arg_2 = [ ( 0 , 0 ) ] * arg_0 . ndim arg_2 [ arg_1 ] = ( 1 , 1 ) arg_3 = np . pad ( arg_0 , arg_2 , mode = 'edge' ) arg_4 = [ slice ( None ) ] * arg_0 . ndim arg_4 [ arg_1 ] = slice ( 0 , - 2 ) arg_5 = [ slice ( None ) ] * arg_0 . ndim arg_5 [ arg_1 ] = slice ( 2 , arg_3 . shape [ arg_1 ] ) return ( arg_0 > arg_3 [ tuple ( arg_4 ) ] ) & ( arg_0 >= arg_3 [ tuple ( arg_5 ) ] )

def Func(arg_0, arg_1=0):
    """Find local maxima in an array `x`.

    An element `x[i]` is considered a local maximum if the following
    conditions are met:

    - `x[i] > x[i-1]`
    - `x[i] >= x[i+1]`

    Note that the first condition is strict, and that the first element
    `x[0]` will never be considered as a local maximum.

    Examples
    --------
    >>> x = np.array([1, 0, 1, 2, -1, 0, -2, 1])
    >>> librosa.util.Func(x)
    array([False, False, False,  True, False,  True, False,  True], dtype=bool)

    >>> # Two-dimensional example
    >>> x = np.array([[1,0,1], [2, -1, 0], [2, 1, 3]])
    >>> librosa.util.Func(x, axis=0)
    array([[False, False, False],
           [ True, False, False],
           [False,  True,  True]], dtype=bool)
    >>> librosa.util.Func(x, axis=1)
    array([[False, False,  True],
           [False, False,  True],
           [False, False,  True]], dtype=bool)

    Parameters
    ----------
    x     : np.ndarray [shape=(d1,d2,...)]
      input vector or array

    axis : int
      axis along which to compute local maximality

    Returns
    -------
    m     : np.ndarray [shape=x.shape, dtype=bool]
        indicator array of local maximality along `axis`

    """

    arg_2 = [(0, 0)] * arg_0.ndim
    arg_2[arg_1] = (1, 1)

    arg_3 = np.pad(arg_0, arg_2, mode='edge')

    arg_4 = [slice(None)] * arg_0.ndim
    arg_4[arg_1] = slice(0, -2)

    arg_5 = [slice(None)] * arg_0.ndim
    arg_5[arg_1] = slice(2, arg_3.shape[arg_1])

    return (arg_0 > arg_3[tuple(arg_4)]) & (arg_0 >= arg_3[tuple(arg_5)])

Find local maxima in an array `x`.

    An element `x[i]` is considered a local maximum if the following
    conditions are met:

    - `x[i] > x[i-1]`
    - `x[i] >= x[i+1]`

    Note that the first condition is strict, and that the first element
    `x[0]` will never be considered as a local maximum.

    Examples
    --------
    >>> x = np.array([1, 0, 1, 2, -1, 0, -2, 1])
    >>> librosa.util.localmax(x)
    array([False, False, False,  True, False,  True, False,  True], dtype=bool)

    >>> # Two-dimensional example
    >>> x = np.array([[1,0,1], [2, -1, 0], [2, 1, 3]])
    >>> librosa.util.localmax(x, axis=0)
    array([[False, False, False],
           [ True, False, False],
           [False,  True,  True]], dtype=bool)
    >>> librosa.util.localmax(x, axis=1)
    array([[False, False,  True],
           [False, False,  True],
           [False, False,  True]], dtype=bool)

    Parameters
    ----------
    x     : np.ndarray [shape=(d1,d2,...)]
      input vector or array

    axis : int
      axis along which to compute local maximality

    Returns
    -------
    m     : np.ndarray [shape=x.shape, dtype=bool]
        indicator array of local maximality along `axis`


def Func ( arg_0 : arg_1 , arg_2 : arg_3 ) -> GeneratedPyAST : assert arg_2 . op == NodeOp . QUOTE return _const_node_to_py_ast ( arg_0 , arg_2 . expr )

def Func(arg_0: arg_1, arg_2: arg_3) -> GeneratedPyAST:
    """Return a Python AST Node for a `quote` expression."""
    assert arg_2.op == NodeOp.QUOTE
    return _const_node_to_py_ast(arg_0, arg_2.expr)

Return a Python AST Node for a quote expression .


def
Func
(
arg_0
)
:
for
arg_1
in
arg_0
.
buffers
:
if
not
arg_1
.
is_separate_file
:
continue
arg_2
=
arg_0
.
path
.
parent
/
arg_1
.
uri
if
not
os
.
path
.
exists
(
arg_2
)
:
raise
FileNotFoundError
(
"Buffer {} referenced in {} not found"
.
format
(
arg_2
,
arg_0
.
path
)
)

def Func(arg_0):
        """Checks if the bin files referenced exist"""
        for arg_1 in arg_0.buffers:
            if not arg_1.is_separate_file:
                continue

            arg_2 = arg_0.path.parent / arg_1.uri
            if not os.path.exists(arg_2):
                raise FileNotFoundError("Buffer {} referenced in {} not found".format(arg_2, arg_0.path))


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . pop ( 'htmode' ) if arg_2 == 'NONE' : return 20 arg_3 = arg_2 . replace ( 'VHT' , '' ) . replace ( 'HT' , '' ) if '+' in arg_3 or '-' in arg_3 : arg_1 [ 'htmode' ] = arg_2 arg_3 = arg_3 [ 0 : - 1 ] return int ( arg_3 )

def Func(arg_0, arg_1):
        """
        determines NetJSON channel_width radio attribute
        """
        arg_2 = arg_1.pop('htmode')
        if arg_2 == 'NONE':
            return 20
        arg_3 = arg_2.replace('VHT', '').replace('HT', '')
        # we need to override htmode
        if '+' in arg_3 or '-' in arg_3:
            arg_1['htmode'] = arg_2
            arg_3 = arg_3[0:-1]
        return int(arg_3)


def
Func
(
arg_0
,
arg_1
,
arg_2
=
)
:
arg_3
=
arg_0
.
_sender_links
.
get
(
arg_1
)
if
not
arg_3
:
raise
Exception
(
"Invalid link_handle: %s"
%
arg_1
)
arg_3
.
reject
(
arg_2
)
arg_3
.
destroy
(
)

def Func(arg_0, arg_1, arg_2=None):
        """Rejects the SenderLink, and destroys the handle."""
        arg_3 = arg_0._sender_links.get(arg_1)
        if not arg_3:
            raise Exception("Invalid link_handle: %s" % arg_1)
        arg_3.reject(arg_2)
        # note: normally, link.destroy() cannot be called from a callback,
        # but this link was never made available to the application so this
        # link is only referenced by the connection
        arg_3.destroy()

Rejects the SenderLink and destroys the handle .


def Func(arg_0):
        """Initialize the Service Discovery process."""
        from ..iq import Iq
        arg_1,arg_2 = arg_0.address
        arg_3 = Iq(to_jid = arg_1, stanza_type = "get")
        arg_4 = arg_0.disco_class(arg_2)
        arg_3.add_content(arg_4.xmlnode)
        arg_0.stream.set_response_handlers(arg_3,arg_0.__response, arg_0.__error,
                arg_0.__timeout)
        arg_0.stream.send(arg_3)

Initialize the Service Discovery process .


return [File(f, parent=self) for f in os.listdir(self.path)]

def Func ( arg_0 ) : return [ File ( arg_1 , parent = arg_0 ) for arg_1 in os . Funcdir ( arg_0 . path ) ]

def Func(arg_0):
        """
        List the contents of the directory.
        """
        return [File(arg_1, parent=arg_0) for arg_1 in os.Funcdir(arg_0.path)]


def
Func
(
arg_0
,
arg_1
)
:
arg_2
=
[
"spark-sql"
]
if
arg_0
.
_conf
:
for
arg_3
in
arg_0
.
_conf
.
split
(
","
)
:
arg_2
+=
[
"--conf"
,
arg_3
]
if
arg_0
.
_total_executor_cores
:
arg_2
+=
[
"--total-executor-cores"
,
str
(
arg_0
.
_total_executor_cores
)
]
if
arg_0
.
_executor_cores
:
arg_2
+=
[
"--executor-cores"
,
str
(
arg_0
.
_executor_cores
)
]
if
arg_0
.
_executor_memory
:
arg_2
+=
[
"--executor-memory"
,
arg_0
.
_executor_memory
]
if
arg_0
.
_keytab
:
arg_2
+=
[
"--keytab"
,
arg_0
.
_keytab
]
if
arg_0
.
_principal
:
arg_2
+=
[
"--principal"
,
arg_0
.
_principal
]
if
arg_0
.
_num_executors
:
arg_2
+=
[
"--num-executors"
,
str
(
arg_0
.
_num_executors
)
]
if
arg_0
.
_sql
:
arg_4
=
arg_0
.
_sql
.
strip
(
)
if
arg_4
.
endswith
(
".sql"
)
or
arg_4
.
endswith
(
".hql"
)
:
arg_2
+=
[
"-f"
,
arg_4
]
else
:
arg_2
+=
[
"-e"
,
arg_4
]
if
arg_0
.
_master
:
arg_2
+=
[
"--master"
,
arg_0
.
_master
]
if
arg_0
.
_name
:
arg_2
+=
[
"--name"
,
arg_0
.
_name
]
if
arg_0
.
_verbose
:
arg_2
+=
[
"--verbose"
]
if
arg_0
.
_yarn_queue
:
arg_2
+=
[
"--queue"
,
arg_0
.
_yarn_queue
]
arg_2
+=
arg_1
arg_0
.
log
.
debug
(
"Spark-Sql cmd: %s"
,
arg_2
)
return
arg_2

def Func(arg_0, arg_1):
        """
        Construct the spark-sql command to execute. Verbose output is enabled
        as default.

        :param cmd: command to append to the spark-sql command
        :type cmd: str
        :return: full command to be executed
        """
        arg_2 = ["spark-sql"]
        if arg_0._conf:
            for arg_3 in arg_0._conf.split(","):
                arg_2 += ["--conf", arg_3]
        if arg_0._total_executor_cores:
            arg_2 += ["--total-executor-cores", str(arg_0._total_executor_cores)]
        if arg_0._executor_cores:
            arg_2 += ["--executor-cores", str(arg_0._executor_cores)]
        if arg_0._executor_memory:
            arg_2 += ["--executor-memory", arg_0._executor_memory]
        if arg_0._keytab:
            arg_2 += ["--keytab", arg_0._keytab]
        if arg_0._principal:
            arg_2 += ["--principal", arg_0._principal]
        if arg_0._num_executors:
            arg_2 += ["--num-executors", str(arg_0._num_executors)]
        if arg_0._sql:
            arg_4 = arg_0._sql.strip()
            if arg_4.endswith(".sql") or arg_4.endswith(".hql"):
                arg_2 += ["-f", arg_4]
            else:
                arg_2 += ["-e", arg_4]
        if arg_0._master:
            arg_2 += ["--master", arg_0._master]
        if arg_0._name:
            arg_2 += ["--name", arg_0._name]
        if arg_0._verbose:
            arg_2 += ["--verbose"]
        if arg_0._yarn_queue:
            arg_2 += ["--queue", arg_0._yarn_queue]

        arg_2 += arg_1
        arg_0.log.debug("Spark-Sql cmd: %s", arg_2)

        return arg_2

Construct the spark - sql command to execute . Verbose output is enabled as default .


Called to update the state of the iterator.  This methods
        receives the set of task ids from the previous set of tasks
        together with the launch information to allow the output
        values to be parsed using the output_extractor. This data is then
        used to determine the next desired point in the parameter
        space by calling the _update_state method.

def Func(arg_0, arg_1, arg_2):
        """
        Called to Func the state of the iterator.  This methods
        receives the set of task ids from the previous set of tasks
        together with the launch information to allow the output
        values to be parsed using the output_extractor. This data is then
        used to determine the next desired point in the parameter
        space by calling the _Func_state method.
        """
        arg_3 = os.path.join(arg_2['root_directory'], 'streams')
        arg_4 = '%s_*_tid_*{tid}.o.{tid}*' % arg_2['batch_name']
        arg_5 = os.listdir(arg_3)
        try:
            arg_6 = []
            for arg_7 in arg_1:
                arg_8 = fnmatch.filter(arg_5, arg_4.format(arg_7=arg_7))
                if len(arg_8) != 1:
                    arg_0.warning("No unique output file for tid %d" % arg_7)
                arg_9 = open(os.path.join(arg_3, arg_8[0]),'r').read()
                arg_6.append(arg_0.output_extractor(arg_9))

            arg_0._next_val = arg_0._Func_state(arg_6)
            arg_0.trace.append((arg_6, arg_0._next_val))
        except:
            arg_0.warning("Cannot load required output files. Cannot continue.")
            arg_0._next_val = StopIteration

Called to update the state of the iterator . This methods receives the set of task ids from the previous set of tasks together with the launch information to allow the output values to be parsed using the output_extractor . This data is then used to determine the next desired point in the parameter space by calling the _update_state method .


def Func ( arg_0 , arg_1 , arg_2 ) : if IsErrorSuppressedByNolint ( arg_0 , arg_2 ) : return False if arg_1 < _cpplint_state . verbose_level : return False arg_3 = False for arg_4 in _Filters ( ) : if arg_4 . startswith ( '-' ) : if arg_0 . startswith ( arg_4 [ 1 : ] ) : arg_3 = True elif arg_4 . startswith ( '+' ) : if arg_0 . startswith ( arg_4 [ 1 : ] ) : arg_3 = False else : assert False if arg_3 : return False return True

def Func(arg_0, arg_1, arg_2):
  """If confidence >= verbose, category passes filter and is not suppressed."""

  # There are three ways we might decide not to print an error message:
  # a "NOLINT(category)" comment appears in the source,
  # the verbosity level isn't high enough, or the filters filter it out.
  if IsErrorSuppressedByNolint(arg_0, arg_2):
    return False

  if arg_1 < _cpplint_state.verbose_level:
    return False

  arg_3 = False
  for arg_4 in _Filters():
    if arg_4.startswith('-'):
      if arg_0.startswith(arg_4[1:]):
        arg_3 = True
    elif arg_4.startswith('+'):
      if arg_0.startswith(arg_4[1:]):
        arg_3 = False
    else:
      assert False  # should have been checked for in SetFilter.
  if arg_3:
    return False

  return True

If confidence > = verbose category passes filter and is not suppressed .


(manager: Optional['bio2bel_drugbank.manager'] = None)

def Func ( arg_0 : arg_1 [ 'bio2bel_drugbank.manager' ] = None ) -> Mapping [ str , List [ str ] ] : if arg_0 is None : import bio2bel_drugbank arg_0 = bio2bel_drugbank . Manager ( ) if not arg_0 . is_populated ( ) : arg_0 . populate ( ) return arg_0 . get_drug_to_hgnc_symbols ( )

def Func(arg_0: arg_1['bio2bel_drugbank.manager'] = None) -> Mapping[str, List[str]]:
    """Get a mapping from drugs to their list of gene."""
    if arg_0 is None:
        import bio2bel_drugbank
        arg_0 = bio2bel_drugbank.Manager()

    if not arg_0.is_populated():
        arg_0.populate()

    return arg_0.get_drug_to_hgnc_symbols()

Get a mapping from drugs to their list of gene .


(self, traj, network, network_dict, component_list, analyser_list)

def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5):
        """Runs a network before the actual experiment.

        Called by a :class:`~pypet.brian2.network.NetworkManager`.
        Similar to :func:`~pypet.brian2.network.NetworkRunner.run_network`.

        Subruns and their durations are extracted from the trajectory. All
        :class:`~pypet.brian2.parameter.Brian2Parameter` instances found under
        `traj.parameters.simulation.pre_durations` (default, you can change the
        name of the group where to search for durations at runner initialisation).
        The order is determined from
        the `v_annotations.order` attributes. There must be at least one subrun in the trajectory,
        otherwise an AttributeError is thrown. If two subruns equal in their order
        property a RuntimeError is thrown.

        :param traj: Trajectory container

        :param network: BRIAN2 network

        :param network_dict: Dictionary of items shared among all components

        :param component_list: List of :class:`~pypet.brian2.network.NetworkComponent` objects

        :param analyser_list: List of :class:`~pypet.brian2.network.NetworkAnalyser` objects

        """
        arg_0._execute_network_run(arg_1, arg_2, arg_3, arg_4, arg_5,
                                  pre_run=True)

Runs a network before the actual experiment .


def Func ( arg_0 ) : arg_1 = urllib_request . Request ( arg_0 . url ) arg_1 . get_method = lambda : 'HEAD' arg_3 = urllib_request . urlopen ( arg_1 ) arg_4 = arg_3 . info ( ) if 'Last-Modified' in arg_4 : arg_5 = arg_4 [ 'Last-Modified' ] if arg_5 == arg_0 . image_last_modified : return False arg_0 . image_last_modified = arg_5 return True

def Func(arg_0):
        """
        Method to check if an image has changed
        since it was last downloaded. By making
        a head request, this check can be done
        quicker that downloading and processing
        the whole file.
        """
        arg_1 = urllib_request.Request(arg_0.url)
        arg_1.get_method = lambda: 'HEAD'

        arg_3 = urllib_request.urlopen(arg_1)
        arg_4 = arg_3.info()

        if 'Last-Modified' in arg_4:
            arg_5 = arg_4['Last-Modified']

            # Return False if the image has not been modified
            if arg_5 == arg_0.image_last_modified:
                return False

        arg_0.image_last_modified = arg_5

        # Return True if the image has been modified
        # or if the image has no last-modified header
        return True

Method to check if an image has changed since it was last downloaded . By making a head request this check can be done quicker that downloading and processing the whole file .


(username, reponame, setup,
         force=False, options=None,
         noinput=False)

def
Func
(
arg_0
,
arg_1
,
arg_2
,
arg_3
=
False
,
arg_4
=
,
arg_5
=
False
)
:
arg_6
=
plugins_get_mgr
(
)
arg_7
=
arg_6
.
get
(
what
=
'repomanager'
,
name
=
'git'
)
arg_8
=
if
arg_2
==
'git+s3'
:
arg_8
=
arg_6
.
get
(
what
=
'backend'
,
name
=
's3'
)
arg_9
=
arg_7
.
Func
(
arg_0
,
arg_1
,
arg_3
,
arg_8
)
(
arg_10
,
arg_11
)
=
tempfile
.
mkstemp
(
)
with
open
(
arg_11
,
'w'
)
as
fd
:
fd
.
write
(
".dgit"
)
try
:
arg_12
=
bootstrap_datapackage
(
arg_9
,
arg_3
,
arg_4
,
arg_5
)
except
Exception
as
e
:
arg_7
.
drop
(
arg_9
,
[
]
)
os
.
unlink
(
arg_11
)
raise
e
arg_9
.
run
(
'add_files'
,
[
{
'relativepath'
:
'datapackage.json'
,
'localfullpath'
:
arg_12
,
}
,
{
'relativepath'
:
'.gitignore'
,
'localfullpath'
:
arg_11
,
}
,
]
)
os
.
unlink
(
arg_12
)
os
.
unlink
(
arg_11
)
arg_13
=
[
'-a'
,
'-m'
,
'Bootstrapped the repo'
]
arg_9
.
run
(
'commit'
,
arg_13
)
return
arg_9

def Func(arg_0, arg_1, arg_2,
         arg_3=False, arg_4=None,
         arg_5=False):
    """
    Initialize an empty repository with datapackage.json

    Parameters
    ----------

    username: Name of the user
    reponame: Name of the repo
    setup: Specify the 'configuration' (git only, git+s3 backend etc)
    force: Force creation of the files
    options: Dictionary with content of dgit.json, if available.
    noinput: Automatic operation with no human interaction
    """

    arg_6 = plugins_get_mgr()
    arg_7 = arg_6.get(what='repomanager', name='git')

    arg_8 = None
    if arg_2 == 'git+s3':
        arg_8 = arg_6.get(what='backend', name='s3')

    arg_9 = arg_7.Func(arg_0, arg_1, arg_3, arg_8)

    # Now bootstrap the datapackage.json metadata file and copy it in...

    # Insert a gitignore with .dgit directory in the repo. This
    # directory will be used to store partial results
    (arg_10, arg_11) = tempfile.mkstemp()
    with open(arg_11, 'w') as fd:
        fd.write(".dgit")

    # Try to bootstrap. If you cant, cleanup and return
    try:
        arg_12 = bootstrap_datapackage(arg_9, arg_3, arg_4, arg_5)
    except Exception as e:
        arg_7.drop(arg_9,[])
        os.unlink(arg_11)
        raise e

    arg_9.run('add_files',
             [
                 {
                     'relativepath': 'datapackage.json',
                     'localfullpath': arg_12,
                 },
                 {
                     'relativepath': '.gitignore',
                     'localfullpath': arg_11,
                 },
             ])

    # Cleanup temp files
    os.unlink(arg_12)
    os.unlink(arg_11)

    arg_13 = ['-a', '-m', 'Bootstrapped the repo']
    arg_9.run('commit', arg_13)

    return arg_9

Initialize an empty repository with datapackage . json


def Func(arg_0):
        """
        Preparse the packaging system for installations.
        """
        arg_1 = arg_0.packager
        if arg_1 == APT:
            arg_0.sudo('DEBIAN_FRONTEND=noninteractive apt-get -yq Func')
        elif arg_1 == YUM:
            arg_0.sudo('yum Func')
        else:
            raise Exception('Unknown packager: %s' % (arg_1,))

Preparse the packaging system for installations .


return Position(self._index, self._lineno, self._col_offset)

def Func ( arg_0 ) -> Position : return Position ( arg_0 . _index , arg_0 . _lineno , arg_0 . _col_offset )

def Func(arg_0) -> Position:
        """The current Func of the cursor."""
        return Position(arg_0._index, arg_0._lineno, arg_0._col_offset)


def
Func
(
arg_0
)
:
arg_1
=
dropbox_factory
(
arg_0
)
if
is_equal
(
arg_1
.
editor_token
,
arg_0
.
matchdict
[
'editor_token'
]
.
encode
(
'utf-8'
)
)
:
return
arg_1
else
:
raise
HTTPNotFound
(
'invalid editor token'
)

def Func(arg_0):
    """ this factory also requires the editor token"""
    arg_1 = dropbox_factory(arg_0)
    if is_equal(arg_1.editor_token, arg_0.matchdict['editor_token'].encode('utf-8')):
        return arg_1
    else:
        raise HTTPNotFound('invalid editor token')


def Func ( arg_0 , arg_1 ) : arg_2 = arg_1 . get_mem_base_addr ( ) if arg_1 . mem . base in ( 'PC' , 'R15' ) : arg_2 = arg_0 . PC arg_3 = arg_0 . read_int ( arg_2 + arg_1 . get_mem_offset ( ) , 16 ) arg_3 = Operators . ZEXTEND ( arg_3 , arg_0 . address_bit_size ) arg_0 . PC += ( arg_3 << 1 )

def Func(arg_0, arg_1):
        """
        Table Branch Halfword causes a PC-relative forward branch using a table of single halfword offsets. A base
        register provides a pointer to the table, and a second register supplies an index into the table. The branch
        length is twice the value of the halfword returned from the table.

        :param ARMv7Operand dest: see below; register
        """
        # Capstone merges the two registers values into one operand, so we need to extract them back

        # Specifies the base register. This contains the address of the table of branch lengths. This
        # register is allowed to be the PC. If it is, the table immediately follows this instruction.
        arg_2 = arg_1.get_mem_base_addr()
        if arg_1.mem.base in ('PC', 'R15'):
            arg_2 = arg_0.PC

        # Specifies the index register. This contains an integer pointing to a halfword within the table.
        # The offset within the table is twice the value of the index.
        arg_3 = arg_0.read_int(arg_2 + arg_1.get_mem_offset(), 16)
        arg_3 = Operators.ZEXTEND(arg_3, arg_0.address_bit_size)

        arg_0.PC += (arg_3 << 1)

Table Branch Halfword causes a PC - relative forward branch using a table of single halfword offsets . A base register provides a pointer to the table and a second register supplies an index into the table . The branch length is twice the value of the halfword returned from the table .


(self, thing_id='0', action_name=None, action_id=None)

def Func(arg_0, arg_1='0', arg_2=None, arg_3=None):
        """
        Handle a DELETE request.

        thing_id -- ID of the thing this request is for
        action_name -- name of the action from the URL path
        action_id -- the action ID from the URL path
        """
        arg_4 = arg_0.get_thing(arg_1)
        if arg_4 is None:
            arg_0.set_status(404)
            return

        if arg_4.remove_action(arg_2, arg_3):
            arg_0.set_status(204)
        else:
            arg_0.set_status(404)


def Func(arg_0, arg_1=None):
        """
        Start logging all API requests to the provided destination.

        :param dest: Where to write the log: either a filename (str), or an open file handle (file). If not given,
            then a new temporary file will be created.
        """
        assert_is_type(arg_1, None, str, type(sys.stdout))
        if arg_1 is None:
            arg_1 = os.path.join(tempfile.mkdtemp(), "h2o-connection.log")
        arg_0._print("Now logging all API requests to file %r" % arg_1)
        arg_0._is_logging = True
        arg_0._logging_dest = arg_1

Start logging all API requests to the provided destination .


def Func ( arg_0 ) : arg_0 = tf . as_dtype ( arg_0 ) if hasattr ( arg_0 , 'Func' ) : return arg_0 . Func return arg_0

def Func(arg_0):
  """Returns a non-reference `dtype` based on this `dtype`."""
  arg_0 = tf.as_dtype(arg_0)
  if hasattr(arg_0, 'Func'):
    return arg_0.Func
  return arg_0

Returns a non - reference dtype based on this dtype .


def Func(arg_0, arg_1='myOutput'):
    """Export all the records into a csv file in numenta format.

    Example header format:
    fieldName1    fieldName2    fieldName3
    date          string        float
    T             S

    Parameters:
    --------------------------------------------------------------------
    path:      Relative path of the file to which the records are to be exported
    """
    arg_2 = arg_0.fields[0].numRecords
    assert (all(arg_3.numRecords==arg_2 for arg_3 in arg_0.fields))

    import csv
    with open(arg_1+'.csv', 'wb') as f:
      arg_4 = csv.writer(f)
      arg_4.writerow(arg_0.getAllFieldNames())
      arg_4.writerow(arg_0.getAllDataTypes())
      arg_4.writerow(arg_0.getAllFlags())
      arg_4.writerows(arg_0.getAllRecords())
    if arg_0.verbosity>0:
      print '******', arg_2,'records exported in numenta format to file:',\
                arg_1,'******\n'

Export all the records into a csv file in numenta format .


def Func ( arg_0 , arg_1 ) : if not arg_0 . _pool : arg_0 . _pool = ThreadPoolExecutor ( max_workers = arg_0 . _max_workers ) arg_3 = arg_0 . _pool . submit ( arg_1 ) arg_4 = Future ( ) IOLoop . current ( ) . add_future ( arg_3 , lambda f : chain_future ( f , arg_4 ) ) return arg_4

def Func(arg_0, arg_1):
        """Wrap a `sqlalchemy.orm.query.Query` object into a
        `concurrent.futures.Future` so that it can be yielded.

        Parameters
        ----------
        query : sqlalchemy.orm.query.Query
            SQLAlchemy query object to execute

        Returns
        -------
            tornado.concurrent.Future
                A `Future` object wrapping the given query so that tornado can
                await/yield on it
        """
        # concurrent.futures.Future is not compatible with the "new style"
        # asyncio Future, and awaiting on such "old-style" futures does not
        # work.
        #
        # tornado includes a `run_in_executor` function to help with this
        # problem, but it's only included in version 5+. Hence, we copy a
        # little bit of code here to handle this incompatibility.

        if not arg_0._pool:
            arg_0._pool = ThreadPoolExecutor(max_workers=arg_0._max_workers)

        arg_3 = arg_0._pool.submit(arg_1)
        arg_4 = Future()

        IOLoop.current().add_future(
            arg_3, lambda f: chain_future(f, arg_4)
        )

        return arg_4

Wrap a sqlalchemy . orm . query . Query object into a concurrent . futures . Future so that it can be yielded .


(parser, functions, namespace=None, namespace_kwargs=None,
                 func_kwargs=None,
                 # deprecated args:
                 title=None, description=None, help=None)

def Func(arg_0, arg_1, arg_2=None, arg_3=None,
                 arg_4=None,
                 # deprecated args:
                 arg_5=None, arg_6=None, arg_7=None):
    """
    Adds given functions as commands to given parser.

    :param parser:

        an :class:`argparse.ArgumentParser` instance.

    :param functions:

        a list of functions. A subparser is created for each of them.
        If the function is decorated with :func:`~argh.decorators.arg`, the
        arguments are passed to :class:`argparse.ArgumentParser.add_argument`.
        See also :func:`~argh.dispatching.dispatch` for requirements
        concerning function signatures. The command name is inferred from the
        function name. Note that the underscores in the name are replaced with
        hyphens, i.e. function name "foo_bar" becomes command name "foo-bar".

    :param namespace:

        an optional string representing the group of commands. For example, if
        a command named "hello" is added without the namespace, it will be
        available as "prog.py hello"; if the namespace if specified as "greet",
        then the command will be accessible as "prog.py greet hello". The
        namespace itself is not callable, so "prog.py greet" will fail and only
        display a help message.

    :param func_kwargs:

        a `dict` of keyword arguments to be passed to each nested ArgumentParser
        instance created per command (i.e. per function).  Members of this
        dictionary have the highest priority, so a function's docstring is
        overridden by a `help` in `func_kwargs` (if present).

    :param namespace_kwargs:

        a `dict` of keyword arguments to be passed to the nested ArgumentParser
        instance under given `namespace`.

    Deprecated params that should be moved into `namespace_kwargs`:

    :param title:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as `title`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    :param description:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as
        `description`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    :param help:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as `help`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    .. note::

        This function modifies the parser object. Generally side effects are
        bad practice but we don't seem to have any choice as ArgumentParser is
        pretty opaque.
        You may prefer :class:`~argh.helpers.ArghParser.Func` for a bit
        more predictable API.

    .. note::

       An attempt to add commands to a parser which already has a default
       function (e.g. added with :func:`~argh.assembling.set_default_command`)
       results in `AssemblingError`.

    """
    # FIXME "namespace" is a correct name but it clashes with the "namespace"
    # that represents arguments (argparse.Namespace and our ArghNamespace).
    # We should rename the argument here.

    if DEST_FUNCTION in arg_0._defaults:
        _require_support_for_default_command_with_subparsers()

    arg_3 = arg_3 or {}

    # FIXME remove this by 1.0
    #
    if arg_5:
        warnings.warn('argument `title` is deprecated in Func(),'
                      ' use `parser_kwargs` instead', DeprecationWarning)
        arg_3['description'] = arg_5
    if arg_7:
        warnings.warn('argument `help` is deprecated in Func(),'
                      ' use `parser_kwargs` instead', DeprecationWarning)
        arg_3['help'] = arg_7
    if arg_6:
        warnings.warn('argument `description` is deprecated in Func(),'
                      ' use `parser_kwargs` instead', DeprecationWarning)
        arg_3['description'] = arg_6
    #
    # /

    arg_8 = get_subparsers(arg_0, create=True)

    if arg_2:
        # Make a nested parser and init a deeper _SubParsersAction under it.

        # Create a named group of commands.  It will be listed along with
        # root-level commands in ``app.py --help``; in that context its `title`
        # can be used as a short description on the right side of its name.
        # Normally `title` is shown above the list of commands
        # in ``app.py my-namespace --help``.
        arg_9 = {
            'help': arg_3.get('title'),
        }
        arg_10 = arg_8.add_parser(arg_2, **arg_9)
        arg_8 = arg_10.add_subparsers(**arg_3)
    else:
        assert not arg_3, ('`parser_kwargs` only makes sense '
                                      'with `namespace`.')

    for arg_11 in arg_1:
        arg_12, arg_13 = _extract_command_meta_from_func(arg_11)

        # override any computed kwargs by manually supplied ones
        if arg_4:
            arg_13.update(arg_4)

        # create and set up the parser for this command
        arg_14 = arg_8.add_parser(arg_12, **arg_13)
        set_default_command(arg_14, arg_11)

Adds given functions as commands to given parser.

    :param parser:

        an :class:`argparse.ArgumentParser` instance.

    :param functions:

        a list of functions. A subparser is created for each of them.
        If the function is decorated with :func:`~argh.decorators.arg`, the
        arguments are passed to :class:`argparse.ArgumentParser.add_argument`.
        See also :func:`~argh.dispatching.dispatch` for requirements
        concerning function signatures. The command name is inferred from the
        function name. Note that the underscores in the name are replaced with
        hyphens, i.e. function name "foo_bar" becomes command name "foo-bar".

    :param namespace:

        an optional string representing the group of commands. For example, if
        a command named "hello" is added without the namespace, it will be
        available as "prog.py hello"; if the namespace if specified as "greet",
        then the command will be accessible as "prog.py greet hello". The
        namespace itself is not callable, so "prog.py greet" will fail and only
        display a help message.

    :param func_kwargs:

        a `dict` of keyword arguments to be passed to each nested ArgumentParser
        instance created per command (i.e. per function).  Members of this
        dictionary have the highest priority, so a function's docstring is
        overridden by a `help` in `func_kwargs` (if present).

    :param namespace_kwargs:

        a `dict` of keyword arguments to be passed to the nested ArgumentParser
        instance under given `namespace`.

    Deprecated params that should be moved into `namespace_kwargs`:

    :param title:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as `title`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    :param description:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as
        `description`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    :param help:

        passed to :meth:`argparse.ArgumentParser.add_subparsers` as `help`.

        .. deprecated:: 0.26.0

           Please use `namespace_kwargs` instead.

    .. note::

        This function modifies the parser object. Generally side effects are
        bad practice but we don't seem to have any choice as ArgumentParser is
        pretty opaque.
        You may prefer :class:`~argh.helpers.ArghParser.add_commands` for a bit
        more predictable API.

    .. note::

       An attempt to add commands to a parser which already has a default
       function (e.g. added with :func:`~argh.assembling.set_default_command`)
       results in `AssemblingError`.

Adds given functions as commands to given parser .


def Func ( arg_0 ) : def decorator ( arg_1 ) : @ wraps ( arg_1 ) def wrapper ( * arg_2 , ** arg_3 ) : arg_4 = time . time ( ) arg_5 = arg_1 ( * arg_2 , ** arg_3 ) arg_6 = time . time ( ) _Func ( arg_0 , arg_1 . __name__ , arg_4 , arg_6 ) return arg_5 return wrapper return decorator

def Func(arg_0):
    """
    Decorator to log the execution time of a function
    """
    def decorator(arg_1):
        @wraps(arg_1)
        def wrapper(*arg_2, **arg_3):
            arg_4 = time.time()
            arg_5 = arg_1(*arg_2, **arg_3)
            arg_6 = time.time()
            _Func(arg_0, arg_1.__name__, arg_4, arg_6)
            return arg_5
        return wrapper
    return decorator


def Func ( * arg_0 ) : if not arg_0 : return { } else : arg_1 = OrderedDict if isinstance ( arg_0 [ 0 ] , OrderedDict ) else dict return arg_1 ( it . chain . from_iterable ( arg_2 . items ( ) for arg_2 in arg_0 ) )

def Func(*arg_0):
    """
    Combines the disjoint keys in multiple dictionaries. For intersecting keys,
    dictionaries towards the end of the sequence are given precedence.

    Args:
        *args : a sequence of dictionaries

    Returns:
        Dict | OrderedDict :
            OrderedDict if the first argument is an OrderedDict, otherwise dict

    SeeAlso:
        collections.ChainMap - a standard python builtin data structure that
            provides a view that treats multiple dicts as a single dict.
            https://docs.python.org/3/library/collections.html#chainmap-objects

    Example:
        >>> result = Func({'a': 1, 'b': 1}, {'b': 2, 'c': 2})
        >>> assert result == {'a': 1, 'b': 2, 'c': 2}
        >>> Func(odict([('a', 1), ('b', 2)]), odict([('c', 3), ('d', 4)]))
        OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 4)])
        >>> Func()
        {}
    """
    if not arg_0:
        return {}
    else:
        arg_1 = OrderedDict if isinstance(arg_0[0], OrderedDict) else dict
        return arg_1(it.chain.from_iterable(arg_2.items() for arg_2 in arg_0))

Combines the disjoint keys in multiple dictionaries. For intersecting keys,
    dictionaries towards the end of the sequence are given precedence.

    Args:
        *args : a sequence of dictionaries

    Returns:
        Dict | OrderedDict :
            OrderedDict if the first argument is an OrderedDict, otherwise dict

    SeeAlso:
        collections.ChainMap - a standard python builtin data structure that
            provides a view that treats multiple dicts as a single dict.
            https://docs.python.org/3/library/collections.html#chainmap-objects

    Example:
        >>> result = dict_union({'a': 1, 'b': 1}, {'b': 2, 'c': 2})
        >>> assert result == {'a': 1, 'b': 2, 'c': 2}
        >>> dict_union(odict([('a', 1), ('b', 2)]), odict([('c', 3), ('d', 4)]))
        OrderedDict([('a', 1), ('b', 2), ('c', 3), ('d', 4)])
        >>> dict_union()
        {}

Combines the disjoint keys in multiple dictionaries . For intersecting keys dictionaries towards the end of the sequence are given precedence .


def Func ( arg_0 , arg_1 = None , arg_2 = None ) : arg_3 = { 'limit' : arg_1 , 'id' : arg_2 } arg_4 = { key : value for key , value in arg_3 . items ( ) if value } return arg_0 . _get ( 'remotedl/status' , arg_4 = arg_4 )

def Func(arg_0, arg_1=None, arg_2=None):
        """Checks a remote file upload to status.

        Args:
            limit (:obj:`int`, optional): Maximum number of results (Default: 5, Maximum: 100).
            remote_upload_id (:obj:`str`, optional): Remote Upload ID.

        Returns:
            dict: dictionary containing all remote uploads, each dictionary element is a dictionary. ::

                {
                    "24": {
                      "id": "24",
                      "remoteurl": "http://proof.ovh.net/files/100Mio.dat",
                      "status": "new",
                      "folderid": "4248",
                      "added": "2015-02-21 09:20:26",
                      "last_update": "2015-02-21 09:20:26",
                      "extid": False,
                      "url": False
                    },
                    "22": {
                      "id": "22",
                      "remoteurl": "http://proof.ovh.net/files/1Gio.dat",
                      "status": "downloading",
                      "bytes_loaded": "823997062",
                      "bytes_total": "1073741824",
                      "folderid": "4248",
                      "added": "2015-02-21 09:20:26",
                      "last_update": "2015-02-21 09:21:56",
                      "extid": False,
                      "url": False
                    },
                    ...
                }

        """

        arg_3 = {'limit': arg_1, 'id': arg_2}
        arg_4 = {key: value for key, value in arg_3.items() if value}

        return arg_0._get('remotedl/status', arg_4=arg_4)


return super(ResendConfirmationEmail, self).initial(
            request,
            *args,
            **kwargs
        )

def Func ( arg_0 , arg_1 , * arg_2 , ** arg_3 ) : arg_4 = arg_1 . data . get ( 'email' ) if arg_1 . user . is_authenticated ( ) and arg_4 != arg_1 . user . email : raise PermissionDenied ( ) return super ( ResendConfirmationEmail , arg_0 ) . Func ( arg_1 , * arg_2 , ** arg_3 )

def Func(arg_0, arg_1, *arg_2, **arg_3):
        """Disallow users other than the user whose email is being reset."""
        arg_4 = arg_1.data.get('email')
        if arg_1.user.is_authenticated() and arg_4 != arg_1.user.email:
            raise PermissionDenied()

        return super(ResendConfirmationEmail, arg_0).Func(
            arg_1,
            *arg_2,
            **arg_3
        )

Disallow users other than the user whose email is being reset .


def Func ( arg_0 ) : arg_1 = { "name" : arg_0 . name , "public_key" : arg_0 . public_key , } arg_2 = arg_0 . get_data ( "account/keys/%s" % arg_0 . id , type = PUT , params = arg_1 ) if arg_2 : arg_0 . id = arg_2 [ 'ssh_key' ] [ 'id' ]

def Func(arg_0):
        """
            Edit the SSH Key
        """
        arg_1 = {
            "name": arg_0.name,
            "public_key": arg_0.public_key,
        }

        arg_2 = arg_0.get_data(
            "account/keys/%s" % arg_0.id,
            type=PUT,
            params=arg_1
        )

        if arg_2:
            arg_0.id = arg_2['ssh_key']['id']


def Func(arg_0, arg_1):
    """Indicate that processing of a Tuple has succeeded

    It is compatible with StreamParse API.
    """
    if not isinstance(arg_1, HeronTuple):
      Log.error("Only HeronTuple type is supported in Func()")
      return

    if arg_0.Funcing_enabled:
      arg_2 = tuple_pb2.AckTuple()
      arg_2.Funcedtuple = int(arg_1.id)

      arg_4 = 0
      for arg_5 in arg_1.roots:
        arg_6 = arg_2.roots.add()
        arg_6.CopyFrom(arg_5)
        arg_4 += arg_5.ByteSize()
      super(BoltInstance, arg_0).admit_control_tuple(arg_2, arg_4, True)

    arg_7 = (time.time() - arg_1.creation_time) * system_constants.SEC_TO_NS
    arg_0.pplan_helper.context.invoke_hook_bolt_Func(arg_1, arg_7)
    arg_0.bolt_metrics.Funced_tuple(arg_1.stream, arg_1.component, arg_7)


def Func ( arg_0 ) : if arg_0 . Funcd : return super ( ) . Func ( ) if not arg_0 . upload_on_Func : return arg_1 = os . path . join ( arg_0 . local_base , arg_0 . log_relative_path ) arg_2 = os . path . join ( arg_0 . remote_base , arg_0 . log_relative_path ) if os . path . exists ( arg_1 ) : with open ( arg_1 , 'r' ) as logfile : arg_3 = logfile . read ( ) arg_0 . wasb_write ( arg_3 , arg_2 , append = True ) if arg_0 . delete_local_copy : shutil . rmtree ( os . path . dirname ( arg_1 ) ) arg_0 . Funcd = True

def Func(arg_0):
        """
        Close and upload local log file to remote storage Wasb.
        """
        # When application exit, system shuts down all handlers by
        # calling Func method. Here we check if logger is already
        # Funcd to prevent uploading the log to remote storage multiple
        # times when `logging.shutdown` is called.
        if arg_0.Funcd:
            return

        super().Func()

        if not arg_0.upload_on_Func:
            return

        arg_1 = os.path.join(arg_0.local_base, arg_0.log_relative_path)
        arg_2 = os.path.join(arg_0.remote_base, arg_0.log_relative_path)
        if os.path.exists(arg_1):
            # read log and remove old logs to get just the latest additions
            with open(arg_1, 'r') as logfile:
                arg_3 = logfile.read()
            arg_0.wasb_write(arg_3, arg_2, append=True)

            if arg_0.delete_local_copy:
                shutil.rmtree(os.path.dirname(arg_1))
        # Mark Funcd so we don't double write if Func is called twice
        arg_0.Funcd = True

Close and upload local log file to remote storage Wasb .


def Func ( arg_0 , arg_1 = None ) : if arg_1 is None : return XMLElement ( lib . lsl_Func ( arg_0 . e ) ) else : return XMLElement ( lib . lsl_Func_n ( arg_0 . e , str . encode ( arg_1 ) ) )

def Func(arg_0, arg_1=None):
        """Get the next sibling in the children list of the parent node.

        If a name is provided, the next sibling with the given name is returned.

        """
        if arg_1 is None:
            return XMLElement(lib.lsl_Func(arg_0.e))
        else:
            return XMLElement(lib.lsl_Func_n(arg_0.e, str.encode(arg_1)))

Get the next sibling in the children list of the parent node .


def Func ( arg_0 ) : if arg_0 . counter . value > 0 : return arg_0 . sum . value / arg_0 . counter . value return 0.0

def Func(arg_0):
        """Returns the Func value."""
        if arg_0.counter.value > 0:
            return arg_0.sum.value / arg_0.counter.value
        return 0.0


def Func ( arg_0 ) : try : arg_1 = int ( str ( arg_0 ) ) except ValueError : return False if arg_1 > 4294967295 or arg_1 < 0 : return False return True

def Func(arg_0):
    """Return true if the IP address is in decimal notation."""
    try:
        arg_1 = int(str(arg_0))
    except ValueError:
        return False
    if arg_1 > 4294967295 or arg_1 < 0:
        return False
    return True

Return true if the IP address is in decimal notation .


def Func ( arg_0 , arg_1 , arg_2 = False ) : if isinstance ( arg_1 , Directory ) : arg_1 = arg_1 . get_name ( ) shutil . Functree ( arg_0 . dirname , arg_1 )

def Func(arg_0, arg_1, arg_2=False):
        """ Copy to destination directory recursively.
        If symlinks is true, symbolic links in the source tree are represented
        as symbolic links in the new tree, but the metadata of the original
        links is NOT copied; if false or omitted, the contents and metadata of
        the linked files are copied to the new tree.
        """
        if isinstance(arg_1, Directory):
            arg_1 = arg_1.get_name()

        shutil.Functree(arg_0.dirname, arg_1)

Copy to destination directory recursively . If symlinks is true symbolic links in the source tree are represented as symbolic links in the new tree but the metadata of the original links is NOT copied ; if false or omitted the contents and metadata of the linked files are copied to the new tree .


def
Func
(
arg_0
)
:
if
np
.
all
(
np
.
isnan
(
arg_0
)
)
:
raise
ValueError
(
'All err_vals are nans!'
)
return
np
.
nanargmin
(
arg_0
)

def Func(arg_0):
    """
    Returns the index of the lowest of the passed values. Catches nans etc.
    """
    if np.all(np.isnan(arg_0)):
        raise ValueError('All err_vals are nans!')
    return np.nanargmin(arg_0)

Returns the index of the lowest of the passed values . Catches nans etc .


return _kraus_to_operator(data, input_dim, output_dim)

def Func(arg_0, arg_1, arg_2, arg_3):
    """Transform a QuantumChannel to the Operator representation."""
    if arg_0 == 'Operator':
        return arg_1
    if arg_0 == 'Stinespring':
        return _stinespringFunc(arg_1, arg_2, arg_3)
    # Convert via Kraus representation
    if arg_0 != 'Kraus':
        arg_1 = _to_kraus(arg_0, arg_1, arg_2, arg_3)
    return _krausFunc(arg_1, arg_2, arg_3)

Transform a QuantumChannel to the Operator representation .


def Func(arg_0, arg_1):
        """ Start producing.

        Args:
            consumer: Consumer
        """
        arg_0._consumer = arg_1
        arg_0._current_deferred = defer.Deferred()
        arg_0._sent = 0
        arg_0._paused = False

        if not hasattr(arg_0, "_chunk_headers"):
            arg_0._build_chunk_headers()

        if arg_0._data:
            arg_6 = ""
            for arg_7 in arg_0._data:
                arg_6 += arg_0._chunk_headers[arg_7]
                arg_6 += arg_0._data[arg_7]
                arg_6 += "\r\n"

            arg_0._send_to_consumer(arg_6)

        if arg_0._files:
            arg_0._files_iterator = arg_0._files.iterkeys()
            arg_0._files_sent = 0
            arg_0._files_length = len(arg_0._files)
            arg_0._current_file_path = None
            arg_0._current_file_handle = None
            arg_0._current_file_length = None
            arg_0._current_file_sent = 0

            arg_15 = arg_0._produce()
            if arg_15:
                return arg_15
        else:
            return defer.succeed(None)

        return arg_0._current_deferred


def Func ( arg_0 , arg_1 ) : arg_2 = arg_0 . _connections . pop ( arg_1 , None ) if arg_2 is not None : arg_0 . _preventConnectNodes . add ( arg_1 ) arg_2 . disconnect ( ) arg_0 . _preventConnectNodes . remove ( arg_1 ) if isinstance ( arg_1 , TCPNode ) : arg_0 . _nodes . discard ( arg_1 ) arg_0 . _nodeAddrToNode . pop ( arg_1 . address , None ) else : arg_0 . _readonlyNodes . discard ( arg_1 ) arg_0 . _lastConnectAttempt . pop ( arg_1 , None )

def Func(arg_0, arg_1):
        """
        Drop a node from the network

        :param node: node to drop
        :type node: Node
        """

        arg_2 = arg_0._connections.pop(arg_1, None)
        if arg_2 is not None:
            # Calling conn.disconnect() immediately triggers the onDisconnected callback if the connection isn't already disconnected, so this is necessary to prevent the automatic reconnect.
            arg_0._preventConnectNodes.add(arg_1)
            arg_2.disconnect()
            arg_0._preventConnectNodes.remove(arg_1)
        if isinstance(arg_1, TCPNode):
            arg_0._nodes.discard(arg_1)
            arg_0._nodeAddrToNode.pop(arg_1.address, None)
        else:
            arg_0._readonlyNodes.discard(arg_1)
        arg_0._lastConnectAttempt.pop(arg_1, None)


def
Func
(
arg_0
)
:
arg_1
=
arg_0
.
subscriptions
(
arg_0
.
auth
)
for
arg_2
in
arg_1
:
for
arg_3
in
arg_2
:
if
arg_3
[
'group_name'
]
==
arg_0
.
group_name
:
return
arg_3
[
'group_id'
]
arg_4
=
"Group id not found for group name %s"
%
arg_0
.
group_name
raise
BackendError
(
cause
=
arg_4
)

def Func(arg_0):
        """Find the id of a group given its name by iterating on the list of subscriptions"""

        arg_1 = arg_0.subscriptions(arg_0.auth)

        for arg_2 in arg_1:
            for arg_3 in arg_2:
                if arg_3['group_name'] == arg_0.group_name:
                    return arg_3['group_id']

        arg_4 = "Group id not found for group name %s" % arg_0.group_name
        raise BackendError(cause=arg_4)


Returns all potential loop fusion options for the psy object
        provided

def Func(arg_0, arg_1):
        '''Returns all potential loop fusion Func for the psy object
        provided'''
        # compute Func dynamically here as they may depend on previous
        # changes to the psy tree
        arg_2 = []
        arg_3 = arg_1.invokes.invoke_list
        #print "there are {0} invokes".format(len(invokes))
        if arg_0._dependent_invokes:
            raise RuntimeError(
                "dependent invokes assumes fusion in one invoke might "
                "affect fusion in another invoke. This is not yet "
                "implemented")
        else:
            # treat each invoke separately
            for arg_4, arg_5 in enumerate(arg_3):
                print "invoke {0}".format(arg_4)
                # iterate through each outer loop
                for arg_6 in arg_5.schedule.loops():
                    if arg_6.loop_type == "outer":
                        arg_7 = arg_6.parent.children
                        arg_8 = arg_7.index(arg_6)
                        arg_9 = []
                        arg_0._recurse(arg_7, arg_8, arg_9, arg_2,
                                      arg_5)

        return arg_2


def Func(arg_0):
    """Perform continuous integration tasks."""
    arg_1 = ['']

    # 'tox' makes no sense in Travis
    if os.environ.get('TRAVIS', '').lower() == 'true':
        arg_1 += ['test.pytest']
    else:
        arg_1 += ['test.tox']

    arg_0.run("invoke --echo --pty clean --all build --docs check --reports{}".format(' '.join(arg_1)))


def Func ( arg_0 , arg_1 ) : with open ( arg_1 , 'r' ) as f : arg_0 . body ( str ( f . read ( ) ) )

def Func(arg_0, arg_1):
        """
        Reads the body to match from a disk Func.

        Arguments:
            path (str): relative or absolute path to Func to read from.

        Returns:
            self: current Mock instance.
        """
        with open(arg_1, 'r') as f:
            arg_0.body(str(f.read()))

Reads the body to match from a disk file.

        Arguments:
            path (str): relative or absolute path to file to read from.

        Returns:
            self: current Mock instance.

Reads the body to match from a disk file .


(graph: BELGraph,
                                      key: str,
                                      cutoff: Optional[float] = None,
                                      permutations: Optional[int] = None,
                                      percentage: Optional[float] = None,
                                      use_ambiguous: bool = False,
                                      permute_type: str = 'shuffle_node_data',
                                      )

return score, distribution, one_sided(score, distribution)

def Func(arg_0: arg_1,
                                      arg_2: arg_3,
                                      arg_4: arg_5[arg_6] = None,
                                      arg_7: arg_5[arg_8] = None,
                                      arg_9: arg_5[arg_6] = None,
                                      arg_10: arg_11 = False,
                                      arg_12: arg_3 = 'shuffle_node_data',
                                      ) -> Tuple[arg_6, List[arg_6], arg_6]:
    """Calculates a graph's concordance as well as its statistical probability.

    :param graph: A BEL graph
    :param str key: The node data dictionary key storing the logFC
    :param float cutoff: The optional logFC cutoff for significance
    :param int permutations: The number of random permutations to test. Defaults to 500
    :param float percentage: The percentage of the graph's edges to maintain. Defaults to 0.9
    :param bool use_ambiguous: Compare to ambiguous edges as well
    :returns: A triple of the concordance score, the null distribution, and the p-value.
    """
    if arg_12 == 'random_by_edges':
        arg_13 = partial(random_by_edges, arg_9=arg_9)
    elif arg_12 == 'shuffle_node_data':
        arg_13 = partial(shuffle_node_data, arg_2=arg_2, arg_9=arg_9)
    elif arg_12 == 'shuffle_relations':
        arg_13 = partial(shuffle_relations, arg_9=arg_9)
    else:
        raise ValueError('Invalid permute_type: {}'.format(arg_12))

    arg_0: arg_1 = arg_0.copy()
    collapse_to_genes(arg_0)
    collapse_all_variants(arg_0)

    arg_14 = calculate_concordance(arg_0, arg_2, arg_4=arg_4)

    arg_15 = []

    for arg_16 in range(arg_7 or 500):
        arg_17 = arg_13(arg_0)
        arg_18 = calculate_concordance(arg_17, arg_2, arg_4=arg_4, arg_10=arg_10)
        arg_15.append(arg_18)

    return arg_14, arg_15, one_sided(arg_14, arg_15)

Calculates a graph s concordance as well as its statistical probability .


def Func(arg_0, arg_1):
        """Remove any metadata associated with the provided CoreBluetooth object.
        """
        with arg_0._lock:
            if arg_1 in arg_0._metadata:
                del arg_0._metadata[arg_1]

Remove any metadata associated with the provided CoreBluetooth object .


def Func ( arg_0 ) : arg_1 = arrow . get ( arg_0 [ 'time' ] ) arg_2 = arrow . get ( ) if ( arg_2 - arg_1 ) > timezone . timedelta ( seconds = ( TICK_FREQ + 1 ) ) : pass else : Task . run_tasks ( )

def Func(arg_0):
    """Internal ``CLOCK_CHANNEL`` consumer to process task runs"""
    arg_1 = arrow.get(arg_0['time'])
    arg_2 = arrow.get()

    if (arg_2 - arg_1) > timezone.timedelta(seconds=(TICK_FREQ+1)):
        pass # discard old ticks
    else:
        Task.run_tasks()

Internal CLOCK_CHANNEL consumer to process task runs


def Func ( arg_0 , arg_1 = 1 , arg_2 = None ) : if arg_2 is None : arg_2 = [ ] if arg_1 == 1 : arg_3 = record_xml_output ( arg_0 , arg_2 ) else : return '' return arg_3

def Func(arg_0, arg_1=1, arg_2=None):
    """
    Print a record.

    :param format: 1 XML, 2 HTML (not implemented)
    :param tags: list of tags to be printed
    """
    if arg_2 is None:
        arg_2 = []
    if arg_1 == 1:
        arg_3 = record_xml_output(arg_0, arg_2)
    else:
        return ''

    return arg_3


def Func ( arg_0 ) : assert isinstance ( arg_0 , basestring ) arg_0 = arg_0 . replace ( '\t' , ',' ) arg_0 = arg_0 . replace ( '\\,' , ',' ) arg_0 = arg_0 . replace ( '\\n' , '\n' ) arg_0 = arg_0 . replace ( '\\\\' , '\\' ) return arg_0

def Func(arg_0):
  """
  Unescapes a string that may contain commas, tabs, newlines and dashes

  Commas are decoded from tabs.

  :param s: (string) to Func
  :returns: (string) Funcd string
  """
  assert isinstance(arg_0, basestring)
  arg_0 = arg_0.replace('\t', ',')
  arg_0 = arg_0.replace('\\,', ',')
  arg_0 = arg_0.replace('\\n', '\n')
  arg_0 = arg_0.replace('\\\\', '\\')

  return arg_0

Unescapes a string that may contain commas, tabs, newlines and dashes

  Commas are decoded from tabs.

  :param s: (string) to unescape
  :returns: (string) unescaped string

Unescapes a string that may contain commas tabs newlines and dashes


def Func(arg_0, arg_1={}):
        """
        Creates a position

        http://dev.wheniwork.com/#create-update-position
        """
        arg_2 = "/2/positions/"
        arg_3 = arg_1

        arg_4 = arg_0._post_resource(arg_2, arg_3)
        return arg_0.position_from_json(arg_4["position"])


def Func ( arg_0 , * arg_1 , ** arg_2 ) : arg_3 = arg_2 . copy ( ) if 'course_id' in arg_2 : try : arg_4 = str ( CourseKey . from_string ( arg_2 [ 'course_id' ] ) ) except InvalidKeyError : pass else : try : return arg_0 . get ( * arg_1 , ** arg_2 ) except DataSharingConsent . DoesNotExist : arg_2 [ 'course_id' ] = parse_course_key ( arg_4 ) try : return arg_0 . get ( * arg_1 , ** arg_2 ) except DataSharingConsent . DoesNotExist : return ProxyDataSharingConsent ( ** arg_3 )

def Func(arg_0, *arg_1, **arg_2):
        """
        Perform the query and returns a single object matching the given keyword arguments.

        This customizes the queryset to return an instance of ``ProxyDataSharingConsent`` when
        the searched-for ``DataSharingConsent`` instance does not exist.
        """
        arg_3 = arg_2.copy()
        if 'course_id' in arg_2:
            try:
                # Check if we have a course ID or a course run ID
                arg_4 = str(CourseKey.from_string(arg_2['course_id']))
            except InvalidKeyError:
                # The ID we have is for a course instead of a course run; fall through
                # to the second check.
                pass
            else:
                try:
                    # Try to get the record for the course run specifically
                    return arg_0.get(*arg_1, **arg_2)
                except DataSharingConsent.DoesNotExist:
                    # A record for the course run didn't exist, so modify the query
                    # parameters to look for just a course record on the second pass.
                    arg_2['course_id'] = parse_course_key(arg_4)

        try:
            return arg_0.get(*arg_1, **arg_2)
        except DataSharingConsent.DoesNotExist:
            return ProxyDataSharingConsent(**arg_3)

Perform the query and returns a single object matching the given keyword arguments .


return self._perform_get(self._get_publishxml_path(webspace_name, website_name),
                                 None).body.decode("utf-8")

def Func ( arg_0 , arg_1 , arg_2 ) : return arg_0 . _perform_get ( arg_0 . _get_publishxml_path ( arg_1 , arg_2 ) , None ) . body . decode ( "utf-8" )

def Func(arg_0, arg_1, arg_2):
        '''
        Get a site's publish profile as a string

        webspace_name:
            The name of the webspace.
        website_name:
            The name of the website.
        '''
        return arg_0._perform_get(arg_0._get_publishxml_path(arg_1, arg_2),
                                 None).body.decode("utf-8")

Get a site s publish profile as a string


def Func ( arg_0 ) : arg_1 = arg_0 [ 2 ] . split ( "#" ) if len ( arg_1 ) > 1 : arg_2 = "#" . join ( ( arg_1 [ 0 ] , arg_1 [ - 1 ] ) ) else : arg_2 = arg_0 [ 2 ] return arg_2

def Func(arg_0):
    """
    Determine the path from the intersphinx inventory entry

    Discard the anchors between head and tail to make it
    compatible with situations where extra meta information is encoded.
    """
    arg_1 = arg_0[2].split("#")
    if len(arg_1) > 1:
        arg_2 = "#".join((arg_1[0], arg_1[-1]))
    else:
        arg_2 = arg_0[2]
    return arg_2