original_docstring: 
          Lists the active iPOPO component instances
          
docstring: Lists the active iPOPO component instances
docstring_tokens: Lists the active iPOPO component instances
code: def list_instances(self, session, name=None):
          """
          Lists the active iPOPO component instances
          """
          headers = ("Name", "Factory", "State")
  
          instances = self._ipopo.get_instances()
          if name is not None:
              # Filter instances by name
              instances = [
                  instance for instance in instances if name in instance[0]
              ]
  
          # Lines are already sorted
          lines = (
              (name, factory, ipopo_state_to_str(state))
              for name, factory, state in instances
          )
  
          session.write(self._utils.make_table(headers, lines))
          if name is None:
              session.write_line("{0} components running", len(instances))
          else:
              session.write_line("{0} filtered components", len(instances))
code_tokens: def list_instances ( self , session , name = None ) : headers = ( "Name" , "Factory" , "State" ) instances = self . _ipopo . get_instances ( ) if name is not None : instances = [ instance for instance in instances if name in instance [ 0 ] ] lines = ( ( name , factory , ipopo_state_to_str ( state ) ) for name , factory , state in instances ) session . write ( self . _utils . make_table ( headers , lines ) ) if name is None : session . write_line ( "{0} components running" , len ( instances ) ) else : session . write_line ( "{0} filtered components" , len ( instances ) )
short_docstring: Lists the active iPOPO component instances
short_docstring_tokens: Lists the active iPOPO component instances
comment: """
          Lists the active iPOPO component instances
          """$SEP$# Filter instances by name$SEP$# Lines are already sorted