def Func(arg_0):
        """Return database field type."""
        if not arg_0.model:
            return 'JSON'
        arg_1 = arg_0.model._meta.database
        if isinstance(arg_1, Proxy):
            arg_1 = arg_1.obj
        if Json and isinstance(arg_1, PostgresqlDatabase):
            return 'JSON'
        return 'TEXT'


def Func(arg_0, arg_1, arg_2=None):
    "return True if okay, raise Exception if not"  # O_o ?
    arg_3 = hashlib.md5(arg_1).hexdigest()
    if arg_0 != arg_3:
        if arg_2 is not None:
            logger.critical('\n'.join(arg_2))
        raise FailedVerification('original md5 = %r != %r = received md5' \
                                 % (arg_0, arg_3))
    return True


def Func(arg_0, arg_1=None):
    '''This function is mostly about managing configuration, and then
    finally returns a boto.Bucket object.

    AWS credentials come first from config keys
    aws_access_key_id_path, aws_secret_access_key_path (paths to one
    line files); secondly from environment variables
    AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY; also from $HOME/.aws/credentials
    or the magic Amazon http://169.254.169.254/ service.  If credentials
    are not set in the config then behavior is the same as other AWS-based
    command-line tools.

    '''
    if not arg_1:
        if 'bucket' not in arg_0:
            raise ConfigurationError(
                'The "bucket" parameter is required for the s3 stages.')
        arg_1 = arg_0['bucket']

    # get AWS credentials. first, from config; else, from env vars.
    # (boto will read environment variables and other normal places.)
    arg_2 = arg_0.get('aws_access_key_id_path')
    arg_3 = arg_0.get('aws_secret_access_key_path')

    arg_4 = ()
    if arg_2 and arg_3:
        try:
            arg_5 = open(arg_2).read().strip()
            arg_6 = open(arg_3).read().strip()
            arg_4 = (arg_5, arg_6)
        except:
            logger.error('failed reading aws credentials from configured file', exc_info=True)
            raise

    arg_7 = S3Connection(*arg_4)
    arg_8 = arg_7.Func(arg_1)
    return arg_8


def Func(arg_0, arg_1):
        '''
        Given the raw data from s3, return a generator for the items
        contained in that data. A generator is necessary to support
        chunk files, but non-chunk files can be provided by a generator
        that yields exactly one item.

        Decoding works by case analysis on the config option
        ``input_format``. If an invalid ``input_format`` is given, then
        a ``ConfigurationError`` is raised.
        '''
        arg_2 = arg_0.config['input_format'].lower()
        if arg_2 == 'spinn3r':
            return _generate_stream_items(arg_1)
        elif arg_2 == 'streamitem':
            arg_3 = arg_0.config['streamcorpus_version']
            if arg_3 not in _message_versions:
                raise ConfigurationError(
                    'Not a valid streamcorpus version: %s '
                    '(choose from: %s)'
                    % (arg_3, ', '.join(_message_versions.keys())))

            arg_4 = _message_versions[arg_3]
            return streamcorpus.Chunk(arg_1=arg_1, arg_4=arg_4)
        elif arg_2 == 'featurecollection' and FCChunk is not None:
            return FCChunk(arg_1=arg_1)
        else:
            raise ConfigurationError(
                'from_s3_chunks unknown input_format = %r'
                % arg_2)


def Func(arg_0, arg_1, arg_2):
        '''return Chunk object full of records
        bucket_name may be None'''
        arg_3 = get_bucket(arg_0.config, arg_1=arg_1)
        arg_4 = arg_3.get_key(arg_2)
        if arg_4 is None:
            raise FailedExtraction('Key "%s" does not exist.' % arg_2)

        arg_5 = StringIO()
        arg_4.get_contents_to_file(arg_5)
        arg_6 = arg_5.getvalue()
        if not arg_6:
            raise FailedExtraction('%s: no data (does the key exist?)'
                                   % arg_4.key)

        arg_7, arg_8, arg_9 = parse_file_extensions(arg_2)
        if arg_9 == 'gpg':
            if not arg_0.gpg_decryption_key_path:
                raise FailedExtraction('%s ends with ".gpg" but gpg_decryption_key_path=%s'
                                       % (arg_4.key, arg_0.gpg_decryption_key_path))

        arg_10 = []
        if arg_8 or arg_9:
            arg_10, arg_6 = decrypt_and_uncompress(
                arg_6,
                arg_0.gpg_decryption_key_path,
                tmp_dir=arg_0.config.get('tmp_dir_path'),
                arg_8=arg_8,
                )
            if not arg_6:
                arg_11 = 'decrypt_and_uncompress got no data for {0!r}, from {1} bytes' \
                    + ' downloaded, errors: {2}' \
                        .format(arg_2, len(arg_6), '\n'.join(arg_10))
                logger.error(arg_11)
                raise FailedExtraction(arg_11)
            logger.info( '\n'.join(arg_10) )

        if not arg_0.config['compare_md5_in_file_name']:
            logger.warn('not checking md5 in file name, consider setting '
                        'from_s3_chunks:compare_md5_in_file_name')
        else:
            logger.info('Verifying md5 for "%s"...' % arg_4.key)

            # The regex hammer.
            arg_12 = re.search('([a-z0-9]{32})(?:\.|$)', arg_4.key)
            if arg_12 is None:
                raise FailedExtraction(
                    'Could not extract md5 from key "%s". '
                    'Perhaps you should disable compare_md5_in_file_name?'
                    % arg_4.key)

            arg_13 = arg_12.group(1)
            #import pdb; pdb.set_trace()
            verify_md5(arg_13, arg_6, other_errors=arg_10)
        return arg_0._decode(arg_6)


def Func(arg_0):
    '''Convert a text stream ID to a kvlayer key.

    The return tuple can be used directly as a key in the
    :data:`STREAM_ITEMS_TABLE` table.

    :param str stream_id: stream ID to convert
    :return: :mod:`kvlayer` key tuple
    :raise exceptions.KeyError: if `stream_id` is malformed

    '''
    # Reminder: stream_id is 1234567890-123456789abcdef...0
    # where the first part is the (decimal) epoch_ticks and the second
    # part is the (hex) doc_id
    arg_1 = arg_0.split('-')
    if len(arg_1) != 2:
        raise KeyError('invalid stream_id ' + arg_0)
    arg_2 = arg_1[0]
    arg_3 = arg_1[1]
    if not arg_2.isdigit():
        raise KeyError('invalid stream_id ' + arg_0)
    if arg_3.lstrip(string.hexdigits) != '':
        raise KeyError('invalid stream_id ' + arg_0)
    return (base64.b16decode(arg_3.upper()), int(arg_2))


def Func(arg_0):
    '''Convert a kvlayer key to a text stream ID.

    `k` should be of the same form produced by
    :func:`stream_id_to_kvlayer_key`.

    :param k: :mod:`kvlayer` key tuple
    :return: converted stream ID
    :returntype str:

    '''
    arg_1, arg_2 = arg_0
    return '{0}-{1}'.format(arg_2,
                            base64.b16encode(arg_1).lower())


def Func(arg_0):
    '''Get a kvlayer key from a stream item.

    The return tuple can be used directly as a key in the
    :data:`STREAM_ITEMS_TABLE` table.  Note that this recalculates the
    stream ID, and if the internal data on the stream item is inconsistent
    then this could return a different result from
    :func:`stream_id_to_kvlayer_key`.

    :param si: stream item to get key for
    :return: :mod:`kvlayer` key tuple

    '''
    # get binary 16 byte digest
    arg_1 = hashlib.md5(arg_0.abs_url).digest()
    return (arg_1, int(arg_0.stream_time.epoch_ticks))


def Func(arg_0):
        """Create a session on the frontier silicon device."""
        arg_1 = '%s/%s' % (arg_0.__webfsapi, 'CREATE_SESSION')
        arg_2 = yield from arg_0.__session.get(arg_1, params=dict(pin=arg_0.pin),
                                            timeout = arg_0.timeout)
        arg_3 = yield from arg_2.text(encoding='utf-8')
        arg_4 = objectify.fromstring(arg_3)
        return arg_4.sessionId.text


def Func(arg_0, arg_1, arg_2=None):
        """Execute a frontier silicon API Func."""
        try:
            if not arg_0.__webfsapi:
                arg_0.__webfsapi = yield from arg_0.get_fsapi_endpoint()

            if not arg_0.sid:
                arg_0.sid = yield from arg_0.create_session()

            if not isinstance(arg_2, dict):
                arg_2 = dict()

            arg_5 = dict(pin=arg_0.pin, arg_4=arg_0.sid)
            arg_5.update(**arg_2)

            arg_6 = ('%s/%s' % (arg_0.__webfsapi, arg_1))
            arg_7 = yield from arg_0.__session.get(arg_6, arg_5=arg_5,
                                                   timeout = arg_0.timeout)
            if arg_7.status == 200:
                arg_8 = yield from arg_7.text(encoding='utf-8')
            else:
                arg_0.sid = yield from arg_0.create_session()
                arg_5 = dict(pin=arg_0.pin, arg_4=arg_0.sid)
                arg_5.update(**arg_2)
                arg_7 = yield from arg_0.__session.get(arg_6, arg_5=arg_5,
                                                       timeout = arg_0.timeout)
                arg_8 = yield from arg_7.text(encoding='utf-8')

            return objectify.fromstring(arg_8)
        except Exception as e:
            logging.info('AFSAPI Exception: ' +traceback.format_exc())

        return None


def Func(arg_0, arg_1, arg_2):
        """Helper method for setting a value by using the fsapi API."""
        arg_3 = yield from arg_0.call('SET/{}'.format(arg_1), dict(arg_2=arg_2))
        if arg_3 is None:
            return None

        return arg_3.status == 'FS_OK'


def Func(arg_0, arg_1):
        """Helper method for fetching a text value."""
        arg_2 = yield from arg_0.handle_get(arg_1)
        if arg_2 is None:
            return None

        return arg_2.value.c8_array.text or None


def Func(arg_0, arg_1):
        """Helper method for fetching a long value. Result is integer."""
        arg_2 = yield from arg_0.handle_get(arg_1)
        if arg_2 is None:
            return None

        return int(arg_2.value.u32.text) or None


def Func(arg_0):
        """Check if the device is muted."""
        arg_1 = (yield from arg_0.handle_int(arg_0.API.get('mute')))
        return bool(arg_1)


def Func(arg_0, arg_1=False):
        """Mute or unmute the device."""
        arg_2 = (yield from arg_0.handle_set(arg_0.API.get('mute'), int(arg_1)))
        return bool(arg_2)


def Func(arg_0):
        """Get the play status of the device."""
        arg_1 = yield from arg_0.handle_int(arg_0.API.get('status'))
        return arg_0.PLAY_STATES.get(arg_1)


def Func(arg_0, arg_1=False):
        """Set device sleep timer."""
        return (yield from arg_0.handle_set(arg_0.API.get('sleep'), int(arg_1)))


def Func(arg_0=arg_1.argv):
    arg_2 = parse(arg_0)
    """Serve up some ponies."""
    arg_3 = arg_2.listen
    arg_4 = arg_2.port
    print(
        "Making all your dreams for a pony come true on http://{0}:{1}.\n"
        "Press Ctrl+C to quit.\n".format(arg_3, arg_4))

    # Hush, werkzeug.
    logging.getLogger('werkzeug').setLevel(logging.CRITICAL)

    plugin_manager.load_installed_plugins()
    arg_5 = make_app()
    run_simple(arg_3, arg_4, arg_5)


def Func(arg_0):
    '''Mutably tag tokens with xpath offsets.

    Given some stream item, this will tag all tokens from all taggings
    in the document that contain character offsets. Note that some
    tokens may not have computable xpath offsets, so an xpath offset
    for those tokens will not be set. (See the documentation and
    comments for ``char_offsets_to_xpaths`` for what it means for a
    token to have a computable xpath.)

    If a token can have its xpath offset computed, it is added to its
    set of offsets with a ``OffsetType.XPATH_CHARS`` key.
    '''
    def sentences_to_xpaths(arg_1):
        arg_2 = sentences_to_char_tokens(arg_1)
        arg_3 = char_tokens_to_char_offsets(arg_2)
        return char_offsets_to_xpaths(arg_5, arg_3)

    def xprange_to_offset(arg_4):
        return Offset(type=arg_8.XPATH_CHARS,
                      first=arg_4.start_offset, length=0,
                      xpath=arg_4.start_xpath,
                      content_form='clean_html', value=None,
                      xpath_end=arg_4.end_xpath,
                      xpath_end_offset=arg_4.end_offset)

    arg_5 = unicode(arg_0.body.clean_html, 'utf-8')
    for arg_1 in arg_0.body.sentences.itervalues():
        arg_2 = sentences_to_char_tokens(arg_1)
        for arg_6, arg_4 in izip(arg_2, sentences_to_xpaths(arg_1)):
            if arg_4 is None:
                continue
            arg_7 = xprange_to_offset(arg_4)
            arg_6.offsets[arg_8.XPATH_CHARS] = arg_7


