NFC is the normalization form recommended by W3C.
481751
def sanitize(func):
    

    def wrapper(*args, **kwargs):
        return normalize('NFC', func(*args, **kwargs))
    return wrapper
605026
function ImageForm() {
		Requirements::javascript(THIRDPARTY_DIR . "/behaviour.js");
		Requirements::javascript(EXTERNALCONTENT . "/javascript/external_tiny_mce_improvements.js");
		Requirements::css('cms/css/TinyMCEImageEnhancement.css');
		Requirements::javascript('cms/javascript/TinyMCEImageEnhancement.js');
		Requirements::javascript(THIRDPARTY_DIR . '/SWFUpload/SWFUpload.js');
		Requirements::javascript(CMS_DIR . '/javascript/Upload.js');

		$form = new Form(
			$this->controller,
			"{$this->name}/ImageForm",
			new FieldSet(
				new LiteralField('Heading', '<h2><img src="cms/images/closeicon.gif" alt="' . _t('HtmlEditorField.CLOSE', 'close') . '" title="' . _t('HtmlEditorField.CLOSE', 'close') . '" />' . _t('HtmlEditorField.IMAGE', 'Image') . '</h2>'),
				new TreeDropdownField('FolderID', _t('HtmlEditorField.FOLDER', 'Folder'), 'Folder'),
				new LiteralField('AddFolderOrUpload',
					'<div style="clear:both;"></div><div id="AddFolderGroup" style="display: none">
						<a style="" href="#" id="AddFolder" class="link">' . _t('HtmlEditorField.CREATEFOLDER','Create Folder') . '</a>
						<input style="display: none; margin-left: 2px; width: 94px;" id="NewFolderName" class="addFolder" type="text">
						<a style="display: none;" href="#" id="FolderOk" class="link addFolder">' . _t('HtmlEditorField.OK','Ok') . '</a>
						<a style="display: none;" href="#" id="FolderCancel" class="link addFolder">' . _t('HtmlEditorField.FOLDERCANCEL','Cancel') . '</a>
					</div>
					<div id="PipeSeparator" style="display: none">|</div>
					<div id="UploadGroup" class="group" style="display: none; margin-top: 2px;">
						<a href="#" id="UploadFiles" class="link">' . _t('HtmlEditorField.UPLOAD','Upload') . '</a>
					</div>'
				),
				new TextField('getimagesSearch', _t('HtmlEditorField.SEARCHFILENAME', 'Search by file name')),
				new ThumbnailStripField('FolderImages', 'FolderID', 'getimages'),
				new TextField('AltText', _t('HtmlEditorField.IMAGEALTTEXT', 'Alternative text (alt) - shown if image cannot be displayed'), '', 80),
				new TextField('ImageTitle', _t('HtmlEditorField.IMAGETITLE', 'Title text (tooltip) - for additional information about the image')),
				new TextField('CaptionText', _t('HtmlEditorField.CAPTIONTEXT', 'Caption text')),
				new DropdownField(
					'CSSClass',
					_t('HtmlEditorField.CSSCLASS', 'Alignment / style'),
					array(
						'left' => _t('HtmlEditorField.CSSCLASSLEFT', 'On the left, with text wrapping around.'),
						'leftAlone' => _t('HtmlEditorField.CSSCLASSLEFTALONE', 'On the left, on its own.'),
						'right' => _t('HtmlEditorField.CSSCLASSRIGHT', 'On the right, with text wrapping around.'),
						'center' => _t('HtmlEditorField.CSSCLASSCENTER', 'Centered, on its own.'),
					)
				),
				new FieldGroup(_t('HtmlEditorField.IMAGEDIMENSIONS', 'Dimensions'),
					new TextField('Width', _t('HtmlEditorField.IMAGEWIDTHPX', 'Width'), 100),
					new TextField('Height', " x " . _t('HtmlEditorField.IMAGEHEIGHTPX', 'Height'), 100)
				)
			),
			new FieldSet(
				new FormAction('insertimage', _t('HtmlEditorField.BUTTONINSERTIMAGE', 'Insert image'))
			)
		);

		$form->disableSecurityToken();
		$form->loadDataFrom($this);

		return $form;
	}
