code: def resolve_type(type_name, pyobject):
      
      if '.' not in type_name:
          try:
              return pyobject.get_module().get_scope().get_name(type_name).get_object()
          except Exception:
              pass
      else:
          mod_name, attr_name = type_name.rsplit('.', 1)
          try:
              mod_finder = ScopeNameFinder(pyobject.get_module())
              mod = mod_finder._find_module(mod_name).get_object()
              return mod.get_attribute(attr_name).get_object()
          except Exception:
              pass
docs: :type type_name: str
      :type pyobject: rope.base.pyobjects.PyDefinedObject | rope.base.pyobjects.PyObject
      :rtype: rope.base.pyobjects.PyDefinedObject | rope.base.pyobjects.PyObject or None