nodes: 0, module; 1, function_definition; 2, function_name:instances_get; 3, parameters; 4, block; 5, identifier:opts; 6, identifier:plugins; 7, identifier:url_file_input; 8, identifier:out; 9, expression_statement; 10, expression_statement; 11, expression_statement; 12, for_statement; 13, for_statement; 14, return_statement; 15, comment:"""
      Creates and returns an ordered dictionary containing instances for all available
      scanning plugins, sort of ordered by popularity.
      @param opts: options as returned by self._options.
      @param plugins: plugins as returned by plugins_util.plugins_base_get.
      @param url_file_input: boolean value which indicates whether we are
          scanning an individual URL or a file. This is used to determine
          kwargs required.
      @param out: self.out
      """; 16, assignment; 17, assignment; 18, identifier:cms_name; 19, identifier:preferred_order; 20, block; 21, identifier:plugin; 22, identifier:plugins; 23, block; 24, identifier:instances; 25, identifier:instances; 26, call; 27, identifier:preferred_order; 28, list; 29, for_statement; 30, expression_statement; 31, if_statement; 32, identifier:OrderedDict; 33, argument_list; 34, string; 35, string; 36, string; 37, identifier:plugin; 38, identifier:plugins; 39, block; 40, assignment; 41, comparison_operator:plugin_name not in preferred_order; 42, block; 43, string_content:wordpress; 44, string_content:joomla; 45, string_content:drupal; 46, expression_statement; 47, if_statement; 48, identifier:plugin_name; 49, call; 50, identifier:plugin_name; 51, identifier:preferred_order; 52, expression_statement; 53, assignment; 54, comparison_operator:cms_name == plugin_name; 55, block; 56, attribute; 57, argument_list; 58, assignment; 59, identifier:plugin_name; 60, call; 61, identifier:cms_name; 62, identifier:plugin_name; 63, expression_statement; 64, attribute; 65, identifier:lower; 66, subscript; 67, call; 68, attribute; 69, argument_list; 70, assignment; 71, identifier:plugin; 72, identifier:__name__; 73, identifier:instances; 74, identifier:plugin_name; 75, identifier:instance_get; 76, argument_list; 77, attribute; 78, identifier:lower; 79, subscript; 80, call; 81, identifier:plugin; 82, identifier:opts; 83, identifier:url_file_input; 84, identifier:out; 85, identifier:plugin; 86, identifier:__name__; 87, identifier:instances; 88, identifier:plugin_name; 89, identifier:instance_get; 90, argument_list; 91, identifier:plugin; 92, identifier:opts; 93, identifier:url_file_input; 94, identifier:out
code: def instances_get(opts, plugins, url_file_input, out):
      """
      Creates and returns an ordered dictionary containing instances for all available
      scanning plugins, sort of ordered by popularity.
      @param opts: options as returned by self._options.
      @param plugins: plugins as returned by plugins_util.plugins_base_get.
      @param url_file_input: boolean value which indicates whether we are
          scanning an individual URL or a file. This is used to determine
          kwargs required.
      @param out: self.out
      """
      instances = OrderedDict()
      preferred_order = ['wordpress', 'joomla', 'drupal']
  
      for cms_name in preferred_order:
          for plugin in plugins:
              plugin_name = plugin.__name__.lower()
  
              if cms_name == plugin_name:
                  instances[plugin_name] = instance_get(plugin, opts,
                          url_file_input, out)
  
      for plugin in plugins:
          plugin_name = plugin.__name__.lower()
          if plugin_name not in preferred_order:
              instances[plugin_name] = instance_get(plugin, opts,
                      url_file_input, out)
  
      return instances