code: def _read_tal(rawbytes):
      
      annotations = []
  
      for m in finditer(PATTERN, rawbytes):
          d = m.groupdict()
          annot = {'onset': float(decode(d['onset'])),
                   'dur': float(decode(d['duration'])) if d['duration'] else 0.,
                   'annotation': [decode(a) for a in d['annotation'].split(b'\x14') if a],
                   }
  
          if annot['annotation']:
              annotations.append(annot)
  
      return annotations
docs: Read TAL (Time-stamped Annotations Lists) using regex
  
      Parameters
      ----------
      rawbytes : bytes
          raw information from file
  
      Returns
      -------
      annotation : list of dict
          where each dict contains onset, duration, and list with the annotations