code: def substitute_any_type(type_, basic_types):
      """
      Takes a type and a set of basic types, and substitutes all instances of ANY_TYPE with all
      possible basic types, and returns a list with all possible combinations.  Note that this
      substitution is unconstrained. That is, If you have a type with placeholders, <#1,#1> for
      example, this may substitute the placeholders with different basic types. In that case, you'd
      want to use ``_substitute_placeholder_type`` instead.
      """
      if type_ == ANY_TYPE:
          return list(basic_types)
      if isinstance(type_, BasicType):
          return [type_]
      # If we've made it this far, we have a ComplexType, and we can just call
      # `type_.substitute_any_type()`.
      return type_.substitute_any_type(basic_types)
  
imports: from __future__ import absolute_import
  from collections import defaultdict
  from nltk.sem.logic import Expression, ApplicationExpression, ConstantExpression, LogicParser, Variable
  from nltk.sem.logic import Type, BasicType, ComplexType, ANY_TYPE
  from allennlp.common.util import START_SYMBOL
label_desc: Use image node_id 1 for calling a global function with example usage: substitute_any_type(type_, basic_types) and returns: type_, list, list