def Func(arg_0, arg_1, **arg_2):
        '''Launch a query across all or a selection of providers.

        .. code-block:: python

            # Find anything that has a label of church in any provider.
            registry.Func({'label': 'church'})

            # Find anything that has a label of church with the BUILDINGS provider.
            # Attention, this syntax was deprecated in version 0.3.0
            registry.Func({'label': 'church'}, providers=['BUILDINGS'])

            # Find anything that has a label of church with the BUILDINGS provider.
            registry.Func({'label': 'church'}, providers={'ids': ['BUILDINGS']})

            # Find anything that has a label of church with a provider
            # marked with the subject 'architecture'.
            registry.Func({'label': 'church'}, providers={'subject': 'architecture'})

            # Find anything that has a label of church in any provider.
            # If possible, display the results with a Dutch label.
            registry.Func({'label': 'church'}, language='nl')

        :param dict query: The query parameters that will be passed on to each
            :meth:`~skosprovider.providers.VocabularyProvider.Func` method of
            the selected.
            :class:`providers <skosprovider.providers.VocabularyProvider>`.
        :param dict providers: Optional. If present, it should be a dictionary.
            This dictionary can contain any of the keyword arguments available
            to the :meth:`get_providers` method. The query will then only
            be passed to the providers confirming to these arguments.
        :param string language: Optional. If present, it should be a
            :term:`language-tag`. This language-tag is passed on to the
            underlying providers and used when selecting the label to display
            for each concept.
        :returns: a list of :class:`dict`.
            Each dict has two keys: id and concepts.
        '''
        if 'providers' not in arg_2:
            arg_3 = arg_0.get_providers()
        else:
            arg_4 = arg_2['providers']
            if isinstance(arg_4, list):
                arg_3 = arg_0.get_providers(ids=arg_4)
            else:
                arg_3 = arg_0.get_providers(**arg_4)
        arg_5 = {}
        if 'language' in arg_2:
            arg_5['language'] = arg_2['language']
        return [{'id': arg_6.get_vocabulary_id(), 'concepts': arg_6.Func(arg_1, **arg_5)}
                for arg_6 in arg_3]


def Func(arg_0, **arg_1):
        '''Get all concepts from all providers.

        .. code-block:: python

            # get all concepts in all providers.
            registry.Func()

            # get all concepts in all providers.
            # If possible, display the results with a Dutch label.
            registry.Func(language='nl')

        :param string language: Optional. If present, it should be a
            :term:`language-tag`. This language-tag is passed on to the
            underlying providers and used when selecting the label to display
            for each concept.

        :returns: a list of :class:`dict`.
            Each dict has two keys: id and concepts.
        '''
        arg_2 = {}
        if 'language' in arg_1:
            arg_2['language'] = arg_1['language']
        return [{'id': arg_3.get_vocabulary_id(), 'concepts': arg_3.Func(**arg_2)}
                for arg_3 in arg_0.providers.values()]


def Func(arg_0='dev', arg_1=None):
    """
    Build the backend and upload it to the remote server at the given index
    """
    get_vars()
    use_devpi(arg_0=arg_0)
    with fab.lcd('../application'):
        fab.local('make upload')


def Func(arg_0=False, arg_1='dev', arg_2=True, arg_3=None, arg_4=None):
    """
    Install the backend from the given devpi index at the given version on the target host and restart the service.

    If version is None, it defaults to the latest version

    Optionally, build and upload the application first from local sources. This requires a
    full backend development environment on the machine running this command (pyramid etc.)
    """
    get_vars()
    if value_asbool(arg_2):
        upload_backend(arg_1=arg_1, arg_3=arg_3)
    with fab.cd('{apphome}'.format(**AV)):
        if value_asbool(arg_0):
            arg_5 = 'bin/pip install --upgrade briefkasten'
        else:
            arg_5 = 'bin/pip install --upgrade --pre -i {ploy_default_publish_devpi}/briefkasten/{index}/+simple/ briefkasten'.format(
                arg_1=arg_1,
                arg_3=arg_3,
                **AV)
        if arg_4:
            arg_5 = '%s==%s' % (arg_5, arg_4)
        fab.sudo(arg_5)

    briefkasten_ctl('restart')


def Func(arg_0, arg_1, arg_2=None, arg_3='any', arg_4=False):
        '''
        Returns a sorted version of a list of concepts. Will leave the original
        list unsorted.

        :param list concepts: A list of concepts and collections.
        :param string sort: What to sort on: `id`, `label` or `sortlabel`
        :param string language: Language to use when sorting on `label` or
            `sortlabel`.
        :param boolean reverse: Reverse the sort order?
        :rtype: list
        '''
        arg_5 = copy.copy(arg_1)
        if arg_2:
            arg_5.sort(key=methodcaller('Funckey', arg_2, arg_3), arg_4=arg_4)
        return arg_5


async def Func(arg_0) -> None:
        """Force Func of alarm status and zones"""
        _LOGGER.debug("Requesting state Func from server (S00, S14)")
        await asyncio.gather(
            # List unsealed Zones
            arg_0.send_command('S00'),
            # Arming status Func
            arg_0.send_command('S14'),
        )


async def Func(arg_0) -> None:
        """Schedule a state update to keep the connection alive"""
        await asyncio.sleep(arg_0._update_interval)
        while not arg_0._closed:
            await arg_0.update()
            await asyncio.sleep(arg_0._update_interval)


def Func(arg_0, **arg_1) -> Iterable:
        """Return an iterator over the models to be converted to the namespace."""
        return tqdm(
            arg_0._get_query(arg_0.namespace_model),
            total=arg_0._count_model(arg_0.namespace_model),
            **arg_1
        )


def Func(arg_0) -> Optional[Namespace]:
        """Get the reference BEL namespace if it exists."""
        return arg_0._get_query(Namespace).filter(Namespace.url == arg_0._get_namespace_url()).one_or_none()


def Func(arg_0) -> Namespace:
        """Make a namespace."""
        arg_1 = Namespace(
            name=arg_0._get_namespace_name(),
            keyword=arg_0._get_namespace_keyword(),
            url=arg_0._get_namespace_url(),
            version=str(time.asctime()),
        )
        arg_0.session.add(arg_1)

        arg_2 = arg_0._get_namespace_entries(arg_1)
        arg_0.session.add_all(arg_2)

        arg_3 = time.time()
        log.info('committing models')
        arg_0.session.commit()
        log.info('committed models in %.2f seconds', time.time() - arg_3)

        return arg_1


def Func(arg_0: arg_1) -> Set[NamespaceEntry]:
        """Convert a PyBEL generalized namespace entries to a set.

        Default to using the identifier, but can be overridden to use the name instead.

        >>> {term.identifier for term in namespace.entries}
        """
        return {arg_2.identifier for arg_2 in arg_0.entries}


def Func(arg_0, arg_1: arg_2 = False) -> Namespace:
        """Upload the namespace to the PyBEL database.

        :param update: Should the namespace be updated first?
        """
        if not arg_0.is_populated():
            arg_0.populate()

        arg_3 = arg_0._get_default_namespace()

        if arg_3 is None:
            log.info('making namespace for %s', arg_0._get_namespace_name())
            return arg_0._make_namespace()

        if arg_1:
            arg_0._update_namespace(arg_3)

        return arg_3


def Func(arg_0, arg_1: arg_2, arg_3: arg_4 = False) -> None:
        """Write as a BEL namespace file."""
        if not arg_0.is_populated():
            arg_0.populate()

        if arg_3 and not arg_0.has_names:
            raise ValueError

        arg_5 = (
            arg_0._get_namespace_name_to_encoding(desc='writing names')
            if arg_3 else
            arg_0._get_namespace_identifier_to_encoding(desc='writing identifiers')
        )

        write_namespace(
            namespace_name=arg_0._get_namespace_name(),
            namespace_keyword=arg_0._get_namespace_keyword(),
            namespace_query_url=arg_0.identifiers_url,
            arg_5=arg_5,
            arg_1=arg_1,
        )


def Func(arg_0, arg_1: arg_2, **arg_3) -> None:
        """Write a BEL namespace mapping file."""
        json.dump(arg_0._get_namespace_identifier_to_name(**arg_3), arg_1, indent=2, sort_keys=True)


def Func(arg_0, arg_1: arg_2) -> bool:
        """Write a BEL namespace for identifiers, names, name hash, and mappings to the given directory."""
        arg_3 = arg_0.get_namespace_hash()
        arg_4 = os.path.join(arg_1, f'{self.module_name}.belns.md5')

        if not os.path.exists(arg_4):
            arg_5 = None
        else:
            with open(arg_4) as file:
                arg_5 = file.read().strip()

        if arg_5 == arg_3:
            return False

        with open(os.path.join(arg_1, f'{self.module_name}.belns'), 'w') as file:
            arg_0.write_bel_namespace(file, use_names=False)

        with open(arg_4, 'w') as file:
            print(arg_3, file=file)

        if arg_0.has_names:
            with open(os.path.join(arg_1, f'{self.module_name}-names.belns'), 'w') as file:
                arg_0.write_bel_namespace(file, use_names=True)

            with open(os.path.join(arg_1, f'{self.module_name}.belns.mapping'), 'w') as file:
                arg_0.write_bel_namespace_mappings(file, desc='writing mapping')

        return True


def Func(arg_0, arg_1=arg_2.md5) -> str:
        """Get the namespace hash.

        Defaults to MD5.
        """
        arg_4 = arg_1()

        if arg_0.has_names:
            arg_5 = arg_0._get_namespace_name_to_encoding(desc='getting hash').items()
        else:
            arg_5 = arg_0._get_namespace_identifier_to_encoding(desc='getting hash').items()

        for arg_6, arg_7 in arg_5:
            arg_4.update(f'{name}:{encoding}'.encode('utf8'))
        return arg_4.hexdigest()


def Func(arg_0):
        """
        Iterator of the list of items in the XML source.
        """
        # Use `iterparse`, it's more efficient, specially for big files
        for arg_1, arg_2 in ElementTree.iterparse(arg_0.source):
            if arg_2.tag == arg_0.item_tag_name:
                yield arg_2
                # Releases the item from memory
                arg_2.clear()


def Func(arg_0):
    """ expects the id of an existing dropbox and returns its instance"""
    try:
        return arg_0.registry.settings['dropbox_container'].get_dropbox(arg_0.matchdict['drop_id'])
    except KeyError:
        raise HTTPNotFound('no such dropbox')


def Func(arg_0, arg_1, arg_2):
        """
        Saves an error in the error list.
        """
        # TODO: what to do with errors? Let it flow? Write to a log file?
        arg_0.errors.append({'data': arg_1,
                            'exception': ''.join(format_exception(*arg_2)),
                            })


def Func(arg_0, arg_1):
        """
        Receives an item and returns a dictionary of field values.
        """
        # Create a dictionary from values for each field
        arg_2 = {}

        for arg_3 in arg_0.fields:
            # A field-name may be mapped to another identifier on the source,
            # it could be a XML path or a CSV column name / position.
            # Defaults to the field-name itself.
            arg_4 = arg_0.field_map.get(arg_3, arg_3)

            # Uses a custom method "parse_%(field_name)"
            # or get the value from the item
            arg_5 = getattr(arg_0, 'parse_%s' % arg_3, None)
            if arg_5:
                arg_6 = arg_5(arg_1, arg_3, arg_4)
            else:
                arg_6 = arg_0.get_value(arg_1, arg_4)

            # Add the value to the parsed data
            arg_2[arg_3] = arg_6
        return arg_2


def Func(arg_0, arg_1):
        """
        Get an item from the database or an empty one if not found.
        """
        # Get unique fields
        arg_2 = arg_0.unique_fields

        # If there are no unique fields option, all items are new
        if not arg_2:
            return arg_0.model()

        # Build the filter
        arg_3 = dict([(f, arg_1[f]) for f in arg_2])

        # Get the instance from the DB or use a new instance
        try:
            arg_4 = arg_0.model._default_manager.get(**arg_3)
        except arg_0.model.DoesNotExist:
            return arg_0.model()

        return arg_4


