import numpy as np


def histeq(im, num_bins=256):
    """
    Performs an histogram equalization on ``img``.
    This was taken from:
    http://www.janeriksolem.net/2009/06/histogram-equalization-with-python-and.html

    Parameters
    ----------
    im : ndarray
        Image on which to perform histogram equalization.
    num_bins : int
        Number of bins used to construct the histogram.

    Returns
    -------
    result : ndarray
        Histogram equalized image.
    """
    #get image histogram
    histo, bins = np.histogram(im.flatten(), num_bins, normed=True)
    cdf = histo.cumsum()
    cdf = 255 * cdf / cdf[-1]

    #use linear interpolation of cdf to find new pixel values
    result = np.interp(im.flatten(), bins[:-1], cdf)

    return result.reshape(im.shape)

@@ -25,18 +25,19 @@
  histeq(
-im
+arr
 , num_bi
@@ -52,20 +52,16 @@
 %0A    %22%22%22
-%0A   
  Perform
@@ -97,11 +97,11 @@
 n %60%60
-img
+arr
 %60%60.%0A
@@ -244,18 +244,19 @@
 ---%0A    
-im
+arr
  : ndarr
@@ -536,18 +536,19 @@
 stogram(
-im
+arr
 .flatten
@@ -715,18 +715,19 @@
 .interp(
-im
+arr
 .flatten
@@ -773,18 +773,19 @@
 reshape(
-im
+arr
 .shape)%0A

Fix comment format and input var name.