def get_percentage(a, b, i=False, r=False):
<EOL>if i is False and r is True:<EOL><INDENT>percentage = round(<NUM_LIT> * (float(a) / b), <NUM_LIT:2>)<EOL><DEDENT>elif (i is True and r is True) or (i is True and r is False):<EOL><INDENT>percentage = int(round(<NUM_LIT:100> * (float(a) / b)))<EOL>if r is False:<EOL><INDENT>warnings.warn(<EOL>"<STR_LIT>"<EOL>)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>percentage = <NUM_LIT> * (float(a) / b)<EOL><DEDENT>return percentage<EOL>
Finds the percentage of one number over another.

Args:
    a: The number that is a percent, int or float.

    b: The base number that a is a percent of, int or float.

    i: Optional boolean integer. True if the user wants the result returned as
    a whole number. Assumes False.

    r: Optional boolean round. True if the user wants the result rounded.
    Rounds to the second decimal point on floating point numbers. Assumes False.

Returns:
    The argument a as a percentage of b. Throws a warning if integer is set to True
    and round is set to False.