Skip to content

Commit 72939b1

Browse files
Merge pull request #7 from Programmer-RD-AI/deepsource-fix-e0594706
Remove unused imports
2 parents d2b4bb2 + 6dcf5b7 commit 72939b1

File tree

5 files changed

+316
-334
lines changed

5 files changed

+316
-334
lines changed

mongodb/test.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
from pymongo import *
2-
import base64
3-
import bson
41
from bson.binary import Binary
2+
from pymongo import *
53

64
cluster = MongoClient(
75
"mongodb+srv://Ranuga:[email protected]/<dbname>?retryWrites=true&w=majority"
86
)
97
db = cluster["test"]
108
collectin = db["test"]
11-
with open(f"/home/ranuga/Programming/Projects/Python/Flask/Done/My-Class-Room-V2/mongodb/get_the_last_id.py", "rb") as f:
9+
with open(
10+
f"/home/ranuga/Programming/Projects/Python/Flask/Done/My-Class-Room-V2/mongodb/get_the_last_id.py",
11+
"rb",
12+
) as f:
1213
encoded = Binary(f.read())
13-
collectin.insert_one({'test':encoded,'file':'get_the_last_id.py'})
14+
collectin.insert_one({"test": encoded, "file": "get_the_last_id.py"})
1415
results = []
15-
for result in collectin.find({'file':'get_the_last_id.py'}):
16+
for result in collectin.find({"file": "get_the_last_id.py"}):
1617
results.append(result)
17-
with open('test.py','wb') as a:
18-
a.write(results[0]['test'])
19-
18+
with open("test.py", "wb") as a:
19+
a.write(results[0]["test"])

0 commit comments

Comments
 (0)