<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def json_request(self, registration_ids, data=None, collapse_key=None, delay_while_idle=False, time_to_live=None, retries=5, dry_run=False):
 """ Makes a JSON request to GCM servers :param registration_ids: list of the registration ids :param data: dict mapping of key-value pairs of messages :return dict of response body from Google including multicast_id, success, failure, canonical_ids, etc :raises GCMMissingRegistrationException: if the list of registration_ids is empty :raises GCMTooManyRegIdsException: if the list of registration_ids exceeds 1000 items """


        if not registration_ids:
            raise GCMMissingRegistrationException("Missing registration_ids")
        if len(registration_ids) > 1000:
            raise GCMTooManyRegIdsException(
                "Exceded number of registration_ids")

        backoff = self.BACKOFF_INITIAL_DELAY
        for attempt in range(retries):
            payload = self.construct_payload(
                registration_ids, data, collapse_key,
                delay_while_idle, time_to_live, True, dry_run
            )
            response = self.make_request(payload, is_json=True)
            info = self.handle_json_response(response, registration_ids)

            unsent_reg_ids = self.extract_unsent_reg_ids(info)
            if unsent_reg_ids:
                registration_ids = unsent_reg_ids
                sleep_time = backoff / 2 + random.randrange(backoff)
                time.sleep(float(sleep_time) / 1000)
                if 2 * backoff < self.MAX_BACKOFF_DELAY:
                    backoff *= 2
            else:
                break
        return info