<commit_before>commonfields:
  id: FetchFromInstance
  version: -1
name: FetchFromInstance
fromversion: 4.0.0
script: |-
  import re
  from distutils.util import strtobool

  incidents_context = []
  context = {}
  add_to_context = bool(strtobool(demisto.args().get('add_to_context')))
  res = []
  brand_name = demisto.args().get("brand_name")
  instance_name = None
  if brand_name:
      context_modules = demisto.getModules()
      for module_name, module in context_modules.iteritems():
          if module.get("brand") == brand_name and module.get('state') == 'active':
              instance_name = module_name.replace(' ', '_')
              break
  elif demisto.args().get("instance_name"):
      instance_name = demisto.args()["instance_name"]
  if not instance_name:
      raise Exception("No instance name was found")
  expect_data = False if demisto.args()["expect_data"] == 'false' else True
  instance_name = instance_name.replace(" ","_")
  command = '!{0}-fetch'.format(instance_name)

  response = demisto.executeCommand(command, {})

  try:
      if not response and expect_data:
          raise Exception("Error occurred while fetching incidents from {}".format(instance_name))<commit_msg>Increased fetch from instance version<commit_after>commonfields:
  id: FetchFromInstance
  version: -1
name: FetchFromInstance
fromversion: 4.1.0
script: |-
  import re
  from distutils.util import strtobool

  incidents_context = []
  context = {}
  add_to_context = bool(strtobool(demisto.args().get('add_to_context')))
  res = []
  brand_name = demisto.args().get("brand_name")
  instance_name = None
  if brand_name:
      context_modules = demisto.getModules()
      for module_name, module in context_modules.iteritems():
          if module.get("brand") == brand_name and module.get('state') == 'active':
              instance_name = module_name.replace(' ', '_')
              break
  elif demisto.args().get("instance_name"):
      instance_name = demisto.args()["instance_name"]
  if not instance_name:
      raise Exception("No instance name was found")
  expect_data = False if demisto.args()["expect_data"] == 'false' else True
  instance_name = instance_name.replace(" ","_")
  command = '!{0}-fetch'.format(instance_name)

  response = demisto.executeCommand(command, {})

  try:
      if not response and expect_data:
          raise Exception("Error occurred while fetching incidents from {}".format(instance_name))
{'fraction_non_alphanumeric': 0.12612612612612611, 'fraction_numerical': 0.004095004095004095, 'mean_word_length': 3.915492957746479, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6522531', 'n_tokens_mistral': 733, 'n_tokens_neox': 735, 'n_words': 169}