import random
import math


def gamma(alpha=1):
    """
    Returns value greater than 0 from the gamma distribution 
    (https://en.wikipedia.org/wiki/Gamma_distribution).
    Parameter alpha controls the distribution's shape and should be a positive integer
    (if a non-integer is provided, the value is rounded.) When alpha=1, the 
    distribution is the same as exponential. As its value increases, the 
    probability density function becomes a curve with mean=alpha and standard 
    deviation = sqrt(alpha).
    """
    r = 1.0
    n = round(alpha)
    for i in range(n):
        r = r * (1 - random.random())
    return - math.log(r)