code: def get_type_id(context, **kw):
      
      portal_type = kw.get("portal_type", None)
      if portal_type:
          return portal_type
  
      # Override by provided marker interface
      if IAnalysisRequestPartition.providedBy(context):
          return "AnalysisRequestPartition"
      elif IAnalysisRequestRetest.providedBy(context):
          return "AnalysisRequestRetest"
      elif IAnalysisRequestSecondary.providedBy(context):
          return "AnalysisRequestSecondary"
  
      return api.get_portal_type(context)
docs: Returns the type id for the context passed in