Creates a new CRFDatum from the preprocessed allData format, given the
document number, position number, and a List of Object labels.

@return A new CRFDatum
3451
protected List<CRFDatum> extractDatumSequence(int[][][] allData, int beginPosition, int endPosition,
      List<IN> labeledWordInfos) {
    List<CRFDatum> result = new ArrayList<CRFDatum>();
    int beginContext = beginPosition - windowSize + 1;
    if (beginContext < 0) {
      beginContext = 0;
    }
    // for the beginning context, add some dummy datums with no features!
    // TODO: is there any better way to do this?
    for (int position = beginContext; position < beginPosition; position++) {
      List<Collection<String>> cliqueFeatures = new ArrayList<Collection<String>>();
      for (int i = 0; i < windowSize; i++) {
        // create a feature list
        cliqueFeatures.add(Collections.<String>emptyList());
      }
      CRFDatum<Collection<String>, String> datum = new CRFDatum<Collection<String>, String>(cliqueFeatures,
              labeledWordInfos.get(position).get(AnswerAnnotation.class));
      result.add(datum);
    }
    // now add the real datums
    for (int position = beginPosition; position <= endPosition; position++) {
      List<Collection<String>> cliqueFeatures = new ArrayList<Collection<String>>();
      for (int i = 0; i < windowSize; i++) {
        // create a feature list
        Collection<String> features = new ArrayList<String>();
        for (int j = 0; j < allData[position][i].length; j++) {
          features.add(featureIndex.get(allData[position][i][j]));
        }
        cliqueFeatures.add(features);
      }
      CRFDatum<Collection<String>,String> datum = new CRFDatum<Collection<String>,String>(cliqueFeatures,
              labeledWordInfos.get(position).get(AnswerAnnotation.class));
      result.add(datum);
    }
    return result;
  }
755168
@Override
    public Object createExample() {
        AnnotationDto result = new AnnotationDto();
        Map<String, String> sampleFields = new HashMap<>();

        fields.put("fieldName", "fieldValue");
        result.setFields(sampleFields);
        result.setId("datasourceSpecificUniqueID");
        result.setMetric("metric");
        result.setScope("scope");
        result.setSource("splunk");

        Map<String, String> sampleTags = new HashMap<>();

        sampleTags.put("tagk", "tagv");
        result.setTags(sampleTags);
        result.setTimestamp(System.currentTimeMillis());
        result.setType("erelease");
        return result;
    }
1151780
private static ColumnMapping createPartialColumnMapping(int columnNumber, final Optional<CsvPartial> partialAnno,
            final Optional<String> suppliedHeader) {
        
        final ColumnMapping columnMapping = new ColumnMapping();
        columnMapping.setNumber(columnNumber);
        columnMapping.setPartialized(true);
        
        String label = String.format("column%d", columnNumber);
        
        if(suppliedHeader.isPresent()) {
            label = suppliedHeader.get();
        }
        
        if(partialAnno.isPresent()) {
            for(CsvPartial.Header header : partialAnno.get().headers()) {
                if(header.number() == columnNumber) {
                    label = header.label();
                    break;
                }
            }
        }
        columnMapping.setLabel(label);
        
        return columnMapping;
        
    }
1203649
@Deprecated
    public static JavaRDD<DataSet> fromContinuousLabeledPoint(JavaSparkContext sc, JavaRDD<LabeledPoint> data) {

        return data.map(new Function<LabeledPoint, DataSet>() {
            @Override
            public DataSet call(LabeledPoint lp) {
                return convertToDataset(lp);
            }
        });
    }
1068270
public LofDataSet deepCopy()
    {
        LofDataSet result = new LofDataSet();
        result.getDataIdList().addAll(this.dataIdList);
        Collection<LofPoint> pointList = this.dataMap.values();
        for (LofPoint targetPoint : pointList)
        {
            result.getDataMap().put(targetPoint.getDataId(), targetPoint.deepCopy());
        }

        return result;
    }
