<commit_before>
import glob, logging, os
from .file import File

log = logging.getLogger(__name__)

class Folder(File):
    
    def __truediv__(self, other):
        return Folder(fn='/'.join([self.fn, str(other)]))

    def glob(self, pattern):
        results = [File(r) for r in glob.glob(str(Folder(self / pattern)))]
        for i in range(len(results)):
            if results[i].isdir: results[i] = Folder(results[i])
        return results<commit_msg>Folder.rglob() is now a thing<commit_after>
import glob, logging, os
import bl.rglob
from .file import File

log = logging.getLogger(__name__)


class Folder(File):
    def __truediv__(self, other):
        return Folder(fn='/'.join([self.fn, str(other)]))

    def glob(self, pattern):
        results = [File(r) for r in glob.glob(str(Folder(self / pattern)))]
        for i in range(len(results)):
            if results[i].isdir:
                results[i] = Folder(results[i])
        return results

    def rglob(self, pattern, **kwargs):
        return [
            Folder(r) if os.path.isdir(r) else File(r)
            for r in bl.rglob.rglob(self.fn, pattern, **kwargs)
        ]
{'fraction_non_alphanumeric': 0.13900955690703737, 'fraction_numerical': 0.0, 'mean_word_length': 2.7281553398058254, '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': '6289088', 'n_tokens_mistral': 376, 'n_tokens_neox': 371, 'n_words': 99}