code: def get_py_filename(name, force_win32=None):
      """Return a valid python filename in the current directory.
  
      If the given name is not a file, it adds '.py' and searches again.
      Raises IOError with an informative message if the file isn't found.
      """
  
      name = os.path.expanduser(name)
      if force_win32 is not None:
          warn(
              "The 'force_win32' argument to 'get_py_filename' is deprecated "
              "since IPython 5.0 and should not be used anymore",
              DeprecationWarning,
              stacklevel=2,
          )
      if not os.path.isfile(name) and not name.endswith(".py"):
          name += ".py"
      if os.path.isfile(name):
          return name
      else:
          raise IOError("File `%r` not found." % name)
  
imports: import os
  import sys
  import errno
  import shutil
  import random
  import glob
  from warnings import warn
  from hashlib import md5
  from IPython.utils.process import system
  from IPython.utils import py3compat
  from IPython.utils.decorators import undoc
label_desc: Use image node_id 5 for calling a global function with example usage: get_py_filename(name, force_win32) and returns: name