@staticmethod
    def load_args():
        if IronWorker.isLoaded: return

        for i in range(len(sys.argv)):
            if sys.argv[i] == "-id":
                IronWorker.arguments['task_id'] = sys.argv[i + 1]
            if sys.argv[i] == "-d":
                IronWorker.arguments['dir'] = sys.argv[i + 1]
            if sys.argv[i] == "-payload":
                IronWorker.arguments['payload_file'] = sys.argv[i + 1]
            if sys.argv[i] == "-config":
                IronWorker.arguments['config_file'] = sys.argv[i + 1]

        if os.getenv('TASK_ID'): IronWorker.arguments['task_id'] = os.getenv('TASK_ID')
        if os.getenv('TASK_DIR'): IronWorker.arguments['dir'] = os.getenv('TASK_DIR')
        if os.getenv('PAYLOAD_FILE'): IronWorker.arguments['payload_file'] = os.getenv('PAYLOAD_FILE')
        if os.getenv('CONFIG_FILE'): IronWorker.arguments['config_file'] = os.getenv('CONFIG_FILE')

        if 'payload_file' in IronWorker.arguments and file_exists(IronWorker.arguments['payload_file']):
            f = open(IronWorker.arguments['payload_file'], "r")
            try:
                content = f.read()
                f.close()
                IronWorker.arguments['payload'] = json.loads(content)
            except Exception as e:
                print("Couldn't parse IronWorker payload into json, leaving as string. %s" % e)

        if 'config_file' in IronWorker.arguments and file_exists(IronWorker.arguments['config_file']):
            f = open(IronWorker.arguments['config_file'])
            try:
                content = f.read()
                f.close()
                IronWorker.arguments['config'] = json.loads(content)
            except Exception as e:
                print("Couldn't parse IronWorker config into json. %s" % e)

        IronWorker.isLoaded = True
dataset/ETHPy150Open iron-io/iron_worker_python/iron_worker.py/IronWorker.load_args/original