Checks an address is not the same character repeated or an empty sequence
433556
def check_address(self, address):
        """"""
        if address is None:
            self.raise_error(InvalidAddress, details='address is None')
        if all(letter == address[0] for letter in address) or len(address) < self.minFundingAddressLength or ' ' in address:
            self.raise_error(InvalidAddress, details='address is invalid or has less than ' + str(self.minFundingAddressLength) + ' characters: "' + str(address) + '"')
        return address
142165
static boolean isPrefixEqual(String aUrlStr, String bUrlStr)
  throws MalformedURLException
  {
    URL aUrl = new URL(aUrlStr);
    URL bUrl = new URL(bUrlStr);
    int aPort = aUrl.getPort();
    int bPort = bUrl.getPort();
    if (aPort == -1 && "https".equals(aUrl.getProtocol()))
    {
      // default port number for HTTPS
      aPort = 443;
    }
    if (bPort == -1 && "https".equals(bUrl.getProtocol()))
    {
      // default port number for HTTPS
      bPort = 443;
    }
    // no default port number for HTTP is supported.
    return aUrl.getHost().equalsIgnoreCase(bUrl.getHost()) &&
           aUrl.getProtocol().equalsIgnoreCase(bUrl.getProtocol()) &&
           aPort == bPort;
  }
995315
public static function verifyFormatting($p_address)
    {
        if (strstr($p_address, "@") == false) {
            return false;
        } else {
            list($user, $domain) = explode('@', $p_address);
            if (strstr($domain, '.') == false) {
                return false;
            } else {
                return true;
            }
        }
    }
470704
function repeat(str, n) {
    var result = '';

    for (var i = 0; i < n; i++) {
        result += str;
    }

    return result;
}
307062
def _check_key(key, allow_unicode_keys, key_prefix=b''):
    """"""
    if allow_unicode_keys:
        if isinstance(key, six.text_type):
            key = key.encode('utf8')
    elif isinstance(key, VALID_STRING_TYPES):
        try:
            if isinstance(key, bytes):
                key = key.decode().encode('ascii')
            else:
                key = key.encode('ascii')
        except (UnicodeEncodeError, UnicodeDecodeError):
            raise MemcacheIllegalInputError("Non-ASCII key: '%r'" % key)

    key = key_prefix + key
    parts = key.split()

    if len(key) > 250:
        raise MemcacheIllegalInputError("Key is too long: '%r'" % key)
    # second statement catches leading or trailing whitespace
    elif len(parts) > 1 or parts[0] != key:
        raise MemcacheIllegalInputError("Key contains whitespace: '%r'" % key)
    elif b'\00' in key:
        raise MemcacheIllegalInputError("Key contains null: '%r'" % key)

    return key
583564
def format_address(address):
    """"""
    if address.kind == ArgumentKind.regular:
        return address.name

    return "{0}[{1}]".format(address.name, address.key)
763570
function (str) {
    var output = [];
    var idx = 0;
    var c, num;

    var nextNumber = function () {
      var chars = [];

      while (/[^-\d\.]/.test(str.charAt(idx))) {
        // skip the non-digit characters
        idx++;
      }

      if ('-' === str.charAt(idx)) {
        chars.push('-');
        idx++;
      }

      while ((c = str.charAt(idx)) && /[\d\.Ee]/.test(c)) {
        chars.push(c);
        idx++;
      }

      return parseFloat(chars.join(''));
    };

    while (!isNaN(num = nextNumber())) output.push(num);

    return output;
  }
1007570
def check_allowed_letters(seq, allowed_letters_as_set):
    

    # set of unique letters in sequence
    seq_set = set(seq)

    not_allowed_letters_in_seq = [x for x in seq_set if str(x).upper() not in allowed_letters_as_set]

    if len(not_allowed_letters_in_seq) > 0:
        raise forms.ValidationError(
            "This sequence type cannot contain letters: " + ", ".join(not_allowed_letters_in_seq))
963356
function isPctEncoded (chr) {
        if (!isPercentDigitDigit(chr, 0)) {
            return false;
        }
        var firstCharCode = parseHex2(chr, 1);
        var numBytes = utf8.numBytes(firstCharCode);
        if (numBytes === 0) {
            return false;
        }
        for (var byteNumber = 1; byteNumber < numBytes; byteNumber += 1) {
            if (!isPercentDigitDigit(chr, 3*byteNumber) || !utf8.isValidFollowingCharCode(parseHex2(chr, 3*byteNumber + 1))) {
                return false;
            }
        }
        return true;
    }
