code: def _add_comment_to_literal_code(method, contains, comment):
      """Inspects a method's code and adds a message to it.
  
      This is a nice to have, so if it fails for some reason, it shouldn't affect the program.
  
      """
      try:
          lines = inspect.getsource(method)
          lines = lines.split("\n")
          idx_list = [i for i, x in enumerate(lines) if contains in x]
          for i in idx_list:
              line = lines[i]
              line += comment
              lines[i] = line
  
          return "\n".join(lines)
  
      except Exception:
          return ""
  
file_path: pytorch-lightning/src/lightning/app/utilities/layout.py
imports: import inspect
  import warnings
  from typing import Dict, List, Union
  import lightning.app
  from lightning.app.frontend.frontend import Frontend
  from lightning.app.utilities.app_helpers import _MagicMockJsonSerializable, is_overridden
  from lightning.app.utilities.cloud import is_running_in_cloud
label_desc: Use image node_id 1 for calling a global function with example usage: _add_comment_to_literal_code(method, contains, comment) and returns: str, str