Returns a new proto file that omits types and services not in {@code identifiers}.
772974
ProtoFile retainAll(Schema schema, MarkSet markSet) {
    ImmutableList.Builder<Type> retainedTypes = ImmutableList.builder();
    for (Type type : types) {
      Type retainedType = type.retainAll(schema, markSet);
      if (retainedType != null) {
        retainedTypes.add(retainedType);
      }
    }

    ImmutableList.Builder<Service> retainedServices = ImmutableList.builder();
    for (Service service : services) {
      Service retainedService = service.retainAll(schema, markSet);
      if (retainedService != null) {
        retainedServices.add(retainedService);
      }
    }

    ProtoFile result = new ProtoFile(location, imports, publicImports, packageName,
        retainedTypes.build(), retainedServices.build(), extendList,
        options.retainAll(schema, markSet), syntax);
    result.javaPackage = javaPackage;
    return result;
  }
283271
public com.google.protobuf.ByteString
      getServiceNameBytes() {
    java.lang.Object ref = serviceName_;
    if (ref instanceof java.lang.String) {
      com.google.protobuf.ByteString b = 
          com.google.protobuf.ByteString.copyFromUtf8(
              (java.lang.String) ref);
      serviceName_ = b;
      return b;
    } else {
      return (com.google.protobuf.ByteString) ref;
    }
  }
849002
public static ServiceSpecification merge(Iterable<ServiceSpecification> specs) {
        return new ServiceSpecification(
                Streams.stream(specs).flatMap(s -> s.services().stream())::iterator,
                Streams.stream(specs).flatMap(s -> s.enums().stream())::iterator,
                Streams.stream(specs).flatMap(s -> s.structs().stream())::iterator,
                Streams.stream(specs).flatMap(s -> s.exceptions().stream())::iterator);
    }
706052
private static Class checkClass(ProtoFile protoFile, Type type, Map<String, String> mappedUniName,
            boolean isUniName) {
        String packageName = protoFile.getPackageName();
        String defaultClsName = type.getName();
        // to check if has "java_package" option and "java_outer_classname"
        List<Option> options = protoFile.getOptions();
        if (options != null) {
            for (Option option : options) {
                if (option.getName().equals(JAVA_PACKAGE_OPTION)) {
                    packageName = option.getValue().toString();
                } else if (option.getName().equals(JAVA_OUTER_CLASSNAME_OPTION)) {
                    defaultClsName = option.getValue().toString();
                }
            }
        }

        String simpleName = getProxyClassName(defaultClsName, mappedUniName, isUniName);
        String className = packageName + PACKAGE_SPLIT_CHAR + simpleName;

        Class<?> c = null;
        try {
            c = Class.forName(className);
        } catch (ClassNotFoundException e1) {
            // if class not found so should generate a new java source class.
            c = null;
        }

        return c;
    }
155742
public TypeMetadata without(Entry.Kind kind) {
        if (this == EMPTY || contents.get(kind) == null)
            return this;

        TypeMetadata out = new TypeMetadata(this);
        out.contents.remove(kind);
        return out.contents.isEmpty() ? EMPTY : out;
    }
442870
public CmsRelationFilter filterNotDefinedInContent() {

        CmsRelationFilter filter = (CmsRelationFilter)clone();
        if (filter.m_types.isEmpty()) {
            filter.m_types.addAll(CmsRelationType.getAllNotDefinedInContent());
        } else {
            filter.m_types = new HashSet<CmsRelationType>(CmsRelationType.filterNotDefinedInContent(filter.m_types));
        }
        return filter;
    }
198655
public MediaType removeQualityValue() {
		if (!this.parameters.containsKey(PARAM_QUALITY_FACTOR)) {
			return this;
		}
		Map<String, String> params = new LinkedHashMap<String, String>(this.parameters);
		params.remove(PARAM_QUALITY_FACTOR);
		return new MediaType(this, params);
	}
286117
public static String toJsUnpackFunction(Descriptor protoDescriptor) {
    return Preconditions.checkNotNull(PROTO_TO_JS_UNPACK_FN.get(protoDescriptor.getFullName()));
  }
1223947
private void removeIdentical(List<Box> containerProducts, Box currentBox) {
		for(int i = 0; i < containerProducts.size(); i++) {
			if(containerProducts.get(i) == currentBox) {
				containerProducts.remove(i);

				return;
			}
		}
		throw new IllegalArgumentException();
	}
412995
public ResourceList nonClassFilesOnly() {
        return filter(new ResourceFilter() {
            @Override
            public boolean accept(final Resource resource) {
                return !CLASSFILE_FILTER.accept(resource);
            }
        });
    }
654636
function createMipElementProto (name) {
  let proto = Object.create(createBaseElementProto())
  proto.name = name
  return proto
}
1213123
@GwtIncompatible("Unnecessary")
  JsonFileSpec createJsonFile(B options, String outputMarker, Function<String, String> escaper)
      throws IOException {
    Appendable jsOutput = new StringBuilder();
    writeOutput(
        jsOutput, compiler, (JSModule) null, config.outputWrapper,
        outputMarker, escaper);

    JsonFileSpec jsonOutput = new JsonFileSpec(jsOutput.toString(),
        Strings.isNullOrEmpty(config.jsOutputFile) ?
            "compiled.js" : config.jsOutputFile);

    if (!Strings.isNullOrEmpty(options.sourceMapOutputPath)) {
      StringBuilder sourcemap = new StringBuilder();
      compiler.getSourceMap().appendTo(sourcemap, jsonOutput.getPath());
      jsonOutput.setSourceMap(sourcemap.toString());
    }

    return jsonOutput;
  }
1252304
def Clean():
  """"""
  # Find all the compiled proto files and unlink them.
  for (root, _, files) in os.walk(ROOT):
    for filename in files:
      full_filename = os.path.join(root, filename)
      if full_filename.endswith("_pb2.py") or full_filename.endswith(
          "_pb2.pyc"):
        os.unlink(full_filename)
260506
@Override
	public IdDt toUnqualified() {
		if (isLocal() || isUrn()) {
			return new IdDt(getValueAsString());
		}
		return new IdDt(getResourceType(), getIdPart(), getVersionIdPart());
	}
746074
void removeNonExistingSystemEntityTypes() {
    // get all system entities
    List<EntityType> removedSystemEntityMetas =
        dataService
            .findAll(ENTITY_TYPE_META_DATA, EntityType.class)
            .filter(EntityTypeUtils::isSystemEntity)
            .filter(this::isNotExists)
            .collect(toList());

    dataService.getMeta().deleteEntityType(removedSystemEntityMetas);
    removedSystemEntityMetas.forEach(
        entityType ->
            mutableAclClassService.deleteAclClass(EntityIdentityUtils.toType(entityType)));
  }
401433
Set<String> removeServiceIfTraceId(String lowTraceId) {
      Set<String> result = new LinkedHashSet<>();
      for (Map.Entry<String, Collection<String>> entry : delegate.entrySet()) {
        Collection<String> lowTraceIds = entry.getValue();
        if (lowTraceIds.remove(lowTraceId) && lowTraceIds.isEmpty()) {
          result.add(entry.getKey());
        }
      }
      delegate.keySet().removeAll(result);
      return result;
    }
283827
public Exclude<Scan<T>> getOrCreateExclude()
   {
      Node node = childNode.getOrCreate("exclude");
      Exclude<Scan<T>> exclude = new ExcludeImpl<Scan<T>>(this, "exclude", childNode, node);
      return exclude;
   }