1051955
static function quickIsNFCVerify( &$string ) {
		# Screen out some characters that eg won't be allowed in XML
		$string = preg_replace( '/[\x00-\x08\x0b\x0c\x0e-\x1f]/', Constants::UTF8_REPLACEMENT, $string );

		# ASCII is always valid NFC!
		# If we're only ever given plain ASCII, we can avoid the overhead
		# of initializing the decomposition tables by skipping out early.
		if ( !preg_match( '/[\x80-\xff]/', $string ) ) {
			return true;
		}

		static $checkit = null, $tailBytes = null, $utfCheckOrCombining = null;
		if ( !isset( $checkit ) ) {
			# Load/build some scary lookup tables...
			self::loadData();

			$utfCheckOrCombining = array_merge( self::$utfCheckNFC, self::$utfCombiningClass );

			# Head bytes for sequences which we should do further validity checks
			$checkit = array_flip( array_map( 'chr',
				[ 0xc0, 0xc1, 0xe0, 0xed, 0xef,
					0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
					0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xff ] ) );

			# Each UTF-8 head byte is followed by a certain
			# number of tail bytes.
			$tailBytes = [];
			for ( $n = 0; $n < 256; $n++ ) {
				if ( $n < 0xc0 ) {
					$remaining = 0;
				} elseif ( $n < 0xe0 ) {
					$remaining = 1;
				} elseif ( $n < 0xf0 ) {
					$remaining = 2;
				} elseif ( $n < 0xf8 ) {
					$remaining = 3;
				} elseif ( $n < 0xfc ) {
					$remaining = 4;
				} elseif ( $n < 0xfe ) {
					$remaining = 5;
				} else {
					$remaining = 0;
				}
				$tailBytes[chr( $n )] = $remaining;
			}
		}

		# Chop the text into pure-ASCII and non-ASCII areas;
		# large ASCII parts can be handled much more quickly.
		# Don't chop up Unicode areas for punctuation, though,
		# that wastes energy.
		$matches = [];
		preg_match_all(
			'/([\x00-\x7f]+|[\x80-\xff][\x00-\x40\x5b-\x5f\x7b-\xff]*)/',
			$string, $matches );

		$looksNormal = true;
		$base = 0;
		$replace = [];
		foreach ( $matches[1] as $str ) {
			$chunk = strlen( $str );

			if ( $str[0] < "\x80" ) {
				# ASCII chunk: guaranteed to be valid UTF-8
				# and in normal form C, so skip over it.
				$base += $chunk;
				continue;
			}

			# We'll have to examine the chunk byte by byte to ensure
			# that it consists of valid UTF-8 sequences, and to see
			# if any of them might not be normalized.

			# Since PHP is not the fastest language on earth, some of
			# this code is a little ugly with inner loop optimizations.

			$head = '';
			# Counting down is faster. I'm *so* sorry.
			$len = $chunk + 1;

			for ( $i = -1; --$len; ) {
				$remaining = $tailBytes[$c = $str[++$i]];
				if ( $remaining ) {
					# UTF-8 head byte!
					$sequence = $head = $c;
					do {
						# Look for the defined number of tail bytes...
						if ( --$len && ( $c = $str[++$i] ) >= "\x80" && $c < "\xc0" ) {
							# Legal tail bytes are nice.
							$sequence .= $c;
						} else {
							if ( 0 == $len ) {
								# Premature end of string!
								# Drop a replacement character into output to
								# represent the invalid UTF-8 sequence.
								$replace[] = [ Constants::UTF8_REPLACEMENT,
									$base + $i + 1 - strlen( $sequence ),
									strlen( $sequence ) ];
								break 2;
							} else {
								# Illegal tail byte; abandon the sequence.
								$replace[] = [ Constants::UTF8_REPLACEMENT,
									$base + $i - strlen( $sequence ),
									strlen( $sequence ) ];
								# Back up and reprocess this byte; it may itself
								# be a legal ASCII or UTF-8 sequence head.
								--$i;
								++$len;
								continue 2;
							}
						}
					} while ( --$remaining );

					if ( isset( $checkit[$head] ) ) {
						# Do some more detailed validity checks, for
						# invalid characters and illegal sequences.
						if ( $head == "\xed" ) {
							# 0xed is relatively frequent in Korean, which
							# abuts the surrogate area, so we're doing
							# this check separately to speed things up.

							if ( $sequence >= Constants::UTF8_SURROGATE_FIRST ) {
								# Surrogates are legal only in UTF-16 code.
								# They are totally forbidden here in UTF-8
								# utopia.
								$replace[] = [ Constants::UTF8_REPLACEMENT,
									$base + $i + 1 - strlen( $sequence ),
									strlen( $sequence ) ];
								$head = '';
								continue;
							}
						} else {
							# Slower, but rarer checks...
							$n = ord( $head );
							if (
								# "Overlong sequences" are those that are syntactically
								# correct but use more UTF-8 bytes than are necessary to
								# encode a character. Naïve string comparisons can be
								# tricked into failing to see a match for an ASCII
								# character, for instance, which can be a security hole
								# if blacklist checks are being used.
								( $n < 0xc2 && $sequence <= Constants::UTF8_OVERLONG_A )
								|| ( $n == 0xe0 && $sequence <= Constants::UTF8_OVERLONG_B )
								|| ( $n == 0xf0 && $sequence <= Constants::UTF8_OVERLONG_C )

								# U+FFFE and U+FFFF are explicitly forbidden in Unicode.
								|| ( $n == 0xef &&
									( $sequence == Constants::UTF8_FFFE )
									|| ( $sequence == Constants::UTF8_FFFF ) )

								# Unicode has been limited to 21 bits; longer
								# sequences are not allowed.
								|| ( $n >= 0xf0 && $sequence > Constants::UTF8_MAX )
							) {
								$replace[] = [ Constants::UTF8_REPLACEMENT,
									$base + $i + 1 - strlen( $sequence ),
									strlen( $sequence ) ];
								$head = '';
								continue;
							}
						}
					}

					if ( isset( $utfCheckOrCombining[$sequence] ) ) {
						# If it's NO or MAYBE, we'll have to rip
						# the string apart and put it back together.
						# That's going to be mighty slow.
						$looksNormal = false;
					}

					# The sequence is legal!
					$head = '';
				} elseif ( $c < "\x80" ) {
					# ASCII byte.
					$head = '';
				} elseif ( $c < "\xc0" ) {
					# Illegal tail bytes
					if ( $head == '' ) {
						# Out of the blue!
						$replace[] = [ Constants::UTF8_REPLACEMENT, $base + $i, 1 ];
					} else {
						# Don't add if we're continuing a broken sequence;
						# we already put a replacement character when we looked
						# at the broken sequence.
						$replace[] = [ '', $base + $i, 1 ];
					}
				} else {
					# Miscellaneous freaks.
					$replace[] = [ Constants::UTF8_REPLACEMENT, $base + $i, 1 ];
					$head = '';
				}
			}
			$base += $chunk;
		}
		if ( count( $replace ) ) {
			# There were illegal UTF-8 sequences we need to fix up.
			$out = '';
			$last = 0;
			foreach ( $replace as $rep ) {
				list( $replacement, $start, $length ) = $rep;
				if ( $last < $start ) {
					$out .= substr( $string, $last, $start - $last );
				}
				$out .= $replacement;
				$last = $start + $length;
			}
			if ( $last < strlen( $string ) ) {
				$out .= substr( $string, $last );
			}
			$string = $out;
		}

		return $looksNormal;
	}
