def METHOD_NAME(self, options):
    if options.editor is not None:
        return options.editor
    elif "VISUAL" in os.environ:
        return os.environ["VISUAL"]
    elif "EDITOR" in os.environ:
        return os.environ["EDITOR"]
    else:
        raise PipError("Could not determine editor to use.")