string
An Evidence instance for a string value.
String
Bases: Evidence
String implements the Evidence interface for a single real value.
Source code in mlte/evidence/types/string.py
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 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 | |
value = value
instance-attribute
The attribute to store the string in.
__eq__(other)
Comparison between String values.
Source code in mlte/evidence/types/string.py
99 100 101 102 103 | |
__init__(value)
Initialize a String instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
value
|
str
|
The string value |
required |
Source code in mlte/evidence/types/string.py
22 23 24 25 26 27 28 29 30 31 32 | |
__str__()
Return a string representation of the value.
Source code in mlte/evidence/types/string.py
95 96 97 | |
contains(substring, success='', failure='')
classmethod
Checks if the given string is in this one.
Source code in mlte/evidence/types/string.py
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | |
equal_to(other_string, success='', failure='')
classmethod
Checks if the given string is the same as this one in value.
Source code in mlte/evidence/types/string.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | |
from_model(model)
classmethod
Convert a string value model to its corresponding artifact.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
BaseModel
|
The model representation |
required |
Returns:
| Type | Description |
|---|---|
String
|
The string value |
Source code in mlte/evidence/types/string.py
43 44 45 46 47 48 49 50 51 | |
to_model()
Convert a string value artifact to its corresponding model.
Returns:
| Type | Description |
|---|---|
ArtifactModel
|
The artifact model |
Source code in mlte/evidence/types/string.py
34 35 36 37 38 39 40 41 | |