Read the tfstate file and load its contents, parses then as JSON and put the result into the object
19015
def load_file(file_path):
        
        log.debug('read data from {0}'.format(file_path))
        if os.path.exists(file_path):
            with open(file_path) as f:
                json_data = json.load(f)

            tf_state = Tfstate(json_data)
            tf_state.tfstate_file = file_path
            return tf_state

        log.debug('{0} is not exist'.format(file_path))

        return Tfstate()
1208297
function readJSON(filepath){
	var buffer = {};
	try{
		buffer = JSON.parse(fs.readFileSync(filepath, { encoding:'utf8' }));
	} catch(error){}
	return buffer;
}
38992
def load_json(file):
    """"""
    here = os.path.dirname(os.path.abspath(__file__))
    with open(os.path.join(here, file)) as jfile:
        data = json.load(jfile)
    return data
729741
def load_json_from_file(file_path):
    """"""
    try:
        with open(file_path) as f:
            json_data = json.load(f)
    except ValueError as e:
        raise ValueError('Given file {} is not a valid JSON file: {}'.format(file_path, e))
    else:
        return json_data
931272
def parse_file(self, sourcepath):
        """"""

        # Open input file and read JSON array:
        with open(sourcepath, 'r') as logfile:
            jsonstr = logfile.read()

        # Set our attributes for this entry and add it to data.entries:
        data = {}
        data['entries'] = json.loads(jsonstr)
        if self.tzone:
            for e in data['entries']:
                e['tzone'] = self.tzone

        # Return the parsed data
        return data
114177
def load(self, f):
        
        with _open_file_obj(f) as f:
            parser = self.parse_file(f)
            self.deserialize(parser)
751854
async function readJSON(path) {
    const file = await read(path)
    const parsed = JSON.parse(file)
    return parsed
}
1143833
def load_state(cls, path:PathOrStr, state:dict) -> 'LabelList':
        ""
        x = state['x_cls']([], path=path, processor=state['x_proc'], ignore_empty=True)
        y = state['y_cls']([], path=path, processor=state['y_proc'], ignore_empty=True)
        res = cls(x, y, tfms=state['tfms'], tfm_y=state['tfm_y'], **state['tfmargs']).process()
        if state.get('tfms_y', False):    res.tfms_y    = state['tfms_y']
        if state.get('tfmargs_y', False): res.tfmargs_y = state['tfmargs_y']
        if state.get('normalize', False): res.normalize = state['normalize']
        return res
915317
function loadJson(filepath) {
	const json = fs.readFileSync(require.resolve(filepath), 'utf8');
	return JSON.parse(stripJsonComments(json));
}
642973
def read_json_breakdown(cls, fname):
        """"""
        if not os.path.exists(fname):
            raise RuntimeError

        with open(fname, 'r') as data_file:
            return cls.fixup_from_json(data_file.read())
989512
def load(cls, fname):
        
        with open(fname) as f:
            return Config(**json.load(f))
876176
public static <T> T readJson(File file) {
    try {
      return objectMapper.readValue(new String(Files.readAllBytes(file.toPath())), new TypeReference<T>() {
      });
    } catch (IOException e) {
      throw new RuntimeException(e);
    }
  }
1310033
def loadJson(self, filename):
        
        jsonConfig = {}
        if os.path.isfile(filename):
            jsonConfig = json.loads(' '.join(open(filename, 'r').readlines()))
        return jsonConfig
410473
function _load(source, callback) {
  fs.readFile(source, {encoding: 'utf8'}, _jsonLoaded.bind(null, callback));
}
1226619
def load_state_from_disk():
    
    if is_there_state():
        with open('data.json', 'r') as f:
            data = json.load(f)
        return data
    else:
        return False
1037855
def read_state_file(self, file_path=None):
        

        working_dir = self.working_dir or ''

        file_path = file_path or self.state or ''

        if not file_path:
            backend_path = os.path.join(file_path, '.terraform',
                                        'terraform.tfstate')

            if os.path.exists(os.path.join(working_dir, backend_path)):
                file_path = backend_path
            else:
                file_path = os.path.join(file_path, 'terraform.tfstate')

        file_path = os.path.join(working_dir, file_path)

        self.tfstate = Tfstate.load_file(file_path)
416496
def read(cls, data):
        
        if isinstance(data, OrderedDict):
            return cls(data)
        elif isinstance(data, basestring)\
             and data.startswith(("http://", "https://", "ftp://", "ftps://")):
            return cls(request(data))
        elif isinstance(data, basestring):
            try:
                json_dict = json.loads(data, object_pairs_hook=OrderedDict)
                return cls(json_dict)
            except ValueError:
                raise
        else:
            try:
                json_dict = json.load(data, object_pairs_hook=OrderedDict)
                return cls(json_dict)
            except ValueError:
                raise