code: def requirement_is_installed(expr):
      
      required_dist = next(parse_requirements(expr))
      try:
          installed_dist = get_distribution(required_dist.key)
          return installed_dist in required_dist
      except DistributionNotFound:
          return False
docs: Check whether a requirement is installed.
  
      :param expr: A requirement specification similar to those used in pip
                   requirement files (a string).
      :returns: :data:`True` if the requirement is available (installed),
                :data:`False` otherwise.