<commit_before>"""

"""

import datetime as dt

import pandas as pd
import geopandas as gp
from shapely.geometry.base import BaseGeometry
import numpy as np
import collections


TYPE_MAP = {
    np.complex256: None,
    np.complex128: None,
    np.complex64: None,
    np.void: None,
    np.timedelta64: dt.timedelta,
    np.datetime64: dt.datetime,
    np.float128: float,
    np.float64: float,
    np.float32: float,
    np.float16: float,
    np.uint64: int,
    np.uint32: int,
    np.uint16: int,
    np.uint8: int,
    np.int64: int,
    np.int32: int,
    np.int16: int,
    np.int8: int,
    np.unicode_: unicode,
    np.string_: str,
    np.bool_: bool,
    np.object_: object
}


class DataFrameUtils(object):
    @staticmethod
    def make_serializable(df):
        """
        :return: DataFrame which contains only exportable data (no objects)
        """
        df = pd.DataFrame(df.copy(True))
        for col in df.columns:
            temp = df[col].dropna()<commit_msg>try to make order predictable<commit_after>"""

"""

import datetime as dt

import pandas as pd
import geopandas as gp
from shapely.geometry.base import BaseGeometry
import numpy as np
import collections

import types


TYPE_MAP = {
    np.complex256: None,
    np.complex128: None,
    np.complex64: None,
    np.void: None,
    np.timedelta64: dt.timedelta,
    np.datetime64: dt.datetime,
    np.float128: float,
    np.float64: float,
    np.float32: float,
    np.float16: float,
    np.uint64: int,
    np.uint32: int,
    np.uint16: int,
    np.uint8: int,
    np.int64: int,
    np.int32: int,
    np.int16: int,
    np.int8: int,
    np.unicode_: unicode,
    np.string_: str,
    np.bool_: bool,
    np.object_: object
}


class DataFrameUtils(object):
    @staticmethod
    def make_serializable(df):
        """
        :return: DataFrame which contains only exportable data (no objects)
        """
        if isinstance(df, types.ListType):
            return map(DataFrameUtils.make_serializable, df)

        df = pd.DataFrame(df.copy(True))
        for col in df.columns:
            temp = df[col].dropna()
{'fraction_non_alphanumeric': 0.11121628017037388, 'fraction_numerical': 0.03312825366777094, 'mean_word_length': 2.5174708818635607, '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': '1873489', 'n_tokens_mistral': 781, 'n_tokens_neox': 722, 'n_words': 191}