def get_by(session, model, pk_value, primary_key=None):
 result = query_by_primary_key(session, model, pk_value, primary_key)
 return result.first()

def get_by ( session , model , pk_value , primary_key = None ) : result = query_by_primary_key ( session , model , pk_value , primary_key ) return result . first ( )
returns the first instance of model whose primary key has the value pk_value .