Evaluate the file in the context of the cleanroom.

 @param [Class] instance
   the instance of the class to evaluate against
 @param [String] filepath
   the path of the file to evaluate
481251
def evaluate_file(instance, filepath)
      absolute_path = File.expand_path(filepath)
      file_contents = IO.read(absolute_path)
      evaluate(instance, file_contents, absolute_path, 1)
    end
66026
def eval(cls, exp, files=None):
        
        return cls.show(cls.get(exp, files=files))
465738
def openSafeReplace(filepath, mode='w+b'):
    
    tempfileName = None
    #Check if the filepath can be accessed and is writable before creating the
    #tempfile
    if not _isFileAccessible(filepath):
        raise IOError('File %s is not writtable' % (filepath, ))
    with tempfile.NamedTemporaryFile(delete=False, mode=mode) as tmpf:
        tempfileName = tmpf.name
        yield tmpf
    #Check if the filepath can be accessed and is writable before moving the
    #tempfile
    if not _isFileAccessible(filepath):
        raise IOError('File %s is not writtable' % (filepath, ))
    #Note: here unhandled exceptions may still occur because of race conditions,
    #messing things up.
    shutil.move(tempfileName, filepath)
229104
def open_instance_resource(self, path: FilePath, mode: str='rb') -> IO[AnyStr]:
        
        return open(self.instance_path / file_path_to_path(path), mode)
751605
def parse file_path
      File.new(file_path).readlines.each {|line| parse_a_bookmark line }
      @total = @bookmarks.size
    end
108138
function (filePath) {
    var removeFile = this._removeFile.bind(this)
    var message = 'Should I remove `' + filePath + '`?'

    var promptPromise = this.ui.prompt({
      type: 'confirm',
      name: 'answer',
      message: message,
      choices: [
        { key: 'y', name: 'Yes, remove it', value: 'yes' },
        { key: 'n', name: 'No, leave it there', value: 'no' }
      ]
    })

    return promptPromise.then(function (response) {
      if (response.answer) {
        return removeFile(filePath)
      } else {
        return RSVP.resolve()
      }
    })
  }
713178
def path
      if @parent
        ::File.join(@parent.path, name)
      else
        if name != '.'
          ::File.join('.', name)
        else
          name
        end
      end
    end
510631
def read_file(cls, filepath):
        
        with open(filepath, mode='rb') as f:
            contents = f.read()
        return cls.decode(contents)
314331
function filePersister(filepath) {

	var self = this;
	this.initialized = false;
	this.filepath = filepath;

	/**
	 * Check to see if the specified file path is available.
	 * @returns A promise appropriately resolving or rejecting.
	 */
	this.start = function() {
		if (!this.initialized) {
			return fsp.emptyDir(this.filepath)
			.then(function() {
				self.initialized = true;
				return Promise.resolve('User has permissions to write to that file.');
			})
			.catch(function(err) {
				return Promise.reject('User does not have permissions to write to that folder.');
			});
		}
		return Promise.reject('Error: Persister already initialized.');
	};

	/**
	 * Save the passed state to the file.
	 * @param {Object} passedState - State to be saved in the file.
	 * @returns A promise resolving to an appropriate success message or an error message.
	 */
	this.save = function(brain, package) {
		var filepath = this.filepath;
		if (this.initialized) {
			return fsp.remove(filepath + '/' + package + '.txt')
			.then(function(){
				return fsp.writeFile(filepath + '/' + package + '.txt', JSON.stringify(brain));				
			})
			.then(function(){
				return Promise.resolve('Saved.');
			})
		} 
		return Promise.reject('Error: Persister not initialized.');
	};

	/**
	 * Retrieve data from the file.
	 * @returns The most recent entry to the file, as a JavaScript object.
	 */
	this.recover = function(package) {
		if (this.initialized) {
			var filepath = this.filepath
			return fsp.ensureFile(filepath +'/' + package + '.txt')
			.then(function(){
				return fsp.readFile(filepath + '/' + package + '.txt', 'utf8')
			})
			.then(function(data) {
				if (data === ''){
					return Promise.resolve({});
				} else {
					return Promise.resolve(JSON.parse(data));
				}
			});
		}
		return Promise.reject('Error: Persister not initialized.');
	};

}
772383
def view(filepath):
    
    try:
        view_func = getattr(view, PLATFORM)
    except AttributeError:
        raise RuntimeError('platform %r not supported' % PLATFORM)
    view_func(filepath)
813266
def evaluate(self, path):
        
        result = False
        cause = None

        for f in self.filters:

            cause, result = f.evaluate(path)
            if not result:
                break

        return cause, result
1082115
def _clean_file_name(self, model_instance, filename):
        
        available_name = self.storage.get_available_name(
            self.generate_filename(model_instance, filename))
        return os.path.basename(available_name)
580683
def from_example(example_path)
      base_dir = File.directory?(example_path) ? example_path : File.dirname(example_path)
      with_config(base_dir, self) { |path| with_override(path) }
    end
1228345
public static CWSEvaluator.Result evaluate(Segment segment, String testFile, String outputPath, String goldFile, String dictPath) throws IOException
    {
        return evaluate(segment, outputPath, goldFile, dictPath);
    }
646041
def file?(path)
      if stat = self.stat(path)
        stat.file?
      elsif path =~ /^#{Volt.root}\/app\/components\/[^\/]+[.]rb$/
        # Matches a component
        return true
      else
        false
      end
    end
994646
def process(input, context=nil, filename=nil)
      code = convert(input)
      filename ||= '(erubis)'
      if context.is_a?(Binding)
        return eval(code, context, filename)
      else
        context = Context.new(context) if context.is_a?(Hash)
        return context.instance_eval(code, filename)
      end
    end
575544
def examples_dir( f = nil )
      if File.exists?( config_file_path )
        form_file_name( examples_dir_from_config_file, f )
      else
        form_file_name( config_dir( '/examples' ), f )
      end
    end