human
What is a the Python code you requested given the following:
I am working on the file "Setup/Imports.ipynb".
The first task is:
Distribution plot with inset option
Can you write Python code for it?
assistant
#Here is the Python code you requested.

def draw_dist(vec, split=None, ax=None, legend=True, colors=None,
              lim=None, tail='right', inset=False):
    """
    Draw a smooth distribution from data with an optional splitting factor.
    """
    _, ax = init_ax(ax)
    if split is None:
        split = pd.Series('s', index=vec.index)
        colors = {'s': colors} if colors is not None else None
        
    def get_dist(v):
        dist = smooth_dist(v)
        if tail is not None:
            dist = dist[lim:] if tail is 'right' else dist[:lim]
        return dist
    
    for l,v in vec.groupby(split):
        if colors is None:
            get_dist(v).plot(label=l, lw=2, ax=ax)
        else:
            get_dist(v).plot(label=l, lw=2, ax=ax, color=colors[l])
    if legend and len(split.unique()) > 1:
        ax.legend(loc='upper left', frameon=False)
    ax.set_yticks([])
    ax.set_xlabel(vec.name)
    ax.set_ylabel('probe density')

    
    if inset:
        a = axes([.4, .4, .5, .5])
        max_y = 0
        for l,v in vec.groupby(split):
            v = smooth_dist(v)
            if colors is None:

                a.plot(v.index, v, label=l, lw=2)
            else:
                a.plot(v.index, v, label=l, lw=2, color=colors[l])
            max_y = max(max_y, v.max())
        setp(a, yticks=[])
        a.set_xlabel(vec.name)
        a.set_ylabel('probe density')
        a.set_xlim(vec.min(), vec.max())
        a.set_ylim(0, max_y*1.03)
        a.axvspan(lim, 1, color='grey', alpha=.1)
    #ax.axvspan(0, 1, color='grey', alpha=.05)
    
def odds_ratio(a,b):
    ct = pd.crosstab(a,b).astype(float)
    r = (ct.ix[0,0] * ct.ix[1,1]) / (ct.ix[0,1] * ct.ix[1,0])
    return r