Create enrollment term.

        Create a new enrollment term for the specified account.
331146
def create_enrollment_term(self, account_id, enrollment_term_end_at=None, enrollment_term_name=None, enrollment_term_sis_term_id=None, enrollment_term_start_at=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # OPTIONAL - enrollment_term[name]
        """The name of the term."""
        if enrollment_term_name is not None:
            data["enrollment_term[name]"] = enrollment_term_name

        # OPTIONAL - enrollment_term[start_at]
        """The day/time the term starts.
        Accepts times in ISO 8601 format, e.g. 2015-01-10T18:48:00Z."""
        if enrollment_term_start_at is not None:
            data["enrollment_term[start_at]"] = enrollment_term_start_at

        # OPTIONAL - enrollment_term[end_at]
        """The day/time the term ends.
        Accepts times in ISO 8601 format, e.g. 2015-01-10T18:48:00Z."""
        if enrollment_term_end_at is not None:
            data["enrollment_term[end_at]"] = enrollment_term_end_at

        # OPTIONAL - enrollment_term[sis_term_id]
        """The unique SIS identifier for the term."""
        if enrollment_term_sis_term_id is not None:
            data["enrollment_term[sis_term_id]"] = enrollment_term_sis_term_id

        self.logger.debug("POST /api/v1/accounts/{account_id}/terms with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/terms".format(**path), data=data, params=params, single_item=True)
901039
def new_term(self, term, value, **kwargs):
        """"""

        tc = self.doc.get_term_class(term.lower())

        t = tc(term, value, doc=self.doc, parent=None, section=self).new_children(**kwargs)

        self.doc.add_term(t)
        return t
113504
def create_account(self, **kwargs):
        
        response = self.__requester.request(
            'POST',
            'accounts',
            _kwargs=combine_kwargs(**kwargs)
        )
        return Account(self.__requester, response.json())
929224
def create_audit_student_enrollment(self, course_id):
        
        audit_enrollment = {
            "mode": "audit",
            "course_details": {"course_id": course_id}
        }
        # the request is done in behalf of the current logged in user
        resp = self.requester.post(
            urljoin(self.base_url, self.enrollment_url),
            json=audit_enrollment
        )
        resp.raise_for_status()
        return Enrollment(resp.json())
1369210
def create_user(self, claims):
        """"""
        email = claims.get('email')
        username = self.get_username(claims)
        return self.UserModel.objects.create_user(username, email)
437909
def pool_create(self, name, description, is_public):
        
        params = {'pool[name]': name, 'pool[description]': description,
                  'pool[is_public]': is_public}
        return self._get('pool/create', params, method='POST')
1022048
def create_group_category_accounts(self, name, account_id, auto_leader=None, create_group_count=None, group_limit=None, self_signup=None, split_group_count=None):
        
        path = {}
        data = {}
        params = {}

        # REQUIRED - PATH - account_id
        """ID"""
        path["account_id"] = account_id

        # REQUIRED - name
        """Name of the group category"""
        data["name"] = name

        # OPTIONAL - self_signup
        """Allow students to sign up for a group themselves (Course Only).
        valid values are:
        "enabled":: allows students to self sign up for any group in course
        "restricted":: allows students to self sign up only for groups in the
                       same section null disallows self sign up"""
        if self_signup is not None:
            self._validate_enum(self_signup, ["enabled", "restricted"])
            data["self_signup"] = self_signup

        # OPTIONAL - auto_leader
        """Assigns group leaders automatically when generating and allocating students to groups
        Valid values are:
        "first":: the first student to be allocated to a group is the leader
        "random":: a random student from all members is chosen as the leader"""
        if auto_leader is not None:
            self._validate_enum(auto_leader, ["first", "random"])
            data["auto_leader"] = auto_leader

        # OPTIONAL - group_limit
        """Limit the maximum number of users in each group (Course Only). Requires
        self signup."""
        if group_limit is not None:
            data["group_limit"] = group_limit

        # OPTIONAL - create_group_count
        """Create this number of groups (Course Only)."""
        if create_group_count is not None:
            data["create_group_count"] = create_group_count

        # OPTIONAL - split_group_count
        """(Deprecated)
        Create this number of groups, and evenly distribute students
        among them. not allowed with "enable_self_signup". because
        the group assignment happens synchronously, it's recommended
        that you instead use the assign_unassigned_members endpoint.
        (Course Only)"""
        if split_group_count is not None:
            data["split_group_count"] = split_group_count

        self.logger.debug("POST /api/v1/accounts/{account_id}/group_categories with query params: {params} and form data: {data}".format(params=params, data=data, **path))
        return self.generic_request("POST", "/api/v1/accounts/{account_id}/group_categories".format(**path), data=data, params=params, single_item=True)
225003
async def create(self, **kwargs):
        '''  '''
        return await super(EntryResource, self).create(user=self.request['user'])
163711
public Term createTerm(final String name, final String slug) throws SQLException {

      Connection conn = null;
      PreparedStatement stmt = null;
      ResultSet rs = null;
      Timer.Context ctx = metrics.createTermTimer.time();
      try {
         conn = connectionSupplier.getConnection();
         stmt = conn.prepareStatement(insertTermSQL, Statement.RETURN_GENERATED_KEYS);
         stmt.setString(1, name);
         stmt.setString(2, slug);
         stmt.executeUpdate();
         rs = stmt.getGeneratedKeys();
         if(rs.next()) {
            return new Term(rs.getLong(1), name, slug);
         } else {
            throw new SQLException("Problem creating term (no generated id)");
         }
      } finally {
         ctx.stop();
         closeQuietly(conn, stmt, rs);
      }
   }
1187351
async def create_account(self, **params):
		
		logging.debug("\n\n[+] -- Create account debugging. ")
		model = {
		"unique": ["email", "public_key"],
		"required": ("public_key",),
		"default": {"count":len(settings.AVAILABLE_COIN_ID), 
					"level":2, 
					"news_count":0, 
					"email":None},
		"optional": ("phone",)}

		message = json.loads(params.get("message", "{}"))
	
		data = {**message.get("message"), "public_key":message["public_key"]}

		# check if all required
		required = all([True if i in data.keys() else False for i in model["required"]])

		if not required:
			return {"error": 400,
					"reason":"Missed required fields"}

		# Unique constraint
		get_account = await self.collection.find_one({"public_key":data.get("public_key")})

		# Try get account with current public key
		if get_account:
			return {"error": 400,
					"reason": "Unique violation error"}

		# Reload data.
		row = {i:data[i] for i in data 
				if i in model["required"] or i in model["optional"]}
		row.update({i:model["default"][i] for i in model["default"]})
		if data.get("email"):
			row["email"] = data.get("email")
		row.update({"id":await self.autoincrement()})
		await self.collection.insert_one(row)
		account = await self.collection.find_one({"public_key":row["public_key"]})

		# Create wallets
		for coinid in coin_ids:
			database = client[coinid]
			wallet_collection = database[settings.WALLET]
			wallet = await wallet_collection.insert_one({
					"account_id": account["id"],
					"wallet": self.account.validator[coinid](account["public_key"]) 
				})
		return account
663380
function createAccount() {

  var acct = {
    givenName: 'Jean-Luc',
    surname: 'Picard',
    username: unique('jlpicard'),
    email: accountEmail,
    password: 'Changeme1!'
  };

  return application.createAccount(acct, function(err, createdAccount) {
    if (err) throw err;
    account = createdAccount;
    console.log('Created account:');
    console.log(account);
    return updateAccount(); //next quickstart step
  });
}
406812
def create(self, name, description, data_source_type,
               url, credential_user=None, credential_pass=None,
               is_public=None, is_protected=None, s3_credentials=None):
        """"""

        data = {
            'name': name,
            'description': description,
            'type': data_source_type,
            'url': url,
        }
        credentials = {}
        self._copy_if_defined(credentials,
                              user=credential_user,
                              password=credential_pass)
        credentials = credentials or s3_credentials
        self._copy_if_defined(data, is_public=is_public,
                              is_protected=is_protected,
                              credentials=credentials)

        return self._create('/data-sources', data, 'data_source')
1048640
def create(self, friendly_name=values.unset):
        
        data = values.of({'FriendlyName': friendly_name, })

        payload = self._version.create(
            'POST',
            self._uri,
            data=data,
        )

        return AccountInstance(self._version, payload, )
153011
public void createAccount() {
    mAccount = new AccountFactory(mAccountConfig).setHttpClient(httpclient).createAccount();
    mAccess = mAccount.getAccess();
    if (mRegion != null) {
      mAccess.setPreferredRegion(mRegion);
    }
  }
240124
def create(self, **kwargs):
        """"""
        if 'monitor' in kwargs:
            value = self._format_monitor_parameter(kwargs['monitor'])
            kwargs['monitor'] = value
        return super(Pool, self)._create(**kwargs)
1293768
async def insert(self, **kwargs):
		
		
		if kwargs:
			# Create autoincrement for account
			pk = await self.autoincrement()
			kwargs.update({"id": pk})

			# Create account with received data and autoincrement
			await self.collection.insert_one(kwargs)

			row = await self.collection.find_one({"id": pk})

		else:
			row = None

		if row:
			return {i:row[i] for i in row if i != "_id"}
		else:
			return {"error":500, 
					"reason":"Not created"}
100741
public static Requirement newInstance(String name)
    {
        Requirement requirement = new Requirement();
        requirement.setName(name);
        return requirement;
    }