code: def format_specifier(ireq):
      
      # TODO: Ideally, this is carried over to the pip library itself
      specs = ireq.specifier._specs if ireq.req is not None else []
      specs = sorted(specs, key=lambda x: x._spec[1])
      return ",".join(str(s) for s in specs) or "<any>"
docs: Generic formatter for pretty printing the specifier part of
      InstallRequirements to the terminal.