<commit_before>import pylab as p
import matplotlib.numerix as nx
from matplotlib.toolkits.basemap import Basemap as Basemap_base
from matplotlib.collections import LineCollection
from matplotlib.colors import rgb2hex
import random
import shapelib

# add a "drawclimdivs" method for Basemap, which draws climate
# division boundaries.

# requires pyshapelib from Thuban (http://thuban.intevation.org/).
# cd to libraries/pyshapelib in Thuban source distribution, run
# 'python setup.py install'.

class Basemap(Basemap_base):

    def drawclimdivs(self,linewidth=0.5,color='k',antialiased=1,ax=None):
        """read in NCDC climate division boundaries and plot on map"""
        # open shapefile, read vertices for each object, convert
        # to map projection coordinates.
        shp = shapelib.ShapeFile('divisions')
        self.climdivsegs = []
        for npoly in range(shp.info()[0]):
            shp_object = shp.read_object(npoly)
            verts = shp_object.vertices()[0]
            lons = [lon for lon,lat in verts]
            lats = [lat for lon,lat in verts]
            x, y = self(lons,lats)
            self.climdivsegs.append(zip(x,y))
        # get current axes instance (if none specified).
        if ax is None and self.ax is None:
            try: 
                ax = p.gca()
            except:
                import pylab as p
                ax = p.gca()
        elif ax is None and self.ax is not None:
            ax = self.ax
        # make LineCollections for each polygon.
        lines = LineCollection(self.climdivsegs,antialiaseds=(antialiased,))
        lines.set_color(color)
        lines.set_linewidth(linewidth)
        ax.add_collection(lines)
        # make sure axis ticks are turned off
        if self.noticks == True:
            ax.set_xticks([])
            ax.set_yticks([])
        # set axes limits to fit map region.
        self.set_axes_limits(ax=ax)

# Lambert Conformal map of lower 48 region.
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
            resolution='l',projection='lcc',lat_1=33,lat_2=45,lon_0=-95)
fig=p.figure(figsize=(8,m.aspect*8))<commit_msg>minor cleanups.<commit_after>import pylab as p
import matplotlib.numerix as nx
from matplotlib.toolkits.basemap import Basemap as Basemap_base
from matplotlib.collections import LineCollection
from matplotlib.colors import rgb2hex
import random
from shapelib import ShapeFile

# add a "drawclimdivs" method for Basemap, which draws climate
# division boundaries.

# requires pyshapelib from Thuban (http://thuban.intevation.org/).
# cd to libraries/pyshapelib in Thuban source distribution, run
# 'python setup.py install'.

class Basemap(Basemap_base):

    def drawclimdivs(self,linewidth=0.5,color='k',antialiased=1,ax=None):
        """read in NCDC climate division boundaries and plot on map"""
        # open shapefile, read vertices for each object, convert
        # to map projection coordinates.
        shp = ShapeFile('divisions')
        self.climdivsegs = []
        for npoly in range(shp.info()[0]):
            shp_object = shp.read_object(npoly)
            verts = shp_object.vertices()[0]
            lons = [lon for lon,lat in verts]
            lats = [lat for lon,lat in verts]
            x, y = self(lons,lats)
            self.climdivsegs.append(zip(x,y))
        # get current axes instance (if none specified).
        if ax is None and self.ax is None:
            try: 
                ax = p.gca()
            except:
                import pylab as p
                ax = p.gca()
        elif ax is None and self.ax is not None:
            ax = self.ax
        # make LineCollections for each polygon.
        lines = LineCollection(self.climdivsegs,antialiaseds=(antialiased,))
        lines.set_color(color)
        lines.set_linewidth(linewidth)
        ax.add_collection(lines)
        # make sure axis ticks are turned off
        if self.noticks == True:
            ax.set_xticks([])
            ax.set_yticks([])
        # set axes limits to fit map region.
        self.set_axes_limits(ax=ax)

# Lambert Conformal map of lower 48 states.
m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
            projection='lcc',lat_1=33,lat_2=45,lon_0=-95)
fig=p.figure(figsize=(8,m.aspect*8))
{'fraction_non_alphanumeric': 0.09601491493824284, 'fraction_numerical': 0.013050570962479609, 'mean_word_length': 2.564784053156146, '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': '2814065', 'n_tokens_mistral': 1433, 'n_tokens_neox': 1372, 'n_words': 368}