def get_mortgage_payment_per_frequency_to_per_annual(mortgage_payment, frequency):
assert isinstance(mortgage_payment, Money), '<STR_LIT>' % mortgage_payment<EOL>assert isinstance(frequency, Decimal), '<STR_LIT>' % frequency<EOL>if frequency == MORTGAGEKIT_ANNUAL:<EOL><INDENT>return mortgage_payment<EOL><DEDENT>elif frequency == MORTGAGEKIT_SEMI_ANNUAL:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_SEMI_ANNUAL)<EOL><DEDENT>elif frequency == MORTGAGEKIT_QUARTER:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_QUARTER)<EOL><DEDENT>elif frequency == MORTGAGEKIT_BI_MONTH:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_BI_MONTH)<EOL><DEDENT>elif frequency == MORTGAGEKIT_MONTH:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_MONTH)<EOL><DEDENT>elif frequency == MORTGAGEKIT_BI_WEEK:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_BI_WEEK)<EOL><DEDENT>elif frequency == MORTGAGEKIT_WEEK:<EOL><INDENT>return mortgage_payment * Decimal(MORTGAGEKIT_WEEK)<EOL><DEDENT>else:<EOL><INDENT>raise Exception("<STR_LIT>")<EOL><DEDENT>
Function will return the amount paid per payment standardized to
a per annual bases based on the "mortgage_payment" and "frequency"
parameters. In essence this function will take the mortgage payment at
the specific frequency to be per annual.