1256115
protected Map<String, Object> getSendableData()
    {
        Map<String, Object> doc = new LinkedHashMap<String, Object>();

        MapUtil.put(doc, docTypeField, docType);
        MapUtil.put(doc, docVersionField, docVersion);
        MapUtil.put(doc, activeField, true);
        MapUtil.put(doc, resourceDataTypeField, resourceDataType);
        Map<String, Object> docId = new HashMap<String, Object>();
        MapUtil.put(docId, submitterTypeField, submitterType);
        MapUtil.put(docId, submitterField, submitter);
        MapUtil.put(docId, curatorField, curator);
        MapUtil.put(docId, ownerField, owner);
        MapUtil.put(docId, signerField, signer);
        MapUtil.put(doc, identityField, docId);
        MapUtil.put(doc, submitterTTLField, submitterTTL);
        Map<String, Object> docTOS = new HashMap<String, Object>();
        MapUtil.put(docTOS, submissionTOSField, submissionTOS);
        MapUtil.put(docTOS, submissionAttributionField, submissionAttribution);
        MapUtil.put(doc, TOSField, docTOS);
        MapUtil.put(doc, resourceLocatorField, resourceLocator);
        MapUtil.put(doc, payloadPlacementField, payloadPlacement);
        MapUtil.put(doc, payloadSchemaField, payloadSchema);
        MapUtil.put(doc, payloadSchemaLocatorField, payloadSchemaLocator);
        MapUtil.put(doc, keysField, tags);
        MapUtil.put(doc, resourceDataField, getEncodedResourceData());
        MapUtil.put(doc, replacesField, replaces);

        if (signed)
        {
            Map<String, Object> sig = new HashMap<String, Object>();
            String[] keys = {publicKeyLocation};
            MapUtil.put(sig, keyLocationField, keys);
            MapUtil.put(sig, signingMethodField, signingMethod);
            MapUtil.put(sig, signatureField, clearSignedMessage);
            MapUtil.put(doc, digitalSignatureField, sig);
        }

        return doc;
    }
1014226
public static JavaRDD<LabeledPoint> fromDataSet(JavaRDD<DataSet> data, boolean preCache) {
        if (preCache && !data.getStorageLevel().useMemory()) {
            data.cache();
        }
        return data.map(new Function<DataSet, LabeledPoint>() {
            @Override
            public LabeledPoint call(DataSet dataSet) {
                return toLabeledPoint(dataSet);
            }
        });
    }
646412
public static RawData sp2nbsp(Object data) {
        return new RawData(StringEscapeUtils.escapeHtml4(str(data)).replace(" ", "&nbsp;"));
    }
1108490
public static Document newDocument() throws AlipayApiException {
        Document doc = null;

        try {
            doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        } catch (ParserConfigurationException e) {
            throw new AlipayApiException(e);
        }

        return doc;
    }
1091198
public static DocumentBuilder createDocumentBuilder()
	{
		try
		{
			DocumentBuilderFactory factory = DOCUMENT_BUILDER_FACTORY.get();

			if (factory == null)
			{
				factory = createDocumentBuilderFactory();

				DOCUMENT_BUILDER_FACTORY = new SoftReference<>(factory);
			}

			return factory.newDocumentBuilder();
		}
		catch (ParserConfigurationException e)
		{
			throw new RuntimeException("Error creating DocumentBuilder: " + e.getMessage(), e);
		}
	}
349143
static DocId create(int docNumber) {
        if (docNumber < Short.MAX_VALUE) {
            // use cached values for docNumbers up to 32k
            return LOW_DOC_IDS[docNumber];
        }
        else
        {
            return new PlainDocId(docNumber);
        }
    }
1008440
private static Document createSurroundingXMLResp() throws ParserConfigurationException {
        final Document document = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
        return document;
    }
