def iter_packages(name, range_=None, paths=None):
entries = _get_families(name, paths)<EOL>seen = set()<EOL>for repo, family_resource in entries:<EOL><INDENT>for package_resource in repo.iter_packages(family_resource):<EOL><INDENT>key = (package_resource.name, package_resource.version)<EOL>if key in seen:<EOL><INDENT>continue<EOL><DEDENT>seen.add(key)<EOL>if range_:<EOL><INDENT>if isinstance(range_, basestring):<EOL><INDENT>range_ = VersionRange(range_)<EOL><DEDENT>if package_resource.version not in range_:<EOL><INDENT>continue<EOL><DEDENT><DEDENT>yield Package(package_resource)<EOL><DEDENT><DEDENT>
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.