Creates the appropriate {@link VorbisPacket}
instance based on the type.
768698
public static VorbisPacket create(OggPacket packet) {
        // Special header types detection
        if (isVorbisSpecial(packet)) {
            byte type = packet.getData()[0];
            switch(type) {
            case TYPE_INFO:
                return new VorbisInfo(packet);
            case TYPE_COMMENTS:
                return new VorbisComments(packet);
            case TYPE_SETUP:
                return new VorbisSetup(packet);
            }
        }

        return new VorbisAudioData(packet);
    }
282951
static JSType createGenericType(
      boolean shouldCreate, JSTypeRegistry registry, JSTypeNative typeName, JSType typeArg) {
    if (!shouldCreate) {
      return null;
    }
    ObjectType genericType = (ObjectType) (registry.getNativeType(typeName));
    ObjectType uninstantiated = genericType.getRawType();
    return registry.instantiateGenericType(uninstantiated, ImmutableList.of(typeArg));
  }
149215
public static SpeexPacket create(OggPacket packet) {
       // Special header types detection
       if(isSpeexSpecial(packet)) {
           return new SpeexInfo(packet);
       }
       if (packet.getSequenceNumber() == 1 && packet.getGranulePosition() == 0) {
           return new SpeexTags(packet);
       }

       return new SpeexAudioData(packet);
   }
1049337
def makeServoIDPacket(curr_id, new_id):
	
	pkt = Packet.makeWritePacket(curr_id, xl320.XL320_ID, [new_id])
	return pkt
844525
public static AbstractMessage createInstance( byte type )
    {
        switch (type)
        {
            case EMPTY:  return new EmptyMessageImpl();
            case BYTES:  return new BytesMessageImpl();
            case MAP:    return new MapMessageImpl();
            case OBJECT: return new ObjectMessageImpl();
            case STREAM: return new StreamMessageImpl();
            case TEXT:   return new TextMessageImpl();
                
            default:
                throw new IllegalArgumentException("Unsupported message type : "+type);
        }
    }
276668
public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass)
    {
        return createFrom(typeClass, NO_EXCLUSIONS, ID_STRATEGY);
    }
1078868
public int createSARLType(IProgressMonitor monitor) throws CoreException, InterruptedException {
		try {
			final SubMonitor mainmon = SubMonitor.convert(monitor, getTitle(), STEPS);
			// Create the package if not existing
			IPackageFragment packageFragment = getPackageFragment();
			if (!packageFragment.exists()) {
				packageFragment = getPackageFragmentRoot().createPackageFragment(
						getPackageFragment().getElementName(),
						true,
						mainmon.newChild(1));
			} else {
				mainmon.worked(1);
			}

			// Create the file
			final IFolder packageResource = (IFolder) packageFragment.getResource();
			if (!packageResource.exists()) {
				CoreUtility.createFolder(packageResource, true, true, mainmon.newChild(1));
			} else {
				mainmon.worked(1);
			}
			IFile sarlFile = packageResource.getFile(
					getTypeName() + "." //$NON-NLS-1$
					+ this.sarlFileExtension);
			int index = 1;
			while (sarlFile.exists()) {
				sarlFile = packageResource.getFile(
						getTypeName() + index + "." //$NON-NLS-1$
						+ this.sarlFileExtension);
				++index;
			}

			final URI sarlUri = this.storage2UriMapper.getUri(sarlFile);
			final ResourceSet resourceSet = this.resourceSetFactory.get(packageFragment.getJavaProject().getProject());
			final ICompilationUnit compilationUnit = getCompilationUnitStub();
			final String lineSeparator = this.whitespaceInformationProvider
					.getLineSeparatorInformation(sarlUri).getLineSeparator();
			mainmon.worked(1);

			// Create the type content
			final SubMonitor mon1 = mainmon.newChild(1);
			mon1.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_5, getTypeName()));
			final String typeComment = getTypeComment(compilationUnit, lineSeparator);
			final IJvmTypeProvider typeProvider = this.jdtTypeProviderFactory.findOrCreateTypeProvider(resourceSet);
			final ImportManager imports = new ImportManager(true);
			this.injector.injectMembers(imports);
			final FakeTreeAppendable appender = new FakeTreeAppendable(imports);
			this.injector.injectMembers(appender);
			generateTypeContent(appender, typeProvider, typeComment, mon1);
			mon1.done();

			// Build the full file content
			final SubMonitor mon2 = mainmon.newChild(1);
			mon2.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_6, getTypeName()));
			final String fileComment = getFileComment(compilationUnit, lineSeparator);
			final StringBuilder realContent = new StringBuilder();
			if (!Strings.isNullOrEmpty(fileComment)) {
				realContent.append(fileComment);
				realContent.append(lineSeparator);
				realContent.append(lineSeparator);
			}
			realContent.append(appender.getContent());
			realContent.append(lineSeparator);
			mon2.done();

			final SubMonitor mon3 = mainmon.newChild(1);
			mon3.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_7, getTypeName()));
			final String content = this.formatterFacade.format(realContent.toString());
			mon3.done();

			// Write the resource
			final SubMonitor mon4 = mainmon.newChild(1);
			mon4.setTaskName(MessageFormat.format(Messages.AbstractNewSarlElementWizardPage_8, getTypeName()));
			try (ByteArrayInputStream stream = new ByteArrayInputStream(content.getBytes())) {
				sarlFile.create(stream, true, mon4);
			}
			setResource(sarlFile);
			saveSettings();
			mon4.done();

			return content.length();
		} catch (OperationCanceledException e) {
			throw new InterruptedException();
		} catch (CoreException e) {
			throw e;
		} catch (Exception e) {
			throw new CoreException(SARLEclipsePlugin.getDefault().createStatus(IStatus.ERROR, e));
		}
	}
