code: def create(container, portal_type, *args, **kwargs):
      
      from bika.lims.utils import tmpID
      if kwargs.get("title") is None:
          kwargs["title"] = "New {}".format(portal_type)
  
      # generate a temporary ID
      tmp_id = tmpID()
  
      # get the fti
      types_tool = get_tool("portal_types")
      fti = types_tool.getTypeInfo(portal_type)
  
      if fti.product:
          obj = _createObjectByType(portal_type, container, tmp_id)
      else:
          # newstyle factory
          factory = getUtility(IFactory, fti.factory)
          obj = factory(tmp_id, *args, **kwargs)
          if hasattr(obj, '_setPortalTypeName'):
              obj._setPortalTypeName(fti.getId())
          notify(ObjectCreatedEvent(obj))
          # notifies ObjectWillBeAddedEvent, ObjectAddedEvent and
          # ContainerModifiedEvent
          container._setObject(tmp_id, obj)
          # we get the object here with the current object id, as it might be
          # renamed already by an event handler
          obj = container._getOb(obj.getId())
  
      # handle AT Content
      if is_at_content(obj):
          obj.processForm()
  
      # Edit after processForm; processForm does AT unmarkCreationFlag.
      obj.edit(**kwargs)
  
      # explicit notification
      modified(obj)
      return obj
docs: Creates an object in Bika LIMS
  
      This code uses most of the parts from the TypesTool
      see: `Products.CMFCore.TypesTool._constructInstance`
  
      :param container: container
      :type container: ATContentType/DexterityContentType/CatalogBrain
      :param portal_type: The portal type to create, e.g. "Client"
      :type portal_type: string
      :param title: The title for the new content object
      :type title: string
      :returns: The new created object