<commit_before>from maproulette import app
from flask.ext.restful import reqparse, fields, marshal, \
    marshal_with, Api, Resource
from flask.ext.restful.fields import Raw
from flask import session, make_response, request, abort
from maproulette.helpers import get_random_task,\
    get_challenge_or_404, get_task_or_404,\
    require_signedin, osmerror, challenge_exists,\
    task_exists
from maproulette.models import User, Challenge, Task, TaskGeometry, Action, db
from sqlalchemy.sql import func
from geoalchemy2.functions import ST_Buffer
from shapely.geometry.base import BaseGeometry
from shapely.geometry import asShape
import geojson
import json
import markdown


class ProtectedResource(Resource):
    """A Resource that requires the caller to be authenticated against OSM"""
    method_decorators = [require_signedin]


class PointField(Raw):
    """An encoded point"""

    def format(self, geometry):
        # if we get a linestring, take the first point,
        # else, just get the point.
        point = geometry.coords[0]
        return '%f|%f' % point


class MarkdownField(Raw):
    """Markdown text"""

    def format(self, text):
        return markdown.markdown(text)

challenge_summary = {
    'slug': fields.String,
    'title': fields.String,
    'difficulty': fields.Integer,
    'description': fields.String,
    'help': MarkdownField,
    'blurb': fields.String,
    'islocal': fields.Boolean
}

task_fields = {
    'identifier': fields.String(attribute='identifier'),
    'instruction': fields.String(attribute='instruction'),
    'location': PointField<commit_msg>adding current action to task marshal<commit_after>from maproulette import app
from flask.ext.restful import reqparse, fields, marshal, \
    marshal_with, Api, Resource
from flask.ext.restful.fields import Raw
from flask import session, make_response, request, abort
from maproulette.helpers import get_random_task,\
    get_challenge_or_404, get_task_or_404,\
    require_signedin, osmerror, challenge_exists,\
    task_exists
from maproulette.models import User, Challenge, Task, TaskGeometry, Action, db
from sqlalchemy.sql import func
from geoalchemy2.functions import ST_Buffer
from shapely.geometry.base import BaseGeometry
from shapely.geometry import asShape
import geojson
import json
import markdown


class ProtectedResource(Resource):
    """A Resource that requires the caller to be authenticated against OSM"""
    method_decorators = [require_signedin]


class PointField(Raw):
    """An encoded point"""

    def format(self, geometry):
        # if we get a linestring, take the first point,
        # else, just get the point.
        point = geometry.coords[0]
        return '%f|%f' % point


class MarkdownField(Raw):
    """Markdown text"""

    def format(self, text):
        return markdown.markdown(text)

challenge_summary = {
    'slug': fields.String,
    'title': fields.String,
    'difficulty': fields.Integer,
    'description': fields.String,
    'help': MarkdownField,
    'blurb': fields.String,
    'islocal': fields.Boolean
}

task_fields = {
    'identifier': fields.String(attribute='identifier'),
    'instruction': fields.String(attribute='instruction'),
    'location': PointField,
    'currentaction': fields.String
{'fraction_non_alphanumeric': 0.09723926380368098, 'fraction_numerical': 0.0049079754601227, 'mean_word_length': 4.234349919743178, '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': '6059251', 'n_tokens_mistral': 973, 'n_tokens_neox': 930, 'n_words': 282}