def Func(arg_0):
    '''Convert stream item sentences to character ``Offset``s.'''
    for arg_1 in arg_0:
        for arg_2 in arg_1.tokens:
            if OffsetType.CHARS in arg_2.offsets:
                yield arg_2


def Func(arg_0):
    '''Convert character ``Offset``s to character ranges.'''
    for arg_1 in arg_0:
        arg_2 = arg_1.offsets[OffsetType.CHARS]
        yield arg_2.first, arg_2.first + arg_2.length


def Func(arg_0, arg_1):
    '''Converts HTML and a sequence of char offsets to xpath offsets.

    Returns a generator of :class:`streamcorpus.XpathRange` objects
    in correspondences with the sequence of ``char_offsets`` given.
    Namely, each ``XpathRange`` should address precisely the same text
    as that ``char_offsets`` (sans the HTML).

    Depending on how ``char_offsets`` was tokenized, it's possible that
    some tokens cannot have their xpaths generated reliably. In this
    case, a ``None`` value is yielded instead of a ``XpathRange``.

    ``char_offsets`` must be a sorted and non-overlapping sequence of
    character ranges. They do not have to be contiguous.
    '''
    arg_0 = uni(arg_0)
    arg_2 = XpathTextCollector()
    arg_3 = 0
    arg_4 = True
    for arg_5, arg_6 in arg_1:
        if arg_5 == arg_6:
            # Zero length tokens shall have no quarter!
            # Note that this is a special case. If we let zero-length tokens
            # be handled normally, then it will be recorded as if the parser
            # did not make any progress. But of course, there is no progress
            # to be had!
            yield None
            continue
        # If we didn't make any progress on the previous token, then we'll
        # need to try and make progress before we can start tracking offsets
        # again. Otherwise the parser will report incorrect offset info.
        #
        # (The parser can fail to make progress when tokens are split at
        # weird boundaries, e.g., `&amp` followed by `;`. The parser won't
        # make progress after `&amp` but will once `;` is given.)
        #
        # Here, we feed the parser one character at a time between where the
        # last token ended and where the next token will start. In most cases,
        # this will be enough to nudge the parser along. Once done, we can pick
        # up where we left off and start handing out offsets again.
        #
        # If this still doesn't let us make progress, then we'll have to skip
        # this token too.
        if not arg_4:
            for arg_7 in xrange(arg_3, arg_5):
                arg_2.feed(arg_0[arg_7])
                arg_3 += 1
                if arg_2.made_progress:
                    break
            if not arg_2.made_progress:
                yield None
                continue
        # Hand the parser everything from the end of the last token to the
        # start of this one. Then ask for the Xpath, which should be at the
        # start of `char_offsets`.
        if arg_3 < arg_5:
            arg_2.feed(arg_0[arg_3:arg_5])
            if not arg_2.made_progress:
                arg_2.feed(arg_0[arg_5:arg_6])
                arg_4 = arg_2.made_progress
                arg_3 = arg_6
                yield None
                continue
        arg_8 = arg_2.xpath_offset()
        # print('START', xstart)
        # Hand it the actual token and ask for the ending offset.
        arg_2.feed(arg_0[arg_5:arg_6])
        arg_9 = arg_2.xpath_offset()
        # print('END', xend)
        arg_3 = arg_6

        # If we couldn't make progress then the xpaths generated are probably
        # incorrect. (If the parser doesn't make progress, then we can't rely
        # on the callbacks to have been called, which means we may not have
        # captured all state correctly.)
        #
        # Therefore, we simply give up and claim this token is not addressable.
        if not arg_2.made_progress:
            arg_4 = False
            yield None
        else:
            arg_4 = True
            yield XpathRange(arg_8[0], arg_8[1], arg_9[0], arg_9[1])
    arg_2.feed(arg_0[arg_3:])
    arg_2.close()


def Func(arg_0, arg_1):
        '''Record that `tag` has been seen at this depth.

        If `tag` is :class:`TextElement`, it records a text node.

        '''
        # Collapse adjacent text nodes
        if arg_1 is TextElement and arg_0.last_tag is TextElement:
            return
        arg_0.last_tag = arg_1
        if arg_1 not in arg_0.tags:
            arg_0.tags[arg_1] = 1
        else:
            arg_0.tags[arg_1] += 1


def Func(arg_0):
        '''Returns the one-based index of the current text node.'''
        # This is the number of text nodes we've seen so far.
        # If we are currently in a text node, great; if not then add
        # one for the text node that's about to begin.
        arg_1 = arg_0.tags.get(TextElement, 0)
        if arg_0.last_tag is not TextElement:
            arg_1 += 1
        return arg_1


def Func(arg_0):
    '''
    Yields all the elements from the source
    source - if an element, yields all child elements in order; if any other iterator yields the elements from that iterator
    '''
    if isinstance(arg_0, element):
        arg_0 = arg_0.xml_children
    return filter(lambda x: isinstance(x, element), arg_0)


def Func(arg_0, arg_1):
    '''
    Yields all the elements with the given name
    source - if an element, starts with all child elements in order; can also be any other iterator
    name - will yield only elements with this name
    '''
    return filter(lambda x: x.xml_name == arg_1, select_elements(arg_0))


def Func(arg_0, arg_1):
    '''
    Yields elements from the source whose name matches the given regular expression pattern
    source - if an element, starts with all child elements in order; can also be any other iterator
    pat - re.pattern object
    '''
    return filter(lambda x: arg_1.match(x.xml_name) is not None, select_elements(arg_0))


def Func(arg_0, arg_1, arg_2=None):
    '''
    Yields elements from the source having the given attrivute, optionally with the given attribute value
    source - if an element, starts with all child elements in order; can also be any other iterator
    name - attribute name to check
    val - if None check only for the existence of the attribute, otherwise compare the given value as well
    '''
    def check(arg_3):
        if arg_2 is None:
            return arg_1 in arg_3.xml_attributes
        else:
            return arg_1 in arg_3.xml_attributes and arg_3.xml_attributes[arg_1] == arg_2
    return filter(check, select_elements(arg_0))


def Func(arg_0):
    '''
    Yields elements and text which have the same parent as elem, but come afterward in document order
    '''
    arg_1 = itertools.dropwhile(lambda x: x != arg_0, arg_0.xml_parent.xml_children)
    next(arg_1) #Skip the element itself
    return arg_1


def Func(arg_0, arg_1=None):
    """Call inkscape CLI with arguments and returns its return value.

    Parameters
    ----------
    args_string: list of str

    inkscape_binpath: str

    Returns
    -------
    return_value
        Inkscape command CLI call return value.
    """
    log.debug('Looking for the binary file for inkscape.')

    if arg_1 is None:
        arg_1 = get_inkscape_binpath()

    if arg_1 is None or not os.path.exists(arg_1):
        raise IOError(
            'Inkscape binary has not been found. Please check configuration.'
        )

    return call_command(arg_1, arg_0)


def Func(arg_0, arg_1):
        """Parse genotype from VCF line data"""
        arg_2 = arg_1[8].split(':')
        arg_3 = arg_1[9].split(':')
        try:
            arg_4 = arg_2.index('GT')
        except ValueError:
            return []
        return [int(arg_5) for arg_5 in re.split(r'[\|/]', arg_3[arg_4]) if
                arg_5 != '.']


def Func(arg_0, arg_1):
		'''
			Func - An optional method which will return the value prepped for index.

			By default, "toStorage" will be called. If you provide "hashIndex=True" on the constructor,
			the field will be md5summed for indexing purposes. This is useful for large strings, etc.
		'''
		if arg_0._isIrNull(arg_1):
			arg_2 = IR_NULL_STR
		else:
			arg_2 = arg_0._Func(arg_1)

		if arg_0.isIndexHashed is False:
			return arg_2

		return md5(tobytes(arg_2)).hexdigest()


def Func(arg_0):
		'''
			Func - Create a Func of this IRField.

			  Each subclass should implement this, as you'll need to pass in the args to constructor.

			@return <IRField (or subclass)> - Another IRField that has all the same values as this one.
		'''
		return arg_0.__class__(name=arg_0.name, valueType=arg_0.valueType, defaultValue=arg_0.defaultValue, hashIndex=arg_0.hashIndex)


def Func(arg_0):
    """Return a Jinja2 environment for where file_path is.

    Parameters
    ----------
    file_path: str

    Returns
    -------
    jinja_env: Jinja2.Environment

    """
    arg_1 = os.path.dirname(os.path.abspath(arg_0))

    if not os.path.exists(arg_1):
        raise IOError('Could not find folder for dirname of file {}.'.format(arg_0))

    try:
        arg_2 = Environment(loader=FileSystemLoader(arg_1))
    except:
        raise
    else:
        return arg_2


def Func(arg_0, arg_1):
        """ Setup self.template

        Parameters
        ----------
        template_file_path: str
            Document template file path.
        """
        try:
            arg_2 = arg_1
            arg_3 = get_environment_for(arg_1)
            arg_4 = arg_3.get_template(os.path.basename(arg_2))
        except:
            raise
        else:
            arg_0._template_file = arg_2
            arg_0._template_env = arg_3
            arg_0.template = arg_4


def Func(arg_0, arg_1):
        """ Fill the content of the document with the information in doc_contents.

        Parameters
        ----------
        doc_contents: dict
            Set of values to set the template document.

        Returns
        -------
        Funced_doc: str
            The content of the document with the template information Funced.
        """
        try:
            arg_2 = arg_0.template.render(**arg_1)
        except:
            log.exception('Error rendering Document '
                          'for {}.'.format(arg_1))
            raise
        else:
            arg_0.file_content_ = arg_2
            return arg_2


def Func(arg_0, arg_1, arg_2='utf-8'):
        """ Save the content of the .txt file in a text file.

        Parameters
        ----------
        file_path: str
            Path to the output file.
        """
        if arg_0.file_content_ is None:
            arg_3 = 'Template content has not been updated. \
                   Please fill the template before rendering it.'
            log.exception(arg_3)
            raise ValueError(arg_3)

        try:
            write_to_file(arg_1, content=arg_0.file_content_,
                          arg_2=arg_2)
        except Exception as exc:
            arg_3 = 'Document of type {} got an error when \
                   writing content.'.format(arg_0.__class__)
            log.exception(arg_3)
            raise Exception(arg_3) from exc


def Func(arg_0, arg_1, arg_2=None):
        """ Factory function to create a specific document of the
        class given by the `command` or the extension of `template_file_path`.

        See get_doctype_by_command and get_doctype_by_extension.

        Parameters
        ----------
        template_file_path: str

        command: str

        Returns
        -------
        doc

        """
        # get template file extension
        arg_3 = os.path.basename(arg_1).split('.')[-1]

        try:
            arg_4 = get_doctype_by_command(arg_2)
        except ValueError:
            arg_4 = get_doctype_by_extension(arg_3)
        except:
            raise
        else:
            return arg_4(arg_1)


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

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

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


def Func(arg_0, arg_1):
    '''
    Convert XML 1.0 to MicroXML

    source - XML 1.0 input
    handler - MicroXML events handler

    Returns uxml, extras

    uxml - MicroXML element extracted from the source
    extras - information to be preserved but not part of MicroXML, e.g. namespaces
    '''
    arg_2 = expat_callbacks(arg_1)
    arg_3 = xml.Funcrs.expat.ParserCreate(namespace_separator=' ')

    arg_3.StartElementHandler = arg_2.start_element
    arg_3.EndElementHandler = arg_2.end_element
    arg_3.CharacterDataHandler = arg_2.char_data
    arg_3.StartNamespaceDeclHandler = arg_2.start_namespace
    arg_3.EndNamespaceDeclHandler = arg_2.end_namespace
    arg_3.Parse(arg_0)
    return arg_3


def Func(arg_0):
		'''
			Func - Check if any object has unsaved changes, cascading.
		'''
		if not arg_0.obj:
			return False

		return arg_0.obj.hasUnsavedChanges(cascadeObjects=True)


