code: def iter_packages(name, range_=None, paths=None):
      
      entries = _get_families(name, paths)
  
      seen = set()
      for repo, family_resource in entries:
          for package_resource in repo.iter_packages(family_resource):
              key = (package_resource.name, package_resource.version)
              if key in seen:
                  continue
  
              seen.add(key)
              if range_:
                  if isinstance(range_, basestring):
                      range_ = VersionRange(range_)
                  if package_resource.version not in range_:
                      continue
  
              yield Package(package_resource)
docs: Iterate over `Package` instances, in no particular order.
  
      Packages of the same name and version earlier in the search path take
      precedence - equivalent packages later in the paths are ignored. Packages
      are not returned in any specific order.
  
      Args:
          name (str): Name of the package, eg 'maya'.
          range_ (VersionRange or str): If provided, limits the versions returned
              to those in `range_`.
          paths (list of str, optional): paths to search for packages, defaults
              to `config.packages_path`.
  
      Returns:
          `Package` iterator.