Looks up the SimFileDescriptor associated with the given number (an AST).
        If the number is concrete and does not map to anything, return None.
        If the number is symbolic, constrain it to an open fd and create a new file for it.
355119
def get_fd(self, fd):
        
        try:
            fd = self.state.solver.eval_one(fd)
        except SimSolverError:
            ideal = self._pick_fd()
            self.state.solver.add(fd == ideal)
            if not self.state.solver.satisfiable():
                raise SimPosixError("Tried to do operation on symbolic but partially constrained file descriptor")
            fd = ideal
            new_filename = b'/tmp/angr_implicit_%d' % self.autotmp_counter
            l.warning("Tried to look up a symbolic fd - constrained to %d and opened %s", ideal, new_filename)
            self.autotmp_counter += 1
            if self.open(new_filename, Flags.O_RDWR, preferred_fd=fd) != fd:
                raise SimPosixError("Something went wrong trying to open implicit temp")

        return self.fd.get(fd)
159141
def load_from_file_object(cls, fd, format=None):
        
        format = 'pickle' if format is None else format
        load = getattr(cls, "load_%s" % format, None)
        if load is None:
            raise ValueError("Unknown format '%s'." % format)
        return load(fd)
1255006
def _is_number_match_SS(number1, number2):
    
    try:
        numobj1 = parse(number1, UNKNOWN_REGION)
        return _is_number_match_OS(numobj1, number2)
    except NumberParseException:
        _, exc, _ = sys.exc_info()
        if exc.error_type == NumberParseException.INVALID_COUNTRY_CODE:
            try:
                numobj2 = parse(number2, UNKNOWN_REGION)
                return _is_number_match_OS(numobj2, number1)
            except NumberParseException:
                _, exc2, _ = sys.exc_info()
                if exc2.error_type == NumberParseException.INVALID_COUNTRY_CODE:
                    try:
                        numobj1 = parse(number1, None, keep_raw_input=False,
                                        _check_region=False, numobj=None)
                        numobj2 = parse(number2, None, keep_raw_input=False,
                                        _check_region=False, numobj=None)
                        return _is_number_match_OO(numobj1, numobj2)
                    except NumberParseException:
                        return MatchType.NOT_A_NUMBER

    # One or more of the phone numbers we are trying to match is not a viable
    # phone number.
    return MatchType.NOT_A_NUMBER
1181823
def is_number(obj):
    """"""
    return isinstance(obj, (int, float, np.int_, np.float_))
1272796
function isNumber(o)  {
    return o !== undefined && o !== null &&
          (typeof o === "number" || o.constructor === Number);
}
108292
def to_ast(value):
    

    if isinstance(value, (type(None), bool)):
        return builtin_folding(value)
    if sys.version_info[0] == 2 and isinstance(value, long):
        from pythran.syntax import PythranSyntaxError
        raise PythranSyntaxError("constant folding results in big int")
    if any(value is t for t in (bool, int, float)):
        iinfo = np.iinfo(int)
        if isinstance(value, int) and not (iinfo.min <= value <= iinfo.max):
            from pythran.syntax import PythranSyntaxError
            raise PythranSyntaxError("constant folding results in big int")
        return builtin_folding(value)
    elif isinstance(value, np.generic):
        return to_ast(np.asscalar(value))
    elif isinstance(value, numbers.Number):
        return ast.Num(value)
    elif isinstance(value, str):
        return ast.Str(value)
    elif isinstance(value, (list, tuple, set, dict, np.ndarray)):
        return size_container_folding(value)
    elif hasattr(value, "__module__") and value.__module__ == "__builtin__":
        # TODO Can be done the same way for others modules
        return builtin_folding(value)
    # only meaningful for python3
    elif sys.version_info.major == 3:
        if isinstance(value, (filter, map, zip)):
            return to_ast(list(value))
    raise ToNotEval()
1294492
def as_pseudo(cls, obj):
        
        return obj if isinstance(obj, cls) else cls.from_file(obj)
6535
function SymbolicLinkFinder(options) {
  this.scanDirs = options && options.scanDirs || ['.'];
  this.extensions = options && options.extensions || ['.js'];
  this.ignore = options && options.ignore || null;
}
989125
def numberify_file(self, filename):
        '''
        '''
        try:
            fd = open(filename, 'r+')
            lines = fd.readlines()
            for i in range(len(lines)):
                if lines[i][0:len(str(i+1))] != str(i+1):
                    lines[i] = str(i+1) + ' ' + lines[i]
                else:
                    print "File already numbered"
                    return False
            fd.seek(0)
            fd.writelines(lines)
            fd.close()
            return True
        except IOError as e:
            print 'I/O error({0}): {1}'.format(e.errno, e.strerror)
        except:
            print 'Unexpected error:', exc_info()[0]
            raise
