With this function you can create multiple milestones in a single
        request. See the "create" function for a description of the individual
        fields in the milestone.
18773
def create_milestones(self, project_id, milestones):
        
        path = '/projects/%u/milestones/create' % project_id
        req = ET.Element('request')
        for milestone in milestones:
            req.append(self._create_milestone_elem(*milestone))
        return self._request(path, req)
196456
def create(self, request):
        
        if self.readonly:
            return HTTPMethodNotAllowed(headers={'Allow': 'GET, HEAD'})
        collection = loads(request.body, object_hook=GeoJSON.to_instance)
        if not isinstance(collection, FeatureCollection):
            return HTTPBadRequest()
        session = self.Session()
        objects = []
        for feature in collection.features:
            create = False
            obj = None
            if hasattr(feature, 'id') and feature.id is not None:
                obj = session.query(self.mapped_class).get(feature.id)
            if self.before_create is not None:
                self.before_create(request, feature, obj)
            if obj is None:
                obj = self.mapped_class(feature)
                create = True
            else:
                obj.__update__(feature)
            if create:
                session.add(obj)
            objects.append(obj)
        session.flush()
        collection = FeatureCollection(objects) if len(objects) > 0 else None
        request.response.status_int = 201
        return collection
694812
def tickets_create_many(self, data, **kwargs):
        ""
        api_path = "/api/v2/tickets/create_many.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
425925
function createFunctions(chunkDefinition) {

	// all the field names used to build the key for a record and a name to store the hash
	const keyHashFields = chunkDefinition.keyHashFields;
	const keyHashName = chunkDefinition.keyHashName;

	// all the field names used to build the content hash for a record and a name to store the hash
	const contentHashFields = chunkDefinition.contentHashFields;
	const contentHashName = chunkDefinition.contentHashName;

	// all the field names used to build the content hash for a record and a name to store the hash
	const scopeHashFields = chunkDefinition.scopeHashFields;
	const scopeHashName = chunkDefinition.scopeHashName;

	if (keyHashName === undefined || keyHashName === null || keyHashFields === undefined) {
		throw ("No 'keyHashFields' and 'keyHashName' are given.");
	}

	if (contentHashFields) {
		if (contentHashName === undefined || contentHashName === null) {
			throw ("No 'contentHashName' given in the chunk definition, but the 'contentHashFields' are defined");
		}
	}

	if (scopeHashFields) {
		if (scopeHashName === undefined || scopeHashName === null) {
			throw ("No 'scopeHashName' given in the chunk definition, but the 'scopeHashFields' are defined");
		}
	}

	let functions = [];
	// create the key hash functions
	functions.push(createHashFunction(keyHashFields, keyHashName));

	// create the content hash functions
	if (contentHashFields && contentHashFields.length > 0) {
		functions.push(createHashFunction(contentHashFields, contentHashName));
	}

	// create the scope hash functions
	if (scopeHashFields && scopeHashFields.length > 0) {
		functions.push(createHashFunction(scopeHashFields, scopeHashName));
	}

	return functions;
}
824826
public static File create(Map<String, Object> params, RequestOptions options)
      throws StripeException {
    return multipartRequest(RequestMethod.POST, classUrl(File.class, Stripe.getUploadBase()),
        params, File.class, options);
  }
623412
function create(callback, payee, name) {
  if(!util.isFunction(callback)) {
    throw new Error('callback must be a function');
  }

  var resource = this.coinjar.personal.api_endpoint + '/v1/contacts.json',
    query = {
      contact : {}
    };

  if(payee) { query.contact.payee = payee; }
  if(name) { query.contact.name = name; }

  request.post(resource)
    .auth(this.coinjar.personal.auth_token)
    .send(query)
    .end(function (response) {
      if(isResponseError(response, callback)) { return; }
      return callback(null, response.body.contact);
    });
}
529095
def _create_create_tracking_event(instance):
    
    event = _create_event(instance, CREATE)
    for field in instance._tracked_fields:
        if not isinstance(instance._meta.get_field(field), ManyToManyField):
            _create_tracked_field(event, instance, field)
150676
function makePoint() {
      // Pull start time from req and log responseTime
      var responseTime = Date.now() - req.start;
      
      // Add the new point to the batch of points
      batch.points.push({
        measurement: "requests",
        "tags": {
          "path": req.path,
          "host": req.hostname,
          "verb": req.method,
          "status": res.statusCode,
        },
        "fields": {
          "responseTime": responseTime,
        },
      })
      
      // Emit the 'addPoint' event
      batch.emit("addPoint")
    }
502834
function incrementDocument(params) {
  var doc = (collections[params.collection] || {})[params.id]

  if (doc !== undefined) {
    doc[params.key] = (doc[params.key] || 0) + (params.by || 1)

    eventEmitter.emit('documentIncremented', params.collection, doc)
  }
}
1285252
protected final InitiateMultipartUploadRequest newInitiateMultipartUploadRequest(
            UploadObjectRequest req) {
        return new InitiateMultipartUploadRequest(
                req.getBucketName(), req.getKey(), req.getMetadata())
            .withRedirectLocation(req.getRedirectLocation())
            .withSSEAwsKeyManagementParams(req.getSSEAwsKeyManagementParams())
            .withSSECustomerKey(req.getSSECustomerKey())
            .withStorageClass(req.getStorageClass())
            .withAccessControlList(req.getAccessControlList())
            .withCannedACL(req.getCannedAcl())
            .withGeneralProgressListener(req.getGeneralProgressListener())
            .withRequestMetricCollector(req.getRequestMetricCollector())
            ;
    }
