parameters: (self, name, version=None)
docstring: Iterates over all distributions to find which distributions provide *name*.
          If a *version* is provided, it will be used to filter the results.
  
          This function only returns the first result found, since no more than
          one values are expected. If the directory is not found, returns ``None``.
  
          :parameter version: a version specifier that indicates the version
                              required, conforming to the format in ``PEP-345``
  
          :type name: string
          :type version: string
docstring_summary: Iterates over all distributions to find which distributions provide *name*.
          If a *version* is provided, it will be used to filter the results.
docstring_tokens: Iterates over all distributions to find which distributions provide * name * . If a * version * is provided it will be used to filter the results .
function: def provides_distribution(self, name, version=None):
          """
          Iterates over all distributions to find which distributions provide *name*.
          If a *version* is provided, it will be used to filter the results.
  
          This function only returns the first result found, since no more than
          one values are expected. If the directory is not found, returns ``None``.
  
          :parameter version: a version specifier that indicates the version
                              required, conforming to the format in ``PEP-345``
  
          :type name: string
          :type version: string
          """
          matcher = None
          if not version is None:
              try:
                  matcher = self._scheme.matcher('%s (%s)' % (name, version))
              except ValueError:
                  raise DistlibException('invalid name or version: %r, %r' %
                                        (name, version))
  
          for dist in self.get_distributions():
              provided = dist.provides
  
              for p in provided:
                  p_name, p_ver = parse_name_and_version(p)
                  if matcher is None:
                      if p_name == name:
                          yield dist
                          break
                  else:
                      if p_name == name and matcher.match(p_ver):
                          yield dist
                          break
function_tokens: def provides_distribution ( self , name , version = None ) : matcher = None if not version is None : try : matcher = self . _scheme . matcher ( '%s (%s)' % ( name , version ) ) except ValueError : raise DistlibException ( 'invalid name or version: %r, %r' % ( name , version ) ) for dist in self . get_distributions ( ) : provided = dist . provides for p in provided : p_name , p_ver = parse_name_and_version ( p ) if matcher is None : if p_name == name : yield dist break else : if p_name == name and matcher . match ( p_ver ) : yield dist break