code: def file_or_stdin() -> Callable:
      """
      Returns a file descriptor from stdin or opening a file from a given path.
      """
  
      def parse(path):
          if path is None or path == "-":
              return sys.stdin
          else:
              return smart_open(path)
  
      return parse
  
imports: import argparse
  import os
  import sys
  import types
  from typing import Any, Callable, Dict, List, Tuple, Optional
  import yaml
  from sockeye.utils import smart_open
  from .None import constants
label_desc: Use image node_id 10 for calling a global function with example usage: file_or_stdin() and returns: parse, sys, smart_open