1134989
def create(self, datapath, tracker_urls, comment=None, root_name=None,
                     created_by=None, private=False, no_date=False, progress=None,
                     callback=None):
        
        if datapath:
            self.datapath = datapath

        try:
            tracker_urls = ['' + tracker_urls]
        except TypeError:
            tracker_urls = list(tracker_urls)
        multi_mode = len(tracker_urls) > 1

        # TODO add optimization so the hashing happens only once for multiple URLs!
        for tracker_url in tracker_urls:
            # Lookup announce URLs from config file
            try:
                if urlparse.urlparse(tracker_url).scheme:
                    tracker_alias = urlparse.urlparse(tracker_url).netloc.split(':')[0].split('.')
                    tracker_alias = tracker_alias[-2 if len(tracker_alias) > 1 else 0]
                else:
                    tracker_alias, tracker_url = config.lookup_announce_alias(tracker_url)
                    tracker_url = tracker_url[0]
            except (KeyError, IndexError):
                raise error.UserError("Bad tracker URL %r, or unknown alias!" % (tracker_url,))

            # Determine metafile name
            output_name = self.filename
            if multi_mode:
                # Add 2nd level of announce URL domain to metafile name
                output_name = list(os.path.splitext(output_name))
                try:
                    output_name[1:1] = '-' + tracker_alias
                except (IndexError,):
                    self.LOG.error("Malformed announce URL %r, skipping!" % (tracker_url,))
                    continue
                output_name = ''.join(output_name)

            # Hash the data
            self.LOG.info("Creating %r for %s %r..." % (
                output_name, "filenames read from" if self._fifo else "data in", self.datapath,
            ))
            meta, _ = self._make_meta(tracker_url, root_name, private, progress)

            # Add optional fields
            if comment:
                meta["comment"] = comment
            if created_by:
                meta["created by"] = created_by
            if not no_date:
                meta["creation date"] = int(time.time())
            if callback:
                callback(meta)

            # Write metafile to disk
            self.LOG.debug("Writing %r..." % (output_name,))
            bencode.bwrite(output_name, meta)

        return meta
452110
public CreateResponse create(CreateRequest request) {
    return call(
      new PostRequest(path("create"))
        .setParam("name", request.getName())
        .setParam("organization", request.getOrganization()),
      CreateResponse.parser());
  }
773097
def create_todo_list(self, project_id, milestone_id=None, private=None,
        tracked=False, name=None, description=None, template_id=None):
        
        path = '/projects/%u/todos/create_list' % project_id
        req = ET.Element('request')
        if milestone_id is not None:
            ET.SubElement('milestone-id').text = str(milestone_id)
        if private is not None:
            ET.SubElement('private').text = str(bool(private)).lower()
        ET.SubElement('tracked').text = str(bool(tracked)).lower()
        if name is not None:
            ET.SubElement('name').text = str(name)
            ET.SubElement('description').text = str(description)
        if template_id is not None:
            ET.SubElement('use-template').text = 'true'
            ET.SubElement('template-id').text = str(int(template_id))
        return self._request(path, req)
1070171
public function createIssue(string $title, string $body = '', string $assignee = '', int $milestone = 0,
                                array $labels = []): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/repos/:owner/:repo/issues', $this->getOwner(),
            $this->getRepo()), Request::METHOD_POST, [
                'title'     => $title,
                'body'      => $body,
                'assignee'  => $assignee,
                'milestone' => $milestone,
                'labels'    => $labels
            ]);
    }
85437
def create(callback=None, path=None, method=Method.POST, resource=None, tags=None, summary="Create a new resource",
           middleware=None):
    # type: (Callable, Path, Methods, Resource, Tags, str, List[Any]) -> Operation
    
    def inner(c):
        op = ResourceOperation(c, path or NoPath, method, resource, tags, summary, middleware)
        op.responses.add(Response(HTTPStatus.CREATED, "{name} has been created"))
        op.responses.add(Response(HTTPStatus.BAD_REQUEST, "Validation failed.", Error))
        return op
    return inner(callback) if callback else inner
783987
def users_create_many(self, data, **kwargs):
        ""
        api_path = "/api/v2/users/create_many.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
74352
def add_child(self, arc_element_type, description=None, story_element_node=None, **kwargs):
        '''
        
        '''
        if 'mile' in arc_element_type:
            if 'mile' in self.arc_element_type:
                raise ArcGenerationError('You cannot have a milestone as a child to another milestone.')
            if self.get_depth() == 1:
                nodes_to_check = self.get_descendants().filter(arc_element_type__icontains='mile')
            else:
                nodes_to_check = self.get_root().get_descendants().filter(arc_element_type__icontains='mile')
            for node in nodes_to_check:
                if node.arc_element_type == arc_element_type:
                    raise ArcIntegrityError('You cannot have two of the same milestone in the same arc.')
        return super().add_child(
            arc=self.arc,
            arc_element_type=arc_element_type,
            description=description,
            story_element_node=story_element_node
        )