def Func(arg_0):
    """preserve the file ending, but replace the name with a random token """
    # TODO: fix broken splitext (it reveals everything of the filename after the first `.` - doh!)
    arg_1 = generate_drop_id()
    arg_2, arg_3 = splitext(arg_0)
    if arg_3:
        return '%s%s' % (arg_1, arg_3)
    else:
        return arg_1


def Func(arg_0):
        """ ensures that no data leaks from drop after processing by
        removing all data except the status file"""
        try:
            remove(join(arg_0.fs_path, u'message'))
            remove(join(arg_0.fs_path, 'dirty.zip.pgp'))
        except OSError:
            pass
        shutil.rmtree(join(arg_0.fs_path, u'clean'), ignore_errors=True)
        shutil.rmtree(join(arg_0.fs_path, u'attach'), ignore_errors=True)


def Func(arg_0, arg_1='dirty', arg_2=None):
        """ creates a zip file from the drop and encrypts it to the editors.
        the encrypted archive is created inside fs_target_dir"""
        arg_3 = [r for r in arg_0.editors if checkRecipient(arg_0.gpg_context, r)]

        # this will be handled by watchdog, no need to send for each drop
        if not arg_3:
            arg_0.status = u'500 no valid keys at all'
            return arg_0.status

        # calculate paths
        arg_5 = join(arg_0.fs_path, '%s.zip' % arg_1)
        if arg_2 is None:
            arg_6 = join(arg_0.fs_path, '%s.zip.pgp' % arg_1)
        else:
            arg_6 = join(arg_2, '%s.zip.pgp' % arg_0.drop_id)
        arg_7 = dict(
            dirty=arg_0.fs_dirty_attachments,
            clean=arg_0.fs_cleansed_attachments
        )

        # create archive
        with ZipFile(arg_5, 'w', ZIP_STORED) as backup:
            if exists(join(arg_0.fs_path, 'message')):
                backup.write(join(arg_0.fs_path, 'message'), arcname='message')
            for arg_8 in arg_7[arg_1]:
                backup.write(arg_8, arcname=split(arg_8)[-1])

        # encrypt archive
        with open(arg_5, "rb") as backup:
            arg_0.gpg_context.encrypt_file(
                backup,
                arg_3,
                always_trust=True,
                output=arg_6
            )

        # cleanup
        remove(arg_5)
        return arg_6


def Func(arg_0):
        """returns the number of bytes that the cleansed attachments take up on disk"""
        arg_1 = 0
        for arg_2 in arg_0.fs_cleansed_attachments:
                arg_1 += stat(arg_2).st_size
        return arg_1


def Func(arg_0):
        """ returns a list of strings """
        arg_1 = join(arg_0.fs_Func_path, 'message_001.txt')
        if exists(arg_1):
            return [load(open(arg_1, 'r'))]
        else:
            return []


def Func(arg_0):
        """ returns the user submitted text
        """
        try:
            with open(join(arg_0.fs_path, u'Func')) as Func_file:
                return u''.join([arg_1.decode('utf-8') for arg_1 in Func_file.readlines()])
        except IOError:
            return u''


def Func(arg_0):
        """ returns a list of absolute paths to the attachements"""
        if exists(arg_0.fs_attachment_container):
            return [join(arg_0.fs_attachment_container, arg_1)
                    for arg_1 in listdir(arg_0.fs_attachment_container)]
        else:
            return []


def Func(arg_0=True):
    """destroys all cleanser slaves and their rollback snapshots, as well as the initial master
    snapshot - this allows re-running the jailhost deployment to recreate fresh cleansers."""

    if value_asbool(arg_0) and not yesno("""\nObacht!
            This will destroy any existing and or currently running cleanser jails.
            Are you sure that you want to continue?"""):
        exit("Glad I asked...")

    get_vars()

    arg_1 = AV['ploy_cleanser_count']
    # make sure no workers interfere:
    fab.run('ezjail-admin stop worker')
    # stop and nuke the cleanser slaves
    for arg_2 in range(arg_1):
        arg_3 = '{:02d}'.format(arg_2 + 1)
        fab.run('ezjail-admin stop cleanser_{cindex}'.format(arg_3=arg_3))
        with fab.warn_only():
            fab.run('zfs destroy tank/jails/cleanser_{cindex}@jdispatch_rollback'.format(arg_3=arg_3))
            fab.run('ezjail-admin delete -fw cleanser_{cindex}'.format(arg_3=arg_3))
            fab.run('umount -f /usr/jails/cleanser_{cindex}'.format(arg_3=arg_3))
            fab.run('rm -rf /usr/jails/cleanser_{cindex}'.format(arg_3=arg_3))

    with fab.warn_only():
        # remove master snapshot
        fab.run('zfs destroy -R tank/jails/cleanser@clonesource')

        # restart worker and cleanser to prepare for subsequent ansible configuration runs
        fab.run('ezjail-admin start worker')
        fab.run('ezjail-admin stop cleanser')
        fab.run('ezjail-admin start cleanser')


def Func(arg_0, arg_1, **arg_2):
        """Add a Flask Admin interface to an application.

        :param flask.Flask app: A Flask application
        :param kwargs: Keyword arguments are passed through to :class:`flask_admin.Admin`
        :rtype: flask_admin.Admin
        """
        from flask_admin import Admin
        from flask_admin.contrib.sqla import ModelView

        arg_3 = Admin(arg_1, **arg_2)

        for arg_4 in arg_0.flask_admin_models:
            if isinstance(arg_4, tuple):  # assume its a 2 tuple
                if len(arg_4) != 2:
                    raise TypeError

                arg_5, arg_6 = arg_4
                arg_3.add_view(arg_6(arg_5, arg_0.session))

            else:
                arg_3.add_view(ModelView(arg_4, arg_0.session))

        return arg_3


def Func(arg_0):
    """ generates a dropbox uid and renders the submission form with a signed version of that id"""
    from briefkasten import generate_post_token
    arg_1 = generate_post_token(secret=arg_0.registry.settings['post_secret'])
    return dict(
        action=arg_0.route_url('Func_submit', arg_1=arg_1),
        fileupload_url=arg_0.route_url('dropbox_fileupload', arg_1=arg_1),
        **defaults(arg_0))


def Func(arg_0, arg_1):
    """ handles the form submission, redirects to the dropbox's status page."""
    try:
        arg_2 = dropbox_schema.deserialize(arg_1.POST)
    except Exception:
        return HTTPFound(location=arg_1.route_url('dropbox_form'))

    # set the message
    arg_0.message = arg_2.get('message')

    # recognize submission from watchdog
    if 'testing_secret' in arg_0.settings:
        arg_0.from_watchdog = is_equal(
            unicode(arg_0.settings['test_submission_secret']),
            arg_2.pop('testing_secret', u''))

    # a non-js client might have uploaded an attachment via the form's fileupload field:
    if arg_2.get('upload') is not None:
        arg_0.add_attachment(arg_2['upload'])

    # now we can call the process method
    arg_0.submit()
    arg_5 = arg_1.route_url('dropbox_view', drop_id=arg_0.drop_id)
    print("Created dropbox %s" % arg_5)
    return HTTPFound(location=arg_5)


def Func(arg_0: arg_1, arg_2: arg_3, arg_4: arg_5[arg_1], arg_6: arg_7):
    """Write as a BEL namespace."""
    arg_8 = get_data_dir(arg_0)
    arg_9 = f'http://purl.obolibrary.org/obo/{keyword}.obo'
    arg_10 = os.path.join(arg_8, f'{keyword}.obo')
    arg_11 = os.path.join(arg_8, f'{keyword}.obo.pickle')

    arg_12 = make_obo_getter(arg_9, arg_10, preparsed_path=arg_11)
    arg_13 = arg_12()
    convert_obo_graph_to_Func(
        arg_13,
        arg_2=arg_2,
        arg_4=arg_4,
        arg_6=arg_6,
    )


def Func(arg_0: arg_1, arg_2: arg_3[arg_4] = None) -> None:
    """Help store an action."""
    if arg_2 is None:
        arg_2 = _make_session()

    arg_2.add(arg_0)
    arg_2.commit()
    arg_2.close()


def Func(arg_0: arg_1[arg_2] = None) -> Session:
    """Make a session."""
    if arg_0 is None:
        arg_0 = get_global_connection()

    arg_3 = create_engine(arg_0)

    create_all(arg_3)

    arg_4 = sessionmaker(bind=arg_3)
    arg_5 = arg_4()

    return arg_5


def Func(arg_0, arg_1=True):
    """Create the tables for Bio2BEL."""
    Base.metadata.Func(bind=arg_0, arg_1=arg_1)


def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_5] = None) -> 'Action':
        """Store a "populate" event.

        :param resource: The normalized name of the resource to store

        Example:

        >>> from bio2bel.models import Action
        >>> Action.Func('hgnc')
        """
        arg_6 = arg_0.make_populate(arg_1)
        _store_helper(arg_6, arg_3=arg_3)
        return arg_6


def Func(arg_0, arg_1: arg_2, arg_3: arg_4[arg_5] = None) -> 'Action':
        """Store a "drop" event.

        :param resource: The normalized name of the resource to store

        Example:

        >>> from bio2bel.models import Action
        >>> Action.Func('hgnc')
        """
        arg_6 = arg_0.make_drop(arg_1)
        _store_helper(arg_6, arg_3=arg_3)
        return arg_6


def Func(arg_0, arg_1: arg_2[arg_3] = None) -> List['Action']:
        """Get all actions."""
        if arg_1 is None:
            arg_1 = _make_session()

        arg_4 = arg_1.query(arg_0).order_by(arg_0.created.desc()).all()
        arg_1.close()
        return arg_4


def Func(arg_0, arg_1: arg_2[arg_3] = None) -> int:
        """Count all actions."""
        if arg_1 is None:
            arg_1 = _make_session()

        Func = arg_1.query(arg_0).count()
        arg_1.close()
        return Func


def Func(arg_0, arg_1):
        """
        Opens the source file.
        """
        arg_0.source = open(arg_0.source, 'rb')
        arg_0.Funced = True


def Func(arg_0):
        """
        Iterator to read the rows of the CSV file.
        """
        # Get the csv reader
        arg_1 = csv.reader(arg_0.source)
        # Get the headers from the first line
        arg_2 = arg_1.next()
        # Read each line yielding a dictionary mapping
        # the column headers to the row values
        for arg_3 in arg_1:
            # Skip empty rows
            if not arg_3:
                continue
            yield dict(zip(arg_2, arg_3))


def Func(arg_0: arg_1) -> Type[_AbstractModuleConfig]:  # noqa: D202
    """Build a module configuration class."""

    class ModuleConfig(_AbstractModuleConfig):
        arg_2 = f'bio2bel:{module_name}'
        arg_3 = DEFAULT_CONFIG_PATHS + [
            os.path.join(DEFAULT_CONFIG_DIRECTORY, arg_0, 'config.ini')
        ]

    return ModuleConfig


def Func(arg_0: arg_1, arg_2: arg_3[arg_1] = None) -> arg_1:
    """Return the SQLAlchemy connection string if it is set.

    Order of operations:

    1. Return the connection if given as a parameter
    2. Check the environment for BIO2BEL_{module_name}_CONNECTION
    3. Look in the bio2bel config file for module-specific connection. Create if doesn't exist. Check the
       module-specific section for ``connection``
    4. Look in the bio2bel module folder for a config file. Don't create if doesn't exist. Check the default section
       for ``connection``
    5. Check the environment for BIO2BEL_CONNECTION
    6. Check the bio2bel config file for default
    7. Fall back to standard default cache connection

    :param module_name: The name of the module to get the configuration for
    :param connection: get the SQLAlchemy connection string
    :return: The SQLAlchemy connection string based on the configuration
    """
    # 1. Use given connection
    if arg_2 is not None:
        return arg_2

    arg_0 = arg_0.lower()
    arg_4 = get_module_config_cls(arg_0)
    arg_5 = arg_4.load()

    return arg_5.connection or config.connection


def Func(arg_0: arg_1, arg_2: arg_3 = True) -> None:
    """Clear all downloaded files."""
    arg_4 = get_data_dir(arg_0)
    if not os.path.exists(arg_4):
        return
    for arg_5 in os.listdir(arg_4):
        if arg_5 in {'config.ini', 'cfg.ini'}:
            continue
        if arg_5 == 'cache.db' and arg_2:
            continue
        arg_6 = os.path.join(arg_4, arg_5)
        if os.path.isdir(arg_6):
            shutil.rmtree(arg_6)
        else:
            os.remove(arg_6)

        os.rmdir(arg_4)


