def _get_score_from_persisted_or_latest_block(persisted_block, block, weight):
 raw_earned = 0.0
 attempted = False
 if persisted_block:
  raw_possible = persisted_block.raw_possible
 else:
  raw_possible = block.transformer_data[GradesTransformer].max_score
 if (raw_possible is None):
  weighted_scores = (None, None)
 else:
  weighted_scores = weighted_score(raw_earned, raw_possible, weight)
 return (((raw_earned, raw_possible) + weighted_scores) + (attempted,))

def _get_score_from_persisted_or_latest_block ( persisted_block , block , weight ) : raw_earned = 0.0 attempted = False if persisted_block : raw_possible = persisted_block . raw_possible else : raw_possible = block . transformer_data [ GradesTransformer ] . max_score if ( raw_possible is None ) : weighted_scores = ( None , None ) else : weighted_scores = weighted_score ( raw_earned , raw_possible , weight ) return ( ( ( raw_earned , raw_possible ) + weighted_scores ) + ( attempted , ) )
returns the score values .