docs: def stream_sample(self, md5, kwargs=None):
          """ Stream the sample by giving back a generator, typically used on 'logs'.
              Args:
                  md5: the md5 of the sample
                  kwargs: a way of specifying subsets of samples (None for all)
                      max_rows: the maximum number of rows to return
              Returns:
                  A generator that yields rows of the file/log
          """
  
          # Get the max_rows if specified
          max_rows = kwargs.get('max_rows', None) if kwargs else None
  
          # Grab the sample and it's raw bytes
          sample = self.get_sample(md5)['sample']
          raw_bytes = sample['raw_bytes']
  
          # Figure out the type of file to be streamed
          type_tag = sample['type_tag']
          if type_tag == 'bro':
              bro_log = bro_log_reader.BroLogReader(convert_datetimes=False)
              mem_file = StringIO(raw_bytes)
              generator = bro_log.read_log(mem_file)
              return generator
          elif type_tag == 'els_query':
              els_log = json.loads(raw_bytes)
              # Try to determine a couple of different types of ELS query results
              if 'fields' in els_log['hits']['hits'][0]:
                  generator = (row['fields'] for row in els_log['hits']['hits'][:max_rows])
              else:
                  generator = (row['_source'] for row in els_log['hits']['hits'][:max_rows])
              return generator
          elif type_tag == 'log':
              generator = ({'row':row} for row in raw_bytes.split('\n')[:max_rows])
              return generator
          elif type_tag == 'json':
              generator = (row for row in json.loads(raw_bytes)[:max_rows])
              return generator
          else:
              raise RuntimeError('Cannot stream file %s with type_tag:%s' % (md5, type_tag))