1124058
def normalize_attachment(attachment):
        ''' 
        '''
        res = dict()
        res['type'] = 'attachment'
        res['id'] = attachment['id']
        del(attachment['id'])
        res['url'] = attachment['url']
        del(attachment['url'])
        res['metadata'] = attachment
        return res
132789
function buildTransactionProposal(chaincodeProposal, endorsements, proposalResponse) {

	const header = _commonProto.Header.decode(chaincodeProposal.getHeader());

	const chaincodeEndorsedAction = new _transProto.ChaincodeEndorsedAction();
	chaincodeEndorsedAction.setProposalResponsePayload(proposalResponse.payload);
	chaincodeEndorsedAction.setEndorsements(endorsements);

	const chaincodeActionPayload = new _transProto.ChaincodeActionPayload();
	chaincodeActionPayload.setAction(chaincodeEndorsedAction);

	// the TransientMap field inside the original proposal payload is only meant for the
	// endorsers to use from inside the chaincode. This must be taken out before sending
	// to the orderer, otherwise the transaction will be rejected by the validators when
	// it compares the proposal hash calculated by the endorsers and returned in the
	// proposal response, which was calculated without the TransientMap
	const originalChaincodeProposalPayload = _proposalProto.ChaincodeProposalPayload.decode(chaincodeProposal.payload);
	const chaincodeProposalPayloadNoTrans = new _proposalProto.ChaincodeProposalPayload();
	chaincodeProposalPayloadNoTrans.setInput(originalChaincodeProposalPayload.input); // only set the input field, skipping the TransientMap
	chaincodeActionPayload.setChaincodeProposalPayload(chaincodeProposalPayloadNoTrans.toBuffer());

	const transactionAction = new _transProto.TransactionAction();
	transactionAction.setHeader(header.getSignatureHeader());
	transactionAction.setPayload(chaincodeActionPayload.toBuffer());

	const actions = [];
	actions.push(transactionAction);

	const transaction = new _transProto.Transaction();
	transaction.setActions(actions);


	const payload = new _commonProto.Payload();
	payload.setHeader(header);
	payload.setData(transaction.toBuffer());

	return payload;
}
102459
function normalizeHtml(src, options) {
    var $ = cheerio.load(src, {
        // We should parse html without trying to normalize too much
        xmlMode: false,

        // SVG need some attributes to use uppercases
        lowerCaseAttributeNames: false,
        lowerCaseTags: false
    });
    var toConvert = [];
    var svgContent = {};
    var outputRoot = options.book.options.output;

    imgConversionCache[outputRoot] = imgConversionCache[outputRoot] || {};

    // Find svg images to extract and process
    if (options.convertImages) {
        $('svg').each(function() {
            var content = renderDom($, $(this));
            var svgId = _.uniqueId('svg');
            var dest = svgId+'.svg';

            // Generate filename
            dest = '/'+fs.getUniqueFilename(outputRoot, dest);

            svgContent[dest] = '<?xml version="1.0" encoding="UTF-8"?>'+content;
            $(this).replaceWith($('<img>').attr('src', dest));
        });
    }

    // Generate ID for headings
    $('h1,h2,h3,h4,h5,h6').each(function() {
        if ($(this).attr('id')) return;

        $(this).attr('id', slug($(this).text()));
    });

    // Find images to normalize
    $('img').each(function() {
        var origin;
        var src = $(this).attr('src');

        if (!src) return;
        var isExternal = links.isExternal(src);

        // Transform as relative to the bases
        if (links.isRelative(src)) {
            src = links.toAbsolute(src, options.base, options.output);
        }

        // Convert if needed
        if (options.convertImages) {
            // If image is external and ebook, then downlaod the images
            if (isExternal) {
                origin = src;
                src = '/'+crc.crc32(origin).toString(16)+path.extname(url.parse(origin).pathname);
                src = links.toAbsolute(src, options.base, options.output);
                isExternal = false;
            }

            var ext = path.extname(src);
            var srcAbs = links.join('/', options.base, src);

            // Test image extension
            if (_.contains(imgUtils.INVALID, ext)) {
                if (imgConversionCache[outputRoot][srcAbs]) {
                    // Already converted
                    src = imgConversionCache[outputRoot][srcAbs];
                } else {
                    // Not converted yet
                    var dest = '';

                    // Replace extension
                    dest = links.join(path.dirname(srcAbs), path.basename(srcAbs, ext)+'.png');
                    dest = dest[0] == '/'? dest.slice(1) : dest;

                    // Get a name that doesn't exists
                    dest = fs.getUniqueFilename(outputRoot, dest);

                    options.book.log.debug.ln('detect invalid image (will be converted to png):', srcAbs);

                    // Add to cache
                    imgConversionCache[outputRoot][srcAbs] = '/'+dest;

                    // Push to convert
                    toConvert.push({
                        origin: origin,
                        content: svgContent[srcAbs],
                        source: isExternal? srcAbs : path.join('./', srcAbs),
                        dest: path.join('./', dest)
                    });

                    src = links.join('/', dest);
                }

                // Reset as relative to output
                src = links.toAbsolute(src, options.base, options.output);
            }

            else if (origin) {
                // Need to downlaod image
                toConvert.push({
                    origin: origin,
                    source: path.join('./', srcAbs)
                });
            }
        }

        $(this).attr('src', src);
    });

    // Normalize links
    $('a').each(function() {
        var href = $(this).attr('href');
        if (!href) return;

        if (links.isAnchor(href)) {
            // Keep it as it is
        } else if (links.isRelative(href)) {
            var parts = url.parse(href);
            var absolutePath = links.join(options.base, parts.pathname);
            var anchor = parts.hash || '';


            // If is in navigation relative: transform as content
            if (options.navigation[absolutePath]) {
                absolutePath = options.book.contentLink(absolutePath);
            }

            // If md/adoc/rst files is not in summary
            // or for ebook, signal all files that are outside the summary
            else if (_.contains(parsableExtensions, path.extname(absolutePath)) ||
            _.contains(['epub', 'pdf', 'mobi'], options.book.options.generator)) {
                options.book.log.warn.ln('page', options.input, 'contains an hyperlink to resource outside spine \''+href+'\'');
            }

            // Transform as absolute
            href = links.toAbsolute('/'+absolutePath, options.base, options.output)+anchor;
        } else {
            // External links
            $(this).attr('target', '_blank');
        }

        // Transform extension
        $(this).attr('href', href);
    });

    // Highlight code blocks
    $('code').each(function() {
        // Normalize language
        var lang = _.chain(
                ($(this).attr('class') || '').split(' ')
            )
            .map(function(cl) {
                // Markdown
                if (cl.search('lang-') === 0) return cl.slice('lang-'.length);

                // Asciidoc
                if (cl.search('language-') === 0) return cl.slice('language-'.length);

                return null;
            })
            .compact()
            .first()
            .value();

        var source = $(this).text();
        var blk = options.book.template.applyBlock('code', {
            body: source,
            kwargs: {
                language: lang
            }
        });

        if (blk.html === false) $(this).text(blk.body);
        else $(this).html(blk.body);
    });

    // Replace glossary terms
    var glossary = _.sortBy(options.glossary, function(term) {
        return -term.name.length;
    });

    _.each(glossary, function(term) {
        var r =  new RegExp( '\\b(' + pregQuote(term.name.toLowerCase()) + ')\\b' , 'gi' );
        var includedInFiles = false;

        $('*').each(function() {
            // Ignore codeblocks
            if (_.contains(['code', 'pre', 'a', 'script'], this.name.toLowerCase())) return;

            replaceText($, this, r, function(match) {
                // Add to files index in glossary
                if (!includedInFiles) {
                    includedInFiles = true;
                    term.files = term.files || [];
                    term.files.push(options.navigation[options.input]);
                }
                return '<a href=\''+links.toAbsolute('/GLOSSARY.html', options.base, options.output) + '#' + term.id+'\' class=\'glossary-term\' title=\''+_.escape(term.description)+'\'>'+match+'</a>';
            });
        });
    });

    return {
        html: renderDom($),
        images: toConvert
    };
}
926675
public Document normalise() {
        Element htmlEl = findFirstElementByTagName("html", this);
        if (htmlEl == null)
            htmlEl = appendElement("html");
        if (head() == null)
            htmlEl.prependElement("head");
        if (body() == null)
            htmlEl.appendElement("body");

        // pull text nodes out of root, html, and head els, and push into body. non-text nodes are already taken care
        // of. do in inverse order to maintain text order.
        normaliseTextNodes(head());
        normaliseTextNodes(htmlEl);
        normaliseTextNodes(this);

        normaliseStructure("head", htmlEl);
        normaliseStructure("body", htmlEl);
        
        ensureMetaCharsetElement();
        
        return this;
    }
