code: def set_id_format(portal, format):
      
      bs = portal.bika_setup
      if 'portal_type' not in format:
          return
      logger.info("Applying format {} for {}".format(format.get('form', ''),
                                                     format.get(
                                                         'portal_type')))
      portal_type = format['portal_type']
      ids = list()
      id_map = bs.getIDFormatting()
      for record in id_map:
          if record.get('portal_type', '') == portal_type:
              continue
          ids.append(record)
      ids.append(format)
      bs.setIDFormatting(ids)
docs: Sets the id formatting in setup for the format provided