23 """Common tasks and idioms performed with the Butler. 
   26 __all__ = [
"dataExists", 
"searchDataRefs"]
 
   30     """Find all data references for a partial data ID. 
   34     butler: `lsst.daf.persistence.Butler` 
   35         The repository to query for data. 
   37         The type of data references to return. 
   39         The level of data ID at which to search. If the empty string, the 
   40         default level for ``datasetType`` shall be used. 
   41     dataId : `lsst.daf.persistence.DataRef`, or `dict` from `str` to any 
   42         Butler identifier naming the data to be retrieved. If ommitted, an 
   43         unrestricted data ID shall be used. 
   47     dataRefs : iterable of `lsst.daf.persistence.ButlerDataRef` 
   48         Complete data references matching ``dataId``. Only references to 
   49         existing data shall be returned. 
   54     refList = butler.subset(datasetType=datasetType, level=level, dataId=dataId)
 
   57     return [dr 
for dr 
in refList 
if dataExists(dr)]
 
   61     """Determine if data exists at the current level or any data exists at a deeper level. 
   65     dataRef : `lsst.daf.persistence.ButlerDataRef` 
   66         Data reference to test for existence. 
   71         Return value is `True` if data exists, `False` otherwise. 
   73     subDRList = dataRef.subItems()
 
   75         for subDR 
in subDRList:
 
   80         return dataRef.datasetExists()