<commit_before>from __future__ import absolute_import
import os
from os.path import join, exists
import shutil
import logging
import textwrap

import oscar


def create_local_app_folder(local_app_path):
    if exists(local_app_path):
        raise ValueError(
            "There is already a '%s' folder! Aborting!" % local_app_path)
    os.mkdir(local_app_path)


def inherit_app_config(local_app_path, app_package, app_label):
    # This only works for non-dashboard apps; but then the fork_app command
    # doesn't support them anyway
    config_name = app_label.title() + 'Config'
    create_file(
        join(local_app_path, '__init__.py'),
        "default_app_config = '{app_package}.config.{config_name}'\n\n".format(
            app_package=app_package, config_name=config_name))
    create_file(
        join(local_app_path, 'config.py'),
        "from oscar.apps.{app_label} import config\n\n"
        "class {config_name}(config.{config_name}):\n"
        "    name = '{app_package}.config.{config_name}'\n".format(
            app_package=app_package,
            app_label=app_label,
            config_name=config_name))


def fork_app(app_label, folder_path, logger=None):
    """
    Create a custom version of one of Oscar's apps
    """
    if logger is None:
        logger = logging.getLogger(__name__)<commit_msg>Use correct app name in fork_app management command<commit_after>from __future__ import absolute_import
import os
from os.path import join, exists
import shutil
import logging
import textwrap

import oscar


def create_local_app_folder(local_app_path):
    if exists(local_app_path):
        raise ValueError(
            "There is already a '%s' folder! Aborting!" % local_app_path)
    os.mkdir(local_app_path)


def inherit_app_config(local_app_path, app_package, app_label):
    # This only works for non-dashboard apps; but then the fork_app command
    # doesn't support them anyway
    config_name = app_label.title() + 'Config'
    create_file(
        join(local_app_path, '__init__.py'),
        "default_app_config = '{app_package}.config.{config_name}'\n".format(
            app_package=app_package, config_name=config_name))
    create_file(
        join(local_app_path, 'config.py'),
        "from oscar.apps.{app_label} import config\n\n\n"
        "class {config_name}(config.{config_name}):\n"
        "    name = '{app_package}'\n".format(
            app_package=app_package,
            app_label=app_label,
            config_name=config_name))


def fork_app(app_label, folder_path, logger=None):
    """
    Create a custom version of one of Oscar's apps
    """
    if logger is None:
        logger = logging.getLogger(__name__)
{'fraction_non_alphanumeric': 0.09884801189149016, 'fraction_numerical': 0.0, 'mean_word_length': 3.355987055016181, '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': '4710131', 'n_tokens_mistral': 847, 'n_tokens_neox': 836, 'n_words': 198}