load the configuration for the ReturnInfo from a fileName
        @param fileName: filename that contains the json configuration to use in the ReturnInfo
191680
def loadFromFile(fileName):
        
        assert os.path.exists(fileName), "File " + fileName + " does not exist"
        conf = json.load(open(fileName))
        return ReturnInfo(
            articleInfo=ArticleInfoFlags(**conf.get("articleInfo", {})),
            eventInfo=EventInfoFlags(**conf.get("eventInfo", {})),
            sourceInfo=SourceInfoFlags(**conf.get("sourceInfo", {})),
            categoryInfo=CategoryInfoFlags(**conf.get("categoryInfo", {})),
            conceptInfo=ConceptInfoFlags(**conf.get("conceptInfo", {})),
            locationInfo=LocationInfoFlags(**conf.get("locationInfo", {})),
            storyInfo=StoryInfoFlags(**conf.get("storyInfo", {})),
            conceptClassInfo=ConceptClassInfoFlags(**conf.get("conceptClassInfo", {})),
            conceptFolderInfo=ConceptFolderInfoFlags(**conf.get("conceptFolderInfo", {}))
        )
757928
def _load_config_file(self):
        
        LOGGER.info('Loading configuration from %s', self._file_path)
        if self._file_path.endswith('json'):
            config = self._load_json_config()
        else:
            config = self._load_yaml_config()
        for key, value in [(k, v) for k, v in config.items()]:
            if key.title() != key:
                config[key.title()] = value
                del config[key]
        return flatdict.FlatDict(config)
714298
def load(self, filename):
        
        if filename is None:
            filename = LOCALCONFIG
        with open(filename, 'r') as fid:
            self._conf.update(json.load(fid))
        self.add_history('Updated from config file: %s' % filename)
1024341
function loadConfig(filename) {
  //Does our consumer have a valid .mitto?
  var mittoObject = _loadMitto();
  //Is it in a valid format?
  mittoObject = _validateMitto(mittoObject);

  //Does our consumer's consumer have a config of 'filename'?
  var configObject = _findFile(filename);
  //Is it in a valid format as prescribed by our consumer's .mitto?
  return _validateConfig(configObject, mittoObject);
}
1195340
static function parse_json_file($filename)
	{
		$json_str = file_get_contents($filename);
		if ($json_str === FALSE) {
			// FIXME: Use different exception ?
			throw new JsonException("Failed to read file: ".$filename);
		}

		return static::parse_json_string($json_str);
	}
617359
def _load_config():
    """"""
    fname = _get_config_fname()
    if fname is None or not op.isfile(fname):
        return dict()
    with open(fname, 'r') as fid:
        config = json.load(fid)
    return config
484901
protected function loadFile($filename)
    {
        if (isset($this->aliases[$filename])) {
            $filename = $this->aliases[$filename];
        }

        switch (pathinfo($filename, PATHINFO_EXTENSION)) {
            case 'js':
            case 'json':
                $level = error_reporting(0);
                $json = file_get_contents($filename);
                error_reporting($level);

                if ($json === false) {
                    $err = error_get_last();
                    throw new InvalidArgumentException("Unable to open {$filename}: " . $err['message']);
                }

                $config = json_decode($json, true);
                // Throw an exception if there was an error loading the file
                if ($error = json_last_error()) {
                    $message = isset(self::$jsonErrors[$error]) ? self::$jsonErrors[$error] : 'Unknown error';
                    throw new RuntimeException("Error loading JSON data from {$filename}: ({$error}) - {$message}");
                }
                break;
            case 'php':
                if (!is_readable($filename)) {
                    throw new InvalidArgumentException("Unable to open {$filename} for reading");
                }
                $config = require $filename;
                if (!is_array($config)) {
                    throw new InvalidArgumentException('PHP files must return an array of configuration data');
                }
                break;
            default:
                throw new InvalidArgumentException('Unknown file extension: ' . $filename);
        }

        // Keep track of this file being loaded to prevent infinite recursion
        $this->loadedFiles[$filename] = true;

        // Merge include files into the configuration array
        $this->mergeIncludes($config, dirname($filename));

        return $config;
    }
1249334
def load_config(name, base='conf'):
    """"""
    fname = pjoin(base, name + '.json')
    if not os.path.exists(fname):
        return {}
    try:
        with open(fname) as f:
            cfg = json.load(f)
    except Exception as e:
        warn("Couldn't load %s: %s" % (fname, e))
        cfg = {}
    return cfg
290676
def _load_from_configs(self, filename):
    
    config_filename = os.path.join(self._config_path, filename)
    if os.path.exists(config_filename):
      try:
        f = open(config_filename, 'r')
        content = ''.join(f.readlines())
        f.close()
        return content
      except Exception as err:
        raise err
    else:
      raise IOError("File not found: {}".format(config_filename))
348431
def from_file(filename):
    
    f = open(filename, 'r')
    j = json.load(f)
    f.close()

    return from_dict(j)
1362664
public function loadJson($filename)
  {
    $result = false;
    if (file_exists($filename) && is_file($filename)) {
      $json = file_get_contents($filename);
      $data = json_decode($json, true);
      if (is_array($data)) {
        foreach ($data as $name => $value) {
          $this->__set($name, $value);
        }
        $result = true;
      }
    }
    return $result;
  }
375582
public DataBinder load(String filename) throws IOException {
        Properties props = new Properties();
        Reader reader = new FileReader(filename);
        props.load(reader);
        reader.close();
        return load(props);
    }
1231682
def load_config(filename):
    

    if filename is None:
        filename = ''

    abs_filename = os.path.join(os.getcwd(), filename)

    global FILE

    # find the config file
    if os.path.isfile(filename):
        FILE = filename
    elif os.path.isfile(abs_filename):
        FILE = abs_filename
    elif os.path.isfile(FILE):
        pass
    else:
        if os.path.dirname(filename):
            file_not_found = filename
        else:
            file_not_found = abs_filename
        file_not_found_message(file_not_found)

    # load config
    init(FILE)
788645
public static function loadJSON($filename)
    {
        $content = self::load($filename);
        $data = json_decode($content, true);
        if ($data === null) {
            throw new InvalidJSON();
        }
        return $data;
    }
235769
def load_config():
    

    configfile = get_configfile()

    if not os.path.exists(configfile):
        data = {
            'apikey': 'GET KEY AT: https://www.filemail.com/apidoc/ApiKey.aspx'
            }

        save_config(data)

    with open(configfile, 'rb') as f:
        return json.load(f)
1059157
def load(self, filename):
        """"""
        LOGGER.info("Loading result from '%s'.", filename)
        if filename.endswith(".gz"):
            with gzip.open(filename, "rb") as file_handle:
                result = MemoteResult(
                    json.loads(file_handle.read().decode("utf-8"))
                )
        else:
            with open(filename, "r", encoding="utf-8") as file_handle:
                result = MemoteResult(json.load(file_handle))
        # TODO (Moritz Beber): Validate the read-in JSON maybe? Trade-off
        #  between extra time taken and correctness. Maybe we re-visit this
        #  issue when there was a new JSON format version needed.
        return result
357161
def _load_json(self, filename):
        """"""
        with open(filename, 'r') as file_handle:
            self._sensors.update(json.load(
                file_handle, cls=MySensorsJSONDecoder))