@classdef.method("initialize", filename="path")
    def method_initialize(self, space, filename, w_mode=None, w_perm_or_opt=None, w_opt=None):
        if w_mode is None:
            w_mode = space.w_nil
        if w_perm_or_opt is None:
            w_perm_or_opt = space.w_nil
        if w_opt is None:
            w_opt = space.w_nil
        if isinstance(w_perm_or_opt, W_HashObject):
            assert w_opt is space.w_nil
            perm = 0665
            w_opt = w_perm_or_opt
        elif w_opt is not space.w_nil:
            perm = space.int_w(w_perm_or_opt)
        else:
            perm = 0665
        mode, encoding = map_filemode(space, w_mode)
        if w_perm_or_opt is not space.w_nil or w_opt is not space.w_nil:
            raise space.error(space.w_NotImplementedError, "options hash or permissions for File.new")
        try:
            self.fd = os.open(filename, mode, perm)
        except __HOLE__ as e:
            raise error_for_oserror(space, e)
        self.filename = filename
        return self
dataset/ETHPy150Open topazproject/topaz/topaz/objects/fileobject.py/W_FileObject.method_initialize