<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def install_def(self, name, dstmt, def_map, interleave=False):
 """Install definition `name` into the appropriate dictionary. `dstmt` is the definition statement ('typedef' or 'grouping') that is to be mapped to a RELAX NG named pattern '<define name="`name`">'. `def_map` must be either `self.local_defs` or `self.global_defs`. `interleave` determines the interleave status inside the definition. """

        delem = SchemaNode.define(name, interleave=interleave)
        delem.attr["name"] = name
        def_map[name] = delem
        if def_map is self.global_defs: self.gg_level += 1
        self.handle_substmts(dstmt, delem)
        if def_map is self.global_defs: self.gg_level -= 1