<commit_before>class MetaBase(object):
    rest_methods = ('get', 'put', 'post', 'delete')
    is_rest_method = lambda inst, name: bool(name.lower() in getattr(inst, 'rest_methods'))
    metanames = []
    rest_method = None
    params = {}
    
    def __call__(self, object_id=None, params=None):
        resource = self.resource(object_id)

        if params:
            self.params.update(params)

        if not self.rest_method:
            return self
        else:
            return self.validate_request(resource)
    
    def __getattr__(self, metaname):
        _metaname = 'meta_{0}'.format(metaname)

        setattr(self, _metaname, self._meta)

        if not self.is_rest_method(metaname):
            self.metanames.append(metaname)
        else:
            self.rest_method = metaname.lower()

        return getattr(self, _metaname)

    @property
    def _meta(self):
        return self

    def resource(self, object_id):
        if object_id != None:
            self.metanames.append(object_id)

        resource = '/'.join(self.metanames)
    
        return resource

    def validate_request(self, resource):
        try:
            if self.rest_method in ('get', 'delete') and self.params:
                raise RequestHasParamsError("method does not support parameters.")
            elif self.rest_method in ('post', 'put') and not self.params:
                raise RequestRequiresParamsError("method must include parameter.")
        except RequestHasParamsError as e:
            print("{0}: {1} {2} {3}".format(e.__class__.__name__,
                                            self.rest_method.upper(),<commit_msg>simplified MetaBase; eliminated possible namespacing issue<commit_after>class MetaBase(object):
    rest_methods = ('get', 'put', 'post', 'delete')
    is_rest_method = lambda inst, name: bool(name.lower() in getattr(inst, 'rest_methods'))
    metanames = []
    rest_method = None
    params = {}
    
    def __call__(self, object_id=None, params=None):
        resource = self.resource(object_id)

        if params:
            self.params.update(params)

        if not self.rest_method:
            return self
        else:
            return self.validate_request(resource)
    
    def __getattr__(self, metaname):
        return_value = None

        if not self.is_rest_method(metaname):
            self.metanames.append(metaname)
            return_value = self
        else:
            self.rest_method = metaname.lower()

        return return_value

    def resource(self, object_id):
        if object_id != None:
            self.metanames.append(object_id)

        resource = '/'.join(self.metanames)
    
        return resource

    def validate_request(self, resource):
        try:
            if self.rest_method in ('get', 'delete') and self.params:
                raise RequestHasParamsError("method does not support parameters.")
            elif self.rest_method in ('post', 'put') and not self.params:
                raise RequestRequiresParamsError("method must include parameter.")
        except RequestHasParamsError as e:
            print("{0}: {1} {2} {3}".format(e.__class__.__name__,
                                            self.rest_method.upper(),
{'fraction_non_alphanumeric': 0.10378811210348013, 'fraction_numerical': 0.002771789344009855, 'mean_word_length': 2.165692007797271, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3060758', 'n_tokens_mistral': 922, 'n_tokens_neox': 900, 'n_words': 215}