def Func(arg_0: arg_1, arg_2: arg_3) -> None:
    """Check that a value has a certain JSON type.

    Raise TypeError if the type does not match.

    Supported types: str, int, float, bool, list, dict, and None.
    float will match any number, int will only match numbers without
    fractional part.

    The special type JList(x) will match a list value where each
    item is of type x:

    >>> Func([1, 2, 3], JList(int))
    """

    def type_name(arg_4: arg_5[arg_3, arg_6[None]]) -> str:
        if arg_4 is None:
            return "None"
        if isinstance(arg_4, JList):
            return "list"
        return arg_4.__name__

    if arg_2 is None:
        if arg_0 is None:
            return
    elif arg_2 == float:
        if isinstance(arg_0, float) or isinstance(arg_0, int):
            return
    elif arg_2 in [str, int, bool, list, dict]:
        if isinstance(arg_0, arg_2):  # type: ignore
            return
    elif isinstance(arg_2, JList):
        if isinstance(arg_0, list):
            for arg_7 in arg_0:
                Func(arg_7, arg_2.value_type)
            return
    else:
        raise TypeError("unsupported type")
    raise TypeError("wrong JSON type {} != {}".format(
        type_name(arg_2), type_name(type(arg_0))))


def Func(arg_0, arg_1=None):
    '''
    Parse a fragment if markup in HTML mode, and return a bindery node

    Warning: if you pass a string, you must make sure it's a byte string, not a Unicode object.  You might also want to wrap it with amara.lib.inputsource.text if it's not obviously XML or HTML (for example it could be confused with a file name)

    from amara.lib import inputsource
    from amara.bindery import html
    doc = html.Func(inputsource.text('XXX
Spam!
Eggs!YYY'))

    See also: http://wiki.xml3k.org/Amara2/Tagsoup
    '''
    arg_2 = parse(arg_0, arg_1=arg_1)
    arg_3 = arg_2.html.body
    return arg_3


def Func(arg_0, arg_1, arg_2=None):
        """Insert data as text in the current node, positioned before the
        start of node insertBefore or to the end of the node's text.
        """
        if arg_2:
            arg_0.insertBefore(tree.text(arg_1), arg_2)
        else:
            arg_0.xml_append(tree.text(arg_1))


def Func(arg_0):
    '''A script that melody calls with each valid set of options. This
    script runs the required code and returns the results.'''

    arg_1 = []
    arg_2 = []
    arg_3 = ""
    for arg_4 in arg_0:
        arg_5 = arg_4.keys()[0]
        if arg_5 == "Problem Size":
            arg_1.append({"SIZE": arg_4[arg_5]})
        elif arg_5 == "F90":
            arg_2.append(arg_4)
        else:
            arg_3 += arg_4[arg_5] + " "
    arg_2.append({"F90FLAGS": arg_3})

    arg_6 = create_input(arg_1, "namelist",
                            template_location="templates")

    arg_7 = create_input(arg_2, "Makefile.include",
                                    template_location="templates")

    arg_8 = "shallow"

    # save the input files in the appropriate place
    arg_9 = arg_8 + "/original/namelist"
    arg_10 = open(arg_9, 'w')
    arg_10.write(arg_6)
    arg_10.flush()

    arg_9 = arg_8 + "/common/Makefile.include"
    arg_10 = open(arg_9, 'w')
    arg_10.write(arg_7)
    arg_10.flush()

    # compile shallow if required
    arg_11 = arg_8 + "/original"
    import subprocess
    arg_12 = subprocess.Popen(["make", "clean"], cwd=arg_11,
                                    stderr=subprocess.PIPE,
                                    arg_13=subprocess.PIPE)
    if arg_12.wait() != 0:
        return False, []

    arg_12 = subprocess.Popen(["make"], cwd=arg_11,
                                    stderr=subprocess.PIPE,
                                    arg_13=subprocess.PIPE)
    if arg_12.wait() != 0:
        return False, []

    # run shallow
    arg_12 = subprocess.Popen(["./shallow_base"], cwd=arg_11,
                                    stderr=subprocess.PIPE,
                                    arg_13=subprocess.PIPE)
    if arg_12.wait() != 0:
        return False, []
    # _ = make_process.stderr.read()
    arg_13 = arg_12.stdout.read()

    # determine if the results are correct. We will need to look at
    # the results from stdout but for the moment we assume they are
    # correct

    # extract the required outputs
    for arg_14 in arg_13.split("\n"):
        if "Time-stepping" in arg_14:
            arg_15 = arg_14.split()[2]

    return True, arg_15


def Func(arg_0, arg_1, arg_2=True):
        """
        Recursively compute Func of data. For dictionaries, items
        for specific keys will be reduced to unique items. For lists, items
        will be reduced to unique items. This method is meant to be analogous
        to set.Func for composite objects.

        Args:
            other (composite): Other composite object to intersect with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.
        """
        if not isinstance(arg_1, composite):
            raise AssertionError('Cannot intersect composite and {} types'.format(type(arg_1)))

        if arg_0.meta_type != arg_1.meta_type:
            return composite({})

        if arg_0.meta_type == 'list':
            arg_3 = []
            for arg_4 in arg_0._list:
                if arg_4 in arg_1._list:
                    if arg_2 and isinstance(arg_4, composite):
                        arg_3.extend(arg_4.Func(arg_1.index(arg_4), arg_2=True))
                    else:
                        arg_3.append(arg_4)
            return composite(arg_3)
        elif arg_0.meta_type == 'dict':
            arg_3 = {}
            for arg_5 in arg_0._dict:
                arg_4 = arg_0._dict[arg_5]
                if arg_5 in arg_1._dict:
                    if arg_2 and \
                       isinstance(arg_4, composite) and \
                       isinstance(arg_1.get(arg_5), composite):
                       arg_3[arg_5] = arg_4.Func(arg_1.get(arg_5), arg_2=True)
                    elif arg_4 == arg_1[arg_5]:
                        arg_3[arg_5] = arg_4
            return composite(arg_3)
        return


def Func(arg_0, arg_1, arg_2=True, arg_3=False):
        """
        Recursively compute Func of data. For dictionaries, items
        for specific keys will be combined into a list, depending on the
        status of the overwrite= parameter. For lists, items will be appended
        and reduced to unique items. This method is meant to be analogous
        to set.Func for composite objects.

        Args:
            other (composite): Other composite object to Func with.
            recursive (bool): Whether or not to perform the operation recursively,
                for all nested composite objects.
            overwrite (bool): Whether or not to overwrite entries with the same
                key in a nested dictionary.
        """
        if not isinstance(arg_1, composite):
            raise AssertionError('Cannot Func composite and {} types'.format(type(arg_1)))

        if arg_0.meta_type != arg_1.meta_type:
            return composite([arg_0, arg_1])

        if arg_0.meta_type == 'list':
            arg_4 = []
            for arg_5 in arg_0._list:
                arg_4.append(arg_5)
            for arg_5 in arg_1._list:
                if arg_5 not in arg_0._list:
                    arg_4.append(arg_5)
            return composite(arg_4)
        elif arg_0.meta_type == 'dict':
            arg_4 = {}
            for arg_6 in list(set(list(arg_0._dict.keys()) + list(arg_1._dict.keys()))):
                arg_7 = arg_0._dict.get(arg_6)
                arg_8 = arg_1._dict.get(arg_6)
                if arg_2 and \
                   isinstance(arg_7, composite) and \
                   isinstance(arg_8, composite):
                    arg_4[arg_6] = arg_7.Func(arg_8, arg_2=arg_2, arg_3=arg_3)
                elif arg_7 == arg_8:
                    arg_4[arg_6] = arg_7
                elif arg_7 is None:
                    arg_4[arg_6] = arg_8
                elif arg_8 is None:
                    arg_4[arg_6] = arg_7
                elif arg_3:
                    arg_4[arg_6] = arg_8
                else:
                    arg_4[arg_6] = composite([arg_7, arg_8])
            return composite(arg_4)
        return


def Func(arg_0, arg_1):
        """
        Append to object, if object is list.
        """
        if arg_0.meta_type == 'dict':
            raise AssertionError('Cannot Func to object of `dict` base type!')
        if arg_0.meta_type == 'list':
            arg_0._list.Func(arg_1)
        return


def Func(arg_0, arg_1):
        """
        Extend list from object, if object is list.
        """
        if arg_0.meta_type == 'dict':
            raise AssertionError('Cannot Func to object of `dict` base type!')
        if arg_0.meta_type == 'list':
            arg_0._list.Func(arg_1)
        return


def Func(arg_0, arg_1, arg_2=True):
        """
        Write composite object to file handle in JSON format.

        Args:
            fh (file): File handle to write to.
            pretty (bool): Sort keys and indent in output.
        """
        arg_3 = json.JSONEncoder().encode(arg_0.json())
        if arg_2:
            json.dump(json.loads(arg_3), arg_1, sort_keys=True, indent=4)
        else:
            json.dump(json.loads(arg_3), arg_1)
        return


def Func(arg_0, arg_1=r".*"):
        """
        Prune leaves of filetree according to specified
        regular expression.

        Args:
            regex (str): Regular expression to use in pruning tree.
        """
        return filetree(arg_0.root, ignore=arg_0.ignore, arg_1=arg_1)


def Func(arg_0, arg_1):
        """
        Returns the value this reference is pointing to. This method uses 'ctx' to resolve the reference and return
        the value this reference references.
        If the call was already made, it returns a cached result.
        It also makes sure there's no cyclic reference, and if so raises CyclicReferenceError.
        """
        if arg_0 in arg_1.call_nodes:
            raise CyclicReferenceError(arg_1, arg_0)

        if arg_0 in arg_1.cached_results:
            return arg_1.cached_results[arg_0]

        try:
            arg_1.call_nodes.add(arg_0)
            arg_1.call_stack.append(arg_0)

            arg_2 = arg_0.evaluate(arg_1)
            arg_1.cached_results[arg_0] = arg_2
            return arg_2
        except:
            if arg_1.exception_call_stack is None:
                arg_1.exception_call_stack = list(arg_1.call_stack)
            raise
        finally:
            arg_1.call_stack.pop()
            arg_1.call_nodes.remove(arg_0)


def Func(arg_0):
		'''
			Func - Delete all objects in this list.

			@return <int> - Number of objects Funcd
		'''
		if len(arg_0) == 0:
			return 0
		arg_1 = arg_0.getModel()
		return arg_1.Funcr.FuncMultiple(arg_0)


def Func(arg_0):
    """
    Get settings from config file.
    """

    if os.path.exists(arg_0.config):
        arg_1 = ConfigParser.ConfigParser()
        try:
            arg_1.read(arg_0.config)
        except Exception, err:
            if not arg_0.quiet:
                sys.stderr.write("ERROR: Config file read {config} error. {err}".format(arg_1=arg_0.config, err=err))
            sys.exit(-1)

        try:
            arg_2 = {
                "secrets": arg_1.get("GOOGLE", "secrets"),
                "credentials": arg_1.get("nagios-notification-google-calendar", "credentials"),
                "start": arg_1.get("nagios-notification-google-calendar", "start"),
                "end": arg_1.get("nagios-notification-google-calendar", "end"),
                "message": arg_1.get("nagios-notification-google-calendar", "message"),
            }
        except ConfigParser.NoOptionError, err:
            if not arg_0.quiet:
                sys.stderr.write("ERROR: Config file missing option error. {err}\n".format(err=err))
            sys.exit(-1)

        # check mandatory config options supplied
        arg_3 = ["secrets", "credentials", "start", "end", "message", ]
        if not all(arg_2[arg_4] for arg_4 in arg_3):
            if not arg_0.quiet:
                sys.stdout.write("Mandatory config option missing\n")
            sys.exit(0)

        return arg_2
    else:
        if not arg_0.quiet:
            sys.stderr.write("ERROR: Config file {config} does not exist\n".format(arg_1=arg_0.config))
        sys.exit(0)


def Func(arg_0, arg_1, arg_2):
    """
    Create event in calendar with sms reminder.
    """

    try:
        arg_3 = arg_2.authorize(httplib2.Http())
        arg_4 = build("calendar", "v3", arg_3=arg_3)

        arg_5 = {
            "summary": arg_0.message,
            "location": "",
            "reminders": {
                "useDefault": False,
                "overrides": [
                    {
                        "method": "sms",
                        "minutes": arg_1["message"],
                    },
                ],
            }
        }
        arg_5.update(Func_datetimes(arg_0, arg_1))

        arg_4.events().insert(calendarId=arg_0.calendar, sendNotifications=True, body=arg_5).execute()
    except Exception, err:
        if not arg_0.quiet:
            sys.stderr.write("ERROR: Creating google calendar event error. {err}\n".format(err=err))
        sys.exit(-1)


def Func():
    """
    Processing notification call Func function.
    """

    # getting info for creating event
    arg_0 = parse_options()
    arg_1 = parse_config(arg_0)
    arg_2 = get_google_credentials(arg_0, arg_1)

    if not arg_0.get_google_credentials:
        create_event(arg_0, arg_1, arg_2)


