class_docstr: Sets up an Amazon SageMaker Collection.
docstr: Adds a list of Model Groups to a Collection.
  
  Args:
      collection_name (str): The name of the Collection.
      model_groups (List[str]): The names of the Model Groups to add to the Collection.
docstr_tok: ["Adds","a","list","of","Model","Groups","to","a","Collection",".","Args",":","collection_name","(","str",")",":","The","name","of","the","Collection",".","model_groups","(","List","[","str","]",")",":","The","names","of","the","Model","Groups","to","add","to","the","Collection","."]
code: def add_model_groups(
      self, collection_name: str, model_groups: List[str]
  ):
      """Adds a list of Model Groups to a Collection.
  
      Args:
          collection_name (str): The name of the Collection.
          model_groups (List[str]): The names of the Model Groups to add to the Collection.
      """
      if len(model_groups) > 10:
          raise Exception(
              "Model groups can have a maximum length of 10"
          )
      tag_rules = self._get_collection_tag_rule(
          collection_name=collection_name
      )
      tag_rule_key = tag_rules["tag_rule_key"]
      tag_rule_value = tag_rules["tag_rule_value"]
  
      add_groups_success = []
      add_groups_failure = []
      if tag_rule_key is not None and tag_rule_value is not None:
          for model_group in model_groups:
              try:
                  self._add_model_group(
                      model_package_group=model_group,
                      tag_rule_key=tag_rule_key,
                      tag_rule_value=tag_rule_value,
                  )
                  add_groups_success.append(model_group)
              except ClientError as e:
                  self._check_access_error(err=e)
                  message = e.response["Error"]["Message"]
                  add_groups_failure.append(
                      {
                          "model_group": model_group,
                          "failure_reason": message,
                      }
                  )
      return {
          "added_groups": add_groups_success,
          "failure": add_groups_failure,
      }
  
imports: from __future__ import absolute_import
  import json
  import time
  from typing import List
  from botocore.exceptions import ClientError
  from sagemaker.session import Session
label_desc: Use image node_id 8 for calling the Collection obj's underlying member method code with example usage: obj.add_model_groups(collection_name, model_groups) and returns: dict