<commit_before>from django.forms import widgets
from django.utils.safestring import mark_safe


class MapWidget(widgets.HiddenInput):
    def render(self, name, value, attrs=None):
        widget = super(MapWidget, self).render(name, value, attrs)
        return mark_safe("""<input name="geom" readonly="readonly" value="%s" type="text" id="id_geom" size="60">
                         <br>
                         <input type="button" value="Geocode Address" onclick=ecepAdmin.geocodeAddress()>
                         (<a onclick=ecepAdmin.mapHelp() href="#">?</a>)
                         <div id='map-help'></div><div id="map">%s</div>""" % (value, widget))
<commit_msg>Add comments to MapWidget class and MapWidget.render method<commit_after>from django.forms import widgets
from django.utils.safestring import mark_safe


class MapWidget(widgets.HiddenInput):
    """Custom map widget for displaying interactive google map to geocode
    addresses of learning centers.

    This widget displays a readonly input box to store lat+lng data, an empty
    help div, a map div for the google map, and a button to initiate geocoding.
    """

    def render(self, name, value, attrs=None):
        """Overrides the render method. This controls the actual html output of a form
        on the page

        See widget docs for more information:
        https://docs.djangoproject.com/en/1.4/ref/forms/widgets/
        """
        
        widget = super(MapWidget, self).render(name, value, attrs)
        return mark_safe("""<input name="geom" readonly="readonly" value="%s" type="text" id="id_geom" size="60">
                         <br>
                         <input type="button" value="Geocode Address" onclick=ecepAdmin.geocodeAddress()>
                         (<a onclick=ecepAdmin.mapHelp() href="#">?</a>)
                         <div id='map-help'></div><div id="map">%s</div>""" % (value, widget))

{'fraction_non_alphanumeric': 0.12871287128712872, 'fraction_numerical': 0.003126628452318916, 'mean_word_length': 2.7209302325581395, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 1, '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': '2949197', 'n_tokens_mistral': 559, 'n_tokens_neox': 535, 'n_words': 156}