def get_repository_by_name_and_owner(app, name, owner):
 repository_query = get_repository_query(app)
 if is_tool_shed_client(app):
  return repository_query.filter(and_((app.install_model.ToolShedRepository.table.c.name == name), (app.install_model.ToolShedRepository.table.c.owner == owner))).first()
 user = common_util.get_user_by_username(app, owner)
 if user:
  return repository_query.filter(and_((app.model.Repository.table.c.name == name), (app.model.Repository.table.c.user_id == user.id))).first()
 return None

def get_repository_by_name_and_owner ( app , name , owner ) : repository_query = get_repository_query ( app ) if is_tool_shed_client ( app ) : return repository_query . filter ( and_ ( ( app . install_model . ToolShedRepository . table . c . name == name ) , ( app . install_model . ToolShedRepository . table . c . owner == owner ) ) ) . first ( ) user = common_util . get_user_by_username ( app , owner ) if user : return repository_query . filter ( and_ ( ( app . model . Repository . table . c . name == name ) , ( app . model . Repository . table . c . user_id == user . id ) ) ) . first ( ) return None
get a repository from the database via name and owner .