<commit_before>from __future__ import print_function
import io
import itertools
import requests
import os
import sys
from copy import deepcopy
from collections import defaultdict
from lxml import etree
from cf_units import Unit
from netCDF4 import Dimension, Variable
from pkgutil import get_data
from pkg_resources import resource_filename

# copied from paegan
# paegan may depend on these later
_possiblet = ["time", "TIME", "Time",
              "t", "T",
              "ocean_time", "OCEAN_TIME",
              "jd", "JD",
              "dn", "DN",
              "times", "TIMES", "Times",
              "mt", "MT",
              "dt", "DT",
              ]
_possiblez = ["depth", "DEPTH",
              "depths", "DEPTHS",
              "height", "HEIGHT",
              "altitude", "ALTITUDE",
              "alt", "ALT",
              "Alt", "Altitude",
              "h", "H",
              "s_rho", "S_RHO",
              "s_w", "S_W",
              "z", "Z",
              "siglay", "SIGLAY",
              "siglev", "SIGLEV",
              "sigma", "SIGMA",
              "vertical", "VERTICAL", "lev", "LEV", "level", "LEVEL"
              ]
_possiblex = ["x", "X",
              "lon", "LON",
              "xlon", "XLON",
              "lonx", "lonx",
              "lon_u", "LON_U",
              "lon_v", "LON_V",
              "lonc", "LONC",
              "Lon", "Longitude",
              "longitude", "LONGITUDE",
              "lon_rho", "LON_RHO",
              "lon_psi", "LON_PSI",

              ]
_possibley = ["y", "Y",
              "lat", "LAT",
              "ylat", "YLAT",
              "laty", "laty",
              "lat_u", "LAT_U",
              "lat_v", "LAT_V",
              "latc", "LATC",
              "Lat", "Latitude",
              "latitude", "LATITUDE",
              "lat_rho", "LAT_RHO",
              "lat_psi", "LAT_PSI",

              ]

_possibleaxis = _possiblet + _possiblez + _possiblex + _possibley


_possiblexunits = ['degrees_east',
                   'degree_east',
                   'degrees_E',
                   'degree_E',
                   'degreesE',
                   'degreeE'
                   ]

_possibleyunits = ['degrees_north',
                   'degree_north',
                   'degrees_N',
                   'degree_N',
                   'degreesN',
                   'degreeN'
                   ]

_possibletunits = ['day',
                   'days',
                   'd',
                   'hour',
                   'hours',
                   'hr',
                   'hrs',
                   'h',
                   'year',
                   'years',
                   'minute',
                   'minutes',
                   'm',
                   'min',
                   'mins',
                   'second',
                   'seconds',
                   's',
                   'sec',
                   'secs'
                   ]

_possibleaxisunits = _possiblexunits + _possibleyunits + _possibletunits


class DotDict(dict):
    """
    Subclass of dict that will recursively look up attributes with dot notation.
    This is primarily for working with JSON-style data in a cleaner way like javascript.
    Note that this will instantiate a number of child DotDicts when you first access attributes;
    do not use in performance-critical parts of your code.
    """

    def __dir__(self):
        return list(self.__dict__.keys()) + list(self.keys())

    def __getattr__(self, key):
        """ Make attempts to lookup by nonexistent attributes also attempt key lookups. """
        if key in self:
            return self[key]
        import sys
        import dis
        frame = sys._getframe(1)
        if '\x00%c' % dis.opmap['STORE_ATTR'] in frame.f_code.co_code:
            self[key] = DotDict()
            return self[key]

        raise AttributeError(key)

    def __setattr__(self, key, value):
        if key in dir(dict):<commit_msg>Uses sets for coord variable possibilities<commit_after>from __future__ import print_function
import io
import itertools
import requests
import os
import sys
from copy import deepcopy
from collections import defaultdict
from lxml import etree
from cf_units import Unit
from netCDF4 import Dimension, Variable
from pkgutil import get_data
from pkg_resources import resource_filename

# copied from paegan
# paegan may depend on these later
_possiblet = {"time", "TIME", "Time",
              "t", "T",
              "ocean_time", "OCEAN_TIME",
              "jd", "JD",
              "dn", "DN",
              "times", "TIMES", "Times",
              "mt", "MT",
              "dt", "DT",
              }
_possiblez = {"depth", "DEPTH",
              "depths", "DEPTHS",
              "height", "HEIGHT",
              "altitude", "ALTITUDE",
              "alt", "ALT",
              "Alt", "Altitude",
              "h", "H",
              "s_rho", "S_RHO",
              "s_w", "S_W",
              "z", "Z",
              "siglay", "SIGLAY",
              "siglev", "SIGLEV",
              "sigma", "SIGMA",
              "vertical", "VERTICAL", "lev", "LEV", "level", "LEVEL"
              }
_possiblex = {"x", "X",
              "lon", "LON",
              "xlon", "XLON",
              "lonx", "lonx",
              "lon_u", "LON_U",
              "lon_v", "LON_V",
              "lonc", "LONC",
              "Lon", "Longitude",
              "longitude", "LONGITUDE",
              "lon_rho", "LON_RHO",
              "lon_psi", "LON_PSI",
              }
_possibley = {"y", "Y",
              "lat", "LAT",
              "ylat", "YLAT",
              "laty", "laty",
              "lat_u", "LAT_U",
              "lat_v", "LAT_V",
              "latc", "LATC",
              "Lat", "Latitude",
              "latitude", "LATITUDE",
              "lat_rho", "LAT_RHO",
              "lat_psi", "LAT_PSI",

              }

_possibleaxis = _possiblet | _possiblez | _possiblex | _possibley


_possiblexunits = {'degrees_east',
                   'degree_east',
                   'degrees_E',
                   'degree_E',
                   'degreesE',
                   'degreeE'
                   }

_possibleyunits = {'degrees_north',
                   'degree_north',
                   'degrees_N',
                   'degree_N',
                   'degreesN',
                   'degreeN'
                   }

_possibletunits = {'day',
                   'days',
                   'd',
                   'hour',
                   'hours',
                   'hr',
                   'hrs',
                   'h',
                   'year',
                   'years',
                   'minute',
                   'minutes',
                   'm',
                   'min',
                   'mins',
                   'second',
                   'seconds',
                   's',
                   'sec',
                   'secs'
                   }

_possibleaxisunits = _possiblexunits | _possibleyunits | _possibletunits


class DotDict(dict):
    """
    Subclass of dict that will recursively look up attributes with dot notation.
    This is primarily for working with JSON-style data in a cleaner way like javascript.
    Note that this will instantiate a number of child DotDicts when you first access attributes;
    do not use in performance-critical parts of your code.
    """

    def __dir__(self):
        return list(self.__dict__.keys()) + list(self.keys())

    def __getattr__(self, key):
        """ Make attempts to lookup by nonexistent attributes also attempt key lookups. """
        if key in self:
            return self[key]
        import sys
        import dis
        frame = sys._getframe(1)
        if '\x00%c' % dis.opmap['STORE_ATTR'] in frame.f_code.co_code:
            self[key] = DotDict()
            return self[key]

        raise AttributeError(key)

    def __setattr__(self, key, value):
        if key in dir(dict):
{'fraction_non_alphanumeric': 0.1221105527638191, 'fraction_numerical': 0.0010050251256281408, 'mean_word_length': 1.3068675746160534, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, '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': '4796958', 'n_tokens_mistral': 2366, 'n_tokens_neox': 2236, 'n_words': 596}