304354
protected function normalizeCrs()
    {
        $type = $this->props['attribs']['type'];
        if (empty($this->props['options'])) {
            $this->props['options'] = array();
            if ($type == 'checkbox') {
                $this->props['options'][] = array(
                    'value' => 'on',
                    'label' => $this->props['label'],
                    'attribs' => $this->props['attribs'],
                );
                $this->props['label'] = null;
                unset($this->props['attribs']['value']);
            }
        }
        if ($type == 'checkbox' && $this->props['checkboxGroup'] === 'auto') {
            $this->props['checkboxGroup'] = \count($this->props['options']) > 1;
        }
        foreach ($this->props['options'] as $key => $option) {
            if (!\is_array($option)) {
                $this->props['options'][$key] = array(
                    'label' => $option,
                    'attribs' => array(
                        'value' => \is_string($key)
                            ? $key
                            : $option,
                    ),
                );
            } else {
                $option = $this->moveShortcuts($option);
                if (!isset($option['label']) && isset($option['attribs']['value'])) {
                    $option['label'] = $option['attribs']['value'];
                }
                $this->props['options'][$key] = $option;
            }
        }
        if (\in_array($type, array('checkbox','select')) && !isset($this->props['values'])) {
            /*
                values may be passed as an alternate way of specifying which values are checked/selected
                single checkbox:
                    passing 'value' is considered the option (not user supplied value) unless options array is non-empty
            */
            $this->props['values'] = isset($this->attribs['value'])
                ? (array) $this->attribs['value']
                : array();
            unset($this->attribs['value']);
        }
    }
