def _get_cpv(cp, installed=True):
 if installed:
  return _get_portage().db[portage.root]['vartree'].dep_bestmatch(cp)
 else:
  return _porttree().dep_bestmatch(cp)

def _get_cpv ( cp , installed = True ) : if installed : return _get_portage ( ) . db [ portage . root ] [ 'vartree' ] . dep_bestmatch ( cp ) else : return _porttree ( ) . dep_bestmatch ( cp )
add version to category/package @cp - name of package in format category/name @installed - boolean value .