def get_repository_by_id(app, id):
 if is_tool_shed_client(app):
  return app.install_model.context.query(app.install_model.ToolShedRepository).get(app.security.decode_id(id))
 else:
  sa_session = app.model.context.current
  return sa_session.query(app.model.Repository).get(app.security.decode_id(id))

def get_repository_by_id ( app , id ) : if is_tool_shed_client ( app ) : return app . install_model . context . query ( app . install_model . ToolShedRepository ) . get ( app . security . decode_id ( id ) ) else : sa_session = app . model . context . current return sa_session . query ( app . model . Repository ) . get ( app . security . decode_id ( id ) )
get a repository from the database via id .