<commit_before>#!/usr/bin/env python
import numpy as _np
import matplotlib.pyplot as _plt
from addlabel import addlabel as _addlabel
from figure import _figure

def plot_featured(*args,**kwargs):
    """Wrapper for matplotlib.pyplot.plot()/errorbar().
    Example:  plot_featured(x,y,[arguments to matplotlib.pyplot.plot()/errorbar()],
            [toplabel=],[xlabel=],[ylabel=],
            [legend=],
            [error=]
            )
    """
    # Strip off options specific to plot_featured
    toplabel = kwargs.pop('toplabel',None)
    xlabel   = kwargs.pop('xlabel',None)
    ylabel   = kwargs.pop('ylabel',None)
    legend   = kwargs.pop('legend',None)
    error    = kwargs.pop('error',None)
    save     = kwargs.pop('save',False)
    figlabel = kwargs.pop('figlabel',None)
    fig      = kwargs.pop('fig',None)

    if not (figlabel == None):
        fig=_figure(figlabel)
    elif fig==None:
        try:
            fig=_plt.gcf()
        except:
            fig=_plt.fig()

    # Pass everything else to plot
    if ( error == None ):
        _plt.plot(*args,**kwargs)
    else:
        _plt.errorbar(*args,**kwargs)

    # Format plot as desired
    _addlabel(toplabel,xlabel,ylabel)
    if ( legend != None ):
        _plt.legend(legend)

    return fig<commit_msg>plot_featured passes along a figure to addlabel<commit_after>#!/usr/bin/env python
import numpy as _np
import matplotlib.pyplot as _plt
from addlabel import addlabel as _addlabel
from figure import _figure

def plot_featured(*args,**kwargs):
    """Wrapper for matplotlib.pyplot.plot()/errorbar().
    Example:  plot_featured(x,y,[arguments to matplotlib.pyplot.plot()/errorbar()],
            [toplabel=],[xlabel=],[ylabel=],
            [legend=],
            [error=]
            )
    """
    # Strip off options specific to plot_featured
    toplabel = kwargs.pop('toplabel',None)
    xlabel   = kwargs.pop('xlabel',None)
    ylabel   = kwargs.pop('ylabel',None)
    legend   = kwargs.pop('legend',None)
    error    = kwargs.pop('error',None)
    save     = kwargs.pop('save',False)
    figlabel = kwargs.pop('figlabel',None)
    fig      = kwargs.pop('fig',None)

    if not (figlabel == None):
        fig=_figure(figlabel)
    elif fig==None:
        try:
            fig=_plt.gcf()
        except:
            fig=_plt.fig()

    # Pass everything else to plot
    if ( error == None ):
        _plt.plot(*args,**kwargs)
    else:
        _plt.errorbar(*args,**kwargs)

    # Format plot as desired
    _addlabel(toplabel,xlabel,ylabel,fig=fig)
    if ( legend != None ):
        _plt.legend(legend)

    return fig
{'fraction_non_alphanumeric': 0.1357361963190184, 'fraction_numerical': 0.0, 'mean_word_length': 2.608575380359613, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6152880', 'n_tokens_mistral': 865, 'n_tokens_neox': 840, 'n_words': 179}