<commit_before># -*- coding: utf-8 -*-

import re
import types
import inspect
from inspect import ArgSpec

_VERBOSE = False
_INDENT = '    '


def getargspec(f):
    # TODO: support partials
    if not inspect.isfunction(f) and not inspect.ismethod(f) \
            and hasattr(f, '__call__'):
        if isinstance(getattr(f, '_argspec', None), ArgSpec):
            return f._argspec
        f = f.__call__  # callable objects

    if isinstance(getattr(f, '_argspec', None), ArgSpec):
        return f._argspec  # we'll take your word for it; good luck, lil buddy.

    ret = inspect.getargspec(f)
<commit_msg>minor tweak to getargspec to provide slightly better errors for builtin functions<commit_after># -*- coding: utf-8 -*-

import re
import types
import inspect
from inspect import ArgSpec

_VERBOSE = False
_INDENT = '    '


def getargspec(f):
    # TODO: support partials
    if not (inspect.isfunction(f) or inspect.ismethod(f) or \
            inspect.isbuiltin(f)) and hasattr(f, '__call__'):
        if isinstance(getattr(f, '_argspec', None), ArgSpec):
            return f._argspec
        f = f.__call__  # callable objects

    if isinstance(getattr(f, '_argspec', None), ArgSpec):
        return f._argspec  # we'll take your word for it; good luck, lil buddy.

    ret = inspect.getargspec(f)

{'fraction_non_alphanumeric': 0.10722433460076046, 'fraction_numerical': 0.001520912547528517, 'mean_word_length': 2.940119760479042, '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': '63135', 'n_tokens_mistral': 422, 'n_tokens_neox': 413, 'n_words': 132}