def merge_endpoints(defaults, additions):
 for (service, region_info) in additions.items():
  defaults.setdefault(service, {})
  defaults[service].update(region_info)
 return defaults

def merge_endpoints ( defaults , additions ) : for ( service , region_info ) in additions . items ( ) : defaults . setdefault ( service , { } ) defaults [ service ] . update ( region_info ) return defaults
given an existing set of endpoint data .