id stringlengths 28 33 | content stringlengths 14 265k ⌀ | max_stars_repo_path stringlengths 49 55 |
|---|---|---|
crossvul-python_data_bad_2105_1 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2105_1 |
crossvul-python_data_bad_2940_0 | # coding: utf-8
"""
mistune
~~~~~~~
The fastest markdown parser in pure Python with renderer feature.
:copyright: (c) 2014 - 2017 by Hsiaoming Yang.
"""
import re
import inspect
__version__ = '0.8'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__all__ = [
'BlockGrammar', 'BlockLexer',
'Inli... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2940_0 |
crossvul-python_data_good_3890_2 | # Generated by Django 3.0.4 on 2020-04-06 09:46
from django.db import migrations
import wagtail.core.blocks
import wagtail.core.fields
import wagtail.tests.testapp.models
class Migration(migrations.Migration):
dependencies = [
('tests', '0046_personpage'),
]
operations = [
migrations.Al... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3890_2 |
crossvul-python_data_good_2940_0 | # coding: utf-8
"""
mistune
~~~~~~~
The fastest markdown parser in pure Python with renderer feature.
:copyright: (c) 2014 - 2017 by Hsiaoming Yang.
"""
import re
import inspect
__version__ = '0.8.1'
__author__ = 'Hsiaoming Yang <me@lepture.com>'
__all__ = [
'BlockGrammar', 'BlockLexer',
'In... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2940_0 |
crossvul-python_data_good_1735_1 | from Products.CMFCore.URLTool import URLTool as BaseTool
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from App.class_init import InitializeClass
from Products.CMFPlone.PloneBaseTool import PloneBaseTool
from posixpath import normpath
from urlparse import urlparse, urljoi... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1735_1 |
crossvul-python_data_bad_5788_0 | import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse, NoReverseMatch
fr... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5788_0 |
crossvul-python_data_bad_2104_9 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2104_9 |
crossvul-python_data_good_5790_0 | from __future__ import with_statement
import os
import re
import urllib
from django.conf import settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolver... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5790_0 |
crossvul-python_data_good_2104_9 | # encoding:utf-8
"""
:synopsis: views "read-only" for main textual content
By main textual content is meant - text of Questions, Answers and Comments.
The "read-only" requirement here is not 100% strict, as for example "question" view does
allow adding new comments via Ajax form post.
"""
import datetime
import loggin... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2104_9 |
crossvul-python_data_bad_2105_2 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2105_2 |
crossvul-python_data_good_453_0 | """A cleanup tool for HTML.
Removes unwanted tags and content. See the `Cleaner` class for
details.
"""
import re
import copy
try:
from urlparse import urlsplit
from urllib import unquote_plus
except ImportError:
# Python 3
from urllib.parse import urlsplit, unquote_plus
from lxml import etree
from l... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_453_0 |
crossvul-python_data_good_1644_9 | """Tornado handlers for the sessions web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import web
from ...base.handlers import APIHandler, json_errors
from IPython.utils.jsonutil import date_default
from IPython.html.utils i... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_9 |
crossvul-python_data_bad_447_0 | """Tornado handlers for nbconvert."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import zipfile
from tornado import web, escape
from tornado.log import app_log
from ..base.handlers import (
IPythonHandler, FilesRedirectHandler,
pa... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_447_0 |
crossvul-python_data_good_1091_0 | from typing import Optional, Tuple
from django.utils.translation import ugettext as _
from django.conf import settings
from django.core.files import File
from django.http import HttpRequest
from django.db.models import Sum
from jinja2 import Markup as mark_safe
import unicodedata
from zerver.lib.avatar_hash import us... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1091_0 |
crossvul-python_data_good_4097_3 | # -*- coding: utf-8 -*-
from wagtail.core.models import Page
from wagtail.tests.testapp.models import (
FormField, FormFieldWithCustomSubmission, FormPage, FormPageWithCustomSubmission,
FormPageWithRedirect, RedirectFormField)
def make_form_page(**kwargs):
kwargs.setdefault('title', "Contact us")
kwar... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_4097_3 |
crossvul-python_data_good_5191_3 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
import tempfile
from django import forms
from django.conf.urls import url
from django.contrib import admin
from django.contrib.admin import BooleanFieldListFilter
from django.contrib.admin.views.main import ChangeList
from django.contrib.auth.a... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5191_3 |
crossvul-python_data_bad_2103_9 | 404: Not Found | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2103_9 |
crossvul-python_data_good_3890_0 | import difflib
from bs4 import BeautifulSoup
from django.utils.encoding import force_str
from django.utils.html import escape, format_html, format_html_join
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from wagtail.core im... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3890_0 |
crossvul-python_data_good_3530_2 | from django import template
from django.conf import settings
from django.db.models import Q
from django.template import NodeList, TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils import simplejson
from django.utils.html import escape
from django.utils.translation import ugettext... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3530_2 |
crossvul-python_data_good_2196_0 | import cgi
import socketio
import traceback
from ajenti.http import HttpHandler
from ajenti.api import BasePlugin, plugin, persistent, rootcontext
from ajenti.api.http import HttpPlugin, SocketPlugin
from ajenti.plugins import manager
from ajenti.profiler import *
class SocketIORouteHandler (HttpHandler):
def __... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2196_0 |
crossvul-python_data_good_4097_1 | from collections import OrderedDict
import django.forms
from django.conf import settings
from django.utils.html import conditional_escape
from django.utils.translation import gettext_lazy as _
from wagtail.admin.forms import WagtailAdminPageForm
from wagtail.contrib.forms.utils import get_field_clean_name
class Bas... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_4097_1 |
crossvul-python_data_bad_3147_0 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - feed some FCKeditor dialogues
@copyright: 2005-2006 Bastian Blank, Florian Festi, Thomas Waldmann
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import config, wikiutil
from MoinMoin.action.AttachFile import _get_files
from MoinMoin.Page import Pa... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_3147_0 |
crossvul-python_data_bad_1091_0 | from typing import Dict, Optional, Tuple
from django.utils.translation import ugettext as _
from django.conf import settings
from django.core.files import File
from django.http import HttpRequest
from django.db.models import Sum
from jinja2 import Markup as mark_safe
import unicodedata
from zerver.lib.avatar_hash imp... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1091_0 |
crossvul-python_data_bad_1728_0 | # coding: utf-8
"""A tornado based Jupyter notebook server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
import base64
import datetime
import errno
import importlib
import io
import json
import logging
i... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1728_0 |
crossvul-python_data_good_2105_1 | import re
import random
import datetime
from django.utils.translation import ugettext as _
from django.utils.translation import ungettext
from django.utils.html import escape
def get_from_dict_or_object(source, key):
try:
return source[key]
except:
return getattr(source, key)
def enumerate_st... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2105_1 |
crossvul-python_data_good_1644_1 | """Tornado handlers for cluster web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import web
from ...base.handlers import APIHandler
#-----------------------------------------------------------------------------
# Cluster h... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_1 |
crossvul-python_data_good_4389_0 | from typing import Any, List
import bleach
from .rest_api import ValidationError
allowed_tags_strict = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # te... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_4389_0 |
crossvul-python_data_good_4208_1 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - Multiple configuration handler and Configuration defaults class
@copyright: 2000-2004 Juergen Hermann <jh@web.de>,
2005-2008 MoinMoin:ThomasWaldmann.
2008 MoinMoin:JohannesBerg
@license: GNU GPL, see COPYING for details.
"""
... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_4208_1 |
crossvul-python_data_bad_1644_4 | """Tornado handlers for kernels."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import logging
from tornado import gen, web
from tornado.concurrent import Future
from tornado.ioloop import IOLoop
from IPython.utils.jsonutil import date_default
from... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_4 |
crossvul-python_data_bad_1644_6 | """Tornado handlers for kernel specifications."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import json
import os
pjoin = os.path.join
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
from ...utils import url_path... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_6 |
crossvul-python_data_bad_41_0 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_41_0 |
crossvul-python_data_bad_1644_9 | """Tornado handlers for the sessions web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
from IPython.utils.jsonutil import date_default
from IPython.html.uti... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_9 |
crossvul-python_data_good_1727_0 | # coding: utf-8
"""A tornado based IPython notebook server."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import base64
import datetime
import errno
import importlib
import io
import json
import logging
import os
import r... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1727_0 |
crossvul-python_data_good_447_0 | """Tornado handlers for nbconvert."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
import io
import os
import zipfile
from tornado import web, escape
from tornado.log import app_log
from ..base.handlers import (
IPythonHandler, FilesRedirectHandler,
pa... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_447_0 |
crossvul-python_data_good_5191_1 | from __future__ import unicode_literals
import os
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import (
HttpRequest, HttpResponse, HttpResponseNotFound, build_request_repr,
)
from django.template import Context, Engin... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5191_1 |
crossvul-python_data_bad_5525_1 | ##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5525_1 |
crossvul-python_data_bad_4389_0 | from typing import Any, List
import bleach
from .rest_api import ValidationError
allowed_tags_strict = [
"a",
"img", # links and images
"br",
"p",
"span",
"blockquote", # text layout
"strike",
"del",
"ins",
"strong",
"u",
"em",
"sup",
"sub",
"pre", # te... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_4389_0 |
crossvul-python_data_good_1644_7 | import json
from tornado import web
from ...base.handlers import APIHandler, json_errors
class NbconvertRootHandler(APIHandler):
SUPPORTED_METHODS = ('GET',)
@web.authenticated
@json_errors
def get(self):
try:
from IPython.nbconvert.exporters.export import exporter_map
ex... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_7 |
crossvul-python_data_bad_4953_0 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_4953_0 |
crossvul-python_data_bad_5788_1 | from __future__ import unicode_literals
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from email.utils import formatdate
fro... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5788_1 |
crossvul-python_data_bad_5191_1 | from __future__ import unicode_literals
import os
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import (
HttpRequest, HttpResponse, HttpResponseNotFound, build_request_repr,
)
from django.template import Context, Engin... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5191_1 |
crossvul-python_data_bad_5729_0 | """
Form Widget classes specific to the Django admin site.
"""
from __future__ import unicode_literals
import copy
from django import forms
from django.contrib.admin.templatetags.admin_static import static
from django.core.urlresolvers import reverse
from django.forms.widgets import RadioFieldRenderer
from django.for... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5729_0 |
crossvul-python_data_good_1644_6 | """Tornado handlers for kernel specifications."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import glob
import json
import os
pjoin = os.path.join
from tornado import web
from ...base.handlers import APIHandler, json_errors
from ...utils import url_path_joi... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_6 |
crossvul-python_data_bad_3149_0 | # -*-python-*-
#
# Copyright (C) 1999-2016 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_3149_0 |
crossvul-python_data_bad_1456_0 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1456_0 |
crossvul-python_data_good_3890_3 | import hashlib
import json
import os
import uuid
from django import forms
from django.conf import settings
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.core.exceptions import ValidationError
from django.core.paginator import Emp... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3890_3 |
crossvul-python_data_bad_5790_0 | from __future__ import with_statement
import os
import re
import urllib
from django.conf import settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolver... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5790_0 |
crossvul-python_data_good_5788_0 | import os
import re
from django.conf import global_settings, settings
from django.contrib.sites.models import Site, RequestSite
from django.contrib.auth.models import User
from django.core import mail
from django.core.exceptions import SuspiciousOperation
from django.core.urlresolvers import reverse, NoReverseMatch
fr... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5788_0 |
crossvul-python_data_bad_5190_1 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5190_1 |
crossvul-python_data_bad_1735_1 | from Products.CMFCore.URLTool import URLTool as BaseTool
from Products.CMFCore.utils import getToolByName
from AccessControl import ClassSecurityInfo
from App.class_init import InitializeClass
from Products.CMFPlone.PloneBaseTool import PloneBaseTool
from posixpath import normpath
from urlparse import urlparse, urljoi... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1735_1 |
crossvul-python_data_bad_1644_2 | """Tornado handlers for frontend config storage."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import io
import errno
from tornado import web
from IPython.utils.py3compat import PY3
from ...base.handlers import IPythonHandler, json_errors... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_2 |
crossvul-python_data_bad_1644_7 | import json
from tornado import web
from ...base.handlers import IPythonHandler, json_errors
class NbconvertRootHandler(IPythonHandler):
SUPPORTED_METHODS = ('GET',)
@web.authenticated
@json_errors
def get(self):
try:
from IPython.nbconvert.exporters.export import exporter_map
... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_7 |
crossvul-python_data_bad_2186_0 | #
# djblets_js.py -- JavaScript-related template tags
#
# Copyright (c) 2007-2009 Christian Hammond
# Copyright (c) 2007-2009 David Trowbridge
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Softw... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2186_0 |
crossvul-python_data_good_40_0 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2016-2018 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free S... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_40_0 |
crossvul-python_data_good_5789_1 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from binascii import Error... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5789_1 |
crossvul-python_data_bad_4097_1 | from collections import OrderedDict
import django.forms
from django.utils.translation import gettext_lazy as _
from wagtail.admin.forms import WagtailAdminPageForm
from wagtail.contrib.forms.utils import get_field_clean_name
class BaseForm(django.forms.Form):
def __init__(self, *args, **kwargs):
kwargs.... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_4097_1 |
crossvul-python_data_good_1456_0 | #
# Copyright (c) 2008--2015 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a c... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1456_0 |
crossvul-python_data_good_5190_1 | from __future__ import unicode_literals
import re
import sys
import types
from django.conf import settings
from django.core.urlresolvers import Resolver404, resolve
from django.http import HttpResponse, HttpResponseNotFound
from django.template import Context, Engine, TemplateDoesNotExist
from django.template.default... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5190_1 |
crossvul-python_data_good_3149_0 | # -*-python-*-
#
# Copyright (C) 1999-2016 The ViewCVS Group. All Rights Reserved.
#
# By using this file, you agree to the terms and conditions set forth in
# the LICENSE.html file which can be found at the top level of the ViewVC
# distribution or at http://viewvc.org/license-1.html.
#
# For more information, visit h... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3149_0 |
crossvul-python_data_bad_2188_0 | #
# gravatars.py -- Decorational template tags
#
# Copyright (c) 2008-2009 Christian Hammond
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limita... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2188_0 |
crossvul-python_data_good_1644_2 | """Tornado handlers for frontend config storage."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
import os
import io
import errno
from tornado import web
from IPython.utils.py3compat import PY3
from ...base.handlers import APIHandler, json_errors
cl... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_2 |
crossvul-python_data_good_1728_0 | # coding: utf-8
"""A tornado based Jupyter notebook server."""
# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import absolute_import, print_function
import base64
import datetime
import errno
import importlib
import io
import json
import logging
i... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1728_0 |
crossvul-python_data_bad_5191_4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
import uuid
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from d... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5191_4 |
crossvul-python_data_good_1644_0 | """Base Tornado handlers for the notebook server."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import functools
import json
import logging
import os
import re
import sys
import traceback
try:
# py3
from http.client import responses
except ImportError:... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_0 |
crossvul-python_data_good_2188_0 | #
# gravatars.py -- Decorational template tags
#
# Copyright (c) 2008-2009 Christian Hammond
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limita... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2188_0 |
crossvul-python_data_bad_1644_3 | """Tornado handlers for the contents web service."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import json
from tornado import gen, web
from IPython.html.utils import url_path_join, url_escape
from IPython.utils.jsonutil import date_default
from IPython.ht... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_3 |
crossvul-python_data_bad_5789_1 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
try:
from urllib import parse as urllib_parse
except ImportError: # Python 2
import urllib as urllib_parse
import urlparse
urllib_parse.urlparse = urlparse.urlparse
from binascii import Error... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5789_1 |
crossvul-python_data_good_5510_1 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities, xmlEntities
from .. import utils
from xml.sax.saxutils import escape
spaceCharacters = "".j... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5510_1 |
crossvul-python_data_good_3147_0 | # -*- coding: iso-8859-1 -*-
"""
MoinMoin - feed some FCKeditor dialogues
@copyright: 2005-2006 Bastian Blank, Florian Festi, Thomas Waldmann
@license: GNU GPL, see COPYING for details.
"""
from MoinMoin import config, wikiutil
from MoinMoin.action.AttachFile import _get_files
from MoinMoin.Page import Pa... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_3147_0 |
crossvul-python_data_good_2186_0 | #
# djblets_js.py -- JavaScript-related template tags
#
# Copyright (c) 2007-2009 Christian Hammond
# Copyright (c) 2007-2009 David Trowbridge
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Softw... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2186_0 |
crossvul-python_data_good_1645_0 | """Base Tornado handlers for the notebook.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as p... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1645_0 |
crossvul-python_data_good_2103_9 | # encoding:utf-8
"""
:synopsis: views "read-only" for main textual content
By main textual content is meant - text of Questions, Answers and Comments.
The "read-only" requirement here is not 100% strict, as for example "question" view does
allow adding new comments via Ajax form post.
"""
import datetime
import loggin... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2103_9 |
crossvul-python_data_bad_3530_2 | from django import template
from django.conf import settings
from django.db.models import Q
from django.template import NodeList, TemplateSyntaxError
from django.template.loader import render_to_string
from django.utils import simplejson
from django.utils.translation import ugettext_lazy as _
from djblets.util.decorato... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_3530_2 |
crossvul-python_data_bad_453_0 | """A cleanup tool for HTML.
Removes unwanted tags and content. See the `Cleaner` class for
details.
"""
import re
import copy
try:
from urlparse import urlsplit
except ImportError:
# Python 3
from urllib.parse import urlsplit
from lxml import etree
from lxml.html import defs
from lxml.html import fromstr... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_453_0 |
crossvul-python_data_good_5790_1 | import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5790_1 |
crossvul-python_data_bad_5510_1 | from __future__ import absolute_import, division, unicode_literals
from six import text_type
import re
from ..constants import voidElements, booleanAttributes, spaceCharacters
from ..constants import rcdataElements, entities, xmlEntities
from .. import utils
from xml.sax.saxutils import escape
spaceCharacters = "".j... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5510_1 |
crossvul-python_data_good_1644_8 | """Tornado handlers for security logging."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import gen, web
from ...base.handlers import APIHandler, json_errors
from . import csp_report_uri
class CSPReportHandler(APIHandler):
'''Accepts a conten... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_1644_8 |
crossvul-python_data_bad_1644_10 | import json
from tornado import web, gen
from ..base.handlers import IPythonHandler, json_errors
from ..utils import url_path_join
class TerminalRootHandler(IPythonHandler):
@web.authenticated
@json_errors
def get(self):
tm = self.terminal_manager
terms = [{'name': name} for name in tm.term... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_10 |
crossvul-python_data_bad_3890_0 | import difflib
from bs4 import BeautifulSoup
from django.utils.encoding import force_str
from django.utils.html import escape, format_html, format_html_join
from django.utils.safestring import mark_safe
from django.utils.text import capfirst
from django.utils.translation import ugettext_lazy as _
from wagtail.core im... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_3890_0 |
crossvul-python_data_good_5525_1 | ##############################################################################
#
# Copyright (c) 2002 Zope Corporation and Contributors. All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5525_1 |
crossvul-python_data_good_4953_0 | from __future__ import unicode_literals
import base64
import calendar
import datetime
import re
import sys
import unicodedata
from binascii import Error as BinasciiError
from email.utils import formatdate
from django.utils import six
from django.utils.datastructures import MultiValueDict
from django.utils.encoding im... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_4953_0 |
crossvul-python_data_bad_4097_3 | # -*- coding: utf-8 -*-
from wagtail.core.models import Page
from wagtail.tests.testapp.models import (
FormField, FormFieldWithCustomSubmission, FormPage, FormPageWithCustomSubmission,
FormPageWithRedirect, RedirectFormField)
def make_form_page(**kwargs):
kwargs.setdefault('title', "Contact us")
kwar... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_4097_3 |
crossvul-python_data_good_5191_4 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import datetime
import os
import tempfile
import uuid
from django.contrib.auth.models import User
from django.contrib.contenttypes.fields import (
GenericForeignKey, GenericRelation,
)
from django.contrib.contenttypes.models import ContentType
from d... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_5191_4 |
crossvul-python_data_bad_1644_8 | """Tornado handlers for security logging."""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from tornado import gen, web
from ...base.handlers import IPythonHandler, json_errors
from . import csp_report_uri
class CSPReportHandler(IPythonHandler):
'''Accepts ... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1644_8 |
crossvul-python_data_good_2105_2 | """
:synopsis: most ajax processors for askbot
This module contains most (but not all) processors for Ajax requests.
Not so clear if this subdivision was necessary as separation of Ajax and non-ajax views
is not always very clean.
"""
import datetime
import logging
from bs4 import BeautifulSoup
from django.conf import... | ./CrossVul/dataset_final_sorted/CWE-79/py/good_2105_2 |
crossvul-python_data_bad_1091_1 | # -*- coding: utf-8 -*-
from django.http import HttpRequest, HttpResponse, HttpResponseForbidden, \
HttpResponseNotFound
from django.shortcuts import redirect
from django.utils.translation import ugettext as _
from zerver.lib.response import json_success, json_error
from zerver.lib.upload import upload_message_im... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_1091_1 |
crossvul-python_data_bad_5790_1 | import calendar
import datetime
import re
import sys
import urllib
import urlparse
from email.utils import formatdate
from django.utils.datastructures import MultiValueDict
from django.utils.encoding import smart_str, force_unicode
from django.utils.functional import allow_lazy
ETAG_MATCH = re.compile(r'(?:W/)?"((?:\... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_5790_1 |
crossvul-python_data_bad_2196_0 | import socketio
import traceback
from ajenti.http import HttpHandler
from ajenti.api import BasePlugin, plugin, persistent, rootcontext
from ajenti.api.http import HttpPlugin, SocketPlugin
from ajenti.plugins import manager
from ajenti.profiler import *
class SocketIORouteHandler (HttpHandler):
def __init__(self... | ./CrossVul/dataset_final_sorted/CWE-79/py/bad_2196_0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.