Check if object is file like
358614
function isFileLike(v) {
  return Buffer.isBuffer(v) ||
    typeof v === 'object' &&
    typeof v.pipe === 'function' &&
    v.readable !== false;
}
979741
def _HasOOOWrite(self, path):
    """"""
    # Check the sizes of each path before the current one.
    size = tf.io.gfile.stat(path).length
    old_size = self._finalized_sizes.get(path, None)
    if size != old_size:
      if old_size is None:
        logger.error('File %s created after file %s even though it\'s '
                         'lexicographically earlier', path, self._path)
      else:
        logger.error('File %s updated even though the current file is %s',
                         path, self._path)
      return True
    else:
      return False
1208117
function isMatch (obj, source) {
  var objKeys = objectKeys(obj)
  var sourceKeys = objectKeys(source)
  if (sourceKeys.length) {
    if (XEUtils.includeArrays(objKeys, sourceKeys)) {
      return XEUtils.some(sourceKeys, function (key2) {
        return findIndexOf(objKeys, function (key1) {
          return key1 === key2 && isEqual(obj[key1], source[key2])
        }) > -1
      })
    }
  } else {
    return true
  }
  return isEqual(obj, source)
}
760690
def is_image(filename):
    """"""
    # note: isfile() also accepts symlinks
    return os.path.isfile(filename) and filename.lower().endswith(ImageExts)
1117812
def is_collection(obj):
    """"""

    col = getattr(obj, '__getitem__', False)
    val = False if (not col) else True

    if isinstance(obj, basestring):
        val = False

    return val
1130739
def has_method(obj, method_name):
    '''
    
    '''
    if method_name in dir(obj):
        return True

    log.error('Method \'%s\' not yet supported!', method_name)
    return False
132032
def _file_like(self, full_path):
        """"""
        magic = self._match_magic(full_path)
        if magic is not None:
            return magic.file_like(full_path, self.encoding)
        else:
            return open(full_path, 'rb')
1206619
function isRefObject (thing) {
  if (thing && typeof thing === 'object' && !Array.isArray(thing)) {
    const keys = Object.keys(thing)
    return keys.length === 1 && keys[0] === '$ref' && typeof thing.$ref === 'string'
  }
  return false
}
1129514
function isFile(fp, stat) {
  if (stat === true) {
    stat = tryStats(fp);
  }
  return !isDir(fp, stat);
}
691830
def getfile(object):
    """"""
    if ismodule(object):
        if hasattr(object, '__file__'):
            return object.__file__
        raise TypeError, 'arg is a built-in module'
    if isclass(object):
        object = sys.modules.get(object.__module__)
        if hasattr(object, '__file__'):
            return object.__file__
        raise TypeError, 'arg is a built-in class'
    if ismethod(object):
        object = object.im_func
    if isfunction(object):
        object = object.func_code
    if istraceback(object):
        object = object.tb_frame
    if isframe(object):
        object = object.f_code
    if iscode(object):
        return object.co_filename
    raise TypeError, 'arg is not a module, class, method, ' \
                     'function, traceback, frame, or code object'
1170578
function isJsonFile (file) {
  return file.data &&                             // The file has data
    (typeof file.data === 'string') &&            // and it's a string
    (
      mimeTypePattern.test(file.mimeType) ||      // and it has a JSON MIME type
      extensionPattern.test(file.url)             // or at least a .json file extension
    );
}
1048550
def isatty(self):
        ""
        try:
            return os.isatty(self._fileno)
        except OSError, e:
            raise IOError(*e.args)
1303670
def _is_valid_file(self, path):
        """"""
        return isinstance(path, basestring) and os.path.isfile(path)
1277671
def is_file(package):
    """"""
    if hasattr(package, "keys"):
        return any(key for key in package.keys() if key in ["file", "path"])

    if os.path.exists(str(package)):
        return True

    for start in SCHEME_LIST:
        if str(package).startswith(start):
            return True

    return False
714169
def isFile(self):
        
        try:
            filetype = file
        except NameError:
            filetype = io.IOBase

        return self._wrap(type(self.obj) is filetype)
215608
def isfile(path, **kwargs):
    """"""
    import os.path
    return os.path.isfile(path, **kwargs)
918014
def has_parent_object(self, dir_object):
        """"""
        obj = self
        while obj:
            if obj == dir_object:
                return True
            obj = obj.parent_dir
        return False