id
stringlengths
28
33
content
stringlengths
14
265k
max_stars_repo_path
stringlengths
49
55
crossvul-python_data_good_3500_4
import os from subprocess import Popen, PIPE import Bcfg2.Server.Plugin # for debugging output only import logging logger = logging.getLogger('Bcfg2.Plugins.Svn') class Svn(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Version): """Svn is a version plugin for dealing with Bcfg2 repos.""" name = '...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3500_4
crossvul-python_data_bad_1065_1
# Copyright (C) 2002-2007 Python Software Foundation # Contact: email-sig@python.org """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ __all__ = [ 'mktime_tz', 'parsedate', 'parsedate_tz', 'quote', ] import time, calendar SPACE = ' ' EMPTYS...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1065_1
crossvul-python_data_bad_652_0
from __future__ import unicode_literals from itertools import chain import re import string import six from xml.sax.saxutils import unescape import html5lib from html5lib.constants import ( entities, namespaces, prefixes, tokenTypes, ) try: from html5lib.constants import ReparseException except Im...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_652_0
crossvul-python_data_good_2141_1
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/good_2141_1
crossvul-python_data_good_1232_0
### # Copyright (c) 2019, Valentin Lorentz # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, # this list of conditi...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1232_0
crossvul-python_data_good_3766_1
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-20/py/good_3766_1
crossvul-python_data_bad_3768_2
import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.shortcuts import render_to_response from django.template import RequestContext from django.utils.http import base36_to_int from django.utils.translation impo...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3768_2
crossvul-python_data_good_3660_1
# Copyright 2011 OpenStack LLC. # Copyright 2012 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/license...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3660_1
crossvul-python_data_good_2156_0
# # The Python Imaging Library. # $Id$ # # Mac OS X icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_2156_0
crossvul-python_data_bad_1376_3
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1376_3
crossvul-python_data_good_872_3
""" Helpers for URI and method injection tests. @see: U{CVE-2019-12387} """ import string UNPRINTABLE_ASCII = ( frozenset(range(0, 128)) - frozenset(bytearray(string.printable, 'ascii')) ) NONASCII = frozenset(range(128, 256)) class MethodInjectionTestsMixin(object): """ A mixin that runs HTTP m...
./CrossVul/dataset_final_sorted/CWE-20/py/good_872_3
crossvul-python_data_bad_2816_2
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth import salt.crypt import salt.uti...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2816_2
crossvul-python_data_good_1739_0
"""Serve files directly from the ContentsManager.""" # Copyright (c) IPython Development Team. # Distributed under the terms of the Modified BSD License. import os import mimetypes import json import base64 from tornado import web from IPython.html.base.handlers import IPythonHandler class FilesHandler(IPythonHand...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1739_0
crossvul-python_data_bad_50_6
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) cornelius kölbel, privacyidea.org # # 2018-01-22 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add offline refill # 2016-12-20 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add triggerchallenge endpoint # 2016-10-23 Corneli...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_50_6
crossvul-python_data_good_1467_1
# coding: UTF-8 '''Mock D-BUS objects for test suites.''' # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the Free # Software Foundation; either version 3 of the License, or (at your option) any # later version. See h...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1467_1
crossvul-python_data_good_1232_1
### # Copyright (c) 2002-2004, Jeremiah Fincher # Copyright (c) 2008-2009, James McCoy # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1232_1
crossvul-python_data_bad_3659_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3659_0
crossvul-python_data_bad_3767_3
from __future__ import absolute_import, unicode_literals import copy import datetime from email.header import Header import os import re import sys import time import warnings from io import BytesIO from pprint import pformat try: from urllib.parse import quote, parse_qsl, urlencode, urljoin, urlparse except Impo...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3767_3
crossvul-python_data_good_3766_2
import urlparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.template.response import TemplateResponse from django.utils.http import base36_to_int from django.utils.translation import ugettext as _ from django.views.de...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3766_2
crossvul-python_data_bad_8_0
from importlib import import_module from os import path, listdir from string import lower from debug import logger import paths class MsgBase(object): def encode(self): self.data = {"": lower(type(self).__name__)} def constructObject(data): try: classBase = eval(data[""] + "." + data[""].tit...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_8_0
crossvul-python_data_bad_3767_0
from django.conf.urls import patterns, url from django.contrib.auth import context_processors from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required from django.contrib.messages.api import info from django.http impo...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3767_0
crossvul-python_data_bad_2078_2
#!/usr/bin/env python from __future__ import division, absolute_import, print_function __all__ = ['run_main', 'compile', 'f2py_testing'] import os import sys import subprocess from . import f2py2e from . import f2py_testing from . import diagnose from .info import __doc__ run_main = f2py2e.run_main main = f2py2e.m...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2078_2
crossvul-python_data_good_872_1
# -*- test-case-name: twisted.web.test.test_webclient,twisted.web.test.test_agent -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ HTTP client. """ from __future__ import division, absolute_import import os import collections import warnings try: from urlparse import urlunparse, u...
./CrossVul/dataset_final_sorted/CWE-20/py/good_872_1
crossvul-python_data_good_1800_0
# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2014 Jean-Marc Martins # Copyright © 2014-2015 Guillaume Ayoub # # This library 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 Softw...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1800_0
crossvul-python_data_good_100_0
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017 Vector Creations Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
./CrossVul/dataset_final_sorted/CWE-20/py/good_100_0
crossvul-python_data_good_2141_0
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/good_2141_0
crossvul-python_data_good_3523_0
import datetime from StringIO import StringIO from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.serializers import json from django.utils import simplejson from django.utils.encoding import force_unicode from tastypie.bundle import Bundle from tastypie.exceptions ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3523_0
crossvul-python_data_good_2078_2
#!/usr/bin/env python from __future__ import division, absolute_import, print_function __all__ = ['run_main', 'compile', 'f2py_testing'] import os import sys import subprocess from . import f2py2e from . import f2py_testing from . import diagnose from .info import __doc__ run_main = f2py2e.run_main main = f2py2e.m...
./CrossVul/dataset_final_sorted/CWE-20/py/good_2078_2
crossvul-python_data_bad_117_3
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils @six.add_metacla...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_117_3
crossvul-python_data_bad_5568_1
# packet.py # # Copyright 2002-2005,2007 Wichert Akkerman <wichert@wiggy.net> # # A RADIUS packet as defined in RFC 2138 import struct import random try: import hashlib md5_constructor = hashlib.md5 except ImportError: # BBB for python 2.4 import md5 md5_constructor = md5.new import six from pyrad...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_5568_1
crossvul-python_data_bad_100_1
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_100_1
crossvul-python_data_bad_2141_2
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2141_2
crossvul-python_data_bad_3766_0
from django.conf.urls import patterns, url from django.contrib.auth import context_processors from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required from django.contrib.messages.api import info from django.http impo...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3766_0
crossvul-python_data_bad_3723_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # no...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3723_0
crossvul-python_data_good_3767_0
from django.conf.urls import patterns, url from django.contrib.auth import context_processors from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required from django.contrib.messages.api import info from django.http impo...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3767_0
crossvul-python_data_good_8_0
from importlib import import_module from os import path, listdir from string import lower from debug import logger import paths class MsgBase(object): def encode(self): self.data = {"": lower(type(self).__name__)} def constructObject(data): try: m = import_module("messagetypes." + data[""]) ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_8_0
crossvul-python_data_good_3499_4
import os import pipes from subprocess import Popen, PIPE import Bcfg2.Server.Plugin # for debugging output only import logging logger = logging.getLogger('Bcfg2.Plugins.Svn') class Svn(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Version): """Svn is a version plugin for dealing with Bcfg2 repos."""...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3499_4
crossvul-python_data_bad_50_7
# -*- coding: utf-8 -*- # # (c) Cornelius Kölbel # License: AGPLv3 # contact: http://www.privacyidea.org # # This code is free software; you can redistribute it and/or # modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE # License as published by the Free Software Foundation; either # version 3 of ...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_50_7
crossvul-python_data_good_50_5
# -*- coding: utf-8 -*- # # privacyIDEA documentation build configuration file, created by # sphinx-quickstart on Fri Jun 13 07:31:01 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
./CrossVul/dataset_final_sorted/CWE-20/py/good_50_5
crossvul-python_data_bad_3767_1
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.urlresolvers import reverse, NoReverseMatch from django.http import QueryDict from django.utils.encod...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3767_1
crossvul-python_data_good_3659_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3659_0
crossvul-python_data_bad_3499_1
404: Not Found
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3499_1
crossvul-python_data_bad_3683_0
# Copyright 2012, Piston Cloud Computing, Inc. # Copyright 2012, OpenStack LLC. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3683_0
crossvul-python_data_bad_117_2
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function from cryptography import utils from cryptography.exceptions import Invali...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_117_2
crossvul-python_data_bad_3660_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3660_0
crossvul-python_data_good_3768_0
from django.conf.urls.defaults import patterns from django.contrib.auth.urls import urlpatterns from django.contrib.auth.views import password_reset from django.contrib.auth.decorators import login_required from django.http import HttpResponse from django.template import Template, RequestContext from django.views.decor...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3768_0
crossvul-python_data_bad_1740_2
"""Tornado handlers for the contents web service. Preliminary documentation at https://github.com/ipython/ipython/wiki/IPEP-27%3A-Contents-Service """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import json from tornado import gen, web from notebook.utils im...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1740_2
crossvul-python_data_good_3659_1
# Copyright 2011 OpenStack LLC. # Copyright 2012 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/license...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3659_1
crossvul-python_data_good_5582_1
import os import os.path import mimetypes import requests from zope.interface import implements from pyramid.interfaces import ITemplateRenderer class ReleaseFileRenderer(object): implements(ITemplateRenderer) def __init__(self, repository_root): self.repository_root = repository_root def __cal...
./CrossVul/dataset_final_sorted/CWE-20/py/good_5582_1
crossvul-python_data_good_3767_3
from __future__ import absolute_import, unicode_literals import copy import datetime from email.header import Header import os import re import sys import time import warnings from io import BytesIO from pprint import pformat try: from urllib.parse import quote, parse_qsl, urlencode, urljoin, urlparse except Impo...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3767_3
crossvul-python_data_bad_1800_0
404: Not Found
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1800_0
crossvul-python_data_good_50_8
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os import stat import sys #VERSION="2.1dev4" VERSION="2.23.2" # Taken from kennethreitz/requests/setup.py package_directory = os.path.realpath(os.path.dirname(__file__)) def get_file_contents(file_path): """Get the context of the file us...
./CrossVul/dataset_final_sorted/CWE-20/py/good_50_8
crossvul-python_data_bad_2141_0
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2141_0
crossvul-python_data_bad_50_8
# -*- coding: utf-8 -*- from setuptools import setup, find_packages import os import stat import sys #VERSION="2.1dev4" VERSION="2.23.1" # Taken from kennethreitz/requests/setup.py package_directory = os.path.realpath(os.path.dirname(__file__)) def get_file_contents(file_path): """Get the context of the file us...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_50_8
crossvul-python_data_good_802_0
# -*- coding: utf-8 -*- # Copyright 2014-2015 OpenMarket Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
./CrossVul/dataset_final_sorted/CWE-20/py/good_802_0
crossvul-python_data_bad_1740_1
"""A contents manager that uses the local file system for storage.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import io import os import shutil import mimetypes import nbformat from tornado import web from .filecheckpoints import FileCheckpoints from .fi...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1740_1
crossvul-python_data_good_3500_3
import Bcfg2.Server.Plugin import Bcfg2.Options import lxml.etree import posixpath import tempfile import pipes import os from subprocess import Popen, PIPE, STDOUT # Compatibility import from Bcfg2.Bcfg2Py3k import ConfigParser class SSLCA(Bcfg2.Server.Plugin.GroupSpool): """ The SSLCA generator handles the ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3500_3
crossvul-python_data_good_3499_1
"""This module implements a config file repository.""" __revision__ = '$Revision$' import binascii import logging import lxml import os import re import tempfile from subprocess import Popen, PIPE import Bcfg2.Server.Plugin logger = logging.getLogger('Bcfg2.Plugins.Cfg') def process_delta(data, delta): if not d...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3499_1
crossvul-python_data_good_3499_2
import os from mercurial import ui, hg import Bcfg2.Server.Plugin # for debugging output only import logging logger = logging.getLogger('Bcfg2.Plugins.Mercurial') class Hg(Bcfg2.Server.Plugin.Plugin, Bcfg2.Server.Plugin.Version): """Mercurial is a version plugin for dealing with Bcfg2 repository.""" ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3499_2
crossvul-python_data_good_117_3
# This file is dual licensed under the terms of the Apache License, Version # 2.0, and the BSD License. See the LICENSE file in the root of this repository # for complete details. from __future__ import absolute_import, division, print_function import abc import six from cryptography import utils @six.add_metacla...
./CrossVul/dataset_final_sorted/CWE-20/py/good_117_3
crossvul-python_data_good_3768_3
import datetime import os import re import time from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin, urlparse try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: # The mod_python version is more efficient, so try importing it fir...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3768_3
crossvul-python_data_good_3766_3
from __future__ import absolute_import import datetime import os import re import sys import time import warnings from pprint import pformat from urllib import urlencode, quote from urlparse import urljoin, urlparse try: from cStringIO import StringIO except ImportError: from StringIO import StringIO try: ...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3766_3
crossvul-python_data_bad_2141_4
# (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) any lat...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2141_4
crossvul-python_data_bad_2156_0
# # The Python Imaging Library. # $Id$ # # Mac OS X icns file decoder, based on icns.py by Bob Ippolito. # # history: # 2004-10-09 fl Turned into a PIL plugin; removed 2.3 dependencies. # # Copyright (c) 2004 by Bob Ippolito. # Copyright (c) 2004 by Secret Labs. # Copyright (c) 2004 by Fredrik Lundh. # Copyright (c) ...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2156_0
crossvul-python_data_good_5568_1
# packet.py # # Copyright 2002-2005,2007 Wichert Akkerman <wichert@wiggy.net> # # A RADIUS packet as defined in RFC 2138 import struct import random try: import hashlib md5_constructor = hashlib.md5 except ImportError: # BBB for python 2.4 import md5 md5_constructor = md5.new import six from pyrad...
./CrossVul/dataset_final_sorted/CWE-20/py/good_5568_1
crossvul-python_data_bad_3268_2
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3268_2
crossvul-python_data_bad_100_0
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017 Vector Creations Ltd # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICEN...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_100_0
crossvul-python_data_good_2816_2
# -*- coding: utf-8 -*- ''' Zeromq transport classes ''' # Import Python Libs from __future__ import absolute_import import os import sys import copy import errno import signal import hashlib import logging import weakref from random import randint # Import Salt Libs import salt.auth import salt.crypt import salt.uti...
./CrossVul/dataset_final_sorted/CWE-20/py/good_2816_2
crossvul-python_data_bad_3660_1
# Copyright 2011 OpenStack LLC. # Copyright 2012 Justin Santa Barbara # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/license...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3660_1
crossvul-python_data_good_3768_1
import os import re import urllib from django.conf import settings from django.contrib.auth import SESSION_KEY, REDIRECT_FIELD_NAME from django.contrib.auth.forms import AuthenticationForm from django.contrib.sites.models import Site, RequestSite from django.contrib.auth.models import User from django.test import Test...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3768_1
crossvul-python_data_good_1740_2
"""Tornado handlers for the contents web service. Preliminary documentation at https://github.com/ipython/ipython/wiki/IPEP-27%3A-Contents-Service """ # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import json from tornado import gen, web from notebook.utils im...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1740_2
crossvul-python_data_good_50_6
# -*- coding: utf-8 -*- # # http://www.privacyidea.org # (c) cornelius kölbel, privacyidea.org # # 2018-01-22 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add offline refill # 2016-12-20 Cornelius Kölbel <cornelius.koelbel@netknights.it> # Add triggerchallenge endpoint # 2016-10-23 Corneli...
./CrossVul/dataset_final_sorted/CWE-20/py/good_50_6
crossvul-python_data_good_1065_1
# Copyright (C) 2002-2007 Python Software Foundation # Contact: email-sig@python.org """Email address parsing code. Lifted directly from rfc822.py. This should eventually be rewritten. """ __all__ = [ 'mktime_tz', 'parsedate', 'parsedate_tz', 'quote', ] import time, calendar SPACE = ' ' EMPTYS...
./CrossVul/dataset_final_sorted/CWE-20/py/good_1065_1
crossvul-python_data_bad_2141_1
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # # This file is part of Ansible # # Ansible 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 Software Foundation, either version 3 of the License, or # (at your option) an...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2141_1
crossvul-python_data_bad_50_5
# -*- coding: utf-8 -*- # # privacyIDEA documentation build configuration file, created by # sphinx-quickstart on Fri Jun 13 07:31:01 2014. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # #...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_50_5
crossvul-python_data_bad_1656_0
# Copyright (C) 2013, Red Hat, Inc. # All rights reserved. # # 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 limitation the rights # to use, copy, modif...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_1656_0
crossvul-python_data_bad_3767_2
try: from urllib.parse import urlparse, urlunparse except ImportError: # Python 2 from urlparse import urlparse, urlunparse from django.conf import settings from django.core.urlresolvers import reverse from django.http import HttpResponseRedirect, QueryDict from django.template.response import TemplateResp...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_3767_2
crossvul-python_data_good_3660_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compli...
./CrossVul/dataset_final_sorted/CWE-20/py/good_3660_0
crossvul-python_data_bad_2816_0
# -*- coding: utf-8 -*- ''' The crypt module manages all of the cryptography functions for minions and masters, encrypting and decrypting payloads, preparing messages, and authenticating peers ''' # Import python libs from __future__ import absolute_import, print_function import os import sys import copy import time im...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_2816_0
crossvul-python_data_bad_872_1
# -*- test-case-name: twisted.web.test.test_webclient,twisted.web.test.test_agent -*- # Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ HTTP client. """ from __future__ import division, absolute_import import os import collections import warnings try: from urlparse import urlunparse, u...
./CrossVul/dataset_final_sorted/CWE-20/py/bad_872_1
crossvul-python_data_bad_4374_2
""" Systemd service utilities. Contains functions to start, stop & poll systemd services. Probably not very useful outside this spawner. """ import asyncio import shlex async def start_transient_service( unit_name, cmd, args, working_dir, environment_variables=None, properties=None, uid=N...
./CrossVul/dataset_final_sorted/CWE-668/py/bad_4374_2
crossvul-python_data_good_4374_2
""" Systemd service utilities. Contains functions to start, stop & poll systemd services. Probably not very useful outside this spawner. """ import asyncio import os import re import shlex import warnings # light validation of environment variable keys env_pat = re.compile("[A-Za-z_]+") RUN_ROOT = "/run" def ensur...
./CrossVul/dataset_final_sorted/CWE-668/py/good_4374_2
crossvul-python_data_bad_4374_1
from setuptools import setup setup( name='jupyterhub-systemdspawner', version='0.14', description='JupyterHub Spawner using systemd for resource isolation', long_description='See https://github.com/jupyterhub/systemdspawner for more info', url='https://github.com/jupyterhub/systemdspawner', aut...
./CrossVul/dataset_final_sorted/CWE-668/py/bad_4374_1
crossvul-python_data_good_4374_1
from setuptools import setup setup( name='jupyterhub-systemdspawner', version='0.15.0', description='JupyterHub Spawner using systemd for resource isolation', long_description='See https://github.com/jupyterhub/systemdspawner for more info', url='https://github.com/jupyterhub/systemdspawner', a...
./CrossVul/dataset_final_sorted/CWE-668/py/good_4374_1
crossvul-python_data_bad_744_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_744_1
crossvul-python_data_good_3793_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/good_3793_0
crossvul-python_data_bad_3788_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_3788_0
crossvul-python_data_good_3791_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/good_3791_0
crossvul-python_data_good_5024_0
#!/usr/bin/env python # -*- coding: utf-8 -*- """ | This file is part of the web2py Web Framework | Copyrighted by Massimo Di Pierro <mdipierro@cs.depaul.edu> | License: LGPLv3 (http://www.gnu.org/licenses/lgpl.html) Contains the classes for the global used variables: - Request - Response - Session """ from gluon....
./CrossVul/dataset_final_sorted/CWE-255/py/good_5024_0
crossvul-python_data_bad_741_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_741_1
crossvul-python_data_bad_3789_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_3789_0
crossvul-python_data_bad_3793_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_3793_0
crossvul-python_data_bad_5754_0
404: Not Found
./CrossVul/dataset_final_sorted/CWE-255/py/bad_5754_0
crossvul-python_data_bad_3792_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_3792_0
crossvul-python_data_good_742_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/good_742_1
crossvul-python_data_bad_743_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_743_1
crossvul-python_data_good_3789_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/good_3789_0
crossvul-python_data_good_743_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/good_743_1
crossvul-python_data_good_741_1
"""Parse (absolute and relative) URLs. urlparse module is based upon the following RFC specifications. RFC 3986 (STD66): "Uniform Resource Identifiers" by T. Berners-Lee, R. Fielding and L. Masinter, January 2005. RFC 2732 : "Format for Literal IPv6 Addresses in URL's by R.Hinden, B.Carpenter and L.Masinter, Decemb...
./CrossVul/dataset_final_sorted/CWE-255/py/good_741_1
crossvul-python_data_bad_3791_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2012 OpenStack LLC # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requ...
./CrossVul/dataset_final_sorted/CWE-255/py/bad_3791_0