def shape_non_refactored_methods(historage, data):
    result = []
    global Id

    for n in data:
        non_refactored_method_data = {
            'Id': Id,
            'method': get_method_information(get_method(n[1]))[0] if is_method_body(n[1]) else get_method_information(get_constructor(n[1]))[0],
            'class': get_class(n[1]),
            'package': get_package(n[1], historage.commit(n[0])).rstrip() if get_package(n[1], historage.commit(n[0])) != None else get_package(n[1], historage.commit(n[0])),
            'commit': n[0].hexsha,
            'category': 0
        }
        Id += 1
        result.append(non_refactored_method_data)

    return result
def shape_inline_refactored_methods(data):
    result = []
    global Id

    csv_file = open(data, 'r')
    inline_refactored_methods = csv.DictReader(csv_file)

    for i in inline_refactored_methods:
        inline_refactored_method_data = {
            'Id': Id,
            'method': get_method_information(i['target_method'])[0],
            'class': i['target_class'],
            'package': i['b_package'].rstrip(),
            'commit': i['b_commit'],
            'category': 2
        }
        Id += 1
        result.append(inline_refactored_method_data)

    csv_file.close()
    return result