Method 2: Load from a file
13387
public void method2() {
        Engine engine = null;
        String configurationFile = "/ObstacleAvoidance.fll";
        URL url = SimpleDimmer.class.getResource(configurationFile);
        try {
            engine = new FllImporter().fromFile(new File(url.toURI()));
        } catch (Exception ex) {
            FuzzyLite.logger().log(Level.SEVERE, ex.toString(), ex);
        }

        FuzzyLite.logger().info(new FldExporter().toString(engine));
    }
1218693
def load_file_contents(file_path, as_list=True):
    """"""
    abs_file_path = join(HERE, file_path)
    with open(abs_file_path, encoding='utf-8') as file_pointer:
        if as_list:
            return file_pointer.read().splitlines()
        return file_pointer.read()
60169
def load(self, filename):
        """"""
        try:
            with open(filename, 'rb') as fp:
                self.counters = cPickle.load(fp)
        except:
            logging.debug("can't load counter from file: %s", filename)
            return False
        return True
926100
def load_file_to_string(self):
        
        try:
            with open(self.fullname, 'r') as f:
                txt = f.read()
            return txt
        except IOError:
            return ''
398224
def load(f, dict_=dict):
    
    if not f.read:
        raise ValueError('The first parameter needs to be a file object, ',
                         '%r is passed' % type(f))
    return loads(f.read(), dict_)
341623
def load(self , filename=None, data=None):
        

        self.__load(filename=filename, data=data)
1271368
def from_file(cls, filename):
        
        with open(filename) as f:
            string = f.read()
        return cls.from_string(string)
996202
public void loadFromFileWithPath(String file, LabelAlphabet alphabet) throws IOException {
		File f = new File(file);
		FileInputStream in = new FileInputStream(f);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
		String line;
		while((line=reader.readLine())!=null){
			String[] tok = line.split(" ");
			for(int i=0;i<tok.length-1;i++){
				addEdge(alphabet.lookupIndex(tok[i]),alphabet.lookupIndex(tok[i+1]));
			}
		}
		travel();
		
	}
149824
def do_load(self, filename):
        """"""
        try:
            self.__session.load(filename)
        except IOError as e:
            self.logger.error(e.strerror)
314104
def from_file(cls, f):
        

        with open_file_like(f, 'r') as fp:
            return cls(json.load(fp))
1373542
def load(self, filename="temp.pkl"):
    
    inputFile = open(filename, 'rb')
    self.tm = cPickle.load(inputFile)
191358
def load(fn)
      lines = open(fn) {|mf| mf.read}
      lines.gsub!(/\\ /, SPACE_MARK)
      lines.gsub!(/#[^\n]*\n/m, "")
      lines.gsub!(/\\\n/, ' ')
      lines.each_line do |line|
        process_line(line)
      end
    end
1318244
def load_from(dir)
      Dir.foreach(dir) do |name|
        next if name =~ /^\./

        # convert from external to internal form, and
        # extract the instance/class flag

        if name =~ /^(.*?)-(c|i).yaml$/
          external_name = $1
          is_class_method = $2 == "c"
          internal_name = RiWriter.external_to_internal(external_name)
          list = is_class_method ? @class_methods : @instance_methods
          path = File.join(dir, name)
          list << MethodEntry.new(path, internal_name, is_class_method, self)
        else
          full_name = File.join(dir, name)
          if File.directory?(full_name)
            inf_class = @inferior_classes.find {|c| c.name == name }
            if inf_class
              inf_class.add_path(full_name)
            else
              inf_class = ClassEntry.new(full_name, name, self)
              @inferior_classes << inf_class
            end
            inf_class.load_from(full_name)
          end
        end
      end
    end
1284340
def load_object(self, filename):
        

        """
        p = Path(filename)
        with open(p, 'rb') as f:
            d = pickle.load(f)
        obj = self._new_object(objtype=p.suffix.strip('.'),
                               name=p.name.split('.')[0])
        obj.update(d)
42942
def load(cls, fname):
        
        with open(fname) as f:
            content = f.readlines()
        return Flow.from_json(''.join(content))
803901
def from_file(file)
      check_read_only

      if file && File.exist?(file)
        file = File.expand_path(file)
        RubyUtils.loadPropertiesFile(spark_conf, file)
      end
    end
329408
def load(self, f, line=None):
        """"""
        if line is None:
            # in case the file contains only a fragment of an input file,
            # this is useful.
            line = f.readlin()
        words = line[1:].split()
        self.__name = words[0].upper()
        self.section_parameters = " ".join(words[1:])
        try:
            self.load_children(f)
        except EOFError:
            raise FileFormatError("Unexpected end of file, section '%s' not ended." % self.__name)