<commit_before>from pyontutils.core import devconfig
from pyontutils import scigraph_client
from IPython import embed

scigraph_client.BASEPATH = (f'http://{devconfig.scigraph_host}'
                            f'{":" if devconfig.scigraph_port else ""}'
                            f'{devconfig.scigraph_port}/scigraph')

__all__ = [e for e in dir(scigraph_client) if type(getattr(scigraph_client, e)) == type]

###

###

def main():
    with open(__file__, 'rt') as f:
        text = f.read()

    code = '\n\n'.join(f'{name} = scigraph_client.' + name for name in __all__)

    sep = '\n###\n'
    start, mid, end = text.split(sep)
    code = sep.join((start, code, end))
    with open(__file__, 'wt') as f:
        f.write(code)

if __name__ == '__main__':
    main()<commit_msg>scigraph.py (the new one) self modifying execution<commit_after>from pyontutils.core import devconfig
from pyontutils import scigraph_client
from IPython import embed

scigraph_client.BASEPATH = (f'http://{devconfig.scigraph_host}'
                            f'{":" if devconfig.scigraph_port else ""}'
                            f'{devconfig.scigraph_port}/scigraph')

__all__ = [e for e in dir(scigraph_client) if type(getattr(scigraph_client, e)) == type]

###
Analyzer = scigraph_client.Analyzer

Annotations = scigraph_client.Annotations

Cypher = scigraph_client.Cypher

Dynamic = scigraph_client.Dynamic

Graph = scigraph_client.Graph

Lexical = scigraph_client.Lexical

Refine = scigraph_client.Refine

Vocabulary = scigraph_client.Vocabulary

restService = scigraph_client.restService
###

def main():
    with open(__file__, 'rt') as f:
        text = f.read()

    code = '\n\n'.join(f'{name} = scigraph_client.' + name for name in __all__)

    sep = '\n###\n'
    start, mid, end = text.split(sep)
    code = sep.join((start, code, end))
    with open(__file__, 'wt') as f:
        f.write(code)

if __name__ == '__main__':
    main()
{'fraction_non_alphanumeric': 0.13095238095238096, 'fraction_numerical': 0.0, 'mean_word_length': 3.193058568329718, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1422380', 'n_tokens_mistral': 681, 'n_tokens_neox': 647, 'n_words': 155}