1327893
def normalize(file)
      if defined?(CarrierWave::Uploader::Base) && file.is_a?(CarrierWave::Uploader::Base)
        file = file.file
      end

      if defined?(Paperclip) && file.is_a?(Paperclip::Attachment)
        if file.options[:storage] == :filesystem
          {file: File.open(file.path)}
        else
          {url: file.expiring_url}
        end
      elsif defined?(CarrierWave::Storage::Fog::File) && file.is_a?(CarrierWave::Storage::Fog::File)
        {url: file.url}
      elsif defined?(CarrierWave::SanitizedFile) && file.is_a?(CarrierWave::SanitizedFile)
        {file: File.open(file.path)}
      elsif is_io?(file)
        {file: file}
      elsif defined?(ActiveStorage::Blob) && file.is_a?(ActiveStorage::Blob)
        {url: file.service_url}
      elsif is_active_storage_attachment?(file) || is_active_storage_one?(file)
        {url: file.blob.service_url}
      elsif file.respond_to? :url
        {url: file.url}
      elsif file.respond_to? :path
        {file: File.open(file.path)}
      elsif file.respond_to? :file
        {file: File.open(file.file)}
      else
        raise(ArgumentError, 'Bad File/Stream')
      end
    end
393545
function normalizeDirectives (options) {
  const dirs = options.directives
  if (dirs) {
    for (const key in dirs) {
      const def = dirs[key]
      if (typeof def === 'function') {
        dirs[key] = {bind: def, update: def}
      }
    }
  }
}
659092
public void normalize() {
		double sum = 0;
		for(Entry e:entries.values())
			sum+=e.getAssocRate();
		if(sum != 0) {
			for(Entry e:entries.values())
				e.setAssocRate(e.getAssocRate()/sum);
		}
		setDirty();
	}
