parameters: (obj)
return_statement: return cnt
docstring: ContainerOf(obj): returns the container that immediately has obj.
docstring_summary: ContainerOf(obj): returns the container that immediately has obj.
docstring_tokens: ContainerOf ( obj ) : returns the container that immediately has obj .
function: def ContainerOf(obj):
      """ContainerOf(obj): returns the container that immediately has obj."""
      cnt = None
      for dep in obj.InList:
          if isAContainer(dep):
              if Container(dep).hasObject(obj):
                  if cnt is not None and dep is not cnt:
                      raise ContainerTreeError("Container tree is not a tree")
                  cnt = dep
      if cnt is None: 
          return obj.Document
      return cnt
function_tokens: def ContainerOf ( obj ) : cnt = None for dep in obj . InList : if isAContainer ( dep ) : if Container ( dep ) . hasObject ( obj ) : if cnt is not None and dep is not cnt : raise ContainerTreeError ( "Container tree is not a tree" ) cnt = dep if cnt is None : return obj . Document return cnt