# Path: nolang/objects/root.py
# class W_Root(object):
#     cls_w_type = None
# 
#     def int_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected integer')
# 
#     def utf8_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected string')
# 
#     def buffer_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected buffer')
# 
#     def listview(self, space):
#         raise space.apperr(space.w_typeerror, 'expected list')
# 
#     def dictview(self, space):
#         raise space.apperr(space.w_typeerror, 'expected dict')
# 
#     def hash(self, space):
#         raise space.apperr(space.w_typeerror, 'unhashable type')
# 
#     def iter(self, space):
#         raise space.apperr(space.w_typeerror, 'uniterable type')
# 
#     def iter_next(self, space):
#         raise space.apperr(space.w_typeerror, 'object not an iterator')
# 
#     def getattr(self, space, attrname):
#         return space.w_NotImplemented
# 
#     def bind(self, space, w_obj):
#         return self
# 
#     def gettype(self, space):
#         return self.cls_w_type
# 
#     def str(self, space):
#         raise space.apperr(space.w_typeerror,
#             'object cannot be converted to str')
# 
#     def len(self, space):
#         raise space.apperr(space.w_typeerror, 'unsized type')
# 
#     def is_true(self, space):
#         return True
# 
#     def lt(self, space, w_obj):
#         raise space.apperr(space.w_typeerror, 'object not comparable')
# 
#     def eq(self, space, w_other):
#         if self is w_other:
#             return True
#         if space.type(self) is not space.type(w_other):
#             raise NotImplementedOp
#         return False
# 
#     def add(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `+`')
# 
#     def sub(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `-`')
# 
#     def mul(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `*`')
# 
#     def truediv(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `/`')
# 
#     def call(self, space, interpreter, args, kwargs):
#         raise space.apperr(space.w_typeerror, 'object is not callable')
# 
#     def freeze(self, space):
#         if self.is_frozen(space):
#             return
#         raise space.apperr(space.w_freezeerror, 'object not freezable')
# 
#     def thaw(self, space):
#         raise space.apperr(space.w_freezeerror, 'object does not know '
#             'how to thaw, this should be an internal error')
# 
#     def is_frozen(self, space):
#         return False
# 
# Path: nolang/frameobject.py
# class Frame(W_Root):
#     def __init__(self, bytecode, name=None):
#         self.name = name
#         self.bytecode = bytecode
#         if bytecode.module is not None:  # for tests
#             self.globals_w = bytecode.module.functions
#         self.locals_w = [None] * len(bytecode.varnames)
#         self.stack_w = [None] * bytecode.stack_depth
#         self.resume_stack = [0] * bytecode.resume_stack_depth
#         self.resume_stack_depth = 0
#         self.pos = 0
# 
#     def populate_args(self, args_w):
#         for i in range(len(args_w)):
#             self.locals_w[i] = args_w[i]
# 
#     def push(self, w_val):
#         self.stack_w[self.pos] = w_val
#         self.pos += 1
# 
#     def pop(self):
#         new_pos = self.pos - 1
#         w_res = self.stack_w[new_pos]
#         assert new_pos >= 0
#         self.pos = new_pos
#         return w_res
# 
#     def peek(self):
#         return self.stack_w[self.pos - 1]
# 
#     def store_var(self, index):
#         self.locals_w[index] = self.pop()


from nolang.objects.root import W_Root
from nolang.frameobject import Frame
                             <= bytecode.maxargs):
        raise argerr_number(
            space, bytecode, name, len(namedargs_w) + len(args_w))

    vals_w = args_w + [None] * (num_args - len(args_w))
    for k, w_v in namedargs_w:
        try:
            index = bytecode.argmapping[k]
        except KeyError:
            raise argerr(space, "Function %s got unexpected keyword "
                "argument '%s'" % (name, k))
        if vals_w[index] is not None:
            raise argerr(space, "Function %s got multiple values for "
                "argument '%s'" % (name, k))
        vals_w[index] = w_v

    if bytecode.first_default >= 0:
        for i in range(bytecode.first_default, len(bytecode.defaults)):
            def_no = bytecode.defaults[i]
            if def_no != -1 and vals_w[i] is not None:
                vals_w[i] = bytecode.constants[def_no]

    for item in vals_w:
        if item is None:
            raise argerr(space, "Function %s didn't receive enough positional "
                "arguments" % (name,))

    return vals_w



