Returns a normalized version of the standard address parts.
340684
def standard
      form = self.mailbox
      form += @config[:tag_separator] + self.tag if self.tag
      form += "(" + self.comment + ")" if self.comment
      form.gsub!(/([\\\"])/, '\\\1') # Escape \ and "
      if form =~ /[ \"\(\),:<>@\[\\\]]/ # Space and "(),:;<>@[\]
        form = %Q("#{form}")
      end
      form
    end
475858
def addr(self,address):
        ''''''
        if isinstance(address,basestring):
            # If you just gave me a single string, assume its "XXXX XXXX"
            addr = address.split()
        else:
            addr = list(address)
        # Convert to actual hex if you give me strings
        for i in xrange(len(addr)):
            if isinstance(addr[i],basestring):
                addr[i] = int(addr[i],16)
        for frame in self.raw_frames:
            if frame['addr']==address:
                return frame
768997
def normalize_url(node):
    """"""
    if not node:
        node = DEFAULT_NODE
    elif '://' not in node:
        node = '//{}'.format(node)
    parts = urlparse(node, scheme='http', allow_fragments=False)
    port = parts.port if parts.port else _get_default_port(parts.scheme)
    netloc = '{}:{}'.format(parts.hostname, port)
    return urlunparse((parts.scheme, netloc, parts.path, '', '', ''))
304969
def normalize(domain)
			# strip off the protocol (\w{1,20}://), the URI (/), parameters (?), port number (:), and username (.*@)
			# then split into parts via the .
			parts = domain.gsub(/^\w{1,20}:\/\//,'').gsub(/[\/\?\:].*/,'').gsub(/.*?\@/,'').split(/\./)
			# grab the last two parts of the domain
			dom = parts[-2,2].join(".")
			# if the dom is in the two_level_tld list, then use three parts
			if @two_level_tld.index(dom)
				dom = parts[-3,3].join(".")
			end
			if @three_level_tld.index(dom)
				dom = parts[-4,4].join(".")
			end
			dom
		end
899910
def format_addresses(addrs):
    
    return ', '.join(
        formataddr(item) if isinstance(item, tuple) else item
        for item in addrs
    )
1352375
def formalised_address(self):
        
        try:
            if self._data_from_search:
                t = self._data_from_search.find('a').contents[0]
            else:
                t = self._ad_page_content.find(
                    'div', {'class': 'smi-object-header'}).find(
                    'h1').text.strip()

        except Exception as e:
            if self._debug:
                logging.error(
                    "Error getting formalised_address. Error message: " + e.args[0])
            return
        s = t.split('-')
        a = s[0].strip()
        if 'SALE AGREED' in a:
            a = a.split()
            a = a[3:]
            a = ' '.join([str(x) for x in a])
        return a.lower().title().strip()
343009
function normalizeArray(parts, allowAboveRoot) {
    var res = [];

    for (var i = 0; i < parts.length; i += 1) {
      var p = parts[i];
      if (!p || p === '.') continue;
      if (p === '..') {
        if (res.length && res[res.length - 1] !== '..') {
          res.pop();
        } else if (allowAboveRoot) {
          res.push('..');
        }
      } else if (/^http(s)?:/.test(p)) {
        res.push(p + '/');
      } else {
        res.push(p);
      }
    }
    return res;
  }
1216263
def normalize(rendered):
    """"""
    out = ''.join([line.strip()
                   for line in rendered.splitlines()
                   if line.strip()])
    out = out.replace(', ', ',')
    return out
1220878
public static String normalizePathMapping(String pathMapping) {

		String normalizedPathMapping = normalizePath(pathMapping);
		if (normalizedPathMapping.endsWith("/**"))
			normalizedPathMapping = normalizedPathMapping.substring(0, normalizedPathMapping.length() - 3);
		return normalizedPathMapping;
	}
242472
def normalize_string(mac_type, resource, content_hash):
    """"""

    normalized = [
        'hawk.' + str(HAWK_VER) + '.' + mac_type,
        normalize_header_attr(resource.timestamp),
        normalize_header_attr(resource.nonce),
        normalize_header_attr(resource.method or ''),
        normalize_header_attr(resource.name or ''),
        normalize_header_attr(resource.host),
        normalize_header_attr(resource.port),
        normalize_header_attr(content_hash or '')
    ]

    # The blank lines are important. They follow what the Node Hawk lib does.

    normalized.append(normalize_header_attr(resource.ext or ''))

    if resource.app:
        normalized.append(normalize_header_attr(resource.app))
        normalized.append(normalize_header_attr(resource.dlg or ''))

    # Add trailing new line.
    normalized.append('')

    normalized = '\n'.join(normalized)

    return normalized
437335
def address(self):
		""
		_ = struct.pack('L', self.address_num)
		return struct.unpack('!L', _)[0]
647110
private static List<String> splitAddress(String addresses){
		if(StrUtil.isBlank(addresses)) {
			return null;
		}
		
		List<String> result;
		if(StrUtil.contains(addresses, ',')) {
			result = StrUtil.splitTrim(addresses, ',');
		}else if(StrUtil.contains(addresses, ';')) {
			result = StrUtil.splitTrim(addresses, ';');
		}else {
			result = CollUtil.newArrayList(addresses);
		}
		return result;
	}
1048261
function normalizeIP(addr) {
  var claimsToBeIPv6 = /:/.test(addr);
  if(claimsToBeIPv6) {
    var ip6 = new Address6(addr);
    if(ip6.valid) {
      return ip6.canonicalForm();
    } else if(ip6.error) {
      throw new Error(ip6.error);
    } else {
      throw new Error("Unknown error while parsing IPv6 address.");
    }
  } else {
    var isIPv4 = false;
    try {
      var ip4 = new Address4(addr);
      isIPv4 = ip4.valid;
    }
    //  Any exception thrown implies not a valid IPv4 address.
    catch(error) {
      throw new Error("Unknown error while parsing IPv4 Address: "+error);
    }

    if(isIPv4) {
      return addr;
    }
    else {
      throw new Error("Unknown error while parsing IPv4 Address.");
    }
  }
}
463247
def get_standard(self):
        """"""
        try:
            res = urlopen(PARSELY_PAGE_SCHEMA)
        except:
            return []
        text = res.read()
        if isinstance(text, bytes):
            text = text.decode('utf-8')
        tree = etree.parse(StringIO(text))
        stdref = tree.xpath("//div/@about")
        return [a.split(':')[1] for a in stdref]
966381
function normalize (mac) {
  let m = CISCO_MAC_ADDRESS_RE.exec(mac)
  if (m) {
    const halfwords = m.slice(1)
    mac = halfwords.map((halfword) => {
      return zeroFill(4, halfword)
    }).join('')
    return chunk(mac, 2).join(':').toUpperCase()
  }

  m = MAC_ADDRESS_RE.exec(mac)
  if (m) {
    const bytes = m.slice(1)
    return bytes
      .map(byte => zeroFill(2, byte))
      .join(':')
      .toUpperCase()
  }
}
1330985
def _normalize(self, addr):
        """"""
        normalize = None
        if isinstance(addr, Address):
            normalize = addr.addr
            self._is_x10 = addr.is_x10

        elif isinstance(addr, bytearray):
            normalize = binascii.unhexlify(binascii.hexlify(addr).decode())

        elif isinstance(addr, bytes):
            normalize = addr

        elif isinstance(addr, str):
            addr = addr.replace('.', '')
            addr = addr[0:6]
            if addr[0:3].lower() == 'x10':
                x10_addr = Address.x10(addr[3:4], int(addr[4:6]))
                normalize = x10_addr.addr
                self._is_x10 = True
            else:
                normalize = binascii.unhexlify(addr.lower())

        elif addr is None:
            normalize = None

        else:
            _LOGGER.warning('Address class init with unknown type %s: %r',
                            type(addr), addr)
        return normalize
352999
def getaddresses(fieldvalues):
    """"""
    all = COMMASPACE.join(fieldvalues)
    a = _AddressList(all)
    return a.addresslist