def create_activity(self, activity_form=None):
if activity_form is None:<EOL><INDENT>raise NullArgument()<EOL><DEDENT>if not isinstance(activity_form, abc_learning_objects.ActivityForm):<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>if activity_form.is_for_update():<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>try:<EOL><INDENT>if self._forms[activity_form.get_id().get_identifier()] == CREATED:<EOL><INDENT>raise IllegalState('<STR_LIT>')<EOL><DEDENT><DEDENT>except KeyError:<EOL><INDENT>raise Unsupported('<STR_LIT>')<EOL><DEDENT>if not activity_form.is_valid():<EOL><INDENT>raise InvalidArgument('<STR_LIT>')<EOL><DEDENT>url_path = construct_url('<STR_LIT>',<EOL>bank_id=self._catalog_idstr)<EOL>try:<EOL><INDENT>result = self._post_request(url_path, activity_form._my_map)<EOL><DEDENT>except Exception:<EOL><INDENT>raise  <EOL><DEDENT>self._forms[activity_form.get_id().get_identifier()] = CREATED<EOL>return objects.Activity(result)<EOL>
Creates a new Activity.

        arg:    activityForm (osid.learning.ActivityForm): the form for
                this Activity
        return: (osid.learning.Activity) - the new Activity
        raise:  IllegalState - activityForm already used in a create
                transaction
        raise:  InvalidArgument - one or more of the form elements is
                invalid
        raise:  NullArgument - activityForm is null
        raise:  OperationFailed - unable to complete request
        raise:  PermissionDenied - authorization failure
        raise:  Unsupported - activityForm did not originate from
                get_activity_form_for_create()
        compliance: mandatory - This method must be implemented.