<commit_before>##
# Copyright (c) 2008-2010 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##


from semantix.utils.ast import *


class PyAST(LanguageAST): pass


#{
#    mod = Module(stmt* body)
#        | Interactive(stmt* body)
#        | Expression(expr body)

class PyModule(PyAST, ASTBlockNode): __fields = [('body', list)]
class PyInteractive(PyAST): __fields = [('body', list)]
class PyExpression(PyAST): __fields = [('body', list)]

#    stmt = FunctionDef(identifier name, arguments args,<commit_msg>utils.lang.python.ast: Add Import and ImportFrom ast nodes<commit_after>##
# Copyright (c) 2008-2010 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##


from semantix.utils.ast import *


class PyAST(LanguageAST): pass


#{
#    mod = Module(stmt* body)
#        | Interactive(stmt* body)
#        | Expression(expr body)

class PyModule(PyAST, ASTBlockNode): __fields = [('body', list)]
class PyInteractive(PyAST): __fields = [('body', list)]
class PyExpression(PyAST): __fields = [('body', list)]

#          | Import(alias* names)
#          | ImportFrom(identifier? module, alias* names, int? level)

class PyImport(PyAST): __fields = [('names', list)]
class PyImportFrom(PyAST): __fields = [('level', int, 0), ('names', list), ('module', str, None)]

#    stmt = FunctionDef(identifier name, arguments args,
{'fraction_non_alphanumeric': 0.1545253863134658, 'fraction_numerical': 0.012509197939661517, 'mean_word_length': 4.3125, 'pattern_counts': {'":': 0, '<': 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': '2999793', 'n_tokens_mistral': 456, 'n_tokens_neox': 430, 'n_words': 123}