code: def _extract_id_from_batch_response(r, name='id'):
          
          names = name + 's'
          if names in r:
              # soon-to-be deprecated batch reponse
              if 'errors' in r and r['errors']:
                  raise GeneralException(r['errors'][0]['desc'])
              id = r[names][0]
          else:
              # new-style simplified api response
              id = r[name]
          return int(id)
docs: Unholy, forward-compatible, mess for extraction of id/oid from a
          soon-to-be (deprecated) batch response.