code
stringlengths
1
18.2k
def save(self, async=False, callback=None, encrypted=True): """ Updates the user and perform the callback method """ if self._new_password and encrypted: self.password = Sha1.encrypt(self._new_password) controller = NURESTSession.get_current_session().login_controller controller.password = self._new_password controller...
def _did_save(self, connection): """ Launched when save has been successfully executed """ self._new_password = None controller = NURESTSession.get_current_session().login_controller controller.password = None controller.api_key = self.api_key if connection.async: callback = connection.callbacks['remote'] if connection...
def fetch(self, async=False, callback=None): """ Fetch all information about the current object Args: async (bool): Boolean to make an asynchronous call. Default is False callback (function): Callback method that will be triggered in case of asynchronous call Returns: tuple: (current_fetcher, callee_parent, fetched_bje...
request = NURESTRequest(method=HTTP_METHOD_GET, url=self.get_resource_url()) if async: return self.send_request(request=request, async=async, local_callback=self._did_fetch, remote_callback=callback) else: connection = self.send_request(request=request) return self._did_retrieve(connection)
def _fabtabular(): """ This function retrieves the ISO 639 and inverted names datasets as tsv files and returns them as lists. """ import csv import sys from pkg_resources import resource_filename data = resource_filename(__package__, 'iso-639-3.tab') inverted = resource_filename(__package__, 'iso-639-3_Name_Index.tab'...
# from contextlib import closing # data_fo = closing(urlopen('http://www-01.sil.org/iso639-3/iso-639-3.tab')) # inverted_fo = closing(urlopen('http://www-01.sil.org/iso639-3/iso-639-3_Name_Index.tab')) # else: # from urllib.request import urlopen # import io # data_fo = io.StringIO(urlopen('http://www-01.sil.org/iso639...
data_fo as u: with inverted_fo as i: with macro_fo as m: with part5_fo as p5: with part2_fo as p2: with part1_fo as p1: return (list(csv.reader(u, delimiter='\t'))[1:], list(csv.reader(i, delimiter='\t'))[1:], list(csv.reader(m, delimiter='\t'))[1:], list(csv.reader(p5, delimiter='\t'))[1:], list(csv.reader(p2, delimit...
def retired(self): """ Function for generating retired languages. Returns a dict('code', (datetime, [language, ...], 'description')). """ def gen(): import csv import re from datetime import datetime from pkg_resources import resource_filename with open(resource_filename(__package__, 'iso-639-3_Retirements.tab')) as rf...
re.findall('\[([a-z]{3})\]', s) if m: m = [m] if isinstance(m, str) else m yield i, (d, [self.get(part3=x) for x in m if x not in rc], s) else: yield i, (d, [], s) yield 'sh', self.get(part3='hbs') # Add 'sh' as deprecated return dict(gen())
def get(self, **kwargs): """ Simple getter function for languages. Takes 1 keyword/value and returns 1 language object. """ if not len(kwargs) == 1: raise AttributeError('Only one keyword expected') key, value = kwargs.popitem() return getattr(self, key)[value]
def list(self, request, *args, **kwargs): """ To get a list of customers, run GET against */api/customers/* as authenticated user. Note that a user can only see connected customers: - customers that the user owns - customers that have a project where user has a role Staff also can filter customers by user UUID, for exa...
for example: The first category: /api/customers/?accounting_is_running=True has accounting_start_date empty (i.e. accounting starts at once) has accounting_start_date in the past (i.e. has already started). Those that are not in the first: /api/customers/?accounting_is_running=False # exists accounting_start_date """ r...
def retrieve(self, request, *args, **kwargs): """ Optional `field` query parameter (can be list) allows to limit what fields are returned. For example, given request /api/customers/<uuid>/?field=uuid&field=name you get response like this: .. code-block:: javascript { "uuid": "90bcfe38b0124c9bbdadd617b5d739f5", "name": ...
def create(self, request, *args, **kwargs): """ A new customer can only be created: - by users with staff privilege (is_staff=True); - by organization owners if OWNER_CAN_MANAGE_CUSTOMER is set to True; Example of a valid request: .. code-block:: http POST /api/customers/ HTTP/1.1 Content-Type: application/json Accept:...
} """ return super(CustomerViewSet, self).create(request, *args, **kwargs)
def destroy(self, request, *args, **kwargs): """ Deletion of a customer is done through sending a **DELETE** request to the customer instance URI. Please note, that if a customer has connected projects, deletion request will fail with 409 response code. Valid request example (token is user specific): .. code-block:: ht...
def list(self, request, *args, **kwargs): """ To get a list of projects, run **GET** against */api/projects/* as authenticated user. Here you can also check actual value for project quotas and project usage Note that a user can only see connected projects: - projects that the user owns as a customer - projects where us...
a list of projects where current user is manager or a customer owner; - ?can_admin - return a list of projects where current user is admin; """ return super(ProjectViewSet, self).list(request, *args, **kwargs)
def retrieve(self, request, *args, **kwargs): """ Optional `field` query parameter (can be list) allows to limit what fields are returned. For example, given request /api/projects/<uuid>/?field=uuid&field=name you get response like this: .. code-block:: javascript { "uuid": "90bcfe38b0124c9bbdadd617b5d739f5", "name": "...
def create(self, request, *args, **kwargs): """ A new project can be created by users with staff privilege (is_staff=True) or customer owners. Project resource quota is optional. Example of a valid request: .. code-block:: http POST /api/projects/ HTTP/1.1 Content-Type: application/json Accept: application/json Authori...
def destroy(self, request, *args, **kwargs): """ Deletion of a project is done through sending a **DELETE** request to the project instance URI. Please note, that if a project has connected instances, deletion request will fail with 409 response code. Valid request example (token is user specific): .. code-block:: http...
def users(self, request, uuid=None): """ A list of users connected to the project """ project = self.get_object() queryset = project.get_users() # we need to handle filtration manually because we want to filter only project users, not projects. filter_backend = filters.UserConcatenatedNameOrderingBackend() queryset = f...
def list(self, request, *args, **kwargs): """ User list is available to all authenticated users. To get a list, issue authenticated **GET** request against */api/users/*. User list supports several filters. All filters are set in HTTP query section. Field filters are listed below. All of the filters apart from ?organiz...
out user making a request. Useful for getting information about a currently logged in user. - ?civil_number=XXX - filters out users with a specified civil number - ?is_active=True|False - show only active (non-active) users The user can be created either through automated process on login with SAML token, or through a ...
is below. .. code-block:: http POST /api/users/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "username": "sample-user", "full_name": "full name", "native_name": "taisnimi", "job_title": "senior cleaning manager", "emai...
def retrieve(self, request, *args, **kwargs): """ User fields can be updated by account owner or user with staff privilege (is_staff=True). Following user fields can be updated: - organization (deprecated, use `organization plugin <http://waldur_core-organization.readthedocs.org/en/stable/>`_ instead) - full_name - nat...
Valid request example (token is user specific): .. code-block:: http PUT /api/users/e0c058d06864441fb4f1c40dee5dd4fd/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "email": "example@example.com", "organization": "Bells ...
def password(self, request, uuid=None): """ To change a user password, submit a **POST** request to the user's RPC URL, specifying new password by staff user or account owner. Password is expected to be at least 7 symbols long and contain at least one number and at least one lower or upper case. Example of a valid requ...
application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.com { "password": "nQvqHzeP123", } """ user = self.get_object() serializer = serializers.PasswordSerializer(data=request.data) serializer.is_valid(raise_exception=True) new_password = serializer.validat...
def list(self, request, *args, **kwargs): """ Project permissions expresses connection of user to a project. User may have either project manager or system administrator permission in the project. Use */api/project-permissions/* endpoint to maintain project permissions. Note that project permissions can be viewed and m...
will contain a list of project users and their brief data. To add a new user to the project, **POST** a new relationship to */api/project-permissions/* endpoint specifying project, user and the role of the user ('admin' or 'manager'): .. code-block:: http POST /api/project-permissions/ HTTP/1.1 Accept: application/json...
**kwargs)
def destroy(self, request, *args, **kwargs): """ To remove a user from a project, delete corresponding connection (**url** field). Successful deletion will return status code 204. .. code-block:: http DELETE /api/project-permissions/42/ HTTP/1.1 Authorization: Token 95a688962bf68678fd4c8cec4d138ddd9493c93b Host: exampl...
def list(self, request, *args, **kwargs): """ Each customer is associated with a group of users that represent customer owners. The link is maintained through **api/customer-permissions/** endpoint. To list all visible links, run a **GET** query against a list. Response will contain a list of customer owners and their ...
endpoint: .. code-block:: http POST /api/customer-permissions/ HTTP/1.1 Accept: application/json Authorization: Token 95a688962bf68678fd4c8cec4d138ddd9493c93b Host: example.com { "customer": "http://example.com/api/customers/6c9b01c251c24174a6691a1f894fae31/", "role": "owner", "user": "http://example.com/api/users/82ce...
def retrieve(self, request, *args, **kwargs): """ To remove a user from a customer owner group, delete corresponding connection (**url** field). Successful deletion will return status code 204. .. code-block:: http DELETE /api/customer-permissions/71/ HTTP/1.1 Authorization: Token 95a688962bf68678fd4c8cec4d138ddd9493c9...
def list(self, request, *args, **kwargs): """ Available request parameters: - ?type=type_of_statistics_objects (required. Have to be from the list: 'customer', 'project') - ?from=timestamp (default: now - 30 days, for example: 1415910025) - ?to=timestamp (default: now, for example: 1415912625) - ?datapoints=how many da...
- count of objects, that were created between 'from' and 'to' dates. Example: .. code-block:: javascript [ {"to": 471970877, "from": 1, "value": 5}, {"to": 943941753, "from": 471970877, "value": 0}, {"to": 1415912629, "from": 943941753, "value": 3} ] """ return super(CreationTimeStatsView, self).list(request, *args, **...
def list(self, request, *args, **kwargs): """ To get a list of SSH keys, run **GET** against */api/keys/* as authenticated user. A new SSH key can be created by any active users. Example of a valid request: .. code-block:: http POST /api/keys/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorizati...
return super(SshKeyViewSet, self).list(request, *args, **kwargs)
def list(self, request, *args, **kwargs): """ To get a list of service settings, run **GET** against */api/service-settings/* as an authenticated user. Only settings owned by this user or shared settings will be listed. Supported filters are: - ?name=<text> - partial matching used for searching - ?type=<type> - choices...
Syncing, In Sync, Erred - ?shared=<bool> - allows to filter shared service settings """ return super(ServiceSettingsViewSet, self).list(request, *args, **kwargs)
def can_user_update_settings(request, view, obj=None): """ Only staff can update shared settings, otherwise user has to be an owner of the settings.""" if obj is None: return # TODO [TM:3/21/17] clean it up after WAL-634. Clean up service settings update tests as well. if obj.customer and not obj.shared: return permiss...
def update(self, request, *args, **kwargs): """ To update service settings, issue a **PUT** or **PATCH** to */api/service-settings/<uuid>/* as a customer owner. You are allowed to change name and credentials only. Example of a request: .. code-block:: http PATCH /api/service-settings/9079705c17d64e6aa0af2e619b0e0702/ H...
def stats(self, request, uuid=None): """ This endpoint returns allocation of resources for current service setting. Answer is service-specific dictionary. Example output for OpenStack: * vcpu - maximum number of vCPUs (from hypervisors) * vcpu_quota - maximum number of vCPUs(from quotas) * vcpu_usage - current number o...
of memory (from quotas) * ram_usage - currently used memory size on all physical hosts * storage - total available disk space on all physical hosts (from hypervisors) * storage_quota - maximum number of storage (from quotas) * storage_usage - currently used storage on all physical hosts { 'vcpu': 10, 'vcpu_quota': 7, '...
'storage_usage': 5000 } """ service_settings = self.get_object() backend = service_settings.get_backend() try: stats = backend.get_stats() except ServiceBackendNotImplemented: stats = {} return Response(stats, status=status.HTTP_200_OK)
def list(self, request, *args, **kwargs): """ To get a list of supported resources' actions, run **OPTIONS** against */api/<resource_url>/* as an authenticated user. It is possible to filter and order by resource-specific fields, but this filters will be applied only to resources that support such filtering. For exampl...
do not support such option. Filter resources by type or category ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ There are two query argument to select resources by their type. - Specify explicitly list of resource types, for example: /api/<resource_endpoint>/?resource_type=DigitalOcean.Droplet&resource_type=OpenStack.Instance - ...
javascript "sla": { "value": 95.0 "agreed_value": 99.0, "period": "2016-03" } You may filter or order resources by SLA. Default period is current year and month. - Example query for filtering list of resources by actual SLA: /api/<resource_endpoint>/?actual_sla=90&period=2016-02 - Warning! If resource does not have SLA...
SLA: /api/<resource_endpoint>/?o=actual_sla&period=2016-02 Service list is displaying current SLAs for each of the items. By default, SLA period is set to the current month. To change the period pass it as a query argument: - ?period=YYYY-MM - return a list with SLAs for a given month - ?period=YYYY - return a list wit...
are returned, if SLA for the given period is not known or not present, it will be shown as **null** in the response. Resources may have monitoring items attached to it. Example rendering of monitoring items: .. code-block:: javascript "monitoring_items": { "application_state": 1 } You may filter or order resources by m...
/api/<resource_endpoint>/?monitoring__installation_state=1 - Warning! If resource does not have monitoring item attached to it, it is not included in ordered response. Example query for ordering list of resources by installation state: /api/<resource_endpoint>/?o=monitoring__installation_state Filtering by tags ^^^^^^^...
tag name, using method OR. Can be list. - ?rtag=os-family:linux - filter by full tag name, using AND method. Can be list. - ?tag__license-os=centos7 - filter by tags with particular prefix. Tags ordering: - ?o=tag__license-os - order by tag with particular prefix. Instances without given tag will not be returned. """ r...
def count(self, request): """ Count resources by type. Example output: .. code-block:: javascript { "Amazon.Instance": 0, "GitLab.Project": 3, "Azure.VirtualMachine": 0, "DigitalOcean.Droplet": 0, "OpenStack.Instance": 0, "GitLab.Group": 8 } """ queryset = self.filter_queryset(self.get_queryset()) return Response({Supp...
def list(self, request, *args, **kwargs): """ Filter services by type ^^^^^^^^^^^^^^^^^^^^^^^ It is possible to filter services by their types. Example: /api/services/?service_type=DigitalOcean&service_type=OpenStack """ return super(ServicesViewSet, self).list(request, *args, **kwargs)
def list(self, request, *args, **kwargs): """ To list all services without regard to its type, run **GET** against */api/services/* as an authenticated user. To list services of specific type issue **GET** to specific endpoint from a list above as a customer owner. Individual endpoint used for every service type. To cr...
a customer owner. Individual endpoint used for every service type. You can create service based on shared service settings. Example: .. code-block:: http POST /api/digitalocean/ HTTP/1.1 Content-Type: application/json Accept: application/json Authorization: Token c84d653b9ec92c6cbac41c706593e66f567a7fa4 Host: example.c...
example.com { "name": "My Oracle", "customer": "http://example.com/api/customers/1040561ca9e046d2b74268600c7e1105/", "backend_url": "https://oracle.example.com:7802/em", "username": "admin", "password": "secret" } """ return super(BaseServiceViewSet, self).list(request, *args, **kwargs)
def _require_staff_for_shared_settings(request, view, obj=None): """ Allow to execute action only if service settings are not shared or user is staff """ if obj is None: return if obj.settings.shared and not request.user.is_staff: raise PermissionDenied(_('Only staff users are allowed to import resources from shared se...
def link(self, request, uuid=None): """ To get a list of resources available for import, run **GET** against */<service_endpoint>/link/* as an authenticated user. Optionally project_uuid parameter can be supplied for services requiring it like OpenStack. To import (link with Waldur) resource issue **POST** against the ...
{ "backend_id": "bd5ec24d-9164-440b-a9f2-1b3c807c5df3", "project": "http://example.com/api/projects/e5f973af2eb14d2d8c38d62bcbaccb33/" } """ service = self.get_object() if self.request.method == 'GET': try: backend = self.get_backend(service) try: resources = backend.get_resources_for_import(**self.get_import_context()...
) return Response(serializer.data, status=status.HTTP_200_OK)
def unlink(self, request, uuid=None): """ Unlink all related resources, service project link and service itself. """ service = self.get_object() service.unlink_descendants() self.perform_destroy(service) return Response(status=status.HTTP_204_NO_CONTENT)
def list(self, request, *args, **kwargs): """ To get a list of connections between a project and an service, run **GET** against service_project_link_url as authenticated user. Note that a user can only see connections of a project where a user has a role. If service has `available_for_all` flag, project-service connec...
be linked to a project. To do that, **POST** a connection between project and a service to service_project_link_url as stuff user or customer owner. """ return super(BaseServiceProjectLinkViewSet, self).list(request, *args, **kwargs)
def retrieve(self, request, *args, **kwargs): """ To remove a link, issue **DELETE** to URL of the corresponding connection as stuff user or customer owner. """ return super(BaseServiceProjectLinkViewSet, self).retrieve(request, *args, **kwargs)
def get_aggregator_quotas(self, quota): """ Fetch ancestors quotas that have the same name and are registered as aggregator quotas. """ ancestors = quota.scope.get_quota_ancestors() aggregator_quotas = [] for ancestor in ancestors: for ancestor_quota_field in ancestor.get_quotas_fields(field_class=AggregatorQuotaField)...
def subscribe(self, handler): """Adds a new event handler.""" assert callable(handler), "Invalid handler %s" % handler self.handlers.append(handler)
def safe_trigger(self, *args): """*Safely* triggers the event by invoking all its handlers, even if few of them raise an exception. If a set of exceptions is raised during handler invocation sequence, this method rethrows the first one. :param args: the arguments to invoke event handlers with. """ error = None # iterat...
may mutate the list for handler in list(self.handlers): try: handler(*args) except BaseException as e: if error is None: prepare_for_reraise(e) error = e if error is not None: reraise(error)
def on(self, event, handler): """Attaches the handler to the specified event. @param event: event to attach the handler to. Any object can be passed as event, but string is preferable. If qcore.EnumBase instance is passed, its name is used as event key. @param handler: event handler. @return: self, so calls like this c...
def off(self, event, handler): """Detaches the handler from the specified event. @param event: event to detach the handler to. Any object can be passed as event, but string is preferable. If qcore.EnumBase instance is passed, its name is used as event key. @param handler: event handler. @return: self, so calls like thi...
def trigger(self, event, *args): """Triggers the specified event by invoking EventHook.trigger under the hood. @param event: event to trigger. Any object can be passed as event, but string is preferable. If qcore.EnumBase instance is passed, its name is used as event key. @param args: event arguments. @return: self, so...
def safe_trigger(self, event, *args): """Safely triggers the specified event by invoking EventHook.safe_trigger under the hood. @param event: event to trigger. Any object can be passed as event, but string is preferable. If qcore.EnumBase instance is passed, its name is used as event key. @param args: event arguments. ...
def get_or_create(self, event): """Gets or creates a new event hook for the specified event (key). This method treats qcore.EnumBase-typed event keys specially: enum_member.name is used as key instead of enum instance in case such a key is passed. Note that on/off/trigger/safe_trigger methods rely on this method, so yo...
EventHook())
def cancel_expired_invitations(invitations=None): """ Invitation lifetime must be specified in Waldur Core settings with parameter "INVITATION_LIFETIME". If invitation creation time is less than expiration time, the invitation will set as expired. """ expiration_date = timezone.now() - settings.WALDUR_CORE['INVITATION_...
def get_pseudo_abi_for_input(s, timeout=None, proxies=None): """ Lookup sighash from 4bytes.directory, create a pseudo api and try to decode it with the parsed abi. May return multiple results as sighashes may collide. :param s: bytes input :return: pseudo abi for method """ sighash = Utils.bytes_to_str(s[:4]) for pseu...
yield pseudo_abi except eth_abi.exceptions.DecodingError as e: continue
def _prepare_abi(self, jsonabi): """ Prepare the contract json abi for sighash lookups and fast access :param jsonabi: contracts abi in json format :return: """ self.signatures = {} for element_description in jsonabi: abi_e = AbiMethod(element_description) if abi_e["type"] == "constructor": self.signatures[b"__construc...
the sighash ourselves? requires keccak256 if abi_e.get("signature"): self.signatures[Utils.str_to_bytes(abi_e["signature"])] = abi_e elif abi_e["type"] == "event": self.signatures[b"__event__"] = abi_e else: raise Exception("Invalid abi type: %s - %s - %s" % (abi_e.get("type"), element_description, abi_e))
def describe_constructor(self, s): """ Describe the input bytesequence (constructor arguments) s based on the loaded contract abi definition :param s: bytes constructor arguments :return: AbiMethod instance """ method = self.signatures.get(b"__constructor__") if not method: # constructor not available m = AbiMethod({"t...
in types_def] if not len(s): values = len(types) * ["<nA>"] else: values = decode_abi(types, s) # (type, name, data) method.inputs = [{"type": t, "name": n, "data": v} for t, n, v in list( zip(types, names, values))] return method
def describe_input(self, s): """ Describe the input bytesequence s based on the loaded contract abi definition :param s: bytes input :return: AbiMethod instance """ signatures = self.signatures.items() for sighash, method in signatures: if sighash is None or sighash.startswith(b"__"): continue # skip constructor if s.s...
if not len(s): values = len(types) * ["<nA>"] else: values = decode_abi(types, s) # (type, name, data) method.inputs = [{"type": t, "name": n, "data": v} for t, n, v in list( zip(types, names, values))] return method else: method = AbiMethod({"type": "fallback", "name": "__fallback__", "inputs": [], "outputs": []}) typ...
in types_def] values = decode_abi(types, s) # (type, name, data) method.inputs = [{"type": t, "name": n, "data": v} for t, n, v in list( zip(types, names, values))] return method
def from_input_lookup(s): """ Return a new AbiMethod object from an input stream :param s: binary input :return: new AbiMethod object matching the provided input stream """ for pseudo_abi in FourByteDirectory.get_pseudo_abi_for_input(s): method = AbiMethod(pseudo_abi) types_def = pseudo_abi["inputs"] types = [t["type"]...
"data": v} for t, n, v in list( zip(types, names, values))] return method
def assert_is(expected, actual, message=None, extra=None): """Raises an AssertionError if expected is not actual.""" assert expected is actual, _assert_fail_message( message, expected, actual, "is not", extra )
def assert_is_not(expected, actual, message=None, extra=None): """Raises an AssertionError if expected is actual.""" assert expected is not actual, _assert_fail_message( message, expected, actual, "is", extra )
def assert_is_instance(value, types, message=None, extra=None): """Raises an AssertionError if value is not an instance of type(s).""" assert isinstance(value, types), _assert_fail_message( message, value, types, "is not an instance of", extra )
def assert_eq(expected, actual, message=None, tolerance=None, extra=None): """Raises an AssertionError if expected != actual. If tolerance is specified, raises an AssertionError if either - expected or actual isn't a number, or - the difference between expected and actual is larger than the tolerance. """ if tolerance ...
parameter to assert_eq must be a number: %r" % tolerance ) assert isinstance(expected, _number_types) and isinstance( actual, _number_types ), ( "parameters must be numbers when tolerance is specified: %r, %r" % (expected, actual) ) diff = abs(expected - actual) assert diff <= tolerance, _assert_fail_message( message, ...
def assert_dict_eq(expected, actual, number_tolerance=None, dict_path=[]): """Asserts that two dictionaries are equal, producing a custom message if they are not.""" assert_is_instance(expected, dict) assert_is_instance(actual, dict) expected_keys = set(expected.keys()) actual_keys = set(actual.keys()) assert expected_...
- expected_keys, ) for k in expected_keys: key_path = dict_path + [k] assert_is_instance( actual[k], type(expected[k]), extra="Types don't match for %s" % _dict_path_string(key_path), ) assert_is_instance( expected[k], type(actual[k]), extra="Types don't match for %s" % _dict_path_string(key_path), ) if isinstance(actu...
match for %s" % _dict_path_string(key_path), )
def assert_gt(left, right, message=None, extra=None): """Raises an AssertionError if left_hand <= right_hand.""" assert left > right, _assert_fail_message(message, left, right, "<=", extra)
def assert_ge(left, right, message=None, extra=None): """Raises an AssertionError if left_hand < right_hand.""" assert left >= right, _assert_fail_message(message, left, right, "<", extra)
def assert_lt(left, right, message=None, extra=None): """Raises an AssertionError if left_hand >= right_hand.""" assert left < right, _assert_fail_message(message, left, right, ">=", extra)