code: def select_segments_by_definer(segment_file, segment_name=None, ifo=None):
      
      from glue.ligolw.ligolw import LIGOLWContentHandler as h; lsctables.use_in(h)
      indoc = ligolw_utils.load_filename(segment_file, False, contenthandler=h)
      segment_table  = table.get_table(indoc, 'segment')
  
      seg_def_table = table.get_table(indoc, 'segment_definer')
      def_ifos = seg_def_table.getColumnByName('ifos')
      def_names = seg_def_table.getColumnByName('name')
      def_ids = seg_def_table.getColumnByName('segment_def_id')
  
      valid_id = []
      for def_ifo, def_name, def_id in zip(def_ifos, def_names, def_ids):
          if ifo and ifo != def_ifo:
              continue
          if segment_name and segment_name != def_name:
              continue
          valid_id += [def_id]
  
      start = numpy.array(segment_table.getColumnByName('start_time'))
      start_ns = numpy.array(segment_table.getColumnByName('start_time_ns'))
      end = numpy.array(segment_table.getColumnByName('end_time'))
      end_ns = numpy.array(segment_table.getColumnByName('end_time_ns'))
      start, end = start + 1e-9 * start_ns, end + 1e-9 * end_ns
      did = segment_table.getColumnByName('segment_def_id')
  
      keep = numpy.array([d in valid_id for d in did])
      if sum(keep) > 0:
          return start_end_to_segments(start[keep], end[keep])
      else:
          return segmentlist([])
docs: Return the list of segments that match the segment name
  
      Parameters
      ----------
      segment_file: str
          path to segment xml file
  
      segment_name: str
          Name of segment
      ifo: str, optional
  
      Returns
      -------
      seg: list of segments