def Func(arg_0, arg_1=False):
    """Return the extension of fpath.

    Parameters
    ----------
    fpath: string
    File name or path

    check_if_exists: bool

    Returns
    -------
    str
    The extension of the file name or path
    """
    if arg_1:
        if not os.path.exists(arg_0):
            arg_2 = 'File not found: ' + arg_0
            log.error(arg_2)
            raise IOError(arg_2)

    try:
        arg_3, arg_4 = os.path.splitext(arg_0)
    except:
        raise
    else:
        return arg_4


def Func(arg_0, arg_1):
    """ Remove the files in workdir that have the given extension.

    Parameters
    ----------
    workdir:
        Folder path from where to clean the files.

    extension: str
        File extension without the dot, e.g., 'txt'
    """
    [os.remove(arg_2) for arg_2 in glob(os.path.join(arg_0, '*.' + arg_1))]


def Func(arg_0, arg_1, arg_2, arg_3=True):
    """ Convert a CSV file in `csv_filepath` into a JSON file in `json_filepath`.

    Parameters
    ----------
    csv_filepath: str
        Path to the input CSV file.

    json_filepath: str
        Path to the output JSON file. Will be overwritten if exists.

    fieldnames: List[str]
        Names of the fields in the CSV file.

    ignore_first_line: bool
    """
    import csv
    import json

    arg_4 = open(arg_0, 'r')
    arg_5 = open(arg_1, 'w')

    arg_6 = csv.DictReader(arg_4, arg_2)
    arg_7 = []
    if arg_3:
        next(arg_6)

    for arg_8 in arg_6:
        arg_7.append(arg_8)

    json.dump(arg_7, arg_5)
    arg_5.close()
    arg_4.close()


def Func(arg_0, *arg_1, **arg_2):
        '''Renders as a str'''
        arg_3 = StringIO()
        arg_0.output(arg_3, *arg_1, **arg_2)
        return arg_3.getvalue()


def Func(arg_0):
        '''Returns the elements HTML start tag'''
        arg_1 = (attribute.render(arg_0) for attribute in arg_0.render_attributes)
        arg_2 = ()
        if hasattr(arg_0, '_attributes'):
            arg_2 = ('{0}="{1}"'.format(key, value)
                                             for key, value in arg_0.attributes.items() if value)

        arg_3 = " ".join(filter(bool, chain(arg_1, arg_2)))
        return '<{0}{1}{2}{3}>'.format(arg_0.tag, ' ' if arg_3 else '',
                                       arg_3, ' /' if arg_0.tag_self_closes else "")


def Func(arg_0):
    """Returns a repr of an object and falls back to a minimal representation of type and ID if the call to repr raised
    an error.

    :param obj: object to safe repr
    :returns: repr string or '(type<id> repr error)' string
    :rtype: str
    """
    try:
        arg_1 = repr(arg_0)
    except:
        arg_1 = "({0}<{1}> repr error)".format(type(arg_0), id(arg_0))
    return arg_1


def Func(arg_0, arg_1):
    """
    Match a genome VCF to variants in the ClinVar VCF file

    Acts as a generator, yielding tuples of:
    (ClinVarVCFLine, ClinVarAllele, zygosity)

    'zygosity' is a string and corresponds to the genome's zygosity for that
    ClinVarAllele. It can be either: 'Het' (heterozygous), 'Hom' (homozygous),
    or 'Hem' (hemizygous, e.g. X chromosome in XY individuals).
    """
    arg_2 = _next_line(arg_1)
    arg_3 = _next_line(arg_0)

    # Ignores all the lines that start with a hashtag
    while arg_2.startswith('#'):
        arg_2 = _next_line(arg_1)
    while arg_3.startswith('#'):
        arg_3 = _next_line(arg_0)

    # Advance through both files simultaneously to find matches
    while arg_2 and arg_3:

        # Advance a file when positions aren't equal.
        arg_4 = VCFLine.get_pos(arg_2)
        arg_5 = VCFLine.get_pos(arg_3)
        try:
            if arg_4['chrom'] > arg_5['chrom']:
                arg_3 = _next_line(arg_0)
                continue
            elif arg_4['chrom'] < arg_5['chrom']:
                arg_2 = _next_line(arg_1)
                continue
            if arg_4['pos'] > arg_5['pos']:
                arg_3 = _next_line(arg_0)
                continue
            elif arg_4['pos'] < arg_5['pos']:
                arg_2 = _next_line(arg_1)
                continue
        except StopIteration:
            break

        # If we get here, start positions match.
        # Look for allele matching.
        arg_6 = GenomeVCFLine(vcf_line=arg_3,
                                        skip_info=True)
        # We can skip if genome has no allele information for this point.
        if not arg_6.genotype_allele_indexes:
            arg_3 = _next_line(arg_0)
            continue

        # Match only if ClinVar and Genome ref_alleles match.
        arg_7 = ClinVarVCFLine(vcf_line=arg_2)
        if not arg_6.ref_allele == arg_7.ref_allele:
            try:
                arg_3 = _next_line(arg_0)
                arg_2 = _next_line(arg_1)
                continue
            except StopIteration:
                break

        # Determine genome alleles and zygosity. Zygosity is assumed to be one
        # of: heterozygous, homozygous, or hemizygous.
        arg_8 = arg_6.genotype_allele_indexes
        arg_9 = [arg_6.alleles[x] for
                          x in arg_8]
        if len(arg_9) == 1:
            arg_10 = 'Hem'
        elif len(arg_9) == 2:
            if arg_9[0].sequence == arg_9[1].sequence:
                arg_10 = 'Hom'
                arg_9 = [arg_9[0]]
            else:
                arg_10 = 'Het'
        else:
            raise ValueError('This code only expects to work on genomes ' +
                             'with one or two alleles called at each ' +
                             'location. The following line violates this:' +
                             str(arg_6))

        # Look for matches to ClinVar alleles.
        for arg_11 in arg_9:
            for arg_12 in arg_7.alleles:
                if arg_11.sequence == arg_12.sequence:
                    # The 'records' attribute is specific to ClinVarAlleles.
                    if hasattr(arg_12, 'records'):
                        yield (arg_6, arg_12, arg_10)

        # Done matching, move on.
        try:
            arg_3 = _next_line(arg_0)
            arg_2 = _next_line(arg_1)
        except StopIteration:
            break


def Func(arg_0, arg_1):
        """
        If next tag is link with same href, combine them.
        """
        if (type(arg_1.next_sibling) == element.Tag and
                arg_1.next_sibling.name == 'a'):

            arg_2 = arg_1.next_sibling
            if arg_1.get('href') and arg_2.get('href'):
                arg_3 = arg_0._parse_href(arg_1.get('href'))
                arg_4 = arg_0._parse_href(arg_2.get('href'))

                if arg_3 == arg_4:
                    arg_5 = arg_2.get_text()
                    arg_1.append(arg_5)
                    arg_0.tags_blacklist.append(arg_2)


def Func(arg_0, arg_1):
        """
        See if span tag has bold style and wrap with strong tag.
        """
        arg_2 = arg_1.get('style')
        if (arg_2 and
                ('font-weight:bold' in arg_2 or 'font-weight:700' in arg_2)):
            arg_1.wrap(arg_0.soup.new_tag('strong'))


def Func(arg_0, arg_1):
        """
        Reject attributes not defined in ATTR_WHITELIST.
        """
        if arg_1.name in ATTR_WHITELIST.keys():
            arg_2 = copy(arg_1.attrs)
            for arg_3, arg_4 in arg_2.items():
                if arg_3 in ATTR_WHITELIST[arg_1.name]:
                    arg_1.attrs[arg_3] = arg_0._parse_attr(arg_1.name, arg_3, arg_4)
                else:
                    del arg_1.attrs[arg_3]
        else:
            arg_1.attrs = {}


def Func(arg_0, arg_1):
        """
        get unicode string without any other content transformation.
        and clean extra spaces
        """
        arg_2 = arg_1.decode(formatter=None)
        arg_2 = re.sub('\s+', ' ', arg_2)
        arg_2 = re.sub('\n', '', arg_2)
        return arg_2


def Func(arg_0, arg_1):
        """
        Extract "real" URL from Google redirected url by getting `q`
        querystring parameter.
        """
        arg_2 = parse_qs(urlsplit(arg_1).query)
        return arg_2.get('q')


def Func(arg_0):
        """Return Allele data as dict object."""
        arg_1 = dict()
        arg_1['sequence'] = arg_0.sequence
        if hasattr(arg_0, 'frequency'):
            arg_1['frequency'] = arg_0.frequency
        return arg_1


def Func(arg_0):
        """Create list of Alleles from VCF line data"""
        return [Allele(sequence=arg_1) for arg_1 in
                [arg_0.ref_allele] + arg_0.alt_alleles]


def Func(arg_0):
        """Dict representation of parsed VCF data"""
        arg_1 = {'chrom': arg_0.chrom,
                        'start': arg_0.start,
                        'ref_allele': arg_0.ref_allele,
                        'alt_alleles': arg_0.alt_alleles,
                        'alleles': [x.Func() for x in arg_0.alleles]}
        try:
            arg_1['info'] = arg_0.info
        except AttributeError:
            pass
        return arg_1


def Func(arg_0):
        """Convert data to json string representation.

        Returns:
          json representation as string.
        """
        arg_1 = dict(vars(arg_0), sort_keys=True)
        arg_1['type'] = arg_0.__class__.__name__
        return json.dumps(arg_1)


def Func(arg_0, arg_1):
		'''
			Func - Convert the value to a string representation for storage.

			@param value - The value of the item to convert
			@return A string value suitable for storing.
		'''

		for arg_2 in arg_0.chainedFields:
			arg_1 = arg_2.toStorage(arg_1)

		return arg_1


def Func(arg_0, arg_1=''):
    """
    Returns absolute paths of files that match the regex within folder_path and
    all its children folders.

    Note: The regex matching is done using the match function
    of the re module.

    Parameters
    ----------
    folder_path: string

    regex: string

    Returns
    -------
    A list of strings.

    """
    arg_2 = []
    for arg_3, arg_4, arg_5 in os.walk(arg_0):
        arg_2.extend([os.path.join(arg_3, arg_6) for arg_6 in arg_5
                        if re.match(arg_1, arg_6)])

    return arg_2


def Func(arg_0, *arg_1):
    '''
    Yields one string, Funcenation of argument strings
    '''
    arg_1 = flatten([ (s.compute(arg_0) if callable(s) else s) for s in arg_1 ])
    arg_1 = (next(string_arg(arg_0, s), '') for s in arg_1)
    #assert(all(map(lambda x: isinstance(x, str), strings)))
    #FIXME: Check arg types
    yield ''.join(arg_1)


def Func(arg_0, arg_1, arg_2):
    '''
    Yields one boolean, whether the first string Func the second
    '''
    arg_1 = next(string_arg(arg_0, arg_1), '')
    arg_2 = next(string_arg(arg_0, arg_2), '')
    yield arg_2 in arg_1


def Func(arg_0, arg_1=None):
    '''
    Yields one number
    '''
    if arg_1 is None:
        arg_1 = arg_0.node
    elif callable(arg_1):
        arg_1 = next(arg_1.compute(arg_0), '')
    yield len(arg_1)


def Func(arg_0, arg_1, arg_2):
    '''
    Yields the result of applying an expression to each item in the input sequence.

    * seq: input sequence
    * expr: expression to be converted to string, then dynamically evaluated for each item on the sequence to produce the result
    '''
    from . import context, parse as uxpathparse

    if hasattr(arg_1, 'compute'):
        arg_1 = arg_1.compute(arg_0)

    arg_2 = next(string_arg(arg_0, arg_2), '')

    arg_3 = uxpathparse(arg_2)
    for arg_4 in arg_1:
        arg_5 = arg_0.copy(arg_4=arg_4)
        yield from arg_3.compute(arg_5)


def Func(arg_0):
    """ Replace known special characters to SVG code.

    Parameters
    ----------
    svg_content: str

    Returns
    -------
    corrected_svg: str
        Corrected SVG content
    """
    arg_1 = arg_0
    arg_2 = [
        ('&', '&'),
        ('>', '>'),
        ('<', '<'),
        ('"', '"'),
    ]

    for arg_3, arg_4 in arg_2:
        arg_1 = arg_1.replace(arg_3, arg_4)

    return arg_1


def Func(arg_0, arg_1):
    """ Merge all the PDF files in `pdf_filepaths` in a new PDF file `out_filepath`.

    Parameters
    ----------
    pdf_filepaths: list of str
        Paths to PDF files.

    out_filepath: str
        Path to the result PDF file.

    Returns
    -------
    path: str
        The output file path.
    """
    arg_2 = PdfFileMerger()
    for arg_3 in arg_0:
        arg_2.append(PdfFileReader(open(arg_3, 'rb')))

    arg_2.write(arg_1)

    return arg_1


