parameters: (session, model, primary_key_value, primary_key=None)
return_statement: return query.filter(getattr(model, pk_name) == primary_key_value)
docstring: Returns a SQLAlchemy query object containing the result of querying
      `model` for instances whose primary key has the value `primary_key_value`.
  
      If `primary_key` is specified, the column specified by that string is used
      as the primary key column. Otherwise, the column named ``id`` is used.
  
      Presumably, the returned query should have at most one element.
docstring_summary: Returns a SQLAlchemy query object containing the result of querying
      `model` for instances whose primary key has the value `primary_key_value`.
docstring_tokens: Returns a SQLAlchemy query object containing the result of querying model for instances whose primary key has the value primary_key_value .
function: def query_by_primary_key(session, model, primary_key_value, primary_key=None):
      """Returns a SQLAlchemy query object containing the result of querying
      `model` for instances whose primary key has the value `primary_key_value`.
  
      If `primary_key` is specified, the column specified by that string is used
      as the primary key column. Otherwise, the column named ``id`` is used.
  
      Presumably, the returned query should have at most one element.
  
      """
      pk_name = primary_key or primary_key_name(model)
      query = session_query(session, model)
      return query.filter(getattr(model, pk_name) == primary_key_value)
function_tokens: def query_by_primary_key ( session , model , primary_key_value , primary_key = None ) : pk_name = primary_key or primary_key_name ( model ) query = session_query ( session , model ) return query . filter ( getattr ( model , pk_name ) == primary_key_value )