<commit_before>from django.core.exceptions import ObjectDoesNotExist
from django.shortcuts import get_object_or_404
from django.conf import settings
from django.http import Http404

from xbrowse.analysis_modules.combine_mendelian_families import get_families_by_gene
from xbrowse_server.base.models import Project, Family, Cohort, FamilyGroup, VariantNote, VariantTag, GeneNote
from xbrowse_server.analysis import population_controls
from xbrowse import genomeloc
from xbrowse import stream_utils
from xbrowse.variant_search.family import get_variants as get_variants_family, get_genes as get_genes_family, get_variants_with_inheritance_mode, get_variants_allele_count
from xbrowse.variant_search.cohort import get_genes_with_inheritance as cohort_get_genes_with_inheritance
from xbrowse import utils as xbrowse_utils
from xbrowse_server import mall
from xbrowse_server.mall import get_mall, get_reference, get_datastore


def get_project_for_user(user, request_data):
    """
    Get project and family from request data
    Throw 404 if invalid IDs, or if user doesn't have view access
    """<commit_msg>remove unused import<commit_after>from django.shortcuts import get_object_or_404
from django.conf import settings
from django.http import Http404

from xbrowse.analysis_modules.combine_mendelian_families import get_families_by_gene
from xbrowse_server.base.models import Project, Family, Cohort, FamilyGroup, VariantNote, VariantTag, GeneNote
from xbrowse_server.analysis import population_controls
from xbrowse import genomeloc
from xbrowse import stream_utils
from xbrowse.variant_search.family import get_variants as get_variants_family, get_genes as get_genes_family, get_variants_with_inheritance_mode, get_variants_allele_count
from xbrowse.variant_search.cohort import get_genes_with_inheritance as cohort_get_genes_with_inheritance
from xbrowse import utils as xbrowse_utils
from xbrowse_server import mall
from xbrowse_server.mall import get_mall, get_reference, get_datastore


def get_project_for_user(user, request_data):
    """
    Get project and family from request data
    Throw 404 if invalid IDs, or if user doesn't have view access
    """
{'fraction_non_alphanumeric': 0.03691739732348869, 'fraction_numerical': 0.008306414397784956, 'mean_word_length': 7.306513409961686, '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': '5296332', 'n_tokens_mistral': 707, 'n_tokens_neox': 634, 'n_words': 192}