code: def _get_st_write_from_expr(
      node,
      i,
      parent_type,
      is_root,
      is_last_expr,
      file_ends_in_semicolon,
  ):
      # Don't wrap function calls
      # (Unless the function call happened at the end of the root node, AND
      # magic.displayLastExprIfNoSemicolon is True. This allows us to support notebook-like
      # behavior, where we display the last function in a cell)
      if type(node.value) is ast.Call and not _is_displayable_last_expr(
          is_root, is_last_expr, file_ends_in_semicolon
      ):
          return None
  
      # Don't wrap DocString nodes
      # (Unless magic.displayRootDocString, in which case we do wrap the root-level
      # docstring with st.write. This allows us to support notebook-like behavior
      # where you can have a cell with a markdown string)
      if _is_docstring_node(
          node.value, i, parent_type
      ) and not _should_display_docstring_like_node_anyway(is_root):
          return None
  
      # Don't wrap yield nodes
      if (
          type(node.value) is ast.Yield
          or type(node.value) is ast.YieldFrom
      ):
          return None
  
      # Don't wrap await nodes
      if type(node.value) is ast.Await:
          return None
  
      # If tuple, call st.write(*the_tuple). This allows us to add a comma at the end of a
      # statement to turn it into an expression that should be st-written. Ex:
      # "np.random.randn(1000, 2),"
      if type(node.value) is ast.Tuple:
          args = node.value.elts
          st_write = _build_st_write_call(args)
  
      # st.write all strings.
      elif type(node.value) is ast.Str:
          args = [node.value]
          st_write = _build_st_write_call(args)
  
      # st.write all variables.
      elif type(node.value) is ast.Name:
          args = [node.value]
          st_write = _build_st_write_call(args)
  
      # st.write everything else
      else:
          args = [node.value]
          st_write = _build_st_write_call(args)
  
      return st_write
  
file_path: streamlit/lib/streamlit/runtime/scriptrunner/magic.py
imports: import ast
  from typing_extensions import Final
  from streamlit import config
label_desc: Use image node_id 6 for calling a global function with example usage: _get_st_write_from_expr(node, i, parent_type, is_root, is_last_expr, file_ends_in_semicolon) and returns: st_write, None, None, None, None