<commit_before>from inspect import isclass, isbuiltin, isfunction, isroutine, ismethod, getmembers, signature

from ..core import Crumb, nodefault, ipeek, prepare_path

if __debug__:
	import warnings
	from collections import deque
	
	log = __import__('logging').getLogger(__name__)


def opts(obj):
	if isclass(obj):
		if hasattr(obj, '__call__'):
			return opts(obj.__call__)
		else:
			return
	
	if callable(obj):
		sig = signature(obj)
		
		if len(sig.parameters) > 1:
			return {'GET', 'POST'}
	
	return {'GET'}


class ObjectDispatch:
	__slots__ = ['protect']
	
	def __init__(self, protect=True):
		self.protect = protect
		<commit_msg>Avoid an edge case.<commit_after>from inspect import isclass, isbuiltin, isfunction, isroutine, ismethod, getmembers, signature

from ..core import Crumb, nodefault, ipeek, prepare_path

if __debug__:
	import warnings
	from collections import deque
	
	log = __import__('logging').getLogger(__name__)


def opts(obj):
	if isclass(obj):
		if '__call__' in dir(obj):
			return opts(obj.__call__)
		else:
			return
	
	if callable(obj):
		sig = signature(obj)
		
		if len(sig.parameters) > 1:
			return {'GET', 'POST'}
	
	return {'GET'}


class ObjectDispatch:
	__slots__ = ['protect']
	
	def __init__(self, protect=True):
		self.protect = protect
		
{'fraction_non_alphanumeric': 0.1150855365474339, 'fraction_numerical': 0.0015552099533437014, 'mean_word_length': 4.407563025210084, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7297513', 'n_tokens_mistral': 477, 'n_tokens_neox': 421, 'n_words': 122}