<commit_before>#!/usr/bin/env python

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
django.setup()

import pymongo
from xbrowse.reference import Reference
from xbrowse.annotation import VariantAnnotator
from xbrowse.coverage import CoverageDatastore
from xbrowse.datastore import MongoDatastore
import reference_settings
import annotator_settings
from seqr.models import Project as SeqrProject, Family as SeqrFamily, Individual as SeqrIndividual, VariantTagType, VariantTag
from django.contrib.auth.models import User
from xbrowse_server.base.models import UserProfile
from xbrowse_server.base.models import Project as BaseProject, Family as BaseFamily, Individual as BaseIndividual
from xbrowse_server.gene_lists.models import GeneList

annotator = datastore = None
try:
    reference_db = pymongo.MongoClient('xbrowse_reference')
    reference = Reference(reference_settings) 

    annotator_db = pymongo.MongoClient('xbrowse_annotator')
    annotator = VariantAnnotator(annotator_settings, reference)
    annotator._ensure_indices()

    datastore_db = pymongo.MongoClient('xbrowse_datastore')
    datastore = MongoDatastore(datastore_db, annotator)
except Exception as e:
    print("Error while connecting to mongo: " + str(e))

user_ns = {
    'annotator': annotator, 
    'datastore': datastore,
    'BaseProject': BaseProject,
    'BaseFamily': BaseFamily,
    'BaseIndividual': BaseIndividual,
    'SeqrProject': SeqrProject,
    'SeqrFamily': SeqrFamily,
    'SeqrIndividual': SeqrIndividual,
    'VariantTag': VariantTag,
    'VariantTagType': VariantTagType,
    'User': User,
    'BaseUser': User,
    'UserProfile': UserProfile,
    'GeneList': GeneList,
}

import IPython
IPython.embed(user_ns=user_ns)
<commit_msg>added SeqrDataset and SeqrSample to context<commit_after>#!/usr/bin/env python

import os
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
import django
django.setup()

import pymongo
from xbrowse.reference import Reference
from xbrowse.annotation import VariantAnnotator
from xbrowse.coverage import CoverageDatastore
from xbrowse.datastore import MongoDatastore
import reference_settings
import annotator_settings
from seqr.models import Project as SeqrProject, Family as SeqrFamily, Individual as SeqrIndividual, Dataset as SeqrDataset, Sample as SeqrSample, VariantTagType, VariantTag
from django.contrib.auth.models import User
from xbrowse_server.base.models import UserProfile
from xbrowse_server.base.models import Project as BaseProject, Family as BaseFamily, Individual as BaseIndividual
from xbrowse_server.gene_lists.models import GeneList

annotator = datastore = None
try:
    reference_db = pymongo.MongoClient('xbrowse_reference')
    reference = Reference(reference_settings) 

    annotator_db = pymongo.MongoClient('xbrowse_annotator')
    annotator = VariantAnnotator(annotator_settings, reference)
    annotator._ensure_indices()

    datastore_db = pymongo.MongoClient('xbrowse_datastore')
    datastore = MongoDatastore(datastore_db, annotator)
except Exception as e:
    print("Error while connecting to mongo: " + str(e))

user_ns = {
    'annotator': annotator, 
    'datastore': datastore,
    'BaseProject': BaseProject,
    'BaseFamily': BaseFamily,
    'BaseIndividual': BaseIndividual,
    'SeqrProject': SeqrProject,
    'SeqrFamily': SeqrFamily,
    'SeqrIndividual': SeqrIndividual,
    'SeqrDataset': SeqrDataset,
    'SeqrSample': SeqrSample,
    'VariantTag': VariantTag,
    'VariantTagType': VariantTagType,
    'User': User,
    'BaseUser': User,
    'UserProfile': UserProfile,
    'GeneList': GeneList,
}

import IPython
IPython.embed(user_ns=user_ns)

{'fraction_non_alphanumeric': 0.08269441401971522, 'fraction_numerical': 0.0, 'mean_word_length': 5.593862815884476, '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': '3532559', 'n_tokens_mistral': 1209, 'n_tokens_neox': 1128, 'n_words': 275}