This method appends normalizer to a given persisted model.

PLEASE NOTE: File should be model file saved earlier with ModelSerializer

@param f
@param normalizer
199077
public static void addNormalizerToModel(File f, Normalizer<?> normalizer) {
        File tempFile = null;
        try {
            // copy existing model to temporary file
            tempFile = DL4JFileUtils.createTempFile("dl4jModelSerializerTemp", "bin");
            tempFile.deleteOnExit();
            Files.copy(f, tempFile);
            try (ZipFile zipFile = new ZipFile(tempFile);
                 ZipOutputStream writeFile =
                         new ZipOutputStream(new BufferedOutputStream(new FileOutputStream(f)))) {
                // roll over existing files within model, and copy them one by one
                Enumeration<? extends ZipEntry> entries = zipFile.entries();
                while (entries.hasMoreElements()) {
                    ZipEntry entry = entries.nextElement();

                    // we're NOT copying existing normalizer, if any
                    if (entry.getName().equalsIgnoreCase(NORMALIZER_BIN))
                        continue;

                    log.debug("Copying: {}", entry.getName());

                    InputStream is = zipFile.getInputStream(entry);

                    ZipEntry wEntry = new ZipEntry(entry.getName());
                    writeFile.putNextEntry(wEntry);

                    IOUtils.copy(is, writeFile);
                }
                // now, add our normalizer as additional entry
                ZipEntry nEntry = new ZipEntry(NORMALIZER_BIN);
                writeFile.putNextEntry(nEntry);

                NormalizerSerializer.getDefault().write(normalizer, writeFile);
            }
        } catch (Exception ex) {
            throw new RuntimeException(ex);
        } finally {
            if (tempFile != null) {
                tempFile.delete();
            }
        }
    }
201596
@Override
    public void validateDefault(InputProblemReporter rep, boolean normalize)
        throws XMLStreamException
    {
        String def = validateDefaultNmToken(rep, normalize);
        if (normalize) {
            mDefValue.setValue(def);
        }
    }
903105
public function add(string $type, RowFieldNormalizerInterface $normalizer)
    {
        $this->normalizers[$type] = $normalizer;
        return $this;
    }
234013
public void init(BaseField fldTarget, String fsTarget)
    {
        m_hsFilter = null;
        m_fldTarget = fldTarget;
        m_fsTarget = fsTarget;
        super.init(null);
    }
199773
public static String writeConfigurationFile( FileDefinition relationsFile, boolean writeComments, String lineSeparator ) {
		return new FileDefinitionSerializer( lineSeparator ).write( relationsFile, writeComments );
	}
249571
static String normalizeResponseWrapper(final String type) {
        if (!getTypeParameters(type).isEmpty() && isAssignableTo(type, Types.GENERIC_ENTITY))
            return getTypeParameters(type).get(0);
        return type;
    }
866725
public void initialize(final Class<?> _initializer)
    {
        this.initializer = _initializer.getName();
        synchronized (this) {
            try {
                readCache();
            } catch (final CacheReloadException e) {
                AbstractCache.LOG.error("Unexpected error while initializing Cache for " + getClass(), e);
            }
        }
    }
954197
public void enableExtendedSerializers() {
        amf3Serializers.put(int[].class, new Amf3IntVectorSerializer(this));
        amf3Serializers.put(long[].class, new Amf3UintVectorSerializer(this));
        amf3Serializers.put(double[].class, new Amf3DoubleVectorSerializer(this));
        amf3Serializers.put(ArrayList.class, new Amf3VectorSerializer(this));
        amf3Serializers.put(HashMap.class, new Amf3DictSerializer(this));
    }
1152010
public void addFile(File file) {
        String name = "file";
        files.put(normalizeDuplicateName(name), file);
    }
624696
File toFile(URL url) {
        String urlstr = url.toExternalForm();
        if(!urlstr.startsWith("file:"))
            return null;

        //  File(String) does fs.normalize, which is really forgiving in fixing up
        // malformed stuff. I couldn't make the other URL.toURI() or File(URI) work
        // in all the cases that we test
        try {
            return new File(URLDecoder.decode(urlstr.substring(5),"UTF-8"));
        } catch (UnsupportedEncodingException x) {
            throw new AssertionError(x);
        }
    }
1008761
public <T extends Normalizer> T restore(@NonNull File file) throws Exception {
        try (InputStream in = new BufferedInputStream(new FileInputStream(file))) {
            return restore(in);
        }
    }
1353673
private void read(final File f) throws IOException {
        final FileReader fr = new FileReader(f);
        final BufferedReader br = new BufferedReader(fr);
        String input = null;
        while ((input = br.readLine()) != null) {

            // Trim whitespace.
            input = input.trim();

            // Skip comments
            if (input.startsWith(COMMENT)) continue;

            final int idx = input.indexOf(NAME_VALUE_DELIMITER);
            if (idx == -1) continue;

            String name, value;
            try {
                name = input.substring(0, idx);
                value = input.substring(idx + 1);
            } catch (IndexOutOfBoundsException e) {
                continue;
            }
            name = name.trim();
            value = value.trim();

            cfgMap.put(name, valueSubstitution(value));
        }
        br.close();
    }
730009
public static void addFileURL(File f) {
        String absolutePath = f.getAbsolutePath();
        if (!filterFile(absolutePath)) {
            try {
                recordURL(f.toURI().toURL().toExternalForm());
            } catch (MalformedURLException e) {
                // Never expected.
            }
        }
    }
123636
public static void normalizeDescriptor(TupleDesc_F64 descriptor , double maxDescriptorElementValue ) {
		// normalize descriptor to unit length
		UtilFeature.normalizeL2(descriptor);

		// clip the values
		for (int i = 0; i < descriptor.size(); i++) {
			double value = descriptor.value[i];
			if( value > maxDescriptorElementValue ) {
				descriptor.value[i] = maxDescriptorElementValue;
			}
		}

		// normalize again
		UtilFeature.normalizeL2(descriptor);
	}
270058
function normalizeString(val, normalizer) {
    if (!normalizer) {
        normalizer = (str) => str.toLowerCase().trim();
    }
    return normalizer(toStringSafe(val));
}
1009052
public void setCustomEndpointInitializer(EndpointInitializer initializer) {
		Objects.requireNonNull(initializer, "Initializer has to be set");
		ClosureCleaner.ensureSerializable(initializer);
		this.initializer = initializer;
	}
27458
protected void addDefaultComponents(final ContextInitializer initializer) {
        initializer.addComponents(
                // PROCESSORS.
                // Assets:
                new AssetService(), new SkinAssetAnnotationProcessor(),
                // Locale:
                new LocaleService(),
                // SFX:
                new MusicEnabledAnnotationProcessor(), new MusicVolumeAnnotationProcessor(),
                new SoundEnabledAnnotationProcessor(), new SoundVolumeAnnotationProcessor(),
                // Settings:
                new I18nBundleAnnotationProcessor(), new PreferenceAnnotationProcessor(), new SkinAnnotationProcessor(),
                new StageViewportAnnotationProcessor(), new PreferencesService(),
                // Interface:
                new ViewAnnotationProcessor(), new ViewDialogAnnotationProcessor(),
                new ViewActionContainerAnnotationProcessor(), new ViewStageAnnotationProcessor(),
                new LmlMacroAnnotationProcessor(), new LmlParserSyntaxAnnotationProcessor(),
                new AvailableLocalesAnnotationProcessor(),
                // COMPONENTS.
                // SFX:
                new MusicService(),
                // Interface:
                interfaceService, new SkinService());
    }