code: def within_magnitude_range(self, lower_mag=None, upper_mag=None):
          '''
          :param float lower_mag:
              Lower magnitude for consideration
  
          :param float upper_mag:
              Upper magnitude for consideration
  
          :returns:
              Instance of openquake.hmtk.seismicity.catalogue.Catalogue class containing
              only selected events
          '''
          if not lower_mag:
              if not upper_mag:
                  # No limiting magnitudes defined - return entire catalogue!
                  return self.catalogue
              else:
                  lower_mag = -np.inf
  
          if not upper_mag:
              upper_mag = np.inf
  
          is_valid = np.logical_and(
              self.catalogue.data['magnitude'] >= lower_mag,
              self.catalogue.data['magnitude'] < upper_mag)
  
          return self.select_catalogue(is_validf within_magnitude_range(self, lower_mag=None, upper_mag=None):
          '''
          :param float lower_mag:
              Lower magnitude for consideration
  
          :param float upper_mag:
              Upper magnitude for consideration
  
          :returns:
              Instance of openquake.hmtk.seismicity.catalogue.Catalogue class containing
              only selected events
          '''
          if not lower_mag:
              if not upper_mag:
                  # No limiting magnitudes defined - return entire catalogue!
                  return self.catalogue
              else:
                  lower_mag = -np.inf
  
          if not upper_mag:
              upper_mag = np.inf
  
          is_valid = np.logical_and(
              self.catalogue.data['magnitude'] >= lower_mag,
              self.catalogue.data['magnitude'] < upper_mag)
  
          return self.select_catalogue(is_valid)
docs: :param float lower_mag:
              Lower magnitude for consideration
  
          :param float upper_mag:
              Upper magnitude for consideration
  
          :returns:
              Instance of openquake.hmtk.seismicity.catalogue.Catalogue class containing
              only selected events