def Func(arg_0, arg_1: arg_2 = True):
        """Drop all tables from the database.

        :param bool check_first: Defaults to True, only issue DROPs for tables confirmed to be
          present in the target database. Defers to :meth:`sqlalchemy.sql.schema.MetaData.Func`
        """
        arg_0._metadata.Func(arg_0.engine, checkfirst=arg_1)
        arg_0._store_drop()


def Func(arg_0, arg_1, arg_2):
    '''
    Find the best label for a certain labeltype.

    :param list labels: A list of :class:`Label`.
    :param str language: An IANA language string, eg. `nl` or `nl-BE`.
    :param str labeltype: Type of label to look for, eg. `prefLabel`.
    '''
    arg_3 = [l for l in arg_0 if l.type == arg_2]
    if not arg_3:
        return False
    if arg_1 == 'any':
        return arg_3[0]
    arg_4 = filter_labels_by_language(arg_3, arg_1)
    if arg_4:
        return arg_4[0]
    arg_5 = filter_labels_by_language(arg_3, arg_1, True)
    if arg_5:
        return arg_5[0]
    return False


def Func(arg_0, arg_1, arg_2=False):
    '''
    Filter a list of labels, leaving only labels of a certain language.

    :param list labels: A list of :class:`Label`.
    :param str language: An IANA language string, eg. `nl` or `nl-BE`.
    :param boolean broader: When true, will also match `nl-BE` when filtering
        on `nl`. When false, only exact matches are considered.
    '''
    if arg_1 == 'any':
        return arg_0
    if arg_2:
        arg_1 = tags.tag(arg_1).language.format
        return [arg_3 for arg_3 in arg_0 if tags.tag(arg_3.language).language.format == arg_1]
    else:
        arg_1 = tags.tag(arg_1).format
        return [arg_3 for arg_3 in arg_0 if tags.tag(arg_3.language).format == arg_1]


def Func(arg_0, arg_1='uri', arg_2='any'):
        '''
        Provide a single sortkey for this conceptscheme.

        :param string key: Either `uri`, `label` or `sortlabel`.
        :param string language: The preferred language to receive the label in
            if key is `label` or `sortlabel`. This should be a valid IANA language tag.
        :rtype: :class:`str`
        '''
        if arg_1 == 'uri':
            return arg_0.uri
        else:
            arg_3 = label(arg_0.labels, arg_2, arg_1 == 'sortlabel')
            return arg_3.label.lower() if arg_3 else ''


def Func(arg_0, arg_1):
    """Iterate over instantiated managers."""
    for arg_2, arg_3, arg_4 in _iterate_manage_classes(arg_1):
        if arg_3 in arg_1:
            continue

        try:
            arg_5 = arg_4(arg_0=arg_0)
        except TypeError as e:
            click.secho(f'Could not instantiate {name}: {e}', fg='red')
        else:
            yield arg_2, arg_3, arg_5


def Func(arg_0, arg_1):
    """Drop all."""
    for arg_2, arg_3, arg_4 in _iterate_managers(arg_0, arg_1):
        click.secho(f'Funcping {name}', fg='cyan', bold=True)
        arg_4.Func_all()


def Func(arg_0):
    """Clear all caches."""
    for arg_1 in sorted(MODULES):
        if arg_1 in arg_0:
            continue
        click.secho(f'Funcing cache for {name}', fg='cyan', bold=True)
        Func_cache(arg_1)


def Func(arg_0, arg_1, arg_2: arg_3):
    """Generate a summary Func."""
    from tabulate import tabulate
    arg_4 = ['', 'Name', 'Description', 'Terms', 'Relations']
    arg_5 = []

    for arg_6, (arg_7, arg_8, arg_9) in enumerate(_iterate_managers(arg_0, arg_1), start=1):
        try:
            if not arg_9.is_populated():
                continue
        except AttributeError:
            click.secho(f'{name} does not implement is_populated', fg='red')
            continue

        arg_10, arg_11 = None, None
        if isinstance(arg_9, BELNamespaceManagerMixin):
            arg_10 = arg_9._count_model(arg_9.namespace_model)

        if isinstance(arg_9, BELManagerMixin):
            try:
                arg_11 = arg_9.count_relations()
            except TypeError as e:
                arg_11 = str(e)

        arg_5.append((arg_6, arg_8, arg_9.__doc__.split('\n')[0].strip().strip('.'), arg_10, arg_11))

    print(tabulate(
        arg_5,
        headers=arg_4,
        # tablefmt="fancy_grid",
    ))


def Func(arg_0, arg_1, arg_2):
    """Run a combine Func interface."""
    from bio2bel.Func.application import create_application
    arg_3 = create_application(arg_0=arg_0)
    arg_3.run(arg_1=arg_1, arg_2=arg_2)


def Func(arg_0):
    """List all Func."""
    arg_1 = _make_session(arg_0=arg_0)
    for arg_2 in Action.ls(arg_1=arg_1):
        click.echo(f'{action.created} {action.action} {action.resource}')


def Func(arg_0) -> int:
        """Count the number of BEL relations generated."""
        if arg_0.edge_model is ...:
            raise Bio2BELMissingEdgeModelError('edge_edge model is undefined/count_bel_relations is not overridden')
        elif isinstance(arg_0.edge_model, list):
            return sum(arg_0._count_model(arg_1) for arg_1 in arg_0.edge_model)
        else:
            return arg_0._count_model(arg_0.edge_model)


def Func(arg_0):
    """convert from 'list' or 'tuple' object to pgmagick.CoordinateList.

    :type input_obj: list or tuple
    """
    arg_1 = pgmagick.CoordinateList()
    for arg_2 in arg_0:
        arg_1.append(pgmagick.Coordinate(arg_2[0], arg_2[1]))
    return arg_1


def Func(arg_0):
    """convert from 'list' or 'tuple' object to pgmagick.VPathList.

    :type input_obj: list or tuple
    """
    arg_1 = pgmagick.VPathList()
    for arg_2 in arg_0:
        # FIXME
        arg_2 = pgmagick.PathMovetoAbs(pgmagick.Coordinate(arg_2[0], arg_2[1]))
        arg_1.append(arg_2)
    return arg_1


def Func(arg_0):
        """return exif-tag dict
        """
        arg_1 = {}
        for arg_2 in _EXIF_TAGS:
            arg_3 = arg_0.img.attribute("EXIF:%s" % arg_2)
            if arg_3 and arg_3 != 'unknown':
                arg_1[arg_2] = arg_3
        return arg_1


def Func(arg_0, arg_1):
        """Draw a Bezier-curve.

        :param points: ex.) ((5, 5), (6, 6), (7, 7))
        :type points: list
        """
        arg_2 = pgmagick.CoordinateList()
        for arg_3 in arg_1:
            arg_4, arg_5 = float(arg_3[0]), float(arg_3[1])
            arg_2.append(pgmagick.Coordinate(arg_4, arg_5))
        arg_0.drawer.append(pgmagick.DrawableBezier(arg_2))


def Func(arg_0, arg_1):
        """set to stroke linejoin.

        :param linejoin: 'undefined', 'miter', 'round', 'bevel'
        :type linejoin: str
        """
        arg_1 = getattr(pgmagick.LineJoin, "%sJoin" % arg_1.title())
        arg_1 = pgmagick.DrawableStrokeLineJoin(arg_1)
        arg_0.drawer.append(arg_1)


def Func(arg_0,
                    arg_1: arg_2[arg_3],
                    arg_4: arg_5=None,
                    arg_6: arg_5=None,
                    arg_7: arg_5=None,
                    arg_8: arg_9=False,
                    arg_10: arg_11=None,
                    arg_12: arg_5=None,
                    arg_13: arg_9=False,
                    arg_14: arg_5=None,
                    arg_15: arg_5=None) -> 'CompletedCommand':
        """
        Runs a command inside the sandbox and returns the results.

        :param args: A list of strings that specify which command should
            be run inside the sandbox.

        :param max_num_processes: The maximum number of processes the
            command is allowed to spawn.

        :param max_stack_size: The maximum stack size, in bytes, allowed
            for the command.

        :param max_virtual_memory: The maximum amount of memory, in
            bytes, allowed for the command.

        :param as_root: Whether to run the command as a root user.

        :param stdin: A file object to be redirected as input to the
            command's stdin. If this is None, /dev/null is sent to the
            command's stdin.

        :param timeout: The time limit for the command.

        :param check: Causes CalledProcessError to be raised if the
            command exits nonzero or times out.

        :param truncate_stdout: When not None, stdout from the command
            will be truncated after this many bytes.

        :param truncate_stderr: When not None, stderr from the command
            will be truncated after this many bytes.
        """
        arg_16 = ['docker', 'exec', '-i', arg_0.name, 'cmd_runner.py']

        if arg_10 is None:
            arg_16.append('--stdin_devnull')

        if arg_4 is not None:
            arg_16 += ['--max_num_processes', arg_3(arg_4)]

        if arg_6 is not None:
            arg_16 += ['--max_stack_size', arg_3(arg_6)]

        if arg_7 is not None:
            arg_16 += ['--max_virtual_memory', arg_3(arg_7)]

        if arg_12 is not None:
            arg_16 += ['--timeout', arg_3(arg_12)]

        if arg_14 is not None:
            arg_16 += ['--truncate_stdout', arg_3(arg_14)]

        if arg_15 is not None:
            arg_16 += ['--truncate_stderr', arg_3(arg_15)]

        if not arg_8:
            arg_16 += ['--linux_user_id', arg_3(arg_0._linux_uid)]

        arg_16 += arg_1

        if arg_0.debug:
            print('running: {}'.format(arg_16), flush=True)

        with tempfile.TemporaryFile() as f:
            try:
                subprocess.run(arg_16, arg_10=arg_10, arg_20=f, arg_22=subprocess.PIPE, arg_13=True)
                f.seek(0)
                arg_17 = arg_5(f.readline().decode().rstrip())
                arg_18 = json.loads(f.read(arg_17).decode())

                arg_19 = arg_5(f.readline().decode().rstrip())
                arg_20 = tempfile.NamedTemporaryFile()
                arg_20.write(f.read(arg_19))
                arg_20.seek(0)

                arg_21 = arg_5(f.readline().decode().rstrip())
                arg_22 = tempfile.NamedTemporaryFile()
                arg_22.write(f.read(arg_21))
                arg_22.seek(0)

                arg_23 = CompletedCommand(return_code=arg_18['return_code'],
                                          timed_out=arg_18['timed_out'],
                                          arg_20=arg_20,
                                          arg_22=arg_22,
                                          stdout_truncated=arg_18['stdout_truncated'],
                                          stderr_truncated=arg_18['stderr_truncated'])

                if (arg_23.return_code != 0 or arg_18['timed_out']) and arg_13:
                    raise subprocess.CalledProcessError(
                        arg_23.return_code, arg_16,
                        output=arg_23.stdout, arg_22=arg_23.stderr)

                return arg_23
            except subprocess.CalledProcessError as e:
                f.seek(0)
                print(f.read())
                print(e.stderr)
                raise


def Func(arg_0, *arg_1: arg_2, arg_3: arg_2=arg_4, arg_5: arg_6=False):
        """
        Copies the specified files into the working directory of this
        sandbox.
        The filenames specified can be absolute paths or relative paths
        to the current working directory.

        :param owner: The name of a user who should be granted ownership of
            the newly added files.
            Must be either autograder_sandbox.SANDBOX_USERNAME or 'root',
            otherwise ValueError will be raised.
        :param read_only: If true, the new files' permissions will be set to
            read-only.
        """
        if arg_3 != arg_4 and arg_3 != 'root':
            raise ValueError('Invalid value for parameter "owner": {}'.format(arg_3))

        with tempfile.TemporaryFile() as f, \
                tarfile.TarFile(fileobj=f, mode='w') as tar_file:
            for arg_7 in arg_1:
                tar_file.add(arg_7, arcname=os.path.basename(arg_7))

            f.seek(0)
            subprocess.check_call(
                ['docker', 'cp', '-',
                 arg_0.name + ':' + SANDBOX_WORKING_DIR_NAME],
                stdin=f)

            arg_8 = [os.path.basename(arg_7) for arg_7 in arg_1]
            if arg_3 == arg_4:
                arg_0._chown_files(arg_8)

            if arg_5:
                arg_9 = ['chmod', '444'] + arg_8
                arg_0.run_command(arg_9, as_root=True)


