<commit_before>"""Plotting functions for linear models (broadly construed)."""
from __future__ import division
import itertools
import warnings
import numpy as np
import pandas as pd
from scipy.spatial import distance
import statsmodels.api as sm
import statsmodels.formula.api as sf
import matplotlib as mpl
import matplotlib.pyplot as plt
import moss

from six.moves import range

from .utils import color_palette
from .axisgrid import FacetGrid


def lmplot(x, y, data, hue=None, col=None, row=None, palette="husl",
           col_wrap=None, size=5, aspect=1, sharex=True, sharey=True,
           col_order=None, row_order=None, hue_order=None,
           **kwargs):

    # Backwards-compatibility warning layer
    if "color" in kwargs:
        msg = "`color` is deprecated and will be removed; using `hue` instead."
        warnings.warn(msg, UserWarning)
        kwargs["hue"] = kwargs.pop("color")

    # Initialize the grid
    facets = FacetGrid(data, row, col, hue, palette=palette, row_order=row_order,
                       col_order=col_order, hue_order=hue_order,
                       size=size, aspect=aspect, col_wrap=col_wrap)

    # Hack to set the x limits properly, which needs to happen here
    # because the extent of the regression estimate is determined
    # by the limits of the plot<commit_msg>Fix lmplot color backcompat code<commit_after>"""Plotting functions for linear models (broadly construed)."""
from __future__ import division
import itertools
import warnings
import numpy as np
import pandas as pd
from scipy.spatial import distance
import statsmodels.api as sm
import statsmodels.formula.api as sf
import matplotlib as mpl
import matplotlib.pyplot as plt
import moss

from six.moves import range

from .utils import color_palette
from .axisgrid import FacetGrid


def lmplot(x, y, data, hue=None, col=None, row=None, palette="husl",
           col_wrap=None, size=5, aspect=1, sharex=True, sharey=True,
           col_order=None, row_order=None, hue_order=None,
           **kwargs):

    # Backwards-compatibility warning layer
    if "color" in kwargs:
        msg = "`color` is deprecated and will be removed; using `hue` instead."
        warnings.warn(msg, UserWarning)
        hue = kwargs.pop("color")

    # Initialize the grid
    facets = FacetGrid(data, row, col, hue, palette=palette, row_order=row_order,
                       col_order=col_order, hue_order=hue_order,
                       size=size, aspect=aspect, col_wrap=col_wrap)

    # Hack to set the x limits properly, which needs to happen here
    # because the extent of the regression estimate is determined
    # by the limits of the plot
{'fraction_non_alphanumeric': 0.07897705904475366, 'fraction_numerical': 0.001504324934185784, 'mean_word_length': 3.455611390284757, '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': '6402531', 'n_tokens_mistral': 807, 'n_tokens_neox': 772, 'n_words': 279}