def inspectObject(item,name='<top>',max_depth=5,verbose=False,print_depth=0,info=None):
    if max_depth < 0:
        return
    
    if not verbose and name[:2] == '__':
        return
    if 'function' in str(type(item)):
        return
    if 'method' in str(type(item)):
        return
    
    if info == None:
        info = pv.Table()
        info.setColumnFormat('name','%s')
        print dir(info)
    i = info.nRows()

    info[i,'name'] = ('    '*print_depth) + name
    try:
        
        # Add info about the type
        type_name = str(getTypeName(item))
        if len(type_name) > 30:
            type_name = type_name[:27]+'...'
        info[i,'type'] = type_name
    
        value = " ".join(repr(item).split())
        if len(value) > 30:
            value = value[:27]+'...'
        info[i,'value'] = value
        
        try:
            item_size = len(pkl.dumps(item, protocol=2))
        except:
            item_size = 'error'
            
        info[i,'pickle size'] = item_size
        
        if type_name in ['int','float','str']:
            return info
        if type_name.startswith('ndarray'):
            return info
        
        for each in dir(item):
            inspectObject(getattr(item,each),name=each,max_depth=max_depth-1,verbose=verbose,print_depth=print_depth+1,info=info)
            
    
        if isinstance(item,list) or isinstance(item,tuple):
            processed_types = set()
            for each in item:
                if type(each) in processed_types:
                    continue
                processed_types.add(type(each))
                inspectObject(each,name='<sample item>',max_depth=max_depth-1,verbose=verbose,print_depth=print_depth+1,info=info)
                
        if isinstance(item,dict):
            processed_types = set()
            for key,each in item.iteritems():
                if type(each) in processed_types:
                    continue
                processed_types.add(type(each))
                inspectObject(each,name='<sample item>',max_depth=max_depth-1,verbose=verbose,print_depth=print_depth+1,info=info)
    except:
        info[i,'error'] = "Could not process this object."    
    return info
Reads artifact definitions from a file-like object.
dataset/ETHPy150Open bolme/pyvision/src/pyvision/__init__.py/inspectObject--crossover with--dataset/ETHPy150Open ForensicArtifacts/artifacts/artifacts/reader.py/YamlArtifactsReader.ReadFileObject