KOSASIH / pipfs-hub

Unused variable found PYL-W0612
Anti-pattern
Major
4 months ago4 months old
Unused variable 'encrypted_file'
28                f.write("Test file content")
29            with open(file_path, "rb") as f:
30                file = f.read()
31            encrypted_file = encrypt_file(file)32            response = self.client.post(
33                "/files",
34                data={"username": "test_user", "file": (file_path, "test_file.txt")},
12    frame_width = int(cap.get(cv2.CAP_PROP_FRAME_WIDTH))
13    frame_height = int(cap.get(cv2.CAP_PROP_FRAME_HEIGHT))
14
15    for i in range(frame_count):16        ret, frame = cap.read()
17        if not ret:
18            break
103                image = cv2.imread(self.config["computer_vision"]["image_path"])
104
105                # Detect faces in the image
106                faces = self.computer_vision.detect_faces(image)107
108                # Save the faces to file
109                cv2.imwrite(self.config["computer_vision"]["faces_path"], image)
41
42    def evaluate(self, X_test, y_test):
43        # Evaluate the performance of the model
44        loss, accuracy = self.model.evaluate(X_test, y_test)45        return accuracy
46
47
Unused variable 'header_frame'
17def receive_message(channel, queue_name):
18    # Receive a message from a message queue
19
20    method_frame, header_frame, body = channel.basic_consume(queue=queue_name)21    channel.basic_ack(delivery_tag=method_frame.delivery_tag)
22
23    return body.decode()