def get_code()

in Example-Project/utils.py [0:0]


def get_code(code_list):
    '''
    Takes the code provided from the NB as a list, converts it to a clean str
    '''
    str_index = code_list.index('   "source": [\n') + 1

    str_rt = ''
    
    for each in code_list[str_index:]:
        
        for b in ['##', '###', ']', "{", "}", '\"', "\\n"]:
            each = each.replace(b, '')

        str_rt += ' {}'.format(each)
    
    return str_rt