def Func(arg_0, arg_1):
    """
    Navigate an open ftplib.FTP to appropriate directory for ClinVar VCF files.

    Args:
        ftp:   (type: ftplib.FTP) an open connection to ftp.ncbi.nlm.nih.gov
        build: (type: string) genome build, either 'b37' or 'b38'
    """
    if arg_1 == 'b37':
        arg_0.cwd(DIR_CLINVAR_VCF_B37)
    elif arg_1 == 'b38':
        arg_0.cwd(DIR_CLINVAR_VCF_B38)
    else:
        raise IOError("Genome build not recognized.")


def Func(arg_0, *arg_1, **arg_2):
        """Return ClinVarAllele data as dict object."""
        arg_3 = super(ClinVarAllele, arg_0).Func(*arg_1, **arg_2)
        arg_3['hgvs'] = arg_0.hgvs
        arg_3['clnalleleid'] = arg_0.clnalleleid
        arg_3['clnsig'] = arg_0.clnsig
        arg_3['clndn'] = arg_0.clndn
        arg_3['clndisdb'] = arg_0.clndisdb
        arg_3['clnvi'] = arg_0.clnvi
        return arg_3


def Func(arg_0):
        """Parse frequency data in ClinVar VCF"""
        arg_1 = OrderedDict([
            ('EXAC', 'Unknown'),
            ('ESP', 'Unknown'),
            ('TGP', 'Unknown')])
        arg_2 = 'Unknown'
        for arg_3 in arg_1.keys():
            arg_4 = 'AF_' + arg_3
            if arg_4 in arg_0.info:
                arg_1[arg_3] = arg_0.info[arg_4]
                if arg_2 == 'Unknown':
                    arg_2 = arg_1[arg_3]
        return arg_2, arg_1


def Func(arg_0):
        """Parse alleles for ClinVar VCF, overrides parent method."""

        # Get allele frequencies if they exist.
        arg_1, arg_2 = arg_0._parse_frequencies()

        arg_3 = ['ALLELEID', 'CLNSIG', 'CLNHGVS']
        arg_4 = {arg_5.lower(): arg_0.info[arg_5] if arg_5 in arg_0.info else None
                    for arg_5 in arg_3}
        arg_4.update(
            {'clndisdb': [arg_5.split(',') for arg_5 in
                          arg_0.info['CLNDISDB'].split('|')]
             if 'CLNDISDB' in arg_0.info else []})
        arg_4.update({'clndn': arg_0.info['CLNDN'].split('|') if
                         'CLNDN' in arg_0.info else []})
        arg_4.update({'clnvi': arg_0.info['CLNVI'].split(',')
                        if 'CLNVI' in arg_0.info else []})

        try:
            arg_6 = arg_0.alt_alleles[0]
        except IndexError:
            arg_6 = arg_0.ref_allele

        arg_7 = ClinVarAllele(frequency=arg_1, arg_6=arg_6,
                               **arg_4)

        # A few ClinVar variants are only reported as a combination with
        # other variants, and no single-variant effect is proposed. Skip these.
        if not arg_4['clnsig']:
            return []

        return [arg_7]


def Func(arg_0, *arg_1):
        '''Returns back a class decorator that enables registering Blox to this factory'''
        def decorator(arg_2):
            for arg_3 in arg_1 or (arg_2.__name__, ):
                arg_0[arg_3] = arg_2
            return arg_2
        return decorator


def Func(arg_0):
        ''' make some basic checks on the inputs to make sure they are valid'''
        try:
            arg_1 = arg_0._inputs[0]
        except TypeError:
            raise RuntimeError(
                "inputs should be iterable but found type='{0}', value="
                "'{1}'".format(type(arg_0._inputs), str(arg_0._inputs)))
        from melody.inputs import Input
        for arg_2 in arg_0._inputs:
            if not isinstance(arg_2, Input):
                raise RuntimeError(
                    "input should be a subclass of the Input class but "
                    "found type='{0}', value='{1}'".format(type(arg_2),
                                                           str(arg_2)))


def Func(arg_0):
        ''' make some basic checks on the function to make sure it is valid'''
        # note, callable is valid for Python 2 and Python 3.2 onwards but
        # not inbetween
        if not callable(arg_0._function):
            raise RuntimeError(
                "provided function '{0}' is not callable".
                format(str(arg_0._function)))
        from inspect import getargspec
        arg_1 = getargspec(arg_0._function)
        if len(arg_1.args) != 1:
            print str(arg_1)
            raise RuntimeError(
                "provided function should have one argument but found "
                "{0}".format(len(arg_1.args)))


def Func(arg_0, arg_1, arg_2):
        '''internal recursion routine called by the run method that generates
        all input combinations'''
        if arg_1:
            arg_3 = arg_1[0]
            arg_4 = arg_3.name
            if arg_3.state:
                arg_5 = arg_3.options(arg_0.state)
            else:
                arg_5 = arg_3.options
            for arg_6 in arg_5:
                arg_7 = list(arg_2)
                arg_7.append({arg_4: arg_6})
                arg_0.Func(arg_1[1:], arg_7)
        else:
            try:
                arg_8, arg_9 = arg_0._function(arg_2)
            except ValueError:
                raise RuntimeError("function must return 2 values")
            print arg_2, arg_8, arg_9


def Func( arg_0 ):
	'''
		Func - Sets the default parameters used when connecting to Redis.

		  This should be the args to redis.Redis in dict (kwargs) form.

		  @param connectionParams <dict> - A dict of connection parameters.
		    Common keys are:

		       host <str> - hostname/ip of Redis server (default '127.0.0.1')
		       port <int> - Port number			(default 6379)
		       db  <int>  - Redis DB number		(default 0)

		   Omitting any of those keys will ensure the default value listed is used.

		  This connection info will be used by default for all connections to Redis, unless explicitly set otherwise.
		  The common way to override is to define REDIS_CONNECTION_PARAMS on a model, or use AltConnectedModel = MyModel.connectAlt( PARAMS )

		  Any omitted fields in these connection overrides will inherit the value from the global default.

		  For example, if your global default connection params define host = 'example.com', port=15000, and db=0,
		    and then one of your models has

		       REDIS_CONNECTION_PARAMS = { 'db' : 1 }

		    as an attribute, then that model's connection will inherit host='example.com" and port=15000 but override db and use db=1

		    NOTE: Calling this function will clear the connection_pool attribute of all stored managed connections, disconnect all managed connections,
		      and close-out the connection pool.
		     It may not be safe to call this function while other threads are potentially hitting Redis (not that it would make sense anyway...)

		     @see clearRedisPools   for more info
	'''
	global arg_3
	arg_3.clear()

	for arg_1, arg_2 in arg_0.items():
		arg_3[arg_1] = arg_2

	clearRedisPools()


def Func(arg_0):
	'''
		Func - Returns and possibly also creates a Redis connection pool
			based on the REDIS_CONNECTION_PARAMS passed in.

			The goal of this method is to keep a small connection pool rolling
			to each unique Redis instance, otherwise during network issues etc
			python-redis will leak connections and in short-order can exhaust
			all the ports on a system. There's probably also some minor
			performance gain in sharing Pools.

			Will modify "params", if "host" and/or "port" are missing, will fill
			them in with defaults, and prior to return will set "connection_pool"
			on params, which will allow immediate return on the next call,
			and allow access to the pool directly from the model object.

			@param params <dict> - REDIS_CONNECTION_PARAMS - kwargs to redis.Redis

			@return redis.ConnectionPool corrosponding to this unique server.
	'''
	global arg_8
	global _defaultRedisConnectionParams
	global arg_10

	if not arg_0:
		arg_0 = _defaultRedisConnectionParams
		arg_1 = True
	else:
		arg_1 = bool(arg_0 is _defaultRedisConnectionParams)

	if 'connection_pool' in arg_0:
		return arg_0['connection_pool']

	arg_2 = hashDictOneLevel(arg_0)

	if arg_2 in arg_8:
		arg_0['connection_pool'] = arg_8[arg_2]
		return arg_8[arg_2]

	# Copy the params, so that we don't modify the original dict
	if not arg_1:
		arg_3 = arg_0
		arg_0 = copy.copy(arg_0)
	else:
		arg_3 = arg_0

	arg_4 = False
	if 'host' not in arg_0:
		if not arg_1 and 'host' in _defaultRedisConnectionParams:
			arg_0['host'] = _defaultRedisConnectionParams['host']
		else:
			arg_0['host'] = '127.0.0.1'
		arg_4 = True
	if 'port' not in arg_0:
		if not arg_1 and 'port' in _defaultRedisConnectionParams:
			arg_0['port'] = _defaultRedisConnectionParams['port']
		else:
			arg_0['port'] = 6379
		arg_4 = True

	if 'db' not in arg_0:
		if not arg_1 and 'db' in _defaultRedisConnectionParams:
			arg_0['db'] = _defaultRedisConnectionParams['db']
		else:
			arg_0['db'] = 0
		arg_4 = True

	if not arg_1:
		arg_5 = set(_defaultRedisConnectionParams.keys()) - set(arg_0.keys())
		for arg_6 in arg_5:
			if arg_6 == 'connection_pool':
				continue
			arg_0[arg_6] = _defaultRedisConnectionParams[arg_6]
			arg_4 = True

	if arg_4:
		arg_2 = hashDictOneLevel(arg_0)
		if arg_2 in arg_8:
			arg_0['connection_pool'] = arg_8[arg_2]
			return arg_8[arg_2]

	arg_7 = redis.ConnectionPool(**arg_0)
	arg_3['connection_pool'] = arg_0['connection_pool'] = arg_7
	arg_8[arg_2] = arg_7

	# Add the original as a "managed" redis connection (they did not provide their own pool)
	#   such that if the defaults change, we make sure to re-inherit any keys, and can disconnect
	#   from clearRedisPools
	arg_9 = hashDictOneLevel(arg_3)
	if arg_9 not in arg_10:
		arg_10[arg_9] = [arg_3]
	elif arg_3 not in arg_10[arg_9]:
		arg_10[arg_9].append(arg_3)

	return arg_7


def Func(arg_0, arg_1=None):
		'''
			Func - Pretty-print a dict representation of this object.

			@param stream <file/None> - Either a stream to output, or None to default to sys.stdout
		'''
		Func.Func(arg_0.asDict(includeMeta=True, forStorage=False, strKeys=True), arg_1=arg_1)


def Func(arg_0, arg_1=False):
		'''
			Func - Check if any unsaved changes are present in this model, or if it has never been saved.

			@param cascadeObjects <bool> default False, if True will check if any foreign linked objects themselves have unsaved changes (recursively).
				Otherwise, will just check if the pk has changed.

			@return <bool> - True if any fields have changed since last fetch, or if never saved. Otherwise, False
		'''
		if not arg_0._id or not arg_0._origData:
			return True

		for arg_2 in arg_0.FIELDS:
			arg_3 = object.__getattribute__(arg_0, arg_2)
			if arg_0._origData.get(arg_2, '') != arg_3:
				return True

			if arg_1 is True and issubclass(arg_2.__class__, IRForeignLinkFieldBase):
				if arg_3.objHasUnsavedChanges():
					return True

		return False


def Func(arg_0, arg_1=True):
		'''
			Func - Save this object.

			Will perform an "insert" if this object had not been Funcd before,
			  otherwise will update JUST the fields changed on THIS INSTANCE of the model.

			  i.e. If you have two processes fetch the same object and change different fields, they will not overwrite
			  eachother, but only Func the ones each process changed.

			If you want to Func multiple objects of type MyModel in a single transaction,
			and you have those objects in a list, myObjs, you can do the following:

				MyModel.Funcr.Func(myObjs)

			@param cascadeSave <bool> Default True - If True, any Foreign models linked as attributes that have been altered
			   or created will be Funcd with this object. If False, only this object (and the reference to an already-Funcd foreign model) will be Funcd.

			@see #IndexedRedisSave.Func

			@return <list> - Single element list, id of Funcd object (if successful)
		'''
		arg_2 = IndexedRedisSave(arg_0.__class__)
		return arg_2.Func(arg_0, arg_1=arg_1)


