docs: def get_results(self, fp=sys.stdout, inline=True, delim=None, fetch=True, qlog=None, arguments=[]):
          """
          Fetches the result for the command represented by this object
  
          get_results will retrieve results of the command and write to stdout by default.
          Optionally one can write to a filestream specified in `fp`. The `inline` argument
          decides whether the result can be returned as a CRLF separated string. In cases where
          the results are greater than 20MB, get_results will attempt to read from s3 and write
          to fp. The retrieval of results from s3 can be turned off by the `fetch` argument
  
          Args:
              `fp`: a file object to write the results to directly
              `inline`: whether or not results are returned inline as CRLF separated string
              `fetch`: True to fetch the result even if it is greater than 20MB, False to
                       only get the result location on s3
          """
          result_path = self.meta_data['results_resource']
  
          conn = Qubole.agent()
  
          include_header = "false"
          if len(arguments) == 1:
              include_header = arguments.pop(0)
              if include_header not in ('true', 'false'):
                  raise ParseError("incude_header can be either true or false")
  
  
          r = conn.get(result_path, {'inline': inline, 'include_headers': include_header})
          if r.get('inline'):
              raw_results = r['results']
              encoded_results = raw_results.encode('utf8')
              if sys.version_info < (3, 0, 0):
                  fp.write(encoded_results)
              else:
                  import io
                  if isinstance(fp, io.TextIOBase):
                      if hasattr(fp, 'buffer'):
                          fp.buffer.write(encoded_results)
                      else:
                          fp.write(raw_results)
                  elif isinstance(fp, io.BufferedIOBase) or isinstance(fp, io.RawIOBase):
                      fp.write(encoded_results)
                  else:
                      # Can this happen? Don't know what's the right thing to do in this case.
                      pass
          else:
              if fetch:
                  storage_credentials = conn.get(Account.credentials_rest_entity_path)
                  if storage_credentials['region_endpoint'] is not None:
                      boto_conn = boto.connect_s3(aws_access_key_id=storage_credentials['storage_access_key'],
                                                  aws_secret_access_key=storage_credentials['storage_secret_key'],
                                                  security_token = storage_credentials['session_token'],
                                                  host = storage_credentials['region_endpoint'])
                  else:
                      boto_conn = boto.connect_s3(aws_access_key_id=storage_credentials['storage_access_key'],
                                                  aws_secret_access_key=storage_credentials['storage_secret_key'],
                                                  security_token=storage_credentials['session_token'])
  
                  log.info("Starting download from result locations: [%s]" % ",".join(r['result_location']))
                  #fetch latest value of num_result_dir
                  num_result_dir = Command.find(self.id).num_result_dir
  
                  # If column/header names are not able to fetch then use include header as true
                  if include_header.lower() == "true" and qlog is not None:
                      write_headers(qlog, fp)
  
                  for s3_path in r['result_location']:
  
                      # In Python 3,
                      # If the delim is None, fp should be in binary mode because
                      # boto expects it to be.
                      # If the delim is not None, then both text and binary modes
                      # work.
  
                      _download_to_local(boto_conn, s3_path, fp, num_result_dir, delim=delim)
              else:
                  fp.write(",".join(r['result_location']))