def __call__(self, name, fields):
        """
        return namedtuple class as singleton 
        """

        fields = tuple(fields)
        if not fields in self.cache:
            self.cache[fields] = namedtuple(
                name, fields)
        return self.cache[fields]
def __call__ ( self , name , fields ) : fields = tuple ( fields ) if not fields in self . cache : self . cache [ fields ] = namedtuple ( name , fields ) return self . cache [ fields ]
return namedtuple class as singleton