511026
def value(self) -> Optional[int]:
        
        if self.symbolic:
            return None
        assert isinstance(self.raw, z3.BitVecNumRef)
        return self.raw.as_long()
1034656
private NumberSelectionResult findByNumber(List<String> numberQueries,
            Sid sourceOrganizationSid, Sid destinationOrganizationSid, Set<SearchModifier> modifiers) {
        Boolean orgFiltered = false;
        NumberSelectionResult matchedNumber = new NumberSelectionResult(null, orgFiltered, null);
        int i = 0;
        while (matchedNumber.getNumber() == null && i < numberQueries.size()) {
            matchedNumber = findSingleNumber(numberQueries.get(i),
                    sourceOrganizationSid, destinationOrganizationSid, modifiers);
            //preserve the orgFiltered flag along the queries
            if (matchedNumber.getOrganizationFiltered()) {
                orgFiltered = true;
            }
            i = i + 1;
        }
        matchedNumber.setOrganizationFiltered(orgFiltered);
        return matchedNumber;
    }
1105030
def get_fd(file_or_fd, default=None):
    """"""
    fd = file_or_fd
    if fd is None:
        fd = default
    if hasattr(fd, "fileno"):
        fd = fd.fileno()
    return fd
853160
def fromfile(cls, f, n=-1):
        """"""
        headerlen = calcsize(cls.FILE_FMT)

        if 0 < n < headerlen:
            raise ValueError('n too small!')

        filter = cls(1)  # Bogus instantiation, we will `_setup'.
        filter._setup(*unpack(cls.FILE_FMT, f.read(headerlen)))
        filter.bitarray = bitarray.bitarray(endian='little')
        if n > 0:
            (filter.bitarray.frombytes(f.read(n-headerlen)) if is_string_io(f)
             else filter.bitarray.fromfile(f, n - headerlen))
        else:
            (filter.bitarray.frombytes(f.read()) if is_string_io(f)
             else filter.bitarray.fromfile(f))
        if filter.num_bits != filter.bitarray.length() and \
               (filter.num_bits + (8 - filter.num_bits % 8)
                != filter.bitarray.length()):
            raise ValueError('Bit length mismatch!')

        return filter
747965
function _copyFileSync(src, dest, flag) {
    const SIZE = 65536;

    const COPYFILE_EXCL = 1;
    const COPYFILE_FICLONE = 2;
    const COPYFILE_FICLONE_FORCE = 4;

    const constants = {
        COPYFILE_EXCL,
        COPYFILE_FICLONE,
        COPYFILE_FICLONE_FORCE,
    };

    const isNumber = (a) => typeof a === 'number';
    const or = (a, b) => a | b;
    const getValue = (obj) => (key) => obj[key];

    const getMaxMask = (obj) => Object
          .keys(obj)
          .map(getValue(obj))
          .reduce(or);

    const MAX_MASK = getMaxMask(constants);
    const isExcl = (flags) => flags & COPYFILE_EXCL;


    const writeFlag = isExcl(flag) ? 'wx' : 'w';

    const {
        size,
        mode,
    } = fs.statSync(src);

    const fdSrc = fs.openSync(src, 'r');
    const fdDest = fs.openSync(dest, writeFlag, mode);

    const length = size < SIZE ? size : SIZE;

    let pos = 0;
    const peaceSize = size < SIZE ? 0 : size % SIZE;
    const offset = 0;

    let buffer = Buffer.allocUnsafe(length);
    for (let i = 0; length + pos + peaceSize <= size; i++, pos = length * i) {
        fs.readSync(fdSrc, buffer, offset, length, pos);
        fs.writeSync(fdDest, buffer, offset, length, pos);
    }

    if (peaceSize) {
        const length = peaceSize;
        buffer = Buffer.allocUnsafe(length);
        fs.readSync(fdSrc, buffer, offset, length, pos);
        fs.writeSync(fdDest, buffer, offset, length, pos);
    }

    fs.closeSync(fdSrc);
    fs.closeSync(fdDest);
}
969553
def _AddFileDescriptor(self, file_desc):
    

    if not isinstance(file_desc, descriptor.FileDescriptor):
      raise TypeError('Expected instance of descriptor.FileDescriptor.')
    self._file_descriptors[file_desc.name] = file_desc
