Skip to content

Commit

Permalink
isort and black
Browse files Browse the repository at this point in the history
  • Loading branch information
sametd committed Sep 20, 2024
1 parent 25a0e3e commit 10a05c4
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions polytope_server/common/datasource/polytope.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@
# does it submit to any jurisdiction.
#

import copy
import json
import logging
import os
import copy

import yaml
from polytope.utility.exceptions import PolytopeError
Expand Down Expand Up @@ -61,7 +61,7 @@ def retrieve(self, request):

# Set the "pre-path" for this request
pre_path = {}
for k,v in r.items():
for k, v in r.items():
if k in self.req_single_keys:
if isinstance(v, list):
v = v[0]
Expand All @@ -70,14 +70,13 @@ def retrieve(self, request):
polytope_mars_config = copy.deepcopy(self.config)
polytope_mars_config["options"]["pre_path"] = pre_path


polytope_mars = PolytopeMars(
polytope_mars_config,
log_context= {
"user": request.user.realm + ':' + request.user.username,
log_context={
"user": request.user.realm + ":" + request.user.username,
"id": request.id,
})

},
)

try:
self.output = polytope_mars.extract(r)
Expand Down Expand Up @@ -111,7 +110,7 @@ def match(self, request):
raise Exception("got {} : {}, but expected one of {}".format(k, r[k], v))

# Check that there is only one value if required
for k, v in r.items():
for k, v in r.items():
if k in self.req_single_keys:
v = [v] if isinstance(v, str) else v
if len(v) > 1:
Expand Down

0 comments on commit 10a05c4

Please sign in to comment.