def _kname(obj):
 if isinstance(obj, dict):
  return [obj.get('metadata', {}).get('name', '')]
 elif isinstance(obj, (list, tuple)):
  names = []
  for i in obj:
   names.append(i.get('metadata', {}).get('name', ''))
  return names
 else:
  return 'Unknown type'

def _kname ( obj ) : if isinstance ( obj , dict ) : return [ obj . get ( 'metadata' , { } ) . get ( 'name' , '' ) ] elif isinstance ( obj , ( list , tuple ) ) : names = [ ] for i in obj : names . append ( i . get ( 'metadata' , { } ) . get ( 'name' , '' ) ) return names else : return 'Unknown type'
get name or names out of json result from api server .