def iplot_histogram(data, figsize=None, number_to_keep=None,<EOL>sort='<STR_LIT>', legend=None):
<EOL>html_template = Template("""<STR_LIT>""")<EOL>javascript_template = Template("""<STR_LIT>""")<EOL>div_number = str(time.time())<EOL>div_number = re.sub('<STR_LIT>', '<STR_LIT>', div_number)<EOL>if figsize is None:<EOL><INDENT>figsize = (<NUM_LIT:7>, <NUM_LIT:5>)<EOL><DEDENT>options = {'<STR_LIT>': <NUM_LIT:0> if number_to_keep is None else number_to_keep,<EOL>'<STR_LIT>': sort,<EOL>'<STR_LIT>': <NUM_LIT:0>,<EOL>'<STR_LIT:width>': int(figsize[<NUM_LIT:0>]),<EOL>'<STR_LIT>': int(figsize[<NUM_LIT:1>])}<EOL>if legend:<EOL><INDENT>options['<STR_LIT>'] = <NUM_LIT:1><EOL><DEDENT>data_to_plot = []<EOL>if isinstance(data, dict):<EOL><INDENT>data = [data]<EOL><DEDENT>if legend and len(legend) != len(data):<EOL><INDENT>raise VisualizationError("<STR_LIT>"<EOL>"<STR_LIT>" %<EOL>(len(legend), len(data)))<EOL><DEDENT>for item, execution in enumerate(data):<EOL><INDENT>exec_data = process_data(execution, options['<STR_LIT>'])<EOL>out_dict = {'<STR_LIT:data>': exec_data}<EOL>if legend:<EOL><INDENT>out_dict['<STR_LIT:name>'] = legend[item]<EOL><DEDENT>data_to_plot.append(out_dict)<EOL><DEDENT>html = html_template.substitute({<EOL>'<STR_LIT>': div_number<EOL>})<EOL>javascript = javascript_template.substitute({<EOL>'<STR_LIT>': div_number,<EOL>'<STR_LIT>': data_to_plot,<EOL>'<STR_LIT>': options<EOL>})<EOL>display(HTML(html + javascript))<EOL>
Create a histogram representation.

        Graphical representation of the input array using a vertical bars
        style graph.

        Args:
            data (list or dict):  This is either a list of dicts or a single
                dict containing the values to represent (ex. {'001' : 130})
            figsize (tuple): Figure size in pixels.
            number_to_keep (int): The number of terms to plot and
                rest is made into a single bar called other values
            sort (string): Could be 'asc' or 'desc'
            legend (list): A list of strings to use for labels of the data.
                The number of entries must match the length of data.
        Raises:
            VisualizationError: When legend is provided and the length doesn't
                match the input data.