#NEWLINE# def facts( self , name = None , value = None , **kwargs ) : #NEWLINE# #INDENT# 'Query for facts limited by either name, value and/or query.\n\n        :param name: (Optional) Only return facts that match this name.\n        :type name: :obj:`string`\n        :param value: (Optional) Only return facts of `name` that            match this value. Use of this parameter requires the `name`            parameter be set.\n        :type value: :obj:`string`\n        :param \\*\\*kwargs: The rest of the keyword arguments are passed\n            to the _query function\n\n        :returns: A generator yielding Facts.\n        :rtype: :class:`pypuppetdb.types.Fact`\n        ' #NEWLINE# if ( ( name is not None ) and ( value is not None ) ) : #NEWLINE# #INDENT# query = '["and",["=", "name", "{0}"],["=", "value", "{1}"]]' . format ( name , value ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( ( name is not None ) and ( value is None ) ) : #NEWLINE# #INDENT# query = '["=", "name", "{0}"]' . format ( facts ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# query = None #NEWLINE# #UNINDENT# #UNINDENT# facts = self . _query ( 'facts' , query = query , ** kwargs ) #NEWLINE# for fact in facts : #NEWLINE# #INDENT# ( yield Fact ( node = fact [ 'certname' ] , name = fact [ 'name' ] , value = fact [ 'value' ] , environment = fact [ 'environment' ] ) )