def _is_valid_requirement(requirement: str) -> bool:
  """Returns True is the `requirement.txt` line is valid."""
  is_invalid = (
      not requirement or  # Empty line
      requirement.startswith('#') or  # Comment
      requirement.startswith('-r ')  # Filter the `-r requirement.txt`
  )
  return not is_invalid