code: def get_source_code(items):
      
      sources = []
      prev_class_name = None
  
      for func in items:
          try:
              lines, lineno = inspect.getsourcelines(func)
          except TypeError:
              continue
  
          if not lines:
              continue
  
          src = "\n".join(line.rstrip() for line in lines)
          src = textwrap.dedent(src)
  
          class_name = None
          if inspect.ismethod(func):
              # Add class name
              if hasattr(func, 'im_class'):
                  class_name = func.im_class.__name__
              elif hasattr(func, '__qualname__'):
                  names = func.__qualname__.split('.')
                  if len(names) > 1:
                      class_name = names[-2]
  
          if class_name and prev_class_name != class_name:
              src = "class {0}:\n    {1}".format(
                  class_name, src.replace("\n", "\n    "))
          elif class_name:
              src = "    {1}".format(
                  class_name, src.replace("\n", "\n    "))
  
          sources.append(src)
          prev_class_name = class_name
  
      return "\n\n".join(sources).rstrip()
docs: Extract source code of given items, and concatenate and dedent it.