<commit_before>from django.http import HttpResponse
import features
import orfs
import json
import gb
import httplib


def _post(request):
    """
    Post a sequence and run the sequence through blast and orf detection.
    Expects: db and sequence
    Response: JSON list of features
    """

    is_gb = False
    db_name = request.REQUEST['db'].strip()

    sequence = request.REQUEST['sequence']
    gb_features = []

    # parse genbank
    if sequence.startswith('LOCUS'):
      is_gb = True
      sequence, gb_features = gb.parse_genbank(sequence)

    # clean sequence
    sequence = features.clean_dna_sequence(sequence)

    feature_list = gb_features
<commit_msg>handle whitespace in front of LOCUS<commit_after>from django.http import HttpResponse
import features
import orfs
import json
import gb
import httplib


def _post(request):
    """
    Post a sequence and run the sequence through blast and orf detection.
    Expects: db and sequence
    Response: JSON list of features
    """

    is_gb = False
    db_name = request.REQUEST['db'].strip()

    sequence = request.REQUEST['sequence']
    gb_features = []

    # parse genbank
    if sequence.strip().startswith('LOCUS'):
      is_gb = True
      sequence, gb_features = gb.parse_genbank(sequence)

    # clean sequence
    sequence = features.clean_dna_sequence(sequence)

    feature_list = gb_features

{'fraction_non_alphanumeric': 0.08043478260869565, 'fraction_numerical': 0.0, 'mean_word_length': 3.356466876971609, 'pattern_counts': {'":': 0, '<': 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': '312752', 'n_tokens_mistral': 411, 'n_tokens_neox': 395, 'n_words': 123}