class_docstr: Parse a requirement.
  
  Parse a given requirement string into its parts, such as name, specifier,
  URL, and extras. Raises InvalidRequirement on a badly-formed requirement
  string.
code: def __init__(self, requirement_string):
      try:
          req = REQUIREMENT.parseString(requirement_string)
      except ParseException as e:
          raise InvalidRequirement(
              'Invalid requirement, parse error at "{0!r}"'.format(
                  requirement_string[e.loc : e.loc + 8]
              )
          )
  
      self.name = req.name
      if req.url:
          parsed_url = urlparse.urlparse(req.url)
          if not (parsed_url.scheme and parsed_url.netloc) or (
              not parsed_url.scheme and not parsed_url.netloc
          ):
              raise InvalidRequirement("Invalid URL given")
          self.url = req.url
      else:
          self.url = None
      self.extras = set(req.extras.asList() if req.extras else [])
      self.specifier = SpecifierSet(req.specifier)
      self.marker = req.marker if req.marker else None
  
file_path: catboost/contrib/python/setuptools/py2/pkg_resources/_vendor/packaging/requirements.py
imports: from __future__ import absolute_import, division, print_function
  import string
  import re
  from pkg_resources.extern.pyparsing import stringStart, stringEnd, originalTextFor, ParseException
  from pkg_resources.extern.pyparsing import ZeroOrMore, Word, Optional, Regex, Combine
  from pkg_resources.extern.pyparsing import Literal
  from pkg_resources.extern.six.moves.urllib import parse
  from .markers import MARKER_EXPR, Marker
  from .specifiers import LegacySpecifier, Specifier, SpecifierSet
label_desc: Use image node_id 1 to create a new Requirement object from inherited base classes: object with example: obj = Requirement(requirement_string)