-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy path_deidentify_file_response.py
More file actions
49 lines (46 loc) · 1.77 KB
/
_deidentify_file_response.py
File metadata and controls
49 lines (46 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import io
from skyflow.vault.detect._file import File
class DeidentifyFileResponse:
def __init__(
self,
file_base64: str = None,
file: io.BytesIO = None,
type: str = None,
extension: str = None,
word_count: int = None,
char_count: int = None,
size_in_kb: float = None,
duration_in_seconds: float = None,
page_count: int = None,
slide_count: int = None,
entities: list = None, # list of dicts with keys 'file' and 'extension'
run_id: str = None,
status: str = None,
errors: list = None,
):
self.file_base64 = file_base64
self.file = File(file) if file else None
self.type = type
self.extension = extension
self.word_count = word_count
self.char_count = char_count
self.size_in_kb = size_in_kb
self.duration_in_seconds = duration_in_seconds
self.page_count = page_count
self.slide_count = slide_count
self.entities = entities if entities is not None else []
self.run_id = run_id
self.status = status
self.errors = errors
def __repr__(self):
return (
f"DeidentifyFileResponse("
f"file_base64={self.file_base64!r}, file={self.file!r}, type={self.type!r}, "
f"extension={self.extension!r}, word_count={self.word_count!r}, "
f"char_count={self.char_count!r}, size_in_kb={self.size_in_kb!r}, "
f"duration_in_seconds={self.duration_in_seconds!r}, page_count={self.page_count!r}, "
f"slide_count={self.slide_count!r}, entities={self.entities!r}, "
f"run_id={self.run_id!r}, status={self.status!r}, errors={self.errors!r})"
)
def __str__(self):
return self.__repr__()