def load_jsonconfig(self, fname):
        if fname == "-":
            content = []
            while True:
                data = sys.stdin.readline()
                if not data:
                    break
                content.append(data)
            content = ''.join(content)
        else:
            if not os.path.isfile(fname):
                raise RuntimeError("%r not found" % fname)

            with open(fname, 'rb') as f:
                content = f.read()

        if isinstance(content, bytes):
            content = content.decode('utf-8')

        # parse the config
        obj = json.loads(content)
        if "jobs" in obj:
            configs = obj['jobs']
        else:
            configs = [obj]

        return configs
dataset/ETHPy150Open benoitc/gaffer/gaffer/cli/commands/base.py/Command.load_jsonconfig/original