code: def get_groundings(entity):
          
          def get_grounding_entries(grounding):
              if not grounding:
                  return None
  
              entries = []
              values = grounding.get('values', [])
              # Values could still have been a None entry here
              if values:
                  for entry in values:
                      ont_concept = entry.get('ontologyConcept')
                      value = entry.get('value')
                      if ont_concept is None or value is None:
                          continue
                      entries.append((ont_concept, value))
              return entries
  
          # Save raw text and Eidos scored groundings as db_refs
          db_refs = {'TEXT': entity['text']}
          groundings = entity.get('groundings')
          if not groundings:
              return db_refs
          for g in groundings:
              entries = get_grounding_entries(g)
              # Only add these groundings if there are actual values listed
              if entries:
                  key = g['name'].upper()
                  if key == 'UN':
                      db_refs[key] = [(s[0].replace(' ', '_'), s[1])
                                      for s in entries]
                  else:
                      db_refs[key] = entries
          return db_refs
docs: Return groundings as db_refs for an entity.