id
stringlengths
28
33
content
stringlengths
14
265k
max_stars_repo_path
stringlengths
49
55
crossvul-python_data_good_1622_2
from configparser import RawConfigParser from attic.remote import cache_if_remote import msgpack import os import sys from binascii import hexlify import shutil from .key import PlaintextKey from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify, UpgradableLock, int_to_bigint, \ bigint_to_i...
./CrossVul/dataset_final_sorted/CWE-264/py/good_1622_2
crossvul-python_data_bad_3772_3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_3772_3
crossvul-python_data_bad_3690_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-264/py/bad_3690_0
crossvul-python_data_bad_3634_2
# 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-264/py/bad_3634_2
crossvul-python_data_bad_3771_1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_3771_1
crossvul-python_data_bad_5539_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. # Copyright 2011 Piston Cloud Computing, Inc. # Copyright 2012 Red Hat, Inc. # All Rights Reserved. # # Licensed under the Apache License,...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_5539_0
crossvul-python_data_good_3773_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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/...
./CrossVul/dataset_final_sorted/CWE-264/py/good_3773_0
crossvul-python_data_good_3632_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-264/py/good_3632_0
crossvul-python_data_bad_3773_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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/...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_3773_0
crossvul-python_data_good_2042_1
from collections import OrderedDict import copy import operator from functools import partial, reduce, update_wrapper import warnings from django import forms from django.conf import settings from django.contrib import messages from django.contrib.admin import widgets, helpers from django.contrib.admin import validati...
./CrossVul/dataset_final_sorted/CWE-264/py/good_2042_1
crossvul-python_data_good_3634_4
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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 (t...
./CrossVul/dataset_final_sorted/CWE-264/py/good_3634_4
crossvul-python_data_bad_3694_1
# 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-264/py/bad_3694_1
crossvul-python_data_bad_2014_1
# -*- coding: utf-8 -*- """ jinja2.bccache ~~~~~~~~~~~~~~ This module implements the bytecode cache system Jinja is optionally using. This is useful if you have very complex template situations and the compiliation of all those templates slow down your application too much. Situations whe...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_2014_1
crossvul-python_data_good_3693_1
# 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-264/py/good_3693_1
crossvul-python_data_bad_3725_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-264/py/bad_3725_0
crossvul-python_data_bad_3692_1
# 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-264/py/bad_3692_1
crossvul-python_data_good_3565_0
import json import webob from xml.dom import minidom from xml.parsers import expat import faults from nova import exception from nova import log as logging from nova import utils from nova import wsgi XMLNS_V10 = 'http://docs.rackspacecloud.com/servers/api/v1.0' XMLNS_V11 = 'http://docs.openstack.org/compute/api/v1...
./CrossVul/dataset_final_sorted/CWE-264/py/good_3565_0
crossvul-python_data_bad_1622_2
from configparser import RawConfigParser from attic.remote import cache_if_remote import msgpack import os from binascii import hexlify import shutil from .helpers import Error, get_cache_dir, decode_dict, st_mtime_ns, unhexlify, UpgradableLock, int_to_bigint, \ bigint_to_int from .hashindex import ChunkIndex cl...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_1622_2
crossvul-python_data_good_3634_1
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 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/...
./CrossVul/dataset_final_sorted/CWE-264/py/good_3634_1
crossvul-python_data_bad_3771_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010 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/...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_3771_0
crossvul-python_data_bad_3634_3
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2011 X.commerce, a business unit of eBay Inc. # 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 (t...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_3634_3
crossvul-python_data_bad_3695_1
# 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-264/py/bad_3695_1
crossvul-python_data_bad_2042_2
from collections import OrderedDict import sys import warnings from django.core.exceptions import SuspiciousOperation, ImproperlyConfigured from django.core.paginator import InvalidPage from django.core.urlresolvers import reverse from django.db import models from django.db.models.fields import FieldDoesNotExist from ...
./CrossVul/dataset_final_sorted/CWE-264/py/bad_2042_2
crossvul-python_data_good_3694_1
# 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-264/py/good_3694_1
crossvul-python_data_good_1123_0
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1123_0
crossvul-python_data_good_1119_0
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1119_0
crossvul-python_data_bad_1120_2
############################################################################## # # Copyright (c) 2006 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1120_2
crossvul-python_data_bad_1119_1
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1119_1
crossvul-python_data_bad_1121_2
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1121_2
crossvul-python_data_good_1119_1
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1119_1
crossvul-python_data_bad_1121_3
404: Not Found
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1121_3
crossvul-python_data_good_1121_3
""" This contains a bunch of RFC7230 definitions and regular expressions that are needed to properly parse HTTP messages. """ import re from .compat import tobytes WS = "[ \t]" OWS = WS + "{0,}?" RWS = WS + "{1,}?" BWS = OWS # RFC 7230 Section 3.2.6 "Field Value Components": # tchar = "!" / "#" / "$" / "%"...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1121_3
crossvul-python_data_good_1121_5
############################################################################## # # Copyright (c) 2004 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1121_5
crossvul-python_data_bad_1121_1
############################################################################## # # Copyright (c) 2006 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1121_1
crossvul-python_data_good_1120_2
############################################################################## # # Copyright (c) 2006 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1120_2
crossvul-python_data_bad_1119_0
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1119_0
crossvul-python_data_good_1121_1
############################################################################## # # Copyright (c) 2006 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1121_1
crossvul-python_data_good_1121_2
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/good_1121_2
crossvul-python_data_bad_1121_5
############################################################################## # # Copyright (c) 2004 Zope Foundation 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 SOF...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1121_5
crossvul-python_data_bad_1123_0
############################################################################## # # Copyright (c) 2001, 2002 Zope Foundation 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. # TH...
./CrossVul/dataset_final_sorted/CWE-444/py/bad_1123_0
crossvul-python_data_bad_5077_2
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com # Copyright (C) 2007-2010 Red Hat, Inc. # # This program 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 2 of t...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5077_2
crossvul-python_data_bad_5076_0
#!/usr/bin/python import dbus import dbus.service import dbus.mainloop.glib import gobject import slip.dbus.service from slip.dbus import polkit import os class RunFix(slip.dbus.service.Object): default_polkit_auth_required = "org.fedoraproject.setroubleshootfixit.write" def __init__ (self, *p, **k): s...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5076_0
crossvul-python_data_good_5077_2
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com # Copyright (C) 2007-2010 Red Hat, Inc. # # This program 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 2 of t...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5077_2
crossvul-python_data_bad_5860_0
# -*- coding: utf-8 -*- #Canto-curses - ncurses RSS reader # Copyright (C) 2014 Jack Miller <jack@codezen.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. from canto_ne...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5860_0
crossvul-python_data_good_5044_0
# # Copyright (C) 2006-2010 Red Hat, Inc. # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distribu...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5044_0
crossvul-python_data_bad_5077_3
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com> # Dan Walsh <dwalsh@redhat.com> # # Copyright (C) 2006-2010 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5077_3
crossvul-python_data_good_5043_1
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com> # Dan Walsh <dwalsh@redhat.com> # # Copyright (C) 2006-2010 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5043_1
crossvul-python_data_bad_5044_0
# # Copyright (C) 2006-2010 Red Hat, Inc. # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distribu...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5044_0
crossvul-python_data_good_5076_0
#!/usr/bin/python import dbus import dbus.service import dbus.mainloop.glib import gobject import slip.dbus.service from slip.dbus import polkit import os class RunFix(slip.dbus.service.Object): default_polkit_auth_required = "org.fedoraproject.setroubleshootfixit.write" def __init__ (self, *p, **k): s...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5076_0
crossvul-python_data_good_5077_3
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com> # Dan Walsh <dwalsh@redhat.com> # # Copyright (C) 2006-2010 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5077_3
crossvul-python_data_bad_5043_1
# Authors: John Dennis <jdennis@redhat.com> # Thomas Liu <tliu@redhat.com> # Dan Walsh <dwalsh@redhat.com> # # Copyright (C) 2006-2010 Red Hat, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Fre...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5043_1
crossvul-python_data_bad_5042_0
# # Copyright (C) 2006-2011 Red Hat, Inc. # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distribu...
./CrossVul/dataset_final_sorted/CWE-77/py/bad_5042_0
crossvul-python_data_good_5860_0
# -*- coding: utf-8 -*- #Canto-curses - ncurses RSS reader # Copyright (C) 2014 Jack Miller <jack@codezen.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 as # published by the Free Software Foundation. from canto_ne...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5860_0
crossvul-python_data_good_5042_0
# # Copyright (C) 2006-2011 Red Hat, Inc. # # This program 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 2 of the License, or # (at your option) any later version. # # This program is distribu...
./CrossVul/dataset_final_sorted/CWE-77/py/good_5042_0
crossvul-python_data_good_3373_0
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import re REG_LINE_GPERF = re.compile('#line .+gperf"') REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\s*\)') REG_STR_AT = re.compile('str\[(\d+)\]') REG_UNFOLD_KEY = re.compile('unicode_unfold_key\s*\(reg...
./CrossVul/dataset_final_sorted/CWE-787/py/good_3373_0
crossvul-python_data_bad_3373_0
#!/usr/bin/python # -*- coding: utf-8 -*- import sys import re REG_LINE_GPERF = re.compile('#line .+gperf"') REG_HASH_FUNC = re.compile('hash\s*\(register\s+const\s+char\s*\*\s*str,\s*register\s+unsigned\s+int\s+len\s*\)') REG_STR_AT = re.compile('str\[(\d+)\]') REG_UNFOLD_KEY = re.compile('unicode_unfold_key\s*\(reg...
./CrossVul/dataset_final_sorted/CWE-787/py/bad_3373_0
crossvul-python_data_bad_765_6
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import login as django_login from django.contrib.auth import logout as django_logout from django.core.exceptions import ObjectDoesNotExist from django.utils.decorators import method_decorator from django.utils.translation import ugettext_...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_6
crossvul-python_data_bad_765_7
from django.db import models try: from django.contrib.auth.models import AbstractUser except ImportError: from django.db.models import Model as AbstractUser class CustomUser(AbstractUser): extra_field = models.CharField(max_length=2) new_username_field = models.CharField('userid', unique=True, max_le...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_7
crossvul-python_data_good_765_8
# -*- coding: utf8 -*- import os import django DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': os.environ.get('DB_NAME', ':memory:'), } } AUTH_USER_MODEL = 'tests.CustomUser' NOPASSWORD_LOGIN_CODE_TIMEOUT = 900 INSTALLED_APPS = [ 'django.contrib....
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_8
crossvul-python_data_bad_765_3
# -*- coding: utf-8 -*- from django import forms from django.contrib.auth import authenticate, get_backends, get_user_model from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured from django.shortcuts import resolve_url from django.utils.translation import ug...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_3
crossvul-python_data_bad_765_4
404: Not Found
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_4
crossvul-python_data_bad_765_8
# -*- coding: utf8 -*- import django DEBUG = False DATABASES = { 'default': { 'ENGINE': 'django.db.backends.sqlite3', 'NAME': ':memory:', } } AUTH_USER_MODEL = 'tests.CustomUser' NOPASSWORD_LOGIN_CODE_TIMEOUT = 900 INSTALLED_APPS = [ 'django.contrib.admin', 'django.contrib.auth', ...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_8
crossvul-python_data_good_765_4
# Generated by Django 2.2 on 2019-04-06 13:22 import uuid from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('nopassword', '0001_initial'), ] operations = [ migrations.RemoveField( model_name='logincode', name='code'...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_4
crossvul-python_data_good_765_2
# -*- coding: utf-8 -*- from datetime import timedelta from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.utils import timezone from nopassword.models import LoginCode class NoPasswordBackend(ModelBackend): def authe...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_2
crossvul-python_data_bad_765_1
404: Not Found
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_1
crossvul-python_data_good_765_1
#!/usr/bin/env python import os import sys if __name__ == "__main__": os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings") from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_1
crossvul-python_data_bad_407_0
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from datetime import timedelta from .auth import _basic_auth_str from .compat import cookielib, is_py3, Ord...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_407_0
crossvul-python_data_bad_765_5
# -*- coding: utf-8 -*- import hashlib import os from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ class LoginCode(models.Model): user = models.ForeignKey(settings.AUTH_USER_MODEL, related_name='login_codes', ...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_5
crossvul-python_data_good_765_7
from django.db import models try: from django.contrib.auth.models import AbstractUser, UserManager except ImportError: from django.db.models import Model as AbstractUser class CustomUser(AbstractUser): extra_field = models.CharField(max_length=2) new_username_field = models.CharField('userid', unique...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_7
crossvul-python_data_good_407_0
# -*- coding: utf-8 -*- """ requests.session ~~~~~~~~~~~~~~~~ This module provides a Session object to manage and persist settings across requests (cookies, auth, proxies). """ import os import sys import time from datetime import timedelta from .auth import _basic_auth_str from .compat import cookielib, is_py3, Ord...
./CrossVul/dataset_final_sorted/CWE-522/py/good_407_0
crossvul-python_data_bad_765_2
# -*- coding: utf-8 -*- from datetime import timedelta from django.conf import settings from django.contrib.auth import get_user_model from django.contrib.auth.backends import ModelBackend from django.utils import timezone from nopassword.models import LoginCode class NoPasswordBackend(ModelBackend): def authe...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_765_2
crossvul-python_data_good_765_3
# -*- coding: utf-8 -*- from django import forms from django.contrib.auth import authenticate, get_backends, get_user_model from django.contrib.sites.shortcuts import get_current_site from django.core.exceptions import ImproperlyConfigured from django.shortcuts import resolve_url from django.utils.translation import ug...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_3
crossvul-python_data_good_765_5
# -*- coding: utf-8 -*- import hashlib import uuid from django.conf import settings from django.db import models from django.utils import timezone from django.utils.translation import ugettext_lazy as _ class LoginCode(models.Model): id = models.UUIDField(primary_key=True, default=uuid.uuid4, editable=False) ...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_5
crossvul-python_data_bad_1110_0
from functools import partial import django_otp from django.conf import settings from django.contrib.auth.views import redirect_to_login from django.urls import NoReverseMatch, reverse from django.utils.functional import SimpleLazyObject from django_otp.middleware import OTPMiddleware as _OTPMiddleware class VerifyU...
./CrossVul/dataset_final_sorted/CWE-522/py/bad_1110_0
crossvul-python_data_good_1110_0
from functools import partial import django_otp from django.conf import settings from django.contrib.auth.views import redirect_to_login from django.urls import NoReverseMatch, reverse from django.utils.functional import SimpleLazyObject from django_otp.middleware import OTPMiddleware as _OTPMiddleware class VerifyU...
./CrossVul/dataset_final_sorted/CWE-522/py/good_1110_0
crossvul-python_data_good_765_6
# -*- coding: utf-8 -*- from django.conf import settings from django.contrib.auth import login as django_login from django.contrib.auth import logout as django_logout from django.core.exceptions import ObjectDoesNotExist from django.utils.decorators import method_decorator from django.utils.translation import ugettext_...
./CrossVul/dataset_final_sorted/CWE-522/py/good_765_6
crossvul-python_data_bad_3871_0
404: Not Found
./CrossVul/dataset_final_sorted/CWE-120/py/bad_3871_0
crossvul-python_data_good_3871_0
#!/usr/bin/env python # Reproductions/tests for crashes/read errors in TiffDecode.c # When run in python, all of these images should fail for # one reason or another, either as a buffer overrun, # unrecognized datastream, or truncated image file. # There shouldn't be any segfaults. # # if run like # `valgrind --tool=...
./CrossVul/dataset_final_sorted/CWE-120/py/good_3871_0
crossvul-python_data_good_4296_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 ( ...
./CrossVul/dataset_final_sorted/CWE-385/py/good_4296_2
crossvul-python_data_bad_4296_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 ( ...
./CrossVul/dataset_final_sorted/CWE-385/py/bad_4296_2
crossvul-python_data_bad_4650_1
from typing import List, Optional, Tuple import graphene from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.db import transaction from django.db.models import Prefetch from ...account.error_codes import AccountErrorCode from ...checkout import models fr...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_4650_1
crossvul-python_data_bad_5541_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_5541_0
crossvul-python_data_bad_3325_0
# -*- coding: utf-8 -*- ''' Classes that manage file clients ''' from __future__ import absolute_import # Import python libs import contextlib import errno import logging import os import string import shutil import ftplib from tornado.httputil import parse_response_start_line, HTTPInputError # Import salt libs from ...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_3325_0
crossvul-python_data_good_3325_2
# -*- coding: utf-8 -*- ''' Manage information about regular files, directories, and special files on the minion, set/read user, group, mode, and data ''' # TODO: We should add the capability to do u+r type operations here # some time in the future from __future__ import absolute_import, print_function # Import pyth...
./CrossVul/dataset_final_sorted/CWE-200/py/good_3325_2
crossvul-python_data_good_3325_3
# -*- coding: utf-8 -*- ''' Operations on regular files, special files, directories, and symlinks ===================================================================== Salt States can aggressively manipulate files on a system. There are a number of ways in which files can be managed. Regular files can be enforced wit...
./CrossVul/dataset_final_sorted/CWE-200/py/good_3325_3
crossvul-python_data_good_5206_0
# Copyright (C) 2016 JWCrypto Project Contributors - see LICENSE file import abc import os import struct from binascii import hexlify, unhexlify from cryptography.exceptions import InvalidSignature from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import constant_time, hashe...
./CrossVul/dataset_final_sorted/CWE-200/py/good_5206_0
crossvul-python_data_bad_5542_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_5542_0
crossvul-python_data_good_5541_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-200/py/good_5541_0
crossvul-python_data_good_5543_0
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2010-2011 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...
./CrossVul/dataset_final_sorted/CWE-200/py/good_5543_0
crossvul-python_data_bad_4177_0
import time from pydoc import locate from django.conf import settings DEFAULT_CONFIG = { 'config_version': 4, 'flag_prefix': 'ractf', 'graph_members': 10, 'register_end_time': -1, 'end_time': time.time() + 7 * 24 * 60 * 60, 'start_time': time.time(), 'register_start_time': time.time(), ...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_4177_0
crossvul-python_data_good_3807_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. # Copyright (c) 2010 Citrix Systems, Inc. # Copyright (c) 2011 Piston Cloud Computing, Inc # Copyrig...
./CrossVul/dataset_final_sorted/CWE-200/py/good_3807_0
crossvul-python_data_good_5622_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-200/py/good_5622_0
crossvul-python_data_bad_3325_2
# -*- coding: utf-8 -*- ''' Manage information about regular files, directories, and special files on the minion, set/read user, group, mode, and data ''' # TODO: We should add the capability to do u+r type operations here # some time in the future from __future__ import absolute_import, print_function # Import pyth...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_3325_2
crossvul-python_data_good_610_0
import warnings import six from django.http import HttpResponse from django.utils.crypto import constant_time_compare from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic import View from ..exceptions import AnymailInsecureWebhookWarning, ...
./CrossVul/dataset_final_sorted/CWE-200/py/good_610_0
crossvul-python_data_bad_610_0
import warnings import six from django.http import HttpResponse from django.utils.decorators import method_decorator from django.views.decorators.csrf import csrf_exempt from django.views.generic import View from ..exceptions import AnymailInsecureWebhookWarning, AnymailWebhookValidationFailure from ..utils import ge...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_610_0
crossvul-python_data_bad_3325_1
# -*- coding: utf-8 -*- ''' Minion side functions for salt-cp ''' # Import python libs from __future__ import absolute_import import os import logging import fnmatch # Import salt libs import salt.minion import salt.fileclient import salt.utils import salt.utils.url import salt.crypt import salt.transport from salt.e...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_3325_1
crossvul-python_data_good_1559_1
import errno import logging import os import uuid import struct import time import base64 import socket from ceph_deploy.cliutil import priority from ceph_deploy import conf, hosts, exc from ceph_deploy.util import arg_validators, ssh, net from ceph_deploy.misc import mon_hosts from ceph_deploy.lib import remoto from ...
./CrossVul/dataset_final_sorted/CWE-200/py/good_1559_1
crossvul-python_data_bad_4177_1
from rest_framework.status import HTTP_400_BAD_REQUEST from rest_framework.views import APIView from backend.response import FormattedResponse from config import config from backend.permissions import AdminOrAnonymousReadOnly class ConfigView(APIView): throttle_scope = "config" permission_classes = (AdminOrA...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_4177_1
crossvul-python_data_bad_5622_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-200/py/bad_5622_0
crossvul-python_data_bad_3325_3
# -*- coding: utf-8 -*- ''' Operations on regular files, special files, directories, and symlinks ===================================================================== Salt States can aggressively manipulate files on a system. There are a number of ways in which files can be managed. Regular files can be enforced wit...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_3325_3