1074429
function createNormalizedNormalAttribute(normal) {
      if (cachedData.attributes.has(normal)) {
        return cachedData.attributes.get(normal);
      }

      var attribute = normal.clone();

      var v = new THREE.Vector3();

      for (var i = 0, il = attribute.count; i < il; i++) {
        v.fromArray(attribute.array, i * 3);

        if (v.x === 0 && v.y === 0 && v.z === 0) {
          // if values can't be normalized set (1, 0, 0)
          v.setX(1.0);
        } else {
          v.normalize();
        }

        v.toArray(attribute.array, i * 3);
      }

      cachedData.attributes.set(normal, attribute);

      return attribute;
    }
1220933
def compose_nfc(text):
    """"""
    if text is None:
        return None
    if not hasattr(compose_nfc, '_tr'):
        compose_nfc._tr = Transliterator.createInstance('Any-NFC')
    return compose_nfc._tr.transliterate(text)
816771
function normalizeNode() {
    $this->node = '<';
    if (!$this->isStartTag) {
      $this->node .= '/'.$this->tagName.'>';
      return;
    }
    $this->node .= $this->tagName;
    foreach ($this->tagAttributes as $name => $value) {
      $this->node .= ' '.$name.'="'.str_replace('"', '&quot;', $value).'"';
    }
    if ($this->isEmptyTag) {
      $this->node .= ' /';
    }
    $this->node .= '>';
  }
