text: # coding=UTF-8
  
  '''
  config = [
      { name: 'deviceA1', type: 'A', classType: 'ClassA', attributes: {...} }
      { name: 'deviceA2', type: 'A', classType: 'ClassA', attributes: {...} },
      { name: 'deviceB', type: 'B', classType: 'ClassB', attributes: {...} }
  ]
  
  request = [
      {id: 'a', type: 'A'},
      {id: 'b', type: 'B'},
  ]
  '''
  
  
  class DataTransformer:
  
      @staticmethod
      def generate_adjacency_list(config, request):
          adjacencyList = [[]] * len(request)
          for requestIndex in range(len(request)):
              adjacencyList[requestIndex] = DataTransformer.searchMatchNodesInConfig(request[requestIndex]['type'], config)
          return adjacencyList
  
      @staticmethod
      def searchMatchNodesInConfig(nodeType, config):
          result = {}
          for configIndex in range(len(config)):
              if (config[configIndex]['type'] == nodeType):
                  result[configIndex] = True
          return result
  
  if __name__ == "__main__":
      config = [
          { 'name': 'deviceA1', 'type': 'A'},
          { 'name': 'deviceA2', 'type': 'A'},
          { 'name': 'deviceB', 'type': 'B'}
      ]
  
      request = [
          {'id': 'a', 'type': 'A'},
          {'id': 'b', 'type': 'B'},
      ]
      adjacencyList = DataTransformer.generate_adjacency_list(config, request)
  
  