def handle(self, *args, **options):
        if len(args) < 2:
            raise CommandError('Usage is submit_form %s' % self.args)
        file = args[0]
        url = args[1]
        rest = args[2:]
        method = options.get('method', 'curl')
        use_chunked = options.get('use_chunked', False)
        is_odk = options.get('is_odk', False)
        if file is None or url is None:
            raise CommandError('Usage is submit_form %s' % self.args)
        if not os.path.exists(file):
            raise CommandError("File does not exist")

        attachments = []
        for attach_path in rest:
            if not os.path.exists(attach_path):
                raise CommandError("Error, additional file path does not exist: %s" % attach_path)
            else:
                attachments.append((attach_path.replace('.', '_'), attach_path))

        if method == 'curl':
            use_curl = True
        elif method == 'python':
            use_curl = False
        
        print post_data(None, url, path=file, use_curl=use_curl, use_chunked=use_chunked,
                        is_odk=is_odk, attachments=attachments)
dataset/ETHPy150Open dimagi/commcare-hq/corehq/ex-submodules/couchforms/management/commands/submit_form.py/Command.handle/original