952732
public static <T> MemcachedClientBuilder<T> newMessagePackClient(final MessagePack messagePack, final Class<T> valueType) {
    if (!ClassUtils.isPrimitiveOrWrapper(valueType)) {
      messagePack.register(valueType);
    }
    return newClient(new MessagePackTranscoder<>(messagePack, valueType));
  }
1178366
public static ProcessPackage getOrCreate(ResourceTypePackageRegistry rtps) {
        ProcessPackage rtp = (ProcessPackage) rtps.get(ResourceType.BPMN2);
        if (rtp == null) {
            rtp = new ProcessPackage();
            // register the same instance for all types. There is no distinction
            rtps.put(ResourceType.BPMN2, rtp);
            rtps.put(ResourceType.DRF, rtp);
            rtps.put(ResourceType.CMMN, rtp);
        }
        return rtp;
    }
1111141
public static <T> RuntimeSchema<T> createFrom(Class<T> typeClass,
            IdStrategy strategy)
    {
        return createFrom(typeClass, NO_EXCLUSIONS, strategy);
    }
1042345
def create(self, name, data=None):
        
        return createPacket(self[name], data) if name in self else None
807749
static <T> KryoSerializerSnapshotData<T> createFrom(
		Class<T> typeClass,
		LinkedHashMap<Class<?>, SerializableSerializer<?>> defaultKryoSerializers,
		LinkedHashMap<Class<?>, Class<? extends Serializer<?>>> defaultKryoSerializerClasses,
		LinkedHashMap<String, KryoRegistration> kryoRegistrations) {

		return new KryoSerializerSnapshotData<>(
			typeClass,
			optionalMapOf(defaultKryoSerializers, Class::getName),
			optionalMapOf(defaultKryoSerializerClasses, Class::getName),
			optionalMapOf(kryoRegistrations, Function.identity()));
	}
1094655
public static WasbUnderFileSystem createInstance(AlluxioURI uri,
      UnderFileSystemConfiguration conf, AlluxioConfiguration alluxioConf) {
    Configuration wasbConf = createConfiguration(conf);
    return new WasbUnderFileSystem(uri, conf, wasbConf, alluxioConf);
  }