# Path: nolang/objects/root.py
# class W_Root(object):
#     cls_w_type = None
# 
#     def int_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected integer')
# 
#     def utf8_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected string')
# 
#     def buffer_w(self, space):
#         raise space.apperr(space.w_typeerror, 'expected buffer')
# 
#     def listview(self, space):
#         raise space.apperr(space.w_typeerror, 'expected list')
# 
#     def dictview(self, space):
#         raise space.apperr(space.w_typeerror, 'expected dict')
# 
#     def hash(self, space):
#         raise space.apperr(space.w_typeerror, 'unhashable type')
# 
#     def iter(self, space):
#         raise space.apperr(space.w_typeerror, 'uniterable type')
# 
#     def iter_next(self, space):
#         raise space.apperr(space.w_typeerror, 'object not an iterator')
# 
#     def getattr(self, space, attrname):
#         return space.w_NotImplemented
# 
#     def bind(self, space, w_obj):
#         return self
# 
#     def gettype(self, space):
#         return self.cls_w_type
# 
#     def str(self, space):
#         raise space.apperr(space.w_typeerror,
#             'object cannot be converted to str')
# 
#     def len(self, space):
#         raise space.apperr(space.w_typeerror, 'unsized type')
# 
#     def is_true(self, space):
#         return True
# 
#     def lt(self, space, w_obj):
#         raise space.apperr(space.w_typeerror, 'object not comparable')
# 
#     def eq(self, space, w_other):
#         if self is w_other:
#             return True
#         if space.type(self) is not space.type(w_other):
#             raise NotImplementedOp
#         return False
# 
#     def add(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `+`')
# 
#     def sub(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `-`')
# 
#     def mul(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `*`')
# 
#     def truediv(self, space, w_other):
#         raise space.apperr(space.w_typeerror, 'no implementation for `/`')
# 
#     def call(self, space, interpreter, args, kwargs):
#         raise space.apperr(space.w_typeerror, 'object is not callable')
# 
#     def freeze(self, space):
#         if self.is_frozen(space):
#             return
#         raise space.apperr(space.w_freezeerror, 'object not freezable')
# 
#     def thaw(self, space):
#         raise space.apperr(space.w_freezeerror, 'object does not know '
#             'how to thaw, this should be an internal error')
# 
#     def is_frozen(self, space):
#         return False
# 
# Path: nolang/frameobject.py
# class Frame(W_Root):
#     def __init__(self, bytecode, name=None):
#         self.name = name
#         self.bytecode = bytecode
#         if bytecode.module is not None:  # for tests
#             self.globals_w = bytecode.module.functions
#         self.locals_w = [None] * len(bytecode.varnames)
#         self.stack_w = [None] * bytecode.stack_depth
#         self.resume_stack = [0] * bytecode.resume_stack_depth
#         self.resume_stack_depth = 0
#         self.pos = 0
# 
#     def populate_args(self, args_w):
#         for i in range(len(args_w)):
#             self.locals_w[i] = args_w[i]
# 
#     def push(self, w_val):
#         self.stack_w[self.pos] = w_val
#         self.pos += 1
# 
#     def pop(self):
#         new_pos = self.pos - 1
#         w_res = self.stack_w[new_pos]
#         assert new_pos >= 0
#         self.pos = new_pos
#         return w_res
# 
#     def peek(self):
#         return self.stack_w[self.pos - 1]
# 
#     def store_var(self, index):
#         self.locals_w[index] = self.pop()


# Path: nolang/function.py
from nolang.objects.root import W_Root
from nolang.frameobject import Frame

                             <= bytecode.maxargs):
        raise argerr_number(
            space, bytecode, name, len(namedargs_w) + len(args_w))

    vals_w = args_w + [None] * (num_args - len(args_w))
    for k, w_v in namedargs_w:
        try:
            index = bytecode.argmapping[k]
        except KeyError:
            raise argerr(space, "Function %s got unexpected keyword "
                "argument '%s'" % (name, k))
        if vals_w[index] is not None:
            raise argerr(space, "Function %s got multiple values for "
                "argument '%s'" % (name, k))
        vals_w[index] = w_v

    if bytecode.first_default >= 0:
        for i in range(bytecode.first_default, len(bytecode.defaults)):
            def_no = bytecode.defaults[i]
            if def_no != -1 and vals_w[i] is not None:
                vals_w[i] = bytecode.constants[def_no]

    for item in vals_w:
        if item is None:
            raise argerr(space, "Function %s didn't receive enough positional "
                "arguments" % (name,))

    return vals_w



class W_Function(W_Root):