def _get_repo(**kwargs):
 for key in ('fromrepo', 'repo'):
  try:
   return kwargs[key]
  except KeyError:
   pass
 return ''

def _get_repo ( ** kwargs ) : for key in ( 'fromrepo' , 'repo' ) : try : return kwargs [ key ] except KeyError : pass return ''
check the kwargs for either fromrepo or repo and return the value .