def DSQuery(dstype, objectname, attribute=None, node='.'):
  ds_path = '/%ss/%s' % (dstype.capitalize(), objectname)
  cmd = [_DSCL, '-plist', node, '-read', ds_path]
  if attribute:
    cmd.append(attribute)
  (stdout, stderr, returncode) = gmacpyutil.RunProcess(cmd)
  if returncode:
    raise DSException('Cannot query %s for %s: %s' % (ds_path,
                                                      attribute,
                                                      stderr))
  plist = NSString.stringWithString_(stdout).propertyList()
  if attribute:
    value = None
    if 'dsAttrTypeStandard:%s' % attribute in plist:
      value = plist['dsAttrTypeStandard:%s' % attribute]
    elif attribute in plist:
      value = plist[attribute]
    try:
      # We're copying to a new list to convert from NSCFArray
      return value[:]
    except TypeError:
      # ... unless we can't
      return value
  else:
    return plist
Looks for targetattr in AttributeList; returns value if found, null string otherwise.
dataset/ETHPy150Open google/macops/gmacpyutil/gmacpyutil/ds.py/DSQuery--crossover with--dataset/ETHPy150Open openeventdata/petrarch/petrarch/PETRreader.py/check_attribute