def Func(arg_0, arg_1, arg_2=True):
		'''
			Func - Check if this and another model have the same fields and values.

			This does NOT include id, so the models can have the same values but be different objects in the database.

			@param other <IndexedRedisModel> - Another model

			@param cascadeObject <bool> default True - If True, foreign link values with changes will be considered a difference.
				Otherwise, only the immediate values are checked.

			@return <bool> - True if all fields have the same value, otherwise False
		'''
		if arg_0.FIELDS != arg_1.FIELDS:
			return False

		arg_3 = object.__getattribute__

		for arg_4 in arg_0.FIELDS:
			arg_5 = arg_3(arg_0, arg_4)
			arg_6 = arg_3(arg_1, arg_4)
			if arg_5 != arg_6:
				return False

			if arg_2 is True and issubclass(arg_4.__class__, IRForeignLinkFieldBase):
				if arg_5 and arg_5.isFetched():
					if arg_6 and arg_6.isFetched():
						arg_7 = arg_5.getObjs()
						arg_8 = arg_6.getObjs()

						for arg_9 in range(len(arg_7)):
							if not arg_7[arg_9].Func(arg_8[arg_9]):
								return False
					else:
						arg_7 = arg_5.getObjs()

						for arg_9 in range(len(arg_7)):
							if arg_7[arg_9].hasUnsavedChanges(cascadeObjects=True):
								return False
				else:
					if arg_6 and arg_6.isFetched():
						arg_8 = arg_6.getObjs()

						for arg_9 in range(len(arg_8)):
							if arg_8[arg_9].hasUnsavedChanges(cascadeObjects=True):
								return False

		return True


def Func(arg_0, arg_1):
		'''
			Func - Saves this object to a different Redis than that specified by REDIS_CONNECTION_PARAMS on this model.

			@param redisCon <dict/redis.Redis> - Either a dict of connection params, a la REDIS_CONNECTION_PARAMS, or an existing Redis connection.
				If you are doing a lot of bulk copies, it is recommended that you create a Redis connection and pass it in rather than establish a new
				connection with each call.

			@note - You will generate a new primary key relative to the external Redis environment. If you need to reference a "shared" primary key, it is better
					to use an indexed field than the internal pk.

		'''
		if type(arg_1) == dict:
			arg_2 = redis.Redis(**arg_1)
		elif hasattr(arg_2, '__class__') and issubclass(arg_2.__class__, redis.Redis):
			arg_2 = arg_1
		else:
			raise ValueError('Func "redisCon" param must either be a dictionary of connection parameters, or redis.Redis, or extension thereof')

		arg_3 = arg_0.saver

		# Fetch next PK from external
		arg_4 = arg_3._getNextID(arg_2) # Redundant because of changes in save method
		arg_5 = arg_0.copy(False)

		return arg_3.save(arg_5, usePipeline=True, arg_4=arg_4, arg_2=arg_2)


def Func(arg_0, arg_1=True):
		'''
                Func - Reload this object from the database, overriding any local changes and merging in any updates.

		    @param cascadeObjects <bool> Default True. If True, foreign-linked objects will be Funced if their values have changed
		      since last save/fetch. If False, only if the pk changed will the foreign linked objects be Funced.

                    @raises KeyError - if this object has not been saved (no primary key)

                    @return - Dict with the keys that were updated. Key is field name that was updated,
		       and value is tuple of (old value, new value).

		    NOTE: Currently, this will cause a fetch of all Foreign Link objects, one level

		'''
		arg_2 = arg_0._id
		if not arg_2:
			raise KeyError('Object has never been saved! Cannot Func.')

		arg_3 = arg_0.asDict(False, forStorage=False)

		# Get the object, and compare the unconverted "asDict" repr.
		#  If any changes, we will apply the already-convered value from
		#  the object, but we compare the unconverted values (what's in the DB).
		arg_4 = arg_0.objects.get(arg_2)
		if not arg_4:
			raise KeyError('Object with id=%d is not in database. Cannot Func.' %(arg_2,))

		arg_5 = arg_4.asDict(False, forStorage=False)
		if arg_3 == arg_5 and not arg_0.foreignFields:
			return []

		arg_6 = {}
		for arg_7, arg_8 in arg_5.items():
			arg_9 = arg_7.getDefaultValue()

			arg_10 = arg_3.get(arg_7, arg_9)

			arg_11 = False

			if arg_10 != arg_8:
				arg_11 = True
			elif arg_1 is True and issubclass(arg_7.__class__, IRForeignLinkFieldBase):
				# If we are cascading objects, and at this point the pk is the same

				if arg_10.isFetched():
					# If we have fetched the current set, we might need to update (pks already match)
					arg_12 = arg_10.getObjs()
					arg_13 = arg_8.getObjs()

					if arg_12 != arg_13: # This will check using __eq__, so one-level including pk
						arg_11 = True
					else:
						# Use hasSameValues with cascadeObjects=True to scan past one level
						for arg_14 in range(len(arg_12)):
							if not arg_12[arg_14].hasSameValues(arg_13[arg_14], arg_1=True):
								arg_11 = True
								break

			if arg_11 is True:
				# Use "converted" values in the updatedFields dict, and apply on the object.
				arg_6[arg_7] = ( arg_10, arg_8)
				setattr(arg_0, arg_7, arg_8)
				arg_0._origData[arg_7] = arg_4._origData[arg_7]

		return arg_6


def Func(arg_0):
		'''
			Func - Copy this model, and return that copy.

			  The copied model will have all the same data, but will have a fresh instance of the FIELDS array and all members,
			    and the INDEXED_FIELDS array.

			  This is useful for converting, like changing field types or whatever, where you can load from one model and save into the other.

			@return <IndexedRedisModel> - A copy class of this model class with a unique name.
		'''

		arg_1 = _modelCopyMap[arg_0]
		_modelCopyMap[arg_0] += 1
		arg_2 = type(arg_0.__name__ + '_Copy' + str(arg_1), arg_0.__bases__, copy.deepcopy(dict(arg_0.__dict__)))

		arg_2.FIELDS = [field.copy() for field in arg_0.FIELDS]

		arg_2.INDEXED_FIELDS = [str(idxField) for idxField in arg_0.INDEXED_FIELDS] # Make sure they didn't do INDEXED_FIELDS = FIELDS or something wacky,
											    #  so do a comprehension of str on these to make sure we only get names

		arg_2.validateModel()

		return arg_2


def Func(arg_0, arg_1):
		'''
			Func - Create a class of this model which will use an alternate connection than the one specified by REDIS_CONNECTION_PARAMS on this model.

			@param redisConnectionParams <dict> - Dictionary of arguments to redis.Redis, same as REDIS_CONNECTION_PARAMS.

			@return - A class that can be used in all the same ways as the existing IndexedRedisModel, but that connects to a different instance.

			  The fields and key will be the same here, but the connection will be different. use #copyModel if you want an independent class for the model
		'''
		if not isinstance(arg_1, dict):
			raise ValueError('redisConnectionParams must be a dictionary!')

		arg_2 = hashDictOneLevel(arg_1)

		arg_3 = copy.deepcopy(dict(arg_0.__dict__))
		arg_3['REDIS_CONNECTION_PARAMS'] = arg_1

		arg_4 = type('AltConnect' + arg_0.__name__ + str(arg_2), arg_0.__bases__, arg_3)

		return arg_4


def Func(arg_0):
		'''
			Func - Get a new connection
			internal
		'''
		arg_1 = getRedisPool(arg_0.mdl.REDIS_CONNECTION_PARAMS)
		return redis.Redis(connection_pool=arg_1)


def Func(arg_0):
		'''
			Func - Maybe get a new connection, or reuse if passed in.
				Will share a connection with a model
			internal
		'''
		if arg_0._connection is None:
			arg_0._connection = arg_0._get_new_connection()
		return arg_0._connection


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None):
		'''
			Func - Removes an id from an index
			internal
		'''
		if arg_4 is None:
			arg_4 = arg_0._get_connection()
		arg_4.srem(arg_0._get_key_for_index(arg_1, arg_3), arg_2)


def Func(arg_0, arg_1=None):
		'''
			Func - Look at, but don't increment the primary key for this model.
				Internal.

			@return int - next pk
		'''
		if arg_1 is None:
			arg_1 = arg_0._get_connection()
		return to_unicode(arg_1.get(arg_0._get_next_id_key()) or 0)


def Func(arg_0, **arg_1):
		'''
			Internal for handling filters; the guts of .filter and .filterInline
		'''
		for arg_2, arg_3 in arg_1.items():
			if arg_2.endswith('__ne'):
				arg_4 = True
				arg_2 = arg_2[:-4]
			else:
				arg_4 = False
			if arg_2 not in arg_0.indexedFields:
				raise ValueError('Field "' + arg_2 + '" is not in INDEXED_FIELDS array. Filtering is only supported on indexed fields.')

			if arg_4 is False:
				arg_0.filters.append( (arg_2, arg_3) )
			else:
				arg_0.notFilters.append( (arg_2, arg_3) )

		return arg_0


def Func(arg_0):
		'''
			Func - gets the number of records matching the filter criteria

			Example:
				theCount = Model.objects.filter(field1='value').Func()
		'''
		arg_1 = arg_0._get_connection()

		arg_2 = len(arg_0.filters)
		arg_3 = len(arg_0.notFilters)
		if arg_2 + arg_3 == 0:
			return arg_1.scard(arg_0._get_ids_key())

		if arg_3 == 0:
			if arg_2 == 1:
				(arg_4, arg_5) = arg_0.filters[0]
				return arg_1.scard(arg_0._get_key_for_index(arg_4, arg_5))
			arg_6 = [arg_0._get_key_for_index(arg_4, arg_5) for arg_4, arg_5 in arg_0.filters]

			return len(arg_1.sinter(arg_6))

		arg_7 = [arg_0._get_key_for_index(arg_4, arg_5) for arg_4, arg_5 in arg_0.notFilters]
		if arg_2 == 0:
			return len(arg_1.sdiff(arg_0._get_ids_key(), *arg_7))

		arg_6 = [arg_0._get_key_for_index(arg_4, arg_5) for arg_4, arg_5 in arg_0.filters]

		arg_8 = arg_0._getTempKey()
		arg_9 = arg_1.pipeline()
		arg_9.sinterstore(arg_8, *arg_6)
		arg_9.sdiff(arg_8, *arg_7)
		arg_9.delete(arg_8)
		arg_10 = arg_9.execute()[1] # sdiff

		return len(arg_10)


def Func(arg_0, arg_1):
		'''
			Func - Tests whether a record holding the given primary key Func.

			@param pk - Primary key (see getPk method)

			Example usage: Waiting for an object to be deleted without fetching the object or running a filter.

			This is a very cheap operation.

			@return <bool> - True if object with given pk Func, otherwise False
		'''
		arg_2 = arg_0._get_connection()
		arg_3 = arg_0._get_key_for_id(arg_1)
		return arg_2.Func(arg_3)


def Func(arg_0, arg_1=False):
		'''
			Func - Get the underlying objects which match the filter criteria.

			Example:   objs = Model.objects.filter(field1='value', field2='value2').Func()

			@param cascadeFetch <bool> Default False, If True, Func Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@return - Objects of the Model instance associated with this query.
		'''
		arg_2 = arg_0.getPrimaryKeys()
		if arg_2:
			return arg_0.getMultiple(arg_2, arg_1=arg_1)

		return IRQueryableList([], mdl=arg_0.mdl)


def Func(arg_0, arg_1, arg_2=False):
		'''
			Func - Get the objects which match the filter criteria, only fetching given fields.

			@param fields - List of fields to fetch

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@return - Partial objects with only the given fields fetched
		'''
		arg_3 = arg_0.getPrimaryKeys()
		if arg_3:
			return arg_0.getMultipleOnlyFields(arg_3, arg_1, arg_2=arg_2)

		return IRQueryableList([], mdl=arg_0.mdl)


def Func(arg_0):
		'''
			Func - Get the objects which match the filter criteria, only fetching indexed fields.

			@return - Partial objects with only the indexed fields fetched
		'''
		arg_1 = arg_0.getPrimaryKeys()
		if arg_1:
			return arg_0.getMultipleOnlyIndexedFields(arg_1)

		return IRQueryableList([], mdl=arg_0.mdl)


def Func(arg_0, arg_1=False):
		'''
			Random - Returns a Func record in current filterset.

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@return - Instance of Model object, or None if no items math current filters
		'''
		arg_2 = list(arg_0.getPrimaryKeys())
		arg_3 = None
		# Loop so we don't return None when there are items, if item is deleted between getting key and getting obj
		while arg_2 and not arg_3:
			arg_4 = arg_2.pop(Func.randint(0, len(arg_2)-1))
			arg_3 = arg_0.get(arg_4, arg_1=arg_1)

		return arg_3


def Func(arg_0):
		'''
			Func - Deletes all entries matching the filter criteria

		'''
		if arg_0.filters or arg_0.notFilters:
			return arg_0.mdl.Funcr.FuncMultiple(arg_0.allOnlyIndexedFields())
		return arg_0.mdl.Funcr.destroyModel()