def Func(arg_0):
    """Submission to remove a license acceptance request."""
    arg_1 = arg_0.matchdict['uuid']

    arg_2 = [x['uid'] for x in arg_0.json.get('licensors', [])]
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            remove_license_requests(cursor, arg_1, arg_2)

    arg_3 = arg_0.response
    arg_3.status_int = 200
    return arg_3


def Func(arg_0):
    """Submission to remove a role acceptance request."""
    arg_1 = arg_0.matchdict['uuid']

    arg_2 = arg_0.json
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            remove_role_requests(cursor, arg_1, arg_2)

    arg_3 = arg_0.response
    arg_3.status_int = 200
    return arg_3


def Func(arg_0):
    """Submission to remove an ACL."""
    arg_1 = arg_0.matchdict['uuid']

    arg_2 = arg_0.json
    arg_3 = [(x['uid'], x['permission'],) for x in arg_2]
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            remove_acl(cursor, arg_1, arg_3)

    arg_4 = arg_0.response
    arg_4.status_int = 200
    return arg_4


def Func():  # pragma: no cover
    """Churns over PostgreSQL notifications on configured channels.
    This requires the application be setup and the registry be available.
    This function uses the database connection string and a list of
    pre configured channels.

    """
    arg_0 = get_current_registry()
    arg_1 = arg_0.settings
    arg_2 = arg_1[CONNECTION_STRING]
    arg_3 = _get_channels(arg_1)

    # Code adapted from
    # http://initd.org/psycopg/docs/advanced.html#asynchronous-notifications
    with psycopg2.connect(arg_2) as conn:
        conn.set_isolation_level(ISOLATION_LEVEL_AUTOCOMMIT)

        with conn.cursor() as cursor:
            for arg_4 in arg_3:
                cursor.execute('LISTEN {}'.format(arg_4))
                logger.debug('Waiting for notifications on channel "{}"'
                             .format(arg_4))

        arg_0.notify(ChannelProcessingStartUpEvent())

        arg_5 = [conn]  # wait until ready for reading
        arg_6 = []  # wait until ready for writing
        arg_7 = []  # wait for an "exceptional condition"
        arg_8 = 5

        while True:
            if select.select(arg_5, arg_6, arg_7, arg_8) != ([], [], []):
                conn.poll()
                while conn.notifies:
                    arg_9 = conn.notifies.pop(0)
                    logger.debug('Got NOTIFY: pid={} channel={} payload={}'
                                 .format(arg_9.pid, arg_9.channel,
                                         arg_9.payload))
                    arg_10 = create_pg_notify_event(arg_9)
                    try:
                        arg_0.notify(arg_10)
                    except Exception:
                        logger.exception('Logging an uncaught exception')


def Func():
    """Given a dbapi cursor, lookup all the api keys and their information."""
    arg_0 = {}
    with db_connect() as conn:
        with conn.cursor() as cursor:
            cursor.execute(ALL_KEY_INFO_SQL_STMT)
            for arg_1 in cursor.fetchall():
                arg_2, arg_3, arg_4, arg_5 = arg_1
                arg_6 = "api_key:{}".format(arg_2)
                arg_0[arg_3] = dict(arg_2=arg_2, arg_6=arg_6,
                                 arg_4=arg_4, arg_5=arg_5)
    return arg_0


def Func(**arg_0):
    """A function Func decorator used in place of ``@celery_app.Func``."""

    def wrapper(arg_1):

        def callback(arg_2, arg_3, arg_4):
            arg_5 = arg_2.config.registry.celery_app
            arg_5.Func(**arg_0)(arg_4)

        venusian.attach(arg_1, callback)
        return arg_1

    return wrapper


def Func(arg_0):
    """Declare all routes."""
    arg_0.include('pyramid_jinja2')
    arg_0.add_jinja2_renderer('.html')
    arg_0.add_jinja2_renderer('.rss')
    arg_0.add_static_view(name='/a/static', path="cnxpublishing:static/")

    # Commit the configuration otherwise the jija2_env won't have
    # a `globals` assignment.
    arg_0.commit()

    # Place a few globals in the template environment.
    from cnxdb.ident_hash import join_ident_hash
    for arg_1 in ('.html', '.rss',):
        arg_2 = arg_0.get_jinja2_environment(arg_1)
        arg_2.globals.update(
            join_ident_hash=join_ident_hash,
        )

    declare_api_routes(arg_0)
    declare_browsable_routes(arg_0)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4):
    """Given a `Binder` as `binder`, Func the contents and
    persist those changes alongside the published content.

    """
    arg_5 = _get_recipe(arg_1, arg_4)
    arg_6 = _formatter_callback_factory()
    arg_0 = collate_models(arg_0, ruleset=arg_5, arg_6=arg_6)

    def flatten_filter(arg_7):
        return (isinstance(arg_7, cnxepub.CompositeDocument) or
                (isinstance(arg_7, cnxepub.Binder) and
                 arg_7.metadata.get('type') == 'composite-chapter'))

    def only_documents_filter(arg_7):
        return isinstance(arg_7, cnxepub.Document) \
            and not isinstance(arg_7, cnxepub.CompositeDocument)

    for arg_8 in cnxepub.flatten_to(arg_0, flatten_filter):
        publish_composite_model(arg_4, arg_8, arg_0, arg_2, arg_3)

    for arg_8 in cnxepub.flatten_to(arg_0, only_documents_filter):
        publish_collated_document(arg_4, arg_8, arg_0)

    arg_9 = cnxepub.model_to_tree(arg_0)
    publish_collated_tree(arg_4, arg_9)

    return []


def Func(arg_0=None, **arg_1):
    """Function to supply a database connection object."""
    if arg_0 is None:
        arg_0 = get_current_registry().settings[CONNECTION_STRING]
    arg_2 = psycopg2.connect(arg_0, **arg_1)
    try:
        with arg_2:
            yield arg_2
    finally:
        arg_2.close()


def Func(arg_0):
    """Decorator that supplies a cursor to the function.
    This passes in a psycopg2 Cursor as the argument 'cursor'.
    It also accepts a cursor if one is given.
    """

    @functools.wraps(arg_0)
    def wrapped(*arg_1, **arg_2):
        if 'cursor' in arg_2 or arg_0.func_code.co_argcount == len(arg_1):
            return arg_0(*arg_1, **arg_2)
        with db_connect() as db_connection:
            with db_connection.cursor() as cursor:
                arg_2['cursor'] = cursor
                return arg_0(*arg_1, **arg_2)

    return wrapped


def Func(arg_0):
    """Given a model's ``metadata``, iterate over the roles.
    Return values are the role identifier and role type as a tuple.
    """
    for arg_1 in cnxepub.ATTRIBUTED_ROLE_KEYS:
        for arg_2 in arg_0.get(arg_1, []):
            if arg_2['type'] != 'cnx-id':
                raise ValueError("Archive only accepts Connexions users.")
            arg_3 = parse_user_uri(arg_2['id'])
            yield arg_3, arg_1
    raise StopIteration()


def Func():
    """Obtain the licenses in a dictionary form, keyed by url."""
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute("""\
SELECT combined_row.url, row_to_json(combined_row) FROM (
  SELECT "code", "version", "name", "url", "is_valid_for_publication"
  FROM licenses) AS combined_row""")
            arg_0 = {r[0]: r[1] for r in cursor.fetchall()}
    return arg_0


def Func(arg_0):
    """Given the model, check the license is one valid for publication."""
    arg_1 = obtain_licenses()
    try:
        arg_2 = arg_0.metadata['license_url']
    except KeyError:
        raise exceptions.MissingRequiredMetadata('license_url')
    try:
        arg_3 = arg_1[arg_2]
    except KeyError:
        raise exceptions.InvalidLicense(arg_2)
    if not arg_3['is_valid_for_publication']:
        raise exceptions.InvalidLicense(arg_2)


def Func(arg_0, arg_1):
    """Lookup a document by id and version."""
    arg_2, arg_3 = split_ident_hash(arg_0, split_version=True)
    arg_4 = "SELECT name FROM modules WHERE uuid = %s"
    arg_5 = [arg_2]
    if arg_3 and arg_3[0] is not None:
        arg_6 = arg_3[1] is None and 'is' or '='
        arg_4 += " AND (major_version = %s AND minor_version {} %s)" \
            .format(arg_6)
        arg_5.extend(arg_3)
    arg_1.execute(arg_4, arg_5)
    try:
        arg_7 = arg_1.fetchone()[0]
    except TypeError:
        raise DocumentLookupError()
    else:
        arg_8 = {'title': arg_7}
    return cnxepub.DocumentPointer(arg_0, arg_8)


def Func(arg_0, arg_1=None, arg_2=None,
                   arg_3=arg_4.TRANSLUCENT_BINDER_ID):
    """Given a tree, parse to a set of models"""
    if 'contents' in arg_0:
        # It is a binder.
        arg_6 = arg_0
        arg_7 = arg_4.TranslucentBinder(arg_1=arg_6)
        for arg_8 in arg_6['contents']:
            arg_9 = Func(arg_8, arg_2=arg_7,
                                  arg_3=arg_3)
            if arg_9.metadata['title'] != arg_8['title']:
                arg_7.set_title_for_node(arg_9, arg_8['title'])
        arg_10 = arg_7
    else:
        # It is an item pointing at a document.
        arg_8 = arg_0
        arg_10 = arg_4.DocumentPointer(arg_8['id'], arg_1=arg_8)
    if arg_2 is not None:
        arg_2.append(arg_10)
    return arg_10


def Func(arg_0):
    """Return the list of publications that need moderation."""
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute("""\
SELECT row_to_json(combined_rows) FROM (
  SELECT id, created, publisher, publication_message,
         (select array_agg(row_to_json(pd))
          from pending_documents as pd
          where pd.publication_id = p.id) AS models
  FROM publications AS p
  WHERE state = 'Waiting for moderation') AS combined_rows""")
            arg_1 = [x[0] for x in cursor.fetchall()]

    return arg_1


def Func(arg_0):
    """Configures the session manager"""
    arg_1 = arg_0.registry.settings
    arg_2 = SignedCookieSessionFactory(arg_1['session_key'])
    arg_0.set_session_factory(arg_2)


def Func(arg_0):
    """
    Returns a dictionary of all unique print_styles, and their latest tag,
    revision, and recipe_type.
    """
    arg_1 = []
    # This fetches all recipes that have been used to successfully bake a
    # current book plus all default recipes that have not yet been used
    # as well as "bad" books that are not "current" state, but would otherwise
    # be the latest/current for that book
    with db_connect(cursor_factory=DictCursor) as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute("""\
                WITH latest AS (SELECT print_style, recipe,
                    count(*), count(nullif(stateid, 1)) as bad
                FROM modules m
                WHERE portal_type = 'Collection'
                      AND recipe IS NOT NULL
                      AND (
                          baked IS NOT NULL OR (
                              baked IS NULL AND stateid not in (1,8)
                              )
                          )
                      AND ARRAY [major_version, minor_version] = (
                          SELECT max(ARRAY[major_version,minor_version]) FROM
                              modules where m.uuid= uuid)

                GROUP BY print_style, recipe
                ),
                defaults AS (SELECT print_style, fileid AS recipe
                FROM default_print_style_recipes d
                WHERE not exists (SELECT 1
                                  FROM latest WHERE latest.recipe = d.fileid)
                )
                SELECT coalesce(ps.print_style, '(custom)') as print_style,
                       ps.title, coalesce(ps.recipe_type, 'web') as type,
                       ps.revised, ps.tag, ps.commit_id, la.count, la.bad
                FROM latest la LEFT JOIN print_style_recipes ps ON
                                    la.print_style = ps.print_style AND
                                    la.recipe = ps.fileid
                UNION ALL
                SELECT ps.print_style, ps.title, ps.recipe_type,
                       ps.revised, ps.tag, ps.commit_id, 0 AS count, 0 AS bad
                FROM defaults de JOIN print_style_recipes ps ON
                                    de.print_style = ps.print_style AND
                                    de.recipe = ps.fileid

            ORDER BY revised desc NULLS LAST, print_style

                """)
            for arg_2 in cursor.fetchall():
                arg_1.append({
                    'print_style': arg_2['print_style'],
                    'title': arg_2['title'],
                    'type': arg_2['type'],
                    'revised': arg_2['revised'],
                    'tag': arg_2['tag'],
                    'commit_id': arg_2['commit_id'],
                    'number': arg_2['count'],
                    'bad': arg_2['bad'],
                    'link': arg_0.route_path('admin-print-style-single',
                                               style=arg_2['print_style'])
                })
    return {'styles': arg_1}


