id
stringlengths
28
33
content
stringlengths
14
265k
max_stars_repo_path
stringlengths
49
55
crossvul-python_data_bad_1775_0
import datetime import decimal import unicodedata from importlib import import_module from django.conf import settings from django.utils import dateformat, datetime_safe, numberformat, six from django.utils.encoding import force_str from django.utils.functional import lazy from django.utils.safestring import mark_safe...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_1775_0
crossvul-python_data_good_1574_0
""" Gather information about a system and report it using plugins supplied for application-specific information """ # sosreport.py # gather information about a system and report it # Copyright (C) 2006 Steve Conklin <sconklin@redhat.com> # This program is free software; you can redistribute it and/or modify # it unde...
./CrossVul/dataset_final_sorted/CWE-200/py/good_1574_0
crossvul-python_data_bad_3112_1
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_3112_1
crossvul-python_data_good_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/good_3325_1
crossvul-python_data_bad_1574_0
""" Gather information about a system and report it using plugins supplied for application-specific information """ # sosreport.py # gather information about a system and report it # Copyright (C) 2006 Steve Conklin <sconklin@redhat.com> # This program is free software; you can redistribute it and/or modify # it unde...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_1574_0
crossvul-python_data_good_1725_0
# -*- coding: utf-8 -*- ''' Support for the Git SCM ''' from __future__ import absolute_import # Import python libs import os import re import subprocess # Import salt libs from salt import utils from salt.exceptions import SaltInvocationError, CommandExecutionError from salt.ext.six.moves.urllib.parse import urlpars...
./CrossVul/dataset_final_sorted/CWE-200/py/good_1725_0
crossvul-python_data_bad_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/bad_3807_0
crossvul-python_data_bad_1559_0
import os.path import logging from ceph_deploy import hosts, exc from ceph_deploy.cliutil import priority LOG = logging.getLogger(__name__) def fetch_file(args, frompath, topath, _hosts): if os.path.exists(topath): LOG.debug('Have %s', topath) return True else: for hostname in _host...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_1559_0
crossvul-python_data_good_609_0
import re 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 AnymailInsecureWebhoo...
./CrossVul/dataset_final_sorted/CWE-200/py/good_609_0
crossvul-python_data_good_1775_0
import datetime import decimal import unicodedata from importlib import import_module from django.conf import settings from django.utils import dateformat, datetime_safe, numberformat, six from django.utils.encoding import force_str from django.utils.functional import lazy from django.utils.safestring import mark_safe...
./CrossVul/dataset_final_sorted/CWE-200/py/good_1775_0
crossvul-python_data_bad_2837_2
from __future__ import print_function import argparse import json from oauthlib.oauth2 import LegacyApplicationClient import logging import logging.handlers from requests_oauthlib import OAuth2Session import os import requests import six import sys import traceback from six.moves.urllib.parse import quote as urlquote...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_2837_2
crossvul-python_data_bad_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/bad_5206_0
crossvul-python_data_good_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/good_5542_0
crossvul-python_data_bad_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/bad_5543_0
crossvul-python_data_bad_1725_0
# -*- coding: utf-8 -*- ''' Support for the Git SCM ''' from __future__ import absolute_import # Import python libs import os import subprocess # Import salt libs from salt import utils from salt.exceptions import SaltInvocationError, CommandExecutionError from salt.ext.six.moves.urllib.parse import urlparse as _urlp...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_1725_0
crossvul-python_data_good_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/good_3325_0
crossvul-python_data_bad_609_0
import re 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...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_609_0
crossvul-python_data_good_4954_0
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib import warnings from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import...
./CrossVul/dataset_final_sorted/CWE-200/py/good_4954_0
crossvul-python_data_good_1559_0
import os.path import logging from ceph_deploy import hosts, exc from ceph_deploy.cliutil import priority LOG = logging.getLogger(__name__) def fetch_file(args, frompath, topath, _hosts): if os.path.exists(topath): LOG.debug('Have %s', topath) return True else: for hostname in _host...
./CrossVul/dataset_final_sorted/CWE-200/py/good_1559_0
crossvul-python_data_good_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 graphql_jwt.exceptions import PermissionDenied from ...account.error_codes impor...
./CrossVul/dataset_final_sorted/CWE-200/py/good_4650_1
crossvul-python_data_good_3808_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_3808_0
crossvul-python_data_bad_3808_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/bad_3808_0
crossvul-python_data_bad_4954_0
from __future__ import unicode_literals import base64 import binascii import hashlib import importlib from collections import OrderedDict from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.core.signals import setting_changed from django.dispatch import receiver from d...
./CrossVul/dataset_final_sorted/CWE-200/py/bad_4954_0
crossvul-python_data_good_4177_1
from rest_framework.status import HTTP_400_BAD_REQUEST, HTTP_403_FORBIDDEN 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...
./CrossVul/dataset_final_sorted/CWE-200/py/good_4177_1
crossvul-python_data_good_3112_1
# -*- coding: utf-8 -*- # # Copyright © 2012 - 2016 Michal Čihař <michal@cihar.com> # # This file is part of Weblate <https://weblate.org/> # # 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, eith...
./CrossVul/dataset_final_sorted/CWE-200/py/good_3112_1
crossvul-python_data_bad_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/bad_1559_1
crossvul-python_data_good_2837_2
from __future__ import print_function import argparse import json from oauthlib.oauth2 import LegacyApplicationClient import logging import logging.handlers from requests_oauthlib import OAuth2Session import os import requests import six import sys import traceback from six.moves.urllib.parse import quote as urlquote...
./CrossVul/dataset_final_sorted/CWE-200/py/good_2837_2
crossvul-python_data_good_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/good_4177_0
crossvul-python_data_good_3332_0
# This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2016 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 S...
./CrossVul/dataset_final_sorted/CWE-362/py/good_3332_0
crossvul-python_data_bad_3332_0
# This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2016 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 S...
./CrossVul/dataset_final_sorted/CWE-362/py/bad_3332_0
crossvul-python_data_good_3333_0
# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2013 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...
./CrossVul/dataset_final_sorted/CWE-362/py/good_3333_0
crossvul-python_data_good_3284_0
# (from BackInTime) # Copyright (C) 2015-2017 Germar Reitze # # 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 p...
./CrossVul/dataset_final_sorted/CWE-362/py/good_3284_0
crossvul-python_data_bad_3284_0
# (from BackInTime) # Copyright (C) 2015-2017 Germar Reitze # # 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 p...
./CrossVul/dataset_final_sorted/CWE-362/py/bad_3284_0
crossvul-python_data_bad_3333_0
# -*- coding: utf-8 -*- # # This file is part of Radicale Server - Calendar Server # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2013 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...
./CrossVul/dataset_final_sorted/CWE-362/py/bad_3333_0
crossvul-python_data_bad_487_2
from k5test import * realm = K5Realm(create_host=False, get_creds=False) usercache = 'FILE:' + os.path.join(realm.testdir, 'usercache') storagecache = 'FILE:' + os.path.join(realm.testdir, 'save') # Create two service principals with keys in the default keytab. service1 = 'service/1@%s' % realm.realm realm.addprinc(s...
./CrossVul/dataset_final_sorted/CWE-617/py/bad_487_2
crossvul-python_data_good_487_2
from k5test import * realm = K5Realm(create_host=False, get_creds=False) usercache = 'FILE:' + os.path.join(realm.testdir, 'usercache') storagecache = 'FILE:' + os.path.join(realm.testdir, 'save') # Create two service principals with keys in the default keytab. service1 = 'service/1@%s' % realm.realm realm.addprinc(s...
./CrossVul/dataset_final_sorted/CWE-617/py/good_487_2
crossvul-python_data_good_5563_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-330/py/good_5563_1
crossvul-python_data_bad_5563_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-330/py/bad_5563_1
crossvul-python_data_good_18_0
from django.apps import AppConfig from django.core import checks from .checks import check_deprecated_settings class AnymailBaseConfig(AppConfig): name = 'anymail' verbose_name = "Anymail" def ready(self): checks.register(check_deprecated_settings)
./CrossVul/dataset_final_sorted/CWE-532/py/good_18_0
crossvul-python_data_bad_18_1
404: Not Found
./CrossVul/dataset_final_sorted/CWE-532/py/bad_18_1
crossvul-python_data_good_18_2
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-532/py/good_18_2
crossvul-python_data_bad_3972_0
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
./CrossVul/dataset_final_sorted/CWE-532/py/bad_3972_0
crossvul-python_data_bad_18_2
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-532/py/bad_18_2
crossvul-python_data_bad_18_0
from django.apps import AppConfig class AnymailBaseConfig(AppConfig): name = 'anymail' verbose_name = "Anymail" def ready(self): pass
./CrossVul/dataset_final_sorted/CWE-532/py/bad_18_0
crossvul-python_data_good_18_13
import base64 from django.test import override_settings, SimpleTestCase from mock import create_autospec, ANY from anymail.exceptions import AnymailInsecureWebhookWarning from anymail.signals import tracking, inbound from .utils import AnymailTestMixin, ClientWithCsrfChecks def event_handler(sender, event, esp_nam...
./CrossVul/dataset_final_sorted/CWE-532/py/good_18_13
crossvul-python_data_good_18_1
from django.conf import settings from django.core import checks def check_deprecated_settings(app_configs, **kwargs): errors = [] anymail_settings = getattr(settings, "ANYMAIL", {}) # anymail.W001: rename WEBHOOK_AUTHORIZATION to WEBHOOK_SECRET if "WEBHOOK_AUTHORIZATION" in anymail_settings: ...
./CrossVul/dataset_final_sorted/CWE-532/py/good_18_1
crossvul-python_data_good_3972_0
# Copyright 2015 Canonical, Ltd. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # published by the Free Software Foundation, either version 3 of the # License, or (at your option) any later version. # # This program is distribute...
./CrossVul/dataset_final_sorted/CWE-532/py/good_3972_0
crossvul-python_data_bad_18_13
import base64 from django.test import override_settings, SimpleTestCase from mock import create_autospec, ANY from anymail.exceptions import AnymailInsecureWebhookWarning from anymail.signals import tracking, inbound from .utils import AnymailTestMixin, ClientWithCsrfChecks def event_handler(sender, event, esp_nam...
./CrossVul/dataset_final_sorted/CWE-532/py/bad_18_13
crossvul-python_data_bad_3250_4
# Copyright 2014 Netflix, Inc. # # 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 applicable law...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_3250_4
crossvul-python_data_bad_1915_12
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2017 New Vector 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....
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_12
crossvul-python_data_good_1915_5
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2018 New Vector Ltd # Copyright 2019 Matrix.org Federation C.I.C # # 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 # # ...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_5
crossvul-python_data_bad_753_0
"""Tornado handlers for logging into the notebook.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os try: from urllib.parse import urlparse # Py 3 except ImportError: from urlparse import urlparse # Py 2 import uuid from tornado.escap...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_753_0
crossvul-python_data_good_1915_2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # Copyright 2020 The Matrix.org Foundation C.I.C. # # 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://...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_2
crossvul-python_data_good_2548_0
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2012 Red Hat, Inc. # Copyright (C) 2008 Ricky Zhou # This file is part of python-fedora # # python-fedora 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;...
./CrossVul/dataset_final_sorted/CWE-601/py/good_2548_0
crossvul-python_data_bad_1915_4
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017, 2018 New Vector 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-601/py/bad_1915_4
crossvul-python_data_good_1315_1
# -*- coding: utf-8 -*- # See https://zulip.readthedocs.io/en/latest/subsystems/thumbnailing.html import base64 import os import sys import urllib from urllib.parse import urljoin, urlsplit, urlunsplit from django.conf import settings from libthumbor import CryptoURL ZULIP_PATH = os.path.dirname(os.path.dirname(os.pat...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1315_1
crossvul-python_data_good_1915_7
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017-2018 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_7
crossvul-python_data_bad_1315_1
# -*- coding: utf-8 -*- # See https://zulip.readthedocs.io/en/latest/subsystems/thumbnailing.html import base64 import os import sys import urllib from django.conf import settings from libthumbor import CryptoURL ZULIP_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath('__file__')))) sys.path.appen...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1315_1
crossvul-python_data_good_4386_0
"""Tornado handlers for logging into the Jupyter Server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os import uuid from urllib.parse import urlparse from tornado.escape import url_escape from .security import passwd_check, set_password ...
./CrossVul/dataset_final_sorted/CWE-601/py/good_4386_0
crossvul-python_data_good_3250_2
# Copyright 2014 Netflix, Inc. # # 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 applicable law...
./CrossVul/dataset_final_sorted/CWE-601/py/good_3250_2
crossvul-python_data_good_1915_10
# -*- coding: utf-8 -*- # Copyright 2019 New Vector 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 applicable la...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_10
crossvul-python_data_good_1915_6
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_6
crossvul-python_data_bad_1915_6
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_6
crossvul-python_data_bad_1315_0
# Zulip's main markdown implementation. See docs/subsystems/markdown.md for # detailed documentation on our markdown syntax. from typing import (Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple, TypeVar, Union, cast) from mypy_extensions import TypedDict from typing.re import M...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1315_0
crossvul-python_data_bad_1915_10
# -*- coding: utf-8 -*- # Copyright 2019 New Vector 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 applicable la...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_10
crossvul-python_data_good_1915_13
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_13
crossvul-python_data_bad_1915_13
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_13
crossvul-python_data_good_1915_9
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_9
crossvul-python_data_bad_1731_1
#!/bin/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) Auth, Mail, PluginManager and various utilities ------------------------------------------------ """ import ...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1731_1
crossvul-python_data_good_1915_11
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_11
crossvul-python_data_good_1915_12
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2017 New Vector 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....
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_12
crossvul-python_data_bad_3250_1
""" .. module: security_monkey.sso.views :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Patrick Kelley <patrick@netflix.com> """ import jwt import base64 import requests from flask import Blueprint, current_app, r...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_3250_1
crossvul-python_data_bad_3250_2
# Copyright 2014 Netflix, Inc. # # 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 applicable law...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_3250_2
crossvul-python_data_good_3250_0
import itertools from flask import request, abort, _app_ctx_stack, redirect from flask_security.core import AnonymousUser from security_monkey.datastore import User try: from flask.ext.login import current_user except ImportError: current_user = None from .models import RBACRole, RBACUserMixin from . import...
./CrossVul/dataset_final_sorted/CWE-601/py/good_3250_0
crossvul-python_data_good_752_0
"""Tornado handlers for logging into the notebook.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os try: from urllib.parse import urlparse # Py 3 except ImportError: from urlparse import urlparse # Py 2 import uuid from tornado.escap...
./CrossVul/dataset_final_sorted/CWE-601/py/good_752_0
crossvul-python_data_good_753_0
"""Tornado handlers for logging into the notebook.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os try: from urllib.parse import urlparse # Py 3 except ImportError: from urlparse import urlparse # Py 2 import uuid from tornado.escap...
./CrossVul/dataset_final_sorted/CWE-601/py/good_753_0
crossvul-python_data_bad_1915_5
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2018 New Vector Ltd # Copyright 2019 Matrix.org Federation C.I.C # # 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 # # ...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_5
crossvul-python_data_good_1915_4
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017, 2018 New Vector 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-601/py/good_1915_4
crossvul-python_data_bad_1915_7
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2017-2018 New Vector Ltd # Copyright 2019 The Matrix.org Foundation C.I.C. # # 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 Licens...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_7
crossvul-python_data_bad_4351_0
"""Base Tornado handlers for the Jupyter server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from http...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_4351_0
crossvul-python_data_good_3250_3
# Copyright 2014 Netflix, Inc. # # 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 applicable law...
./CrossVul/dataset_final_sorted/CWE-601/py/good_3250_3
crossvul-python_data_good_3250_4
# Copyright 2014 Netflix, Inc. # # 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 applicable law...
./CrossVul/dataset_final_sorted/CWE-601/py/good_3250_4
crossvul-python_data_good_4332_1
"""Base Tornado handlers for the notebook server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from htt...
./CrossVul/dataset_final_sorted/CWE-601/py/good_4332_1
crossvul-python_data_bad_3250_0
import itertools from flask import request, abort, _app_ctx_stack, redirect from flask_security.core import AnonymousUser from security_monkey.datastore import User try: from flask.ext.login import current_user except ImportError: current_user = None from .models import RBACRole, RBACUserMixin from . import...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_3250_0
crossvul-python_data_bad_2548_0
# -*- coding: utf-8 -*- # # Copyright (C) 2008-2012 Red Hat, Inc. # Copyright (C) 2008 Ricky Zhou # This file is part of python-fedora # # python-fedora 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;...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_2548_0
crossvul-python_data_good_1953_1
import re import warnings from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar from .web_exceptions import HTTPMove, HTTPPermanentRedirect from .web_request import Request from .web_response import StreamResponse from .web_urldispatcher import SystemRoute __all__ = ( "middleware", "norm...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1953_1
crossvul-python_data_bad_1915_8
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2017 Vector Creations Ltd # Copyright 2018 New Vector 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 # # htt...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_8
crossvul-python_data_bad_752_0
"""Tornado handlers for logging into the notebook.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os try: from urllib.parse import urlparse # Py 3 except ImportError: from urlparse import urlparse # Py 2 import uuid from tornado.escap...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_752_0
crossvul-python_data_bad_1915_2
#!/usr/bin/env python # -*- coding: utf-8 -*- # Copyright 2016 OpenMarket Ltd # Copyright 2020 The Matrix.org Foundation C.I.C. # # 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://...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_2
crossvul-python_data_bad_1953_1
import re import warnings from typing import TYPE_CHECKING, Awaitable, Callable, Tuple, Type, TypeVar from .web_exceptions import HTTPMove, HTTPPermanentRedirect from .web_request import Request from .web_response import StreamResponse from .web_urldispatcher import SystemRoute __all__ = ( "middleware", "norm...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1953_1
crossvul-python_data_bad_4386_0
"""Tornado handlers for logging into the Jupyter Server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import re import os import uuid from urllib.parse import urlparse from tornado.escape import url_escape from .security import passwd_check, set_password ...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_4386_0
crossvul-python_data_bad_1915_9
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_9
crossvul-python_data_good_3250_1
""" .. module: security_monkey.sso.views :platform: Unix :copyright: (c) 2015 by Netflix Inc., see AUTHORS for more :license: Apache, see LICENSE for more details. .. moduleauthor:: Patrick Kelley <patrick@netflix.com> """ import jwt import base64 import requests from flask import Blueprint, current_app, r...
./CrossVul/dataset_final_sorted/CWE-601/py/good_3250_1
crossvul-python_data_bad_4332_1
"""Base Tornado handlers for the notebook server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from htt...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_4332_1
crossvul-python_data_good_4351_0
"""Base Tornado handlers for the Jupyter server.""" # Copyright (c) Jupyter Development Team. # Distributed under the terms of the Modified BSD License. import datetime import functools import ipaddress import json import mimetypes import os import re import sys import traceback import types import warnings from http...
./CrossVul/dataset_final_sorted/CWE-601/py/good_4351_0
crossvul-python_data_good_1731_1
#!/bin/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) Auth, Mail, PluginManager and various utilities ------------------------------------------------ """ import ...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1731_1
crossvul-python_data_good_1915_3
# -*- coding: utf-8 -*- # Copyright 2020 The Matrix.org Foundation C.I.C. # # 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 require...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_3
crossvul-python_data_bad_1915_11
# -*- coding: utf-8 -*- # Copyright 2014-2016 OpenMarket Ltd # Copyright 2018 New Vector 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...
./CrossVul/dataset_final_sorted/CWE-601/py/bad_1915_11
crossvul-python_data_good_1915_8
# -*- coding: utf-8 -*- # Copyright 2015, 2016 OpenMarket Ltd # Copyright 2017 Vector Creations Ltd # Copyright 2018 New Vector 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 # # htt...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1915_8
crossvul-python_data_good_1315_0
# Zulip's main markdown implementation. See docs/subsystems/markdown.md for # detailed documentation on our markdown syntax. from typing import (Any, Callable, Dict, Iterable, List, NamedTuple, Optional, Set, Tuple, TypeVar, Union, cast) from mypy_extensions import TypedDict from typing.re import M...
./CrossVul/dataset_final_sorted/CWE-601/py/good_1315_0