@transaction.atomic()<EOL>def do_import(token, account_uuid, bank_account, since=None):
response = requests.get(<EOL>url="<STR_LIT>".format(account_uuid),<EOL>headers={"<STR_LIT>": "<STR_LIT>".format(token)},<EOL>)<EOL>response.raise_for_status()<EOL>data = response.json()<EOL>statement_import = StatementImport.objects.create(<EOL>source="<STR_LIT>", extra={"<STR_LIT>": account_uuid}, bank_account=bank_account<EOL>)<EOL>for line_data in data:<EOL><INDENT>uuid = UUID(hex=line_data["<STR_LIT:id>"])<EOL>if StatementLine.objects.filter(uuid=uuid):<EOL><INDENT>continue<EOL><DEDENT>description = "<STR_LIT:U+002CU+0020>".join(filter(bool, [line_data["<STR_LIT>"], line_data["<STR_LIT:description>"]]))<EOL>date = datetime.date(*map(int, line_data["<STR_LIT:date>"].split("<STR_LIT:->")))<EOL>if not since or date >= since:<EOL><INDENT>StatementLine.objects.create(<EOL>uuid=uuid,<EOL>date=line_data["<STR_LIT:date>"],<EOL>statement_import=statement_import,<EOL>amount=line_data["<STR_LIT>"],<EOL>type=line_data["<STR_LIT:type>"],<EOL>description=description,<EOL>source_data=line_data,<EOL>)<EOL><DEDENT><DEDENT>
Import data from teller.io

    Returns the created StatementImport