@@ -46,33 +46,33 @@ def add(self, triple, context, quoted=False):
46
46
spo = self .__spo
47
47
try :
48
48
po = spo [subject ]
49
- except :
49
+ except : # noqa: E722
50
50
po = spo [subject ] = {}
51
51
try :
52
52
o = po [predicate ]
53
- except :
53
+ except : # noqa: E722
54
54
o = po [predicate ] = {}
55
55
o [object ] = 1
56
56
57
57
pos = self .__pos
58
58
try :
59
59
os = pos [predicate ]
60
- except :
60
+ except : # noqa: E722
61
61
os = pos [predicate ] = {}
62
62
try :
63
63
s = os [object ]
64
- except :
64
+ except : # noqa: E722
65
65
s = os [object ] = {}
66
66
s [subject ] = 1
67
67
68
68
osp = self .__osp
69
69
try :
70
70
sp = osp [object ]
71
- except :
71
+ except : # noqa: E722
72
72
sp = osp [object ] = {}
73
73
try :
74
74
p = sp [subject ]
75
- except :
75
+ except : # noqa: E722
76
76
p = sp [subject ] = {}
77
77
p [predicate ] = 1
78
78
@@ -88,7 +88,7 @@ def triples(self, triple_pattern, context=None):
88
88
if subject != ANY : # subject is given
89
89
spo = self .__spo
90
90
if subject in spo :
91
- subjectDictionary = spo [subject ]
91
+ subjectDictionary = spo [subject ] # noqa: N806
92
92
if predicate != ANY : # subject+predicate is given
93
93
if predicate in subjectDictionary :
94
94
if object != ANY : # subject+predicate+object is given
@@ -116,7 +116,7 @@ def triples(self, triple_pattern, context=None):
116
116
elif predicate != ANY : # predicate is given, subject unbound
117
117
pos = self .__pos
118
118
if predicate in pos :
119
- predicateDictionary = pos [predicate ]
119
+ predicateDictionary = pos [predicate ] # noqa: N806
120
120
if object != ANY : # predicate+object is given, subject unbound
121
121
if object in predicateDictionary :
122
122
for s in predicateDictionary [object ].keys ():
@@ -130,14 +130,14 @@ def triples(self, triple_pattern, context=None):
130
130
elif object != ANY : # object is given, subject+predicate unbound
131
131
osp = self .__osp
132
132
if object in osp :
133
- objectDictionary = osp [object ]
133
+ objectDictionary = osp [object ] # noqa: N806
134
134
for s in objectDictionary .keys ():
135
135
for p in objectDictionary [s ].keys ():
136
136
yield (s , p , object ), self .__contexts ()
137
137
else : # subject+predicate+object unbound
138
138
spo = self .__spo
139
139
for s in spo .keys ():
140
- subjectDictionary = spo [s ]
140
+ subjectDictionary = spo [s ] # noqa: N806
141
141
for p in subjectDictionary .keys ():
142
142
for o in subjectDictionary [p ].keys ():
143
143
yield (s , p , o ), self .__contexts ()
@@ -184,12 +184,12 @@ def namespaces(self):
184
184
def __contexts (self ):
185
185
return (c for c in []) # TODO: best way to return empty generator
186
186
187
- def query (self , query , initNs , initBindings , queryGraph , ** kwargs ):
187
+ def query (self , query , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
188
188
super (SimpleMemory , self ).query (
189
189
query , initNs , initBindings , queryGraph , ** kwargs
190
190
)
191
191
192
- def update (self , update , initNs , initBindings , queryGraph , ** kwargs ):
192
+ def update (self , update , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
193
193
super (SimpleMemory , self ).update (
194
194
update , initNs , initBindings , queryGraph , ** kwargs
195
195
)
@@ -347,7 +347,7 @@ def triples(self, triple_pattern, context=None):
347
347
elif subject is not None : # subject is given
348
348
spo = self .__spo
349
349
if subject in spo :
350
- subjectDictionary = spo [subject ]
350
+ subjectDictionary = spo [subject ] # noqa: N806
351
351
if predicate is not None : # subject+predicate is given
352
352
if predicate in subjectDictionary :
353
353
if object_ is not None : # subject+predicate+object is given
@@ -383,7 +383,7 @@ def triples(self, triple_pattern, context=None):
383
383
elif predicate is not None : # predicate is given, subject unbound
384
384
pos = self .__pos
385
385
if predicate in pos :
386
- predicateDictionary = pos [predicate ]
386
+ predicateDictionary = pos [predicate ] # noqa: N806
387
387
if object_ is not None : # predicate+object is given, subject unbound
388
388
if object_ in predicateDictionary :
389
389
for s in list (predicateDictionary [object_ ].keys ()):
@@ -401,7 +401,7 @@ def triples(self, triple_pattern, context=None):
401
401
elif object_ is not None : # object is given, subject+predicate unbound
402
402
osp = self .__osp
403
403
if object_ in osp :
404
- objectDictionary = osp [object_ ]
404
+ objectDictionary = osp [object_ ] # noqa: N806
405
405
for s in list (objectDictionary .keys ()):
406
406
for p in list (objectDictionary [s ].keys ()):
407
407
triple = (s , p , object_ )
@@ -411,7 +411,7 @@ def triples(self, triple_pattern, context=None):
411
411
# Shouldn't get here if all other cases above worked correctly.
412
412
spo = self .__spo
413
413
for s in list (spo .keys ()):
414
- subjectDictionary = spo [s ]
414
+ subjectDictionary = spo [s ] # noqa: N806
415
415
for p in list (subjectDictionary .keys ()):
416
416
for o in list (subjectDictionary [p ].keys ()):
417
417
triple = (s , p , o )
@@ -530,7 +530,7 @@ def __add_triple_context(self, triple, triple_exists, context, quoted):
530
530
if triple_context == self .__defaultContexts :
531
531
del self .__tripleContexts [triple ]
532
532
533
- def __get_context_for_triple (self , triple , skipQuoted = False ):
533
+ def __get_context_for_triple (self , triple , skipQuoted = False ): # noqa: N803
534
534
"""return a list of contexts (str) for the triple, skipping
535
535
quoted contexts if skipQuoted==True"""
536
536
@@ -582,8 +582,8 @@ def __contexts(self, triple):
582
582
if ctx_str is not None
583
583
)
584
584
585
- def query (self , query , initNs , initBindings , queryGraph , ** kwargs ):
585
+ def query (self , query , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
586
586
super (Memory , self ).query (query , initNs , initBindings , queryGraph , ** kwargs )
587
587
588
- def update (self , update , initNs , initBindings , queryGraph , ** kwargs ):
588
+ def update (self , update , initNs , initBindings , queryGraph , ** kwargs ): # noqa: N803
589
589
super (Memory , self ).update (update , initNs , initBindings , queryGraph , ** kwargs )
0 commit comments