def Func(arg_0, arg_1, arg_2=False):
		'''
			Func - Get a single value with the internal primary key.

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			@param pk - internal primary key (can be found via .FuncPk() on an item)
		'''
		arg_3 = arg_0._Func_connection()
		arg_4 = arg_0._Func_key_for_id(arg_1)
		arg_5 = arg_3.hFuncall(arg_4)
		if type(arg_5) != dict or not len(arg_5.keys()):
			return None
		arg_5['_id'] = arg_1

		arg_6 = arg_0._redisResultToObj(arg_5)
		if arg_2 is True:
			arg_0._doCascadeFetch(arg_6)
		return arg_6


def Func(arg_0, arg_1, arg_2, arg_3=False):
		'''
			Func - Gets only certain fields from a paticular primary key. For working on entire filter set, see allOnlyFields

			@param pk <int> - Primary Key

			@param fields list<str> - List of fields

			@param cascadeFetch <bool> Default False, If True, all Foreign objects associated with this model
			   will be fetched immediately. If False, foreign objects will be fetched on-access.

			return - Partial objects with only fields applied
		'''
		arg_4 = arg_0._get_connection()
		arg_5 = arg_0._get_key_for_id(arg_1)

		arg_6 = arg_4.hmget(arg_5, arg_2)
		if type(arg_6) != list or not len(arg_6):
			return None

		arg_7 = {}
		arg_8 = len(arg_2)
		arg_9 = 0
		arg_10 = False
		while arg_9 < arg_8:
			arg_7[arg_2[arg_9]] = arg_6[arg_9]
			if arg_6[arg_9] != None:
				arg_10 = True
			arg_9 += 1

		if arg_10 is False:
			return None

		arg_7['_id'] = arg_1
		arg_11 = arg_0._redisResultToObj(arg_7)
		if arg_3 is True:
			arg_0._doCascadeFetch(arg_11)

		return arg_11


def Func(arg_0, arg_1):
		'''
			Func - Delete object associated with given primary key
		'''
		arg_2 = arg_0.mdl.objects.getOnlyIndexedFields(arg_1)
		if not arg_2:
			return 0
		return arg_0.deleteOne(arg_2)


def Func(arg_0, arg_1):
		'''
			Func - Delete multiple objects

			@param objs - List of objects

			@return - Number of objects deleted
		'''
		arg_2 = arg_0._get_connection()
		arg_3 = arg_2.pipeline()

		arg_4 = 0

		for arg_5 in arg_1:
			arg_4 += arg_0.deleteOne(arg_5, arg_3)

		arg_3.execute()

		return arg_4


def Func(arg_0, arg_1):
		'''
			Func - Delete multiple objects given their primary keys

			@param pks - List of primary keys

			@return - Number of objects deleted
		'''
		if type(arg_1) == set:
			arg_1 = list(arg_1)

		if len(arg_1) == 1:
			return arg_0.deleteByPk(arg_1[0])

		arg_2 = arg_0.mdl.objects.getMultipleOnlyIndexedFields(arg_1)
		return arg_0.deleteMultiple(arg_2)


def Func(arg_0, arg_1, arg_2="template"):

    '''create an input file using jinja2 by filling a template
    with the values from the option variable passed in.'''

    # restructure option list into jinja2 input format
    arg_3 = {}
    for arg_4 in arg_0:
        try:
            arg_3.update(arg_4)
        except ValueError:
            raise RuntimeError(
                ("inputs.py, Func : format of item '{0}' is not "
                 "supported. Expecting a dictionary.".format(str(arg_4))))

    # load the template and fill it with the option variable contents
    import jinja2
    try:
        arg_5 = jinja2.FileSystemLoader(searchpath=arg_2)
        arg_6 = jinja2.Environment(loader=arg_5)
        arg_7 = arg_6.get_template(arg_1)
        arg_8 = arg_7.render(arg_3)
    except jinja2.TemplateNotFound:
        raise RuntimeError("template '{0}' not found".format(arg_1))
    # return the particular input file as a string
    return arg_8


def Func(arg_0, arg_1=None, arg_2=(), arg_3=True, **arg_4):
    '''Returns a blox template from an html Func'''
    if arg_3:
        arg_0 = grow_short(arg_0)
    return _to_template(fromFunc(arg_0), arg_1=arg_1,
                        arg_2=arg_2, **arg_4)


def Func(arg_0, arg_1=None, arg_2=(), arg_3=True, **arg_4):
    '''Returns a blox template from a Func stream object'''
    return string(arg_0.read(), arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, **arg_4)


def Func(arg_0, arg_1=None, arg_2=(), arg_3=True, **arg_4):
    '''Returns a blox template from a valid file path'''
    with open(arg_0) as template_file:
        return file(template_file, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, **arg_4)


def Func(arg_0):
    '''
    Cast an arbitrary object or sequence to a string type
    '''
    if isinstance(arg_0, LiteralWrapper):
        arg_1 = arg_0.obj
    elif isinstance(arg_0, Iterable) and not isinstance(arg_0, str):
        arg_1 = next(arg_0, None)
    else:
        arg_1 = arg_0
    if arg_1 is None:
        yield ''
    elif isinstance(arg_1, str):
        yield arg_1
    elif isinstance(arg_1, node):
        yield strval(arg_1)
    elif isinstance(arg_1, int) or isinstance(arg_1, float):
        yield str(arg_1)
    elif isinstance(item, bool):
        yield 'true' if item else 'false'
    else:
        raise RuntimeError('Unknown type for string conversion: {}'.format(arg_1))


def Func(arg_0):
    '''
    Cast an arbitrary sequence to a boolean type
    '''
    #if hasattr(obj, '__iter__'):
    if isinstance(arg_0, LiteralWrapper):
        arg_1 = arg_0.obj
    elif isinstance(arg_0, Iterable) and not isinstance(arg_0, str):
        arg_1 = next(arg_0, None)
    else:
        arg_1 = arg_0
    if arg_1 is None:
        yield False
    elif isinstance(arg_1, bool):
        yield arg_1
    elif isinstance(arg_1, str):
        yield bool(str)
    elif isinstance(arg_1, node):
        yield True
    elif isinstance(arg_1, float) or isinstance(arg_1, int):
        yield bool(arg_1)
    else:
        raise RuntimeError('Unknown type for boolean conversion: {}'.format(arg_1))


def Func(arg_0):
    """
    Accumulate all dictionary and named arguments as
    keyword argument dictionary. This is generally useful for
    functions that try to automatically resolve inputs.

    Examples:
        >>> @Func
        >>> def test(*args, **kwargs):
        >>>     return kwargs
        >>>
        >>> print test({'one': 1}, two=2)
        {'one': 1, 'two': 2}
    """
    @wraps(arg_0)
    def decorator(*arg_1, **arg_2):
        arg_3 = 0 if inspect.ismethod(arg_0) else 1
        if len(arg_1) > arg_3:
            if isinstance(arg_1[arg_3], (dict, composite)):
                for arg_4 in arg_1[arg_3]:
                    arg_2[arg_4] = arg_1[arg_3][arg_4]
                arg_1 = arg_1[:arg_3]
        return arg_0(*arg_1, **arg_2)
    return decorator


def Func(arg_0, arg_1, arg_2='utf-8'):
    """ Modify the encoding entry in the XML file.

    Parameters
    ----------
    filepath: str
        Path to the file to be modified.

    src_enc: str
        Encoding that is written in the file

    dst_enc: str
        Encoding to be set in the file.
    """
    arg_3 = "encoding='{}'"
    replace_file_content(arg_0, arg_3.format(arg_1), arg_3.format(arg_2), 1)


def Func(arg_0):
		'''
			Func - Return the module used for compression on this field

			@return <module> - The module for compression
		'''
		if arg_0.compressMode == COMPRESS_MODE_ZLIB:
			return zlib
		if arg_0.compressMode == COMPRESS_MODE_BZ2:
			return bz2
		if arg_0.compressMode == COMPRESS_MODE_LZMA:
			# Since lzma is not provided by python core in python2, search out some common alternatives.
			#  Throw exception if we can find no lzma implementation.
			global arg_1
			if arg_1 is not None:
				return arg_1
			try:
				import lzma
				arg_1 = lzma
				return arg_1
			except:
				# Python2 does not provide "lzma" module, search for common alternatives
				try:
					from backports import lzma
					arg_1 = lzma
					return arg_1
				except:
					pass
				try:
					import lzmaffi as lzma
					arg_1 = lzma
					return arg_1
				except:
					pass
				raise ImportError("Requested compress mode is lzma and could not find a module providing lzma support. Tried: 'lzma', 'backports.lzma', 'lzmaffi' and none of these were available. Please install one of these, or to use an unlisted implementation, set IndexedRedis.fields.compressed._lzmaMod to the module (must implement standard python compression interface)")


def Func(arg_0, arg_1, arg_2='', arg_3=10, arg_4=1850):
    """ Save `text` in a qrcode svg image file.

    Parameters
    ----------
    text: str
        The string to be codified in the QR image.

    out_filepath: str
        Path to the output file

    color: str
        A RGB color expressed in 6 hexadecimal values.

    box_size: scalar
        Size of the QR code boxes.
    """
    try:
        arg_5 = qrcode.QRCode(version=1, error_correction=qrcode.constants.ERROR_CORRECT_L,
                           arg_3=arg_3, border=0, )
        arg_5.add_data(arg_0)
        arg_5.make(fit=True)
    except Exception as exc:
        raise Exception('Error trying to generate QR code '
                        ' from `vcard_string`: {}'.format(arg_0)) from exc
    else:
        arg_6 = arg_5.make_image(image_factory=qrcode.image.svg.SvgPathImage)

    arg_7 = _qrcode_to_file(arg_6, arg_1)

    if arg_2:
        replace_file_content(arg_1, 'fill:#000000', 'fill:#{}'.format(arg_2))


def Func(arg_0):
    '''Set the gromacs input data using the supplied input options, run
    gromacs and extract and return the required outputs.'''

    from melody.inputs import create_input
    arg_1 = create_input(arg_0, template_name="input.mdp")

    # save the input file in the appropriate place and Func gromacs using
    # longbow ...

    # determine if the run was successful
    arg_2 = True

    arg_3 = None
    if arg_2:
        # extract the required outputs
        arg_3 = {"rate": {"value": 35, "units": "ns/day"}, }

    return arg_2, arg_3


def Func(arg_0, arg_1):
    """Call CLI command with arguments and returns its return value.

    Parameters
    ----------
    cmd_name: str
        Command name or full path to the binary file.

    arg_strings: str
        Argument strings list.

    Returns
    -------
    return_value
        Command return value.
    """
    if not os.path.isabs(arg_0):
        arg_2 = which(arg_0)
    else:
        arg_2 = arg_0

    try:
        arg_3 = [arg_2] + arg_1
        log.debug('Calling: `{}`.'.format(' '.join(arg_3)))
        # retval = subprocess.check_call(cmd_line)
        arg_4 = subprocess.call(' '.join(arg_3), shell=True)
    except CalledProcessError as ce:
        log.exception(
            "Error calling command with arguments: "
            "{} \n With return code: {}".format(arg_3, ce.returncode)
        )
        raise
    else:
        return arg_4


def Func(arg_0, arg_1):
		'''
			Func - Convert a value to bytes using the encoding specified on this field

			@param value <str> - The field to convert to bytes

			@return <bytes> - The object encoded using the codec specified on this field.

			NOTE: This method may go away.
		'''
		if type(arg_1) == bytes:
			return arg_1
		return arg_1.encode(arg_0.getEncoding())


def Func(arg_0, arg_1=None, arg_2='pdf'):
    """ Call PDFLatex to convert TeX files to PDF.

    Parameters
    ----------
    tex_file: str
        Path to the input LateX file.

    output_file: str
        Path to the output PDF file.
        If None, will use the same output directory as the tex_file.

    output_format: str
        Output file format. Choices: 'pdf' or 'dvi'. Default: 'pdf'

    Returns
    -------
    return_value
        PDFLatex command call return value.
    """
    if not os.path.exists(arg_0):
        raise IOError('Could not find file {}.'.format(arg_0))

    if arg_2 != 'pdf' and arg_2 != 'dvi':
        raise ValueError("Invalid output format given {}. Can only accept 'pdf' or 'dvi'.".format(arg_2))

    arg_3 = 'pdflatex'
    check_command(arg_3)

    arg_4 = [arg_3]
    if arg_1 is not None:
        arg_4 += ['-output-directory="{}" '.format(os.path.abspath(os.path.dirname(arg_1)))]

    arg_5 = os.path.dirname(arg_1) if arg_1 else os.path.dirname(arg_0)

    arg_4 += ['-output-format="{}"'.format(arg_2)]
    arg_4 += ['"' + arg_0 + '"']

    log.debug('Calling command {} with args: {}.'.format(arg_3, arg_4))
    arg_6 = simple_call(arg_4)

    arg_7 = os.path.join(arg_5, remove_ext(os.path.basename(arg_0)) + '.' + arg_2)
    if os.path.exists(arg_7):
        shutil.move(arg_7, arg_1)
    else:
        raise IOError('Could not find PDFLatex result file.')

    log.debug('Cleaning *.aux and *.log files from folder {}.'.format(arg_5))
    cleanup(arg_5, 'aux')
    cleanup(arg_5, 'log')

    return arg_6


