class_docstr: Parameters
  ----------
  ttype
      Type of theano variable this list will contains, can be another list.
  depth
      Optionnal parameters, any value above 0 will create a nested list of
      this depth. (0-based)
class_docstr_tok: ["Parameters","--","--","--","--","--","ttype","Type","of","theano","variable","this","list","will","contains",",","can","be","another","list",".","depth","Optionnal","parameters",",","any","value","above","0","will","create","a","nested","list","of","this","depth",".","(","0-based",")"]
docstr: Parameters
  ----------
  x
      Value to filter.
  strict
      If true, only native python list will be accepted.
  allow_downcast
      Does not have any utility at the moment.
docstr_tok: ["Parameters","--","--","--","--","--","x","Value","to","filter",".","strict","If","true",",","only","native","python","list","will","be","accepted",".","allow_downcast","Does","not","have","any","utility","at","the","moment","."]
code: def filter(self, x, strict=False, allow_downcast=None):
      """
  
      Parameters
      ----------
      x
          Value to filter.
      strict
          If true, only native python list will be accepted.
      allow_downcast
          Does not have any utility at the moment.
  
      """
      if strict:
          if not isinstance(x, list):
              raise TypeError("Expected a python list")
      else:
          x = [self.ttype.filter(y) for y in x]
  
          if all(self.ttype.is_valid_value(y) for y in x):
              return x
  
          else:
              raise TypeError(
                  "Expected all elements to" " be %s" % str(self.ttype)
              )
  
file_path: Theano/theano/typed_list/type.py
imports: from __future__ import absolute_import, print_function, division
  from theano import gof
label_desc: Use image node_id 2 for calling the TypedListType obj's underlying member method code with example usage: obj.filter(x, strict, allow_downcast) and returns: x