Reads input data from a JSON file in the output directory.
493962
private void readFormDataFromFile() {
		List<FormInput> formInputList =
				FormInputValueHelper.deserializeFormInputs(config.getSiteDir());

		if (formInputList != null) {
			InputSpecification inputSpecs = config.getCrawlRules().getInputSpecification();

			for (FormInput input : formInputList) {
				inputSpecs.inputField(input);
			}
		}
	}
293182
def read(self, filehandle):
        """"""
        return self.__import(json.load(filehandle, **self.kwargs))
265939
def read(self):
		
		with open(self.default_file) as json_file:
			try:
				return json.load(json_file)
			except Exception as e:
				raise 'empty file'
732034
public static JSON readJSON(File file, Charset charset) throws IORuntimeException {
		return parse(FileReader.create(file, charset).readString());
	}
644251
def load_json(json_object):
   '''  '''
   content = None
   if isinstance(json_object, str) and os.path.exists(json_object):
      with open_(json_object) as f:
         try:
            content = json.load(f)
         except Exception as e:
            debug.log("Warning: Content of '%s' file is not json."%f.name)
   elif hasattr(json_object, 'read'):
      try:
         content = json.load(json_object)
      except Exception as e:
         debug.log("Warning: Content of '%s' file is not json."%json_object.name)
   else:
      debug.log("%s\nWarning: Object type invalid!"%json_object)
   return content
122094
def _read_file(file_name):
    
    with open(file_name) as config_file:
        data = json.load(config_file)
    return data
1167884
def read_json_file(fpath):
    
    if not os.path.exists(fpath):
        raise Exception('ERROR: file %s does not exist.' % fpath)
    with open(fpath, 'r') as fh:
        raw = fh.read()
    res = json.loads(raw)
    return res
140420
def from_json_file(cls, json_file):
        """"""
        with open(json_file, "r", encoding="utf-8") as reader:
            text = reader.read()
        return cls.from_dict(json.loads(text))
1062927
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            return cls.from_dict(json.load(f))
485925
def _read_from_json(self, file):
        

        try:
            with io.open(os.path.join(self._PATH, file), encoding="utf8") as f:
                return {u["id"]: u for u in json.load(f)}
        except IOError:
            return {}
1073813
def get_dict_from_json_file(path, encoding='utf-8'):
    
    with open(path, encoding=encoding) as data_file:
        return json.loads(data_file.read())
587523
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            json_string = f.read()
        return cls.from_json(json_string)
148284
def read_file(self, filepath=None, filename=None):
        
        name = filename if filename else self.filename
        path = filepath if filepath else self.filepath
        name = self._ends_with(name, ".json")
        path = self._ends_with(path, os.path.sep)

        try:
            return self._read_json(path, name)
        except EnvironmentError as error:
            self.logger.error("Error while opening or reading the file: {}".format(error))
            raise
        except ValueError as error:
            self.logger.error("File contents cannot be decoded to JSON: {}".format(error))
            raise
433432
def read_json(self):
        
        line = self.stdin.readline()
        if line == '':
            raise EOFError()
        return json.loads(line)
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))
607526
def read_from_json(json_filename):
  """"""
  with tf.io.gfile.GFile(json_filename) as f:
    dataset_info_json_str = f.read()
  # Parse it back into a proto.
  parsed_proto = json_format.Parse(dataset_info_json_str,
                                   dataset_info_pb2.DatasetInfo())
  return parsed_proto
1045619
public static void serializeFormInputs(File dir) {

		if (instance == null) {
			LOGGER.error("No instance of FormInputValueHelper exists.");
			return;
		}

		final File out = new File(dir, FORMS_JSON_FILE);
		Gson json = new GsonBuilder().setPrettyPrinting().create();
		String serialized = json.toJson(instance.formInputs.values());

		try {
			LOGGER.info("Writing training form inputs to " + out.toString());
			FileUtils.writeStringToFile(out, serialized, Charset.defaultCharset());
		} catch (IOException e) {
			LOGGER.error(e.getMessage(), e);
		}

	}