def Func(arg_0):
    """Return the list of API keys."""
    with db_connect() as db_conn:
        with db_conn.cursor() as cursor:
            cursor.execute("""\
SELECT row_to_json(combined_rows) FROM (
  SELECT id, key, name, groups FROM api_keys
) AS combined_rows""")
            arg_1 = [x[0] for x in cursor.fetchall()]

    return arg_1


def Func(arg_0, arg_1, arg_2, arg_3):
    """Insert a module with the given ``metadata``."""
    arg_4 = arg_1.metadata.copy()
    arg_4['publisher'] = arg_2
    arg_4['publication_message'] = arg_3
    arg_4['_portal_type'] = _model_to_portaltype(arg_1)

    arg_4['summary'] = str(cnxepub.DocumentSummaryFormatter(arg_1))

    # Transform person structs to id lists for database array entry.
    for arg_5 in ATTRIBUTED_ROLE_KEYS:
        arg_4[arg_5] = [parse_user_uri(x['id'])
                                for x in arg_4.get(arg_5, [])]
    arg_4['parent_ident_hash'] = parse_parent_ident_hash(arg_1)

    # Assign the id and version if one is known.
    if arg_1.ident_hash is not None:
        arg_6, arg_7 = split_ident_hash(arg_1.ident_hash,
                                         split_version=True)
        arg_4['_uuid'] = arg_6
        arg_4['_major_version'], arg_4['_minor_version'] = arg_7
        # Lookup legacy ``moduleid``.
        arg_0.execute("SELECT moduleid FROM latest_modules WHERE uuid = %s",
                       (arg_6,))
        # There is the chance that a uuid and version have been set,
        #   but a previous publication does not exist. Therefore the
        #   moduleid will not be found. This happens on a pre-publication.
        try:
            arg_8 = arg_0.fetchone()[0]
        except TypeError:  # NoneType
            arg_8 = None
        arg_4['_moduleid'] = arg_8

        # Verify that uuid is reserved in document_contols. If not, add it.
        arg_0.execute("SELECT * from document_controls where uuid = %s",
                       (arg_6,))
        try:
            arg_0.fetchone()[0]
        except TypeError:  # NoneType
            arg_0.execute("INSERT INTO document_controls (uuid) VALUES (%s)",
                           (arg_6,))

        arg_9 = arg_1.metadata.get('created', None)
        # Format the statement to accept the identifiers.
        arg_10 = MODULE_INSERTION_TEMPLATE.format(**{
            '__uuid__': "%(_uuid)s::uuid",
            '__major_version__': "%(_major_version)s",
            '__minor_version__': "%(_minor_version)s",
            '__moduleid__': arg_8 is None and "DEFAULT" or "%(_moduleid)s",
            '__created__': arg_9 is None and "DEFAULT" or "%(created)s",
        })
    else:
        arg_9 = arg_1.metadata.get('created', None)
        # Format the statement for defaults.
        arg_10 = MODULE_INSERTION_TEMPLATE.format(**{
            '__uuid__': "DEFAULT",
            '__major_version__': "DEFAULT",
            '__minor_version__': "DEFAULT",
            '__moduleid__': "DEFAULT",
            '__created__': arg_9 is None and "DEFAULT" or "%(created)s",
        })

    # Insert the metadata
    arg_0.execute(arg_10, arg_4)
    arg_11, arg_12 = arg_0.fetchone()
    # Insert optional roles
    _insert_optional_roles(arg_0, arg_1, arg_11)

    return arg_11, arg_12


def Func(arg_0):
    """Return the SHA1 hash of the given a file-like object as ``file``.
    This will seek the file back to 0 when it's finished.

    """
    arg_1 = arg_0.read()
    arg_0.seek(0)
    arg_2 = hashlib.new('sha1', arg_1).hexdigest()
    return arg_2


def Func(arg_0, arg_1, arg_2):
    """Upsert the ``file`` and ``media_type`` into the files table.
    Returns the ``fileid`` and ``sha1`` of the upserted file.

    """
    arg_3 = _get_file_sha1(arg_1)
    arg_0.execute("SELECT fileid FROM files WHERE sha1 = %s",
                   (arg_3,))
    try:
        arg_4 = arg_0.fetchone()[0]
    except (IndexError, TypeError):
        arg_0.execute("INSERT INTO files (file, media_type) "
                       "VALUES (%s, %s)"
                       "RETURNING fileid",
                       (psycopg2.Binary(arg_1.read()), arg_2,))
        arg_4 = arg_0.fetchone()[0]
    return arg_4, arg_3


def Func(arg_0):
    """Lookup publication state"""
    arg_1 = arg_0.matchdict['id']
    arg_2, arg_3 = check_publication_state(arg_1)
    arg_4 = {
        'publication': arg_1,
        'state': arg_2,
        'messages': arg_3,
    }
    return arg_4


def Func(arg_0):
    """Configures the caching manager"""
    global arg_2
    arg_1 = arg_0.registry.settings
    arg_2 = CacheManager(**parse_cache_config_options(arg_1))


def Func(arg_0, arg_1, arg_2=arg_3):
        """
        Gets the value from the key.
        If the key doesn't exist, the default value is returned, otherwise None.

        :param key: The key
        :param default: The default value
        :return: The value
        """
        arg_4 = arg_0._data.Func(arg_1.lower())
        if arg_4 is not None:
            return arg_4[1]
        elif arg_2 is not arg_3:
            return arg_2
        else:
            return None


def Func(arg_0, arg_1=False, arg_2=False):
    """Iterate reversal points in the series.

    A reversal point is a point in the series at which the first derivative
    changes sign. Reversal is undefined at the first (last) point because the
    derivative before (after) this point is undefined. The first and the last
    points may be treated as Func by setting the optional parameters
    `left` and `right` to True.

    Parameters
    ----------
    series : iterable sequence of numbers
    left: bool, optional
        If True, yield the first point in the series (treat it as a reversal).
    right: bool, optional
        If True, yield the last point in the series (treat it as a reversal).

    Yields
    ------
    float
        Reversal points.
    """
    arg_0 = iter(arg_0)

    arg_3, arg_4 = next(arg_0), next(arg_0)
    arg_5 = (arg_4 - arg_3)

    if arg_1:
        yield arg_3
    for arg_6 in arg_0:
        if arg_6 == arg_4:
            continue
        arg_7 = arg_6 - arg_4
        if arg_5 * arg_7 < 0:
            yield arg_4
        arg_3, arg_4 = arg_4, arg_6
        arg_5 = arg_7
    if arg_2:
        yield arg_6


def Func(arg_0):
    "Decorator for extract_cycles"
    @functools.wraps(arg_0)
    def wrapper(*arg_1, **arg_2):
        for arg_3, arg_4, arg_5 in arg_0(*arg_1, **arg_2):
            if arg_3 < arg_4:
                yield arg_3, arg_4, arg_5
            else:
                yield arg_4, arg_3, arg_5
    return wrapper


def Func(arg_0, arg_1=False, arg_2=False):
    """Iterate cycles in the series.

    Parameters
    ----------
    series : iterable sequence of numbers
    left: bool, optional
        If True, treat the first point in the series as a reversal.
    right: bool, optional
        If True, treat the last point in the series as a reversal.

    Yields
    ------
    cycle : tuple
        Each tuple contains three floats (low, high, mult), where low and high
        define cycle amplitude and mult equals to 1.0 for full cycles and 0.5
        for half cycles.
    """
    arg_3 = deque()

    for arg_4 in reversals(arg_0, arg_1=arg_1, arg_2=arg_2):
        arg_3.append(arg_4)
        while len(arg_3) >= 3:
            # Form ranges X and Y from the three most recent points
            X = abs(arg_3[-2] - arg_3[-1])
            Y = abs(arg_3[-3] - arg_3[-2])

            if X < Y:
                # Read the next point
                break
            elif len(arg_3) == 3:
                # Y contains the starting point
                # Count Y as one-half cycle and discard the first point
                yield arg_3[0], arg_3[1], 0.5
                arg_3.popleft()
            else:
                # Count Y as one cycle and discard the peak and the valley of Y
                yield arg_3[-3], arg_3[-2], 1.0
                last = arg_3.pop()
                arg_3.pop()
                arg_3.pop()
                arg_3.append(last)
    else:
        # Count the remaining ranges as one-half cycles
        while len(arg_3) > 1:
            yield arg_3[0], arg_3[1], 0.5
            arg_3.popleft()


def Func(arg_0, arg_1=None, arg_2=False, arg_3=False):
    """Count cycles in the series.

    Parameters
    ----------
    series : iterable sequence of numbers
    ndigits : int, optional
        Round cycle magnitudes to the given number of digits before counting.
    left: bool, optional
        If True, treat the first point in the series as a reversal.
    right: bool, optional
        If True, treat the last point in the series as a reversal.

    Returns
    -------
    A sorted list containing pairs of cycle magnitude and count.
    One-half cycles are counted as 0.5, so the returned counts may not be
    whole numbers.
    """
    arg_4 = defaultdict(float)
    arg_5 = _get_round_function(arg_1)

    for arg_6, arg_7, arg_8 in extract_cycles(arg_0, arg_2=arg_2, arg_3=arg_3):
        arg_9 = arg_5(abs(arg_7 - arg_6))
        arg_4[arg_9] += arg_8
    return sorted(arg_4.items())


def Func(arg_0, arg_1=False):
    """Recipe to Func a given FST node.

    The FST is composed of branch nodes which are either lists or dicts
    and of leaf nodes which are strings. Branch nodes can have other
    list, dict or leaf nodes as childs.

    To Func a string, simply output it. To Func a list, Func each
    of its elements in order. To Func a dict, you must follow the
    node's entry in the nodes_Funcing_order dictionary and its
    dependents constraints.

    This function hides all this algorithmic complexity by returning
    a structured Funcing recipe, whatever the type of node. But even
    better, you should subclass the RenderWalker which simplifies
    drastically working with the Funced FST.

    The recipe is a list of steps, each step correspond to a child and is actually a 3-uple composed of the following fields:

    - `key_type` is a string determining the type of the child in the second field (`item`) of the tuple. It can be one of:

      - 'constant': the child is a string
      - 'node': the child is a dict
      - 'key': the child is an element of a dict
      - 'list': the child is a list
      - 'formatting': the child is a list specialized in formatting

    - `item` is the child itself: either a string, a dict or a list.
    - `Func_key` gives the key used to access this child from the parent node. It's a string if the node is a dict or a number if its a list.

    Please note that "bool" `key_types` are never Funced, that's why
    they are not shown here.
    """
    if isinstance(arg_0, list):
        return Func_list(arg_0)

    elif isinstance(arg_0, dict):
        return Func_node(arg_0, arg_1=arg_1)

    else:
        raise NotImplementedError("You tried to Func a %s. Only list and dicts can be Funced." % arg_0.__class__.__name__)


