@@ -46,33 +46,33 @@ def add(self, triple, context, quoted=False):
4646 spo = self .__spo
4747 try :
4848 po = spo [subject ]
49- except :
49+ except : # noqa: E722
5050 po = spo [subject ] = {}
5151 try :
5252 o = po [predicate ]
53- except :
53+ except : # noqa: E722
5454 o = po [predicate ] = {}
5555 o [object ] = 1
5656
5757 pos = self .__pos
5858 try :
5959 os = pos [predicate ]
60- except :
60+ except : # noqa: E722
6161 os = pos [predicate ] = {}
6262 try :
6363 s = os [object ]
64- except :
64+ except : # noqa: E722
6565 s = os [object ] = {}
6666 s [subject ] = 1
6767
6868 osp = self .__osp
6969 try :
7070 sp = osp [object ]
71- except :
71+ except : # noqa: E722
7272 sp = osp [object ] = {}
7373 try :
7474 p = sp [subject ]
75- except :
75+ except : # noqa: E722
7676 p = sp [subject ] = {}
7777 p [predicate ] = 1
7878
@@ -88,7 +88,7 @@ def triples(self, triple_pattern, context=None):
8888 if subject != ANY : # subject is given
8989 spo = self .__spo
9090 if subject in spo :
91- subjectDictionary = spo [subject ]
91+ subjectDictionary = spo [subject ] # noqa: N806
9292 if predicate != ANY : # subject+predicate is given
9393 if predicate in subjectDictionary :
9494 if object != ANY : # subject+predicate+object is given
@@ -116,7 +116,7 @@ def triples(self, triple_pattern, context=None):
116116 elif predicate != ANY : # predicate is given, subject unbound
117117 pos = self .__pos
118118 if predicate in pos :
119- predicateDictionary = pos [predicate ]
119+ predicateDictionary = pos [predicate ] # noqa: N806
120120 if object != ANY : # predicate+object is given, subject unbound
121121 if object in predicateDictionary :
122122 for s in predicateDictionary [object ].keys ():
@@ -130,14 +130,14 @@ def triples(self, triple_pattern, context=None):
130130 elif object != ANY : # object is given, subject+predicate unbound
131131 osp = self .__osp
132132 if object in osp :
133- objectDictionary = osp [object ]
133+ objectDictionary = osp [object ] # noqa: N806
134134 for s in objectDictionary .keys ():
135135 for p in objectDictionary [s ].keys ():
136136 yield (s , p , object ), self .__contexts ()
137137 else : # subject+predicate+object unbound
138138 spo = self .__spo
139139 for s in spo .keys ():
140- subjectDictionary = spo [s ]
140+ subjectDictionary = spo [s ] # noqa: N806
141141 for p in subjectDictionary .keys ():
142142 for o in subjectDictionary [p ].keys ():
143143 yield (s , p , o ), self .__contexts ()
@@ -184,12 +184,12 @@ def namespaces(self):
184184 def __contexts (self ):
185185 return (c for c in []) # TODO: best way to return empty generator
186186
187- def query (self , query , initNs , initBindings , queryGraph , ** kwargs ):
187+ def query (self , query , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
188188 super (SimpleMemory , self ).query (
189189 query , initNs , initBindings , queryGraph , ** kwargs
190190 )
191191
192- def update (self , update , initNs , initBindings , queryGraph , ** kwargs ):
192+ def update (self , update , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
193193 super (SimpleMemory , self ).update (
194194 update , initNs , initBindings , queryGraph , ** kwargs
195195 )
@@ -347,7 +347,7 @@ def triples(self, triple_pattern, context=None):
347347 elif subject is not None : # subject is given
348348 spo = self .__spo
349349 if subject in spo :
350- subjectDictionary = spo [subject ]
350+ subjectDictionary = spo [subject ] # noqa: N806
351351 if predicate is not None : # subject+predicate is given
352352 if predicate in subjectDictionary :
353353 if object_ is not None : # subject+predicate+object is given
@@ -383,7 +383,7 @@ def triples(self, triple_pattern, context=None):
383383 elif predicate is not None : # predicate is given, subject unbound
384384 pos = self .__pos
385385 if predicate in pos :
386- predicateDictionary = pos [predicate ]
386+ predicateDictionary = pos [predicate ] # noqa: N806
387387 if object_ is not None : # predicate+object is given, subject unbound
388388 if object_ in predicateDictionary :
389389 for s in list (predicateDictionary [object_ ].keys ()):
@@ -401,7 +401,7 @@ def triples(self, triple_pattern, context=None):
401401 elif object_ is not None : # object is given, subject+predicate unbound
402402 osp = self .__osp
403403 if object_ in osp :
404- objectDictionary = osp [object_ ]
404+ objectDictionary = osp [object_ ] # noqa: N806
405405 for s in list (objectDictionary .keys ()):
406406 for p in list (objectDictionary [s ].keys ()):
407407 triple = (s , p , object_ )
@@ -411,7 +411,7 @@ def triples(self, triple_pattern, context=None):
411411 # Shouldn't get here if all other cases above worked correctly.
412412 spo = self .__spo
413413 for s in list (spo .keys ()):
414- subjectDictionary = spo [s ]
414+ subjectDictionary = spo [s ] # noqa: N806
415415 for p in list (subjectDictionary .keys ()):
416416 for o in list (subjectDictionary [p ].keys ()):
417417 triple = (s , p , o )
@@ -530,7 +530,7 @@ def __add_triple_context(self, triple, triple_exists, context, quoted):
530530 if triple_context == self .__defaultContexts :
531531 del self .__tripleContexts [triple ]
532532
533- def __get_context_for_triple (self , triple , skipQuoted = False ):
533+ def __get_context_for_triple (self , triple , skipQuoted = False ): # noqa: N803
534534 """return a list of contexts (str) for the triple, skipping
535535 quoted contexts if skipQuoted==True"""
536536
@@ -582,8 +582,8 @@ def __contexts(self, triple):
582582 if ctx_str is not None
583583 )
584584
585- def query (self , query , initNs , initBindings , queryGraph , ** kwargs ):
585+ def query (self , query , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
586586 super (Memory , self ).query (query , initNs , initBindings , queryGraph , ** kwargs )
587587
588- def update (self , update , initNs , initBindings , queryGraph , ** kwargs ):
588+ def update (self , update , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
589589 super (Memory , self ).update (update , initNs , initBindings , queryGraph , ** kwargs )
0 commit comments