code: def parse_flag_str(flag_str):
      
      flags = flag_str.replace(' ', '').strip().split(',')
  
      signs = {}
      ifos = {}
      bounds = {}
      padding = {}
      bflags = []
  
      for flag in flags:
          # Check if the flag should add or subtract time
          sign = flag[0] == '+'
          flag = flag[1:]
  
          ifo = pad = bound = None
  
          # Check for non-default IFO
          if len(flag.split(':')[0]) == 2:
              ifo = flag.split(':')[0]
              flag = flag[3:]
  
          # Check for padding options
          if '<' in flag:
              popt = flag.split('<')[1].split('>')[0]
              spad, epad = popt.split(':')
              pad = (float(spad), float(epad))
              flag = flag.replace(popt, '').replace('<>', '')
  
          # Check if there are bounds on the flag
          if '[' in flag:
              bopt = flag.split('[')[1].split(']')[0]
              start, end = bopt.split(':')
              bound = (int(start), int(end))
              flag = flag.replace(bopt, '').replace('[]', '')
  
          if ifo:
              ifos[flag] = ifo
          if pad:
              padding[flag] = pad
          if bound:
              bounds[flag] = bound
          bflags.append(flag)
          signs[flag] = sign
  
      return bflags, signs, ifos, bounds, padding
docs: Parse a dq flag query string
  
      Parameters
      ----------
      flag_str: str
          String needing to be parsed
  
      Returns
      -------
      flags: list of strings
          List of reduced name strings which can be passed to lower level
      query commands
      signs: dict
          Dict of bools indicated if this should add positively to the segmentlist
      ifos: dict
          Ifo specified for the given flag
      bounds: dict
          The boundary of a given flag
      padding: dict
          Any padding that should be applied to the segments in for a given
          flag.