Returns a VLCPanel class

    Parameters
    ----------
    filepath: String
    \tFile path of video
    volume: Float, optional
    \tSound volume
962367
def vlcpanel_factory(filepath, volume=None):
    

    vlc_panel_cls = VLCPanel
    VLCPanel.filepath = filepath
    if volume is not None:
        VLCPanel.volume = volume

    return vlc_panel_cls
953378
def from_video(self, path):
        
        frames = self.get_video_frames(path)
        self.handle_type(frames)
        return self
1347264
protected function getReflection($filepath)
    {
        // Regexp instead of tokenizer because of the bad perf @link > https://gist.github.com/1886076
        if (!preg_match('#^namespace\s+(.+?);.*class\s+(\w+).+;$#sm', file_get_contents($filepath), $captured)) {
            throw new \RuntimeException('Unable to find namespace or class declaration');
        }

        $fqcn = $captured[1].'\\'.$captured[2];

        try {
            $reflectedClass = new \ReflectionClass($fqcn);
        } catch (\ReflectionException $exception) {
            $this->registerAutoload($fqcn, $filepath);
            $reflectedClass = new \ReflectionClass($fqcn);
        }

        return $reflectedClass;
    }
251257
def File(self, path):
    """"""

    return vfs.FileRef(
        client_id=self.client_id, path=path, context=self._context)
626441
def load_media(self, vidSource):
		
		if not os.path.exists(vidSource):
			print("File not found: " + vidSource)
			pygame.display.quit()
			pygame.quit()
			sys.exit(1)

		self.decoder.load_media(vidSource)
		self.decoder.loop = self.loop
		pygame.display.set_caption(os.path.split(vidSource)[1])
		self.vidsize = self.decoder.clip.size

		self.destsize = self.calc_scaled_res(self.windowSize, self.vidsize)
		self.vidPos = ((self.windowSize[0] - self.destsize[0]) / 2, (self.windowSize[1] - self.destsize[1]) / 2)

		self.__textureSetup()

		if(self.decoder.audioformat):
			if self.soundrenderer == "pygame":
				from mediadecoder.soundrenderers import SoundrendererPygame
				self.audio = SoundrendererPygame(self.decoder.audioformat)
			elif self.soundrenderer == "pyaudio":
				from mediadecoder.soundrenderers.pyaudiorenderer import SoundrendererPyAudio
				self.audio = SoundrendererPyAudio(self.decoder.audioformat)
			elif self.soundrenderer == "sounddevice":
				from mediadecoder.soundrenderers.sounddevicerenderer import SoundrendererSounddevice
				self.audio = SoundrendererSounddevice(self.decoder.audioformat)
			self.decoder.set_audiorenderer(self.audio)
510631
def read_file(cls, filepath):
        
        with open(filepath, mode='rb') as f:
            contents = f.read()
        return cls.decode(contents)
106391
function loadFile(filepath, defaultObj) {
  defaultObj = defaultObj || {};

  if (!isFile(filepath)) { return defaultObj; }

  var extension = path.extname(filepath).replace(/^\./, '');
  var contents = supportedExtensions[extension](filepath);

  return assign({}, defaultObj, contents);
}
738535
def get_png_dim(filepath: str) -> int:
    
    if not imghdr.what(filepath) == 'png':
        raise Exception("not PNG")
    head = open(filepath, 'rb').read(24)
    return struct.unpack('!II', head[16:24])
121712
def vofile(filename, **kwargs):
    
    basename = os.path.basename(filename)
    if os.access(basename, os.R_OK):
        return open(basename, 'r')
    kwargs['view'] = kwargs.get('view', 'data')
    return client.open(filename, **kwargs)
