<commit_before>"""
fs.expose.django
================

Use an FS object for Django File Storage

"""

from django.conf import settings
from django.core.files.storage import Storage
from django.core.files import File

from fs.path import abspath, dirname
from fs.errors import convert_fs_errors

class FSStorage(Storage):
    """Expose an FS object as a Django File Storage object."""

    def __init__(self, fs=None, base_url=None):
        """
        :param fs: an FS object
        :param base_url: The url to prepend to the path<commit_msg>basic module docs for fs.expose.django_storage<commit_after>"""
fs.expose.django
================

Use an FS object for Django File Storage

This module exposes the class "FSStorage", a simple adapter for using FS
objects as Django storage objects.  Simply include the following lines
in your setttings.py::

    DEFAULT_FILE_STORAGE = fs.expose.django_storage.FSStorage
    DEFAULT_FILE_STORAGE_FS = OSFS('foo/bar')  # Or whatever FS


"""

from django.conf import settings
from django.core.files.storage import Storage
from django.core.files import File

from fs.path import abspath, dirname
from fs.errors import convert_fs_errors

class FSStorage(Storage):
    """Expose an FS object as a Django File Storage object."""

    def __init__(self, fs=None, base_url=None):
        """
        :param fs: an FS object
        :param base_url: The url to prepend to the path
{'fraction_non_alphanumeric': 0.0989399293286219, 'fraction_numerical': 0.0, 'mean_word_length': 3.968421052631579, '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': '1850990', 'n_tokens_mistral': 421, 'n_tokens_neox': 400, 'n_words': 157}