#NEWLINE# def in_domain( self , xs , ys , x ) : #NEWLINE# #INDENT# '\n        Returns the filtered (xs, ys) based on the Kernel domain centred on x\n        ' #NEWLINE# def isInDomain( xy ) : #NEWLINE# #INDENT# 'Used for filter to check if point is in the domain' #NEWLINE# u = ( ( xy [ 0 ] - x ) / self . h ) #NEWLINE# return ( ( u >= self . domain [ 0 ] ) and ( u <= self . domain [ 1 ] ) ) #NEWLINE# #UNINDENT# if ( self . domain is None ) : #NEWLINE# #INDENT# return ( xs , ys ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# filtered = lfilter ( isInDomain , lzip ( xs , ys ) ) #NEWLINE# if ( len ( filtered ) > 0 ) : #NEWLINE# #INDENT# ( xs , ys ) = lzip ( * xs ) #NEWLINE# return ( xs , ys ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# return ( [ ] , [ ] )