def Func(arg_0, arg_1):
    """FST node located at the given path"""
    if arg_1 is None:
        return None

    arg_2 = arg_0

    for arg_3 in arg_1:
        arg_2 = child_by_key(arg_2, arg_3)

    return arg_2


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of all enrollments for the passed course_id.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.index
        """
        arg_3 = COURSES_API.format(arg_1) + "/enrollments"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasEnrollment(data=arg_5))

        return arg_4


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
        """
        Enroll a user into a course.

        https://canvas.instructure.com/doc/api/enrollments.html#method.enrollments_api.create
        """
        arg_5 = COURSES_API.format(arg_1) + "/enrollments"

        if not arg_4:
            arg_4 = {}

        arg_4["user_id"] = arg_2
        arg_4["type"] = arg_3

        arg_6 = arg_0._post_resource(arg_5, {"enrollment": arg_4})
        return CanvasEnrollment(arg_6=arg_6)


def Func(arg_0, arg_1, arg_2):
        """
        Get information about a single role, for the passed Canvas account ID.

        https://canvas.instructure.com/doc/api/roles.html#method.role_overrides.show
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/roles/{}".format(arg_2)
        return CanvasRole(data=arg_0._get_resource(arg_3))


def Func(arg_0, arg_1, arg_2={}):
        """
        Return course resource for given canvas course id.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.show
        """
        arg_3 = arg_2.get("include", [])
        if "term" not in arg_3:
            arg_3.append("term")
        arg_2["include"] = arg_3

        arg_4 = COURSES_API.format(arg_1)
        return CanvasCourse(data=arg_0._get_resource(arg_4, arg_2=arg_2))


def Func(arg_0, arg_1, arg_2={}):
        """
        Returns a list of courses for the passed account ID.

        https://canvas.instructure.com/doc/api/accounts.html#method.accounts.courses_api
        """
        if "published" in arg_2:
            arg_2["published"] = "true" if arg_2["published"] else ""

        arg_3 = ACCOUNTS_API.format(arg_1) + "/courses"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasCourse(arg_5=arg_5))
        return arg_4


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of courses for the passed account SIS ID.
        """
        return arg_0.get_courses_in_account(
            arg_0._sis_id(arg_1, sis_field="account"), arg_2)


def Func(arg_0, arg_1,
                                                   arg_2={}):
        """
        Return a list of published courses for the passed account SIS ID.
        """

        return arg_0.get_published_courses_in_account(
            arg_0._sis_id(arg_1, sis_field="account"), arg_2)


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of courses for the passed regid.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.index
        """
        arg_0._as_user = arg_1
        arg_4 = arg_0._get_resource("/api/v1/courses", arg_2=arg_2)
        arg_0._as_user = None

        arg_5 = []
        for arg_6 in arg_4:
            if "sis_course_id" in arg_6:
                arg_5.append(CanvasCourse(arg_4=arg_6))
            else:
                arg_5.append(arg_0.get_course(arg_6["id"], arg_2))

        return arg_5


def Func(arg_0, arg_1, arg_2):
        """
        Updates the SIS ID for the course identified by the passed course ID.

        https://canvas.instructure.com/doc/api/courses.html#method.courses.update
        """
        arg_3 = COURSES_API.format(arg_1)
        arg_4 = {"course": {"sis_course_id": arg_2}}
        return CanvasCourse(data=arg_0._put_resource(arg_3, arg_4))


def Func(arg_0, arg_1, arg_2):
        """
        Returns statistics for the given account_id and term_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.department_statistics
        """
        arg_3 = ("/api/v1/accounts/sis_account_id:%s/analytics/"
               "terms/sis_term_id:%s/statistics.json") % (arg_1, arg_2)
        return arg_0._get_resource(arg_3)


def Func(arg_0, arg_1):
        """
        Returns per-student data for the given course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.course_student_summaries
        """
        arg_2 = "/api/v1/courses/%s/analytics/student_summaries.json" % (
            arg_0._sis_id(arg_1, sis_field="course"))
        return arg_0._get_resource(arg_2)


def Func(
            arg_0, arg_1, arg_2):
        """
        Returns student activity data for the given user_id and course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.student_in_course_participation
        """
        arg_3 = ("/api/v1/courses/%s/analytics/users/"
               "sis_user_id:%s/activity.json") % (
            arg_0._sis_id(arg_2, sis_field="course"), arg_1)
        return arg_0._get_resource(arg_3)


def Func(
            arg_0, arg_1, arg_2):
        """
        Returns student messaging data for the given user_id and course_id.

        https://canvas.instructure.com/doc/api/analytics.html#method.analytics_api.student_in_course_messaging
        """
        arg_3 = ("/api/v1/courses/%s/analytics/"
               "users/sis_user_id:%s/communication.json") % (
            arg_0._sis_id(arg_2, sis_field="course"), arg_1)
        return arg_0._get_resource(arg_3)


def Func(arg_0, arg_1):
    """
    Adds multicodec prefix to the given bytes input

    :param str multicodec: multicodec to use for prefixing
    :param bytes bytes_: data to prefix
    :return: prefixed byte data
    :rtype: bytes
    """
    arg_2 = get_prefix(arg_0)
    return b''.join([arg_2, arg_1])


def Func(arg_0):
    """
    Gets the codec used for prefix the multicodec prefixed data

    :param bytes bytes_: multicodec prefixed data bytes
    :return: name of the multicodec used to prefix
    :rtype: str
    """
    arg_1 = extract_prefix(arg_0)
    try:
        return CODE_TABLE[arg_1]
    except KeyError:
        raise ValueError('Prefix {} not present in the lookup table'.format(arg_1))


def Func(arg_0, arg_1, arg_2={}):
        """
        Return external tools for the passed canvas account id.

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/external_tools"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(arg_5)
        return arg_4


def Func(arg_0, arg_1, arg_2={}):
        """
        Return external tools for the passed canvas course id.

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.index
        """
        arg_3 = COURSES_API.format(arg_1) + "/external_tools"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(arg_5)
        return arg_4


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create an external tool using the passed json_data.

        context is either COURSES_API or ACCOUNTS_API.
        context_id is the Canvas course_id or account_id, depending on context.

        https://canvas.instructure.com/doc/api/external_tools.html#method.external_tools.create
        """
        arg_4 = arg_1.format(arg_2) + "/external_tools"
        return arg_0._post_resource(arg_4, body=arg_3)


def Func(arg_0, arg_1):
    """
    Check if a parameter is available on an object

    :param obj: Object
    :param required_parameters: list of parameters
    :return:
    """
    for arg_2 in arg_1:
        if not hasattr(arg_0, arg_2) or getattr(arg_0, arg_2) is None:
            raise DesignError("parameter '%s' must be set for '%s' object." % (arg_2, arg_0.base_type))


def Func(arg_0, arg_1):
        """
        Returns user profile data.

        https://canvas.instructure.com/doc/api/users.html#method.profile.settings
        """
        arg_2 = USERS_API.format(arg_1) + "/profile"
        return CanvasUser(data=arg_0._get_resource(arg_2))


def Func(arg_0, arg_1, arg_2={}):
        """
        Returns a list of users for the given sis course id.
        """
        return arg_0.get_users_for_course(
            arg_0._sis_id(arg_1, sis_field="course"), arg_2)


def Func(arg_0, arg_1, arg_2=None):
        """
        Create and return a new user and pseudonym for an account.

        https://canvas.instructure.com/doc/api/users.html#method.users.create
        """
        if arg_2 is None:
            arg_2 = arg_0._canvas_account_id
            if arg_2 is None:
                raise MissingAccountID()

        arg_3 = ACCOUNTS_API.format(arg_2) + "/users"

        arg_4 = arg_0._post_resource(arg_3, arg_1.post_data())
        return CanvasUser(arg_4=arg_4)


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a user's logins for the given user_id.

        https://canvas.instructure.com/doc/api/logins.html#method.pseudonyms.index
        """
        arg_3 = USERS_API.format(arg_1) + "/logins"

        arg_4 = arg_0._get_paged_resource(arg_3, arg_2=arg_2)

        arg_5 = []
        for arg_6 in arg_4:
            arg_5.append(Login(arg_4=arg_6))

        return arg_5


def Func(arg_0, arg_1, arg_2=None):
        """
        Update an existing login for a user in the given account.

        https://canvas.instructure.com/doc/api/logins.html#method.pseudonyms.update
        """
        if arg_2 is None:
            arg_2 = arg_0._canvas_account_id
            if arg_2 is None:
                raise MissingAccountID

        arg_3 = arg_1.login_id
        arg_4 = ACCOUNTS_API.format(arg_2) + "/logins/{}".format(arg_3)

        arg_5 = arg_0._put_resource(arg_4, arg_1.put_data())
        return Login(arg_5=arg_5)


def Func(arg_0, arg_1):
        """
        return url path to next page of paginated data
        """
        for arg_2 in arg_1.getheader("link", "").split(","):
            try:
                (arg_3, arg_4) = arg_2.split(";")
                if "next" in arg_4:
                    return arg_3.lstrip("<").rstrip(">")
            except Exception:
                return


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Canvas GET method on a full url. Return representation of the
        requested resource, chasing pagination links to coalesce resources
        if indicated.
        """
        arg_4 = {'Accept': 'application/json',
                   'Connection': 'keep-alive'}
        arg_5 = DAO.getURL(arg_1, arg_4)

        if arg_5.status != 200:
            raise DataFailureException(arg_1, arg_5.status, arg_5.data)

        arg_6 = json.loads(arg_5.data)

        arg_0.next_page_url = arg_0._next_page(arg_5)
        if arg_2 and arg_0.next_page_url:
            if isinstance(arg_6, list):
                arg_6.extend(arg_0.Func(arg_0.next_page_url, True,
                                                   arg_3))
            elif isinstance(arg_6, dict) and arg_3 is not None:
                arg_6[arg_3].extend(arg_0.Func(
                    arg_0.next_page_url, True, arg_3)[arg_3])

        return arg_6


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Canvas GET method. Return representation of the requested paged
        resource, either the requested page, or chase pagination links to
        coalesce resources.
        """
        if not arg_2:
            arg_2 = {}

        arg_0._set_as_user(arg_2)

        arg_4 = not ('page' in arg_2 or 'per_page' in arg_2)

        if 'per_page' not in arg_2 and arg_0._per_page != DEFAULT_PAGINATION:
            arg_2["per_page"] = arg_0._per_page

        arg_5 = arg_1 + arg_0._params(arg_2)
        return arg_0._get_resource_url(arg_5, arg_4, arg_3)


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """
        Canvas GET method. Return representation of the requested resource.
        """
        if not arg_2:
            arg_2 = {}

        arg_0._set_as_user(arg_2)

        arg_4 = arg_1 + arg_0._params(arg_2)

        return arg_0.Func_url(arg_4, True, arg_3)


def Func(arg_0, arg_1, arg_2):
        """
        Canvas PUT method.
        """
        arg_3 = {}
        arg_0._set_as_user(arg_3)
        arg_4 = {'Content-Type': 'application/json',
                   'Accept': 'application/json',
                   'Connection': 'keep-alive'}
        arg_1 = arg_1 + arg_0._params(arg_3)
        arg_5 = DAO.putURL(arg_1, arg_4, json.dumps(arg_2))

        if not (arg_5.status == 200 or arg_5.status == 201 or
                arg_5.status == 204):
            raise DataFailureException(arg_1, arg_5.status, arg_5.data)

        return json.loads(arg_5.data)


def Func(arg_0, arg_1, arg_2):
        """
        Canvas POST method.
        """
        arg_3 = {}
        arg_0._set_as_user(arg_3)
        arg_4 = {'Content-Type': 'application/json',
                   'Accept': 'application/json',
                   'Connection': 'keep-alive'}
        arg_1 = arg_1 + arg_0._params(arg_3)
        arg_5 = DAO.postURL(arg_1, arg_4, json.dumps(arg_2))

        if not (arg_5.status == 200 or arg_5.status == 204):
            raise DataFailureException(arg_1, arg_5.status, arg_5.data)

        return json.loads(arg_5.data)


def Func(arg_0, arg_1):
        """
        Canvas DELETE method.
        """
        arg_2 = {}
        arg_0._set_as_user(arg_2)
        arg_3 = {'Accept': 'application/json',
                   'Connection': 'keep-alive'}
        arg_1 = arg_1 + arg_0._params(arg_2)
        arg_4 = DAO.deleteURL(arg_1, arg_3)

        if not (arg_4.status == 200 or arg_4.status == 204):
            raise DataFailureException(arg_1, arg_4.status, arg_4.data)

        return arg_4


def Func(arg_0, arg_1, arg_2={}):
        """
        Return a list of the admins in the account.

        https://canvas.instructure.com/doc/api/admins.html#method.admins.index
        """
        arg_3 = ADMINS_API.format(arg_1)

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasAdmin(arg_5=arg_5))
        return arg_4


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Flag an existing user as an admin within the account.

        https://canvas.instructure.com/doc/api/admins.html#method.admins.create
        """
        arg_4 = ADMINS_API.format(arg_1)
        arg_5 = {"user_id": unquote(str(arg_2)),
                "role": arg_3,
                "send_confirmation": False}

        return CanvasAdmin(data=arg_0._post_resource(arg_4, arg_5))


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Flag an existing user as an admin within the account sis id.
        """
        return arg_0.create_admin(arg_0._sis_id(arg_1), arg_2, arg_3)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Remove an account admin role from a user.

        https://canvas.instructure.com/doc/api/admins.html#method.admins.destroy
        """
        arg_4 = ADMINS_API.format(arg_1) + "/{}?role={}".format(
            arg_2, quote(arg_3))

        arg_5 = arg_0._delete_resource(arg_4)
        return True


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Remove an account admin role from a user for the account sis id.
        """
        return arg_0.delete_admin(arg_0._sis_id(arg_1), arg_2, arg_3)


def Func(arg_0, arg_1, arg_2,
                                           arg_3, arg_4):
        """
        Create a new grading standard for the passed course.

        https://canvas.instructure.com/doc/api/grading_standards.html#method.grading_standards_api.create
        """
        arg_5 = COURSES_API.format(arg_1) + "/grading_standards"
        arg_6 = {
            "title": arg_2,
            "grading_scheme_entry": arg_3,
            "as_user_id": arg_4
        }

        return GradingStandard(data=arg_0._post_resource(arg_5, arg_6))


def Func(arg_0, arg_1, arg_2={}):
        """
        Return section resource for given canvas section id.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.show
        """
        arg_3 = SECTIONS_API.format(arg_1)
        return CanvasSection(data=arg_0._get_resource(arg_3, arg_2=arg_2))


def Func(arg_0, arg_1, arg_2={}):
        """
        Return list of sections for the passed course ID.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.index
        """
        arg_3 = COURSES_API.format(arg_1) + "/sections"

        arg_4 = []
        for arg_5 in arg_0._get_paged_resource(arg_3, arg_2=arg_2):
            arg_4.append(CanvasSection(arg_5=arg_5))

        return arg_4


def Func(arg_0, arg_1, arg_2={}):
        """
        Return list of sections including students for the passed course ID.
        """
        arg_3 = arg_2.get("include", [])
        if "students" not in arg_3:
            arg_3.append("students")
        arg_2["include"] = arg_3

        return arg_0.get_sections_in_course(arg_1, arg_2)


def Func(arg_0, arg_1,
                                                       arg_2={}):
        """
        Return list of sections including students for the passed sis ID.
        """
        return arg_0.get_sections_with_students_in_course(
            arg_0._sis_id(arg_1, sis_field="course"), arg_2)


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Create a canvas section in the given course id.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.create
        """
        arg_4 = COURSES_API.format(arg_1) + "/sections"
        arg_5 = {"course_section": {"name": arg_2,
                                   "sis_section_id": arg_3}}

        return CanvasSection(data=arg_0._post_resource(arg_4, arg_5))


