def _extract_meta(x, nonempty=False):
 if isinstance(x, (_Frame, Scalar)):
  return (x._meta_nonempty if nonempty else x._meta)
 elif isinstance(x, list):
  return [_extract_meta(_x, nonempty) for _x in x]
 elif isinstance(x, tuple):
  return tuple([_extract_meta(_x, nonempty) for _x in x])
 elif isinstance(x, dict):
  res = {}
  for k in x:
   res[k] = _extract_meta(x[k], nonempty)
  return res
 else:
  return x

def _extract_meta ( x , nonempty = False ) : if isinstance ( x , ( _Frame , Scalar ) ) : return ( x . _meta_nonempty if nonempty else x . _meta ) elif isinstance ( x , list ) : return [ _extract_meta ( _x , nonempty ) for _x in x ] elif isinstance ( x , tuple ) : return tuple ( [ _extract_meta ( _x , nonempty ) for _x in x ] ) elif isinstance ( x , dict ) : res = { } for k in x : res [ k ] = _extract_meta ( x [ k ] , nonempty ) return res else : return x
extract internal cache data from dd .