code: def get_earliest_class_that_defined_member(member, cls):
      ancestors = get_classes_ancestors([cls])
      result = None
      for ancestor in ancestors:
          if member in dir(ancestor):
              result = ancestor
      if not result:
          return cls
      return result
  
imports: from __future__ import print_function
  from __future__ import unicode_literals
  import re
  import inspect
  import os
  import shutil
  import sys
  import rl
  import rl.core
  import rl.processors
  import rl.agents
label_desc: Use image node_id 1 for calling a global function with example usage: get_earliest_class_that_defined_member(member, cls) and returns: result, cls