class_docstr: Restrict operations to a single subdirectory - pseudo-chroot
class_docstr_tok: ["Restrict","operations","to","a","single","subdirectory","-","pseudo-chroot"]
docstr: Called for low-level os.open()
code: def open(self, file, flags, mode=0o777, *args, **kw):
      """Called for low-level os.open()"""
      if flags & WRITE_FLAGS and not self._ok(file):
          self._violation("os.open", file, flags, mode, *args, **kw)
      return _os.open(file, flags, mode, *args, **kw)
  
imports: import os
  import sys
  import tempfile
  import operator
  import functools
  import itertools
  import re
  import contextlib
  import pickle
  import textwrap
  import builtins
  import pkg_resources
  from distutils.errors import DistutilsError
  from pkg_resources import working_set
label_desc: Use image node_id 9 for calling the DirectorySandbox obj's underlying member method code with example usage: obj.open(file, flags, mode) and returns: _os