1137052
@Nonnull
  public T create(@Nonnull DocumentReference documentReference, @Nonnull Object pojo) {
    Object data = CustomClassMapper.convertToPlainJavaTypes(pojo);
    if (!(data instanceof Map)) {
      FirestoreException.invalidState("Can't set a document's data to an array or primitive");
    }
    return performCreate(documentReference, (Map<String, Object>) data);
  }
581169
public function createFormatter()
    {
        $num = array_push($this->formatters, new PHPCPDFormatterElement($this));

        return $this->formatters[$num - 1];
    }
664269
public MultipartFormDataParser createMultipartFormDataParser() {
        MultipartFormDataParser parser = new CommonsMultipartFormDataParser();
        if (tempDirectoryPath != null) {
            parser.setTempDirectoryPath(tempDirectoryPath);
        } else {
            parser.setTempDirectoryPath(SystemUtils.getProperty("java.io.tmpdir"));
        }
        if (maxRequestSize > -1L) {
            parser.setMaxRequestSize(maxRequestSize);
        }
        if (maxFileSize > -1L) {
            parser.setMaxFileSize(maxFileSize);
        }
        if (maxInMemorySize > -1) {
            parser.setMaxInMemorySize(maxInMemorySize);
        }
        parser.setAllowedFileExtensions(allowedFileExtensions);
        parser.setDeniedFileExtensions(deniedFileExtensions);
        return parser;
    }
1106938
@Transactional
  @PostMapping(value = "/{entityTypeId}", headers = "Content-Type=multipart/form-data")
  public void createFromFormPostMultiPart(
      @PathVariable("entityTypeId") String entityTypeId,
      MultipartHttpServletRequest request,
      HttpServletResponse response) {
    Map<String, Object> paramMap = new HashMap<>();
    for (String param : request.getParameterMap().keySet()) {
      String[] values = request.getParameterValues(param);
      String value = values != null ? StringUtils.join(values, ',') : null;
      if (StringUtils.isNotBlank(value)) {
        paramMap.put(param, value);
      }
    }

    // add files to param map
    for (Entry<String, List<MultipartFile>> entry : request.getMultiFileMap().entrySet()) {
      String param = entry.getKey();
      List<MultipartFile> files = entry.getValue();
      if (files != null && files.size() > 1) {
        throw new IllegalArgumentException("Multiple file input not supported");
      }
      paramMap.put(param, files != null && !files.isEmpty() ? files.get(0) : null);
    }
    createInternal(entityTypeId, paramMap, response);
  }
1368252
def create_document( obj )        
    
    solr_doc = Hash.new
    
    model_klazz_array = ActiveFedora::ContentModel.known_models_for( obj )
    model_klazz_array.delete(ActiveFedora::Base)
    
    # If the object was passed in as an ActiveFedora::Base, call to_solr in order to get the base field entries from ActiveFedora::Base
    # Otherwise, the object was passed in as a model instance other than ActiveFedora::Base,so call its to_solr method & allow it to insert the fields from ActiveFedora::Base
    if obj.class == ActiveFedora::Base
      solr_doc = obj.to_solr(solr_doc)
      logger.debug "  added base fields from #{obj.class.to_s}"
    else
      solr_doc = obj.to_solr(solr_doc)
      model_klazz_array.delete(obj.class)
      logger.debug "    added base fields from #{obj.class.to_s} and model fields from #{obj.class.to_s}"
    end
   
    # Load the object as an instance of each of its other models and get the corresponding solr fields
    # Include :model_only=>true in the options in order to avoid adding the metadata from ActiveFedora::Base every time.
    model_klazz_array.each do |klazz|
      instance = obj.adapt_to(klazz)
      solr_doc = instance.to_solr(solr_doc, :model_only=>true)
      logger.debug "  added solr fields from #{klazz.to_s}"
    end
    
    ::Solrizer::Extractor.insert_solr_field_value(solr_doc, :id_t, "#{obj.pid}" )
    ::Solrizer::Extractor.insert_solr_field_value(solr_doc, :id, "#{obj.pid}" ) unless solr_doc[:id]
    
    return solr_doc
  end