def __init__(self, jsonfilename=None, writable=True, **kwargs):
        """Loads and optionally saves configuration files in JSON
        format. Since JSON has some support for typed values (supports
        numbers, lists, bools, but not dates or datetimes), data from
        this source are sometimes typed, sometimes only available as
        strings.

        :param jsonfile: The name of a JSON file, whose root element
                         should be a JSON object (python dict). Nested
                         objects are turned into nested config objects.
        :type jsonfile: str
        :param writable: Whether changes to the LayeredConfig object
                         that has this JSONFile object amongst its
                         sources should be saved in the JSON file.
        :type writable: bool

        """
        super(JSONFile, self).__init__(**kwargs)
        if jsonfilename == None and 'parent' in kwargs and hasattr(kwargs['parent'], 'jsonfilename'):
            jsonfilename = kwargs['parent'].jsonfilename
        if 'defaults' in kwargs:
            self.source = kwargs['defaults']
        else:
            with open(jsonfilename) as fp:
                self.source = json.load(fp)
            self.jsonfilename = jsonfilename
            self.dirty = False
        self.writable = writable
dataset/ETHPy150Open staffanm/layeredconfig/layeredconfig/jsonfile.py/JSONFile.__init__/original