(self, elem_id)
return '\n'.join(out)
Generates a debug message for the specified Element.
Generates a debug message for the specified Element.
Generates a debug message for the specified Element .
def _generate_debug_message_from_element_id(self, elem_id):
    """Generates a debug message for the specified Element."""
    out = []
    debug_info = self._debug_info_for_element_ids[elem_id]

    out.append('Debug summary for element:')
    if not get_full_dump_dir():
      out.append(
          '  * Full debug info can be dumped to disk by setting the '
          'flag --pymjcf_debug_full_dump_dir=path/to/dump>')
    out.append('  * Element object was created by `{}` at {}:{}'
               .format(debug_info.init_stack[-1].function_name,
                       debug_info.init_stack[-1].filename,
                       debug_info.init_stack[-1].line_number))

    for attrib_name, stack in debug_info.attribute_stacks.items():
      attrib_value = debug_info.element.get_attribute_xml_string(attrib_name)
      if stack[-1] == debug_info.init_stack[-1]:
        if attrib_value is not None:
          out.append('  * {}="{}" was set when the element was created'
                     .format(attrib_name, attrib_value))
      else:
        if attrib_value is not None:
          out.append('  * {}="{}" was set by `{}` at `{}:{}`'
                     .format(attrib_name, attrib_value,
                             stack[-1].function_name, stack[-1].filename,
                             stack[-1].line_number))
        else:
          out.append('  * {} was CLEARED by `{}` at {}:{}'
                     .format(attrib_name, stack[-1].function_name,
                             stack[-1].filename, stack[-1].line_number))

    return '\n'.join(out)
def _generate_debug_message_from_element_id ( self , elem_id ) : out = [ ] debug_info = self . _debug_info_for_element_ids [ elem_id ] out . append ( 'Debug summary for element:' ) if not get_full_dump_dir ( ) : out . append ( '  * Full debug info can be dumped to disk by setting the ' 'flag --pymjcf_debug_full_dump_dir=path/to/dump>' ) out . append ( '  * Element object was created by `{}` at {}:{}' . format ( debug_info . init_stack [ - 1 ] . function_name , debug_info . init_stack [ - 1 ] . filename , debug_info . init_stack [ - 1 ] . line_number ) ) for attrib_name , stack in debug_info . attribute_stacks . items ( ) : attrib_value = debug_info . element . get_attribute_xml_string ( attrib_name ) if stack [ - 1 ] == debug_info . init_stack [ - 1 ] : if attrib_value is not None : out . append ( '  * {}="{}" was set when the element was created' . format ( attrib_name , attrib_value ) ) else : if attrib_value is not None : out . append ( '  * {}="{}" was set by `{}` at `{}:{}`' . format ( attrib_name , attrib_value , stack [ - 1 ] . function_name , stack [ - 1 ] . filename , stack [ - 1 ] . line_number ) ) else : out . append ( '  * {} was CLEARED by `{}` at {}:{}' . format ( attrib_name , stack [ - 1 ] . function_name , stack [ - 1 ] . filename , stack [ - 1 ] . line_number ) ) return '\n' . join ( out )