1181273
public static byte[] toPacket(final ServiceType type)
	{
		final KNXnetIPHeader h = new KNXnetIPHeader(type.svcType, type.getStructLength());
		final ByteArrayOutputStream os = new ByteArrayOutputStream(h.getTotalLength());
		os.write(h.toByteArray(), 0, h.getStructLength());
		return type.toByteArray(os);
	}
639270
public PackingPlan createPackingPlan(final Config config, final Config runtime)
    throws PackingException {
    // Create an instance of the packing class
    String packingClass = Context.packingClass(config);
    IPacking packing;
    try {
      // create an instance of the packing class
      packing = ReflectionUtils.newInstance(packingClass);
    } catch (IllegalAccessException | InstantiationException | ClassNotFoundException e) {
      throw new PackingException(String.format(
          "Failed to instantiate packing instance using packing class %s", packingClass), e);
    }

    try {
      TopologyAPI.Topology topology = Runtime.topology(runtime);
      packing.initialize(config, topology);
      return packing.pack();
    } finally {
      SysUtils.closeIgnoringExceptions(packing);
    }
  }
920201
public static OggAudioStreamHeaders create(OggPacket firstPacket) {
        if (firstPacket.isBeginningOfStream() &&
                firstPacket.getData() != null &&
                firstPacket.getData().length > 10) {
            int sid = firstPacket.getSid();
            if (VorbisPacketFactory.isVorbisStream(firstPacket)) {
                return new OggAudioStreamHeaders(sid, 
                        OggStreamIdentifier.OGG_VORBIS,
                        (VorbisInfo)VorbisPacketFactory.create(firstPacket));
            }
            if (SpeexPacketFactory.isSpeexStream(firstPacket)) {
                return new OggAudioStreamHeaders(sid, 
                        OggStreamIdentifier.SPEEX_AUDIO,
                        (SpeexInfo)SpeexPacketFactory.create(firstPacket));
            }
            if (OpusPacketFactory.isOpusStream(firstPacket)) {
                return new OggAudioStreamHeaders(sid, 
                        OggStreamIdentifier.OPUS_AUDIO,
                        (OpusInfo)OpusPacketFactory.create(firstPacket));
            }
            if (FlacFirstOggPacket.isFlacStream(firstPacket)) {
                FlacFirstOggPacket flac = new FlacFirstOggPacket(firstPacket);
                return new OggAudioStreamHeaders(sid, 
                        OggStreamIdentifier.OGG_FLAC,
                        flac.getInfo());
            }
            throw new IllegalArgumentException("Unsupported stream of type " + OggStreamIdentifier.identifyType(firstPacket));
        } else {
            throw new IllegalArgumentException("May only be called for the first packet in a stream, with data");
        }
    }
314322
private static CodeDependent createCodeByType(EnumType type, boolean topLevelClass, String packageName,
            Map<String, String> mappedUniName, boolean isUniName) {

        CodeDependent cd = new CodeDependent();

        String defaultClsName = type.getName();
        String simpleName = getProxyClassName(defaultClsName, mappedUniName, isUniName);

        // To generate class
        StringBuilder code = new StringBuilder();
        if (topLevelClass) {
            // define package
            if (!StringUtils.isEmpty(packageName)) {
                code.append("package ").append(packageName).append(CODE_END);
                code.append("\n");
            }
            // add import;
            code.append("import com.baidu.bjf.remoting.protobuf.EnumReadable;\n");
        }

        // define class
        if (topLevelClass) {
            code.append("public enum ");
        } else {
            code.append("public static enum ");
        }
        code.append(simpleName).append(" implements EnumReadable {\n");

        Iterator<Value> iter = type.getValues().iterator();
        while (iter.hasNext()) {
            Value value = iter.next();
            String name = value.getName();
            int tag = value.getTag();

            code.append(name).append("(").append(tag).append(")");
            if (iter.hasNext()) {
                code.append(",").append("\n");
            } else {
                code.append(";\n");
            }
        }

        code.append("private final int value;\n");
        code.append(simpleName).append("(int value) { this.value = value;  }\n");
        code.append("public int value() { return value; }\n");
        code.append("}\n");

        cd.name = simpleName;
        cd.pkg = packageName;
        cd.code = code.toString();

        return cd;
    }