@staticmethod
  def work_dir_context_for_path(path, config):
    '''
    Retrieve a WorkingDir enclosing a given path. Also return the relative
    path and enclosing scope for the given path. Useful for defaults for
    commands.
    '''
    pairs = WorkingDir.work_dirs_for_path(path, require=False)
    if len(pairs) > 0:
      (work_dir, rel_path) = pairs[0]
      work = WorkingDir(work_dir, config)
      scope = work.enclosing_scope(rel_path)
      return (work, rel_path, scope)
    else:
      return (None, None, None)
dataset/ETHPy150Open bloomreach/zinc/zinc.py/WorkingDir.work_dir_context_for_path/original