def get_dict_registry_services(registry, template_files, warn_missing_files=True):
    """
    Return a dict mapping service name to a dict containing the service's
    type ('fixtures', 'platform_services', 'application_services', 'internal_services'),
    the template file's absolute path, and a list of environments to which the
    service is intended to deploy.

    Service names that appear twice in the output list will emit a warning and
    ignore the latter records.

    Services which have no template file will not appear in the returned dict.
    If the `warn_missing_files` boolean is True these files will emit a warning.
    """
    with open(registry) as fr:
        parsed_registry = json.load(fr)

    services = {}
    for type, type_services in parsed_registry.iteritems():
        for name, service in type_services.iteritems():
            if name in services:
                logger.warning("Template name appears twice, ignoring later items: `%s`", name)
                continue

            template_file = get_matching_service_template_file(name, template_files)
            if not template_file:
                if warn_missing_files:
                    logger.warning("No template file for `%s` (%s) `%s`", type, service['type'], name)
                continue

            services[name] = {
                'type': type,
                'template_file': template_file,
                'environments': service['environments']
            }

    return services