# Path: sciunit/base.py
# PLATFORM = sys.platform
# PYTHON_MAJOR_VERSION = sys.version_info.major
# class Config(dict):
# class Versioned(object):
# class SciUnit(Versioned):
# class TestWeighted(object):
# class SciUnitHandler(BaseHandler):
# class QuantitiesHandler(BaseHandler):
# class UnitQuantitiesHandler(BaseHandler):
#     def __init__(self, *args, **kwargs):
#     def path(self):
#     def path(self, val):
#     def __getitem__(self, key):
#     def get(self, key, default=None, update_from_disk=True):
#     def set(self, key, val):
#     def __setitem__(self, key, val):
#     def get_from_disk(self):
#     def create(self, data: dict = None) -> bool:
#     def load(self):
#     def save(self):
#     def get_repo(self, cached: bool = True) -> Repo:
#     def get_version(self, cached: bool = True) -> str:
#     def get_remote(self, remote_name: str = "origin", **kwargs) -> Remote:
#     def get_remote_url(self, remote: str = "origin", cached: bool = True) -> str:
#     def __init__(self):
#     def __getstate__(self) -> dict:
#     def properties(self, keys: list = None, exclude: list = None) -> dict:
#     def property_names(self) -> list:
#     def json(
#         self, add_props: bool = True, string: bool = True, unpicklable: bool = False, make_refs: bool = False) -> str:
#     def diff(self, other, add_props=False):
#     def hash(self, serialization: str = None) -> str:
#     def _class(self) -> dict:
#     def url(self) -> str:
#     def get_list_attr_with_bases(self, attr: str) -> list:
#     def weights(self) -> List[float]:
# def deep_exclude(state: dict, exclude: list) -> dict:
# def log(*args, **kwargs):
# def strip_html(html):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def simplify(self, d):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def flatten(self, obj, data):
#     def restore(self, data):
# 
# Path: sciunit/errors.py
# class CapabilityNotImplementedError(CapabilityError):
#     """Error raised when a required capability is not *implemented* by a model.
#     Do not use for capabilities that are not provided at all."""
# 
#     action = "implement"


import dis
import inspect
import io
import re
import sys
import warnings
from .base import SciUnit, log, logger
from .errors import CapabilityNotImplementedError
        from sciunit import Model
                sys.stdout = io.StringIO()

                dis.dis(getattr(cls, method))

                dis_output = sys.stdout.getvalue()
                sys.stdout = stdout

                dis_output = re.split("\n|\s+", dis_output)
                dis_output = [word for word in dis_output if word]

                if (
                    "(NotImplementedError)" in dis_output
                    or "(unimplemented)" in dis_output
                    or "(CapabilityNotImplementedError)" in dis_output
                    or "(NotImplemented)" in dis_output
                ):
                    cap_source = inspect.getsource(getattr(cls, method))
                    model_source = inspect.getsource(getattr(model, method))

                    if cap_source == model_source:
                        source_capable = False
                        break

            except OSError:
                warnings.warn(
                    """Inspect cannot get the source, and it is not guaranteed that 
                    all required methods have been implemented by the model"""
                )
                break


# Path: sciunit/base.py
# PLATFORM = sys.platform
# PYTHON_MAJOR_VERSION = sys.version_info.major
# class Config(dict):
# class Versioned(object):
# class SciUnit(Versioned):
# class TestWeighted(object):
# class SciUnitHandler(BaseHandler):
# class QuantitiesHandler(BaseHandler):
# class UnitQuantitiesHandler(BaseHandler):
#     def __init__(self, *args, **kwargs):
#     def path(self):
#     def path(self, val):
#     def __getitem__(self, key):
#     def get(self, key, default=None, update_from_disk=True):
#     def set(self, key, val):
#     def __setitem__(self, key, val):
#     def get_from_disk(self):
#     def create(self, data: dict = None) -> bool:
#     def load(self):
#     def save(self):
#     def get_repo(self, cached: bool = True) -> Repo:
#     def get_version(self, cached: bool = True) -> str:
#     def get_remote(self, remote_name: str = "origin", **kwargs) -> Remote:
#     def get_remote_url(self, remote: str = "origin", cached: bool = True) -> str:
#     def __init__(self):
#     def __getstate__(self) -> dict:
#     def properties(self, keys: list = None, exclude: list = None) -> dict:
#     def property_names(self) -> list:
#     def json(
#         self, add_props: bool = True, string: bool = True, unpicklable: bool = False, make_refs: bool = False) -> str:
#     def diff(self, other, add_props=False):
#     def hash(self, serialization: str = None) -> str:
#     def _class(self) -> dict:
#     def url(self) -> str:
#     def get_list_attr_with_bases(self, attr: str) -> list:
#     def weights(self) -> List[float]:
# def deep_exclude(state: dict, exclude: list) -> dict:
# def log(*args, **kwargs):
# def strip_html(html):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def simplify(self, d):
#     def flatten(self, obj, data):
#     def restore(self, data):
#     def flatten(self, obj, data):
#     def restore(self, data):
# 
# Path: sciunit/errors.py
# class CapabilityNotImplementedError(CapabilityError):
#     """Error raised when a required capability is not *implemented* by a model.
#     Do not use for capabilities that are not provided at all."""
# 
#     action = "implement"


# Path: sciunit/capabilities.py
import dis
import inspect
import io
import re
import sys
import warnings
from .base import SciUnit, log, logger
from .errors import CapabilityNotImplementedError
        from sciunit import Model

                sys.stdout = io.StringIO()

                dis.dis(getattr(cls, method))

                dis_output = sys.stdout.getvalue()
                sys.stdout = stdout

                dis_output = re.split("\n|\s+", dis_output)
                dis_output = [word for word in dis_output if word]

                if (
                    "(NotImplementedError)" in dis_output
                    or "(unimplemented)" in dis_output
                    or "(CapabilityNotImplementedError)" in dis_output
                    or "(NotImplemented)" in dis_output
                ):
                    cap_source = inspect.getsource(getattr(cls, method))
                    model_source = inspect.getsource(getattr(model, method))

                    if cap_source == model_source:
                        source_capable = False
                        break

            except OSError:
                warnings.warn(
                    """Inspect cannot get the source, and it is not guaranteed that 
                    all required methods have been implemented by the model"""
                )
                break


        return source_capable