138459
function (filePath)
		{
			if (typeof arguments[1]=='function')
				var cb = arguments[1];

			if (typeof arguments[2]=='function')
				var cb = arguments[2];

			var binary = typeof arguments[1]=='boolean' ? arguments[1] : false,
				realPath = this.instanceOf('wnModule')?this.modulePath+filePath:filePath,
				cmd = !cb ? 'readFileSync' : 'readFile';

			try {
				var _cb = cb ? function (err,file) {
					cb&&cb(!err ? ((binary===true) ? file : file.toString()) : false);
				} : null,
				file = fs[cmd](realPath,_cb);
			} catch (e)
			{
				if (_cb)
					cb&&cb(false);
				else
					return false;
			}
			return (file ? (binary===true) ? file : file.toString() : false);
		}
489598
def _build_filepath_for_phantomcss(filepath):
    
    try:
        if os.path.exists(filepath):
            new_root = '.'.join((os.path.splitext(filepath)[0], 'diff'))
            ext = os.path.splitext(filepath)[1]
            diff_filepath = ''.join((new_root, ext))
            if os.path.exists(diff_filepath):
                print 'removing stale diff: {0}'.format(diff_filepath)
                os.remove(diff_filepath)
            return diff_filepath
        else:
            return filepath
    except OSError, e:
        print e
1365145
def read_tabular(filepath):
    
    _, fn, ext = splitext2(filepath)
    if ext == '.h5':
        return _read_tabular_h5(filepath)
    elif ext == '.pkl':
        return _read_tabular_pickle(filepath)
    else:
        raise NotImplementedError
1224690
def get_file(self, file_path, mode="r"):
        
        return open(self.cont_path(file_path), mode=mode)
359288
function getLines(filePath) {
  // if (path.isAbsolute(filePath)) throw new Error('Absolute file path is not allowed: ' + filePath);

  if (_.isArray(filePath)) {
    // If it's already lines, return the arg.
    return filePath;
  }

  if (!fileLines[filePath]) {
    // if the file is moved, find the real file path
    let realFilePath = _.findKey(mvs, s => s === filePath) || filePath;
    // if dir is moved, find the original file path
    Object.keys(mvDirs).forEach(oldDir => {
      if (_.startsWith(realFilePath, mvDirs[oldDir])) {
        realFilePath = realFilePath.replace(mvDirs[oldDir], oldDir);
      }
    });
    // console.log('real file path: ', Object.keys(fileLines), realFilePath);
    const absPath = path.isAbsolute(realFilePath) ? realFilePath : paths.map(realFilePath);
    if (!fs.existsSync(absPath)) {
      throw new Error("Can't find such file: " + realFilePath + '(' + absPath + ')');
    }
    fileLines[filePath] = fs
      .readFileSync(absPath)
      .toString()
      .split(/\r?\n/);
  }
  return fileLines[filePath];
}
1170311
function (filePath) {

            var pos = filePath.lastIndexOf("\\");
            if (pos !== -1) {
                filePath = filePath.substr(pos + 1);
            }

            pos = filePath.lastIndexOf("/");
            if (pos !== -1) {
                filePath = filePath.substr(pos + 1);
            }

            return filePath;
        }
792634
def libvlc_video_set_subtitle_file(p_mi, psz_subtitle):
    '''
    '''
    f = _Cfunctions.get('libvlc_video_set_subtitle_file', None) or \
        _Cfunction('libvlc_video_set_subtitle_file', ((1,), (1,),), None,
                    ctypes.c_int, MediaPlayer, ctypes.c_char_p)
    return f(p_mi, psz_subtitle)
1093659
def GetFilePathsWithDialog(fileTypes=[]):
    
    root = tkinter.Tk()
    root.withdraw()
    filepath = filedialog.askopenfilenames(
        filetypes=fileTypes, parent=root)

    if isinstance(filepath, str):
        fileList = filepath.split(" ")
    elif isinstance(filepath, tuple):
        fileList = list(filepath)
    elif isinstance(filepath, list):
        fileList = filepath

    root.destroy()
    print(str(len(fileList)) + " files are selected")

    return fileList