966931
function parseFormatDescriptor(formatStr, pos) {

    var fd = {};    // return object

    if (typeof formatStr !== 'string' || pos >= formatStr.length)
        return fd;

    // check argument sanity
    if (typeof pos !== 'number' || typeof formatStr !== 'string' || formatStr.length <= pos)
        return fd;

    if (formatStr[pos] !== '%') return fd;
    fd.startPos = pos;      // startPos is the character position where the '%' is
    if (++pos >= formatStr.length) return fd;   // skip the '%'

    // get the flags
    // Flag    Meaning
    // -       The output is left justified in its field, not right justified (the default).
    // +       Signed numbers will always be printed with a leading sign (+ or -).
    // space   Positive numbers are preceded by a space (negative numbers by a - sign).
    // 0       For numeric conversions, pad with leading zeros to the field width.
    // #       An alternative output form. For o, the first digit will be '0'. For x or X,
    //          "0x" or "0X" will be prefixed to a non-zero result. For e, E, f, F, g and G,
    //          the output will always have a decimal point; for g and G, trailing zeros will
    //          not be removed.
    fd.flags = {};
    fd.flags.leftJustified = false;
    fd.flags.forceSign = false;
    fd.flags.showNegSign = false;
    fd.flags.leadingZeros = false;
    fd.flags.altNumeric = false;

    while (pos < formatStr.length && (formatStr[pos] === '-' || formatStr[pos] === '+' ||
             formatStr[pos] === ' ' || formatStr[pos] === '0' || formatStr[pos] === '#')) {
        switch (formatStr[pos]) {
        case '-':
            fd.flags.leftJustified = true;
            break;
        case '+':
            fd.flags.forceSign = true;
            break;
        case ' ':
            fd.flags.showNegSign = true;
            break;
        case '0':
            fd.flags.leadingZeros = true;
            break;
        case '#':
            fd.flags.altNumeric = true;
            break;
        }
        pos++;
    }

    if (pos >= formatStr.length) return fd;

    // get the field width
    // The converted argument will be printed in a field at least this wide, and wider if
    // necessary. If the converted argument has fewer characters than the field width, it
    // will be padded on the left (or right, if left adjustment has been requested) to make
    // up the field width. The padding character is normally ' ' (space), but is '0' if the
    // zero padding flag (0) is present.
    //
    // If the field width is specified as *, the value is computed from the next argument,
    // which must be an int.
    if (formatStr[pos] === '*') {
        fd.fieldWidth = '*';
        pos++;
    } else if (formatStr[pos] >= '0' && formatStr[pos] <= '9') {
        fd.fieldWidth = formatStr[pos++];
        while (pos <= formatStr.length && formatStr[pos] >= '0' && formatStr[pos] <= '9')
            fd.fieldWidth += formatStr[pos++];
        fd.fieldWidth = parseInt(fd.fieldWidth, 10);
    }

    if (pos >= formatStr.length) return fd;

    // get the percision
    // A dot '.' separates the field width from the precision.
    // If the precision is specified as *, the value is computed from the next argument, which must be an int.
    if (formatStr[pos] === '.') {
        if (++pos >= formatStr.length) return fd;

        if (formatStr[pos] === '*') {
            fd.precision = '*';
            pos++;
        } else if (formatStr[pos] >= '0' && formatStr[pos] <= '9') {
            fd.precision = formatStr[pos++];
            while (pos <= formatStr.length && formatStr[pos] >= '0' && formatStr[pos] <= '9')
                fd.precision += formatStr[pos++];
            fd.precision = parseInt(fd.precision, 10);
        }
    }

    if (pos >= formatStr.length) return fd;

    // Get the lenth modifier
    // Char Meaning
    // h    The value is to be displayed as a short or unsigned short.
    // l    For d, i, o, u, x or X conversions: the argument is a long, not an int.
    // L    For e, f, g or G conversions: the argument is a long double.
    // NOTE: We handle a length modifier, if present but don't do anything with it
    if (formatStr[pos] === 'h' || formatStr[pos] === 'l' || formatStr[pos] === 'L')
        pos++;

    if (pos >= formatStr.length) return fd;

    // get the conversion character
    // Conversion   Meaning
    // s    The maximum number of characters to be printed from the string.
    // e, E, f  The number of digits to be printed after the decimal point.
    // g, G The number of significant digits.
    // d, i, o, u, x, X The minimum number of digits to be printed. Leading
    //    zeros will be added to make up the field width.
    if (isConversionChar(formatStr[pos]))
        fd.conversion = formatStr[pos++];
    else
        fd.conversion = false;

    fd.endPos = pos;
    return fd;
}
799781
def read_binary_real(fname,fd,length)
      raise CFFormatError.new("Real greater than 8 bytes: #{length}") if length > 3

      nbytes = 1 << length
      buff = fd.read(nbytes)

      CFReal.new(
        case length
        when 0 # 1 byte float? must be an error
          raise CFFormatError.new("got #{length+1} byte float, must be an error!")
        when 1 # 2 byte float? must be an error
          raise CFFormatError.new("got #{length+1} byte float, must be an error!")
        when 2 then
          buff.reverse.unpack("e")[0]
        when 3 then
          buff.reverse.unpack("E")[0]
        else
          fail "unexpected length: #{length}"
        end
      )
    end