code: def translate_argv(raw_args):
      kwargs = {}
      def get_parameter(param_str):
          for i, a in enumerate(raw_args):
              if a == param_str:
                  assert len(raw_args) == i+2 and raw_args[i+1][0] != '-', \
                      'All arguments must have a value, e.g. `-testing true`'
                  return raw_args[i+1]
          return None
      value = get_parameter('-testing')
      if value is not None and value.lower() in ('true', 't', 'yes'):
              kwargs['testing'] = True
      value = get_parameter('-connect')
      if value is not None:
          colon = value.find(':')
          if colon > -1:
              kwargs['host'] = value[0:colon]
              kwargs['port'] = int(value[colon+1:])
          else:
              kwargs['host'] = value
      value = get_parameter('-name')
      if value is not None:
          kwargs['name'] = value
      value = get_parameter('-group')
      if value is not None:
          kwargs['group_name'] = value
      value = get_parameter('-scan')
      if value in ('true', 't', 'yes'):
          kwargs['scan_for_port'] = True
      value = get_parameter('-debug')
      if value in ('true', 't', 'yes'):
          kwargs['debug'] = True
      return kwargs