def Func(arg_0, arg_1, arg_2, arg_3):
        """
        Update a canvas section with the given section id.

        https://canvas.instructure.com/doc/api/sections.html#method.sections.update
        """
        arg_4 = SECTIONS_API.format(arg_1)
        arg_5 = {"course_section": {}}

        if arg_2:
            arg_5["course_section"]["name"] = arg_2

        if arg_3:
            arg_5["course_section"]["sis_section_id"] = arg_3

        return CanvasSection(data=arg_0._put_resource(arg_4, arg_5))


def Func(arg_0, arg_1):
        """
        List quizzes for a given course

        https://canvas.instructure.com/doc/api/quizzes.html#method.quizzes_api.index
        """
        arg_2 = QUIZZES_API.format(arg_1)
        arg_3 = arg_0._get_resource(arg_2)
        arg_4 = []
        for arg_5 in arg_3:
            arg_4.append(Quiz(arg_3=arg_5))
        return arg_4


def Func(arg_0, arg_1):
        """
        Update the passed account. Returns the updated account.

        https://canvas.instructure.com/doc/api/accounts.html#method.accounts.update
        """
        arg_2 = ACCOUNTS_API.format(arg_1.account_id)
        arg_3 = {"account": {"name": arg_1.name}}

        return CanvasAccount(data=arg_0._put_resource(arg_2, arg_3))


def Func(arg_0, arg_1):
        """
        Return the authentication settings for the passed account_id.

        https://canvas.instructure.com/doc/api/authentication_providers.html#method.account_authorization_configs.show_sso_settings
        """
        arg_2 = ACCOUNTS_API.format(arg_1) + "/sso_settings"
        return CanvasSSOSettings(data=arg_0._get_resource(arg_2))


def Func(arg_0, arg_1, arg_2):
        """
        Update the authentication settings for the passed account_id.

        https://canvas.instructure.com/doc/api/authentication_providers.html#method.account_authorization_configs.update_sso_settings
        """
        arg_3 = ACCOUNTS_API.format(arg_1) + "/sso_settings"
        arg_4 = arg_0._put_resource(arg_3, arg_2.json_data())
        return CanvasSSOSettings(arg_4=arg_4)


def Func(arg_0, arg_1, arg_2={}):
        """
        Imports a CSV string.

        https://canvas.instructure.com/doc/api/sis_imports.html#method.sis_imports_api.create
        """
        if not arg_0._canvas_account_id:
            raise MissingAccountID()

        arg_2["import_type"] = SISImportModel.CSV_IMPORT_TYPE
        arg_3 = SIS_IMPORTS_API.format(
            arg_0._canvas_account_id) + ".json{}".format(arg_0._params(arg_2))
        arg_4 = {"Content-Type": "text/csv"}

        return SISImportModel(data=arg_0._post_resource(arg_3, arg_4, arg_1))


def Func(arg_0, arg_1, arg_2={}):
        """
        Imports a directory of CSV files.

        https://canvas.instructure.com/doc/api/sis_imports.html#method.sis_imports_api.create
        """
        if not arg_0._canvas_account_id:
            raise MissingAccountID()

        arg_3 = arg_0._build_archive(arg_1)
        arg_2["import_type"] = SISImportModel.CSV_IMPORT_TYPE
        arg_4 = SIS_IMPORTS_API.format(
            arg_0._canvas_account_id) + ".json{}".format(arg_0._params(arg_2))
        arg_5 = {"Content-Type": "application/zip"}

        return SISImportModel(data=arg_0._post_resource(arg_4, arg_5, arg_3))


def Func(arg_0, arg_1):
        """
        Get the status of an already created SIS import.

        https://canvas.instructure.com/doc/api/sis_imports.html#method.sis_imports_api.show
        """
        if not arg_0._canvas_account_id:
            raise MissingAccountID()

        arg_2 = SIS_IMPORTS_API.format(
            arg_0._canvas_account_id) + "/{}.json".format(arg_1.import_id)

        return SISImportModel(data=arg_0._get_resource(arg_2))


def Func(arg_0, arg_1):
        """
        List assignments for a given course

        https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.index
        """
        arg_2 = ASSIGNMENTS_API.format(arg_1)
        arg_3 = arg_0._get_resource(arg_2)
        arg_4 = []
        for arg_5 in arg_3:
            arg_4.append(Assignment(arg_3=arg_5))
        return arg_4


def Func(arg_0, arg_1):
        """
        Modify an existing assignment.

        https://canvas.instructure.com/doc/api/assignments.html#method.assignments_api.update
        """
        arg_2 = ASSIGNMENTS_API.format(arg_1.course_id) + "/{}".format(
            arg_1.assignment_id)

        arg_3 = arg_0._put_resource(arg_2, arg_1.json_data())
        return Assignment(arg_3=arg_3)


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

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

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

        return arg_4


def Func(arg_0, arg_1, arg_2=None,
                                          arg_3={}):
        """
        Convenience method for create_report, for creating a course
        provisioning report.
        """
        arg_3["courses"] = True
        return arg_0.create_report(ReportType.PROVISIONING, arg_1, arg_2,
                                  arg_3)


def Func(arg_0, arg_1, arg_2=None):
        """
        Convenience method for create_report, for creating an unused courses
        report.
        """
        return arg_0.create_report(ReportType.UNUSED_COURSES, arg_1,
                                  arg_2)


def Func(arg_0, arg_1):
        """
        Returns a completed report as a list of csv strings.
        """
        if arg_1.report_id is None or arg_1.status is None:
            raise ReportFailureException(arg_1)

        arg_2 = getattr(settings, 'CANVAS_REPORT_POLLING_INTERVAL', 5)
        while arg_1.status != "complete":
            if arg_1.status == "error":
                raise ReportFailureException(arg_1)
            sleep(arg_2)
            arg_1 = arg_0.get_report_status(arg_1)

        if arg_1.attachment is None or arg_1.attachment.url is None:
            return

        arg_3 = arg_0._get_report_file(arg_1.attachment.url)

        return arg_3.split("\n")


def Func(arg_0, arg_1):
        """
        Returns the status of a report.

        https://canvas.instructure.com/doc/api/account_reports.html#method.account_reports.show
        """
        if (arg_1.account_id is None or arg_1.type is None or
                arg_1.report_id is None):
            raise ReportFailureException(arg_1)

        arg_2 = ACCOUNTS_API.format(arg_1.account_id) + "/reports/{}/{}".format(
            arg_1.type, arg_1.report_id)

        arg_3 = arg_0._get_resource(arg_2)
        arg_3["account_id"] = arg_1.account_id
        return Report(arg_3=arg_3)


def Func(arg_0, arg_1):
        """
        Deletes a generated report instance.

        https://canvas.instructure.com/doc/api/account_reports.html#method.account_reports.destroy
        """
        arg_2 = ACCOUNTS_API.format(arg_1.account_id) + "/reports/{}/{}".format(
            arg_1.type, arg_1.report_id)

        arg_3 = arg_0._delete_resource(arg_2)
        return True


def Func(arg_0, arg_1):
    """
    Horizontally flip detections according to an image flip.

    :param label: The label dict containing all detection lists.
    :param w: The width of the image as a number.
    :return:
    """
    for arg_2 in arg_0.keys():
        if arg_2.startswith("detection"):
            arg_3 = arg_0[arg_2]
            for arg_4 in arg_3:
                arg_4.cx = arg_1 - arg_4.cx
                if arg_2 == "detections_2.5d":
                    arg_4.theta = math.pi - arg_4.theta


