read in the configuration file, a json file defined at self.config
497283
def _read_config_file(self):
        """"""

        try:
            with open(self.config, 'r') as f:
                config_data = json.load(f)
        except FileNotFoundError:
            config_data = {}

        return config_data
502764
def read_config(config_path_or_dict=None):
    
    config = None

    if isinstance(config_path_or_dict, dict):
        config = Config(config_path_or_dict)

    if isinstance(config_path_or_dict, string_types):
        if os.path.isabs(config_path_or_dict):
            config_path = config_path_or_dict
        else:
            config_path = os.path.join(
                os.getcwd(),
                os.path.normpath(config_path_or_dict)
            )
    else:
        config_path = os.path.join(
            os.getcwd(),
            DEFAULT_CONFIG_PATH
        )

    if os.path.exists(config_path):
        with open(config_path, 'r') as f:
            data = json.load(f)
            config = Config(data)

    if config is None:
        raise ConfigNotFound()
    else:
        config.validate()

        return config
1248865
def read_file(self, file_path):
        '''  '''
        getLogger().info("Loading app config from {} file: {}".format(self.__mode, file_path))
        if self.__mode == AppConfig.JSON:
            return json.loads(FileHelper.read(file_path), object_pairs_hook=OrderedDict)
        elif self.__mode == AppConfig.INI:
            config = configparser.ConfigParser(allow_no_value=True)
            config.read(file_path)
            return config
1055982
def _load_json(self):
        
        if os.path.isfile(self.expectations_json):
            self.log.info("Loading expectation config from file {file}".format(file=self.expectations_json))
            return json.load(open(self.expectations_json))
        else:
            self.log.info("Loading expectation config from string")
            return json.loads(self.expectations_json)
85665
def _load_file(self):
        

        if not os.path.exists(self.file):
            return {}

        with open(self.file, "r") as infile:
            data = json.load(infile)

        return data
1056733
def readConfigFromJSON(self, fileName):
        
        self.__logger.debug("readConfigFromJSON: reading from " + fileName)
        with open(fileName) as data_file:
            data = load(data_file)
        self.readConfig(data)
1016849
function loadJSONConfigFile(filePath) {
    try {
        return JSON.parse(stripComments(readFile(filePath)));
    }
    catch (e) {
        e.message = `Cannot read config file: ${filePath}\nError: ${e.message}`;
        throw e;
    }
}
575969
protected function load_json() {
		$json_file = $this->locate_configuration_file();
		$json_data = '{}';

		if ( '' !== $json_file ) {
			$json_data = file_get_contents( $json_file );
		}

		return $json_data ? $this->parse_json( $json_data ) : array();
	}
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)
1078270
def read(self, config_dir=None, config_name=None, clear=False):
        

# TODO should probably allow config_dir to be a list as well
        # get name of config directory
        if not config_dir:
            config_dir = self._defaults.get('config_dir', None)
        if not config_dir:
            raise KeyError('config_dir not set')

        # get name of config file
        if not config_name:
            config_name = self._defaults.get('config_name', None)
        if not config_name:
            raise KeyError('config_name not set')

        conf_path = os.path.expanduser(config_dir)
        if not os.path.exists(conf_path):
            raise IOError("config dir not found at %s" % (conf_path,))

        config = munge.load_datafile(config_name, conf_path, default=None)

        if not config:
            raise IOError("config file not found in %s" % (conf_path,))

        if clear:
            self.clear()

        munge.util.recursive_update(self.data, config)
        self._meta_config_dir = conf_path
        return self
1062927
def read_json_file(cls, path):
        
        with open(path, 'r') as f:
            return cls.from_dict(json.load(f))
