@depends(element_container=const(None))
def get_element(obj, element_container=None):
 if isinstance(obj, basestring):
  if (element_container is None):
   raise RuntimeError('Control elements can only be accessed by name, if an element container is available')
  match = _element_list_access_expr.match(obj)
  if match:
   name = match.group(1)
   index = int(match.group(2))
   obj = getattr(element_container, name)[index]
  else:
   obj = getattr(element_container, obj)
 return obj

@ depends ( element_container = const ( None ) ) def get_element ( obj , element_container = None ) : if isinstance ( obj , basestring ) : if ( element_container is None ) : raise RuntimeError ( 'Control elements can only be accessed by name, if an element container is available' ) match = _element_list_access_expr . match ( obj ) if match : name = match . group ( 1 ) index = int ( match . group ( 2 ) ) obj = getattr ( element_container , name ) [ index ] else : obj = getattr ( element_container , obj ) return obj
function for receiving a control element by name .