code: def contained_in(filename, directory):
      
      filename = os.path.normcase(os.path.abspath(filename))
      directory = os.path.normcase(os.path.abspath(directory))
      return os.path.commonprefix([filename, directory]) == directory
docs: Test if a file is located within the given directory.