def create_annotation_class(project, name, color, attribute_groups=None):
    'Create annotation class in project\n\n    :param project: project name or metadata of the project\n    :type project: str or dict\n    :param name: name for the class\n    :type name: str\n    :param color: RGB hex color value, e.g., "#FFFFAA"\n    :type color: str\n    :param attribute_groups: example:\n     [ { "name": "tall", "is_multiselect": 0, "attributes": [ { "name": "yes" }, { "name": "no" } ] },\n     { "name": "age", "is_multiselect": 0, "attributes": [ { "name": "young" }, { "name": "old" } ] } ]\n    :type attribute_groups: list of dicts\n\n    :return: new class metadata\n    :rtype: dict\n    '
    if (not isinstance(project, dict)):
        project = get_project_metadata(project)
    try:
        get_annotation_class_metadata(project, name)
    except SANonExistingAnnotationClassNameException:
        pass
    else:
        logger.warning('Annotation class %s already in project. Skipping.', name)
        return None
    (team_id, project_id) = (project['team_id'], project['id'])
    logger.info('Creating annotation class in project %s with name %s', project['name'], name)
    params = {'team_id': team_id, 'project_id': project_id}
    data = {'classes': [{'name': name, 'color': color, 'attribute_groups': (attribute_groups if (attribute_groups is not None) else [])}]}
    response = _api.send_request(req_type='POST', path='/classes', params=params, json_req=data)
    if (not response.ok):
        raise SABaseException(response.status_code, ("Couldn't create class " + response.text))
    res = response.json()
    new_class = res[0]
    return new_class
Create annotation class in project

:param project: project name or metadata of the project
:type project: str or dict
:param name: name for the class
:type name: str
:param color: RGB hex color value, e.g., "#FFFFAA"
:type color: str
:param attribute_groups: example:
 [ { "name": "tall", "is_multiselect": 0, "attributes": [ { "name": "yes" }, { "name": "no" } ] },
 { "name": "age", "is_multiselect": 0, "attributes": [ { "name": "young" }, { "name": "old" } ] } ]
:type attribute_groups: list of dicts

:return: new class metadata
:rtype: dict
def create_annotation_class(project, name, color, attribute_groups=None):
    'Create annotation class in project\n\n    :param project: project name or metadata of the project\n    :type project: str or dict\n    :param name: name for the class\n    :type name: str\n    :param color: RGB hex color value, e.g., "#FFFFAA"\n    :type color: str\n    :param attribute_groups: example:\n     [ { "name": "tall", "is_multiselect": 0, "attributes": [ { "name": "yes" }, { "name": "no" } ] },\n     { "name": "age", "is_multiselect": 0, "attributes": [ { "name": "young" }, { "name": "old" } ] } ]\n    :type attribute_groups: list of dicts\n\n    :return: new class metadata\n    :rtype: dict\n    '
    if (not isinstance(project, dict)):
        project = get_project_metadata(project)
    try:
        get_annotation_class_metadata(project, name)
    except SANonExistingAnnotationClassNameException:
        pass
    else:
        logger.warning('Annotation class %s already in project. Skipping.', name)
        return None
    (team_id, project_id) = (project['team_id'], project['id'])
    logger.info('Creating annotation class in project %s with name %s', project['name'], name)
    params = {'team_id': team_id, 'project_id': project_id}
    data = {'classes': [{'name': name, 'color': color, 'attribute_groups': (attribute_groups if (attribute_groups is not None) else [])}]}
    response = _api.send_request(req_type='POST', path='/classes', params=params, json_req=data)
    if (not response.ok):
        raise SABaseException(response.status_code, ("Couldn't create class " + response.text))
    res = response.json()
    new_class = res[0]
    return new_class