<commit_before>from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from courseware.courses import get_course_by_id, get_course_about_section
from courseware.tests.helpers import get_request_for_user
from courseware.module_render import get_module
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview


def get_course_key(course_id):
    course_key = ""
    try:
        course_key = CourseKey.from_string(course_id)
    except InvalidKeyError:<commit_msg>Remove dependencies from courseware.test as create problem with import<commit_after>from opaque_keys.edx.keys import CourseKey
from opaque_keys import InvalidKeyError
from opaque_keys.edx.locations import SlashSeparatedCourseKey
from xmodule.modulestore.django import modulestore
from courseware.courses import get_course_by_id, get_course_about_section
from courseware.module_render import get_module
from openedx.core.djangoapps.content.course_overviews.models import CourseOverview
from django.test.client import RequestFactory


def get_request_for_user(user):
    """Create a request object for user."""
    request = RequestFactory()
    request.user = user
    request.COOKIES = {}
    request.META = {}
    request.is_secure = lambda: True
    request.get_host = lambda: "edx.org"
    request.method = 'GET'
    return request

def get_course_key(course_id):
    course_key = ""
    try:
        course_key = CourseKey.from_string(course_id)
    except InvalidKeyError:
{'fraction_non_alphanumeric': 0.06164383561643835, 'fraction_numerical': 0.0, 'mean_word_length': 5.428, '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': '2678297', 'n_tokens_mistral': 480, 'n_tokens_neox': 462, 'n_words': 113}