class_docstr: This class can create a struct of Theano types (like TensorType, GpuArrayType, etc.)
  to be used as a convenience op parameter wrapping many data.
  
  ParamsType constructor takes key-value args.
  Key will be the name of the attribute in the struct.
  Value is the Theano type of this attribute, ie. an instance of (a subclass of) :class:`Type`
  (eg. ``TensorType('int64', (False,))``).
  
  In a Python code any attribute named ``key`` will be available via::
  
      structObject.key
  
  In a C code, any attribute named ``key`` will be available via:
  
  .. code-block:: c
  
      structObject->key;
  
  .. note::
  
      This Type is not complete and should never be used for regular graph operations.
class_docstr_tok: ["This","class","can","create","a","struct","of","Theano","types","(","like","TensorType",",","GpuArrayType",",","etc",".",")","to","be","used","as","a","convenience","op","parameter","wrapping","many","data",".","ParamsType","constructor","takes","key-value","args",".","Key","will","be","the","name","of","the","attribute","in","the","struct",".","Value","is","the","Theano","type","of","this","attribute",",","ie",".","an","instance","of","(","a","subclass","of",")",":","class",":","`","Type","`","(","eg",".","``","TensorType","(","'int64","'",",","(","False",",",")",")","``",")",".","In","a","Python","code","any","attribute","named","``","key","``","will","be","available","via",":",":","structObject.key","In","a","C","code",",","any","attribute","named","``","key","``","will","be","available","via",":","..","code-block",":",":","c","structObject-",">","key",";","..","note",":",":","This","Type","is","not","complete","and","should","never","be","used","for","regular","graph","operations","."]
docstr: Convenient method to extract fields values from a list of Python objects and key-value args,
  and wrap them into a :class:`Params` object compatible with current ParamsType.
  
  For each field defined in the current ParamsType, a value for this field
  is looked for in the given objects attributes (looking for attributes with this field name)
  and key-values args (looking for a key equal to this field name), from left to right
  (first object, then, ..., then last object, then key-value args), replacing a previous
  field value found with any value found in next step, so that only the last field value
  found is retained.
  
  Fields values given in objects and kwargs must be compatible with types
  associated to corresponding fields in current ParamsType.
  
  **Example**::
  
      import numpy
      from theano.gof import ParamsType
      from theano.tensor import dmatrix
      from theano.scalar import Scalar
  
      class MyObject:
          def __init__(self):
              self.a = 10
              self.b = numpy.asarray([[1, 2, 3], [4, 5, 6]])
  
      params_type = ParamsType(a=Scalar('int32'), b=dmatrix, c=Scalar('bool'))
  
      o = MyObject()
      value_for_c = False
  
      # Value for c can't be retrieved from o, so we add a value for that field in kwargs.
      params = params_type.get_params(o, c=value_for_c)
      # params.a contains 10
      # params.b contains [[1, 2, 3], [4, 5, 6]]
      # params.c contains value_for_c
      print(params)
docstr_tok: ["Convenient","method","to","extract","fields","values","from","a","list","of","Python","objects","and","key-value","args",",","and","wrap","them","into","a",":","class",":","`","Params","`","object","compatible","with","current","ParamsType",".","For","each","field","defined","in","the","current","ParamsType",",","a","value","for","this","field","is","looked","for","in","the","given","objects","attributes","(","looking","for","attributes","with","this","field","name",")","and","key-values","args","(","looking","for","a","key","equal","to","this","field","name",")",",","from","left","to","right","(","first","object",",","then",",","...",",","then","last","object",",","then","key-value","args",")",",","replacing","a","previous","field","value","found","with","any","value","found","in","next","step",",","so","that","only","the","last","field","value","found","is","retained",".","Fields","values","given","in","objects","and","kwargs","must","be","compatible","with","types","associated","to","corresponding","fields","in","current","ParamsType",".","*","*","Example","*","*",":",":","import","numpy","from","theano.gof","import","ParamsType","from","theano.tensor","import","dmatrix","from","theano.scalar","import","Scalar","class","MyObject",":","def","__init__","(","self",")",":","self.a","=","10","self.b","=","numpy.asarray","(","[","[","1",",","2",",","3","]",",","[","4",",","5",",","6","]","]",")","params_type","=","ParamsType","(","a=Scalar","(","'int32","'",")",",","b=dmatrix",",","c=Scalar","(","'bool","'",")",")","o","=","MyObject","(",")","value_for_c","=","False","#","Value","for","c","ca","n't","be","retrieved","from","o",",","so","we","add","a","value","for","that","field","in","kwargs",".","params","=","params_type.get_params","(","o",",","c=value_for_c",")","#","params.a","contains","10","#","params.b","contains","[","[","1",",","2",",","3","]",",","[","4",",","5",",","6","]","]","#","params.c","contains","value_for_c","print","(","params",")"]
code: def get_params(self, *objects, **kwargs):
      """
      Convenient method to extract fields values from a list of Python objects and key-value args,
      and wrap them into a :class:`Params` object compatible with current ParamsType.
  
      For each field defined in the current ParamsType, a value for this field
      is looked for in the given objects attributes (looking for attributes with this field name)
      and key-values args (looking for a key equal to this field name), from left to right
      (first object, then, ..., then last object, then key-value args), replacing a previous
      field value found with any value found in next step, so that only the last field value
      found is retained.
  
      Fields values given in objects and kwargs must be compatible with types
      associated to corresponding fields in current ParamsType.
  
      **Example**::
  
          import numpy
          from theano.gof import ParamsType
          from theano.tensor import dmatrix
          from theano.scalar import Scalar
  
          class MyObject:
              def __init__(self):
                  self.a = 10
                  self.b = numpy.asarray([[1, 2, 3], [4, 5, 6]])
  
          params_type = ParamsType(a=Scalar('int32'), b=dmatrix, c=Scalar('bool'))
  
          o = MyObject()
          value_for_c = False
  
          # Value for c can't be retrieved from o, so we add a value for that field in kwargs.
          params = params_type.get_params(o, c=value_for_c)
          # params.a contains 10
          # params.b contains [[1, 2, 3], [4, 5, 6]]
          # params.c contains value_for_c
          print(params)
  
      """
      fields_values = dict()
      # We collect fields values from given objects.
      # If a field is present in many objects, only the field in the last object will be retained.
      for obj in objects:
          for field in self.fields:
              try:
                  fields_values[field] = getattr(obj, field)
              except Exception:
                  pass
      # We then collect fields values from given kwargs.
      # A field value in kwargs will replace any previous value collected from objects for this field.
      for field in self.fields:
          if field in kwargs:
              fields_values[field] = kwargs[field]
      # Then we filter the fields values and we create the Params object.
      filtered = {
          self.fields[i]: self.types[i].filter(
              fields_values[self.fields[i]],
              strict=False,
              allow_downcast=True,
          )
          for i in range(self.length)
      }
      return Params(self, **filtered)
  
imports: from __future__ import absolute_import, print_function, division
  import re
  import hashlib
  from theano.gof.utils import MethodNotDefined, c_cpp_keywords
  from theano.gof import Type, EnumType
label_desc: Use image node_id 13 for calling the ParamsType obj's underlying member method code with example usage: obj.get_params() and returns: Params