def add(self, *args, **kwargs):
for key in kwargs:<EOL><INDENT>if isinstance(kwargs[key], str):<EOL><INDENT>self._children[key] = File(kwargs[key])<EOL><DEDENT>else:<EOL><INDENT>self._children[key] = kwargs[key]<EOL><DEDENT>self._children[key]._parent = self<EOL>self._children[key]._env = self._env<EOL><DEDENT>added = []<EOL>for arg in args:<EOL><INDENT>if isinstance(arg, File):<EOL><INDENT>self._children[arg.name] = arg<EOL>self._children[arg.name]._parent = self<EOL>self._children[arg.name]._env = self._env<EOL><DEDENT>elif isinstance(arg, str):<EOL><INDENT>f = File(arg)<EOL>added.append(f)<EOL>self._children[arg] = f<EOL>self._children[arg]._parent = self<EOL>self._children[arg]._env = self._env<EOL><DEDENT>else:<EOL><INDENT>raise TypeError(type(arg))<EOL><DEDENT><DEDENT>if len(added) == <NUM_LIT:1>:<EOL><INDENT>return added[<NUM_LIT:0>]<EOL><DEDENT>if len(args) == <NUM_LIT:1>:<EOL><INDENT>return args[<NUM_LIT:0>]<EOL><DEDENT>
Add objects to the directory.