1260619
function process(payload) {
  var addressType = parseInt(payload.substr(0,1),16);
  var typeCode = payload.substr(1,1);
  var length = parseInt(payload.substr(2,2),16) % 64;
  var rxAdd = "public";
  var txAdd = "public";
  if(addressType & 0x8) {
    rxAdd = "random";
  }
  if(addressType & 0x4) {
    txAdd = "random";
  }   
  var type;
  switch(typeCode) {
    case("0"):
      type = TYPE0_NAME;
      break;
    case("1"):
      type = TYPE1_NAME;
      break;
    case("2"):
      type = TYPE2_NAME;
      break;
    case("3"):
      type = TYPE3_NAME;
      break;
    case("4"):
      type = TYPE4_NAME;
      break;
    case("5"):
      type = TYPE5_NAME;
      break;
    case("6"):
      type = TYPE6_NAME;
      break;
    default: 
      type = TYPE_UNDEFINED_NAME;
  }
  return { type: type,
           length: length,
           txAdd: txAdd,
           rxAdd: rxAdd
  };
}
519161
function scanUnicodeRange(scanner) {
    var hexStart = scanner.tokenStart + 1; // skip +
    var hexLength = 0;

    scan: {
        if (scanner.tokenType === NUMBER) {
            if (scanner.source.charCodeAt(scanner.tokenStart) !== FULLSTOP && scanUnicodeNumber(scanner)) {
                scanner.next();
            } else if (scanner.source.charCodeAt(scanner.tokenStart) !== HYPHENMINUS) {
                break scan;
            }
        } else {
            scanner.next(); // PLUSSIGN
        }

        if (scanner.tokenType === HYPHENMINUS) {
            scanner.next();
        }

        if (scanner.tokenType === NUMBER) {
            scanner.next();
        }

        if (scanner.tokenType === IDENTIFIER) {
            scanner.next();
        }

        if (scanner.tokenStart === hexStart) {
            scanner.error('Unexpected input', hexStart);
        }
    }

    // validate for U+x{1,6} or U+x{1,6}-x{1,6}
    // where x is [0-9a-fA-F]
    for (var i = hexStart, wasHyphenMinus = false; i < scanner.tokenStart; i++) {
        var code = scanner.source.charCodeAt(i);

        if (isHex(code) === false && (code !== HYPHENMINUS || wasHyphenMinus)) {
            scanner.error('Unexpected input', i);
        }

        if (code === HYPHENMINUS) {
            // hex sequence shouldn't be an empty
            if (hexLength === 0) {
                scanner.error('Unexpected input', i);
            }

            wasHyphenMinus = true;
            hexLength = 0;
        } else {
            hexLength++;

            // too long hex sequence
            if (hexLength > 6) {
                scanner.error('Too long hex sequence', i);
            }
        }

    }

    // check we have a non-zero sequence
    if (hexLength === 0) {
        scanner.error('Unexpected input', i - 1);
    }

    // U+abc???
    if (!wasHyphenMinus) {
        // consume as many U+003F QUESTION MARK (?) code points as possible
        for (; hexLength < 6 && !scanner.eof; scanner.next()) {
            if (scanner.tokenType !== QUESTIONMARK) {
                break;
            }

            hexLength++;
        }
    }
}
1270326
function verifyAddress(address) {
  var ifs = os.networkInterfaces();
  var nics = Object.keys(ifs);
  var i, j, match = false;
  nicLoop:
    for (i = 0; i < nics.length; i++) {
      var nic = ifs[nics[i]];
      for (j = 0; j < nic.length; j++) {
        if (nic[j].address === address && !nic[j].internal) {
          match = true;
          break nicLoop;
        }
      }
    }
  return match;
}
288288
def ref_string_matches_ref_sequence(self, ref_sequence):
        ''''''
        # you never know what you're gonna get...
        if self.POS < 0:
            return False

        end_pos = self.ref_end_pos()
        if end_pos >= len(ref_sequence):
            return False

        return self.REF == ref_sequence[self.POS:end_pos + 1]
4430
public static ErrorCode isAddressValid(String address){
        if (!isMustFieldValid( address, ipRegEx)) {
            return ErrorCode.SERVICE_INSTANCE_ADDRESS_FORMAT_ERROR;
        }
        return ErrorCode.OK;
    }
697045
boolean isTask(int sequence) {
        int index = toIndex(sequence);
        checkSequence(index, sequence);
        return isTask[index];
    }
596930
def _street_addr_from_response(self, match):
        
        # Same caveat as above regarding the ordering of these fields; the
        # documentation is not explicit about the correct ordering for
        # reconstructing a full address, but implies that this is the ordering.
        ordered_fields = ['preQualifier', 'preDirection', 'preType', 'streetName',
                          'suffixType', 'suffixDirection', 'suffixQualifier']
        result = []
        # The address components only contain a from and to address, not the
        # actual number of the address that was matched, so we need to cheat a
        # bit and extract it from the full address string. This is likely to
        # miss some edge cases (hopefully only a few since this is a US-only
        # geocoder).
        addr_num_re = re.match(r'([0-9]+)', match['matchedAddress'])
        if not addr_num_re:  # Give up
            return ''
        result.append(addr_num_re.group(0))
        for field in ordered_fields:
            result.append(match['addressComponents'].get(field, ''))
        if any(result):
            return ' '.join([s for s in result if s])  # Filter out empty strings.
        else:
            return ''
443600
function (str, index) {
            var res = false;
            for (var i = index - 1; i >= 0; i--) {
                if (str.charAt(i) == "\\") {
                    res = !res;
                } else {
                    return res;
                }
            }
            return res;
        }