Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _is_consumer_class(c):
return utils.is_subclass(c, interfaces.Consumer)
def _client_class_handler(key):
if utils.is_subclass(key, interfaces.HttpClientAdapter):
return key()
def _get_schema(cls, type_):
if utils.is_subclass(type_, cls.marshmallow.Schema):
return type_()
elif isinstance(type_, cls.marshmallow.Schema):
return type_
raise ValueError("Expected marshmallow.Scheme subclass or instance.")
def _is_relevant(self, type_, argument_annotations, method_annotations):
return (
utils.is_subclass(type_, self._model_class) and
self._contains_annotations(argument_annotations, method_annotations)
)
def _is_annotation(annotation):
cls = interfaces.Annotation
return utils.is_subclass(annotation, cls) or isinstance(annotation, cls)