def _get_weight_from_block(persisted_block, block):
 if persisted_block:
  return persisted_block.weight
 else:
  return getattr(block, 'weight', None)

def _get_weight_from_block ( persisted_block , block ) : if persisted_block : return persisted_block . weight else : return getattr ( block , 'weight' , None )
returns the weighted value from the persisted_block if found .