docs: def nsarg_completions(
      completion_text: str,
      entity_types: list,
      bel_spec: BELSpec,
      namespace: str,
      species_id: str,
      bel_fmt: str,
      size: int,
  ):
      """Namespace completions
  
      Args:
          completion_text
          entity_types: used to filter namespace search results
          bel_spec: used to search default namespaces
          namespace: used to filter namespace search results
          species_id: used to filter namespace search results
          bel_fmt: used to select full name or abbrev for default namespaces
          size: how many completions to return
  
      Results:
          list of replacement text objects
      """
  
      minimal_nsarg_completion_len = 1
  
      species = [species_id]
      namespaces = [namespace]
      replace_list = []
  
      if len(completion_text) >= minimal_nsarg_completion_len:
          # Use BEL.bio API module if running bel module in BEL.bio API, otherwise call BEL.bio API endpoint
          #   is there a better way to  handle this?
  
          url = f'{config["bel_api"]["servers"]["api_url"]}/terms/completions/{url_path_param_quoting(completion_text)}'
          params = {
              "size": size,
              "entity_types": entity_types,
              "namespaces": namespaces,
              "species": species,
          }
          r = get_url(url, params=params)
  
          if r.status_code == 200:
              ns_completions = r.json()
          else:
              log.error(f"Status code of {r.status_code} for {url}")
              ns_completions = {}
  
          for complete in ns_completions.get("completions", []):
              replace_list.append(
                  {
                      "replacement": complete["id"],
                      "label": f"{complete['id']} ({complete['label']})",
                      "highlight": complete["highlight"][-1],
                      "type": "NSArg",
                  }
              )
  
      # Check default namespaces
      for entity_type in entity_types:
          default_namespace = bel_spec["namespaces"].get(entity_type, [])
          if default_namespace:
              for obj in default_namespace["info"]:
                  replacement = None
                  if bel_fmt == "long" and re.match(
                      completion_text, obj["name"], re.IGNORECASE
                  ):
                      replacement = obj["name"]
                  elif bel_fmt in ["short", "medium"] and re.match(
                      completion_text, obj["abbreviation"], re.IGNORECASE
                  ):
                      replacement = obj["abbreviation"]
  
                  if replacement:
                      highlight = replacement.replace(
                          completion_text, f"<em>{completion_text}</em>"
                      )
                      replace_list.insert(
                          0,
                          {
                              "replacement": replacement,
                              "label": replacement,
                              "highlight": highlight,
                              "type": "NSArg",
                          },
                      )
  
      return replace_list[:size]