641017
function normalizeDispense(value) {
    var tokens = value.split(' ');
    var result;
    if (tokens.length === 4 && tokens[1] === 'Every') {
        result = {
            "doseQuantity": {
                "value": tokens[0]
            },
            "timing": {
                "repeat": {
                    "durationUnits": tokens[3]
                }
            }
        };
    } else {
        result = {
            "timing": {
                "repeat": {
                    "durationUnits": value
                }
            }
        };
    }
    return result;
}
905220
function normalize(obj) {
    const isMultipart = isFormData(obj);
    const content = { filename: '', value: '', mime: '' };
    const result = ((isMultipart) ? new FormData() : {});
    let file = null;

    Object.keys(obj).forEach((item) => {
        if (isMultipart) {
            if (obj[item].value) content.value = obj[item].value;
            else content.value = obj[item];

            content.filename = obj[item].filename || null;
            content.mime = obj[item].mime || null;

            if (content.value instanceof stream.Stream) {
                result.append(item, content.value, {
                    contentType: content.mime,
                    filename: content.filename,
                });

                return;
            }

            if (Buffer.isBuffer(content.value)) {
                file = FileType(content.value);
                result.append(item, content.value, {
                    contentType: content.mime || file.mime || 'application/octet-stream',
                    filename: content.filename || `data-${Date.now()}.${file.ext || ''}`,
                });

                return;
            }

            if (typeof content.value === 'object') {
                result.append(item, JSON.stringify(content.value), {
                    contentType: 'application/json',
                });

                return;
            }

            result.append(item, content.value);
        } else {
            if (typeof obj[item] === 'object') {
                result[item] = JSON.stringify(obj[item]);
                return;
            }

            result[item] = obj[item];
        }
    });

    return result;
}
1244627
def deaccent(text):
    
    norm = unicodedata.normalize("NFD", text)
    result = "".join(ch for ch in norm if unicodedata.category(ch) != 'Mn')
    return unicodedata.normalize("NFC", result)