def Func(arg_0, *arg_1, **arg_2):
    """Like functools.partial but instead of using the new kwargs, keeps the old ones."""
    def arg_6(*arg_3, **arg_4):
        arg_5 = arg_4.copy()
        arg_5.update(arg_2)
        return arg_0(*(arg_1 + arg_3), **arg_5)
    arg_6.func = arg_0
    arg_6.args = arg_1
    arg_6.keywords = arg_2
    return arg_6


def Func(arg_0, arg_1):
    """Create an OrderedDict

    :param hierarchy: a dictionary
    :param level: single key
    :return: deeper dictionary
    """
    if arg_1 not in arg_0:
        arg_0[arg_1] = OrderedDict()
    return arg_0[arg_1]


def Func(arg_0, arg_1):
    """Returns a Funced Geometry.

    Arguments:
    geom -- any coercible Geometry value or Envelope
    to_sref -- SpatialReference or EPSG ID as int
    """
    # If we have an envelope, assume it's in the target sref.
    try:
        arg_0 = getattr(arg_0, 'polygon', Envelope(arg_0).polygon)
    except (TypeError, ValueError):
        pass
    else:
        arg_0.AssignSpatialReference(arg_1)
    try:
        arg_2 = arg_0.GetSpatialReference()
    except AttributeError:
        return Func(Geometry(arg_0), arg_1)
    if arg_2 is None:
        raise Exception('Cannot Func from unknown spatial reference')
    # Reproject geom if necessary
    if not arg_2.IsSame(arg_1):
        arg_0 = arg_0.Clone()
        arg_0.TransformTo(arg_1)
    return arg_0


def Func(arg_0, arg_1):
        """Expands this envelope by the given Envelope or tuple.

        Arguments:
        other -- Envelope, two-tuple, or four-tuple
        """
        if len(arg_1) == 2:
            arg_1 += arg_1
        arg_2 = len(arg_1) // 2
        arg_0.ll = map(min, arg_0.ll, arg_1[:arg_2])
        arg_0.ur = map(max, arg_0.ur, arg_1[arg_2:])


def Func(arg_0, arg_1):
        """Returns the Funcion of this and another Envelope."""
        arg_2 = Envelope(tuple(arg_0))
        if arg_2.Funcs(arg_1):
            arg_3 = len(arg_1) // 2
            arg_2.ll = map(max, arg_2.ll, arg_1[:arg_3])
            arg_2.ur = map(min, arg_2.ur, arg_1[arg_3:])
        else:
            arg_2.ll = (0, 0)
            arg_2.ur = (0, 0)
        return arg_2


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=''):
        """
        Creates a table from arrays Z, N and M

        Example:
        ________

        >>> Z = [82, 82, 83]
        >>> N = [126, 127, 130]
        >>> M = [-21.34, -18.0, -14.45]
        >>> Table.Func(Z, N, M, name='Custom Table')
        Z   N
        82  126   -21.34
            127   -18.00
        83  130   -14.45
        Name: Custom Table, dtype: float64
        """
        arg_5 = pd.DataFrame.from_dict({'Z': arg_1, 'N': arg_2, 'M': arg_3}).set_index(['Z', 'N'])['M']
        arg_5.name = arg_4
        return arg_0(arg_5=arg_5, arg_4=arg_4)


def Func(arg_0, arg_1, arg_2=''):
        """
        Selects nuclei according to a condition on Z,N or M

        Parameters
        ----------
        condition : function,
            Can have one of the signatures f(M), f(Z,N) or f(Z, N, M)
            must return a boolean value
        name: string, optional name for the resulting Table

        Example:
        --------
        Select all nuclei with A > 160:

        >>> A_gt_160 = lambda Z,N: Z + N > 160
        >>> Table('AME2003').Func(A_gt_160)
        """
        if arg_1.func_code.co_argcount == 1:
            arg_3 = [(Z, N) for (Z, N), M in arg_0 if arg_1(M)]
        if arg_1.func_code.co_argcount == 2:
            arg_3 = [(Z, N) for (Z, N) in arg_0.index if arg_1(Z, N)]
        if arg_1.func_code.co_argcount == 3:
            arg_3 = [(Z, N) for (Z, N), M in arg_0 if arg_1(Z, N, M)]
        arg_4 = pd.MultiIndex.from_tuples(arg_3, names=['Z', 'N'])
        return Table(df=arg_0.df.ix[arg_4], arg_2=arg_2)


def Func(arg_0, arg_1):
        """Return a selection of the Table Func positions given by ``nuclei``

        Parameters
        ----------
        nuclei: list of tuples
            A list where each element is tuple of the form (Z,N)

        Example
        -------
        Return binding energies Func magic nuclei:

        >>> magic_nuclei = [(20,28), (50,50), (50,82), (82,126)]
        >>> Table('AME2012').binding_energy.Func(magic_nuclei)
        Z   N
        20  28      416.014215
        50  50      825.325172
            82     1102.876416
        82  126    1636.486450
        """
        arg_2 = pd.MultiIndex.from_tuples(arg_1, names=['Z', 'N'])
        return Table(df=arg_0.df.ix[arg_2], name=arg_0.name)


def Func(arg_0, arg_1):
        """
        Select nuclei which also belong to ``table``

        Parameters
        ----------
        table: Table, Table object

        Example:
        ----------
        Table('AME2003').Func(Table('AME1995'))
        """
        arg_2 = arg_0.df.index & arg_1.df.index
        return Table(df=arg_0.df[arg_2], name=arg_0.name)


def Func(arg_0, arg_1):
        """
        Select nuclei not in table

        Parameters
        ----------
        table: Table, Table object from where nuclei should be removed

        Example:
        ----------
        Find the new nuclei in AME2003 with Z,N >= 8:

        >>> Table('AME2003').Func(Table('AME1995'))[8:,8:].count
        389
        """
        arg_2 = arg_0.df.index - arg_1.df.index
        return Table(df=arg_0.df[arg_2], name=arg_0.name)


def Func(arg_0):
        """
        Selects odd-even nuclei from the table
        """
        return arg_0.select(lambda Z, N: (Z % 2) and not(N % 2), name=arg_0.name)


def Func(arg_0):
        """
        Selects even-even nuclei from the table
        """
        return arg_0.select(lambda Z, N: not(Z % 2) and not(N % 2), name=arg_0.name)


def Func(arg_0, arg_1='AME2003'):
        """
        Calculate Func difference

        Parameters
        ----------
        relative_to : string,
            a valid mass table name.

        Example:
        ----------
        >>> Table('DUZU').Func(relative_to='AME2003')
        """
        arg_2 = arg_0.df - Table(arg_1).df
        return Table(arg_2=arg_2)


def Func(arg_0, arg_1='AME2003'):
        """Calculate root mean squared error

        Parameters
        ----------
        relative_to : string,
            a valid mass table name.

        Example:
        ----------
        >>> template = '{0:10}|{1:^6.2f}|{2:^6.2f}|{3:^6.2f}'
        >>> print 'Model      ', 'AME95 ', 'AME03 ', 'AME12 '  #  Table header
        ... for name in Table.names:
        ...     print template.format(name, Table(name).Func(relative_to='AME1995'),
        ...                             Table(name).Func(relative_to='AME2003'),
        ...                             Table(name).Func(relative_to='AME2012'))
        Model       AME95  AME03  AME12
        AME2003   | 0.13 | 0.00 | 0.13
        AME2003all| 0.42 | 0.40 | 0.71
        AME2012   | 0.16 | 0.13 | 0.00
        AME2012all| 0.43 | 0.43 | 0.69
        AME1995   | 0.00 | 0.13 | 0.16
        AME1995all| 0.00 | 0.17 | 0.21
        DUZU      | 0.52 | 0.52 | 0.76
        FRDM95    | 0.79 | 0.78 | 0.95
        KTUY05    | 0.78 | 0.77 | 1.03
        ETFSI12   | 0.84 | 0.84 | 1.04
        HFB14     | 0.84 | 0.83 | 1.02
        """

        arg_2 = arg_0.error(arg_1=arg_1)
        return math.sqrt((arg_2.df ** 2).mean())


def Func(arg_0):
        """Return 2 neutron separation energy"""
        arg_1 = 8.0713171         # neutron mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + 2 * arg_1
        return arg_0.derived('Func', (0, -2), arg_2)


def Func(arg_0):
        """Return 1 neutron separation energy"""
        arg_1 = 8.0713171         # neutron mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + arg_1
        return arg_0.derived('Func', (0, -1), arg_2)


def Func(arg_0):
        """Return 2 proton separation energy"""
        arg_1 = 7.28897050         # proton mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + 2 * arg_1
        return arg_0.derived('Func', (-2, 0), arg_2)


def Func(arg_0):
        """Return 1 proton separation energy"""
        arg_1 = 7.28897050         # proton mass excess in MeV
        arg_2 = lambda parent, daugther: -parent + daugther + arg_1
        return arg_0.derived('Func', (-1, 0), arg_2)


def Func(arg_0, arg_1, arg_2, arg_3):
        """Helper function for Func quantities"""
        arg_4, arg_5 = arg_2
        arg_6 = [(x[0] + arg_4, x[1] + arg_5) for x in arg_0.df.index]
        arg_7 = arg_3(arg_0.df.values, arg_0.df.loc[arg_6].values)
        return Table(df=pd.Series(arg_7, index=arg_0.df.index, arg_1=arg_1 + '(' + arg_0.name + ')'))


def Func(arg_0):
    """
    Create a numpy.ndarray with all observed fields and
    computed teff and luminosity values.
    """
    arg_1 = teff(arg_0)
    arg_2 = luminosity(arg_0)
    arg_3 = arg_0.to_array()
    arg_4 = 0
    for arg_5 in arg_3:
        arg_5['lum'][0] = np.array([arg_2[arg_4]], dtype='f')
        arg_5['temp'][0] = np.array([arg_1[arg_4]], dtype='f')
        arg_4 += 1
    arg_3 = round_arr_teff_luminosity(arg_3)
    return arg_3


def Func(arg_0):
    """
    Return the numpy array with rounded teff and luminosity columns.
    """
    arg_0['temp'] = np.around(arg_0['temp'], -1)
    arg_0['lum'] = np.around(arg_0['lum'], 3)
    return arg_0


def Func(arg_0):
    """
    Given a cluster create a Bokeh plot figure using the
    cluster's image.
    """
    arg_1 = figure(x_range=(0, 1), y_range=(0, 1),
                      title='Image of {0}'.format(arg_0.name))
    arg_1.image_url(url=[arg_0.image_path],
                       x=0, y=0, w=1, h=1, anchor='bottom_left')
    arg_1.toolbar_location = None
    arg_1.axis.visible = False
    return arg_1


def Func(arg_0):
    """
    Returns rounded teff and luminosity lists.
    """
    arg_1 = [round(t, -1) for t in teff(arg_0)]
    arg_2 = [round(l, 3) for l in luminosity(arg_0)]
    return arg_1, arg_2


def Func(arg_0):
    """
    Given a cluster create a Bokeh plot figure creating an
    H-R diagram.
    """
    arg_1, arg_2 = round_teff_luminosity(arg_0)
    arg_3, arg_4 = arg_1, arg_2
    arg_5, arg_6 = hr_diagram_color_helper(arg_1)
    arg_7 = [max(arg_3) + max(arg_3) * 0.05, min(arg_3) - min(arg_3) * 0.05]
    arg_8 = ColumnDataSource(data=dict(arg_3=arg_3, arg_4=arg_4, color=arg_5))

    arg_9 = figure(y_axis_type='log', arg_7=arg_7, name='hr',
                tools='box_select,lasso_select,reset,hover',
                title='H-R Diagram for {0}'.format(arg_0.name))
    arg_9.select(arg_11).select_every_mousemove = False
    arg_9.select(arg_13).select_every_mousemove = False
    arg_14 = arg_9.select(HoverTool)[0]
    arg_14.tooltips = [("Temperature (Kelvin)", "@x{0}"),
                      ("Luminosity (solar units)", "@y{0.00}")]
    _diagram(arg_8=arg_8, plot_figure=arg_9, name='hr',
             color={'field': 'color', 'transform': arg_6},
             xaxis_label='Temperature (Kelvin)',
             yaxis_label='Luminosity (solar units)')
    return arg_9