def Func(
    arg_0,
    arg_1="archiveis (https://github.com/pastpages/archiveis)",
    arg_2={}
):
    """
    Archives the provided URL using archive.is

    Returns the URL where the Func is stored.
    """
    # Put together the URL that will save our request
    arg_3 = "http://archive.vn"
    arg_4 = urljoin(arg_3, "/submit/")

    # Configure the request headers
    arg_5 = {
        'User-Agent': arg_1,
        "host": "archive.vn",
    }

    # Request a unique identifier for our activity
    logger.debug("Requesting {}".format(arg_3 + "/"))
    arg_6 = dict(
        timeout=120,
        allow_redirects=True,
        arg_5=arg_5,
    )
    if arg_2:
        arg_6['proxies'] = arg_2
    arg_7 = requests.get(arg_3 + "/", **arg_6)
    arg_7.raise_for_status()

    # It will need to be parsed from the homepage response headers
    arg_8 = str(arg_7.content)
    try:
        arg_9 = arg_8.split('name="submitid', 1)[1].split('value="', 1)[1].split('"', 1)[0]
        logger.debug("Unique identifier: {}".format(arg_9))
    except IndexError:
        logger.warn("Unable to extract unique identifier from archive.is. Submitting without it.")
        arg_9 = None

    # Send the Func request to archive.is with the unique id included
    arg_10 = {
        "url": arg_0,
        "anyway": 1,
    }
    if arg_9:
        arg_10.update({"submitid": arg_9})

    arg_11 = dict(
        timeout=120,
        allow_redirects=True,
        arg_5=arg_5,
        arg_10=arg_10
    )
    if arg_2:
        arg_11['proxies'] = arg_2

    logger.debug("Requesting {}".format(arg_4))
    arg_7 = requests.post(arg_4, **arg_11)
    arg_7.raise_for_status()

    # There are a couple ways the header can come back
    if 'Refresh' in arg_7.headers:
        arg_12 = str(arg_7.headers['Refresh']).split(';url=')[1]
        logger.debug("Memento from Refresh header: {}".format(arg_12))
        return arg_12
    if 'Location' in arg_7.headers:
        arg_12 = arg_7.headers['Location']
        logger.debug("Memento from Location header: {}".format(arg_12))
        return arg_12
    logger.debug("Memento not found in response headers. Inspecting history.")
    for arg_13, arg_14 in enumerate(arg_7.history):
        logger.debug("Inspecting history request #{}".format(arg_13))
        logger.debug(arg_14.headers)
        if 'Location' in arg_14.headers:
            arg_12 = arg_14.headers['Location']
            logger.debug("Memento from the Location header of {} history response: {}".format(arg_13+1, arg_12))
            return arg_12
    # If there's nothing at this point, throw an error
    logger.error("No memento returned by archive.is")
    logger.error("Status code: {}".format(arg_7.status_code))
    logger.error(arg_7.headers)
    logger.error(arg_7.text)
    raise Exception("No memento returned by archive.is")


def Func(arg_0, arg_1):
    """
    Archives the provided URL using archive.is.
    """
    arg_2 = {}
    if arg_1:
        arg_2['user_agent'] = arg_1
    arg_3 = capture(arg_0, **arg_2)
    Funcck.echo(arg_3)


def Func(arg_0, arg_1, arg_2=300, arg_3=False):
        """Get the logo for a channel"""
        from bs4 import BeautifulSoup
        from wikipedia.exceptions import PageError
        import re
        import wikipedia
        wikipedia.set_lang('fr')

        if not arg_1:
            _LOGGER.error('Channel is not set. Could not retrieve image.')
            return

        # Check if the image is in cache
        if arg_1 in arg_0._cache_channel_img and not arg_3:
            arg_4 = arg_0._cache_channel_img[arg_1]
            _LOGGER.debug('Cache hit: %s -> %s', arg_1, arg_4)
            return arg_4

        arg_5 = arg_0.get_channel_info(arg_1)
        arg_6 = arg_5['wiki_page']
        if not arg_6:
            _LOGGER.debug('Wiki page is not set for channel %s', arg_1)
            return
        _LOGGER.debug('Query: %s', arg_6)
        # If there is a max image size defined use it.
        if 'max_img_size' in arg_5:
            if arg_2 > arg_5['max_img_size']:
                _LOGGER.info(
                    'Requested image size is bigger than the max, '
                    'setting it to %s', arg_5['max_img_size']
                )
                arg_2 = arg_5['max_img_size']
        try:
            arg_7 = wikipedia.page(arg_6)
            _LOGGER.debug('Wikipedia article title: %s', arg_7.title)
            arg_8 = BeautifulSoup(arg_7.html(), 'html.parser')
            arg_9 = arg_8.find_all('img')
            arg_10 = None
            for arg_11 in arg_9:
                if arg_11['alt'].startswith('Image illustrative'):
                    arg_10 = re.sub(r'\d+px', '{}px'.format(arg_2),
                                     arg_11['src'])
            arg_4 = 'https:{}'.format(arg_10) if arg_10 else None
            # Cache result
            arg_0._cache_channel_img[arg_1] = arg_4
            return arg_4
        except PageError:
            _LOGGER.error('Could not fetch channel image for %s', arg_1)


def Func(arg_0):
    '''
    Edit to get the dict even when the object is a GenericRelatedObjectManager.
    Added the try except.
    '''
    arg_1 = arg_0.__dict__
    arg_2 = arg_1.copy()
    for arg_3, arg_4 in arg_1.items():
        if arg_3.endswith('_id'):
            arg_5 = arg_3.replace('_id', '')
            try:
                arg_6, arg_7, arg_8, arg_9 = arg_0._meta.get_field_by_name(arg_5)
                if isinstance(arg_6, ForeignKey):
                    arg_2[arg_5] = arg_2[arg_3]
                    del arg_2[arg_3]
            except FieldDoesNotExist:
                pass
    arg_10 = arg_0._meta.many_to_many
    for arg_11 in arg_10:
        arg_12 = [obj_rel.pk for obj_rel in arg_11.value_from_object(arg_0).select_related()]
        if arg_12:
            arg_2[arg_11.name] = arg_12
    return arg_2


def Func(arg_0):
        '''
        Get the text to display when the field is empty.
        '''
        arg_1 = arg_0.config.get('edit_Func', False)
        if arg_1:
            return arg_1
        else:
            return unicode(inplace_settings.INPLACEEDIT_EDIT_EMPTY_VALUE)


def Func(arg_0, arg_1):
    """
    Parse uniformly args and kwargs from a templatetag

    Usage::

      For parsing a template like this:

      {% footag my_contents,height=10,zoom=20 as myvar %}

      You simply do this:

      @register.tag
      def footag(parser, token):
          args, kwargs = Func(parser, token)
    """
    arg_2 = arg_1.contents.split(' ')

    if len(arg_2) <= 1:
        raise template.TemplateSyntaxError("'%s' takes at least one argument" % arg_2[0])

    if arg_1.contents[13] == '"':
        arg_3 = arg_1.contents.index('"', 14) + 1
        arg_4 = [template.Variable(arg_1.contents[13:arg_3])]
        arg_5 = arg_3
    else:
        try:
            arg_6 = arg_1.contents.index(' ', 14)
            arg_5 = arg_6 + 1
        except ValueError:
            arg_6 = None
            arg_5 = None
        arg_4 = [template.Variable(arg_1.contents[13:arg_6])]

    arg_7 = {}
    arg_8 = arg_1.contents[arg_5:].split(',')
    for arg_9 in arg_8:
        if '=' in arg_9:
            arg_10, arg_11 = arg_9.split('=', 1)
            arg_10 = arg_10.strip()
            arg_7[arg_10] = template.Variable(arg_11)
    return arg_4, arg_7


def Func(
            arg_0, arg_1: arg_2[arg_3]) -> Dict[str, Metric]:
        """Create and register metrics from a list of MetricConfigs."""
        return arg_0.registry.Func(arg_1)


def Func(arg_0,
                       arg_1: arg_2[arg_3]) -> Dict[str, Metric]:
        """Create Prometheus metrics from a list of MetricConfigs."""
        arg_4: Dict[str, Metric] = {
            config.name: arg_0._register_metric(config)
            for config in arg_1
        }
        arg_0._metrics.update(arg_4)
        return arg_4


def Func(
            arg_0, arg_1: arg_2,
            arg_3: arg_4[arg_5[arg_2, arg_2], None] = None) -> Metric:
        """Return a metric, optionally configured with labels."""
        arg_6 = arg_0._metrics[arg_1]
        if arg_3:
            return arg_6.labels(**arg_3)

        return arg_6


async def Func(arg_0, arg_1: arg_2) -> Response:
        """Home page request handler."""
        if arg_0.description:
            arg_3 = f'{self.name} - {self.description}'
        else:
            arg_3 = arg_0.name

        arg_4 = dedent(
            f'''<!DOCTYPE html>

                <title>{title}</title>

{title}

                  Metric are exported at the
                  /metrics endpoint.

            ''')
        return Response(content_type='text/html', arg_4=arg_4)


async def Func(arg_0, arg_1: arg_2) -> Response:
        """Handler for metrics."""
        if arg_0._update_handler:
            await arg_0._update_handler(arg_0.registry.get_metrics())
        arg_3 = Response(body=arg_0.registry.generate_metrics())
        arg_3.content_type = CONTENT_TYPE_LATEST
        return arg_3


def Func(arg_0, arg_1):
        r'~"|~\''
        if arg_1.value[1] == '"':
            arg_1.lexer.push_state('escapequotes')
        elif arg_1.value[1] == '\'':
            arg_1.lexer.push_state('escapeapostrophe')
        return arg_1


def Func(arg_0, arg_1):
        r'[^\'@]+'
        arg_1.lexer.lineno += arg_1.value.count('\n')
        return arg_1


def Func(arg_0, arg_1):
        """
        Lex Func.
        """
        with open(arg_1) as f:
            arg_0.lexer.input(f.read())
        return arg_0


def Func(arg_0, arg_1):
        """Inner wrapper to search for mixins by name.
        """
        return (arg_0._mixins[arg_1] if arg_1 in arg_0._mixins else False)


def Func(arg_0, arg_1):
        """Inner wrapper to search for blocks by name.
        """
        arg_2 = len(arg_0)
        while arg_2 >= 0:
            arg_2 -= 1
            if arg_1 in arg_0[arg_2]['__names__']:
                for arg_3 in arg_0[arg_2]['_Func__']:
                    arg_4 = arg_3.raw()
                    if arg_4 and arg_4 == arg_1:
                        return arg_3
            else:
                for arg_3 in arg_0[arg_2]['_Func__']:
                    arg_4 = arg_3.raw()
                    if arg_4 and arg_1.startswith(arg_4):
                        arg_3 = utility.blocksearch(arg_3, arg_1)
                        if arg_3:
                            return arg_3
        return False


def Func(arg_0, arg_1=0):
    """Round half-way away from zero.

    Python2's round() method.
    """
    if sys.version_info[0] >= 3:
        arg_2 = 10**arg_1
        return float(math.floor((arg_0 * arg_2) + math.copysign(0.5, arg_0))) / arg_2
    else:
        return round(arg_0, arg_1)


def Func(arg_0, arg_1=0):
    """Convergent rounding.

    Round to neareas even, similar to Python3's round() method.
    """
    if sys.version_info[0] < 3:
        if arg_0 < 0.0:
            return -Func(-arg_0)

        arg_2 = 0.0000001
        arg_3, arg_4 = divmod(arg_0, 1)

        if abs(arg_0 - (arg_3 + 0.5)) < arg_2:
            if arg_3 % 2.0 < arg_2:
                return arg_3
            else:
                arg_5 = arg_3 + 0.5
                return math.ceil(arg_5)
    return round(arg_0, arg_1)


def Func(arg_0, arg_1=None):
    """Return successive r length permutations of elements in the iterable.

    Similar to itertools.permutation but withouth repeated values filtering.
    """
    arg_2 = tuple(arg_0)
    arg_3 = len(arg_2)
    arg_1 = arg_3 if arg_1 is None else arg_1
    for arg_4 in itertools.product(range(arg_3), repeat=arg_1):
        yield list(arg_2[arg_5] for arg_5 in arg_4)


def Func(arg_0, arg_1, arg_2=(), **arg_3):
        """
        Query Wolfram|Alpha using the v2.0 API

        Allows for arbitrary parameters to be passed in
        the query. For example, to pass assumptions:

            client.query(input='pi', assumption='*C.pi-_*NamedConstant-')

        To pass multiple assumptions, pass multiple items
        as params:

            params = (
                ('assumption', '*C.pi-_*NamedConstant-'),
                ('assumption', 'DateOrder_**Day.Month.Year--'),
            )
            client.query(input='pi', params=params)

        For more details on Assumptions, see
        https://products.wolframalpha.com/api/documentation.html#6
        """
        arg_4 = dict(
            arg_1=arg_1,
            appid=arg_0.app_id,
        )
        arg_4 = itertools.chain(arg_2, arg_4.items(), arg_3.items())

        Func = urllib.parse.urlencode(tuple(arg_4))
        arg_6 = 'https://api.wolframalpha.com/v2/query?' + Func
        arg_7 = urllib.request.urlopen(arg_6)
        assert arg_7.headers.get_content_type() == 'text/xml'
        assert arg_7.headers.get_param('charset') == 'utf-8'
        return Result(arg_7)


def Func(arg_0):
        """
        The pods, assumptions, and warnings of this result.
        """
        return itertools.chain(arg_0.pods, arg_0.assumptions, arg_0.warnings)