code: def warn(warn_string, log=None):
      
  
      if import_fail:
          warn_txt = 'WARNING'
      else:
          warn_txt = colored('WARNING', 'yellow')
  
      # Print warning to stdout.
      sys.stderr.write(warn_txt + ': ' + warn_string + '\n')
  
      # Check if a logging structure is provided.
      if not isinstance(log, type(None)):
          warnings.warn(warn_string)
docs: Warning
  
      This method creates custom warning messages.
  
      Parameters
      ----------
      warn_string : str
          Warning message string
      log : instance, optional
          Logging structure instance