@staticmethod
  def remove_unused_links(dirpath, required_links):
    """Recursively remove any links in dirpath which are not contained in required_links.

    :param str dirpath: Absolute path of directory to search.
    :param container required_links: Container of "in use" links which should not be removed,
                                     where each link is an absolute path.
    """
    for root, dirs, files in os.walk(dirpath):
      for p in chain(dirs, files):
        p = os.path.join(root, p)
        if os.path.islink(p) and required_links not in p:
          os.unlink(p)
dataset/ETHPy150Open pantsbuild/pants/contrib/go/src/python/pants/contrib/go/tasks/go_workspace_task.py/GoWorkspaceTask.remove_unused_links/swapped operands of `not in`