Did I find the right examples for you? yes no

All Samples(7)  |  Call(5)  |  Derive(0)  |  Import(2)
'obj' is an instance of 'classinfo', but is not a 'str' or 'bytes'
instance. 

        def is_container(obj, classinfo):
    """ 'obj' is an instance of 'classinfo', but is not a 'str' or 'bytes'
        instance. """
    if isinstance(obj, classinfo) and not isinstance(obj, (str, bytes)):
        return True
    return False
        


src/a/p/apitree-0.3.3/apitree/tree_scan.py   apitree(Download)
    APITreeStructureError,
    )
from .util import is_container
 
class RequestMethod(object):
    # ---------------------- Parse 'branch_location'. ----------------------
 
    if is_container(branch_location, Sequence):
        if all(
            [isinstance(item, RequestMethod) for item in branch_location]
    # ----------------------- Parse 'branch_object'. -----------------------
 
    if is_container(branch_obj, Sequence):
        try:
            return get_endpoints(branch_obj, complete_route)
def make_uppercase_tuple(value):
    if is_container(value, Sequence):
        return tuple([item.upper() for item in value])
    return tuple([value.upper()])
 

src/a/p/apitree-0.3.3/apitree/api_documentation.py   apitree(Download)
    get_endpoints,
    )
from .util import is_container
 
INDENT_STR = '    '
    def prepare(self, value):
        if is_container(value, Sequence):
            return self.prepare_list(value)
        if isinstance(value, Mapping):
            return self.prepare_dict(value)
    def prepare_listof(self, value):
        start, end = 'ListOf(', ')'
 
        iospec_obj = value.iospec_obj
        if is_container(iospec_obj, (Sequence, Mapping, ListOf)):