def _batch_load(project, workspace, headerline, entity_data, chunk_size=<NUM_LIT>):
if fcconfig.verbosity:<EOL><INDENT>print("<STR_LIT>" + str(len(entity_data)) + "<STR_LIT>")<EOL><DEDENT>if not _valid_headerline(headerline):<EOL><INDENT>eprint("<STR_LIT>" + headerline)<EOL>return <NUM_LIT:1><EOL><DEDENT>update_type = "<STR_LIT>" if headerline.startswith("<STR_LIT>") else "<STR_LIT>"<EOL>etype = headerline.split('<STR_LIT:\t>')[<NUM_LIT:0>].split('<STR_LIT::>')[<NUM_LIT:1>].replace("<STR_LIT>", "<STR_LIT>")<EOL>total = int(len(entity_data) / chunk_size) + <NUM_LIT:1><EOL>batch = <NUM_LIT:0><EOL>for i in range(<NUM_LIT:0>, len(entity_data), chunk_size):<EOL><INDENT>batch += <NUM_LIT:1><EOL>if fcconfig.verbosity:<EOL><INDENT>print("<STR_LIT>".format(<EOL>etype, update_type, i+<NUM_LIT:1>, min(i+chunk_size, len(entity_data)),<EOL>batch, total))<EOL><DEDENT>this_data = headerline + '<STR_LIT:\n>' + '<STR_LIT:\n>'.join(entity_data[i:i+chunk_size])<EOL>r = fapi.upload_entities(project, workspace, this_data)<EOL>fapi._check_response_code(r, <NUM_LIT:200>)<EOL><DEDENT>return <NUM_LIT:0><EOL>
Submit a large number of entity updates in batches of chunk_size