class_docstr: Restrict operations to a single subdirectory - pseudo-chroot
class_docstr_tok: ["Restrict","operations","to","a","single","subdirectory","-","pseudo-chroot"]
docstr: Called for path inputs
code: def _remap_input(self, operation, path, *args, **kw):
      """Called for path inputs"""
      if operation in self.write_ops and not self._ok(path):
          self._violation(
              operation, os.path.realpath(path), *args, **kw
          )
      return path
  
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 7 for calling the DirectorySandbox obj's underlying member method code with example usage: obj._remap_input(operation, path) and returns: path