code: def brackets(
      text: str,
      *,
      only: Optional[str | Collection[str]] = None,
  ) -> str:
      """
      Remove text within curly {}, square [], and/or round () brackets, as well as
      the brackets themselves.
  
      Args:
          text
          only: Remove only those bracketed contents as specified here: "curly", "square",
              and/or "round". For example, ``"square"`` removes only those contents found
              between square brackets, while ``["round", "square"]`` removes those contents
              found between square or round brackets, but not curly.
  
      Returns:
          str
  
      Note:
          This function relies on regular expressions, applied sequentially for curly,
          square, then round brackets; as such, it doesn't handle nested brackets of the
          same type and may behave unexpectedly on text with "wild" use of brackets.
          It should be fine removing structured bracketed contents, as is often used,
          for instance, to denote in-text citations.
      """
      only = utils.to_set(only) if only is not None else None
      if only is None or "curly" in only:
          text = resources.RE_BRACKETS_CURLY.sub("", text)
      if only is None or "square" in only:
          text = resources.RE_BRACKETS_SQUARE.sub("", text)
      if only is None or "round" in only:
          text = resources.RE_BRACKETS_ROUND.sub("", text)
      return text
  
file_path: textacy/src/textacy/preprocessing/remove.py
imports: from __future__ import annotations
  import re
  import unicodedata
  from typing import Collection, Optional
  from ..None import utils
  from .None import resources
label_desc: Use image node_id 2 for calling a global function with example usage: brackets(text) and returns: text