<commit_before>import Language.Python.Common
import Language.Python.Version3.Parser

unModule :: ModuleSpan -> [Statement SrcSpan] 
unModule (Module xs) = xs

-- Gets the SrcSpan list from python code
f = unModule $ fst $ (\(Right x) -> x) (parseModule a "")

a = "x = \"Hello\""

changeAssignment (Assign x _ c) = Assign x (Int 5 "5" c ) c
changeAssignment              a = a

doIt = pretty (Module (fmap changeAssignment f))

main :: IO()
main = undefined<commit_msg>integer constants now tranformed in lambda functions<commit_after>import Language.Python.Common
import Language.Python.Version3.Parser

unModule :: ModuleSpan -> [Statement SrcSpan] 
unModule (Module xs) = xs

-- Gets the SrcSpan list from python code
f a = unModule $ fst $ (\(Right x) -> x) (parseModule a "")
fb = fst $ (\(Right x) -> x) (parseModule a "")

a = "x = 5\ny=8"

changeAssignment (Assign x expr c) = Assign x (exprToLambda expr) c
changeAssignment              a = a

doIt a = pretty (Module (fmap changeAssignment (f a)))

main :: IO()
main = undefined

exprToLambda e@(Int value lit a) = Call (Paren (Lambda [] e a) a) [] a
exprToLambda e                   = e

splitAssign (Assign t e a) = (t,e)

idLambda = Lambda [Param  (Ident "x" "") Nothing Nothing ""] (Var (Ident "x" "") "") ""






fromRight (Right a) = a
{'fraction_non_alphanumeric': 0.1336405529953917, 'fraction_numerical': 0.004608294930875576, 'mean_word_length': 3.3433333333333333, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 8, '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': '1520662', 'n_tokens_mistral': 436, 'n_tokens_neox': 425, 'n_words': 157}