564854
public void read_config(InputStream in) throws Exception {

        JsonFactory f = new MappingJsonFactory();
        JsonParser jp = f.createJsonParser(in);

        JsonToken current;

        current = jp.nextToken();
        if (current != JsonToken.START_OBJECT) {
            logger.warn("read_config: Error:  START_OBJECT not found : quiting.");
            return;
        }
        current = jp.nextToken();
        String fieldName = jp.getCurrentName();
        current = jp.nextToken();
        if (fieldName.equals("config")) {
            if (current != JsonToken.START_OBJECT) {
                logger.warn("read_config: Error:  START_OBJECT not found after config : quiting.");
                return;
            }
            current = jp.nextToken();
            String fieldName2 = jp.getCurrentName();
            if (fieldName2.equals("metric_groups")) {
                current = jp.nextToken();
                if (current != JsonToken.START_ARRAY) {
                  logger.warn("read_config: Error:  START_ARRAY not found after metric_groups : quiting.");
                  return;
                }

                current = jp.nextToken();
                while (current != JsonToken.END_ARRAY) {
                    if (current != JsonToken.START_OBJECT) {
                        logger.warn("read_config: Error:  START_OBJECT not found after metric_groups START_ARRAY : quiting.");
                        return;
                    }
                    current = jp.nextToken();
                    JsonNode node1 = jp.readValueAsTree();
                    String node1string = write_tostring(node1);
                    metricgroupMap.put(node1.get("name").asText(),node1string);
                    current = jp.nextToken();
                }

                current = jp.nextToken();
                String fieldName3 = jp.getCurrentName();

                if (fieldName3.equals("dashboards")) {
                    current = jp.nextToken();
                    if (current != JsonToken.START_ARRAY) {
                        logger.warn("read_config: Error:  START_ARRAY not found after dashboards : quiting.");
                        return;
                    }
                    current = jp.nextToken();
                    while (current != JsonToken.END_ARRAY) {
                        if (current != JsonToken.START_OBJECT) {
                            logger.warn("read_config: Error:  START_OBJECT not found after dashboards START_ARRAY : quiting.");
                            return;
                        }
                        current = jp.nextToken();
                        JsonNode node = jp.readValueAsTree();
                        String nodestring = write_tostring(node);
                        dashMap.put(node.get("name").asText(),nodestring);
                        current = jp.nextToken();

                    }
                    if(jp.nextToken() != JsonToken.END_OBJECT) {
                        logger.warn("read_config: Error:  END_OBJECT expected, not found (1): quiting.");
                        return;
                    }
                    if(jp.nextToken() != JsonToken.END_OBJECT) {
                        logger.warn("read_config: Error:  END_OBJECT expected, not found (2): quiting.");
                        return;
                    }
                } else {
                    logger.warn("read_config: Error:  Expected dashboards : quiting.");
                    return;
                }
            } else {
                logger.warn("read_config: Error:  Expected metric_groups : quiting.");
                return;
            }
        }
    }
1255374
async def init(self) -> None:
        ''''''

        if self.data:
            return

        if self.json_data:
            try:
                self.data = json.loads(self.json_data)

            except Exception:
                Log.exception('Falied to load raw configuration')

        else:
            try:
                with open(self.json_path, 'r') as f:
                    self.data = json.load(f)

            except Exception:
                Log.exception('Failed to load configuration from %s',
                              self.json_path)
                self.data = {}
949087
def _ReadAppJsonFile(self, relative_path):
    
    try:
      with open(os.path.join(sys.path[0], relative_path), 'r') as f:
        return json.load(f)
    except (IOError, ValueError):
      return None
752141
def _read_config(self):
        
        if not self._file_path:
            return None
        elif self._file_path.startswith('s3://'):
            return self._read_s3_config()
        elif self._file_path.startswith('http://') or \
                self._file_path.startswith('https://'):
            return self._read_remote_config()
        elif not path.exists(self._file_path):
            raise ValueError(
                'Configuration file not found: {}'.format(self._file_path))

        with open(self._file_path, 'r') as handle:
            return handle.read()
887114
def init_config_json(config_file):
    
    json_data = None
    try:
        if os.path.exists(config_file):
        #Load the config file

            with open(config_file) as json_file:
                json_data = json.load(json_file)
                return unicode_convert(json_data)
        else:
            return None
    except:
        line, filename, synerror = trace()
        raise ArcRestHelperError({
                    "function": "init_config_json",
                    "line": line,
                    "filename":  filename,
                    "synerror": synerror,
                                    }
                                    )
    finally:
        json_data = None

        del json_data

        gc.collect()
1134242
def read_file(file)
      json = JSON.parse(File.read(file))
      json.key?('definitions') ? json['definitions'] : {}
    end