Check that the stream is a file
488664
def _check_stream(stream):
    ''''''
    if not isinstance(stream, type(_sys.stderr)):
        raise TypeError("The stream given ({}) is not a file object.".format(stream))
39486
function hasFileType(file, fileExt) {
  file = path.basename(file);
  var ext = path.extname(file);
  do {
    if (ext === fileExt) {
      return true;
    } else {
      file = path.basename(file, ext);
      ext = path.extname(file);
    }
  } while (ext);
  return false;
}
670046
def stream_data(self, ostream):
        """"""
        istream = self.repo.odb.stream(self.binsha)
        stream_copy(istream, ostream)
        return self
617846
public function isStream()
    {
        if ($this->data instanceof StreamInterface) {
            return true;
        }

        if (!is_resource($this->data)) {
            return false;
        }

        if (get_resource_type($this->data) !== 'stream') {
            return false;
        }

        return true;
    }
1303670
def _is_valid_file(self, path):
        """"""
        return isinstance(path, basestring) and os.path.isfile(path)
1086990
def _stream_out(self, outfile, append=False):
        '''
        
        '''
        if type(outfile) in (str, unicode):
            outfile = os.path.expanduser(os.path.expandvars(outfile))
            outfile = open(outfile, 'a' if append else 'w')
        self._run(outfile)
        self._pop.wait()
47550
function processFile(rootPath, log) {
  return (file, callback) => {
    const filePath = path.join(rootPath, file.path);
    const writeMode = isStream(file.data) ? WriteMode.STREAM : WriteMode.UTF8;
    write(filePath, file.data, writeMode, (error) => {
      if (log === true && !error) {
        console.log(`Successfully wrote file '${file.path}'`);
      }

      async.nextTick(callback, error, file);
    });
  };
}
36550
def _is_streaming_request(self):
        """"""
        arg2 = self.argstreams[1]
        arg3 = self.argstreams[2]
        return not (isinstance(arg2, InMemStream) and
                    isinstance(arg3, InMemStream) and
                    ((arg2.auto_close and arg3.auto_close) or (
                        arg2.state == StreamState.completed and
                        arg3.state == StreamState.completed)))
973836
def get_file_stream(self):
        
        if self.file_stream:
            self.file_stream.seek(0)
            return self.file_stream
        elif os.path.isfile(self.file_path):
            return open(self.file_path, 'rb')
        else:
            raise ValueError("invalid file {}".format(self.file_path))
357846
private boolean isFileType(WatchEvent event, String fileType) {
        return event.context().toString().contains(fileType);
    }
446708
function stream (env) {
    let parseStream = parseFilter(env)

    let filter = through.obj((file, enc, cb) => cb(), function (cb) {
      parseStream.promise.then(data => {
        this.push(data)
        cb()
      }, cb)
    })

    return pipe(parseStream, filter)
  }
202114
def io_check(*args, func=None):
    """"""
    func = func or inspect.stack()[2][3]
    for var in args:
        if not isinstance(var, io.IOBase):
            name = type(var).__name__
            raise IOObjError(
                f'Function {func} expected file-like object, {name} got instead.')
41588
def is_valid_file(parser, arg):
    """"""
    arg = os.path.abspath(arg)
    if not os.path.exists(arg):
        parser.error("The file %s does not exist!" % arg)
    else:
        return arg
865884
function FileReadStream(path, options) {
  stream.Stream.call(this);
  this.readable = true;

  if(!options) {
    options = {};
  }

  this._destroyed = false;
  this._streamEnded = false;
  this._fd = null;
  this._fileName = undefined;
  this._highWaterMark = options.highWaterMark || bufferSize;
  this._offset = 0;
  this._paused = undefined;
  this._allocator = options.allocator;
  this._fileName = path;

  this._md5hash = null;
  this._md5sum = undefined;

  if (options.calcContentMd5) {
    this._md5hash = new Md5Wrapper().createMd5Hash();
  }

  this._open();
}
1065557
async function isFileOfType(filename, condition){
    try{
        // get stats
        const stats = await _fs.stat(filename);

        // is directory ?
        return condition(stats);
    }catch(e){
        // file not found error ?
        if (e.code === 'ENOENT'){
            return false;
        }else{
            throw e;
        }
    }
}
355486
private void checkFile() throws IORuntimeException {
		Assert.notNull(file, "File to write content is null !");
		if(this.file.exists() && false == file.isFile()){
			throw new IORuntimeException("File [{}] is not a file !", this.file.getAbsoluteFile());
		}
	}
795972
function(file) {
        var FileSystem = require('./fs.js');
        var ReadStream = require('./read_stream.js');

        if(FileSystem.fs.existFile(file)) {
            file = FileSystem.fs.pathResolve(file);
            var readStream = new ReadStream(file);

            return _.clone(readStream.trackStack);
        } else {
            return false;
        }
    }