<commit_before>#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys

def to_number(num):
    try:
        if '.' in num:
            return float(num)
        else:
            return int(num)
    except:
        sys.exit("Error")

op1 = to_number(sys.argv[1])
operation = sys.argv[2]
op2 = to_number(sys.argv[3])

def sum(num1, num2):
    return num1 + num2
def substraction(num1, num2):
    return num1 - num2

if operation == "suma":
    print (sum(op1, op2))
elif operation == "resta":
    print (substraction(op1, op2))
else:
    print ("Not allowed operation ", operation)<commit_msg>if name y funcion do_operation añadidos<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-

import sys


def to_number(num):
    try:
        if '.' in num:
            return float(num)
        else:
            return int(num)
    except:
        sys.exit("Error")


def sum(op1, op2):
    return op1 + op2


def substraction(op1, op2):
    return op1 - op2


def do_operation(operation, op1, op2):
    if operation == "suma":
        print (sum(op1, op2))
    elif operation == "resta":
        print (substraction(op1, op2))
    else:
        print ("Not allowed operation ", operation)

if __name__ == "__main__":

    op1 = to_number(sys.argv[1])
    operation = sys.argv[2]
    op2 = to_number(sys.argv[3])
    do_operation(operation, op1, op2)
{'fraction_non_alphanumeric': 0.14094955489614244, 'fraction_numerical': 0.03115727002967359, 'mean_word_length': 2.5221932114882506, 'pattern_counts': {'":': 5, '<': 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': '1226998', 'n_tokens_mistral': 490, 'n_tokens_neox': 481, 'n_words': 122}