code: def sent_tokenize(text, lang=None):
      """
      ```
      segment text into sentences
      ```
      """
      lang = detect_lang(text) if lang is None else lang
      sents = []
      if is_chinese(lang):
          for sent in re.findall(
              "[^!?。\.\!\?]+[!?。\.\!\?]?", text, flags=re.U
          ):
              sents.append(sent)
      else:
          for paragraph in segmenter.process(text):
              for sentence in paragraph:
                  sents.append(" ".join([t.value for t in sentence]))
      return sents
  
imports: from subprocess import DEVNULL, PIPE, Popen
  from ..imports import *
label_desc: Use image node_id 20 for calling a global function with example usage: sent_tokenize(text, lang) and returns: sents