code: def _is_modification_or_activity(feature):
      
      if not (isinstance(feature, _bp('ModificationFeature')) or \
              isinstance(feature, _bpimpl('ModificationFeature'))):
          return None
      mf_type = feature.getModificationType()
      if mf_type is None:
          return None
      mf_type_terms = mf_type.getTerm().toArray()
      for term in mf_type_terms:
          if term in ('residue modification, active',
                      'residue modification, inactive',
                      'active', 'inactive'):
              return 'activity'
      return 'modification'
docs: Return True if the feature is a modification